/* ReactionsRow.c generated by valac 0.56.19, the Vala compiler
 * generated from ReactionsRow.vala, do not modify */

#include <adwaita.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <libsoup/soup.h>
#include <glib/gi18n-lib.h>
#include <json-glib/json-glib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_WIDGETS_TYPE_REACTIONS_ROW (tuba_widgets_reactions_row_get_type ())
#define TUBA_WIDGETS_REACTIONS_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow))
#define TUBA_WIDGETS_REACTIONS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRowClass))
#define TUBA_WIDGETS_IS_REACTIONS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW))
#define TUBA_WIDGETS_IS_REACTIONS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_REACTIONS_ROW))
#define TUBA_WIDGETS_REACTIONS_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRowClass))

typedef struct _TubaWidgetsReactionsRow TubaWidgetsReactionsRow;
typedef struct _TubaWidgetsReactionsRowClass TubaWidgetsReactionsRowClass;
typedef struct _TubaWidgetsReactionsRowPrivate TubaWidgetsReactionsRowPrivate;

#define TUBA_WIDGETS_TYPE_REACT_BUTTON (tuba_widgets_react_button_get_type ())
#define TUBA_WIDGETS_REACT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton))
#define TUBA_WIDGETS_REACT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButtonClass))
#define TUBA_WIDGETS_IS_REACT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_REACT_BUTTON))
#define TUBA_WIDGETS_IS_REACT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_REACT_BUTTON))
#define TUBA_WIDGETS_REACT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButtonClass))

typedef struct _TubaWidgetsReactButton TubaWidgetsReactButton;
typedef struct _TubaWidgetsReactButtonClass TubaWidgetsReactButtonClass;
enum  {
	TUBA_WIDGETS_REACTIONS_ROW_0_PROPERTY,
	TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY,
	TUBA_WIDGETS_REACTIONS_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_reactions_row_properties[TUBA_WIDGETS_REACTIONS_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block113Data Block113Data;

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;

#define TUBA_API_TYPE_INSTANCE (tuba_api_instance_get_type ())
#define TUBA_API_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstance))
#define TUBA_API_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))
#define TUBA_API_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_IS_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))

typedef struct _TubaAPIInstance TubaAPIInstance;
typedef struct _TubaAPIInstanceClass TubaAPIInstanceClass;

#define TUBA_API_TYPE_EMOJI_REACTION (tuba_api_emoji_reaction_get_type ())
#define TUBA_API_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReaction))
#define TUBA_API_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))
#define TUBA_API_IS_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_IS_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_EMOJI_REACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))

typedef struct _TubaAPIEmojiReaction TubaAPIEmojiReaction;
typedef struct _TubaAPIEmojiReactionClass TubaAPIEmojiReactionClass;
typedef struct _Block114Data Block114Data;

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaWidgetsReactionsRowOnReactionToggledRealData TubaWidgetsReactionsRowOnReactionToggledRealData;

#define TUBA_TYPE_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;

#define TUBA_API_TYPE_STATUS (tuba_api_status_get_type ())
#define TUBA_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatus))
#define TUBA_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))
#define TUBA_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_STATUS))
#define TUBA_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_STATUS))
#define TUBA_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))

typedef struct _TubaAPIStatus TubaAPIStatus;
typedef struct _TubaAPIStatusClass TubaAPIStatusClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef struct _TubaWidgetsReactionsRowReactWithShortcodeRealData TubaWidgetsReactionsRowReactWithShortcodeRealData;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#define TUBA_API_PLEROMA_TYPE_INSTANCE (tuba_api_pleroma_instance_get_type ())
#define TUBA_API_PLEROMA_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstance))
#define TUBA_API_PLEROMA_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstanceClass))
#define TUBA_API_PLEROMA_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE))
#define TUBA_API_PLEROMA_IS_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_PLEROMA_TYPE_INSTANCE))
#define TUBA_API_PLEROMA_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstanceClass))

typedef struct _TubaAPIPleromaInstance TubaAPIPleromaInstance;
typedef struct _TubaAPIPleromaInstanceClass TubaAPIPleromaInstanceClass;
typedef struct _Block115Data Block115Data;

#define TUBA_API_TYPE_EMOJI (tuba_api_emoji_get_type ())
#define TUBA_API_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmoji))
#define TUBA_API_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))
#define TUBA_API_IS_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI))
#define TUBA_API_IS_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI))
#define TUBA_API_EMOJI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))

typedef struct _TubaAPIEmoji TubaAPIEmoji;
typedef struct _TubaAPIEmojiClass TubaAPIEmojiClass;

#define TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2 (tuba_widgets_custom_emoji_chooser_v2_get_type ())
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2, TubaWidgetsCustomEmojiChooserV2))
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2, TubaWidgetsCustomEmojiChooserV2Class))
#define TUBA_WIDGETS_IS_CUSTOM_EMOJI_CHOOSER_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2))
#define TUBA_WIDGETS_IS_CUSTOM_EMOJI_CHOOSER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2))
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2, TubaWidgetsCustomEmojiChooserV2Class))

typedef struct _TubaWidgetsCustomEmojiChooserV2 TubaWidgetsCustomEmojiChooserV2;
typedef struct _TubaWidgetsCustomEmojiChooserV2Class TubaWidgetsCustomEmojiChooserV2Class;

struct _TubaWidgetsReactionsRow {
	AdwBin parent_instance;
	TubaWidgetsReactionsRowPrivate * priv;
};

struct _TubaWidgetsReactionsRowClass {
	AdwBinClass parent_class;
};

struct _TubaWidgetsReactionsRowPrivate {
	AdwWrapBox* reaction_box;
	GeeHashMap* react_btn_list;
	GtkMenuButton* emoji_button;
	GtkMenuButton* custom_emoji_button;
	gboolean _is_announcement;
	gchar* status_id;
};

struct _Block113Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	gint64 max_reacts;
	gint self_reacts;
};

struct _Block114Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	gchar** new_reactions_keys;
	gint new_reactions_keys_length1;
	gint _new_reactions_keys_size_;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaWidgetsReactionsRowOnReactionToggledRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaWidgetsReactionsRow* self;
	TubaWidgetsReactButton* btn;
	TubaRequestV2* req;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	TubaRequestV2* _tmp4_;
	TubaAccountStore* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	GInputStream* _tmp8_;
	GInputStream* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GError* e;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	GError* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GError* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	TubaApplication* _tmp25_;
	GError* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	GError* _inner_error0_;
};

struct _TubaWidgetsReactionsRowReactWithShortcodeRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaWidgetsReactionsRow* self;
	gchar* shortcode;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	TubaWidgetsReactButton* _tmp3_;
	TubaRequestV2* req;
	TubaRequestV2* _tmp4_;
	TubaRequestV2* _tmp5_;
	TubaAccountStore* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp9_;
	GInputStream* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	JsonParser* parser;
	GInputStream* _tmp13_;
	JsonParser* _tmp14_;
	JsonNode* node;
	TubaNetwork* _tmp15_;
	JsonParser* _tmp16_;
	JsonNode* _tmp17_;
	TubaAPIStatus* status;
	JsonNode* _tmp18_;
	TubaAPIStatus* _tmp19_;
	TubaAPIStatus* _tmp20_;
	TubaAPIStatus* _tmp21_;
	TubaAPIStatus* _tmp22_;
	GeeArrayList* _tmp23_;
	GeeArrayList* _tmp24_;
	TubaAPIStatus* _tmp25_;
	TubaAPIStatus* _tmp26_;
	TubaAPIStatus* _tmp27_;
	GeeArrayList* _tmp28_;
	GeeArrayList* _tmp29_;
	GError* e;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	GError* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	GError* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	TubaApplication* _tmp41_;
	GError* _tmp42_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	GError* _inner_error0_;
};

struct _Block115Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	gboolean value;
};

static gint TubaWidgetsReactionsRow_private_offset;
static gpointer tuba_widgets_reactions_row_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaNetwork* tuba_network;

VALA_EXTERN GType tuba_widgets_reactions_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsReactionsRow, g_object_unref)
VALA_EXTERN GType tuba_widgets_react_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsReactButton, g_object_unref)
static void tuba_widgets_reactions_row_update_reaction_add_state (TubaWidgetsReactionsRow* self);
static Block113Data* block113_data_ref (Block113Data* _data113_);
static void block113_data_unref (void * _userdata_);
VALA_EXTERN gboolean tuba_widgets_reactions_row_get_is_announcement (TubaWidgetsReactionsRow* self);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN GType tuba_api_instance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIInstance, g_object_unref)
VALA_EXTERN TubaAPIInstance* tuba_instance_account_get_instance_info (TubaInstanceAccount* self);
VALA_EXTERN gint64 tuba_api_instance_get_compat_status_reactions_max (TubaAPIInstance* self);
static gboolean __lambda94_ (Block113Data* _data113_,
                      GeeMapEntry* e);
VALA_EXTERN gboolean tuba_widgets_react_button_get_has_reacted (TubaWidgetsReactButton* self);
static gboolean ___lambda94__gee_forall_func (gpointer g,
                                       gpointer self);
static void tuba_widgets_reactions_row_set_can_add_reaction (TubaWidgetsReactionsRow* self,
                                                      gboolean value);
VALA_EXTERN GType tuba_api_emoji_reaction_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmojiReaction, g_object_unref)
VALA_EXTERN void tuba_widgets_reactions_row_update_reactions_diff (TubaWidgetsReactionsRow* self,
                                                       GeeArrayList* new_reactions);
static Block114Data* block114_data_ref (Block114Data* _data114_);
static void block114_data_unref (void * _userdata_);
VALA_EXTERN const gchar* tuba_api_emoji_reaction_get_name (TubaAPIEmojiReaction* self);
static void _vala_array_add171 (gchar** * array,
                         gint* length,
                         gint* size,
                         gchar* value);
VALA_EXTERN void tuba_widgets_react_button_update_reaction (TubaWidgetsReactButton* self,
                                                TubaAPIEmojiReaction* reaction);
static void tuba_widgets_reactions_row_add_emoji (TubaWidgetsReactionsRow* self,
                                           TubaAPIEmojiReaction* reaction);
static gboolean __lambda96_ (Block114Data* _data114_,
                      GeeMapEntry* e);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
static void tuba_widgets_reactions_row_on_remove (TubaWidgetsReactionsRow* self,
                                           TubaWidgetsReactButton* btn);
static gboolean ___lambda96__gee_forall_func (gpointer g,
                                       gpointer self);
VALA_EXTERN TubaWidgetsReactionsRow* tuba_widgets_reactions_row_new (const gchar* status_id,
                                                         GeeArrayList* reactions,
                                                         gboolean is_announcement);
VALA_EXTERN TubaWidgetsReactionsRow* tuba_widgets_reactions_row_construct (GType object_type,
                                                               const gchar* status_id,
                                                               GeeArrayList* reactions,
                                                               gboolean is_announcement);
VALA_EXTERN void tuba_widgets_reactions_row_set_is_announcement (TubaWidgetsReactionsRow* self,
                                                     gboolean value);
static void tuba_widgets_reactions_row_set_reactions (TubaWidgetsReactionsRow* self,
                                               GeeArrayList* value);
static void tuba_widgets_reactions_row_on_reaction_toggled (TubaWidgetsReactionsRow* self,
                                                     TubaWidgetsReactButton* btn);
static void tuba_widgets_reactions_row_on_reaction_toggled_real (TubaWidgetsReactionsRow* self,
                                                          TubaWidgetsReactButton* btn,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static void tuba_widgets_reactions_row_on_reaction_toggled_real_finish (TubaWidgetsReactionsRow* self,
                                                                 GAsyncResult* _res_);
static void tuba_widgets_reactions_row_on_reaction_toggled_real_data_free (gpointer _data);
static gboolean tuba_widgets_reactions_row_on_reaction_toggled_real_co (TubaWidgetsReactionsRowOnReactionToggledRealData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
static TubaRequestV2* tuba_widgets_reactions_row_reaction_request (TubaWidgetsReactionsRow* self,
                                                            const gchar* shortcode,
                                                            gboolean has_reacted);
VALA_EXTERN const gchar* tuba_widgets_react_button_get_shortcode (TubaWidgetsReactButton* self);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_widgets_reactions_row_on_reaction_toggled_real_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
VALA_EXTERN void tuba_widgets_react_button_update_reacted (TubaWidgetsReactButton* self,
                                               gboolean reacted);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
static void tuba_widgets_reactions_row_react_with_shortcode (TubaWidgetsReactionsRow* self,
                                                      const gchar* shortcode);
static void tuba_widgets_reactions_row_react_with_shortcode_real (TubaWidgetsReactionsRow* self,
                                                           const gchar* shortcode,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
static void tuba_widgets_reactions_row_react_with_shortcode_real_finish (TubaWidgetsReactionsRow* self,
                                                                  GAsyncResult* _res_);
static void tuba_widgets_reactions_row_react_with_shortcode_real_data_free (gpointer _data);
static gboolean tuba_widgets_reactions_row_react_with_shortcode_real_co (TubaWidgetsReactionsRowReactWithShortcodeRealData* _data_);
static void tuba_widgets_reactions_row_react_with_shortcode_real_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN GType tuba_api_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIStatus, g_object_unref)
VALA_EXTERN TubaAPIStatus* tuba_api_status_from (JsonNode* node,
                                     GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN TubaAPIStatus* tuba_api_status_get_formal (TubaAPIStatus* self);
VALA_EXTERN GeeArrayList* tuba_api_status_get_compat_status_reactions (TubaAPIStatus* self);
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN GType tuba_api_pleroma_instance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPleromaInstance, g_object_unref)
VALA_EXTERN TubaAPIPleromaInstance* tuba_api_instance_get_pleroma (TubaAPIInstance* self);
static void tuba_widgets_reactions_row_on_remove_and_update_state (TubaWidgetsReactionsRow* self,
                                                            TubaWidgetsReactButton* btn);
static void tuba_widgets_reactions_row_on_emoji_picked (TubaWidgetsReactionsRow* self,
                                                 const gchar* emoji);
static void tuba_widgets_reactions_row_on_custom_emoji_picked (TubaWidgetsReactionsRow* self,
                                                        const gchar* emoji_shortcode);
VALA_EXTERN gint64 tuba_api_emoji_reaction_get_count (TubaAPIEmojiReaction* self);
VALA_EXTERN TubaWidgetsReactButton* tuba_widgets_react_button_new (TubaAPIEmojiReaction* reaction);
VALA_EXTERN TubaWidgetsReactButton* tuba_widgets_react_button_construct (GType object_type,
                                                             TubaAPIEmojiReaction* reaction);
static void _tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled (TubaWidgetsReactButton* _sender,
                                                                                                 gpointer self);
static void _tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed (TubaWidgetsReactButton* _sender,
                                                                                               gpointer self);
static Block115Data* block115_data_ref (Block115Data* _data115_);
static void block115_data_unref (void * _userdata_);
static gboolean _tuba_widgets_reactions_row_can_add_reaction___lambda95_ (Block115Data* _data115_,
                                                                   GeeMapEntry* e);
static gboolean __tuba_widgets_reactions_row_can_add_reaction___lambda95__gee_forall_func (gpointer g,
                                                                                    gpointer self);
static gboolean _tuba_widgets_reactions_row_reactions___lambda97_ (TubaWidgetsReactionsRow* self,
                                                            GeeMapEntry* e);
static gboolean __tuba_widgets_reactions_row_reactions___lambda97__gee_forall_func (gpointer g,
                                                                             gpointer self);
static GObject * tuba_widgets_reactions_row_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
static void _tuba_widgets_reactions_row_on_emoji_picked_gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                                                 const gchar* text,
                                                                                 gpointer self);
VALA_EXTERN GType tuba_api_emoji_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmoji, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_instance_account_get_instance_emojis (TubaInstanceAccount* self);
VALA_EXTERN GType tuba_widgets_custom_emoji_chooser_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsCustomEmojiChooserV2, g_object_unref)
VALA_EXTERN TubaWidgetsCustomEmojiChooserV2* tuba_widgets_custom_emoji_chooser_v2_new (void);
VALA_EXTERN TubaWidgetsCustomEmojiChooserV2* tuba_widgets_custom_emoji_chooser_v2_construct (GType object_type);
static void _tuba_widgets_reactions_row_on_custom_emoji_picked_tuba_widgets_custom_emoji_chooser_v2_emoji_picked (TubaWidgetsCustomEmojiChooserV2* _sender,
                                                                                                           const gchar* shortcode,
                                                                                                           gpointer self);
static void tuba_widgets_reactions_row_finalize (GObject * obj);
static GType tuba_widgets_reactions_row_get_type_once (void);
static void _vala_tuba_widgets_reactions_row_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_tuba_widgets_reactions_row_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_widgets_reactions_row_get_instance_private (TubaWidgetsReactionsRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsReactionsRow_private_offset);
}

static Block113Data*
block113_data_ref (Block113Data* _data113_)
{
	g_atomic_int_inc (&_data113_->_ref_count_);
	return _data113_;
}

static void
block113_data_unref (void * _userdata_)
{
	Block113Data* _data113_;
	_data113_ = (Block113Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data113_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data113_->self;
		_g_object_unref0 (self);
		g_slice_free (Block113Data, _data113_);
	}
}

static gboolean
__lambda94_ (Block113Data* _data113_,
             GeeMapEntry* e)
{
	TubaWidgetsReactionsRow* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	self = _data113_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_value (e);
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_widgets_react_button_get_has_reacted (G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp1_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_data113_->self_reacts += 1;
		if (((gint64) _data113_->self_reacts) >= _data113_->max_reacts) {
			result = FALSE;
			_g_object_unref0 (e);
			return result;
		}
	}
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
___lambda94__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda94_ (self, (GeeMapEntry*) g);
	return result;
}

static void
tuba_widgets_reactions_row_update_reaction_add_state (TubaWidgetsReactionsRow* self)
{
	Block113Data* _data113_;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	TubaAccountStore* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaInstanceAccount* _tmp10_;
	TubaAPIInstance* _tmp11_;
	TubaAPIInstance* _tmp12_;
	gint64 _tmp13_;
	gint64 _tmp14_;
	GeeHashMap* _tmp15_;
	g_return_if_fail (self != NULL);
	_data113_ = g_slice_new0 (Block113Data);
	_data113_->_ref_count_ = 1;
	_data113_->self = g_object_ref (self);
	_tmp1_ = tuba_widgets_reactions_row_get_is_announcement (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		_tmp0_ = TRUE;
	} else {
		TubaAccountStore* _tmp3_;
		TubaInstanceAccount* _tmp4_;
		TubaInstanceAccount* _tmp5_;
		TubaAPIInstance* _tmp6_;
		TubaAPIInstance* _tmp7_;
		_tmp3_ = tuba_accounts;
		_tmp4_ = tuba_account_store_get_active (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = tuba_instance_account_get_instance_info (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_ == NULL;
	}
	if (_tmp0_) {
		block113_data_unref (_data113_);
		_data113_ = NULL;
		return;
	}
	_tmp8_ = tuba_accounts;
	_tmp9_ = tuba_account_store_get_active (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = tuba_instance_account_get_instance_info (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = tuba_api_instance_get_compat_status_reactions_max (_tmp12_);
	_tmp14_ = _tmp13_;
	_data113_->max_reacts = _tmp14_;
	if (_data113_->max_reacts == ((gint64) 0)) {
		block113_data_unref (_data113_);
		_data113_ = NULL;
		return;
	}
	_data113_->self_reacts = 0;
	_tmp15_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp15_, ___lambda94__gee_forall_func, _data113_);
	tuba_widgets_reactions_row_set_can_add_reaction (self, ((gint64) _data113_->self_reacts) < _data113_->max_reacts);
	block113_data_unref (_data113_);
	_data113_ = NULL;
}

static Block114Data*
block114_data_ref (Block114Data* _data114_)
{
	g_atomic_int_inc (&_data114_->_ref_count_);
	return _data114_;
}

static void
block114_data_unref (void * _userdata_)
{
	Block114Data* _data114_;
	_data114_ = (Block114Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data114_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data114_->self;
		_data114_->new_reactions_keys = (_vala_array_free (_data114_->new_reactions_keys, _data114_->new_reactions_keys_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block114Data, _data114_);
	}
}

static void
_vala_array_add171 (gchar** * array,
                    gint* length,
                    gint* size,
                    gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static gboolean
__lambda96_ (Block114Data* _data114_,
             GeeMapEntry* e)
{
	TubaWidgetsReactionsRow* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gboolean result;
	self = _data114_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_key (e);
	_tmp1_ = _tmp0_;
	_tmp2_ = _data114_->new_reactions_keys;
	_tmp2__length1 = _data114_->new_reactions_keys_length1;
	if (!_vala_string_array_contains (_tmp2_, _tmp2__length1, (const gchar*) ((const gchar*) _tmp1_))) {
		gconstpointer _tmp3_;
		gconstpointer _tmp4_;
		_tmp3_ = gee_map_entry_get_value (e);
		_tmp4_ = _tmp3_;
		tuba_widgets_reactions_row_on_remove (self, G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp4_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	}
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
___lambda96__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda96_ (self, (GeeMapEntry*) g);
	return result;
}

void
tuba_widgets_reactions_row_update_reactions_diff (TubaWidgetsReactionsRow* self,
                                                  GeeArrayList* new_reactions)
{
	Block114Data* _data114_;
	gchar** _tmp0_;
	GeeHashMap* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_reactions != NULL);
	_data114_ = g_slice_new0 (Block114Data);
	_data114_->_ref_count_ = 1;
	_data114_->self = g_object_ref (self);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	_data114_->new_reactions_keys = _tmp0_;
	_data114_->new_reactions_keys_length1 = 0;
	_data114_->_new_reactions_keys_size_ = _data114_->new_reactions_keys_length1;
	{
		GeeArrayList* _p_list = NULL;
		gint _p_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _p_index = 0;
		_p_list = new_reactions;
		_tmp1_ = _p_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_p_size = _tmp3_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			TubaAPIEmojiReaction* p = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			TubaAPIEmojiReaction* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			gchar* _tmp11_;
			GeeHashMap* _tmp12_;
			TubaAPIEmojiReaction* _tmp13_;
			const gchar* _tmp14_;
			const gchar* _tmp15_;
			_p_index = _p_index + 1;
			_tmp4_ = _p_index;
			_tmp5_ = _p_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _p_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _p_index);
			p = (TubaAPIEmojiReaction*) _tmp7_;
			_tmp8_ = p;
			_tmp9_ = tuba_api_emoji_reaction_get_name (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = g_strdup (_tmp10_);
			_vala_array_add171 (&_data114_->new_reactions_keys, &_data114_->new_reactions_keys_length1, &_data114_->_new_reactions_keys_size_, _tmp11_);
			_tmp12_ = self->priv->react_btn_list;
			_tmp13_ = p;
			_tmp14_ = tuba_api_emoji_reaction_get_name (_tmp13_);
			_tmp15_ = _tmp14_;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp12_, _tmp15_)) {
				GeeHashMap* _tmp16_;
				TubaAPIEmojiReaction* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				gpointer _tmp20_;
				TubaWidgetsReactButton* _tmp21_;
				TubaAPIEmojiReaction* _tmp22_;
				_tmp16_ = self->priv->react_btn_list;
				_tmp17_ = p;
				_tmp18_ = tuba_api_emoji_reaction_get_name (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp16_, _tmp19_);
				_tmp21_ = (TubaWidgetsReactButton*) _tmp20_;
				_tmp22_ = p;
				tuba_widgets_react_button_update_reaction (_tmp21_, _tmp22_);
				_g_object_unref0 (_tmp21_);
			} else {
				TubaAPIEmojiReaction* _tmp23_;
				_tmp23_ = p;
				tuba_widgets_reactions_row_add_emoji (self, _tmp23_);
			}
			_g_object_unref0 (p);
		}
	}
	_tmp24_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp24_, ___lambda96__gee_forall_func, _data114_);
	tuba_widgets_reactions_row_update_reaction_add_state (self);
	block114_data_unref (_data114_);
	_data114_ = NULL;
}

TubaWidgetsReactionsRow*
tuba_widgets_reactions_row_construct (GType object_type,
                                      const gchar* status_id,
                                      GeeArrayList* reactions,
                                      gboolean is_announcement)
{
	TubaWidgetsReactionsRow * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (status_id != NULL, NULL);
	g_return_val_if_fail (reactions != NULL, NULL);
	self = (TubaWidgetsReactionsRow*) g_object_new (object_type, NULL);
	tuba_widgets_reactions_row_set_is_announcement (self, is_announcement);
	_tmp0_ = g_strdup (status_id);
	_g_free0 (self->priv->status_id);
	self->priv->status_id = _tmp0_;
	tuba_widgets_reactions_row_set_reactions (self, reactions);
	return self;
}

TubaWidgetsReactionsRow*
tuba_widgets_reactions_row_new (const gchar* status_id,
                                GeeArrayList* reactions,
                                gboolean is_announcement)
{
	return tuba_widgets_reactions_row_construct (TUBA_WIDGETS_TYPE_REACTIONS_ROW, status_id, reactions, is_announcement);
}

static void
tuba_widgets_reactions_row_on_reaction_toggled (TubaWidgetsReactionsRow* self,
                                                TubaWidgetsReactButton* btn)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	tuba_widgets_reactions_row_on_reaction_toggled_real (self, btn, NULL, NULL);
}

static void
tuba_widgets_reactions_row_on_reaction_toggled_real_data_free (gpointer _data)
{
	TubaWidgetsReactionsRowOnReactionToggledRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->btn);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaWidgetsReactionsRowOnReactionToggledRealData, _data_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
tuba_widgets_reactions_row_on_reaction_toggled_real (TubaWidgetsReactionsRow* self,
                                                     TubaWidgetsReactButton* btn,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	TubaWidgetsReactionsRowOnReactionToggledRealData* _data_;
	TubaWidgetsReactionsRow* _tmp0_;
	TubaWidgetsReactButton* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	_data_ = g_slice_new0 (TubaWidgetsReactionsRowOnReactionToggledRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_widgets_reactions_row_on_reaction_toggled_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (btn);
	_g_object_unref0 (_data_->btn);
	_data_->btn = _tmp1_;
	tuba_widgets_reactions_row_on_reaction_toggled_real_co (_data_);
}

static void
tuba_widgets_reactions_row_on_reaction_toggled_real_finish (TubaWidgetsReactionsRow* self,
                                                            GAsyncResult* _res_)
{
	TubaWidgetsReactionsRowOnReactionToggledRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_widgets_reactions_row_on_reaction_toggled_real_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	TubaWidgetsReactionsRowOnReactionToggledRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_widgets_reactions_row_on_reaction_toggled_real_co (_data_);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gboolean
tuba_widgets_reactions_row_on_reaction_toggled_real_co (TubaWidgetsReactionsRowOnReactionToggledRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	gtk_widget_set_sensitive ((GtkWidget*) _data_->btn, FALSE);
	_data_->_tmp0_ = tuba_widgets_react_button_get_shortcode (_data_->btn);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = tuba_widgets_react_button_get_has_reacted (_data_->btn);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = tuba_widgets_reactions_row_reaction_request (_data_->self, _data_->_tmp1_, _data_->_tmp3_);
	_data_->req = _data_->_tmp4_;
	_data_->_tmp5_ = tuba_accounts;
	_data_->_tmp6_ = tuba_account_store_get_active (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	tuba_request_v2_set_account (_data_->req, _data_->_tmp7_);
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_widgets_reactions_row_on_reaction_toggled_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp8_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_g_object_unref0 (_data_->_tmp9_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp10_ = tuba_widgets_react_button_get_has_reacted (_data_->btn);
		_data_->_tmp11_ = _data_->_tmp10_;
		tuba_widgets_react_button_update_reacted (_data_->btn, !_data_->_tmp11_);
		gtk_widget_set_sensitive ((GtkWidget*) _data_->btn, TRUE);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp12_ = _data_->self->priv->status_id;
		_data_->_tmp13_ = string_to_string (_data_->_tmp12_);
		_data_->_tmp14_ = tuba_widgets_react_button_get_shortcode (_data_->btn);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = string_to_string (_data_->_tmp15_);
		_data_->_tmp17_ = _data_->e;
		_data_->_tmp18_ = g_strdup_printf ("%i", _data_->_tmp17_->code);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_tmp20_ = _data_->e;
		_data_->_tmp21_ = _data_->_tmp20_->message;
		_data_->_tmp22_ = string_to_string (_data_->_tmp21_);
		_data_->_tmp23_ = g_strconcat ("Error while reacting to ", _data_->_tmp13_, " with ", _data_->_tmp16_, ": ", _data_->_tmp19_, " ", _data_->_tmp22_, NULL);
		_data_->_tmp24_ = _data_->_tmp23_;
		g_warning ("ReactionsRow.vala:155: %s", _data_->_tmp24_);
		_g_free0 (_data_->_tmp24_);
		_g_free0 (_data_->_tmp19_);
		gtk_widget_set_sensitive ((GtkWidget*) _data_->btn, TRUE);
		_data_->_tmp25_ = tuba_app;
		_data_->_tmp26_ = _data_->e;
		_data_->_tmp27_ = _data_->_tmp26_->message;
		_data_->_tmp28_ = g_strdup_printf ("%s: %s", _ ("Error"), _data_->_tmp27_);
		_data_->_tmp29_ = _data_->_tmp28_;
		g_signal_emit_by_name (_data_->_tmp25_, "toast", _data_->_tmp29_, (guint) 5, NULL, NULL, NULL);
		_g_free0 (_data_->_tmp29_);
		tuba_widgets_reactions_row_update_reaction_add_state (_data_->self);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->req);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
tuba_widgets_reactions_row_react_with_shortcode (TubaWidgetsReactionsRow* self,
                                                 const gchar* shortcode)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (shortcode != NULL);
	tuba_widgets_reactions_row_react_with_shortcode_real (self, shortcode, NULL, NULL);
}

static void
tuba_widgets_reactions_row_react_with_shortcode_real_data_free (gpointer _data)
{
	TubaWidgetsReactionsRowReactWithShortcodeRealData* _data_;
	_data_ = _data;
	_g_free0 (_data_->shortcode);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaWidgetsReactionsRowReactWithShortcodeRealData, _data_);
}

static void
tuba_widgets_reactions_row_react_with_shortcode_real (TubaWidgetsReactionsRow* self,
                                                      const gchar* shortcode,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	TubaWidgetsReactionsRowReactWithShortcodeRealData* _data_;
	TubaWidgetsReactionsRow* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (shortcode != NULL);
	_data_ = g_slice_new0 (TubaWidgetsReactionsRowReactWithShortcodeRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_widgets_reactions_row_react_with_shortcode_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (shortcode);
	_g_free0 (_data_->shortcode);
	_data_->shortcode = _tmp1_;
	tuba_widgets_reactions_row_react_with_shortcode_real_co (_data_);
}

static void
tuba_widgets_reactions_row_react_with_shortcode_real_finish (TubaWidgetsReactionsRow* self,
                                                             GAsyncResult* _res_)
{
	TubaWidgetsReactionsRowReactWithShortcodeRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_widgets_reactions_row_react_with_shortcode_real_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_)
{
	TubaWidgetsReactionsRowReactWithShortcodeRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_widgets_reactions_row_react_with_shortcode_real_co (_data_);
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gboolean
tuba_widgets_reactions_row_react_with_shortcode_real_co (TubaWidgetsReactionsRowReactWithShortcodeRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->react_btn_list;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp0_, _data_->shortcode)) {
		_data_->_tmp1_ = _data_->self->priv->react_btn_list;
		_data_->_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp1_, _data_->shortcode);
		_data_->_tmp3_ = (TubaWidgetsReactButton*) _data_->_tmp2_;
		_data_->_state_ = 1;
		tuba_widgets_reactions_row_on_reaction_toggled_real (_data_->self, _data_->_tmp3_, tuba_widgets_reactions_row_react_with_shortcode_real_ready, _data_);
		return FALSE;
		_state_1:
		tuba_widgets_reactions_row_on_reaction_toggled_real_finish (_data_->self, _data_->_res_);
		_g_object_unref0 (_data_->_tmp3_);
	} else {
		_data_->_tmp4_ = tuba_widgets_reactions_row_reaction_request (_data_->self, _data_->shortcode, FALSE);
		_data_->req = _data_->_tmp4_;
		_data_->_tmp5_ = _data_->req;
		_data_->_tmp6_ = tuba_accounts;
		_data_->_tmp7_ = tuba_account_store_get_active (_data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		tuba_request_v2_set_account (_data_->_tmp5_, _data_->_tmp8_);
		{
			_data_->_tmp9_ = _data_->req;
			_data_->_state_ = 2;
			tuba_request_v2_exec (_data_->_tmp9_, tuba_widgets_reactions_row_react_with_shortcode_real_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp10_ = tuba_request_v2_exec_finish (_data_->_tmp9_, _data_->_res_, NULL, &_data_->_inner_error0_);
			_data_->in_stream = _data_->_tmp10_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp11_ = tuba_widgets_reactions_row_get_is_announcement (_data_->self);
			_data_->_tmp12_ = _data_->_tmp11_;
			if (!_data_->_tmp12_) {
				_data_->_tmp13_ = _data_->in_stream;
				_data_->_state_ = 3;
				tuba_network_get_parser_from_inputstream_async (_data_->_tmp13_, NULL, tuba_widgets_reactions_row_react_with_shortcode_real_ready, _data_);
				return FALSE;
				_state_3:
				_data_->_tmp14_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
				_data_->parser = _data_->_tmp14_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_object_unref0 (_data_->in_stream);
					goto __catch0_g_error;
				}
				_data_->_tmp15_ = tuba_network;
				_data_->_tmp16_ = _data_->parser;
				_data_->_tmp17_ = tuba_network_parse_node (_data_->_tmp15_, _data_->_tmp16_);
				_data_->node = _data_->_tmp17_;
				_data_->_tmp18_ = _data_->node;
				_data_->_tmp19_ = tuba_api_status_from (_data_->_tmp18_, &_data_->_inner_error0_);
				_data_->status = _data_->_tmp19_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					__vala_JsonNode_free0 (_data_->node);
					_g_object_unref0 (_data_->parser);
					_g_object_unref0 (_data_->in_stream);
					goto __catch0_g_error;
				}
				_data_->_tmp20_ = _data_->status;
				_data_->_tmp21_ = tuba_api_status_get_formal (_data_->_tmp20_);
				_data_->_tmp22_ = _data_->_tmp21_;
				_data_->_tmp23_ = tuba_api_status_get_compat_status_reactions (_data_->_tmp22_);
				_data_->_tmp24_ = _data_->_tmp23_;
				if (_data_->_tmp24_ != NULL) {
					_data_->_tmp25_ = _data_->status;
					_data_->_tmp26_ = tuba_api_status_get_formal (_data_->_tmp25_);
					_data_->_tmp27_ = _data_->_tmp26_;
					_data_->_tmp28_ = tuba_api_status_get_compat_status_reactions (_data_->_tmp27_);
					_data_->_tmp29_ = _data_->_tmp28_;
					tuba_widgets_reactions_row_update_reactions_diff (_data_->self, _data_->_tmp29_);
				}
				_g_object_unref0 (_data_->status);
				__vala_JsonNode_free0 (_data_->node);
				_g_object_unref0 (_data_->parser);
			}
			_g_object_unref0 (_data_->in_stream);
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp30_ = _data_->self->priv->status_id;
			_data_->_tmp31_ = string_to_string (_data_->_tmp30_);
			_data_->_tmp32_ = string_to_string (_data_->shortcode);
			_data_->_tmp33_ = _data_->e;
			_data_->_tmp34_ = g_strdup_printf ("%i", _data_->_tmp33_->code);
			_data_->_tmp35_ = _data_->_tmp34_;
			_data_->_tmp36_ = _data_->e;
			_data_->_tmp37_ = _data_->_tmp36_->message;
			_data_->_tmp38_ = string_to_string (_data_->_tmp37_);
			_data_->_tmp39_ = g_strconcat ("Error while reacting to ", _data_->_tmp31_, " with ", _data_->_tmp32_, ": ", _data_->_tmp35_, " ", _data_->_tmp38_, NULL);
			_data_->_tmp40_ = _data_->_tmp39_;
			g_warning ("ReactionsRow.vala:185: %s", _data_->_tmp40_);
			_g_free0 (_data_->_tmp40_);
			_g_free0 (_data_->_tmp35_);
			_data_->_tmp41_ = tuba_app;
			_data_->_tmp42_ = _data_->e;
			_data_->_tmp43_ = _data_->_tmp42_->message;
			_data_->_tmp44_ = g_strdup_printf ("%s: %s", _ ("Error"), _data_->_tmp43_);
			_data_->_tmp45_ = _data_->_tmp44_;
			g_signal_emit_by_name (_data_->_tmp41_, "toast", _data_->_tmp45_, (guint) 5, NULL, NULL, NULL);
			_g_free0 (_data_->_tmp45_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->req);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->req);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static TubaRequestV2*
tuba_widgets_reactions_row_reaction_request (TubaWidgetsReactionsRow* self,
                                             const gchar* shortcode,
                                             gboolean has_reacted)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	TubaRequestV2* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (shortcode != NULL, NULL);
	_tmp0_ = tuba_widgets_reactions_row_get_is_announcement (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gchar* endpoint = NULL;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		TubaRequestV2* _tmp9_ = NULL;
		TubaRequestV2* _tmp14_;
		_tmp2_ = self->priv->status_id;
		_tmp3_ = string_to_string (_tmp2_);
		_tmp4_ = g_uri_escape_string (shortcode, NULL, TRUE);
		_tmp5_ = _tmp4_;
		_tmp6_ = string_to_string (_tmp5_);
		_tmp7_ = g_strconcat ("/api/v1/announcements/", _tmp3_, "/reactions/", _tmp6_, NULL);
		_tmp8_ = _tmp7_;
		_g_free0 (_tmp5_);
		endpoint = _tmp8_;
		if (has_reacted) {
			const gchar* _tmp10_;
			TubaRequestV2* _tmp11_;
			_tmp10_ = endpoint;
			_tmp11_ = tuba_request_v2_new (_tmp10_, TUBA_REQUEST_V2_METHOD_DELETE);
			_g_object_unref0 (_tmp9_);
			_tmp9_ = _tmp11_;
		} else {
			const gchar* _tmp12_;
			TubaRequestV2* _tmp13_;
			_tmp12_ = endpoint;
			_tmp13_ = tuba_request_v2_new (_tmp12_, TUBA_REQUEST_V2_METHOD_PUT);
			_g_object_unref0 (_tmp9_);
			_tmp9_ = _tmp13_;
		}
		_tmp14_ = _tmp9_;
		_tmp9_ = NULL;
		result = _tmp14_;
		_g_object_unref0 (_tmp9_);
		_g_free0 (endpoint);
		return result;
	} else {
		TubaAccountStore* _tmp15_;
		TubaInstanceAccount* _tmp16_;
		TubaInstanceAccount* _tmp17_;
		TubaAPIInstance* _tmp18_;
		TubaAPIInstance* _tmp19_;
		TubaAPIPleromaInstance* _tmp20_;
		TubaAPIPleromaInstance* _tmp21_;
		_tmp15_ = tuba_accounts;
		_tmp16_ = tuba_account_store_get_active (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = tuba_instance_account_get_instance_info (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = tuba_api_instance_get_pleroma (_tmp19_);
		_tmp21_ = _tmp20_;
		if (_tmp21_ != NULL) {
			gchar* endpoint = NULL;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			gchar* _tmp24_;
			gchar* _tmp25_;
			const gchar* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			TubaRequestV2* _tmp29_ = NULL;
			TubaRequestV2* _tmp34_;
			_tmp22_ = self->priv->status_id;
			_tmp23_ = string_to_string (_tmp22_);
			_tmp24_ = g_uri_escape_string (shortcode, NULL, TRUE);
			_tmp25_ = _tmp24_;
			_tmp26_ = string_to_string (_tmp25_);
			_tmp27_ = g_strconcat ("/api/v1/pleroma/statuses/", _tmp23_, "/reactions/", _tmp26_, NULL);
			_tmp28_ = _tmp27_;
			_g_free0 (_tmp25_);
			endpoint = _tmp28_;
			if (has_reacted) {
				const gchar* _tmp30_;
				TubaRequestV2* _tmp31_;
				_tmp30_ = endpoint;
				_tmp31_ = tuba_request_v2_new (_tmp30_, TUBA_REQUEST_V2_METHOD_DELETE);
				_g_object_unref0 (_tmp29_);
				_tmp29_ = _tmp31_;
			} else {
				const gchar* _tmp32_;
				TubaRequestV2* _tmp33_;
				_tmp32_ = endpoint;
				_tmp33_ = tuba_request_v2_new (_tmp32_, TUBA_REQUEST_V2_METHOD_PUT);
				_g_object_unref0 (_tmp29_);
				_tmp29_ = _tmp33_;
			}
			_tmp34_ = _tmp29_;
			_tmp29_ = NULL;
			result = _tmp34_;
			_g_object_unref0 (_tmp29_);
			_g_free0 (endpoint);
			return result;
		} else {
			gchar* action = NULL;
			gchar* _tmp35_;
			gchar* endpoint = NULL;
			const gchar* _tmp37_;
			const gchar* _tmp38_;
			const gchar* _tmp39_;
			const gchar* _tmp40_;
			gchar* _tmp41_;
			gchar* _tmp42_;
			const gchar* _tmp43_;
			gchar* _tmp44_;
			gchar* _tmp45_;
			const gchar* _tmp46_;
			TubaRequestV2* _tmp47_;
			_tmp35_ = g_strdup ("react");
			action = _tmp35_;
			if (has_reacted) {
				gchar* _tmp36_;
				_tmp36_ = g_strdup ("unreact");
				_g_free0 (action);
				action = _tmp36_;
			}
			_tmp37_ = self->priv->status_id;
			_tmp38_ = string_to_string (_tmp37_);
			_tmp39_ = action;
			_tmp40_ = string_to_string (_tmp39_);
			_tmp41_ = g_uri_escape_string (shortcode, NULL, TRUE);
			_tmp42_ = _tmp41_;
			_tmp43_ = string_to_string (_tmp42_);
			_tmp44_ = g_strconcat ("/api/v1/statuses/", _tmp38_, "/", _tmp40_, "/", _tmp43_, NULL);
			_tmp45_ = _tmp44_;
			_g_free0 (_tmp42_);
			endpoint = _tmp45_;
			_tmp46_ = endpoint;
			_tmp47_ = tuba_request_v2_new (_tmp46_, TUBA_REQUEST_V2_METHOD_POST);
			result = _tmp47_;
			_g_free0 (endpoint);
			_g_free0 (action);
			return result;
		}
	}
}

static void
tuba_widgets_reactions_row_on_remove (TubaWidgetsReactionsRow* self,
                                      TubaWidgetsReactButton* btn)
{
	AdwWrapBox* _tmp0_;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	_tmp0_ = self->priv->reaction_box;
	adw_wrap_box_remove (_tmp0_, (GtkWidget*) btn);
	_tmp1_ = self->priv->react_btn_list;
	_tmp2_ = tuba_widgets_react_button_get_shortcode (btn);
	_tmp3_ = _tmp2_;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp1_, _tmp3_, NULL);
}

static void
tuba_widgets_reactions_row_on_remove_and_update_state (TubaWidgetsReactionsRow* self,
                                                       TubaWidgetsReactButton* btn)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	tuba_widgets_reactions_row_on_remove (self, btn);
	tuba_widgets_reactions_row_update_reaction_add_state (self);
}

static void
tuba_widgets_reactions_row_on_emoji_picked (TubaWidgetsReactionsRow* self,
                                            const gchar* emoji)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (emoji != NULL);
	tuba_widgets_reactions_row_react_with_shortcode (self, emoji);
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static void
tuba_widgets_reactions_row_on_custom_emoji_picked (TubaWidgetsReactionsRow* self,
                                                   const gchar* emoji_shortcode)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (emoji_shortcode != NULL);
	_tmp0_ = string_slice (emoji_shortcode, (glong) 1, (glong) -2);
	_tmp1_ = _tmp0_;
	tuba_widgets_reactions_row_react_with_shortcode (self, _tmp1_);
	_g_free0 (_tmp1_);
}

static void
_tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled (TubaWidgetsReactButton* _sender,
                                                                                            gpointer self)
{
	tuba_widgets_reactions_row_on_reaction_toggled ((TubaWidgetsReactionsRow*) self, _sender);
}

static void
_tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed (TubaWidgetsReactButton* _sender,
                                                                                          gpointer self)
{
	tuba_widgets_reactions_row_on_remove_and_update_state ((TubaWidgetsReactionsRow*) self, _sender);
}

static void
tuba_widgets_reactions_row_add_emoji (TubaWidgetsReactionsRow* self,
                                      TubaAPIEmojiReaction* reaction)
{
	gint64 _tmp0_;
	gint64 _tmp1_;
	TubaWidgetsReactButton* badge_button = NULL;
	TubaWidgetsReactButton* _tmp2_;
	TubaWidgetsReactButton* _tmp3_;
	TubaWidgetsReactButton* _tmp4_;
	GtkWidget* last_reaction = NULL;
	AdwWrapBox* _tmp5_;
	GtkWidget* _tmp6_;
	GtkWidget* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp18_;
	GeeHashMap* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	TubaWidgetsReactButton* _tmp27_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (reaction != NULL);
	_tmp0_ = tuba_api_emoji_reaction_get_count (reaction);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == ((gint64) 0)) {
		return;
	}
	_tmp2_ = tuba_widgets_react_button_new (reaction);
	g_object_ref_sink (_tmp2_);
	badge_button = _tmp2_;
	_tmp3_ = badge_button;
	g_signal_connect_object (_tmp3_, "reaction-toggled", (GCallback) _tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled, self, 0);
	_tmp4_ = badge_button;
	g_signal_connect_object (_tmp4_, "removed", (GCallback) _tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed, self, 0);
	_tmp5_ = self->priv->reaction_box;
	_tmp6_ = gtk_widget_get_last_child ((GtkWidget*) _tmp5_);
	_tmp7_ = _g_object_ref0 (_tmp6_);
	last_reaction = _tmp7_;
	_tmp8_ = last_reaction;
	if (_tmp8_ != NULL) {
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		gboolean _tmp12_ = FALSE;
		GtkWidget* _tmp13_;
		_tmp9_ = last_reaction;
		_tmp10_ = gtk_widget_get_prev_sibling (_tmp9_);
		_tmp11_ = _g_object_ref0 (_tmp10_);
		_g_object_unref0 (last_reaction);
		last_reaction = _tmp11_;
		_tmp13_ = last_reaction;
		if (_tmp13_ != NULL) {
			GtkMenuButton* _tmp14_;
			_tmp14_ = self->priv->custom_emoji_button;
			_tmp12_ = _tmp14_ != NULL;
		} else {
			_tmp12_ = FALSE;
		}
		if (_tmp12_) {
			GtkWidget* _tmp15_;
			GtkWidget* _tmp16_;
			GtkWidget* _tmp17_;
			_tmp15_ = last_reaction;
			_tmp16_ = gtk_widget_get_prev_sibling (_tmp15_);
			_tmp17_ = _g_object_ref0 (_tmp16_);
			_g_object_unref0 (last_reaction);
			last_reaction = _tmp17_;
		}
	}
	_tmp18_ = last_reaction;
	if (_tmp18_ == NULL) {
		AdwWrapBox* _tmp19_;
		TubaWidgetsReactButton* _tmp20_;
		_tmp19_ = self->priv->reaction_box;
		_tmp20_ = badge_button;
		adw_wrap_box_prepend (_tmp19_, (GtkWidget*) _tmp20_);
	} else {
		AdwWrapBox* _tmp21_;
		TubaWidgetsReactButton* _tmp22_;
		GtkWidget* _tmp23_;
		_tmp21_ = self->priv->reaction_box;
		_tmp22_ = badge_button;
		_tmp23_ = last_reaction;
		adw_wrap_box_insert_child_after (_tmp21_, (GtkWidget*) _tmp22_, _tmp23_);
	}
	_tmp24_ = self->priv->react_btn_list;
	_tmp25_ = tuba_api_emoji_reaction_get_name (reaction);
	_tmp26_ = _tmp25_;
	_tmp27_ = badge_button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, _tmp26_, _tmp27_);
	_g_object_unref0 (last_reaction);
	_g_object_unref0 (badge_button);
}

gboolean
tuba_widgets_reactions_row_get_is_announcement (TubaWidgetsReactionsRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_announcement;
	return result;
}

void
tuba_widgets_reactions_row_set_is_announcement (TubaWidgetsReactionsRow* self,
                                                gboolean value)
{
	GtkMenuButton* _tmp0_;
	GtkMenuButton* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->emoji_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, !value);
	_tmp1_ = self->priv->custom_emoji_button;
	if (_tmp1_ != NULL) {
		GtkMenuButton* _tmp2_;
		_tmp2_ = self->priv->custom_emoji_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp2_, !value);
	}
	self->priv->_is_announcement = value;
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_reactions_row_properties[TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY]);
}

static Block115Data*
block115_data_ref (Block115Data* _data115_)
{
	g_atomic_int_inc (&_data115_->_ref_count_);
	return _data115_;
}

static void
block115_data_unref (void * _userdata_)
{
	Block115Data* _data115_;
	_data115_ = (Block115Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data115_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data115_->self;
		_g_object_unref0 (self);
		g_slice_free (Block115Data, _data115_);
	}
}

static gboolean
_tuba_widgets_reactions_row_can_add_reaction___lambda95_ (Block115Data* _data115_,
                                                          GeeMapEntry* e)
{
	TubaWidgetsReactionsRow* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	self = _data115_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_value (e);
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_widgets_react_button_get_has_reacted (G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp1_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		gconstpointer _tmp4_;
		gconstpointer _tmp5_;
		_tmp4_ = gee_map_entry_get_value (e);
		_tmp5_ = _tmp4_;
		gtk_widget_set_sensitive ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp5_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton), _data115_->value);
	}
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
__tuba_widgets_reactions_row_can_add_reaction___lambda95__gee_forall_func (gpointer g,
                                                                           gpointer self)
{
	gboolean result;
	result = _tuba_widgets_reactions_row_can_add_reaction___lambda95_ (self, (GeeMapEntry*) g);
	return result;
}

static void
tuba_widgets_reactions_row_set_can_add_reaction (TubaWidgetsReactionsRow* self,
                                                 gboolean value)
{
	Block115Data* _data115_;
	GtkMenuButton* _tmp0_;
	GtkMenuButton* _tmp1_;
	GeeHashMap* _tmp3_;
	g_return_if_fail (self != NULL);
	_data115_ = g_slice_new0 (Block115Data);
	_data115_->_ref_count_ = 1;
	_data115_->self = g_object_ref (self);
	_data115_->value = value;
	_tmp0_ = self->priv->emoji_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _data115_->value);
	_tmp1_ = self->priv->custom_emoji_button;
	if (_tmp1_ != NULL) {
		GtkMenuButton* _tmp2_;
		_tmp2_ = self->priv->custom_emoji_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, _data115_->value);
	}
	_tmp3_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp3_, __tuba_widgets_reactions_row_can_add_reaction___lambda95__gee_forall_func, _data115_);
	block115_data_unref (_data115_);
	_data115_ = NULL;
}

static gboolean
_tuba_widgets_reactions_row_reactions___lambda97_ (TubaWidgetsReactionsRow* self,
                                                   GeeMapEntry* e)
{
	AdwWrapBox* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = self->priv->reaction_box;
	_tmp1_ = gee_map_entry_get_value (e);
	_tmp2_ = _tmp1_;
	adw_wrap_box_remove (_tmp0_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp2_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
__tuba_widgets_reactions_row_reactions___lambda97__gee_forall_func (gpointer g,
                                                                    gpointer self)
{
	gboolean result;
	result = _tuba_widgets_reactions_row_reactions___lambda97_ ((TubaWidgetsReactionsRow*) self, (GeeMapEntry*) g);
	return result;
}

static void
tuba_widgets_reactions_row_set_reactions (TubaWidgetsReactionsRow* self,
                                          GeeArrayList* value)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	g_return_if_fail (self != NULL);
	if (value == NULL) {
		return;
	}
	_tmp0_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp0_, __tuba_widgets_reactions_row_reactions___lambda97__gee_forall_func, self);
	_tmp1_ = self->priv->react_btn_list;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp1_);
	{
		gint j = 0;
		gint _tmp2_;
		gint _tmp3_;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) value);
		_tmp3_ = _tmp2_;
		j = _tmp3_ - 1;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				TubaAPIEmojiReaction* p = NULL;
				gpointer _tmp6_;
				TubaAPIEmojiReaction* _tmp7_;
				gint64 _tmp8_;
				gint64 _tmp9_;
				TubaWidgetsReactButton* badge_button = NULL;
				TubaAPIEmojiReaction* _tmp10_;
				TubaWidgetsReactButton* _tmp11_;
				TubaWidgetsReactButton* _tmp12_;
				TubaWidgetsReactButton* _tmp13_;
				AdwWrapBox* _tmp14_;
				TubaWidgetsReactButton* _tmp15_;
				GeeHashMap* _tmp16_;
				TubaAPIEmojiReaction* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				TubaWidgetsReactButton* _tmp20_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = j;
					j = _tmp5_ - 1;
				}
				_tmp4_ = FALSE;
				if (!(j >= 0)) {
					break;
				}
				_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) value, j);
				p = (TubaAPIEmojiReaction*) _tmp6_;
				_tmp7_ = p;
				_tmp8_ = tuba_api_emoji_reaction_get_count (_tmp7_);
				_tmp9_ = _tmp8_;
				if (_tmp9_ <= ((gint64) 0)) {
					_g_object_unref0 (p);
					return;
				}
				_tmp10_ = p;
				_tmp11_ = tuba_widgets_react_button_new (_tmp10_);
				g_object_ref_sink (_tmp11_);
				badge_button = _tmp11_;
				_tmp12_ = badge_button;
				g_signal_connect_object (_tmp12_, "reaction-toggled", (GCallback) _tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled, self, 0);
				_tmp13_ = badge_button;
				g_signal_connect_object (_tmp13_, "removed", (GCallback) _tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed, self, 0);
				_tmp14_ = self->priv->reaction_box;
				_tmp15_ = badge_button;
				adw_wrap_box_prepend (_tmp14_, (GtkWidget*) _tmp15_);
				_tmp16_ = self->priv->react_btn_list;
				_tmp17_ = p;
				_tmp18_ = tuba_api_emoji_reaction_get_name (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = badge_button;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp16_, _tmp19_, _tmp20_);
				_g_object_unref0 (badge_button);
				_g_object_unref0 (p);
			}
		}
	}
	tuba_widgets_reactions_row_update_reaction_add_state (self);
}

static void
_tuba_widgets_reactions_row_on_emoji_picked_gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                                            const gchar* text,
                                                                            gpointer self)
{
	tuba_widgets_reactions_row_on_emoji_picked ((TubaWidgetsReactionsRow*) self, text);
}

static void
_tuba_widgets_reactions_row_on_custom_emoji_picked_tuba_widgets_custom_emoji_chooser_v2_emoji_picked (TubaWidgetsCustomEmojiChooserV2* _sender,
                                                                                                      const gchar* shortcode,
                                                                                                      gpointer self)
{
	tuba_widgets_reactions_row_on_custom_emoji_picked ((TubaWidgetsReactionsRow*) self, shortcode);
}

static GObject *
tuba_widgets_reactions_row_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsReactionsRow * self;
	GeeHashMap* _tmp0_;
	AdwWrapBox* _tmp1_ = NULL;
	AdwWrapBox* _tmp2_;
	GtkEmojiChooser* emoji_picker = NULL;
	GtkEmojiChooser* _tmp3_;
	gchar* _tmp4_;
	GtkEmojiChooser* _tmp5_;
	GtkPopover* _tmp6_;
	gchar* _tmp7_;
	GtkMenuButton* _tmp8_ = NULL;
	AdwWrapBox* _tmp9_;
	GtkMenuButton* _tmp10_;
	GtkEmojiChooser* _tmp11_;
	gboolean _tmp12_ = FALSE;
	TubaAccountStore* _tmp13_;
	TubaInstanceAccount* _tmp14_;
	TubaInstanceAccount* _tmp15_;
	GeeArrayList* _tmp16_;
	GeeArrayList* _tmp17_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_reactions_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TUBA_WIDGETS_TYPE_REACT_BUTTON, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->react_btn_list);
	self->priv->react_btn_list = _tmp0_;
	_tmp1_ = (AdwWrapBox*) adw_wrap_box_new ();
	adw_wrap_box_set_child_spacing (_tmp1_, 6);
	adw_wrap_box_set_line_spacing (_tmp1_, 6);
	adw_wrap_box_set_justify (_tmp1_, ADW_JUSTIFY_NONE);
	adw_wrap_box_set_align (_tmp1_, 0.0f);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->reaction_box);
	self->priv->reaction_box = _tmp1_;
	_tmp2_ = self->priv->reaction_box;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp2_);
	_tmp3_ = (GtkEmojiChooser*) gtk_emoji_chooser_new ();
	g_object_ref_sink (_tmp3_);
	emoji_picker = _tmp3_;
	_tmp4_ = g_strdup ("tuba-smile-symbolic");
	_tmp5_ = emoji_picker;
	_tmp6_ = _g_object_ref0 ((GtkPopover*) _tmp5_);
	_tmp7_ = g_strdup (_ ("Emoji Picker"));
	_tmp8_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_icon_name (_tmp8_, _tmp4_);
	_g_free0 (_tmp4_);
	gtk_menu_button_set_popover (_tmp8_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, _tmp7_);
	_g_free0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->emoji_button);
	self->priv->emoji_button = _tmp8_;
	_tmp9_ = self->priv->reaction_box;
	_tmp10_ = self->priv->emoji_button;
	adw_wrap_box_append (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = emoji_picker;
	g_signal_connect_object (_tmp11_, "emoji-picked", (GCallback) _tuba_widgets_reactions_row_on_emoji_picked_gtk_emoji_chooser_emoji_picked, self, 0);
	_tmp13_ = tuba_accounts;
	_tmp14_ = tuba_account_store_get_active (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = tuba_instance_account_get_instance_emojis (_tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_ != NULL) {
		TubaAccountStore* _tmp18_;
		TubaInstanceAccount* _tmp19_;
		TubaInstanceAccount* _tmp20_;
		GeeArrayList* _tmp21_;
		GeeArrayList* _tmp22_;
		gint _tmp23_;
		gint _tmp24_;
		_tmp18_ = tuba_accounts;
		_tmp19_ = tuba_account_store_get_active (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = tuba_instance_account_get_instance_emojis (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp22_);
		_tmp24_ = _tmp23_;
		_tmp12_ = _tmp24_ > 0;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		TubaWidgetsCustomEmojiChooserV2* custom_emoji_picker = NULL;
		TubaWidgetsCustomEmojiChooserV2* _tmp25_;
		gchar* _tmp26_;
		TubaWidgetsCustomEmojiChooserV2* _tmp27_;
		GtkPopover* _tmp28_;
		gchar* _tmp29_;
		GtkMenuButton* _tmp30_ = NULL;
		AdwWrapBox* _tmp31_;
		GtkMenuButton* _tmp32_;
		TubaWidgetsCustomEmojiChooserV2* _tmp33_;
		_tmp25_ = tuba_widgets_custom_emoji_chooser_v2_new ();
		g_object_ref_sink (_tmp25_);
		custom_emoji_picker = _tmp25_;
		_tmp26_ = g_strdup ("tuba-cat-symbolic");
		_tmp27_ = custom_emoji_picker;
		_tmp28_ = _g_object_ref0 ((GtkPopover*) _tmp27_);
		_tmp29_ = g_strdup (_ ("Custom Emoji Picker"));
		_tmp30_ = (GtkMenuButton*) gtk_menu_button_new ();
		gtk_menu_button_set_icon_name (_tmp30_, _tmp26_);
		_g_free0 (_tmp26_);
		gtk_menu_button_set_popover (_tmp30_, _tmp28_);
		_g_object_unref0 (_tmp28_);
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp30_, _tmp29_);
		_g_free0 (_tmp29_);
		g_object_ref_sink (_tmp30_);
		_g_object_unref0 (self->priv->custom_emoji_button);
		self->priv->custom_emoji_button = _tmp30_;
		_tmp31_ = self->priv->reaction_box;
		_tmp32_ = self->priv->custom_emoji_button;
		adw_wrap_box_append (_tmp31_, (GtkWidget*) _tmp32_);
		_tmp33_ = custom_emoji_picker;
		g_signal_connect_object (_tmp33_, "emoji-picked", (GCallback) _tuba_widgets_reactions_row_on_custom_emoji_picked_tuba_widgets_custom_emoji_chooser_v2_emoji_picked, self, 0);
		_g_object_unref0 (custom_emoji_picker);
	}
	_g_object_unref0 (emoji_picker);
	return obj;
}

static void
tuba_widgets_reactions_row_class_init (TubaWidgetsReactionsRowClass * klass,
                                       gpointer klass_data)
{
	tuba_widgets_reactions_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsReactionsRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_reactions_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_reactions_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_reactions_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_reactions_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY, tuba_widgets_reactions_row_properties[TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY] = g_param_spec_boolean ("is-announcement", "is-announcement", "is-announcement", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_widgets_reactions_row_instance_init (TubaWidgetsReactionsRow * self,
                                          gpointer klass)
{
	self->priv = tuba_widgets_reactions_row_get_instance_private (self);
	self->priv->_is_announcement = FALSE;
}

static void
tuba_widgets_reactions_row_finalize (GObject * obj)
{
	TubaWidgetsReactionsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	_g_object_unref0 (self->priv->reaction_box);
	_g_object_unref0 (self->priv->react_btn_list);
	_g_object_unref0 (self->priv->emoji_button);
	_g_object_unref0 (self->priv->custom_emoji_button);
	_g_free0 (self->priv->status_id);
	G_OBJECT_CLASS (tuba_widgets_reactions_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_reactions_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsReactionsRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_reactions_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsReactionsRow), 0, (GInstanceInitFunc) tuba_widgets_reactions_row_instance_init, NULL };
	GType tuba_widgets_reactions_row_type_id;
	tuba_widgets_reactions_row_type_id = g_type_register_static (adw_bin_get_type (), "TubaWidgetsReactionsRow", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsReactionsRow_private_offset = g_type_add_instance_private (tuba_widgets_reactions_row_type_id, sizeof (TubaWidgetsReactionsRowPrivate));
	return tuba_widgets_reactions_row_type_id;
}

GType
tuba_widgets_reactions_row_get_type (void)
{
	static GType tuba_widgets_reactions_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_reactions_row_type_id__once)) {
		GType tuba_widgets_reactions_row_type_id;
		tuba_widgets_reactions_row_type_id = tuba_widgets_reactions_row_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_reactions_row_type_id__once, tuba_widgets_reactions_row_type_id);
	}
	return tuba_widgets_reactions_row_type_id__once;
}

static void
_vala_tuba_widgets_reactions_row_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	TubaWidgetsReactionsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	switch (property_id) {
		case TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_reactions_row_get_is_announcement (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_reactions_row_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	TubaWidgetsReactionsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	switch (property_id) {
		case TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY:
		tuba_widgets_reactions_row_set_is_announcement (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

