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

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

#define TUBA_DIALOGS_COLLECTIONS_MAX_MEMBERS 25
#define BUILD_RESOURCES "/dev/geopjr/Tuba/"
#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_DIALOGS_TYPE_COLLECTIONS (tuba_dialogs_collections_get_type ())
#define TUBA_DIALOGS_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_COLLECTIONS, TubaDialogsCollections))
#define TUBA_DIALOGS_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_COLLECTIONS, TubaDialogsCollectionsClass))
#define TUBA_DIALOGS_IS_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_COLLECTIONS))
#define TUBA_DIALOGS_IS_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_COLLECTIONS))
#define TUBA_DIALOGS_COLLECTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_COLLECTIONS, TubaDialogsCollectionsClass))

typedef struct _TubaDialogsCollections TubaDialogsCollections;
typedef struct _TubaDialogsCollectionsClass TubaDialogsCollectionsClass;
typedef struct _TubaDialogsCollectionsPrivate TubaDialogsCollectionsPrivate;

#define TUBA_WIDGETS_TYPE_ACCOUNT_ROW (tuba_widgets_account_row_get_type ())
#define TUBA_WIDGETS_ACCOUNT_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_ROW, TubaWidgetsAccountRow))
#define TUBA_WIDGETS_ACCOUNT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_ACCOUNT_ROW, TubaWidgetsAccountRowClass))
#define TUBA_WIDGETS_IS_ACCOUNT_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_ROW))
#define TUBA_WIDGETS_IS_ACCOUNT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_ACCOUNT_ROW))
#define TUBA_WIDGETS_ACCOUNT_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_ACCOUNT_ROW, TubaWidgetsAccountRowClass))

typedef struct _TubaWidgetsAccountRow TubaWidgetsAccountRow;
typedef struct _TubaWidgetsAccountRowClass TubaWidgetsAccountRowClass;

#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;
enum  {
	TUBA_DIALOGS_COLLECTIONS_0_PROPERTY,
	TUBA_DIALOGS_COLLECTIONS_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_collections_properties[TUBA_DIALOGS_COLLECTIONS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
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_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_TYPE_OOPSIE (tuba_oopsie_get_type ())
typedef struct _TubaDialogsCollectionsPatchCollectionData TubaDialogsCollectionsPatchCollectionData;
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaDialogsCollectionsPatchEntryRowData TubaDialogsCollectionsPatchEntryRowData;

#define TUBA_UTILS_LOCALES_TYPE_LOCALE (tuba_utils_locales_locale_get_type ())
#define TUBA_UTILS_LOCALES_LOCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_UTILS_LOCALES_TYPE_LOCALE, TubaUtilsLocalesLocale))
#define TUBA_UTILS_LOCALES_LOCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_UTILS_LOCALES_TYPE_LOCALE, TubaUtilsLocalesLocaleClass))
#define TUBA_UTILS_LOCALES_IS_LOCALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_UTILS_LOCALES_TYPE_LOCALE))
#define TUBA_UTILS_LOCALES_IS_LOCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_UTILS_LOCALES_TYPE_LOCALE))
#define TUBA_UTILS_LOCALES_LOCALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_UTILS_LOCALES_TYPE_LOCALE, TubaUtilsLocalesLocaleClass))

typedef struct _TubaUtilsLocalesLocale TubaUtilsLocalesLocale;
typedef struct _TubaUtilsLocalesLocaleClass TubaUtilsLocalesLocaleClass;

#define TUBA_API_TYPE_COLLECTION (tuba_api_collection_get_type ())
#define TUBA_API_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_COLLECTION, TubaAPICollection))
#define TUBA_API_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_COLLECTION, TubaAPICollectionClass))
#define TUBA_API_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_COLLECTION))
#define TUBA_API_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_COLLECTION))
#define TUBA_API_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_COLLECTION, TubaAPICollectionClass))

typedef struct _TubaAPICollection TubaAPICollection;
typedef struct _TubaAPICollectionClass TubaAPICollectionClass;

#define TUBA_API_COLLECTION_TYPE_TAG (tuba_api_collection_tag_get_type ())
#define TUBA_API_COLLECTION_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_COLLECTION_TYPE_TAG, TubaAPICollectionTag))
#define TUBA_API_COLLECTION_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_COLLECTION_TYPE_TAG, TubaAPICollectionTagClass))
#define TUBA_API_COLLECTION_IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_COLLECTION_TYPE_TAG))
#define TUBA_API_COLLECTION_IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_COLLECTION_TYPE_TAG))
#define TUBA_API_COLLECTION_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_COLLECTION_TYPE_TAG, TubaAPICollectionTagClass))

typedef struct _TubaAPICollectionTag TubaAPICollectionTag;
typedef struct _TubaAPICollectionTagClass TubaAPICollectionTagClass;
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))

#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 TUBA_UTILS_TYPE_LOCALES (tuba_utils_locales_get_type ())
#define TUBA_UTILS_LOCALES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_UTILS_TYPE_LOCALES, TubaUtilsLocales))
#define TUBA_UTILS_LOCALES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_UTILS_TYPE_LOCALES, TubaUtilsLocalesClass))
#define TUBA_UTILS_IS_LOCALES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_UTILS_TYPE_LOCALES))
#define TUBA_UTILS_IS_LOCALES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_UTILS_TYPE_LOCALES))
#define TUBA_UTILS_LOCALES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_UTILS_TYPE_LOCALES, TubaUtilsLocalesClass))

typedef struct _TubaUtilsLocales TubaUtilsLocales;
typedef struct _TubaUtilsLocalesClass TubaUtilsLocalesClass;
typedef struct _TubaUtilsLocalesPrivate TubaUtilsLocalesPrivate;

#define TUBA_TYPE_SETTINGS (tuba_settings_get_type ())
#define TUBA_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_SETTINGS, TubaSettings))
#define TUBA_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_SETTINGS, TubaSettingsClass))
#define TUBA_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_SETTINGS))
#define TUBA_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_SETTINGS))
#define TUBA_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_SETTINGS, TubaSettingsClass))

typedef struct _TubaSettings TubaSettings;
typedef struct _TubaSettingsClass TubaSettingsClass;

#define TUBA_API_COLLECTION_TYPE_ITEM (tuba_api_collection_item_get_type ())
#define TUBA_API_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_COLLECTION_TYPE_ITEM, TubaAPICollectionItem))
#define TUBA_API_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_COLLECTION_TYPE_ITEM, TubaAPICollectionItemClass))
#define TUBA_API_COLLECTION_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_COLLECTION_TYPE_ITEM))
#define TUBA_API_COLLECTION_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_COLLECTION_TYPE_ITEM))
#define TUBA_API_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_COLLECTION_TYPE_ITEM, TubaAPICollectionItemClass))

typedef struct _TubaAPICollectionItem TubaAPICollectionItem;
typedef struct _TubaAPICollectionItemClass TubaAPICollectionItemClass;
typedef struct _Block24Data Block24Data;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef void (*TubaNetworkNodeCallback) (JsonNode* node, gpointer user_data, GError** error);
typedef struct _TubaDialogsCollectionsFetchAccountsRealData TubaDialogsCollectionsFetchAccountsRealData;
typedef struct _Block25Data Block25Data;
typedef struct _Block26Data Block26Data;
typedef struct _TubaDialogsCollectionsCreateCollectionRealData TubaDialogsCollectionsCreateCollectionRealData;

#define TUBA_API_ACCOUNT_TYPE_FEATURE_APPROVAL (tuba_api_account_feature_approval_get_type ())
#define TUBA_API_ACCOUNT_FEATURE_APPROVAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ACCOUNT_TYPE_FEATURE_APPROVAL, TubaAPIAccountFeatureApproval))
#define TUBA_API_ACCOUNT_FEATURE_APPROVAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ACCOUNT_TYPE_FEATURE_APPROVAL, TubaAPIAccountFeatureApprovalClass))
#define TUBA_API_ACCOUNT_IS_FEATURE_APPROVAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ACCOUNT_TYPE_FEATURE_APPROVAL))
#define TUBA_API_ACCOUNT_IS_FEATURE_APPROVAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ACCOUNT_TYPE_FEATURE_APPROVAL))
#define TUBA_API_ACCOUNT_FEATURE_APPROVAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ACCOUNT_TYPE_FEATURE_APPROVAL, TubaAPIAccountFeatureApprovalClass))

typedef struct _TubaAPIAccountFeatureApproval TubaAPIAccountFeatureApproval;
typedef struct _TubaAPIAccountFeatureApprovalClass TubaAPIAccountFeatureApprovalClass;
typedef struct _TubaDialogsCollectionsUpdateSearchResultsRealData TubaDialogsCollectionsUpdateSearchResultsRealData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define TUBA_API_TYPE_SEARCH_RESULTS (tuba_api_search_results_get_type ())
#define TUBA_API_SEARCH_RESULTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_SEARCH_RESULTS, TubaAPISearchResults))
#define TUBA_API_SEARCH_RESULTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_SEARCH_RESULTS, TubaAPISearchResultsClass))
#define TUBA_API_IS_SEARCH_RESULTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_SEARCH_RESULTS))
#define TUBA_API_IS_SEARCH_RESULTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_SEARCH_RESULTS))
#define TUBA_API_SEARCH_RESULTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_SEARCH_RESULTS, TubaAPISearchResultsClass))

typedef struct _TubaAPISearchResults TubaAPISearchResults;
typedef struct _TubaAPISearchResultsClass TubaAPISearchResultsClass;

#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 __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))

#define TUBA_API_TYPE_TAG (tuba_api_tag_get_type ())
#define TUBA_API_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_TAG, TubaAPITag))
#define TUBA_API_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_TAG, TubaAPITagClass))
#define TUBA_API_IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_TAG))
#define TUBA_API_IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_TAG))
#define TUBA_API_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_TAG, TubaAPITagClass))

typedef struct _TubaAPITag TubaAPITag;
typedef struct _TubaAPITagClass TubaAPITagClass;

#define TUBA_WIDGETS_TYPE_TAG (tuba_widgets_tag_get_type ())
#define TUBA_WIDGETS_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_TAG, TubaWidgetsTag))
#define TUBA_WIDGETS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_TAG, TubaWidgetsTagClass))
#define TUBA_WIDGETS_IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_TAG))
#define TUBA_WIDGETS_IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_TAG))
#define TUBA_WIDGETS_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_TAG, TubaWidgetsTagClass))

typedef struct _TubaWidgetsTag TubaWidgetsTag;
typedef struct _TubaWidgetsTagClass TubaWidgetsTagClass;
typedef struct _TubaDialogsCollectionsUpdateTagSearchResultsRealData TubaDialogsCollectionsUpdateTagSearchResultsRealData;

#define TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM (tuba_api_wrapped_collection_item_get_type ())
#define TUBA_API_WRAPPED_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM, TubaAPIWrappedCollectionItem))
#define TUBA_API_WRAPPED_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM, TubaAPIWrappedCollectionItemClass))
#define TUBA_API_IS_WRAPPED_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM))
#define TUBA_API_IS_WRAPPED_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM))
#define TUBA_API_WRAPPED_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM, TubaAPIWrappedCollectionItemClass))

typedef struct _TubaAPIWrappedCollectionItem TubaAPIWrappedCollectionItem;
typedef struct _TubaAPIWrappedCollectionItemClass TubaAPIWrappedCollectionItemClass;
typedef struct _TubaDialogsCollectionsPostAccountRealData TubaDialogsCollectionsPostAccountRealData;
typedef struct _TubaDialogsCollectionsDeleteAccountRealData TubaDialogsCollectionsDeleteAccountRealData;
enum  {
	TUBA_DIALOGS_COLLECTIONS_REFRESH_SIGNAL,
	TUBA_DIALOGS_COLLECTIONS_NUM_SIGNALS
};
static guint tuba_dialogs_collections_signals[TUBA_DIALOGS_COLLECTIONS_NUM_SIGNALS] = {0};

struct _TubaDialogsCollections {
	AdwPreferencesDialog parent_instance;
	TubaDialogsCollectionsPrivate * priv;
};

struct _TubaDialogsCollectionsClass {
	AdwPreferencesDialogClass parent_class;
};

struct _TubaDialogsCollectionsPrivate {
	gboolean edit_mode;
	gchar* collection_id;
	AdwEntryRow* name_row;
	AdwEntryRow* description_row;
	AdwEntryRow* topic_row;
	AdwPreferencesGroup* search_group;
	AdwPreferencesGroup* details_group;
	TubaWidgetsAccountRow** search_results;
	gint search_results_length1;
	gint _search_results_size_;
	GtkWidget** tag_results;
	gint tag_results_length1;
	gint _tag_results_size_;
	AdwEntryRow* search_row;
	AdwPreferencesGroup* members_group;
	GeeHashMap* members;
	GeeHashMap* members_collection_items;
	GtkCheckButton* cw_checkbox;
	GtkCheckButton* public_checkbox;
	GtkCheckButton* unlisted_checkbox;
	AdwComboRow* lang_row;
	gchar* last_name;
	gchar* last_description;
	guint last_lang;
	gchar* last_topic;
	gboolean last_cw;
	gboolean last_disco;
	guint search_timeout_id;
	TubaRequestV2* last_search_req;
	guint tag_timeout_id;
	TubaRequestV2* last_tag_req;
};

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 _TubaDialogsCollectionsPatchCollectionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	gchar* key;
	gchar* value;
	gboolean result;
	TubaRequestV2* req;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	TubaAccountStore* _tmp4_;
	TubaInstanceAccount* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaRequestV2* _tmp8_;
	TubaRequestV2* _tmp9_;
	TubaRequestV2* _tmp10_;
	TubaRequestV2* _tmp11_;
	GInputStream* _tmp12_;
	GInputStream* _tmp13_;
	GError* _inner_error0_;
};

struct _Block21Data {
	int _ref_count_;
	TubaDialogsCollections* self;
	AdwEntryRow* row;
};

struct _Block22Data {
	int _ref_count_;
	TubaDialogsCollections* self;
	AdwEntryRow* row;
};

struct _Block23Data {
	int _ref_count_;
	TubaDialogsCollections* self;
	AdwEntryRow* row;
};

struct _TubaDialogsCollectionsPatchEntryRowData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	gchar* key;
	AdwEntryRow* row;
	gboolean result;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	AdwToast* _tmp5_;
	const gchar* _tmp6_;
	GError* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GError* _inner_error0_;
};

struct _TubaUtilsLocales {
	GObject parent_instance;
	TubaUtilsLocalesPrivate * priv;
	GListStore* list_store;
};

struct _TubaUtilsLocalesClass {
	GObjectClass parent_class;
};

struct _Block24Data {
	int _ref_count_;
	TubaDialogsCollections* self;
	gchar** accounts_arr;
	gint accounts_arr_length1;
	gint _accounts_arr_size_;
	GHashTable* states;
	gpointer _async_data_;
};

struct _TubaDialogsCollectionsFetchAccountsRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	GtkWidget* members_page;
	TubaAPICollection* collection;
	Block24Data* _data24_;
	gchar** _tmp0_;
	GHashFunc _tmp1_;
	GEqualFunc _tmp2_;
	GHashTable* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	TubaRequestV2* req;
	gchar** _tmp6_;
	gint _tmp6__length1;
	gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	TubaAccountStore* _tmp12_;
	TubaInstanceAccount* _tmp13_;
	TubaInstanceAccount* _tmp14_;
	TubaInstanceAccount* _tmp15_;
	TubaRequestV2* _tmp16_;
	TubaRequestV2* _tmp17_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp18_;
	GInputStream* _tmp19_;
	JsonParser* parser;
	GInputStream* _tmp20_;
	JsonParser* _tmp21_;
	JsonParser* _tmp22_;
	GError* e;
	GError* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	GError* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	GError* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	AdwToast* _tmp35_;
	GError* _inner_error0_;
};

struct _Block25Data {
	int _ref_count_;
	TubaDialogsCollections* self;
	AdwAlertDialog* dlg;
};

struct _Block26Data {
	int _ref_count_;
	TubaDialogsCollections* self;
	JsonBuilder* builder;
};

struct _TubaDialogsCollectionsCreateCollectionRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	TubaRequestV2* req;
	GInputStream* _tmp0_;
	GInputStream* _tmp1_;
	GError* e;
	GError* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GError* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _tmp10_;
	const gchar* _tmp11_;
	AdwToast* _tmp12_;
	GError* _inner_error0_;
};

struct _TubaDialogsCollectionsUpdateSearchResultsRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	gchar* query;
	TubaWidgetsAccountRow** _tmp0_;
	gint _tmp0__length1;
	TubaWidgetsAccountRow** widg_collection;
	gint widg_collection_length1;
	gint _widg_collection_size_;
	gint widg_it;
	TubaWidgetsAccountRow* _tmp1_;
	TubaWidgetsAccountRow* widg;
	AdwPreferencesGroup* _tmp2_;
	TubaWidgetsAccountRow* _tmp3_;
	TubaWidgetsAccountRow** _tmp4_;
	TubaRequestV2* _tmp5_;
	TubaRequestV2* _tmp6_;
	GCancellable* _tmp7_;
	GCancellable* _tmp8_;
	TubaRequestV2* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	TubaRequestV2* _tmp12_;
	TubaRequestV2* _tmp13_;
	TubaRequestV2* _tmp14_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp15_;
	GInputStream* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	TubaWidgetsAccountRow** _tmp19_;
	gint _tmp19__length1;
	TubaRequestV2* _tmp20_;
	TubaRequestV2* _tmp21_;
	GCancellable* _tmp22_;
	GCancellable* _tmp23_;
	JsonParser* parser;
	GInputStream* _tmp24_;
	JsonParser* _tmp25_;
	JsonParser* _tmp26_;
	GError* _inner_error0_;
};

struct _TubaDialogsCollectionsUpdateTagSearchResultsRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	gchar* query;
	GtkWidget** _tmp0_;
	gint _tmp0__length1;
	GtkWidget** widg_collection;
	gint widg_collection_length1;
	gint _widg_collection_size_;
	gint widg_it;
	GtkWidget* _tmp1_;
	GtkWidget* widg;
	AdwPreferencesGroup* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget** _tmp4_;
	TubaRequestV2* _tmp5_;
	TubaRequestV2* _tmp6_;
	GCancellable* _tmp7_;
	GCancellable* _tmp8_;
	TubaRequestV2* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	TubaRequestV2* _tmp12_;
	TubaRequestV2* _tmp13_;
	TubaRequestV2* _tmp14_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp15_;
	GInputStream* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	GtkWidget** _tmp19_;
	gint _tmp19__length1;
	TubaRequestV2* _tmp20_;
	TubaRequestV2* _tmp21_;
	GCancellable* _tmp22_;
	GCancellable* _tmp23_;
	JsonParser* parser;
	GInputStream* _tmp24_;
	JsonParser* _tmp25_;
	TubaAPISearchResults* results;
	TubaNetwork* _tmp26_;
	JsonParser* _tmp27_;
	JsonNode* _tmp28_;
	JsonNode* _tmp29_;
	TubaAPISearchResults* _tmp30_;
	TubaAPISearchResults* _tmp31_;
	TubaAPISearchResults* _tmp32_;
	TubaAPISearchResults* _tmp33_;
	GeeArrayList* _tmp34_;
	GeeArrayList* _tmp35_;
	GError* _inner_error0_;
};

struct _TubaDialogsCollectionsPostAccountRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	TubaRequestV2* req;
	TubaWidgetsAccountRow* member_row;
	GInputStream* in_stream;
	GInputStream* _tmp0_;
	JsonParser* parser;
	GInputStream* _tmp1_;
	JsonParser* _tmp2_;
	JsonNode* node;
	TubaNetwork* _tmp3_;
	JsonParser* _tmp4_;
	JsonNode* _tmp5_;
	TubaAPIWrappedCollectionItem* ci;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	TubaEntity* _tmp8_;
	TubaAPIAccount* _tmp9_;
	TubaAPIAccount* _tmp10_;
	TubaAPIWrappedCollectionItem* _tmp11_;
	TubaAPICollectionItem* _tmp12_;
	TubaAPICollectionItem* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	GeeHashMap* _tmp16_;
	TubaAPIAccount* _tmp17_;
	TubaAPIAccount* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	TubaAPIWrappedCollectionItem* _tmp21_;
	TubaAPICollectionItem* _tmp22_;
	TubaAPICollectionItem* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	GError* e;
	GError* _tmp26_;
	const gchar* _tmp27_;
	AdwToast* _tmp28_;
	GError* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	guint _tmp37_;
	GError* _inner_error0_;
};

struct _TubaDialogsCollectionsDeleteAccountRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsCollections* self;
	TubaRequestV2* req;
	TubaWidgetsAccountRow* member_row;
	GInputStream* _tmp0_;
	GInputStream* _tmp1_;
	TubaAPIAccount* _tmp2_;
	TubaAPIAccount* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	AdwToast* _tmp8_;
	GError* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GError* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	guint _tmp17_;
	GError* _inner_error0_;
};

static gint TubaDialogsCollections_private_offset;
static gpointer tuba_dialogs_collections_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaSettings* tuba_settings;
VALA_EXTERN GEqualFunc tuba_utils_locales_locale_compare;
VALA_EXTERN TubaNetwork* tuba_network;

VALA_EXTERN GType tuba_dialogs_collections_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsCollections, g_object_unref)
VALA_EXTERN GType tuba_widgets_account_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAccountRow, g_object_unref)
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
static void tuba_dialogs_collections_clear (TubaDialogsCollections* self);
static void tuba_dialogs_collections_on_closed (TubaDialogsCollections* self);
static void tuba_dialogs_collections_patch_collection_data_free (gpointer _data);
static void tuba_dialogs_collections_patch_collection (TubaDialogsCollections* self,
                                                const gchar* key,
                                                const gchar* value,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static gboolean tuba_dialogs_collections_patch_collection_finish (TubaDialogsCollections* self,
                                                           GAsyncResult* _res_,
                                                           GError** error);
static gboolean tuba_dialogs_collections_patch_collection_co (TubaDialogsCollectionsPatchCollectionData* _data_);
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
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 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 void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_add_form_data (TubaRequestV2* self,
                                    const gchar* name,
                                    const gchar* val);
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_dialogs_collections_patch_collection_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void tuba_dialogs_collections_update_collection_name (TubaDialogsCollections* self,
                                                      AdwEntryRow* row);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static void tuba_dialogs_collections_patch_entry_row (TubaDialogsCollections* self,
                                               const gchar* key,
                                               AdwEntryRow* row,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static gboolean tuba_dialogs_collections_patch_entry_row_finish (TubaDialogsCollections* self,
                                                          GAsyncResult* _res_);
static void __lambda47_ (Block21Data* _data21_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda47__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void tuba_dialogs_collections_update_collection_description (TubaDialogsCollections* self,
                                                             AdwEntryRow* row);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static void __lambda48_ (Block22Data* _data22_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda48__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void tuba_dialogs_collections_update_collection_topic (TubaDialogsCollections* self,
                                                       AdwEntryRow* row);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static void __lambda49_ (Block23Data* _data23_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda49__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void tuba_dialogs_collections_patch_entry_row_data_free (gpointer _data);
static gboolean tuba_dialogs_collections_patch_entry_row_co (TubaDialogsCollectionsPatchEntryRowData* _data_);
static void tuba_dialogs_collections_patch_entry_row_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void tuba_dialogs_collections_on_lang_changed (TubaDialogsCollections* self);
VALA_EXTERN GType tuba_utils_locales_locale_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaUtilsLocalesLocale, g_object_unref)
VALA_EXTERN const gchar* tuba_utils_locales_locale_get_locale (TubaUtilsLocalesLocale* self);
static void __lambda51_ (TubaDialogsCollections* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda51__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void tuba_dialogs_collections_on_sensitive_changed (TubaDialogsCollections* self);
static void __lambda52_ (TubaDialogsCollections* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda52__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void tuba_dialogs_collections_on_disc_changed (TubaDialogsCollections* self);
static void __lambda53_ (TubaDialogsCollections* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda53__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
VALA_EXTERN GType tuba_api_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPICollection, g_object_unref)
VALA_EXTERN TubaDialogsCollections* tuba_dialogs_collections_new (TubaAPICollection* collection);
VALA_EXTERN TubaDialogsCollections* tuba_dialogs_collections_construct (GType object_type,
                                                            TubaAPICollection* collection);
VALA_EXTERN const gchar* tuba_api_collection_get_id (TubaAPICollection* self);
static void _tuba_dialogs_collections_on_closed_adw_dialog_closed (AdwDialog* _sender,
                                                            gpointer self);
VALA_EXTERN const gchar* tuba_api_collection_get_name (TubaAPICollection* self);
static void _tuba_dialogs_collections_update_collection_name_adw_entry_row_apply (AdwEntryRow* _sender,
                                                                           gpointer self);
VALA_EXTERN const gchar* tuba_api_collection_get_description (TubaAPICollection* self);
static void _tuba_dialogs_collections_update_collection_description_adw_entry_row_apply (AdwEntryRow* _sender,
                                                                                  gpointer self);
VALA_EXTERN GType tuba_api_collection_tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPICollectionTag, g_object_unref)
VALA_EXTERN TubaAPICollectionTag* tuba_api_collection_get_tag (TubaAPICollection* self);
VALA_EXTERN const gchar* tuba_api_collection_tag_get_name (TubaAPICollectionTag* self);
static void _tuba_dialogs_collections_update_collection_topic_adw_entry_row_apply (AdwEntryRow* _sender,
                                                                            gpointer self);
static void tuba_dialogs_collections_on_tag_search_changed (TubaDialogsCollections* self);
static void _tuba_dialogs_collections_on_tag_search_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                           gpointer self);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN GType tuba_utils_locales_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaUtilsLocales, g_object_unref)
VALA_EXTERN TubaUtilsLocales* tuba_application_get_app_locales (TubaApplication* self);
VALA_EXTERN GType tuba_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaSettings, g_object_unref)
VALA_EXTERN const gchar* tuba_settings_get_default_language (TubaSettings* self);
VALA_EXTERN const gchar* tuba_api_collection_get_language (TubaAPICollection* self);
VALA_EXTERN TubaUtilsLocalesLocale* tuba_utils_locales_locale_new (const gchar* locale,
                                                       const gchar* en_name,
                                                       const gchar* name);
VALA_EXTERN TubaUtilsLocalesLocale* tuba_utils_locales_locale_construct (GType object_type,
                                                             const gchar* locale,
                                                             const gchar* en_name,
                                                             const gchar* name);
static void _tuba_dialogs_collections_on_lang_changed_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
VALA_EXTERN gboolean tuba_api_collection_get_discoverable (TubaAPICollection* self);
VALA_EXTERN gboolean tuba_api_collection_get_sensitive (TubaAPICollection* self);
static void tuba_dialogs_collections_on_search_changed (TubaDialogsCollections* self);
static void _tuba_dialogs_collections_on_search_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                       gpointer self);
static void tuba_dialogs_collections_update_member_metadata (TubaDialogsCollections* self);
static void tuba_dialogs_collections_on_close_attempt (TubaDialogsCollections* self);
static void _tuba_dialogs_collections_on_close_attempt_adw_dialog_close_attempt (AdwDialog* _sender,
                                                                          gpointer self);
static void _tuba_dialogs_collections_on_sensitive_changed_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                              gpointer self);
static void _tuba_dialogs_collections_on_disc_changed_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                         gpointer self);
VALA_EXTERN GType tuba_api_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPICollectionItem, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_api_collection_get_items (TubaAPICollection* self);
static void tuba_dialogs_collections_fetch_accounts_real (TubaDialogsCollections* self,
                                                   GtkWidget* members_page,
                                                   TubaAPICollection* collection,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void tuba_dialogs_collections_fetch_accounts_real_finish (TubaDialogsCollections* self,
                                                          GAsyncResult* _res_);
static void tuba_dialogs_collections_fetch_accounts_real_data_free (gpointer _data);
static gboolean tuba_dialogs_collections_fetch_accounts_real_co (TubaDialogsCollectionsFetchAccountsRealData* _data_);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static void _g_free0_ (gpointer var);
static gboolean __lambda60_ (Block24Data* _data24_,
                      TubaAPICollectionItem* e);
VALA_EXTERN const gchar* tuba_api_collection_item_get_account_id (TubaAPICollectionItem* self);
static void _vala_array_add10 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN const gchar* tuba_api_collection_item_get_id (TubaAPICollectionItem* self);
VALA_EXTERN const gchar* tuba_api_collection_item_get_state (TubaAPICollectionItem* self);
static gboolean ___lambda60__gee_forall_func (gpointer g,
                                       gpointer self);
static void tuba_dialogs_collections_fetch_accounts_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 void tuba_network_parse_array (JsonParser* parser,
                               TubaNetworkNodeCallback cb,
                               gpointer cb_target,
                               GDestroyNotify cb_target_destroy_notify,
                               GError** error);
static void ___lambda61_ (Block24Data* _data24_,
                   JsonNode* node,
                   GError** error);
VALA_EXTERN TubaAPIAccount* tuba_api_account_from (JsonNode* node,
                                       GError** error);
static void tuba_dialogs_collections_add_account (TubaDialogsCollections* self,
                                           TubaAPIAccount* acc,
                                           gboolean pending);
VALA_EXTERN const gchar* tuba_api_account_get_id (TubaAPIAccount* self);
static void ____lambda61__tuba_network_node_callback (JsonNode* node,
                                               gpointer self,
                                               GError** error);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static void __lambda58_ (Block25Data* _data25_,
                  GObject* obj,
                  GAsyncResult* res);
static void tuba_dialogs_collections_create_collection (TubaDialogsCollections* self);
static void ___lambda58__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static gboolean __lambda59_ (Block26Data* _data26_,
                      GeeMapEntry* e);
static gboolean ___lambda59__gee_forall_func (gpointer g,
                                       gpointer self);
VALA_EXTERN void tuba_request_v2_set_body_from_json (TubaRequestV2* self,
                                         JsonBuilder* json_builder);
static void tuba_dialogs_collections_create_collection_real (TubaDialogsCollections* self,
                                                      TubaRequestV2* req,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static void tuba_dialogs_collections_create_collection_real_finish (TubaDialogsCollections* self,
                                                             GAsyncResult* _res_);
static void tuba_dialogs_collections_create_collection_real_data_free (gpointer _data);
static gboolean tuba_dialogs_collections_create_collection_real_co (TubaDialogsCollectionsCreateCollectionRealData* _data_);
static void tuba_dialogs_collections_create_collection_real_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_);
VALA_EXTERN TubaAPIAccount* tuba_widgets_account_row_get_account (TubaWidgetsAccountRow* self);
VALA_EXTERN void tuba_widgets_account_row_set_checkbox_active (TubaWidgetsAccountRow* self,
                                                   gboolean value);
VALA_EXTERN gboolean tuba_widgets_account_row_get_checkbox_active (TubaWidgetsAccountRow* self);
VALA_EXTERN void tuba_widgets_account_row_set_checkbox_sensitive (TubaWidgetsAccountRow* self,
                                                      gboolean value);
static gboolean tuba_dialogs_collections_update_search_results (TubaDialogsCollections* self);
static gboolean _tuba_dialogs_collections_update_search_results_gsource_func (gpointer self);
static void tuba_dialogs_collections_update_search_results_real (TubaDialogsCollections* self,
                                                          const gchar* query,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static void tuba_dialogs_collections_update_search_results_real_finish (TubaDialogsCollections* self,
                                                                 GAsyncResult* _res_,
                                                                 GError** error);
static void __lambda57_ (TubaDialogsCollections* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda57__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void tuba_dialogs_collections_update_search_results_real_data_free (gpointer _data);
static gboolean tuba_dialogs_collections_update_search_results_real_co (TubaDialogsCollectionsUpdateSearchResultsRealData* _data_);
VALA_EXTERN GCancellable* tuba_request_v2_get_cancellable (TubaRequestV2* self);
VALA_EXTERN TubaRequestV2* tuba_api_account_search (const gchar* query,
                                        GError** error);
static void tuba_dialogs_collections_update_search_results_real_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void __lambda56_ (TubaDialogsCollections* self,
                  JsonNode* node,
                  GError** error);
VALA_EXTERN TubaEntity* tuba_helper_entity_from_json (JsonNode* node,
                                          GType type,
                                          gboolean force);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
VALA_EXTERN TubaWidgetsAccountRow* tuba_widgets_account_row_new (TubaAPIAccount* account,
                                                     gboolean open_only);
VALA_EXTERN TubaWidgetsAccountRow* tuba_widgets_account_row_construct (GType object_type,
                                                           TubaAPIAccount* account,
                                                           gboolean open_only);
VALA_EXTERN void tuba_widgets_account_row_add_checkbox (TubaWidgetsAccountRow* self,
                                            const gchar* tooltip_text);
static void tuba_dialogs_collections_on_account_toggled (TubaDialogsCollections* self,
                                                  TubaWidgetsAccountRow* member_row,
                                                  gboolean new_state);
static void _tuba_dialogs_collections_on_account_toggled_tuba_widgets_account_row_checkbox_toggled (TubaWidgetsAccountRow* _sender,
                                                                                             gboolean new_state,
                                                                                             gpointer self);
VALA_EXTERN GType tuba_api_account_feature_approval_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccountFeatureApproval, g_object_unref)
VALA_EXTERN TubaAPIAccountFeatureApproval* tuba_api_account_get_feature_approval (TubaAPIAccount* self);
VALA_EXTERN gboolean tuba_api_account_feature_approval_get_tuba_can_invite (TubaAPIAccountFeatureApproval* self);
static void _vala_array_add11 (TubaWidgetsAccountRow** * array,
                        gint* length,
                        gint* size,
                        TubaWidgetsAccountRow* value);
static void ___lambda56__tuba_network_node_callback (JsonNode* node,
                                              gpointer self,
                                              GError** error);
static gboolean tuba_dialogs_collections_update_tag_search_results (TubaDialogsCollections* self);
static gboolean _tuba_dialogs_collections_update_tag_search_results_gsource_func (gpointer self);
static void tuba_dialogs_collections_update_tag_search_results_real (TubaDialogsCollections* self,
                                                              const gchar* query,
                                                              GAsyncReadyCallback _callback_,
                                                              gpointer _user_data_);
static void tuba_dialogs_collections_update_tag_search_results_real_finish (TubaDialogsCollections* self,
                                                                     GAsyncResult* _res_,
                                                                     GError** error);
static void __lambda55_ (TubaDialogsCollections* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda55__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void tuba_dialogs_collections_update_tag_search_results_real_data_free (gpointer _data);
static gboolean tuba_dialogs_collections_update_tag_search_results_real_co (TubaDialogsCollectionsUpdateTagSearchResultsRealData* _data_);
VALA_EXTERN TubaRequestV2* tuba_api_tag_search (const gchar* query,
                                    GError** error);
static void tuba_dialogs_collections_update_tag_search_results_real_ready (GObject* source_object,
                                                                    GAsyncResult* _res_,
                                                                    gpointer _user_data_);
VALA_EXTERN GType tuba_api_search_results_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPISearchResults, g_object_unref)
VALA_EXTERN TubaAPISearchResults* tuba_api_search_results_from (JsonNode* node,
                                                    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);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN GType tuba_api_tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPITag, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_api_search_results_get_hashtags (TubaAPISearchResults* self);
static gboolean ___lambda54_ (TubaDialogsCollections* self,
                       TubaAPITag* tag);
VALA_EXTERN GType tuba_widgets_tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsTag, g_object_unref)
VALA_EXTERN TubaWidgetsTag* tuba_widgets_tag_new (TubaAPITag* tag);
VALA_EXTERN TubaWidgetsTag* tuba_widgets_tag_construct (GType object_type,
                                            TubaAPITag* tag);
static void tuba_dialogs_collections_on_tag_chosen (TubaDialogsCollections* self,
                                             AdwActionRow* tag_row);
static void _tuba_dialogs_collections_on_tag_chosen_adw_action_row_activated (AdwActionRow* _sender,
                                                                       gpointer self);
static void _vala_array_add12 (GtkWidget** * array,
                        gint* length,
                        gint* size,
                        GtkWidget* value);
static gboolean ____lambda54__gee_forall_func (gpointer g,
                                        gpointer self);
VALA_EXTERN const gchar* tuba_widgets_tag_get_name (TubaWidgetsTag* self);
static void tuba_dialogs_collections_post_account_real (TubaDialogsCollections* self,
                                                 TubaRequestV2* req,
                                                 TubaWidgetsAccountRow* member_row,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void tuba_dialogs_collections_post_account_real_finish (TubaDialogsCollections* self,
                                                        GAsyncResult* _res_);
static void tuba_dialogs_collections_delete_account_real (TubaDialogsCollections* self,
                                                   TubaRequestV2* req,
                                                   TubaWidgetsAccountRow* member_row,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void tuba_dialogs_collections_delete_account_real_finish (TubaDialogsCollections* self,
                                                          GAsyncResult* _res_);
static void tuba_dialogs_collections_remove_account (TubaDialogsCollections* self,
                                              const gchar* acc_id);
static void tuba_dialogs_collections_post_account_real_data_free (gpointer _data);
static gboolean tuba_dialogs_collections_post_account_real_co (TubaDialogsCollectionsPostAccountRealData* _data_);
static void tuba_dialogs_collections_post_account_real_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
VALA_EXTERN GType tuba_api_wrapped_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIWrappedCollectionItem, g_object_unref)
VALA_EXTERN TubaAPICollectionItem* tuba_api_wrapped_collection_item_get_collection_item (TubaAPIWrappedCollectionItem* self);
static void tuba_dialogs_collections_delete_account_real_data_free (gpointer _data);
static gboolean tuba_dialogs_collections_delete_account_real_co (TubaDialogsCollectionsDeleteAccountRealData* _data_);
static void tuba_dialogs_collections_delete_account_real_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
VALA_EXTERN void tuba_widgets_account_row_add (TubaWidgetsAccountRow* self,
                                   GtkWidget* widget);
VALA_EXTERN void tuba_widgets_account_row_add_button (TubaWidgetsAccountRow* self,
                                          const gchar* label,
                                          const gchar* icon_name,
                                          gchar** styles,
                                          gint styles_length1);
static void tuba_dialogs_collections_on_acc_row_remove_clicked (TubaDialogsCollections* self,
                                                         TubaWidgetsAccountRow* member_row);
static void _tuba_dialogs_collections_on_acc_row_remove_clicked_tuba_widgets_account_row_button_clicked (TubaWidgetsAccountRow* _sender,
                                                                                                  gpointer self);
static void tuba_dialogs_collections_finalize (GObject * obj);
static GType tuba_dialogs_collections_get_type_once (void);
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_dialogs_collections_get_instance_private (TubaDialogsCollections* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsCollections_private_offset);
}

static void
tuba_dialogs_collections_clear (TubaDialogsCollections* self)
{
	TubaWidgetsAccountRow** _tmp0_;
	GtkWidget** _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (TubaWidgetsAccountRow*, 0 + 1);
	self->priv->search_results = (_vala_array_free (self->priv->search_results, self->priv->search_results_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->search_results = _tmp0_;
	self->priv->search_results_length1 = 0;
	self->priv->_search_results_size_ = self->priv->search_results_length1;
	_tmp1_ = g_new0 (GtkWidget*, 0 + 1);
	self->priv->tag_results = (_vala_array_free (self->priv->tag_results, self->priv->tag_results_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->tag_results = _tmp1_;
	self->priv->tag_results_length1 = 0;
	self->priv->_tag_results_size_ = self->priv->tag_results_length1;
	if (self->priv->search_timeout_id > ((guint) 0)) {
		g_source_remove (self->priv->search_timeout_id);
	}
	if (self->priv->tag_timeout_id > ((guint) 0)) {
		g_source_remove (self->priv->tag_timeout_id);
	}
	_tmp2_ = self->priv->members;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp2_);
	_tmp3_ = self->priv->members_collection_items;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp3_);
}

static void
tuba_dialogs_collections_on_closed (TubaDialogsCollections* self)
{
	g_return_if_fail (self != NULL);
	tuba_dialogs_collections_clear (self);
	if (self->priv->edit_mode) {
		g_signal_emit (self, tuba_dialogs_collections_signals[TUBA_DIALOGS_COLLECTIONS_REFRESH_SIGNAL], 0);
	}
}

static void
tuba_dialogs_collections_patch_collection_data_free (gpointer _data)
{
	TubaDialogsCollectionsPatchCollectionData* _data_;
	_data_ = _data;
	_g_free0 (_data_->key);
	_g_free0 (_data_->value);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsPatchCollectionData, _data_);
}

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

static void
tuba_dialogs_collections_patch_collection (TubaDialogsCollections* self,
                                           const gchar* key,
                                           const gchar* value,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	TubaDialogsCollectionsPatchCollectionData* _data_;
	TubaDialogsCollections* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (value != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsPatchCollectionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_patch_collection_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_tmp2_ = g_strdup (value);
	_g_free0 (_data_->value);
	_data_->value = _tmp2_;
	tuba_dialogs_collections_patch_collection_co (_data_);
}

static gboolean
tuba_dialogs_collections_patch_collection_finish (TubaDialogsCollections* self,
                                                  GAsyncResult* _res_,
                                                  GError** error)
{
	gboolean result;
	TubaDialogsCollectionsPatchCollectionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

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 void
tuba_dialogs_collections_patch_collection_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	TubaDialogsCollectionsPatchCollectionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_patch_collection_co (_data_);
}

static gboolean
tuba_dialogs_collections_patch_collection_co (TubaDialogsCollectionsPatchCollectionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (!_data_->self->priv->edit_mode) {
		_data_->result = FALSE;
		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;
	}
	_data_->_tmp0_ = _data_->self->priv->collection_id;
	_data_->_tmp1_ = string_to_string (_data_->_tmp0_);
	_data_->_tmp2_ = g_strconcat ("/api/v1/collections/", _data_->_tmp1_, NULL);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = tuba_accounts;
	_data_->_tmp5_ = tuba_account_store_get_active (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = tuba_request_v2_new (_data_->_tmp3_, TUBA_REQUEST_V2_METHOD_PATCH);
	tuba_request_v2_set_account (_data_->_tmp8_, _data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_free0 (_data_->_tmp3_);
	_data_->req = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->req;
	tuba_request_v2_add_form_data (_data_->_tmp10_, _data_->key, _data_->value);
	_data_->_tmp11_ = _data_->req;
	_data_->_state_ = 1;
	tuba_request_v2_exec (_data_->_tmp11_, tuba_dialogs_collections_patch_collection_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp12_ = tuba_request_v2_exec_finish (_data_->_tmp11_, _data_->_res_, NULL, &_data_->_inner_error0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_g_object_unref0 (_data_->_tmp13_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->req);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = TRUE;
	_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 Block21Data*
block21_data_ref (Block21Data* _data21_)
{
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}

static void
block21_data_unref (void * _userdata_)
{
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		TubaDialogsCollections* self;
		self = _data21_->self;
		_g_object_unref0 (_data21_->row);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}

static void
__lambda47_ (Block21Data* _data21_,
             GObject* obj,
             GAsyncResult* res)
{
	TubaDialogsCollections* self;
	self = _data21_->self;
	g_return_if_fail (res != NULL);
	if (!tuba_dialogs_collections_patch_entry_row_finish (self, res)) {
		const gchar* _tmp0_;
		_tmp0_ = self->priv->last_name;
		gtk_editable_set_text ((GtkEditable*) _data21_->row, _tmp0_);
	} else {
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = gtk_editable_get_text ((GtkEditable*) _data21_->row);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strdup (_tmp2_);
		_g_free0 (self->priv->last_name);
		self->priv->last_name = _tmp3_;
	}
}

static void
___lambda47__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda47_ (self, source_object, res);
	block21_data_unref (self);
}

static void
tuba_dialogs_collections_update_collection_name (TubaDialogsCollections* self,
                                                 AdwEntryRow* row)
{
	Block21Data* _data21_;
	AdwEntryRow* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (row);
	_g_object_unref0 (_data21_->row);
	_data21_->row = _tmp0_;
	tuba_dialogs_collections_patch_entry_row (self, "name", _data21_->row, ___lambda47__gasync_ready_callback, block21_data_ref (_data21_));
	block21_data_unref (_data21_);
	_data21_ = NULL;
}

static Block22Data*
block22_data_ref (Block22Data* _data22_)
{
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}

static void
block22_data_unref (void * _userdata_)
{
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		TubaDialogsCollections* self;
		self = _data22_->self;
		_g_object_unref0 (_data22_->row);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}

static void
__lambda48_ (Block22Data* _data22_,
             GObject* obj,
             GAsyncResult* res)
{
	TubaDialogsCollections* self;
	self = _data22_->self;
	g_return_if_fail (res != NULL);
	if (!tuba_dialogs_collections_patch_entry_row_finish (self, res)) {
		const gchar* _tmp0_;
		_tmp0_ = self->priv->last_description;
		gtk_editable_set_text ((GtkEditable*) _data22_->row, _tmp0_);
	} else {
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = gtk_editable_get_text ((GtkEditable*) _data22_->row);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strdup (_tmp2_);
		_g_free0 (self->priv->last_description);
		self->priv->last_description = _tmp3_;
	}
}

static void
___lambda48__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda48_ (self, source_object, res);
	block22_data_unref (self);
}

static void
tuba_dialogs_collections_update_collection_description (TubaDialogsCollections* self,
                                                        AdwEntryRow* row)
{
	Block22Data* _data22_;
	AdwEntryRow* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (row);
	_g_object_unref0 (_data22_->row);
	_data22_->row = _tmp0_;
	tuba_dialogs_collections_patch_entry_row (self, "description", _data22_->row, ___lambda48__gasync_ready_callback, block22_data_ref (_data22_));
	block22_data_unref (_data22_);
	_data22_ = NULL;
}

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		TubaDialogsCollections* self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->row);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}

static void
__lambda49_ (Block23Data* _data23_,
             GObject* obj,
             GAsyncResult* res)
{
	TubaDialogsCollections* self;
	self = _data23_->self;
	g_return_if_fail (res != NULL);
	if (!tuba_dialogs_collections_patch_entry_row_finish (self, res)) {
		const gchar* _tmp0_;
		_tmp0_ = self->priv->last_topic;
		gtk_editable_set_text ((GtkEditable*) _data23_->row, _tmp0_);
	} else {
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = gtk_editable_get_text ((GtkEditable*) _data23_->row);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strdup (_tmp2_);
		_g_free0 (self->priv->last_topic);
		self->priv->last_topic = _tmp3_;
	}
}

static void
___lambda49__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda49_ (self, source_object, res);
	block23_data_unref (self);
}

static void
tuba_dialogs_collections_update_collection_topic (TubaDialogsCollections* self,
                                                  AdwEntryRow* row)
{
	Block23Data* _data23_;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (row);
	_g_object_unref0 (_data23_->row);
	_data23_->row = _tmp0_;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _data23_->row);
	_tmp2_ = _tmp1_;
	if (!g_str_has_prefix (_tmp2_, "#")) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = gtk_editable_get_text ((GtkEditable*) _data23_->row);
		_tmp4_ = _tmp3_;
		_tmp5_ = string_to_string (_tmp4_);
		_tmp6_ = g_strconcat ("#", _tmp5_, NULL);
		_tmp7_ = _tmp6_;
		gtk_editable_set_text ((GtkEditable*) _data23_->row, _tmp7_);
		_g_free0 (_tmp7_);
	}
	tuba_dialogs_collections_patch_entry_row (self, "tag_name", _data23_->row, ___lambda49__gasync_ready_callback, block23_data_ref (_data23_));
	block23_data_unref (_data23_);
	_data23_ = NULL;
}

static void
tuba_dialogs_collections_patch_entry_row_data_free (gpointer _data)
{
	TubaDialogsCollectionsPatchEntryRowData* _data_;
	_data_ = _data;
	_g_free0 (_data_->key);
	_g_object_unref0 (_data_->row);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsPatchEntryRowData, _data_);
}

static void
tuba_dialogs_collections_patch_entry_row (TubaDialogsCollections* self,
                                          const gchar* key,
                                          AdwEntryRow* row,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	TubaDialogsCollectionsPatchEntryRowData* _data_;
	TubaDialogsCollections* _tmp0_;
	gchar* _tmp1_;
	AdwEntryRow* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (row != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsPatchEntryRowData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_patch_entry_row_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_tmp2_ = _g_object_ref0 (row);
	_g_object_unref0 (_data_->row);
	_data_->row = _tmp2_;
	tuba_dialogs_collections_patch_entry_row_co (_data_);
}

static gboolean
tuba_dialogs_collections_patch_entry_row_finish (TubaDialogsCollections* self,
                                                 GAsyncResult* _res_)
{
	gboolean result;
	TubaDialogsCollectionsPatchEntryRowData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
tuba_dialogs_collections_patch_entry_row_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	TubaDialogsCollectionsPatchEntryRowData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_patch_entry_row_co (_data_);
}

static gboolean
tuba_dialogs_collections_patch_entry_row_co (TubaDialogsCollectionsPatchEntryRowData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp1_ = gtk_editable_get_text ((GtkEditable*) _data_->row);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_state_ = 1;
		tuba_dialogs_collections_patch_collection (_data_->self, _data_->key, _data_->_tmp2_, tuba_dialogs_collections_patch_entry_row_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = tuba_dialogs_collections_patch_collection_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->result = _data_->_tmp0_;
		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;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = adw_toast_new (_data_->_tmp4_);
		adw_toast_set_timeout (_data_->_tmp5_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) _data_->self, _data_->_tmp5_);
		_data_->_tmp6_ = string_to_string (_data_->key);
		_data_->_tmp7_ = _data_->e;
		_data_->_tmp8_ = g_strdup_printf ("%i", _data_->_tmp7_->code);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = _data_->e;
		_data_->_tmp11_ = _data_->_tmp10_->message;
		_data_->_tmp12_ = string_to_string (_data_->_tmp11_);
		_data_->_tmp13_ = g_strconcat ("Error while updating collection ", _data_->_tmp6_, ": ", _data_->_tmp9_, " ", _data_->_tmp12_, NULL);
		_data_->_tmp14_ = _data_->_tmp13_;
		g_warning ("Collections.vala:102: %s", _data_->_tmp14_);
		_g_free0 (_data_->_tmp14_);
		_g_free0 (_data_->_tmp9_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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;
	}
	_data_->result = FALSE;
	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
__lambda51_ (TubaDialogsCollections* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = tuba_dialogs_collections_patch_collection_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!_tmp0_) {
			AdwComboRow* _tmp1_;
			_tmp1_ = self->priv->lang_row;
			adw_combo_row_set_selected (_tmp1_, self->priv->last_lang);
		} else {
			AdwComboRow* _tmp2_;
			guint _tmp3_;
			guint _tmp4_;
			_tmp2_ = self->priv->lang_row;
			_tmp3_ = adw_combo_row_get_selected (_tmp2_);
			_tmp4_ = _tmp3_;
			self->priv->last_lang = _tmp4_;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		AdwToast* _tmp7_ = NULL;
		GError* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		GError* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		AdwComboRow* _tmp16_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = e;
		_tmp6_ = _tmp5_->message;
		_tmp7_ = adw_toast_new (_tmp6_);
		adw_toast_set_timeout (_tmp7_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) self, _tmp7_);
		_tmp8_ = e;
		_tmp9_ = g_strdup_printf ("%i", _tmp8_->code);
		_tmp10_ = _tmp9_;
		_tmp11_ = e;
		_tmp12_ = _tmp11_->message;
		_tmp13_ = string_to_string (_tmp12_);
		_tmp14_ = g_strconcat ("Error while updating collection language: ", _tmp10_, " ", _tmp13_, NULL);
		_tmp15_ = _tmp14_;
		g_warning ("Collections.vala:125: %s", _tmp15_);
		_g_free0 (_tmp15_);
		_g_free0 (_tmp10_);
		_tmp16_ = self->priv->lang_row;
		adw_combo_row_set_selected (_tmp16_, self->priv->last_lang);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda51__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda51_ ((TubaDialogsCollections*) self, source_object, res);
	g_object_unref (self);
}

static void
tuba_dialogs_collections_on_lang_changed (TubaDialogsCollections* self)
{
	AdwComboRow* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	TubaUtilsLocalesLocale* locale_obj = NULL;
	AdwComboRow* _tmp3_;
	GObject* _tmp4_;
	GObject* _tmp5_;
	TubaUtilsLocalesLocale* _tmp6_;
	gboolean _tmp7_ = FALSE;
	TubaUtilsLocalesLocale* _tmp8_;
	TubaUtilsLocalesLocale* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->lang_row;
	_tmp1_ = adw_combo_row_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == GTK_INVALID_LIST_POSITION) {
		return;
	}
	_tmp3_ = self->priv->lang_row;
	_tmp4_ = adw_combo_row_get_selected_item (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _g_object_ref0 (TUBA_UTILS_LOCALES_IS_LOCALE (_tmp5_) ? ((TubaUtilsLocalesLocale*) _tmp5_) : NULL);
	locale_obj = _tmp6_;
	_tmp8_ = locale_obj;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		TubaUtilsLocalesLocale* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		_tmp9_ = locale_obj;
		_tmp10_ = tuba_utils_locales_locale_get_locale (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp7_ = _tmp11_ == NULL;
	}
	if (_tmp7_) {
		_g_object_unref0 (locale_obj);
		return;
	}
	_tmp12_ = locale_obj;
	_tmp13_ = tuba_utils_locales_locale_get_locale (_tmp12_);
	_tmp14_ = _tmp13_;
	tuba_dialogs_collections_patch_collection (self, "language", _tmp14_, ___lambda51__gasync_ready_callback, g_object_ref (self));
	_g_object_unref0 (locale_obj);
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static void
__lambda52_ (TubaDialogsCollections* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = tuba_dialogs_collections_patch_collection_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!_tmp0_) {
			GtkCheckButton* _tmp1_;
			_tmp1_ = self->priv->cw_checkbox;
			gtk_check_button_set_active (_tmp1_, self->priv->last_cw);
		} else {
			GtkCheckButton* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			_tmp2_ = self->priv->cw_checkbox;
			_tmp3_ = gtk_check_button_get_active (_tmp2_);
			_tmp4_ = _tmp3_;
			self->priv->last_cw = _tmp4_;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		AdwToast* _tmp7_ = NULL;
		GError* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		GError* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		GtkCheckButton* _tmp16_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = e;
		_tmp6_ = _tmp5_->message;
		_tmp7_ = adw_toast_new (_tmp6_);
		adw_toast_set_timeout (_tmp7_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) self, _tmp7_);
		_tmp8_ = e;
		_tmp9_ = g_strdup_printf ("%i", _tmp8_->code);
		_tmp10_ = _tmp9_;
		_tmp11_ = e;
		_tmp12_ = _tmp11_->message;
		_tmp13_ = string_to_string (_tmp12_);
		_tmp14_ = g_strconcat ("Error while updating collection sensitive: ", _tmp10_, " ", _tmp13_, NULL);
		_tmp15_ = _tmp14_;
		g_warning ("Collections.vala:143: %s", _tmp15_);
		_g_free0 (_tmp15_);
		_g_free0 (_tmp10_);
		_tmp16_ = self->priv->cw_checkbox;
		gtk_check_button_set_active (_tmp16_, self->priv->last_cw);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda52__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda52_ ((TubaDialogsCollections*) self, source_object, res);
	g_object_unref (self);
}

static void
tuba_dialogs_collections_on_sensitive_changed (TubaDialogsCollections* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->cw_checkbox;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = bool_to_string (_tmp2_);
	_tmp4_ = _tmp3_;
	tuba_dialogs_collections_patch_collection (self, "sensitive", _tmp4_, ___lambda52__gasync_ready_callback, g_object_ref (self));
	_g_free0 (_tmp4_);
}

static void
__lambda53_ (TubaDialogsCollections* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = tuba_dialogs_collections_patch_collection_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!_tmp0_) {
			GtkCheckButton* _tmp1_;
			GtkCheckButton* _tmp2_;
			_tmp1_ = self->priv->public_checkbox;
			gtk_check_button_set_active (_tmp1_, self->priv->last_disco);
			_tmp2_ = self->priv->unlisted_checkbox;
			gtk_check_button_set_active (_tmp2_, !self->priv->last_disco);
		} else {
			GtkCheckButton* _tmp3_;
			gboolean _tmp4_;
			gboolean _tmp5_;
			_tmp3_ = self->priv->public_checkbox;
			_tmp4_ = gtk_check_button_get_active (_tmp3_);
			_tmp5_ = _tmp4_;
			self->priv->last_disco = _tmp5_;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		AdwToast* _tmp8_ = NULL;
		GError* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		GError* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		GtkCheckButton* _tmp17_;
		GtkCheckButton* _tmp18_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		_tmp8_ = adw_toast_new (_tmp7_);
		adw_toast_set_timeout (_tmp8_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) self, _tmp8_);
		_tmp9_ = e;
		_tmp10_ = g_strdup_printf ("%i", _tmp9_->code);
		_tmp11_ = _tmp10_;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		_tmp14_ = string_to_string (_tmp13_);
		_tmp15_ = g_strconcat ("Error while updating collection discoverable: ", _tmp11_, " ", _tmp14_, NULL);
		_tmp16_ = _tmp15_;
		g_warning ("Collections.vala:162: %s", _tmp16_);
		_g_free0 (_tmp16_);
		_g_free0 (_tmp11_);
		_tmp17_ = self->priv->public_checkbox;
		gtk_check_button_set_active (_tmp17_, self->priv->last_disco);
		_tmp18_ = self->priv->unlisted_checkbox;
		gtk_check_button_set_active (_tmp18_, !self->priv->last_disco);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda53__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda53_ ((TubaDialogsCollections*) self, source_object, res);
	g_object_unref (self);
}

static void
tuba_dialogs_collections_on_disc_changed (TubaDialogsCollections* self)
{
	const gchar* _tmp0_ = NULL;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->public_checkbox;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp0_ = "true";
	} else {
		_tmp0_ = "false";
	}
	tuba_dialogs_collections_patch_collection (self, "discoverable", _tmp0_, ___lambda53__gasync_ready_callback, g_object_ref (self));
}

static void
_tuba_dialogs_collections_on_closed_adw_dialog_closed (AdwDialog* _sender,
                                                       gpointer self)
{
	tuba_dialogs_collections_on_closed ((TubaDialogsCollections*) self);
}

static void
_tuba_dialogs_collections_update_collection_name_adw_entry_row_apply (AdwEntryRow* _sender,
                                                                      gpointer self)
{
	tuba_dialogs_collections_update_collection_name ((TubaDialogsCollections*) self, _sender);
}

static void
_tuba_dialogs_collections_update_collection_description_adw_entry_row_apply (AdwEntryRow* _sender,
                                                                             gpointer self)
{
	tuba_dialogs_collections_update_collection_description ((TubaDialogsCollections*) self, _sender);
}

static void
_tuba_dialogs_collections_update_collection_topic_adw_entry_row_apply (AdwEntryRow* _sender,
                                                                       gpointer self)
{
	tuba_dialogs_collections_update_collection_topic ((TubaDialogsCollections*) self, _sender);
}

static void
_tuba_dialogs_collections_on_tag_search_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                      gpointer self)
{
	tuba_dialogs_collections_on_tag_search_changed ((TubaDialogsCollections*) self);
}

static void
_tuba_dialogs_collections_on_lang_changed_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	tuba_dialogs_collections_on_lang_changed ((TubaDialogsCollections*) self);
}

static void
_tuba_dialogs_collections_on_search_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                  gpointer self)
{
	tuba_dialogs_collections_on_search_changed ((TubaDialogsCollections*) self);
}

static void
_tuba_dialogs_collections_on_close_attempt_adw_dialog_close_attempt (AdwDialog* _sender,
                                                                     gpointer self)
{
	tuba_dialogs_collections_on_close_attempt ((TubaDialogsCollections*) self);
}

static void
_tuba_dialogs_collections_on_sensitive_changed_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                         gpointer self)
{
	tuba_dialogs_collections_on_sensitive_changed ((TubaDialogsCollections*) self);
}

static void
_tuba_dialogs_collections_on_disc_changed_gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                    gpointer self)
{
	tuba_dialogs_collections_on_disc_changed ((TubaDialogsCollections*) self);
}

TubaDialogsCollections*
tuba_dialogs_collections_construct (GType object_type,
                                    TubaAPICollection* collection)
{
	TubaDialogsCollections * self = NULL;
	const gchar* _tmp3_ = NULL;
	AdwPreferencesPage* collection_page = NULL;
	gchar* _tmp6_;
	gchar* _tmp7_;
	AdwPreferencesPage* _tmp8_ = NULL;
	AdwPreferencesGroup* _tmp9_;
	gchar* _tmp10_;
	AdwEntryRow* _tmp11_ = NULL;
	gchar* _tmp17_;
	AdwEntryRow* _tmp18_ = NULL;
	gchar* _tmp26_;
	AdwEntryRow* _tmp27_ = NULL;
	AdwEntryRow* _tmp37_;
	gchar* _tmp38_;
	GtkPropertyExpression* _tmp39_;
	AdwComboRow* _tmp40_ = NULL;
	AdwComboRow* _tmp41_;
	const gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	GtkBuilderListItemFactory* _tmp45_;
	GtkBuilderListItemFactory* _tmp46_;
	AdwComboRow* _tmp47_;
	TubaApplication* _tmp48_;
	TubaUtilsLocales* _tmp49_;
	TubaUtilsLocales* _tmp50_;
	GListStore* _tmp51_;
	const gchar* _tmp52_ = NULL;
	TubaSettings* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	gchar* default_language = NULL;
	gchar* _tmp59_;
	guint default_lang_index = 0U;
	TubaApplication* _tmp63_;
	TubaUtilsLocales* _tmp64_;
	TubaUtilsLocales* _tmp65_;
	GListStore* _tmp66_;
	const gchar* _tmp67_;
	TubaUtilsLocalesLocale* _tmp68_;
	TubaUtilsLocalesLocale* _tmp69_;
	GEqualFunc _tmp70_;
	guint _tmp71_ = 0U;
	gboolean _tmp72_;
	gboolean _tmp73_;
	AdwPreferencesGroup* _tmp76_;
	AdwEntryRow* _tmp77_;
	AdwPreferencesGroup* _tmp78_;
	AdwEntryRow* _tmp79_;
	AdwPreferencesGroup* _tmp80_;
	AdwComboRow* _tmp81_;
	AdwPreferencesGroup* _tmp82_;
	AdwEntryRow* _tmp83_;
	AdwPreferencesGroup* visibility_group = NULL;
	gchar* _tmp84_;
	AdwPreferencesGroup* _tmp85_ = NULL;
	gboolean _tmp86_ = FALSE;
	GtkCheckButton* _tmp90_ = NULL;
	GtkCheckButton* _tmp91_;
	GtkCheckButton* _tmp92_;
	GtkCheckButton* _tmp93_;
	gboolean _tmp94_;
	gboolean _tmp95_;
	GtkCheckButton* _tmp96_ = NULL;
	AdwActionRow* p1 = NULL;
	gchar* _tmp97_;
	GtkCheckButton* _tmp98_;
	GtkWidget* _tmp99_;
	gchar* _tmp100_;
	AdwActionRow* _tmp101_ = NULL;
	AdwActionRow* _tmp102_;
	GtkCheckButton* _tmp103_;
	AdwPreferencesGroup* _tmp104_;
	AdwActionRow* _tmp105_;
	AdwActionRow* p2 = NULL;
	gchar* _tmp106_;
	GtkCheckButton* _tmp107_;
	GtkWidget* _tmp108_;
	gchar* _tmp109_;
	AdwActionRow* _tmp110_ = NULL;
	AdwActionRow* _tmp111_;
	GtkCheckButton* _tmp112_;
	AdwPreferencesGroup* _tmp113_;
	AdwActionRow* _tmp114_;
	AdwPreferencesGroup* cw_group = NULL;
	gchar* _tmp115_;
	AdwPreferencesGroup* _tmp116_ = NULL;
	gboolean _tmp117_ = FALSE;
	GtkCheckButton* _tmp120_ = NULL;
	AdwActionRow* c3 = NULL;
	gchar* _tmp121_;
	GtkCheckButton* _tmp122_;
	GtkWidget* _tmp123_;
	gchar* _tmp124_;
	AdwActionRow* _tmp125_ = NULL;
	AdwActionRow* _tmp126_;
	GtkCheckButton* _tmp127_;
	AdwPreferencesGroup* _tmp128_;
	AdwActionRow* _tmp129_;
	AdwPreferencesPage* _tmp130_;
	AdwPreferencesGroup* _tmp131_;
	AdwPreferencesPage* _tmp132_;
	AdwPreferencesGroup* _tmp133_;
	AdwPreferencesPage* _tmp134_;
	AdwPreferencesGroup* _tmp135_;
	AdwPreferencesPage* members_page = NULL;
	gchar* _tmp136_;
	gchar* _tmp137_;
	AdwPreferencesPage* _tmp138_ = NULL;
	AdwPreferencesGroup* _tmp139_;
	gchar* _tmp140_;
	AdwEntryRow* _tmp141_ = NULL;
	AdwEntryRow* _tmp142_;
	AdwPreferencesGroup* _tmp143_;
	AdwEntryRow* _tmp144_;
	AdwPreferencesGroup* _tmp145_;
	AdwPreferencesPage* _tmp146_;
	AdwPreferencesGroup* _tmp147_;
	AdwPreferencesPage* _tmp148_;
	AdwPreferencesGroup* _tmp149_;
	AdwPreferencesPage* _tmp150_;
	AdwPreferencesPage* _tmp151_;
	gboolean _tmp161_ = FALSE;
	gboolean _tmp162_ = FALSE;
	self = (TubaDialogsCollections*) g_object_new (object_type, NULL);
	self->priv->edit_mode = collection != NULL;
	if (self->priv->edit_mode) {
		const gchar* _tmp0_;
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp0_ = tuba_api_collection_get_id (collection);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_strdup (_tmp1_);
		_g_free0 (self->priv->collection_id);
		self->priv->collection_id = _tmp2_;
	}
	adw_dialog_set_can_close ((AdwDialog*) self, self->priv->edit_mode);
	g_signal_connect_object ((AdwDialog*) self, "closed", (GCallback) _tuba_dialogs_collections_on_closed_adw_dialog_closed, self, 0);
	if (self->priv->edit_mode) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = tuba_api_collection_get_name (collection);
		_tmp5_ = _tmp4_;
		_tmp3_ = _tmp5_;
	} else {
		_tmp3_ = _ ("New Collection");
	}
	adw_dialog_set_title ((AdwDialog*) self, _tmp3_);
	_tmp6_ = g_strdup (_ ("Collection"));
	_tmp7_ = g_strdup ("tuba-shapes-symbolic");
	_tmp8_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	adw_preferences_page_set_title (_tmp8_, _tmp6_);
	_g_free0 (_tmp6_);
	adw_preferences_page_set_icon_name (_tmp8_, _tmp7_);
	_g_free0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	collection_page = _tmp8_;
	_tmp9_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->details_group);
	self->priv->details_group = _tmp9_;
	_tmp10_ = g_strdup (_ ("Name"));
	_tmp11_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp11_, _tmp10_);
	_g_free0 (_tmp10_);
	adw_entry_row_set_max_length (_tmp11_, 40);
	adw_entry_row_set_show_apply_button (_tmp11_, self->priv->edit_mode);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->name_row);
	self->priv->name_row = _tmp11_;
	if (self->priv->edit_mode) {
		AdwEntryRow* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		AdwEntryRow* _tmp16_;
		_tmp12_ = self->priv->name_row;
		_tmp13_ = tuba_api_collection_get_name (collection);
		_tmp14_ = _tmp13_;
		gtk_editable_set_text ((GtkEditable*) _tmp12_, _tmp14_);
		_tmp15_ = g_strdup (_tmp14_);
		_g_free0 (self->priv->last_name);
		self->priv->last_name = _tmp15_;
		_tmp16_ = self->priv->name_row;
		g_signal_connect_object (_tmp16_, "apply", (GCallback) _tuba_dialogs_collections_update_collection_name_adw_entry_row_apply, self, 0);
	}
	_tmp17_ = g_strdup (_ ("Description"));
	_tmp18_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp18_, _tmp17_);
	_g_free0 (_tmp17_);
	adw_entry_row_set_max_length (_tmp18_, 100);
	adw_entry_row_set_show_apply_button (_tmp18_, self->priv->edit_mode);
	g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->priv->description_row);
	self->priv->description_row = _tmp18_;
	if (self->priv->edit_mode) {
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		AdwEntryRow* _tmp25_;
		_tmp19_ = tuba_api_collection_get_description (collection);
		_tmp20_ = _tmp19_;
		if (_tmp20_ != NULL) {
			AdwEntryRow* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			gchar* _tmp24_;
			_tmp21_ = self->priv->description_row;
			_tmp22_ = tuba_api_collection_get_description (collection);
			_tmp23_ = _tmp22_;
			gtk_editable_set_text ((GtkEditable*) _tmp21_, _tmp23_);
			_tmp24_ = g_strdup (_tmp23_);
			_g_free0 (self->priv->last_description);
			self->priv->last_description = _tmp24_;
		}
		_tmp25_ = self->priv->description_row;
		g_signal_connect_object (_tmp25_, "apply", (GCallback) _tuba_dialogs_collections_update_collection_description_adw_entry_row_apply, self, 0);
	}
	_tmp26_ = g_strdup (_ ("Topic"));
	_tmp27_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp27_, _tmp26_);
	_g_free0 (_tmp26_);
	adw_entry_row_set_max_length (_tmp27_, 100);
	adw_entry_row_set_show_apply_button (_tmp27_, self->priv->edit_mode);
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->topic_row);
	self->priv->topic_row = _tmp27_;
	if (self->priv->edit_mode) {
		TubaAPICollectionTag* _tmp28_;
		TubaAPICollectionTag* _tmp29_;
		AdwEntryRow* _tmp36_;
		_tmp28_ = tuba_api_collection_get_tag (collection);
		_tmp29_ = _tmp28_;
		if (_tmp29_ != NULL) {
			AdwEntryRow* _tmp30_;
			TubaAPICollectionTag* _tmp31_;
			TubaAPICollectionTag* _tmp32_;
			const gchar* _tmp33_;
			const gchar* _tmp34_;
			gchar* _tmp35_;
			_tmp30_ = self->priv->topic_row;
			_tmp31_ = tuba_api_collection_get_tag (collection);
			_tmp32_ = _tmp31_;
			_tmp33_ = tuba_api_collection_tag_get_name (_tmp32_);
			_tmp34_ = _tmp33_;
			gtk_editable_set_text ((GtkEditable*) _tmp30_, _tmp34_);
			_tmp35_ = g_strdup (_tmp34_);
			_g_free0 (self->priv->last_topic);
			self->priv->last_topic = _tmp35_;
		}
		_tmp36_ = self->priv->topic_row;
		g_signal_connect_object (_tmp36_, "apply", (GCallback) _tuba_dialogs_collections_update_collection_topic_adw_entry_row_apply, self, 0);
	}
	_tmp37_ = self->priv->topic_row;
	g_signal_connect_object ((GtkEditable*) _tmp37_, "changed", (GCallback) _tuba_dialogs_collections_on_tag_search_changed_gtk_editable_changed, self, 0);
	_tmp38_ = g_strdup (_ ("Language"));
	_tmp39_ = (GtkPropertyExpression*) gtk_property_expression_new (TUBA_UTILS_LOCALES_TYPE_LOCALE, NULL, "name");
	_tmp40_ = (AdwComboRow*) adw_combo_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp40_, _tmp38_);
	_g_free0 (_tmp38_);
	adw_combo_row_set_enable_search (_tmp40_, TRUE);
	adw_combo_row_set_expression (_tmp40_, (GtkExpression*) _tmp39_);
	_gtk_expression_unref0 (_tmp39_);
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (self->priv->lang_row);
	self->priv->lang_row = _tmp40_;
	_tmp41_ = self->priv->lang_row;
	_tmp42_ = string_to_string (BUILD_RESOURCES);
	_tmp43_ = g_strconcat (_tmp42_, "gtk/dropdown/language.ui", NULL);
	_tmp44_ = _tmp43_;
	_tmp45_ = (GtkBuilderListItemFactory*) gtk_builder_list_item_factory_new_from_resource (NULL, _tmp44_);
	_tmp46_ = _tmp45_;
	adw_combo_row_set_list_factory (_tmp41_, (GtkListItemFactory*) _tmp46_);
	_g_object_unref0 (_tmp46_);
	_g_free0 (_tmp44_);
	_tmp47_ = self->priv->lang_row;
	_tmp48_ = tuba_app;
	_tmp49_ = tuba_application_get_app_locales (_tmp48_);
	_tmp50_ = _tmp49_;
	_tmp51_ = _tmp50_->list_store;
	adw_combo_row_set_model (_tmp47_, (GListModel*) _tmp51_);
	_tmp53_ = tuba_settings;
	_tmp54_ = tuba_settings_get_default_language (_tmp53_);
	_tmp55_ = _tmp54_;
	if (g_strcmp0 (_tmp55_, "") == 0) {
		_tmp52_ = "en";
	} else {
		TubaSettings* _tmp56_;
		const gchar* _tmp57_;
		const gchar* _tmp58_;
		_tmp56_ = tuba_settings;
		_tmp57_ = tuba_settings_get_default_language (_tmp56_);
		_tmp58_ = _tmp57_;
		_tmp52_ = _tmp58_;
	}
	_tmp59_ = g_strdup (_tmp52_);
	default_language = _tmp59_;
	if (self->priv->edit_mode) {
		const gchar* _tmp60_;
		const gchar* _tmp61_;
		gchar* _tmp62_;
		_tmp60_ = tuba_api_collection_get_language (collection);
		_tmp61_ = _tmp60_;
		_tmp62_ = g_strdup (_tmp61_);
		_g_free0 (default_language);
		default_language = _tmp62_;
	}
	_tmp63_ = tuba_app;
	_tmp64_ = tuba_application_get_app_locales (_tmp63_);
	_tmp65_ = _tmp64_;
	_tmp66_ = _tmp65_->list_store;
	_tmp67_ = default_language;
	_tmp68_ = tuba_utils_locales_locale_new (_tmp67_, NULL, NULL);
	_tmp69_ = _tmp68_;
	_tmp70_ = tuba_utils_locales_locale_compare;
	_tmp72_ = g_list_store_find_with_equal_func (_tmp66_, (GObject*) _tmp69_, _tmp70_, &_tmp71_);
	default_lang_index = _tmp71_;
	_tmp73_ = _tmp72_;
	_g_object_unref0 (_tmp69_);
	if (_tmp73_) {
		AdwComboRow* _tmp74_;
		_tmp74_ = self->priv->lang_row;
		adw_combo_row_set_selected (_tmp74_, default_lang_index);
		self->priv->last_lang = default_lang_index;
	}
	if (self->priv->edit_mode) {
		AdwComboRow* _tmp75_;
		_tmp75_ = self->priv->lang_row;
		g_signal_connect_object ((GObject*) _tmp75_, "notify::selected", (GCallback) _tuba_dialogs_collections_on_lang_changed_g_object_notify, self, 0);
	}
	_tmp76_ = self->priv->details_group;
	_tmp77_ = self->priv->name_row;
	adw_preferences_group_add (_tmp76_, (GtkWidget*) _tmp77_);
	_tmp78_ = self->priv->details_group;
	_tmp79_ = self->priv->description_row;
	adw_preferences_group_add (_tmp78_, (GtkWidget*) _tmp79_);
	_tmp80_ = self->priv->details_group;
	_tmp81_ = self->priv->lang_row;
	adw_preferences_group_add (_tmp80_, (GtkWidget*) _tmp81_);
	_tmp82_ = self->priv->details_group;
	_tmp83_ = self->priv->topic_row;
	adw_preferences_group_add (_tmp82_, (GtkWidget*) _tmp83_);
	_tmp84_ = g_strdup (_ ("Visibility"));
	_tmp85_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp85_, _tmp84_);
	_g_free0 (_tmp84_);
	g_object_ref_sink (_tmp85_);
	visibility_group = _tmp85_;
	if (!self->priv->edit_mode) {
		_tmp86_ = TRUE;
	} else {
		gboolean _tmp87_ = FALSE;
		if (self->priv->edit_mode) {
			gboolean _tmp88_;
			gboolean _tmp89_;
			_tmp88_ = tuba_api_collection_get_discoverable (collection);
			_tmp89_ = _tmp88_;
			_tmp87_ = _tmp89_;
		} else {
			_tmp87_ = FALSE;
		}
		_tmp86_ = _tmp87_;
	}
	_tmp90_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp90_, GTK_ALIGN_CENTER);
	gtk_check_button_set_active (_tmp90_, _tmp86_);
	g_object_ref_sink (_tmp90_);
	_g_object_unref0 (self->priv->public_checkbox);
	self->priv->public_checkbox = _tmp90_;
	_tmp91_ = self->priv->public_checkbox;
	_tmp92_ = _g_object_ref0 (_tmp91_);
	_tmp93_ = self->priv->public_checkbox;
	_tmp94_ = gtk_check_button_get_active (_tmp93_);
	_tmp95_ = _tmp94_;
	_tmp96_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp96_, GTK_ALIGN_CENTER);
	gtk_check_button_set_group (_tmp96_, _tmp92_);
	_g_object_unref0 (_tmp92_);
	gtk_check_button_set_active (_tmp96_, !_tmp95_);
	g_object_ref_sink (_tmp96_);
	_g_object_unref0 (self->priv->unlisted_checkbox);
	self->priv->unlisted_checkbox = _tmp96_;
	_tmp97_ = g_strdup (_ ("Public"));
	_tmp98_ = self->priv->public_checkbox;
	_tmp99_ = _g_object_ref0 ((GtkWidget*) _tmp98_);
	_tmp100_ = g_strdup (_ ("Discoverable in search results and other areas where recommendations a" \
"ppear."));
	_tmp101_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp101_, _tmp97_);
	_g_free0 (_tmp97_);
	adw_action_row_set_activatable_widget (_tmp101_, _tmp99_);
	_g_object_unref0 (_tmp99_);
	adw_action_row_set_subtitle (_tmp101_, _tmp100_);
	_g_free0 (_tmp100_);
	g_object_ref_sink (_tmp101_);
	p1 = _tmp101_;
	_tmp102_ = p1;
	_tmp103_ = self->priv->public_checkbox;
	adw_action_row_add_prefix (_tmp102_, (GtkWidget*) _tmp103_);
	_tmp104_ = visibility_group;
	_tmp105_ = p1;
	adw_preferences_group_add (_tmp104_, (GtkWidget*) _tmp105_);
	_tmp106_ = g_strdup (_ ("Unlisted"));
	_tmp107_ = self->priv->unlisted_checkbox;
	_tmp108_ = _g_object_ref0 ((GtkWidget*) _tmp107_);
	_tmp109_ = g_strdup (_ ("Visible to anyone with a link. Hidden from search results and recommen" \
"dations."));
	_tmp110_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp110_, _tmp106_);
	_g_free0 (_tmp106_);
	adw_action_row_set_activatable_widget (_tmp110_, _tmp108_);
	_g_object_unref0 (_tmp108_);
	adw_action_row_set_subtitle (_tmp110_, _tmp109_);
	_g_free0 (_tmp109_);
	g_object_ref_sink (_tmp110_);
	p2 = _tmp110_;
	_tmp111_ = p2;
	_tmp112_ = self->priv->unlisted_checkbox;
	adw_action_row_add_prefix (_tmp111_, (GtkWidget*) _tmp112_);
	_tmp113_ = visibility_group;
	_tmp114_ = p2;
	adw_preferences_group_add (_tmp113_, (GtkWidget*) _tmp114_);
	_tmp115_ = g_strdup (_ ("Content Warning"));
	_tmp116_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp116_, _tmp115_);
	_g_free0 (_tmp115_);
	g_object_ref_sink (_tmp116_);
	cw_group = _tmp116_;
	if (self->priv->edit_mode) {
		gboolean _tmp118_;
		gboolean _tmp119_;
		_tmp118_ = tuba_api_collection_get_sensitive (collection);
		_tmp119_ = _tmp118_;
		_tmp117_ = _tmp119_;
	} else {
		_tmp117_ = FALSE;
	}
	_tmp120_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp120_, GTK_ALIGN_CENTER);
	gtk_check_button_set_active (_tmp120_, _tmp117_);
	g_object_ref_sink (_tmp120_);
	_g_object_unref0 (self->priv->cw_checkbox);
	self->priv->cw_checkbox = _tmp120_;
	_tmp121_ = g_strdup (_ ("Mark as Sensitive"));
	_tmp122_ = self->priv->cw_checkbox;
	_tmp123_ = _g_object_ref0 ((GtkWidget*) _tmp122_);
	_tmp124_ = g_strdup (_ ("Hides the collection's description and accounts behind a content warni" \
"ng. The collection name will still be visible."));
	_tmp125_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp125_, _tmp121_);
	_g_free0 (_tmp121_);
	adw_action_row_set_activatable_widget (_tmp125_, _tmp123_);
	_g_object_unref0 (_tmp123_);
	adw_action_row_set_subtitle (_tmp125_, _tmp124_);
	_g_free0 (_tmp124_);
	g_object_ref_sink (_tmp125_);
	c3 = _tmp125_;
	_tmp126_ = c3;
	_tmp127_ = self->priv->cw_checkbox;
	adw_action_row_add_prefix (_tmp126_, (GtkWidget*) _tmp127_);
	_tmp128_ = cw_group;
	_tmp129_ = c3;
	adw_preferences_group_add (_tmp128_, (GtkWidget*) _tmp129_);
	_tmp130_ = collection_page;
	_tmp131_ = self->priv->details_group;
	adw_preferences_page_add (_tmp130_, _tmp131_);
	_tmp132_ = collection_page;
	_tmp133_ = visibility_group;
	adw_preferences_page_add (_tmp132_, _tmp133_);
	_tmp134_ = collection_page;
	_tmp135_ = cw_group;
	adw_preferences_page_add (_tmp134_, _tmp135_);
	_tmp136_ = g_strdup (_ ("Members"));
	_tmp137_ = g_strdup ("tuba-person-symbolic");
	_tmp138_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	adw_preferences_page_set_title (_tmp138_, _tmp136_);
	_g_free0 (_tmp136_);
	adw_preferences_page_set_icon_name (_tmp138_, _tmp137_);
	_g_free0 (_tmp137_);
	g_object_ref_sink (_tmp138_);
	members_page = _tmp138_;
	_tmp139_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp139_);
	_g_object_unref0 (self->priv->search_group);
	self->priv->search_group = _tmp139_;
	_tmp140_ = g_strdup (_ ("Search"));
	_tmp141_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp141_, _tmp140_);
	_g_free0 (_tmp140_);
	g_object_ref_sink (_tmp141_);
	_g_object_unref0 (self->priv->search_row);
	self->priv->search_row = _tmp141_;
	_tmp142_ = self->priv->search_row;
	g_signal_connect_object ((GtkEditable*) _tmp142_, "changed", (GCallback) _tuba_dialogs_collections_on_search_changed_gtk_editable_changed, self, 0);
	_tmp143_ = self->priv->search_group;
	_tmp144_ = self->priv->search_row;
	adw_preferences_group_add (_tmp143_, (GtkWidget*) _tmp144_);
	_tmp145_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp145_);
	_g_object_unref0 (self->priv->members_group);
	self->priv->members_group = _tmp145_;
	_tmp146_ = members_page;
	_tmp147_ = self->priv->search_group;
	adw_preferences_page_add (_tmp146_, _tmp147_);
	_tmp148_ = members_page;
	_tmp149_ = self->priv->members_group;
	adw_preferences_page_add (_tmp148_, _tmp149_);
	_tmp150_ = collection_page;
	adw_preferences_dialog_add ((AdwPreferencesDialog*) self, _tmp150_);
	_tmp151_ = members_page;
	adw_preferences_dialog_add ((AdwPreferencesDialog*) self, _tmp151_);
	tuba_dialogs_collections_update_member_metadata (self);
	if (!self->priv->edit_mode) {
		g_signal_connect_object ((AdwDialog*) self, "close-attempt", (GCallback) _tuba_dialogs_collections_on_close_attempt_adw_dialog_close_attempt, self, 0);
	}
	if (self->priv->edit_mode) {
		GtkCheckButton* _tmp152_;
		GtkCheckButton* _tmp153_;
		GtkCheckButton* _tmp154_;
		GtkCheckButton* _tmp155_;
		gboolean _tmp156_;
		gboolean _tmp157_;
		GtkCheckButton* _tmp158_;
		gboolean _tmp159_;
		gboolean _tmp160_;
		_tmp152_ = self->priv->cw_checkbox;
		g_signal_connect_object (_tmp152_, "toggled", (GCallback) _tuba_dialogs_collections_on_sensitive_changed_gtk_check_button_toggled, self, 0);
		_tmp153_ = self->priv->public_checkbox;
		g_signal_connect_object (_tmp153_, "toggled", (GCallback) _tuba_dialogs_collections_on_disc_changed_gtk_check_button_toggled, self, 0);
		_tmp154_ = self->priv->unlisted_checkbox;
		g_signal_connect_object (_tmp154_, "toggled", (GCallback) _tuba_dialogs_collections_on_disc_changed_gtk_check_button_toggled, self, 0);
		_tmp155_ = self->priv->cw_checkbox;
		_tmp156_ = gtk_check_button_get_active (_tmp155_);
		_tmp157_ = _tmp156_;
		self->priv->last_cw = _tmp157_;
		_tmp158_ = self->priv->public_checkbox;
		_tmp159_ = gtk_check_button_get_active (_tmp158_);
		_tmp160_ = _tmp159_;
		self->priv->last_disco = _tmp160_;
	}
	if (self->priv->edit_mode) {
		GeeArrayList* _tmp163_;
		GeeArrayList* _tmp164_;
		_tmp163_ = tuba_api_collection_get_items (collection);
		_tmp164_ = _tmp163_;
		_tmp162_ = _tmp164_ != NULL;
	} else {
		_tmp162_ = FALSE;
	}
	if (_tmp162_) {
		GeeArrayList* _tmp165_;
		GeeArrayList* _tmp166_;
		gint _tmp167_;
		gint _tmp168_;
		_tmp165_ = tuba_api_collection_get_items (collection);
		_tmp166_ = _tmp165_;
		_tmp167_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp166_);
		_tmp168_ = _tmp167_;
		_tmp161_ = _tmp168_ > 0;
	} else {
		_tmp161_ = FALSE;
	}
	if (_tmp161_) {
		AdwPreferencesPage* _tmp169_;
		AdwPreferencesPage* _tmp170_;
		_tmp169_ = members_page;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp169_, FALSE);
		_tmp170_ = members_page;
		tuba_dialogs_collections_fetch_accounts_real (self, (GtkWidget*) _tmp170_, collection, NULL, NULL);
	}
	_g_object_unref0 (members_page);
	_g_object_unref0 (c3);
	_g_object_unref0 (cw_group);
	_g_object_unref0 (p2);
	_g_object_unref0 (p1);
	_g_object_unref0 (visibility_group);
	_g_free0 (default_language);
	_g_object_unref0 (collection_page);
	return self;
}

TubaDialogsCollections*
tuba_dialogs_collections_new (TubaAPICollection* collection)
{
	return tuba_dialogs_collections_construct (TUBA_DIALOGS_TYPE_COLLECTIONS, collection);
}

static void
tuba_dialogs_collections_fetch_accounts_real_data_free (gpointer _data)
{
	TubaDialogsCollectionsFetchAccountsRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->members_page);
	_g_object_unref0 (_data_->collection);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsFetchAccountsRealData, _data_);
}

static void
tuba_dialogs_collections_fetch_accounts_real (TubaDialogsCollections* self,
                                              GtkWidget* members_page,
                                              TubaAPICollection* collection,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	TubaDialogsCollectionsFetchAccountsRealData* _data_;
	TubaDialogsCollections* _tmp0_;
	GtkWidget* _tmp1_;
	TubaAPICollection* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (members_page != NULL);
	g_return_if_fail (collection != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsFetchAccountsRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_fetch_accounts_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (members_page);
	_g_object_unref0 (_data_->members_page);
	_data_->members_page = _tmp1_;
	_tmp2_ = _g_object_ref0 (collection);
	_g_object_unref0 (_data_->collection);
	_data_->collection = _tmp2_;
	tuba_dialogs_collections_fetch_accounts_real_co (_data_);
}

static void
tuba_dialogs_collections_fetch_accounts_real_finish (TubaDialogsCollections* self,
                                                     GAsyncResult* _res_)
{
	TubaDialogsCollectionsFetchAccountsRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		TubaDialogsCollections* self;
		self = _data24_->self;
		_g_hash_table_unref0 (_data24_->states);
		_data24_->accounts_arr = (_vala_array_free (_data24_->accounts_arr, _data24_->accounts_arr_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_vala_array_add10 (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
__lambda60_ (Block24Data* _data24_,
             TubaAPICollectionItem* e)
{
	TubaDialogsCollections* self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GeeHashMap* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	GHashTable* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gboolean result;
	self = _data24_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = tuba_api_collection_item_get_account_id (e);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_to_string (_tmp1_);
	_tmp3_ = g_strconcat ("id[]=", _tmp2_, NULL);
	_vala_array_add10 (&_data24_->accounts_arr, &_data24_->accounts_arr_length1, &_data24_->_accounts_arr_size_, _tmp3_);
	_tmp4_ = self->priv->members_collection_items;
	_tmp5_ = tuba_api_collection_item_get_account_id (e);
	_tmp6_ = _tmp5_;
	_tmp7_ = tuba_api_collection_item_get_id (e);
	_tmp8_ = _tmp7_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp4_, _tmp6_, _tmp8_);
	_tmp9_ = _data24_->states;
	_tmp10_ = tuba_api_collection_item_get_account_id (e);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strdup (_tmp11_);
	_tmp13_ = tuba_api_collection_item_get_state (e);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_strdup (_tmp14_);
	g_hash_table_insert (_tmp9_, _tmp12_, _tmp15_);
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
___lambda60__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda60_ (self, (TubaAPICollectionItem*) g);
	return result;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
tuba_dialogs_collections_fetch_accounts_real_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	TubaDialogsCollectionsFetchAccountsRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_fetch_accounts_real_co (_data_);
}

static void
___lambda61_ (Block24Data* _data24_,
              JsonNode* node,
              GError** error)
{
	TubaDialogsCollections* self;
	TubaAPIAccount* acc = NULL;
	TubaAPIAccount* _tmp0_;
	GHashTable* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gconstpointer _tmp4_;
	GError* _inner_error0_ = NULL;
	self = _data24_->self;
	g_return_if_fail (node != NULL);
	_tmp0_ = tuba_api_account_from (node, &_inner_error0_);
	acc = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = _data24_->states;
	_tmp2_ = tuba_api_account_get_id (acc);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_hash_table_lookup (_tmp1_, _tmp3_);
	tuba_dialogs_collections_add_account (self, acc, g_strcmp0 ((const gchar*) _tmp4_, "pending") == 0);
	_g_object_unref0 (acc);
}

static void
____lambda61__tuba_network_node_callback (JsonNode* node,
                                          gpointer self,
                                          GError** error)
{
	___lambda61_ (self, node, error);
}

static gboolean
tuba_dialogs_collections_fetch_accounts_real_co (TubaDialogsCollectionsFetchAccountsRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data24_ = g_slice_new0 (Block24Data);
	_data_->_data24_->_ref_count_ = 1;
	_data_->_data24_->self = g_object_ref (_data_->self);
	_data_->_data24_->_async_data_ = _data_;
	_data_->_tmp0_ = g_new0 (gchar*, 0 + 1);
	_data_->_data24_->accounts_arr = _data_->_tmp0_;
	_data_->_data24_->accounts_arr_length1 = 0;
	_data_->_data24_->_accounts_arr_size_ = _data_->_data24_->accounts_arr_length1;
	_data_->_tmp1_ = g_str_hash;
	_data_->_tmp2_ = g_str_equal;
	_data_->_tmp3_ = g_hash_table_new_full (_data_->_tmp1_, _data_->_tmp2_, _g_free0_, _g_free0_);
	_data_->_data24_->states = _data_->_tmp3_;
	_data_->_tmp4_ = tuba_api_collection_get_items (_data_->collection);
	_data_->_tmp5_ = _data_->_tmp4_;
	gee_abstract_collection_foreach ((GeeAbstractCollection*) _data_->_tmp5_, ___lambda60__gee_forall_func, _data_->_data24_);
	_data_->_tmp6_ = _data_->_data24_->accounts_arr;
	_data_->_tmp6__length1 = _data_->_data24_->accounts_arr_length1;
	_data_->_tmp7_ = _vala_g_strjoinv ("&", _data_->_tmp6_, (gint) _data_->_tmp6__length1);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = string_to_string (_data_->_tmp8_);
	_data_->_tmp10_ = g_strconcat ("/api/v1/accounts?", _data_->_tmp9_, NULL);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = tuba_accounts;
	_data_->_tmp13_ = tuba_account_store_get_active (_data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = _g_object_ref0 (_data_->_tmp14_);
	_data_->_tmp16_ = NULL;
	_data_->_tmp16_ = tuba_request_v2_new (_data_->_tmp11_, TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp16_, _data_->_tmp15_);
	_g_object_unref0 (_data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	_g_free0 (_data_->_tmp11_);
	_g_free0 (_data_->_tmp8_);
	_data_->req = _data_->_tmp17_;
	{
		_data_->_tmp18_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp18_, tuba_dialogs_collections_fetch_accounts_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp19_ = tuba_request_v2_exec_finish (_data_->_tmp18_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp19_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp20_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp20_, NULL, tuba_dialogs_collections_fetch_accounts_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp21_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp21_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp22_ = _data_->parser;
		tuba_network_parse_array (_data_->_tmp22_, ____lambda61__tuba_network_node_callback, block24_data_ref (_data_->_data24_), block24_data_unref, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		gtk_widget_set_sensitive (_data_->members_page, TRUE);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_data_->_inner_error0_);
		g_debug ("Collections.vala:357: Message is cancelled.");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp23_ = _data_->e;
		_data_->_tmp24_ = g_strdup_printf ("%i", _data_->_tmp23_->code);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = _data_->e;
		_data_->_tmp27_ = _data_->_tmp26_->message;
		_data_->_tmp28_ = string_to_string (_data_->_tmp27_);
		_data_->_tmp29_ = g_strconcat ("Error while fetching accounts: ", _data_->_tmp25_, " ", _data_->_tmp28_, NULL);
		_data_->_tmp30_ = _data_->_tmp29_;
		g_warning ("Collections.vala:359: %s", _data_->_tmp30_);
		_g_free0 (_data_->_tmp30_);
		_g_free0 (_data_->_tmp25_);
		_data_->_tmp31_ = _data_->e;
		_data_->_tmp32_ = _data_->_tmp31_->message;
		_data_->_tmp33_ = g_strdup_printf ("%s: %s", _ ("Error"), _data_->_tmp32_);
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_tmp35_ = NULL;
		_data_->_tmp35_ = adw_toast_new (_data_->_tmp34_);
		adw_toast_set_timeout (_data_->_tmp35_, (guint) 10);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) _data_->self, _data_->_tmp35_);
		_g_free0 (_data_->_tmp34_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		block24_data_unref (_data_->_data24_);
		_data_->_data24_ = NULL;
		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);
	block24_data_unref (_data_->_data24_);
	_data_->_data24_ = NULL;
	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 Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		TubaDialogsCollections* self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->dlg);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
__lambda58_ (Block25Data* _data25_,
             GObject* obj,
             GAsyncResult* res)
{
	TubaDialogsCollections* self;
	AdwAlertDialog* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GQuark _tmp4_ = 0U;
	static GQuark _tmp3_label0 = 0;
	static GQuark _tmp3_label1 = 0;
	self = _data25_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = _data25_->dlg;
	_tmp1_ = adw_alert_dialog_choose_finish (_tmp0_, res);
	_tmp2_ = _tmp1_;
	_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
	if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("discard")))) {
		switch (0) {
			default:
			{
				adw_dialog_force_close ((AdwDialog*) self);
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("create")))) {
		switch (0) {
			default:
			{
				tuba_dialogs_collections_create_collection (self);
				break;
			}
		}
	}
}

static void
___lambda58__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda58_ (self, source_object, res);
	block25_data_unref (self);
}

static void
tuba_dialogs_collections_on_close_attempt (TubaDialogsCollections* self)
{
	Block25Data* _data25_;
	gboolean _tmp0_ = FALSE;
	AdwAlertDialog* _tmp11_;
	AdwAlertDialog* _tmp12_;
	AdwAlertDialog* _tmp13_;
	AdwAlertDialog* _tmp14_;
	AdwAlertDialog* _tmp15_;
	AdwAlertDialog* _tmp16_;
	AdwAlertDialog* _tmp17_;
	AdwAlertDialog* _tmp18_;
	AdwAlertDialog* _tmp19_;
	g_return_if_fail (self != NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	if (self->priv->edit_mode) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp1_ = FALSE;
		AdwEntryRow* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gboolean _tmp7_;
		_tmp2_ = self->priv->name_row;
		_tmp3_ = gtk_editable_get_text ((GtkEditable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = string_strip (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strcmp0 (_tmp6_, "") == 0;
		_g_free0 (_tmp6_);
		if (_tmp7_) {
			GeeHashMap* _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			_tmp8_ = self->priv->members;
			_tmp9_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp8_);
			_tmp10_ = _tmp9_;
			_tmp1_ = _tmp10_ == 0;
		} else {
			_tmp1_ = FALSE;
		}
		_tmp0_ = _tmp1_;
	}
	if (_tmp0_) {
		adw_dialog_force_close ((AdwDialog*) self);
		block25_data_unref (_data25_);
		_data25_ = NULL;
		return;
	}
	_tmp11_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Create Collection?"), NULL);
	g_object_ref_sink (_tmp11_);
	_data25_->dlg = _tmp11_;
	_tmp12_ = _data25_->dlg;
	adw_alert_dialog_add_response (_tmp12_, "cancel", _ ("Cancel"));
	_tmp13_ = _data25_->dlg;
	adw_alert_dialog_set_response_appearance (_tmp13_, "cancel", ADW_RESPONSE_DEFAULT);
	_tmp14_ = _data25_->dlg;
	adw_alert_dialog_add_response (_tmp14_, "discard", _ ("Discard"));
	_tmp15_ = _data25_->dlg;
	adw_alert_dialog_set_response_appearance (_tmp15_, "discard", ADW_RESPONSE_DESTRUCTIVE);
	_tmp16_ = _data25_->dlg;
	adw_alert_dialog_add_response (_tmp16_, "create", _ ("Create"));
	_tmp17_ = _data25_->dlg;
	adw_alert_dialog_set_response_appearance (_tmp17_, "create", ADW_RESPONSE_SUGGESTED);
	_tmp18_ = _data25_->dlg;
	adw_alert_dialog_set_default_response (_tmp18_, "cancel");
	_tmp19_ = _data25_->dlg;
	adw_alert_dialog_choose (_tmp19_, (GtkWidget*) self, NULL, ___lambda58__gasync_ready_callback, block25_data_ref (_data25_));
	block25_data_unref (_data25_);
	_data25_ = NULL;
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		TubaDialogsCollections* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->builder);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}

static gboolean
__lambda59_ (Block26Data* _data26_,
             GeeMapEntry* e)
{
	TubaDialogsCollections* self;
	JsonBuilder* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	gboolean result;
	self = _data26_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = _data26_->builder;
	_tmp1_ = gee_map_entry_get_key (e);
	_tmp2_ = _tmp1_;
	json_builder_add_string_value (_tmp0_, (const gchar*) _tmp2_);
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

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

static void
tuba_dialogs_collections_create_collection (TubaDialogsCollections* self)
{
	Block26Data* _data26_;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_;
	JsonBuilder* _tmp8_;
	JsonBuilder* _tmp9_;
	JsonBuilder* _tmp10_;
	JsonBuilder* _tmp11_;
	AdwEntryRow* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	AdwEntryRow* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gboolean _tmp22_;
	JsonBuilder* _tmp30_;
	AdwComboRow* _tmp31_;
	guint _tmp32_;
	guint _tmp33_;
	gchar* topic = NULL;
	AdwEntryRow* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	gchar* _tmp52_;
	gboolean _tmp53_ = FALSE;
	const gchar* _tmp54_;
	JsonBuilder* _tmp65_;
	JsonBuilder* _tmp66_;
	GtkCheckButton* _tmp67_;
	gboolean _tmp68_;
	gboolean _tmp69_;
	JsonBuilder* _tmp70_;
	JsonBuilder* _tmp71_;
	GtkCheckButton* _tmp72_;
	gboolean _tmp73_;
	gboolean _tmp74_;
	JsonBuilder* _tmp75_;
	JsonBuilder* _tmp76_;
	GeeHashMap* _tmp77_;
	JsonBuilder* _tmp78_;
	JsonBuilder* _tmp79_;
	TubaRequestV2* req = NULL;
	TubaAccountStore* _tmp80_;
	TubaInstanceAccount* _tmp81_;
	TubaInstanceAccount* _tmp82_;
	TubaInstanceAccount* _tmp83_;
	TubaRequestV2* _tmp84_ = NULL;
	TubaRequestV2* _tmp85_;
	JsonBuilder* _tmp86_;
	TubaRequestV2* _tmp87_;
	g_return_if_fail (self != NULL);
	_data26_ = g_slice_new0 (Block26Data);
	_data26_->_ref_count_ = 1;
	_data26_->self = g_object_ref (self);
	if (self->priv->edit_mode) {
		block26_data_unref (_data26_);
		_data26_ = NULL;
		return;
	}
	gtk_widget_set_sensitive ((GtkWidget*) self, FALSE);
	_tmp0_ = self->priv->name_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strcmp0 (_tmp4_, "") == 0;
	_g_free0 (_tmp4_);
	if (_tmp5_) {
		AdwEntryRow* _tmp6_;
		AdwToast* _tmp7_ = NULL;
		gtk_widget_set_sensitive ((GtkWidget*) self, TRUE);
		_tmp6_ = self->priv->name_row;
		gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
		_tmp7_ = adw_toast_new (_ ("Name cannot be empty"));
		adw_toast_set_timeout (_tmp7_, (guint) 10);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) self, _tmp7_);
		block26_data_unref (_data26_);
		_data26_ = NULL;
		return;
	}
	_tmp8_ = json_builder_new ();
	_data26_->builder = _tmp8_;
	_tmp9_ = _data26_->builder;
	json_builder_begin_object (_tmp9_);
	_tmp10_ = _data26_->builder;
	json_builder_set_member_name (_tmp10_, "name");
	_tmp11_ = _data26_->builder;
	_tmp12_ = self->priv->name_row;
	_tmp13_ = gtk_editable_get_text ((GtkEditable*) _tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = string_strip (_tmp14_);
	_tmp16_ = _tmp15_;
	json_builder_add_string_value (_tmp11_, _tmp16_);
	_g_free0 (_tmp16_);
	_tmp17_ = self->priv->description_row;
	_tmp18_ = gtk_editable_get_text ((GtkEditable*) _tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = string_strip (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = g_strcmp0 (_tmp21_, "") != 0;
	_g_free0 (_tmp21_);
	if (_tmp22_) {
		JsonBuilder* _tmp23_;
		JsonBuilder* _tmp24_;
		AdwEntryRow* _tmp25_;
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		_tmp23_ = _data26_->builder;
		json_builder_set_member_name (_tmp23_, "description");
		_tmp24_ = _data26_->builder;
		_tmp25_ = self->priv->description_row;
		_tmp26_ = gtk_editable_get_text ((GtkEditable*) _tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = string_strip (_tmp27_);
		_tmp29_ = _tmp28_;
		json_builder_add_string_value (_tmp24_, _tmp29_);
		_g_free0 (_tmp29_);
	}
	_tmp30_ = _data26_->builder;
	json_builder_set_member_name (_tmp30_, "language");
	_tmp31_ = self->priv->lang_row;
	_tmp32_ = adw_combo_row_get_selected (_tmp31_);
	_tmp33_ = _tmp32_;
	if (_tmp33_ == GTK_INVALID_LIST_POSITION) {
		JsonBuilder* _tmp34_;
		_tmp34_ = _data26_->builder;
		json_builder_add_string_value (_tmp34_, "en");
	} else {
		TubaUtilsLocalesLocale* locale_obj = NULL;
		AdwComboRow* _tmp35_;
		GObject* _tmp36_;
		GObject* _tmp37_;
		TubaUtilsLocalesLocale* _tmp38_;
		const gchar* _tmp39_ = NULL;
		gboolean _tmp40_ = FALSE;
		TubaUtilsLocalesLocale* _tmp41_;
		JsonBuilder* _tmp48_;
		_tmp35_ = self->priv->lang_row;
		_tmp36_ = adw_combo_row_get_selected_item (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = _g_object_ref0 (TUBA_UTILS_LOCALES_IS_LOCALE (_tmp37_) ? ((TubaUtilsLocalesLocale*) _tmp37_) : NULL);
		locale_obj = _tmp38_;
		_tmp41_ = locale_obj;
		if (_tmp41_ == NULL) {
			_tmp40_ = TRUE;
		} else {
			TubaUtilsLocalesLocale* _tmp42_;
			const gchar* _tmp43_;
			const gchar* _tmp44_;
			_tmp42_ = locale_obj;
			_tmp43_ = tuba_utils_locales_locale_get_locale (_tmp42_);
			_tmp44_ = _tmp43_;
			_tmp40_ = _tmp44_ == NULL;
		}
		if (_tmp40_) {
			_tmp39_ = "en";
		} else {
			TubaUtilsLocalesLocale* _tmp45_;
			const gchar* _tmp46_;
			const gchar* _tmp47_;
			_tmp45_ = locale_obj;
			_tmp46_ = tuba_utils_locales_locale_get_locale (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp39_ = _tmp47_;
		}
		_tmp48_ = _data26_->builder;
		json_builder_add_string_value (_tmp48_, _tmp39_);
		_g_object_unref0 (locale_obj);
	}
	_tmp49_ = self->priv->topic_row;
	_tmp50_ = gtk_editable_get_text ((GtkEditable*) _tmp49_);
	_tmp51_ = _tmp50_;
	_tmp52_ = string_strip (_tmp51_);
	topic = _tmp52_;
	_tmp54_ = topic;
	if (g_strcmp0 (_tmp54_, "#") != 0) {
		const gchar* _tmp55_;
		_tmp55_ = topic;
		_tmp53_ = g_strcmp0 (_tmp55_, "") != 0;
	} else {
		_tmp53_ = FALSE;
	}
	if (_tmp53_) {
		JsonBuilder* _tmp56_;
		const gchar* _tmp57_ = NULL;
		const gchar* _tmp58_;
		JsonBuilder* _tmp59_;
		const gchar* _tmp60_;
		const gchar* _tmp61_;
		const gchar* _tmp62_;
		gchar* _tmp63_;
		gchar* _tmp64_;
		_tmp56_ = _data26_->builder;
		json_builder_set_member_name (_tmp56_, "tag_name");
		_tmp58_ = topic;
		if (g_str_has_prefix (_tmp58_, "#")) {
			_tmp57_ = "";
		} else {
			_tmp57_ = "#";
		}
		_tmp59_ = _data26_->builder;
		_tmp60_ = string_to_string (_tmp57_);
		_tmp61_ = topic;
		_tmp62_ = string_to_string (_tmp61_);
		_tmp63_ = g_strconcat (_tmp60_, _tmp62_, NULL);
		_tmp64_ = _tmp63_;
		json_builder_add_string_value (_tmp59_, _tmp64_);
		_g_free0 (_tmp64_);
	}
	_tmp65_ = _data26_->builder;
	json_builder_set_member_name (_tmp65_, "sensitive");
	_tmp66_ = _data26_->builder;
	_tmp67_ = self->priv->cw_checkbox;
	_tmp68_ = gtk_check_button_get_active (_tmp67_);
	_tmp69_ = _tmp68_;
	json_builder_add_boolean_value (_tmp66_, _tmp69_);
	_tmp70_ = _data26_->builder;
	json_builder_set_member_name (_tmp70_, "discoverable");
	_tmp71_ = _data26_->builder;
	_tmp72_ = self->priv->public_checkbox;
	_tmp73_ = gtk_check_button_get_active (_tmp72_);
	_tmp74_ = _tmp73_;
	json_builder_add_boolean_value (_tmp71_, _tmp74_);
	_tmp75_ = _data26_->builder;
	json_builder_set_member_name (_tmp75_, "account_ids");
	_tmp76_ = _data26_->builder;
	json_builder_begin_array (_tmp76_);
	_tmp77_ = self->priv->members;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp77_, ___lambda59__gee_forall_func, _data26_);
	_tmp78_ = _data26_->builder;
	json_builder_end_array (_tmp78_);
	_tmp79_ = _data26_->builder;
	json_builder_end_object (_tmp79_);
	_tmp80_ = tuba_accounts;
	_tmp81_ = tuba_account_store_get_active (_tmp80_);
	_tmp82_ = _tmp81_;
	_tmp83_ = _g_object_ref0 (_tmp82_);
	_tmp84_ = tuba_request_v2_new ("/api/v1/collections", TUBA_REQUEST_V2_METHOD_POST);
	tuba_request_v2_set_account (_tmp84_, _tmp83_);
	_g_object_unref0 (_tmp83_);
	req = _tmp84_;
	_tmp85_ = req;
	_tmp86_ = _data26_->builder;
	tuba_request_v2_set_body_from_json (_tmp85_, _tmp86_);
	_tmp87_ = req;
	tuba_dialogs_collections_create_collection_real (self, _tmp87_, NULL, NULL);
	_g_object_unref0 (req);
	_g_free0 (topic);
	block26_data_unref (_data26_);
	_data26_ = NULL;
}

static void
tuba_dialogs_collections_create_collection_real_data_free (gpointer _data)
{
	TubaDialogsCollectionsCreateCollectionRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->req);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsCreateCollectionRealData, _data_);
}

static void
tuba_dialogs_collections_create_collection_real (TubaDialogsCollections* self,
                                                 TubaRequestV2* req,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	TubaDialogsCollectionsCreateCollectionRealData* _data_;
	TubaDialogsCollections* _tmp0_;
	TubaRequestV2* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (req != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsCreateCollectionRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_create_collection_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (req);
	_g_object_unref0 (_data_->req);
	_data_->req = _tmp1_;
	tuba_dialogs_collections_create_collection_real_co (_data_);
}

static void
tuba_dialogs_collections_create_collection_real_finish (TubaDialogsCollections* self,
                                                        GAsyncResult* _res_)
{
	TubaDialogsCollectionsCreateCollectionRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_collections_create_collection_real_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_)
{
	TubaDialogsCollectionsCreateCollectionRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_create_collection_real_co (_data_);
}

static gboolean
tuba_dialogs_collections_create_collection_real_co (TubaDialogsCollectionsCreateCollectionRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_dialogs_collections_create_collection_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp1_ = _data_->_tmp0_;
		_g_object_unref0 (_data_->_tmp1_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gtk_widget_set_sensitive ((GtkWidget*) _data_->self, TRUE);
		g_signal_emit (_data_->self, tuba_dialogs_collections_signals[TUBA_DIALOGS_COLLECTIONS_REFRESH_SIGNAL], 0);
		adw_dialog_force_close ((AdwDialog*) _data_->self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp2_ = _data_->e;
		_data_->_tmp3_ = g_strdup_printf ("%i", _data_->_tmp2_->code);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = _data_->e;
		_data_->_tmp6_ = _data_->_tmp5_->message;
		_data_->_tmp7_ = string_to_string (_data_->_tmp6_);
		_data_->_tmp8_ = g_strconcat ("Error while creating collection: ", _data_->_tmp4_, " ", _data_->_tmp7_, NULL);
		_data_->_tmp9_ = _data_->_tmp8_;
		g_warning ("Collections.vala:468: %s", _data_->_tmp9_);
		_g_free0 (_data_->_tmp9_);
		_g_free0 (_data_->_tmp4_);
		_data_->_tmp10_ = _data_->e;
		_data_->_tmp11_ = _data_->_tmp10_->message;
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = adw_toast_new (_data_->_tmp11_);
		adw_toast_set_timeout (_data_->_tmp12_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) _data_->self, _data_->_tmp12_);
		gtk_widget_set_sensitive ((GtkWidget*) _data_->self, TRUE);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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_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_dialogs_collections_update_member_metadata (TubaDialogsCollections* self)
{
	AdwPreferencesGroup* _tmp0_;
	GeeHashMap* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	TubaWidgetsAccountRow** _tmp6_;
	gint _tmp6__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->members_group;
	_tmp1_ = self->priv->members;
	_tmp2_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf (_ ("Members (%d/%d)"), _tmp3_, TUBA_DIALOGS_COLLECTIONS_MAX_MEMBERS);
	_tmp5_ = _tmp4_;
	adw_preferences_group_set_title (_tmp0_, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = self->priv->search_results;
	_tmp6__length1 = self->priv->search_results_length1;
	{
		TubaWidgetsAccountRow** widg_collection = NULL;
		gint widg_collection_length1 = 0;
		gint _widg_collection_size_ = 0;
		gint widg_it = 0;
		widg_collection = _tmp6_;
		widg_collection_length1 = _tmp6__length1;
		for (widg_it = 0; widg_it < widg_collection_length1; widg_it = widg_it + 1) {
			TubaWidgetsAccountRow* _tmp7_;
			TubaWidgetsAccountRow* widg = NULL;
			_tmp7_ = _g_object_ref0 (widg_collection[widg_it]);
			widg = _tmp7_;
			{
				TubaWidgetsAccountRow* _tmp8_;
				GeeHashMap* _tmp9_;
				TubaWidgetsAccountRow* _tmp10_;
				TubaAPIAccount* _tmp11_;
				TubaAPIAccount* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gboolean _tmp15_ = FALSE;
				GeeHashMap* _tmp16_;
				gint _tmp17_;
				gint _tmp18_;
				TubaWidgetsAccountRow* _tmp22_;
				_tmp8_ = widg;
				_tmp9_ = self->priv->members;
				_tmp10_ = widg;
				_tmp11_ = tuba_widgets_account_row_get_account (_tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = tuba_api_account_get_id (_tmp12_);
				_tmp14_ = _tmp13_;
				tuba_widgets_account_row_set_checkbox_active (_tmp8_, gee_abstract_map_has_key ((GeeAbstractMap*) _tmp9_, _tmp14_));
				_tmp16_ = self->priv->members;
				_tmp17_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp16_);
				_tmp18_ = _tmp17_;
				if (_tmp18_ < TUBA_DIALOGS_COLLECTIONS_MAX_MEMBERS) {
					_tmp15_ = TRUE;
				} else {
					TubaWidgetsAccountRow* _tmp19_;
					gboolean _tmp20_;
					gboolean _tmp21_;
					_tmp19_ = widg;
					_tmp20_ = tuba_widgets_account_row_get_checkbox_active (_tmp19_);
					_tmp21_ = _tmp20_;
					_tmp15_ = _tmp21_;
				}
				_tmp22_ = widg;
				tuba_widgets_account_row_set_checkbox_sensitive (_tmp22_, _tmp15_);
				_g_object_unref0 (widg);
			}
		}
	}
}

static gboolean
_tuba_dialogs_collections_update_search_results_gsource_func (gpointer self)
{
	gboolean result;
	result = tuba_dialogs_collections_update_search_results ((TubaDialogsCollections*) self);
	return result;
}

static void
tuba_dialogs_collections_on_search_changed (TubaDialogsCollections* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->search_timeout_id > ((guint) 0)) {
		g_source_remove (self->priv->search_timeout_id);
		self->priv->search_timeout_id = (guint) 0;
	}
	self->priv->search_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, _tuba_dialogs_collections_update_search_results_gsource_func, g_object_ref (self), g_object_unref);
}

static void
__lambda57_ (TubaDialogsCollections* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		tuba_dialogs_collections_update_search_results_real_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (g_error_matches (_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_inner_error0_);
		g_debug ("Collections.vala:504: Message is cancelled.");
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		AdwToast* _tmp2_ = NULL;
		GError* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		_tmp2_ = adw_toast_new (_tmp1_);
		adw_toast_set_timeout (_tmp2_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) self, _tmp2_);
		_tmp3_ = e;
		_tmp4_ = g_strdup_printf ("%i", _tmp3_->code);
		_tmp5_ = _tmp4_;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		_tmp8_ = string_to_string (_tmp7_);
		_tmp9_ = g_strconcat ("Error while searching users: ", _tmp5_, " ", _tmp8_, NULL);
		_tmp10_ = _tmp9_;
		g_warning ("Collections.vala:509: %s", _tmp10_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp5_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	self->priv->search_timeout_id = (guint) 0;
	_g_object_unref0 (self->priv->last_search_req);
	self->priv->last_search_req = NULL;
}

static void
___lambda57__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda57_ ((TubaDialogsCollections*) self, source_object, res);
	g_object_unref (self);
}

static gboolean
tuba_dialogs_collections_update_search_results (TubaDialogsCollections* self)
{
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->search_timeout_id == ((guint) 0)) {
		self->priv->search_timeout_id = (guint) 0;
		result = G_SOURCE_REMOVE;
		return result;
	}
	_tmp0_ = self->priv->search_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	tuba_dialogs_collections_update_search_results_real (self, _tmp2_, ___lambda57__gasync_ready_callback, g_object_ref (self));
	result = G_SOURCE_REMOVE;
	return result;
}

static void
tuba_dialogs_collections_update_search_results_real_data_free (gpointer _data)
{
	TubaDialogsCollectionsUpdateSearchResultsRealData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsUpdateSearchResultsRealData, _data_);
}

static void
tuba_dialogs_collections_update_search_results_real (TubaDialogsCollections* self,
                                                     const gchar* query,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	TubaDialogsCollectionsUpdateSearchResultsRealData* _data_;
	TubaDialogsCollections* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (query != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsUpdateSearchResultsRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_update_search_results_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	tuba_dialogs_collections_update_search_results_real_co (_data_);
}

static void
tuba_dialogs_collections_update_search_results_real_finish (TubaDialogsCollections* self,
                                                            GAsyncResult* _res_,
                                                            GError** error)
{
	TubaDialogsCollectionsUpdateSearchResultsRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
tuba_dialogs_collections_update_search_results_real_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	TubaDialogsCollectionsUpdateSearchResultsRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_update_search_results_real_co (_data_);
}

static JsonNode*
_vala_JsonNode_copy (JsonNode* self)
{
	return g_boxed_copy (json_node_get_type (), self);
}

static gpointer
__vala_JsonNode_copy0 (gpointer self)
{
	return self ? _vala_JsonNode_copy (self) : NULL;
}

static void
_tuba_dialogs_collections_on_account_toggled_tuba_widgets_account_row_checkbox_toggled (TubaWidgetsAccountRow* _sender,
                                                                                        gboolean new_state,
                                                                                        gpointer self)
{
	tuba_dialogs_collections_on_account_toggled ((TubaDialogsCollections*) self, _sender, new_state);
}

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

static void
__lambda56_ (TubaDialogsCollections* self,
             JsonNode* node,
             GError** error)
{
	TubaEntity* entity = NULL;
	JsonNode* _tmp0_;
	TubaEntity* _tmp1_;
	TubaEntity* _tmp2_;
	g_return_if_fail (node != NULL);
	_tmp0_ = __vala_JsonNode_copy0 (node);
	_tmp1_ = tuba_helper_entity_from_json (_tmp0_, TUBA_API_TYPE_ACCOUNT, FALSE);
	entity = _tmp1_;
	_tmp2_ = entity;
	if (TUBA_API_IS_ACCOUNT (_tmp2_)) {
		TubaWidgetsAccountRow* widget = NULL;
		TubaEntity* _tmp3_;
		TubaWidgetsAccountRow* _tmp4_;
		TubaWidgetsAccountRow* _tmp5_;
		TubaWidgetsAccountRow* _tmp6_;
		TubaWidgetsAccountRow* _tmp7_;
		TubaWidgetsAccountRow* _tmp8_;
		GeeHashMap* _tmp9_;
		TubaEntity* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gboolean _tmp13_ = FALSE;
		GeeHashMap* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		TubaWidgetsAccountRow* _tmp20_;
		gboolean _tmp21_ = FALSE;
		TubaEntity* _tmp22_;
		TubaAPIAccountFeatureApproval* _tmp23_;
		TubaAPIAccountFeatureApproval* _tmp24_;
		TubaWidgetsAccountRow* _tmp30_;
		TubaWidgetsAccountRow* _tmp31_;
		TubaWidgetsAccountRow* _tmp32_;
		AdwPreferencesGroup* _tmp33_;
		TubaWidgetsAccountRow* _tmp34_;
		_tmp3_ = entity;
		_tmp4_ = tuba_widgets_account_row_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TUBA_API_TYPE_ACCOUNT, TubaAPIAccount), FALSE);
		g_object_ref_sink (_tmp4_);
		widget = _tmp4_;
		_tmp5_ = widget;
		gtk_list_box_row_set_activatable ((GtkListBoxRow*) _tmp5_, FALSE);
		_tmp6_ = widget;
		tuba_widgets_account_row_add_checkbox (_tmp6_, _ ("Invite"));
		_tmp7_ = widget;
		g_signal_connect_object (_tmp7_, "checkbox-toggled", (GCallback) _tuba_dialogs_collections_on_account_toggled_tuba_widgets_account_row_checkbox_toggled, self, 0);
		_tmp8_ = widget;
		_tmp9_ = self->priv->members;
		_tmp10_ = entity;
		_tmp11_ = tuba_api_account_get_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TUBA_API_TYPE_ACCOUNT, TubaAPIAccount));
		_tmp12_ = _tmp11_;
		tuba_widgets_account_row_set_checkbox_active (_tmp8_, gee_abstract_map_has_key ((GeeAbstractMap*) _tmp9_, _tmp12_));
		_tmp14_ = self->priv->members;
		_tmp15_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp14_);
		_tmp16_ = _tmp15_;
		if (_tmp16_ < TUBA_DIALOGS_COLLECTIONS_MAX_MEMBERS) {
			_tmp13_ = TRUE;
		} else {
			TubaWidgetsAccountRow* _tmp17_;
			gboolean _tmp18_;
			gboolean _tmp19_;
			_tmp17_ = widget;
			_tmp18_ = tuba_widgets_account_row_get_checkbox_active (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp13_ = _tmp19_;
		}
		_tmp20_ = widget;
		tuba_widgets_account_row_set_checkbox_sensitive (_tmp20_, _tmp13_);
		_tmp22_ = entity;
		_tmp23_ = tuba_api_account_get_feature_approval (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TUBA_API_TYPE_ACCOUNT, TubaAPIAccount));
		_tmp24_ = _tmp23_;
		if (_tmp24_ != NULL) {
			TubaEntity* _tmp25_;
			TubaAPIAccountFeatureApproval* _tmp26_;
			TubaAPIAccountFeatureApproval* _tmp27_;
			gboolean _tmp28_;
			gboolean _tmp29_;
			_tmp25_ = entity;
			_tmp26_ = tuba_api_account_get_feature_approval (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, TUBA_API_TYPE_ACCOUNT, TubaAPIAccount));
			_tmp27_ = _tmp26_;
			_tmp28_ = tuba_api_account_feature_approval_get_tuba_can_invite (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp21_ = _tmp29_;
		} else {
			_tmp21_ = FALSE;
		}
		_tmp30_ = widget;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp30_, _tmp21_);
		_tmp31_ = widget;
		_tmp32_ = _g_object_ref0 (_tmp31_);
		_vala_array_add11 (&self->priv->search_results, &self->priv->search_results_length1, &self->priv->_search_results_size_, _tmp32_);
		_tmp33_ = self->priv->search_group;
		_tmp34_ = widget;
		adw_preferences_group_add (_tmp33_, (GtkWidget*) _tmp34_);
		_g_object_unref0 (widget);
	}
	_g_object_unref0 (entity);
}

static void
___lambda56__tuba_network_node_callback (JsonNode* node,
                                         gpointer self,
                                         GError** error)
{
	__lambda56_ ((TubaDialogsCollections*) self, node, error);
}

static gboolean
tuba_dialogs_collections_update_search_results_real_co (TubaDialogsCollectionsUpdateSearchResultsRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->search_timeout_id == ((guint) 0)) {
		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;
	}
	_data_->_tmp0_ = _data_->self->priv->search_results;
	_data_->_tmp0__length1 = _data_->self->priv->search_results_length1;
	{
		_data_->widg_collection_length1 = 0;
		_data_->_widg_collection_size_ = 0;
		_data_->widg_collection = _data_->_tmp0_;
		_data_->widg_collection_length1 = _data_->_tmp0__length1;
		for (_data_->widg_it = 0; _data_->widg_it < _data_->widg_collection_length1; _data_->widg_it = _data_->widg_it + 1) {
			_data_->_tmp1_ = _g_object_ref0 (_data_->widg_collection[_data_->widg_it]);
			_data_->widg = _data_->_tmp1_;
			{
				_data_->_tmp2_ = _data_->self->priv->search_group;
				_data_->_tmp3_ = _data_->widg;
				adw_preferences_group_remove (_data_->_tmp2_, (GtkWidget*) _data_->_tmp3_);
				_g_object_unref0 (_data_->widg);
			}
		}
	}
	_data_->_tmp4_ = g_new0 (TubaWidgetsAccountRow*, 0 + 1);
	_data_->self->priv->search_results = (_vala_array_free (_data_->self->priv->search_results, _data_->self->priv->search_results_length1, (GDestroyNotify) g_object_unref), NULL);
	_data_->self->priv->search_results = _data_->_tmp4_;
	_data_->self->priv->search_results_length1 = 0;
	_data_->self->priv->_search_results_size_ = _data_->self->priv->search_results_length1;
	_data_->_tmp5_ = _data_->self->priv->last_search_req;
	if (_data_->_tmp5_ != NULL) {
		_data_->_tmp6_ = _data_->self->priv->last_search_req;
		_data_->_tmp7_ = tuba_request_v2_get_cancellable (_data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		g_cancellable_cancel (_data_->_tmp8_);
		_g_object_unref0 (_data_->self->priv->last_search_req);
		_data_->self->priv->last_search_req = NULL;
	}
	_data_->_tmp10_ = string_strip (_data_->query);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = tuba_api_account_search (_data_->_tmp11_, &_data_->_inner_error0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_g_free0 (_data_->_tmp11_);
	_data_->_tmp9_ = _data_->_tmp13_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = _data_->_tmp9_;
	_data_->_tmp9_ = NULL;
	_g_object_unref0 (_data_->self->priv->last_search_req);
	_data_->self->priv->last_search_req = _data_->_tmp14_;
	_data_->_tmp15_ = _data_->self->priv->last_search_req;
	_data_->_state_ = 1;
	tuba_request_v2_exec (_data_->_tmp15_, tuba_dialogs_collections_update_search_results_real_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp16_ = tuba_request_v2_exec_finish (_data_->_tmp15_, _data_->_res_, NULL, &_data_->_inner_error0_);
	_data_->in_stream = _data_->_tmp16_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp9_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp19_ = _data_->self->priv->search_results;
	_data_->_tmp19__length1 = _data_->self->priv->search_results_length1;
	if (_data_->_tmp19__length1 > 0) {
		_data_->_tmp18_ = TRUE;
	} else {
		_data_->_tmp20_ = _data_->self->priv->last_search_req;
		_data_->_tmp18_ = _data_->_tmp20_ == NULL;
	}
	if (_data_->_tmp18_) {
		_data_->_tmp17_ = TRUE;
	} else {
		_data_->_tmp21_ = _data_->self->priv->last_search_req;
		_data_->_tmp22_ = tuba_request_v2_get_cancellable (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp17_ = g_cancellable_is_cancelled (_data_->_tmp23_);
	}
	if (_data_->_tmp17_) {
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->_tmp9_);
		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;
	}
	_data_->_tmp24_ = _data_->in_stream;
	_data_->_state_ = 2;
	tuba_network_get_parser_from_inputstream_async (_data_->_tmp24_, NULL, tuba_dialogs_collections_update_search_results_real_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp25_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->parser = _data_->_tmp25_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->_tmp9_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp26_ = _data_->parser;
	tuba_network_parse_array (_data_->_tmp26_, ___lambda56__tuba_network_node_callback, g_object_ref (_data_->self), g_object_unref, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->_tmp9_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->parser);
	_g_object_unref0 (_data_->in_stream);
	_g_object_unref0 (_data_->_tmp9_);
	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 gboolean
_tuba_dialogs_collections_update_tag_search_results_gsource_func (gpointer self)
{
	gboolean result;
	result = tuba_dialogs_collections_update_tag_search_results ((TubaDialogsCollections*) self);
	return result;
}

static void
tuba_dialogs_collections_on_tag_search_changed (TubaDialogsCollections* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->tag_timeout_id > ((guint) 0)) {
		g_source_remove (self->priv->tag_timeout_id);
		self->priv->tag_timeout_id = (guint) 0;
	}
	self->priv->tag_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, _tuba_dialogs_collections_update_tag_search_results_gsource_func, g_object_ref (self), g_object_unref);
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static void
__lambda55_ (TubaDialogsCollections* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		tuba_dialogs_collections_update_tag_search_results_real_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (g_error_matches (_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_inner_error0_);
		g_debug ("Collections.vala:572: Message is cancelled.");
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		AdwToast* _tmp2_ = NULL;
		GError* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		_tmp2_ = adw_toast_new (_tmp1_);
		adw_toast_set_timeout (_tmp2_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) self, _tmp2_);
		_tmp3_ = e;
		_tmp4_ = g_strdup_printf ("%i", _tmp3_->code);
		_tmp5_ = _tmp4_;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		_tmp8_ = string_to_string (_tmp7_);
		_tmp9_ = g_strconcat ("Error while searching tags: ", _tmp5_, " ", _tmp8_, NULL);
		_tmp10_ = _tmp9_;
		g_warning ("Collections.vala:577: %s", _tmp10_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp5_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	self->priv->tag_timeout_id = (guint) 0;
	_g_object_unref0 (self->priv->last_tag_req);
	self->priv->last_tag_req = NULL;
}

static void
___lambda55__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda55_ ((TubaDialogsCollections*) self, source_object, res);
	g_object_unref (self);
}

static gboolean
tuba_dialogs_collections_update_tag_search_results (TubaDialogsCollections* self)
{
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->tag_timeout_id == ((guint) 0)) {
		self->priv->tag_timeout_id = (guint) 0;
		result = G_SOURCE_REMOVE;
		return result;
	}
	_tmp0_ = self->priv->topic_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_replace (_tmp2_, "#", "");
	_tmp4_ = _tmp3_;
	tuba_dialogs_collections_update_tag_search_results_real (self, _tmp4_, ___lambda55__gasync_ready_callback, g_object_ref (self));
	_g_free0 (_tmp4_);
	result = G_SOURCE_REMOVE;
	return result;
}

static void
tuba_dialogs_collections_update_tag_search_results_real_data_free (gpointer _data)
{
	TubaDialogsCollectionsUpdateTagSearchResultsRealData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsUpdateTagSearchResultsRealData, _data_);
}

static void
tuba_dialogs_collections_update_tag_search_results_real (TubaDialogsCollections* self,
                                                         const gchar* query,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_)
{
	TubaDialogsCollectionsUpdateTagSearchResultsRealData* _data_;
	TubaDialogsCollections* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (query != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsUpdateTagSearchResultsRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_update_tag_search_results_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	tuba_dialogs_collections_update_tag_search_results_real_co (_data_);
}

static void
tuba_dialogs_collections_update_tag_search_results_real_finish (TubaDialogsCollections* self,
                                                                GAsyncResult* _res_,
                                                                GError** error)
{
	TubaDialogsCollectionsUpdateTagSearchResultsRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
tuba_dialogs_collections_update_tag_search_results_real_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_)
{
	TubaDialogsCollectionsUpdateTagSearchResultsRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_update_tag_search_results_real_co (_data_);
}

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

static void
_tuba_dialogs_collections_on_tag_chosen_adw_action_row_activated (AdwActionRow* _sender,
                                                                  gpointer self)
{
	tuba_dialogs_collections_on_tag_chosen ((TubaDialogsCollections*) self, _sender);
}

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

static gboolean
___lambda54_ (TubaDialogsCollections* self,
              TubaAPITag* tag)
{
	TubaWidgetsTag* widget = NULL;
	TubaWidgetsTag* _tmp0_;
	GtkWidget* _tmp1_;
	AdwPreferencesGroup* _tmp2_;
	gboolean result;
	g_return_val_if_fail (tag != NULL, FALSE);
	_tmp0_ = tuba_widgets_tag_new (G_TYPE_CHECK_INSTANCE_CAST (tag, TUBA_API_TYPE_TAG, TubaAPITag));
	g_object_ref_sink (_tmp0_);
	widget = _tmp0_;
	gtk_widget_set_opacity ((GtkWidget*) widget, 0.7);
	g_signal_connect_object ((AdwActionRow*) widget, "activated", (GCallback) _tuba_dialogs_collections_on_tag_chosen_adw_action_row_activated, self, 0);
	_tmp1_ = _g_object_ref0 ((GtkWidget*) widget);
	_vala_array_add12 (&self->priv->tag_results, &self->priv->tag_results_length1, &self->priv->_tag_results_size_, _tmp1_);
	_tmp2_ = self->priv->details_group;
	adw_preferences_group_add (_tmp2_, (GtkWidget*) widget);
	result = TRUE;
	_g_object_unref0 (widget);
	_g_object_unref0 (tag);
	return result;
}

static gboolean
____lambda54__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = ___lambda54_ ((TubaDialogsCollections*) self, (TubaAPITag*) g);
	return result;
}

static gboolean
tuba_dialogs_collections_update_tag_search_results_real_co (TubaDialogsCollectionsUpdateTagSearchResultsRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->tag_timeout_id == ((guint) 0)) {
		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;
	}
	_data_->_tmp0_ = _data_->self->priv->tag_results;
	_data_->_tmp0__length1 = _data_->self->priv->tag_results_length1;
	{
		_data_->widg_collection_length1 = 0;
		_data_->_widg_collection_size_ = 0;
		_data_->widg_collection = _data_->_tmp0_;
		_data_->widg_collection_length1 = _data_->_tmp0__length1;
		for (_data_->widg_it = 0; _data_->widg_it < _data_->widg_collection_length1; _data_->widg_it = _data_->widg_it + 1) {
			_data_->_tmp1_ = _g_object_ref0 (_data_->widg_collection[_data_->widg_it]);
			_data_->widg = _data_->_tmp1_;
			{
				_data_->_tmp2_ = _data_->self->priv->details_group;
				_data_->_tmp3_ = _data_->widg;
				adw_preferences_group_remove (_data_->_tmp2_, _data_->_tmp3_);
				_g_object_unref0 (_data_->widg);
			}
		}
	}
	_data_->_tmp4_ = g_new0 (GtkWidget*, 0 + 1);
	_data_->self->priv->tag_results = (_vala_array_free (_data_->self->priv->tag_results, _data_->self->priv->tag_results_length1, (GDestroyNotify) g_object_unref), NULL);
	_data_->self->priv->tag_results = _data_->_tmp4_;
	_data_->self->priv->tag_results_length1 = 0;
	_data_->self->priv->_tag_results_size_ = _data_->self->priv->tag_results_length1;
	_data_->_tmp5_ = _data_->self->priv->last_tag_req;
	if (_data_->_tmp5_ != NULL) {
		_data_->_tmp6_ = _data_->self->priv->last_tag_req;
		_data_->_tmp7_ = tuba_request_v2_get_cancellable (_data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		g_cancellable_cancel (_data_->_tmp8_);
		_g_object_unref0 (_data_->self->priv->last_tag_req);
		_data_->self->priv->last_tag_req = NULL;
	}
	_data_->_tmp10_ = string_strip (_data_->query);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = tuba_api_tag_search (_data_->_tmp11_, &_data_->_inner_error0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_g_free0 (_data_->_tmp11_);
	_data_->_tmp9_ = _data_->_tmp13_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = _data_->_tmp9_;
	_data_->_tmp9_ = NULL;
	_g_object_unref0 (_data_->self->priv->last_tag_req);
	_data_->self->priv->last_tag_req = _data_->_tmp14_;
	_data_->_tmp15_ = _data_->self->priv->last_tag_req;
	_data_->_state_ = 1;
	tuba_request_v2_exec (_data_->_tmp15_, tuba_dialogs_collections_update_tag_search_results_real_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp16_ = tuba_request_v2_exec_finish (_data_->_tmp15_, _data_->_res_, NULL, &_data_->_inner_error0_);
	_data_->in_stream = _data_->_tmp16_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp9_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp19_ = _data_->self->priv->tag_results;
	_data_->_tmp19__length1 = _data_->self->priv->tag_results_length1;
	if (_data_->_tmp19__length1 > 0) {
		_data_->_tmp18_ = TRUE;
	} else {
		_data_->_tmp20_ = _data_->self->priv->last_tag_req;
		_data_->_tmp18_ = _data_->_tmp20_ == NULL;
	}
	if (_data_->_tmp18_) {
		_data_->_tmp17_ = TRUE;
	} else {
		_data_->_tmp21_ = _data_->self->priv->last_tag_req;
		_data_->_tmp22_ = tuba_request_v2_get_cancellable (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp17_ = g_cancellable_is_cancelled (_data_->_tmp23_);
	}
	if (_data_->_tmp17_) {
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->_tmp9_);
		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;
	}
	_data_->_tmp24_ = _data_->in_stream;
	_data_->_state_ = 2;
	tuba_network_get_parser_from_inputstream_async (_data_->_tmp24_, NULL, tuba_dialogs_collections_update_tag_search_results_real_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp25_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->parser = _data_->_tmp25_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->_tmp9_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp26_ = tuba_network;
	_data_->_tmp27_ = _data_->parser;
	_data_->_tmp28_ = tuba_network_parse_node (_data_->_tmp26_, _data_->_tmp27_);
	_data_->_tmp29_ = _data_->_tmp28_;
	_data_->_tmp30_ = tuba_api_search_results_from (_data_->_tmp29_, &_data_->_inner_error0_);
	_data_->_tmp31_ = _data_->_tmp30_;
	__vala_JsonNode_free0 (_data_->_tmp29_);
	_data_->results = _data_->_tmp31_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->_tmp9_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp32_ = _data_->results;
	if (_data_->_tmp32_ != NULL) {
		_data_->_tmp33_ = _data_->results;
		_data_->_tmp34_ = tuba_api_search_results_get_hashtags (_data_->_tmp33_);
		_data_->_tmp35_ = _data_->_tmp34_;
		gee_abstract_collection_foreach ((GeeAbstractCollection*) _data_->_tmp35_, ____lambda54__gee_forall_func, _data_->self);
	}
	_g_object_unref0 (_data_->results);
	_g_object_unref0 (_data_->parser);
	_g_object_unref0 (_data_->in_stream);
	_g_object_unref0 (_data_->_tmp9_);
	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_dialogs_collections_on_tag_chosen (TubaDialogsCollections* self,
                                        AdwActionRow* tag_row)
{
	AdwEntryRow* _tmp0_;
	guint _tmp1_;
	GtkWidget** _tmp2_;
	gint _tmp2__length1;
	GtkWidget** _tmp6_;
	AdwEntryRow* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	AdwEntryRow* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tag_row != NULL);
	_tmp0_ = self->priv->topic_row;
	g_signal_parse_name ("changed", gtk_editable_get_type (), &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((GtkEditable*) _tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _tuba_dialogs_collections_on_tag_search_changed_gtk_editable_changed, self);
	_tmp2_ = self->priv->tag_results;
	_tmp2__length1 = self->priv->tag_results_length1;
	{
		GtkWidget** widg_collection = NULL;
		gint widg_collection_length1 = 0;
		gint _widg_collection_size_ = 0;
		gint widg_it = 0;
		widg_collection = _tmp2_;
		widg_collection_length1 = _tmp2__length1;
		for (widg_it = 0; widg_it < widg_collection_length1; widg_it = widg_it + 1) {
			GtkWidget* _tmp3_;
			GtkWidget* widg = NULL;
			_tmp3_ = _g_object_ref0 (widg_collection[widg_it]);
			widg = _tmp3_;
			{
				AdwPreferencesGroup* _tmp4_;
				GtkWidget* _tmp5_;
				_tmp4_ = self->priv->details_group;
				_tmp5_ = widg;
				adw_preferences_group_remove (_tmp4_, _tmp5_);
				_g_object_unref0 (widg);
			}
		}
	}
	_tmp6_ = g_new0 (GtkWidget*, 0 + 1);
	self->priv->tag_results = (_vala_array_free (self->priv->tag_results, self->priv->tag_results_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->tag_results = _tmp6_;
	self->priv->tag_results_length1 = 0;
	self->priv->_tag_results_size_ = self->priv->tag_results_length1;
	_tmp7_ = self->priv->topic_row;
	_tmp8_ = tuba_widgets_tag_get_name (G_TYPE_CHECK_INSTANCE_CAST (tag_row, TUBA_WIDGETS_TYPE_TAG, TubaWidgetsTag));
	_tmp9_ = _tmp8_;
	gtk_editable_set_text ((GtkEditable*) _tmp7_, _tmp9_);
	_tmp10_ = self->priv->topic_row;
	g_signal_connect_object ((GtkEditable*) _tmp10_, "changed", (GCallback) _tuba_dialogs_collections_on_tag_search_changed_gtk_editable_changed, self, 0);
}

static void
tuba_dialogs_collections_on_account_toggled (TubaDialogsCollections* self,
                                             TubaWidgetsAccountRow* member_row,
                                             gboolean new_state)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (member_row != NULL);
	if (self->priv->edit_mode) {
		if (new_state) {
			JsonBuilder* builder = NULL;
			JsonBuilder* _tmp0_;
			JsonBuilder* _tmp1_;
			JsonBuilder* _tmp2_;
			JsonBuilder* _tmp3_;
			TubaAPIAccount* _tmp4_;
			TubaAPIAccount* _tmp5_;
			const gchar* _tmp6_;
			const gchar* _tmp7_;
			JsonBuilder* _tmp8_;
			TubaRequestV2* req = NULL;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			gchar* _tmp11_;
			gchar* _tmp12_;
			TubaAccountStore* _tmp13_;
			TubaInstanceAccount* _tmp14_;
			TubaInstanceAccount* _tmp15_;
			TubaInstanceAccount* _tmp16_;
			TubaRequestV2* _tmp17_ = NULL;
			TubaRequestV2* _tmp18_;
			TubaRequestV2* _tmp19_;
			JsonBuilder* _tmp20_;
			TubaRequestV2* _tmp21_;
			_tmp0_ = json_builder_new ();
			builder = _tmp0_;
			_tmp1_ = builder;
			json_builder_begin_object (_tmp1_);
			_tmp2_ = builder;
			json_builder_set_member_name (_tmp2_, "account_id");
			_tmp3_ = builder;
			_tmp4_ = tuba_widgets_account_row_get_account (member_row);
			_tmp5_ = _tmp4_;
			_tmp6_ = tuba_api_account_get_id (_tmp5_);
			_tmp7_ = _tmp6_;
			json_builder_add_string_value (_tmp3_, _tmp7_);
			_tmp8_ = builder;
			json_builder_end_object (_tmp8_);
			gtk_widget_set_sensitive ((GtkWidget*) member_row, FALSE);
			_tmp9_ = self->priv->collection_id;
			_tmp10_ = string_to_string (_tmp9_);
			_tmp11_ = g_strconcat ("/api/v1/collections/", _tmp10_, "/items", NULL);
			_tmp12_ = _tmp11_;
			_tmp13_ = tuba_accounts;
			_tmp14_ = tuba_account_store_get_active (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = _g_object_ref0 (_tmp15_);
			_tmp17_ = tuba_request_v2_new (_tmp12_, TUBA_REQUEST_V2_METHOD_POST);
			tuba_request_v2_set_account (_tmp17_, _tmp16_);
			_g_object_unref0 (_tmp16_);
			_tmp18_ = _tmp17_;
			_g_free0 (_tmp12_);
			req = _tmp18_;
			_tmp19_ = req;
			_tmp20_ = builder;
			tuba_request_v2_set_body_from_json (_tmp19_, _tmp20_);
			_tmp21_ = req;
			tuba_dialogs_collections_post_account_real (self, _tmp21_, member_row, NULL, NULL);
			_g_object_unref0 (req);
			_g_object_unref0 (builder);
		} else {
			TubaRequestV2* req = NULL;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			GeeHashMap* _tmp24_;
			TubaAPIAccount* _tmp25_;
			TubaAPIAccount* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			gpointer _tmp29_;
			gchar* _tmp30_;
			const gchar* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			TubaAccountStore* _tmp34_;
			TubaInstanceAccount* _tmp35_;
			TubaInstanceAccount* _tmp36_;
			TubaInstanceAccount* _tmp37_;
			TubaRequestV2* _tmp38_ = NULL;
			TubaRequestV2* _tmp39_;
			TubaRequestV2* _tmp40_;
			gtk_widget_set_sensitive ((GtkWidget*) member_row, FALSE);
			_tmp22_ = self->priv->collection_id;
			_tmp23_ = string_to_string (_tmp22_);
			_tmp24_ = self->priv->members_collection_items;
			_tmp25_ = tuba_widgets_account_row_get_account (member_row);
			_tmp26_ = _tmp25_;
			_tmp27_ = tuba_api_account_get_id (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp24_, _tmp28_);
			_tmp30_ = (gchar*) _tmp29_;
			_tmp31_ = string_to_string (_tmp30_);
			_tmp32_ = g_strconcat ("/api/v1/collections/", _tmp23_, "/items/", _tmp31_, NULL);
			_tmp33_ = _tmp32_;
			_tmp34_ = tuba_accounts;
			_tmp35_ = tuba_account_store_get_active (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = _g_object_ref0 (_tmp36_);
			_tmp38_ = tuba_request_v2_new (_tmp33_, TUBA_REQUEST_V2_METHOD_DELETE);
			tuba_request_v2_set_account (_tmp38_, _tmp37_);
			_g_object_unref0 (_tmp37_);
			_tmp39_ = _tmp38_;
			_g_free0 (_tmp33_);
			_g_free0 (_tmp30_);
			req = _tmp39_;
			_tmp40_ = req;
			tuba_dialogs_collections_delete_account_real (self, _tmp40_, member_row, NULL, NULL);
			_g_object_unref0 (req);
		}
	} else {
		if (new_state) {
			TubaAPIAccount* _tmp41_;
			TubaAPIAccount* _tmp42_;
			_tmp41_ = tuba_widgets_account_row_get_account (member_row);
			_tmp42_ = _tmp41_;
			tuba_dialogs_collections_add_account (self, _tmp42_, FALSE);
		} else {
			TubaAPIAccount* _tmp43_;
			TubaAPIAccount* _tmp44_;
			const gchar* _tmp45_;
			const gchar* _tmp46_;
			_tmp43_ = tuba_widgets_account_row_get_account (member_row);
			_tmp44_ = _tmp43_;
			_tmp45_ = tuba_api_account_get_id (_tmp44_);
			_tmp46_ = _tmp45_;
			tuba_dialogs_collections_remove_account (self, _tmp46_);
		}
	}
}

static void
tuba_dialogs_collections_post_account_real_data_free (gpointer _data)
{
	TubaDialogsCollectionsPostAccountRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->req);
	_g_object_unref0 (_data_->member_row);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsPostAccountRealData, _data_);
}

static void
tuba_dialogs_collections_post_account_real (TubaDialogsCollections* self,
                                            TubaRequestV2* req,
                                            TubaWidgetsAccountRow* member_row,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	TubaDialogsCollectionsPostAccountRealData* _data_;
	TubaDialogsCollections* _tmp0_;
	TubaRequestV2* _tmp1_;
	TubaWidgetsAccountRow* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (req != NULL);
	g_return_if_fail (member_row != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsPostAccountRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_post_account_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (req);
	_g_object_unref0 (_data_->req);
	_data_->req = _tmp1_;
	_tmp2_ = _g_object_ref0 (member_row);
	_g_object_unref0 (_data_->member_row);
	_data_->member_row = _tmp2_;
	tuba_dialogs_collections_post_account_real_co (_data_);
}

static void
tuba_dialogs_collections_post_account_real_finish (TubaDialogsCollections* self,
                                                   GAsyncResult* _res_)
{
	TubaDialogsCollectionsPostAccountRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_collections_post_account_real_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	TubaDialogsCollectionsPostAccountRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_post_account_real_co (_data_);
}

static gboolean
tuba_dialogs_collections_post_account_real_co (TubaDialogsCollectionsPostAccountRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_dialogs_collections_post_account_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp0_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp1_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp1_, NULL, tuba_dialogs_collections_post_account_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp2_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp3_ = tuba_network;
		_data_->_tmp4_ = _data_->parser;
		_data_->_tmp5_ = tuba_network_parse_node (_data_->_tmp3_, _data_->_tmp4_);
		_data_->node = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->node;
		_data_->_tmp7_ = __vala_JsonNode_copy0 (_data_->_tmp6_);
		_data_->_tmp8_ = tuba_helper_entity_from_json (_data_->_tmp7_, TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM, FALSE);
		_data_->ci = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp8_, TUBA_API_TYPE_WRAPPED_COLLECTION_ITEM, TubaAPIWrappedCollectionItem);
		_data_->_tmp9_ = tuba_widgets_account_row_get_account (_data_->member_row);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->ci;
		_data_->_tmp12_ = tuba_api_wrapped_collection_item_get_collection_item (_data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = tuba_api_collection_item_get_state (_data_->_tmp13_);
		_data_->_tmp15_ = _data_->_tmp14_;
		tuba_dialogs_collections_add_account (_data_->self, _data_->_tmp10_, g_strcmp0 (_data_->_tmp15_, "pending") == 0);
		_data_->_tmp16_ = _data_->self->priv->members_collection_items;
		_data_->_tmp17_ = tuba_widgets_account_row_get_account (_data_->member_row);
		_data_->_tmp18_ = _data_->_tmp17_;
		_data_->_tmp19_ = tuba_api_account_get_id (_data_->_tmp18_);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = _data_->ci;
		_data_->_tmp22_ = tuba_api_wrapped_collection_item_get_collection_item (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = tuba_api_collection_item_get_id (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp16_, _data_->_tmp20_, _data_->_tmp25_);
		gtk_widget_set_sensitive ((GtkWidget*) _data_->member_row, TRUE);
		_g_object_unref0 (_data_->ci);
		__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_->_tmp26_ = _data_->e;
		_data_->_tmp27_ = _data_->_tmp26_->message;
		_data_->_tmp28_ = NULL;
		_data_->_tmp28_ = adw_toast_new (_data_->_tmp27_);
		adw_toast_set_timeout (_data_->_tmp28_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) _data_->self, _data_->_tmp28_);
		_data_->_tmp29_ = _data_->e;
		_data_->_tmp30_ = g_strdup_printf ("%i", _data_->_tmp29_->code);
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_tmp32_ = _data_->e;
		_data_->_tmp33_ = _data_->_tmp32_->message;
		_data_->_tmp34_ = string_to_string (_data_->_tmp33_);
		_data_->_tmp35_ = g_strconcat ("Error while adding collection member: ", _data_->_tmp31_, " ", _data_->_tmp34_, NULL);
		_data_->_tmp36_ = _data_->_tmp35_;
		g_warning ("Collections.vala:673: %s", _data_->_tmp36_);
		_g_free0 (_data_->_tmp36_);
		_g_free0 (_data_->_tmp31_);
		gtk_widget_set_sensitive ((GtkWidget*) _data_->member_row, TRUE);
		g_signal_parse_name ("checkbox-toggled", TUBA_WIDGETS_TYPE_ACCOUNT_ROW, &_data_->_tmp37_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_data_->member_row, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp37_, 0, NULL, (GCallback) _tuba_dialogs_collections_on_account_toggled_tuba_widgets_account_row_checkbox_toggled, _data_->self);
		tuba_widgets_account_row_set_checkbox_active (_data_->member_row, FALSE);
		g_signal_connect_object (_data_->member_row, "checkbox-toggled", (GCallback) _tuba_dialogs_collections_on_account_toggled_tuba_widgets_account_row_checkbox_toggled, _data_->self, 0);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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_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_dialogs_collections_delete_account_real_data_free (gpointer _data)
{
	TubaDialogsCollectionsDeleteAccountRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->req);
	_g_object_unref0 (_data_->member_row);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsCollectionsDeleteAccountRealData, _data_);
}

static void
tuba_dialogs_collections_delete_account_real (TubaDialogsCollections* self,
                                              TubaRequestV2* req,
                                              TubaWidgetsAccountRow* member_row,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	TubaDialogsCollectionsDeleteAccountRealData* _data_;
	TubaDialogsCollections* _tmp0_;
	TubaRequestV2* _tmp1_;
	TubaWidgetsAccountRow* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (req != NULL);
	g_return_if_fail (member_row != NULL);
	_data_ = g_slice_new0 (TubaDialogsCollectionsDeleteAccountRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_collections_delete_account_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (req);
	_g_object_unref0 (_data_->req);
	_data_->req = _tmp1_;
	_tmp2_ = _g_object_ref0 (member_row);
	_g_object_unref0 (_data_->member_row);
	_data_->member_row = _tmp2_;
	tuba_dialogs_collections_delete_account_real_co (_data_);
}

static void
tuba_dialogs_collections_delete_account_real_finish (TubaDialogsCollections* self,
                                                     GAsyncResult* _res_)
{
	TubaDialogsCollectionsDeleteAccountRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_collections_delete_account_real_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	TubaDialogsCollectionsDeleteAccountRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_collections_delete_account_real_co (_data_);
}

static gboolean
tuba_dialogs_collections_delete_account_real_co (TubaDialogsCollectionsDeleteAccountRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_dialogs_collections_delete_account_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp1_ = _data_->_tmp0_;
		_g_object_unref0 (_data_->_tmp1_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp2_ = tuba_widgets_account_row_get_account (_data_->member_row);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = tuba_api_account_get_id (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		tuba_dialogs_collections_remove_account (_data_->self, _data_->_tmp5_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp6_ = _data_->e;
		_data_->_tmp7_ = _data_->_tmp6_->message;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = adw_toast_new (_data_->_tmp7_);
		adw_toast_set_timeout (_data_->_tmp8_, (guint) 5);
		adw_preferences_dialog_add_toast ((AdwPreferencesDialog*) _data_->self, _data_->_tmp8_);
		_data_->_tmp9_ = _data_->e;
		_data_->_tmp10_ = g_strdup_printf ("%i", _data_->_tmp9_->code);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = _data_->e;
		_data_->_tmp13_ = _data_->_tmp12_->message;
		_data_->_tmp14_ = string_to_string (_data_->_tmp13_);
		_data_->_tmp15_ = g_strconcat ("Error while removing collection member: ", _data_->_tmp11_, " ", _data_->_tmp14_, NULL);
		_data_->_tmp16_ = _data_->_tmp15_;
		g_warning ("Collections.vala:689: %s", _data_->_tmp16_);
		_g_free0 (_data_->_tmp16_);
		_g_free0 (_data_->_tmp11_);
		gtk_widget_set_sensitive ((GtkWidget*) _data_->member_row, TRUE);
		g_signal_parse_name ("checkbox-toggled", TUBA_WIDGETS_TYPE_ACCOUNT_ROW, &_data_->_tmp17_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_data_->member_row, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _data_->_tmp17_, 0, NULL, (GCallback) _tuba_dialogs_collections_on_account_toggled_tuba_widgets_account_row_checkbox_toggled, _data_->self);
		tuba_widgets_account_row_set_checkbox_active (_data_->member_row, TRUE);
		g_signal_connect_object (_data_->member_row, "checkbox-toggled", (GCallback) _tuba_dialogs_collections_on_account_toggled_tuba_widgets_account_row_checkbox_toggled, _data_->self, 0);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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_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_dialogs_collections_on_acc_row_remove_clicked_tuba_widgets_account_row_button_clicked (TubaWidgetsAccountRow* _sender,
                                                                                             gpointer self)
{
	tuba_dialogs_collections_on_acc_row_remove_clicked ((TubaDialogsCollections*) self, _sender);
}

static void
tuba_dialogs_collections_add_account (TubaDialogsCollections* self,
                                      TubaAPIAccount* acc,
                                      gboolean pending)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	TubaWidgetsAccountRow* member_row = NULL;
	TubaWidgetsAccountRow* _tmp7_;
	TubaWidgetsAccountRow* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar** _tmp20_;
	gchar** _tmp21_;
	gint _tmp21__length1;
	TubaWidgetsAccountRow* _tmp22_;
	GeeHashMap* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	TubaWidgetsAccountRow* _tmp26_;
	AdwPreferencesGroup* _tmp27_;
	TubaWidgetsAccountRow* _tmp28_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (acc != NULL);
	_tmp1_ = self->priv->members;
	_tmp2_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ >= TUBA_DIALOGS_COLLECTIONS_MAX_MEMBERS) {
		_tmp0_ = TRUE;
	} else {
		GeeHashMap* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = self->priv->members;
		_tmp5_ = tuba_api_account_get_id (acc);
		_tmp6_ = _tmp5_;
		_tmp0_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, _tmp6_);
	}
	if (_tmp0_) {
		return;
	}
	_tmp7_ = tuba_widgets_account_row_new (acc, FALSE);
	g_object_ref_sink (_tmp7_);
	member_row = _tmp7_;
	if (pending) {
		TubaWidgetsAccountRow* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar** _tmp12_;
		gchar* _tmp13_;
		GtkLabel* _tmp14_ = NULL;
		GtkLabel* _tmp15_;
		_tmp8_ = member_row;
		_tmp9_ = g_strdup ("warning");
		_tmp10_ = g_strdup ("profile-role");
		_tmp11_ = g_strdup ("tuba-circular");
		_tmp12_ = g_new0 (gchar*, 3 + 1);
		_tmp12_[0] = _tmp9_;
		_tmp12_[1] = _tmp10_;
		_tmp12_[2] = _tmp11_;
		_tmp13_ = g_strdup (_ ("Pending"));
		_tmp14_ = (GtkLabel*) gtk_label_new (_ ("Pending"));
		gtk_widget_set_css_classes ((GtkWidget*) _tmp14_, _tmp12_);
		_tmp12_ = (_vala_array_free (_tmp12_, 3, (GDestroyNotify) g_free), NULL);
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp14_, _tmp13_);
		_g_free0 (_tmp13_);
		gtk_label_set_ellipsize (_tmp14_, PANGO_ELLIPSIZE_END);
		gtk_widget_set_valign ((GtkWidget*) _tmp14_, GTK_ALIGN_CENTER);
		g_object_ref_sink (_tmp14_);
		_tmp15_ = _tmp14_;
		tuba_widgets_account_row_add (_tmp8_, (GtkWidget*) _tmp15_);
		_g_object_unref0 (_tmp15_);
	}
	_tmp16_ = member_row;
	_tmp17_ = g_strdup ("circular");
	_tmp18_ = g_strdup ("flat");
	_tmp19_ = g_strdup ("error");
	_tmp20_ = g_new0 (gchar*, 3 + 1);
	_tmp20_[0] = _tmp17_;
	_tmp20_[1] = _tmp18_;
	_tmp20_[2] = _tmp19_;
	_tmp21_ = _tmp20_;
	_tmp21__length1 = 3;
	tuba_widgets_account_row_add_button (_tmp16_, _ ("Remove"), "user-trash-symbolic", _tmp21_, (gint) 3);
	_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) g_free), NULL);
	_tmp22_ = member_row;
	g_signal_connect_object (_tmp22_, "button-clicked", (GCallback) _tuba_dialogs_collections_on_acc_row_remove_clicked_tuba_widgets_account_row_button_clicked, self, 0);
	_tmp23_ = self->priv->members;
	_tmp24_ = tuba_api_account_get_id (acc);
	_tmp25_ = _tmp24_;
	_tmp26_ = member_row;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp23_, _tmp25_, _tmp26_);
	_tmp27_ = self->priv->members_group;
	_tmp28_ = member_row;
	adw_preferences_group_add (_tmp27_, (GtkWidget*) _tmp28_);
	tuba_dialogs_collections_update_member_metadata (self);
	_g_object_unref0 (member_row);
}

static void
tuba_dialogs_collections_remove_account (TubaDialogsCollections* self,
                                         const gchar* acc_id)
{
	GeeHashMap* _tmp0_;
	AdwPreferencesGroup* _tmp1_;
	GeeHashMap* _tmp2_;
	gpointer _tmp3_;
	TubaWidgetsAccountRow* _tmp4_;
	GeeHashMap* _tmp5_;
	GeeHashMap* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (acc_id != NULL);
	_tmp0_ = self->priv->members;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, acc_id)) {
		return;
	}
	_tmp1_ = self->priv->members_group;
	_tmp2_ = self->priv->members;
	_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, acc_id);
	_tmp4_ = (TubaWidgetsAccountRow*) _tmp3_;
	adw_preferences_group_remove (_tmp1_, (GtkWidget*) _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = self->priv->members;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp5_, acc_id, NULL);
	_tmp6_ = self->priv->members_collection_items;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp6_, acc_id)) {
		GeeHashMap* _tmp7_;
		_tmp7_ = self->priv->members_collection_items;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp7_, acc_id, NULL);
	}
	tuba_dialogs_collections_update_member_metadata (self);
}

static void
tuba_dialogs_collections_on_acc_row_remove_clicked (TubaDialogsCollections* self,
                                                    TubaWidgetsAccountRow* member_row)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (member_row != NULL);
	if (self->priv->edit_mode) {
		tuba_dialogs_collections_on_account_toggled (self, member_row, FALSE);
	} else {
		TubaAPIAccount* _tmp0_;
		TubaAPIAccount* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp0_ = tuba_widgets_account_row_get_account (member_row);
		_tmp1_ = _tmp0_;
		_tmp2_ = tuba_api_account_get_id (_tmp1_);
		_tmp3_ = _tmp2_;
		tuba_dialogs_collections_remove_account (self, _tmp3_);
	}
}

static void
tuba_dialogs_collections_class_init (TubaDialogsCollectionsClass * klass,
                                     gpointer klass_data)
{
	tuba_dialogs_collections_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsCollections_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_collections_finalize;
	tuba_dialogs_collections_signals[TUBA_DIALOGS_COLLECTIONS_REFRESH_SIGNAL] = g_signal_new ("refresh", TUBA_DIALOGS_TYPE_COLLECTIONS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
tuba_dialogs_collections_instance_init (TubaDialogsCollections * self,
                                        gpointer klass)
{
	gchar* _tmp0_;
	TubaWidgetsAccountRow** _tmp1_;
	GtkWidget** _tmp2_;
	GeeHashMap* _tmp3_;
	GeeHashMap* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	self->priv = tuba_dialogs_collections_get_instance_private (self);
	self->priv->edit_mode = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->collection_id = _tmp0_;
	_tmp1_ = g_new0 (TubaWidgetsAccountRow*, 0 + 1);
	self->priv->search_results = _tmp1_;
	self->priv->search_results_length1 = 0;
	self->priv->_search_results_size_ = self->priv->search_results_length1;
	_tmp2_ = g_new0 (GtkWidget*, 0 + 1);
	self->priv->tag_results = _tmp2_;
	self->priv->tag_results_length1 = 0;
	self->priv->_tag_results_size_ = self->priv->tag_results_length1;
	_tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TUBA_WIDGETS_TYPE_ACCOUNT_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->members = _tmp3_;
	_tmp4_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->members_collection_items = _tmp4_;
	_tmp5_ = g_strdup ("");
	self->priv->last_name = _tmp5_;
	_tmp6_ = g_strdup ("");
	self->priv->last_description = _tmp6_;
	self->priv->last_lang = (guint) 0;
	_tmp7_ = g_strdup ("");
	self->priv->last_topic = _tmp7_;
	self->priv->last_cw = FALSE;
	self->priv->last_disco = FALSE;
	self->priv->search_timeout_id = (guint) 0;
	self->priv->last_search_req = NULL;
	self->priv->tag_timeout_id = (guint) 0;
	self->priv->last_tag_req = NULL;
}

static void
tuba_dialogs_collections_finalize (GObject * obj)
{
	TubaDialogsCollections * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_TYPE_COLLECTIONS, TubaDialogsCollections);
	g_debug ("Collections.vala:5: Destroying Collections");
	tuba_dialogs_collections_clear (self);
	_g_free0 (self->priv->collection_id);
	_g_object_unref0 (self->priv->name_row);
	_g_object_unref0 (self->priv->description_row);
	_g_object_unref0 (self->priv->topic_row);
	_g_object_unref0 (self->priv->search_group);
	_g_object_unref0 (self->priv->details_group);
	self->priv->search_results = (_vala_array_free (self->priv->search_results, self->priv->search_results_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->tag_results = (_vala_array_free (self->priv->tag_results, self->priv->tag_results_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->search_row);
	_g_object_unref0 (self->priv->members_group);
	_g_object_unref0 (self->priv->members);
	_g_object_unref0 (self->priv->members_collection_items);
	_g_object_unref0 (self->priv->cw_checkbox);
	_g_object_unref0 (self->priv->public_checkbox);
	_g_object_unref0 (self->priv->unlisted_checkbox);
	_g_object_unref0 (self->priv->lang_row);
	_g_free0 (self->priv->last_name);
	_g_free0 (self->priv->last_description);
	_g_free0 (self->priv->last_topic);
	_g_object_unref0 (self->priv->last_search_req);
	_g_object_unref0 (self->priv->last_tag_req);
	G_OBJECT_CLASS (tuba_dialogs_collections_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_collections_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsCollectionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_collections_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsCollections), 0, (GInstanceInitFunc) tuba_dialogs_collections_instance_init, NULL };
	GType tuba_dialogs_collections_type_id;
	tuba_dialogs_collections_type_id = g_type_register_static (adw_preferences_dialog_get_type (), "TubaDialogsCollections", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsCollections_private_offset = g_type_add_instance_private (tuba_dialogs_collections_type_id, sizeof (TubaDialogsCollectionsPrivate));
	return tuba_dialogs_collections_type_id;
}

GType
tuba_dialogs_collections_get_type (void)
{
	static GType tuba_dialogs_collections_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_collections_type_id__once)) {
		GType tuba_dialogs_collections_type_id;
		tuba_dialogs_collections_type_id = tuba_dialogs_collections_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_collections_type_id__once, tuba_dialogs_collections_type_id);
	}
	return tuba_dialogs_collections_type_id__once;
}

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);
}

