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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "libdino.h"
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "xmpp-vala.h"
#include "dino_i18n.h"
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>

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

#define DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG (dino_ui_manage_accounts_add_account_dialog_get_type ())
#define DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG, DinoUiManageAccountsAddAccountDialog))
#define DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG, DinoUiManageAccountsAddAccountDialogClass))
#define DINO_UI_MANAGE_ACCOUNTS_IS_ADD_ACCOUNT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG))
#define DINO_UI_MANAGE_ACCOUNTS_IS_ADD_ACCOUNT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG))
#define DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG, DinoUiManageAccountsAddAccountDialogClass))

typedef struct _DinoUiManageAccountsAddAccountDialog DinoUiManageAccountsAddAccountDialog;
typedef struct _DinoUiManageAccountsAddAccountDialogClass DinoUiManageAccountsAddAccountDialogClass;
typedef struct _DinoUiManageAccountsAddAccountDialogPrivate DinoUiManageAccountsAddAccountDialogPrivate;
enum  {
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_0_PROPERTY,
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dino_ui_manage_accounts_add_account_dialog_properties[DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_NUM_PROPERTIES];
typedef enum  {
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN,
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN_TLS_ERROR,
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_SELECT_SERVER,
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_REGISTER_FORM,
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SUCCESS
} DinoUiManageAccountsAddAccountDialogPage;

#define DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_TYPE_PAGE (dino_ui_manage_accounts_add_account_dialog_page_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _xmpp_xep_data_forms_data_form_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_data_forms_data_form_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block83Data Block83Data;
#define _dino_register_server_availability_return_unref0(var) ((var == NULL) ? NULL : (var = (dino_register_server_availability_return_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData;
#define _dino_register_registration_form_return_unref0(var) ((var == NULL) ? NULL : (var = (dino_register_registration_form_return_unref (var), NULL)))
typedef struct _DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData;
typedef struct _DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData;
enum  {
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_ADDED_SIGNAL,
	DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_NUM_SIGNALS
};
static guint dino_ui_manage_accounts_add_account_dialog_signals[DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_NUM_SIGNALS] = {0};

struct _DinoUiManageAccountsAddAccountDialog {
	AdwWindow parent_instance;
	DinoUiManageAccountsAddAccountDialogPrivate * priv;
};

struct _DinoUiManageAccountsAddAccountDialogClass {
	AdwWindowClass parent_class;
};

struct _DinoUiManageAccountsAddAccountDialogPrivate {
	GtkStack* stack;
	GtkRevealer* notification_revealer;
	GtkLabel* notification_label;
	GtkBox* sign_in_box;
	GtkLabel* sign_in_error_label;
	AdwEntryRow* jid_entry;
	AdwPreferencesGroup* password_group;
	AdwPasswordEntryRow* password_entry;
	GtkButton* sign_in_continue_button;
	GtkSpinner* sign_in_continue_spinner;
	GtkButton* sign_in_serverlist_button;
	GtkBox* sign_in_tls_box;
	GtkLabel* sign_in_tls_label;
	GtkButton* sign_in_tls_back_button;
	GtkBox* create_account_box;
	GtkButton* login_button;
	GtkSpinner* select_server_continue_spinner;
	GtkButton* select_server_continue;
	GtkLabel* register_form_continue_label;
	GtkListBox* server_list_box;
	GtkEntry* server_entry;
	GtkButton* back_button;
	GtkBox* register_box;
	GtkBox* form_box;
	GtkSpinner* register_form_continue_spinner;
	GtkButton* register_form_continue;
	GtkBox* success_box;
	GtkLabel* success_description;
	GtkButton* success_continue_button;
	DinoStreamInteractor* stream_interactor;
	DinoDatabase* db;
	GeeHashMap* list_box_jids;
	XmppJid* server_jid;
	XmppJid* login_jid;
	XmppXepInBandRegistrationForm* form;
};

struct _Block83Data {
	int _ref_count_;
	DinoUiManageAccountsAddAccountDialog* self;
	gulong jid_entry_changed_handler_id;
};

struct _DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoUiManageAccountsAddAccountDialog* self;
	Block83Data* _data83_;
	XmppJid* _tmp0_;
	AdwEntryRow* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkButton* _tmp8_;
	GtkSpinner* _tmp9_;
	AdwEntryRow* _tmp10_;
	gulong _tmp11_;
	AdwPreferencesGroup* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	gchar* password;
	AdwPasswordEntryRow* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	DinoEntitiesAccount* account;
	XmppJid* _tmp19_;
	const gchar* _tmp20_;
	DinoEntitiesAccount* _tmp21_;
	DinoConnectionManagerConnectionErrorSource* _error_;
	DinoStreamInteractor* _tmp22_;
	DinoModuleIdentity* _tmp23_;
	gpointer _tmp24_;
	DinoRegister* _tmp25_;
	DinoEntitiesAccount* _tmp26_;
	DinoConnectionManagerConnectionErrorSource* _tmp27_;
	DinoConnectionManagerConnectionErrorSource* _tmp28_;
	GtkSpinner* _tmp29_;
	GtkButton* _tmp30_;
	DinoConnectionManagerConnectionErrorSource* _tmp31_;
	GtkLabel* _tmp32_;
	DinoConnectionManagerConnectionErrorSource* _tmp33_;
	GtkLabel* _tmp34_;
	const gchar* _tmp35_;
	GtkLabel* _tmp36_;
	const gchar* _tmp37_;
	DinoEntitiesAccount* _tmp38_;
	DinoEntitiesAccount* _tmp39_;
	DinoRegisterServerAvailabilityReturn* server_status;
	XmppJid* _tmp40_;
	DinoRegisterServerAvailabilityReturn* _tmp41_;
	GtkSpinner* _tmp42_;
	GtkButton* _tmp43_;
	DinoRegisterServerAvailabilityReturn* _tmp44_;
	gboolean _tmp45_;
	gboolean _tmp46_;
	AdwPreferencesGroup* _tmp47_;
	AdwPasswordEntryRow* _tmp48_;
	GtkButton* _tmp49_;
	DinoRegisterServerAvailabilityReturn* _tmp50_;
	GTlsCertificateFlags* _tmp51_;
	GTlsCertificateFlags* _tmp52_;
	XmppJid* _tmp53_;
	const gchar* _tmp54_;
	DinoRegisterServerAvailabilityReturn* _tmp55_;
	GTlsCertificateFlags* _tmp56_;
	GTlsCertificateFlags* _tmp57_;
	GtkLabel* _tmp58_;
	GtkLabel* _tmp59_;
	const gchar* _tmp60_;
	XmppJid* _tmp61_;
	const gchar* _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	GError* e;
	GError* _tmp65_;
	const gchar* _tmp66_;
	GtkLabel* _tmp67_;
	GtkLabel* _tmp68_;
	const gchar* _tmp69_;
	GError* _inner_error0_;
};

struct _DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoUiManageAccountsAddAccountDialog* self;
	XmppJid* server_jid;
	GtkSpinner* _tmp0_;
	DinoRegisterRegistrationFormReturn* form_return;
	DinoRegisterRegistrationFormReturn* _tmp1_;
	GtkSpinner* _tmp2_;
	GtkSpinner* _tmp3_;
	DinoRegisterRegistrationFormReturn* _tmp4_;
	XmppXepInBandRegistrationForm* _tmp5_;
	XmppXepInBandRegistrationForm* _tmp6_;
	DinoRegisterRegistrationFormReturn* _tmp7_;
	XmppXepInBandRegistrationForm* _tmp8_;
	XmppXepInBandRegistrationForm* _tmp9_;
	XmppXepInBandRegistrationForm* _tmp10_;
	XmppXepInBandRegistrationForm* _tmp11_;
	DinoRegisterRegistrationFormReturn* _tmp12_;
	GTlsCertificateFlags* _tmp13_;
	GTlsCertificateFlags* _tmp14_;
	const gchar* _tmp15_;
	DinoRegisterRegistrationFormReturn* _tmp16_;
	GTlsCertificateFlags* _tmp17_;
	GTlsCertificateFlags* _tmp18_;
	const gchar* _tmp19_;
};

struct _DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoUiManageAccountsAddAccountDialog* self;
	GtkRevealer* _tmp0_;
	XmppXepInBandRegistrationForm* _tmp1_;
	const gchar* _tmp2_;
	XmppXepInBandRegistrationForm* _tmp3_;
	const gchar* _tmp4_;
	GtkSpinner* _tmp5_;
	gchar* _error_;
	XmppJid* _tmp6_;
	XmppXepInBandRegistrationForm* _tmp7_;
	gchar* _tmp8_;
	GtkSpinner* _tmp9_;
	GtkSpinner* _tmp10_;
	const gchar* _tmp11_;
	gchar* username;
	gchar* password;
	GeeList* _field_list;
	XmppXepInBandRegistrationForm* _tmp12_;
	GeeList* _tmp13_;
	gint _field_size;
	GeeList* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _field_index;
	gint _tmp17_;
	gint _tmp18_;
	XmppXepDataFormsDataFormField* field;
	GeeList* _tmp19_;
	gpointer _tmp20_;
	XmppXepDataFormsDataFormField* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	GQuark _tmp26_;
	XmppXepDataFormsDataFormField* _tmp27_;
	gchar* _tmp28_;
	XmppXepDataFormsDataFormField* _tmp29_;
	gchar* _tmp30_;
	XmppJid* _tmp31_;
	const gchar* _tmp32_;
	XmppJid* _tmp33_;
	const gchar* _tmp34_;
	XmppJid* _tmp35_;
	DinoEntitiesAccount* account;
	const gchar* _tmp36_;
	DinoEntitiesAccount* _tmp37_;
	DinoEntitiesAccount* _tmp38_;
	DinoEntitiesAccount* _tmp39_;
	GError* e;
	GError* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	GError* _inner_error0_;
};

static gint DinoUiManageAccountsAddAccountDialog_private_offset;
static gpointer dino_ui_manage_accounts_add_account_dialog_parent_class = NULL;
static gchar** dino_ui_manage_accounts_add_account_dialog_server_list;
static gint dino_ui_manage_accounts_add_account_dialog_server_list_length1;
static gchar** dino_ui_manage_accounts_add_account_dialog_server_list = NULL;
static gint dino_ui_manage_accounts_add_account_dialog_server_list_length1 = 0;
static gint _dino_ui_manage_accounts_add_account_dialog_server_list_size_ = 0;

VALA_EXTERN GType dino_ui_manage_accounts_add_account_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiManageAccountsAddAccountDialog, g_object_unref)
static GType dino_ui_manage_accounts_add_account_dialog_page_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN DinoUiManageAccountsAddAccountDialog* dino_ui_manage_accounts_add_account_dialog_new (DinoStreamInteractor* stream_interactor,
                                                                                      DinoDatabase* db);
VALA_EXTERN DinoUiManageAccountsAddAccountDialog* dino_ui_manage_accounts_add_account_dialog_construct (GType object_type,
                                                                                            DinoStreamInteractor* stream_interactor,
                                                                                            DinoDatabase* db);
static void dino_ui_manage_accounts_add_account_dialog_on_jid_entry_changed (DinoUiManageAccountsAddAccountDialog* self);
static void _dino_ui_manage_accounts_add_account_dialog_on_jid_entry_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                            gpointer self);
static void dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked (DinoUiManageAccountsAddAccountDialog* self,
                                                                                    GAsyncReadyCallback _callback_,
                                                                                    gpointer _user_data_);
static void dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_finish (DinoUiManageAccountsAddAccountDialog* self,
                                                                                           GAsyncResult* _res_);
static void _dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                                        gpointer self);
static void dino_ui_manage_accounts_add_account_dialog_show_select_server (DinoUiManageAccountsAddAccountDialog* self);
static void _dino_ui_manage_accounts_add_account_dialog_show_select_server_gtk_button_clicked (GtkButton* _sender,
                                                                                        gpointer self);
static void __lambda236_ (DinoUiManageAccountsAddAccountDialog* self);
static void dino_ui_manage_accounts_add_account_dialog_show_sign_in (DinoUiManageAccountsAddAccountDialog* self,
                                                              gboolean keep_jid);
static void ___lambda236__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda237_ (DinoUiManageAccountsAddAccountDialog* self);
static void ___lambda237__gtk_editable_changed (GtkEditable* _sender,
                                         gpointer self);
static void dino_ui_manage_accounts_add_account_dialog_on_select_server_continue (DinoUiManageAccountsAddAccountDialog* self);
static void _dino_ui_manage_accounts_add_account_dialog_on_select_server_continue_gtk_button_clicked (GtkButton* _sender,
                                                                                               gpointer self);
static void __lambda238_ (DinoUiManageAccountsAddAccountDialog* self);
static void ___lambda238__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked (DinoUiManageAccountsAddAccountDialog* self,
                                                                                   GAsyncReadyCallback _callback_,
                                                                                   gpointer _user_data_);
static void dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_finish (DinoUiManageAccountsAddAccountDialog* self,
                                                                                          GAsyncResult* _res_);
static void _dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                                       gpointer self);
static void __lambda239_ (DinoUiManageAccountsAddAccountDialog* self);
static void ___lambda239__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda240_ (DinoUiManageAccountsAddAccountDialog* self);
static void ___lambda240__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void dino_ui_manage_accounts_add_account_dialog_switch_stack_page (DinoUiManageAccountsAddAccountDialog* self,
                                                                   DinoUiManageAccountsAddAccountDialogPage page);
static void dino_ui_manage_accounts_add_account_dialog_show_tls_error (DinoUiManageAccountsAddAccountDialog* self,
                                                                const gchar* domain,
                                                                GTlsCertificateFlags error_flags);
static void dino_ui_manage_accounts_add_account_dialog_on_server_list_row_activated (DinoUiManageAccountsAddAccountDialog* self,
                                                                              GtkListBox* box,
                                                                              GtkListBoxRow* row);
static void _dino_ui_manage_accounts_add_account_dialog_on_server_list_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                                          GtkListBoxRow* row,
                                                                                                          gpointer self);
static void dino_ui_manage_accounts_add_account_dialog_show_register_form (DinoUiManageAccountsAddAccountDialog* self);
static void dino_ui_manage_accounts_add_account_dialog_show_success (DinoUiManageAccountsAddAccountDialog* self,
                                                              DinoEntitiesAccount* account);
static void dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_data_free (gpointer _data);
static gboolean dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_co (DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData* _data_);
static Block83Data* block83_data_ref (Block83Data* _data83_);
static void block83_data_unref (void * _userdata_);
static void ___lambda234_ (Block83Data* _data83_);
static void ____lambda234__gtk_editable_changed (GtkEditable* _sender,
                                          gpointer self);
static void dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_ready (GObject* source_object,
                                                                                          GAsyncResult* _res_,
                                                                                          gpointer _user_data_);
static void dino_ui_manage_accounts_add_account_dialog_add_activate_account (DinoUiManageAccountsAddAccountDialog* self,
                                                                      DinoEntitiesAccount* account);
static void dino_ui_manage_accounts_add_account_dialog_request_show_register_form (DinoUiManageAccountsAddAccountDialog* self,
                                                                            XmppJid* server_jid,
                                                                            GAsyncReadyCallback _callback_,
                                                                            gpointer _user_data_);
static void dino_ui_manage_accounts_add_account_dialog_request_show_register_form_finish (DinoUiManageAccountsAddAccountDialog* self,
                                                                                   GAsyncResult* _res_);
static void dino_ui_manage_accounts_add_account_dialog_display_notification (DinoUiManageAccountsAddAccountDialog* self,
                                                                      const gchar* text);
static void dino_ui_manage_accounts_add_account_dialog_request_show_register_form_data_free (gpointer _data);
static gboolean dino_ui_manage_accounts_add_account_dialog_request_show_register_form_co (DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData* _data_);
static void dino_ui_manage_accounts_add_account_dialog_request_show_register_form_ready (GObject* source_object,
                                                                                  GAsyncResult* _res_,
                                                                                  gpointer _user_data_);
static void dino_ui_manage_accounts_add_account_dialog_set_register_form (DinoUiManageAccountsAddAccountDialog* self,
                                                                   XmppJid* server,
                                                                   XmppXepInBandRegistrationForm* form);
VALA_EXTERN gchar* dino_ui_util_parse_add_markup (const gchar* s_,
                                      const gchar* highlight_word,
                                      gboolean parse_links,
                                      gboolean parse_text_markup);
VALA_EXTERN gchar* dino_ui_util_unbreak_space_around_non_spacing_mark (gchar* s);
VALA_EXTERN AdwPreferencesGroup* dino_ui_util_rows_to_preference_group (GListStore* row_view_models,
                                                            const gchar* title);
VALA_EXTERN GListStore* dino_ui_util_get_data_form_view_model (XmppXepDataFormsDataForm* data_form);
static void dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_data_free (gpointer _data);
static gboolean dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_co (DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData* _data_);
static void dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_ready (GObject* source_object,
                                                                                         GAsyncResult* _res_,
                                                                                         gpointer _user_data_);
static gboolean __lambda235_ (DinoUiManageAccountsAddAccountDialog* self);
static gboolean ___lambda235__gsource_func (gpointer self);
static gchar* dino_ui_manage_accounts_add_account_dialog_get_visible_stack_child_name (DinoUiManageAccountsAddAccountDialog* self,
                                                                                DinoUiManageAccountsAddAccountDialogPage page);
static void dino_ui_manage_accounts_add_account_dialog_finalize (GObject * obj);
static GType dino_ui_manage_accounts_add_account_dialog_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_manage_accounts_add_account_dialog_get_instance_private (DinoUiManageAccountsAddAccountDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiManageAccountsAddAccountDialog_private_offset);
}

static GType
dino_ui_manage_accounts_add_account_dialog_page_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN, "DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN", "sign-in"}, {DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN_TLS_ERROR, "DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN_TLS_ERROR", "sign-in-tls-error"}, {DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_SELECT_SERVER, "DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_SELECT_SERVER", "create-account-select-server"}, {DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_REGISTER_FORM, "DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_REGISTER_FORM", "create-account-register-form"}, {DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SUCCESS, "DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SUCCESS", "success"}, {0, NULL, NULL}};
	GType dino_ui_manage_accounts_add_account_dialog_page_type_id;
	dino_ui_manage_accounts_add_account_dialog_page_type_id = g_enum_register_static ("DinoUiManageAccountsAddAccountDialogPage", values);
	return dino_ui_manage_accounts_add_account_dialog_page_type_id;
}

static GType
dino_ui_manage_accounts_add_account_dialog_page_get_type (void)
{
	static volatile gsize dino_ui_manage_accounts_add_account_dialog_page_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_manage_accounts_add_account_dialog_page_type_id__once)) {
		GType dino_ui_manage_accounts_add_account_dialog_page_type_id;
		dino_ui_manage_accounts_add_account_dialog_page_type_id = dino_ui_manage_accounts_add_account_dialog_page_get_type_once ();
		g_once_init_leave (&dino_ui_manage_accounts_add_account_dialog_page_type_id__once, dino_ui_manage_accounts_add_account_dialog_page_type_id);
	}
	return dino_ui_manage_accounts_add_account_dialog_page_type_id__once;
}

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

static gpointer
_qlite_database_ref0 (gpointer self)
{
	return self ? qlite_database_ref (self) : NULL;
}

static void
_dino_ui_manage_accounts_add_account_dialog_on_jid_entry_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                       gpointer self)
{
	dino_ui_manage_accounts_add_account_dialog_on_jid_entry_changed ((DinoUiManageAccountsAddAccountDialog*) self);
}

static void
_dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                                   gpointer self)
{
	dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked ((DinoUiManageAccountsAddAccountDialog*) self, NULL, NULL);
}

static void
_dino_ui_manage_accounts_add_account_dialog_show_select_server_gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self)
{
	dino_ui_manage_accounts_add_account_dialog_show_select_server ((DinoUiManageAccountsAddAccountDialog*) self);
}

static void
__lambda236_ (DinoUiManageAccountsAddAccountDialog* self)
{
	dino_ui_manage_accounts_add_account_dialog_show_sign_in (self, FALSE);
}

static void
___lambda236__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda236_ ((DinoUiManageAccountsAddAccountDialog*) self);
}

static void
__lambda237_ (DinoUiManageAccountsAddAccountDialog* self)
{
	GError* _inner_error0_ = NULL;
	{
		XmppJid* jid = NULL;
		GtkEntry* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		XmppJid* _tmp3_;
		gboolean _tmp4_ = FALSE;
		gboolean _tmp5_ = FALSE;
		GtkButton* _tmp8_;
		_tmp0_ = self->priv->server_entry;
		_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = xmpp_jid_new (_tmp2_, &_inner_error0_);
		jid = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_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;
		}
		if (jid != NULL) {
			const gchar* _tmp6_;
			_tmp6_ = jid->localpart;
			_tmp5_ = _tmp6_ == NULL;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			const gchar* _tmp7_;
			_tmp7_ = jid->resourcepart;
			_tmp4_ = _tmp7_ == NULL;
		} else {
			_tmp4_ = FALSE;
		}
		_tmp8_ = self->priv->select_server_continue;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, _tmp4_);
		_xmpp_jid_unref0 (jid);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GtkButton* _tmp9_;
		g_clear_error (&_inner_error0_);
		_tmp9_ = self->priv->select_server_continue;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, FALSE);
	}
	__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
___lambda237__gtk_editable_changed (GtkEditable* _sender,
                                    gpointer self)
{
	__lambda237_ ((DinoUiManageAccountsAddAccountDialog*) self);
}

static void
_dino_ui_manage_accounts_add_account_dialog_on_select_server_continue_gtk_button_clicked (GtkButton* _sender,
                                                                                          gpointer self)
{
	dino_ui_manage_accounts_add_account_dialog_on_select_server_continue ((DinoUiManageAccountsAddAccountDialog*) self);
}

static void
__lambda238_ (DinoUiManageAccountsAddAccountDialog* self)
{
	dino_ui_manage_accounts_add_account_dialog_show_sign_in (self, FALSE);
}

static void
___lambda238__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda238_ ((DinoUiManageAccountsAddAccountDialog*) self);
}

static void
_dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                                  gpointer self)
{
	dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked ((DinoUiManageAccountsAddAccountDialog*) self, NULL, NULL);
}

static void
__lambda239_ (DinoUiManageAccountsAddAccountDialog* self)
{
	GtkButton* _tmp0_;
	dino_ui_manage_accounts_add_account_dialog_show_select_server (self);
	_tmp0_ = self->priv->back_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
}

static void
___lambda239__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda239_ ((DinoUiManageAccountsAddAccountDialog*) self);
}

static void
__lambda240_ (DinoUiManageAccountsAddAccountDialog* self)
{
	gtk_window_close ((GtkWindow*) self);
}

static void
___lambda240__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda240_ ((DinoUiManageAccountsAddAccountDialog*) self);
}

DinoUiManageAccountsAddAccountDialog*
dino_ui_manage_accounts_add_account_dialog_construct (GType object_type,
                                                      DinoStreamInteractor* stream_interactor,
                                                      DinoDatabase* db)
{
	DinoUiManageAccountsAddAccountDialog * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoDatabase* _tmp1_;
	const gchar* _tmp2_;
	AdwEntryRow* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkEntry* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	GtkButton* _tmp22_;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoUiManageAccountsAddAccountDialog*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp1_;
	_tmp2_ = dino_gettext ("Add Account");
	gtk_window_set_title ((GtkWindow*) self, _tmp2_);
	_tmp3_ = self->priv->jid_entry;
	g_signal_connect_object ((GtkEditable*) _tmp3_, "changed", (GCallback) _dino_ui_manage_accounts_add_account_dialog_on_jid_entry_changed_gtk_editable_changed, self, 0);
	_tmp4_ = self->priv->sign_in_continue_button;
	g_signal_connect_object (_tmp4_, "clicked", (GCallback) _dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_gtk_button_clicked, self, 0);
	_tmp5_ = self->priv->sign_in_serverlist_button;
	g_signal_connect_object (_tmp5_, "clicked", (GCallback) _dino_ui_manage_accounts_add_account_dialog_show_select_server_gtk_button_clicked, self, 0);
	_tmp6_ = self->priv->sign_in_tls_back_button;
	g_signal_connect_object (_tmp6_, "clicked", (GCallback) ___lambda236__gtk_button_clicked, self, 0);
	_tmp7_ = self->priv->server_entry;
	g_signal_connect_object ((GtkEditable*) _tmp7_, "changed", (GCallback) ___lambda237__gtk_editable_changed, self, 0);
	_tmp8_ = self->priv->select_server_continue;
	g_signal_connect_object (_tmp8_, "clicked", (GCallback) _dino_ui_manage_accounts_add_account_dialog_on_select_server_continue_gtk_button_clicked, self, 0);
	_tmp9_ = self->priv->login_button;
	g_signal_connect_object (_tmp9_, "clicked", (GCallback) ___lambda238__gtk_button_clicked, self, 0);
	_tmp10_ = dino_ui_manage_accounts_add_account_dialog_server_list;
	_tmp10__length1 = dino_ui_manage_accounts_add_account_dialog_server_list_length1;
	{
		gchar** server_collection = NULL;
		gint server_collection_length1 = 0;
		gint _server_collection_size_ = 0;
		gint server_it = 0;
		server_collection = _tmp10_;
		server_collection_length1 = _tmp10__length1;
		for (server_it = 0; server_it < server_collection_length1; server_it = server_it + 1) {
			gchar* _tmp11_;
			gchar* server = NULL;
			_tmp11_ = g_strdup (server_collection[server_it]);
			server = _tmp11_;
			{
				GtkListBoxRow* list_box_row = NULL;
				GtkListBoxRow* _tmp12_;
				GtkListBoxRow* _tmp13_;
				const gchar* _tmp14_;
				GtkLabel* _tmp15_ = NULL;
				GtkLabel* _tmp16_;
				GeeHashMap* _tmp17_;
				GtkListBoxRow* _tmp18_;
				const gchar* _tmp19_;
				GtkListBox* _tmp20_;
				GtkListBoxRow* _tmp21_;
				_tmp12_ = (GtkListBoxRow*) gtk_list_box_row_new ();
				g_object_ref_sink (_tmp12_);
				list_box_row = _tmp12_;
				_tmp13_ = list_box_row;
				_tmp14_ = server;
				_tmp15_ = (GtkLabel*) gtk_label_new (_tmp14_);
				gtk_label_set_xalign (_tmp15_, (gfloat) 0);
				gtk_widget_set_margin_start ((GtkWidget*) _tmp15_, 7);
				gtk_widget_set_margin_end ((GtkWidget*) _tmp15_, 7);
				g_object_ref_sink (_tmp15_);
				_tmp16_ = _tmp15_;
				gtk_list_box_row_set_child (_tmp13_, (GtkWidget*) _tmp16_);
				_g_object_unref0 (_tmp16_);
				_tmp17_ = self->priv->list_box_jids;
				_tmp18_ = list_box_row;
				_tmp19_ = server;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, _tmp18_, _tmp19_);
				_tmp20_ = self->priv->server_list_box;
				_tmp21_ = list_box_row;
				gtk_list_box_append (_tmp20_, (GtkWidget*) _tmp21_);
				_g_object_unref0 (list_box_row);
				_g_free0 (server);
			}
		}
	}
	_tmp22_ = self->priv->register_form_continue;
	g_signal_connect_object (_tmp22_, "clicked", (GCallback) _dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_gtk_button_clicked, self, 0);
	_tmp23_ = self->priv->back_button;
	g_signal_connect_object (_tmp23_, "clicked", (GCallback) ___lambda239__gtk_button_clicked, self, 0);
	_tmp24_ = self->priv->success_continue_button;
	g_signal_connect_object (_tmp24_, "clicked", (GCallback) ___lambda240__gtk_button_clicked, self, 0);
	dino_ui_manage_accounts_add_account_dialog_show_sign_in (self, FALSE);
	return self;
}

DinoUiManageAccountsAddAccountDialog*
dino_ui_manage_accounts_add_account_dialog_new (DinoStreamInteractor* stream_interactor,
                                                DinoDatabase* db)
{
	return dino_ui_manage_accounts_add_account_dialog_construct (DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG, stream_interactor, db);
}

static void
dino_ui_manage_accounts_add_account_dialog_show_sign_in (DinoUiManageAccountsAddAccountDialog* self,
                                                         gboolean keep_jid)
{
	const gchar* _tmp0_;
	GtkButton* _tmp1_;
	GtkLabel* _tmp2_;
	GtkSpinner* _tmp3_;
	AdwPasswordEntryRow* _tmp6_;
	AdwPreferencesGroup* _tmp7_;
	GtkButton* _tmp8_;
	g_return_if_fail (self != NULL);
	dino_ui_manage_accounts_add_account_dialog_switch_stack_page (self, DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN);
	_tmp0_ = dino_gettext ("Sign in");
	gtk_window_set_title ((GtkWindow*) self, _tmp0_);
	_tmp1_ = self->priv->sign_in_continue_button;
	gtk_window_set_default_widget ((GtkWindow*) self, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->sign_in_error_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = self->priv->sign_in_continue_spinner;
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, FALSE);
	if (!keep_jid) {
		AdwEntryRow* _tmp4_;
		AdwEntryRow* _tmp5_;
		_tmp4_ = self->priv->jid_entry;
		gtk_editable_set_text ((GtkEditable*) _tmp4_, "");
		_tmp5_ = self->priv->jid_entry;
		gtk_widget_grab_focus ((GtkWidget*) _tmp5_);
	}
	_tmp6_ = self->priv->password_entry;
	gtk_editable_set_text ((GtkEditable*) _tmp6_, "");
	_tmp7_ = self->priv->password_group;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, FALSE);
	_tmp8_ = self->priv->sign_in_serverlist_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp8_, TRUE);
}

static void
dino_ui_manage_accounts_add_account_dialog_show_tls_error (DinoUiManageAccountsAddAccountDialog* self,
                                                           const gchar* domain,
                                                           GTlsCertificateFlags error_flags)
{
	gchar* error_desc = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkLabel* _tmp27_;
	const gchar* _tmp28_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (domain != NULL);
	dino_ui_manage_accounts_add_account_dialog_switch_stack_page (self, DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN_TLS_ERROR);
	_tmp0_ = dino_gettext ("The server could not prove that it is %s.");
	_tmp1_ = g_strconcat ("<b>", domain, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (_tmp2_, "</b>", NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup_printf (_tmp0_, _tmp4_);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	error_desc = _tmp6_;
	if ((error_flags & G_TLS_CERTIFICATE_UNKNOWN_CA) == G_TLS_CERTIFICATE_UNKNOWN_CA) {
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp7_ = error_desc;
		_tmp8_ = dino_gettext ("Its security certificate is not trusted by your operating system.");
		_tmp9_ = g_strconcat (" ", _tmp8_, NULL);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strconcat (_tmp7_, _tmp10_, NULL);
		_g_free0 (error_desc);
		error_desc = _tmp11_;
		_g_free0 (_tmp10_);
	} else {
		if ((error_flags & G_TLS_CERTIFICATE_BAD_IDENTITY) == G_TLS_CERTIFICATE_BAD_IDENTITY) {
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			_tmp12_ = error_desc;
			_tmp13_ = dino_gettext ("Its security certificate is issued to another domain.");
			_tmp14_ = g_strconcat (" ", _tmp13_, NULL);
			_tmp15_ = _tmp14_;
			_tmp16_ = g_strconcat (_tmp12_, _tmp15_, NULL);
			_g_free0 (error_desc);
			error_desc = _tmp16_;
			_g_free0 (_tmp15_);
		} else {
			if ((error_flags & G_TLS_CERTIFICATE_NOT_ACTIVATED) == G_TLS_CERTIFICATE_NOT_ACTIVATED) {
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				gchar* _tmp21_;
				_tmp17_ = error_desc;
				_tmp18_ = dino_gettext ("Its security certificate will only become valid in the future.");
				_tmp19_ = g_strconcat (" ", _tmp18_, NULL);
				_tmp20_ = _tmp19_;
				_tmp21_ = g_strconcat (_tmp17_, _tmp20_, NULL);
				_g_free0 (error_desc);
				error_desc = _tmp21_;
				_g_free0 (_tmp20_);
			} else {
				if ((error_flags & G_TLS_CERTIFICATE_EXPIRED) == G_TLS_CERTIFICATE_EXPIRED) {
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					gchar* _tmp24_;
					gchar* _tmp25_;
					gchar* _tmp26_;
					_tmp22_ = error_desc;
					_tmp23_ = dino_gettext ("Its security certificate is expired.");
					_tmp24_ = g_strconcat (" ", _tmp23_, NULL);
					_tmp25_ = _tmp24_;
					_tmp26_ = g_strconcat (_tmp22_, _tmp25_, NULL);
					_g_free0 (error_desc);
					error_desc = _tmp26_;
					_g_free0 (_tmp25_);
				}
			}
		}
	}
	_tmp27_ = self->priv->sign_in_tls_label;
	_tmp28_ = error_desc;
	gtk_label_set_label (_tmp27_, _tmp28_);
	_g_free0 (error_desc);
}

static void
_dino_ui_manage_accounts_add_account_dialog_on_server_list_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                                     GtkListBoxRow* row,
                                                                                                     gpointer self)
{
	dino_ui_manage_accounts_add_account_dialog_on_server_list_row_activated ((DinoUiManageAccountsAddAccountDialog*) self, _sender, row);
}

static void
dino_ui_manage_accounts_add_account_dialog_show_select_server (DinoUiManageAccountsAddAccountDialog* self)
{
	const gchar* _tmp0_;
	GtkEntry* _tmp1_;
	GtkEntry* _tmp2_;
	GtkButton* _tmp3_;
	GtkListBox* _tmp4_;
	guint _tmp5_;
	GtkListBox* _tmp6_;
	GtkListBox* _tmp7_;
	g_return_if_fail (self != NULL);
	dino_ui_manage_accounts_add_account_dialog_switch_stack_page (self, DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_SELECT_SERVER);
	_tmp0_ = dino_gettext ("Create account");
	gtk_window_set_title ((GtkWindow*) self, _tmp0_);
	_tmp1_ = self->priv->server_entry;
	gtk_editable_set_text ((GtkEditable*) _tmp1_, "");
	_tmp2_ = self->priv->server_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp2_);
	_tmp3_ = self->priv->select_server_continue;
	gtk_window_set_default_widget ((GtkWindow*) self, (GtkWidget*) _tmp3_);
	_tmp4_ = self->priv->server_list_box;
	g_signal_parse_name ("row-activated", gtk_list_box_get_type (), &_tmp5_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _dino_ui_manage_accounts_add_account_dialog_on_server_list_row_activated_gtk_list_box_row_activated, self);
	_tmp6_ = self->priv->server_list_box;
	gtk_list_box_unselect_all (_tmp6_);
	_tmp7_ = self->priv->server_list_box;
	g_signal_connect_object (_tmp7_, "row-activated", (GCallback) _dino_ui_manage_accounts_add_account_dialog_on_server_list_row_activated_gtk_list_box_row_activated, self, 0);
}

static void
dino_ui_manage_accounts_add_account_dialog_show_register_form (DinoUiManageAccountsAddAccountDialog* self)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	dino_ui_manage_accounts_add_account_dialog_switch_stack_page (self, DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_REGISTER_FORM);
	_tmp0_ = self->priv->register_form_continue;
	gtk_window_set_default_widget ((GtkWindow*) self, (GtkWidget*) _tmp0_);
}

static void
dino_ui_manage_accounts_add_account_dialog_show_success (DinoUiManageAccountsAddAccountDialog* self,
                                                         DinoEntitiesAccount* account)
{
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GtkButton* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	dino_ui_manage_accounts_add_account_dialog_switch_stack_page (self, DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SUCCESS);
	_tmp0_ = self->priv->success_description;
	_tmp1_ = dino_gettext ("You can now use the account %s.");
	_tmp2_ = dino_entities_account_get_bare_jid (account);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_jid_to_string (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_markup_escape_text (_tmp6_, (gssize) -1);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat ("<b>", _tmp8_, NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strconcat (_tmp10_, "</b>", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup_printf (_tmp1_, _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_label_set_label (_tmp0_, _tmp14_);
	_g_free0 (_tmp14_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_xmpp_jid_unref0 (_tmp4_);
	_tmp15_ = self->priv->success_continue_button;
	gtk_window_set_default_widget ((GtkWindow*) self, (GtkWidget*) _tmp15_);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_jid_entry_changed (DinoUiManageAccountsAddAccountDialog* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		XmppJid* _tmp0_ = NULL;
		AdwEntryRow* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		XmppJid* _tmp4_;
		XmppJid* _tmp5_;
		gboolean _tmp6_ = FALSE;
		XmppJid* _tmp7_;
		const gchar* _tmp8_;
		_tmp1_ = self->priv->jid_entry;
		_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = xmpp_jid_new (_tmp3_, &_inner_error0_);
		_tmp0_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_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;
		}
		_tmp5_ = _tmp0_;
		_tmp0_ = NULL;
		_xmpp_jid_unref0 (self->priv->login_jid);
		self->priv->login_jid = _tmp5_;
		_tmp7_ = self->priv->login_jid;
		_tmp8_ = _tmp7_->localpart;
		if (_tmp8_ != NULL) {
			XmppJid* _tmp9_;
			const gchar* _tmp10_;
			_tmp9_ = self->priv->login_jid;
			_tmp10_ = _tmp9_->resourcepart;
			_tmp6_ = _tmp10_ == NULL;
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			GtkButton* _tmp11_;
			_tmp11_ = self->priv->sign_in_continue_button;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp11_, TRUE);
		} else {
			GtkButton* _tmp12_;
			_tmp12_ = self->priv->sign_in_continue_button;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp12_, FALSE);
		}
		_xmpp_jid_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GtkButton* _tmp13_;
		g_clear_error (&_inner_error0_);
		_tmp13_ = self->priv->sign_in_continue_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp13_, FALSE);
	}
	__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
dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_data_free (gpointer _data)
{
	DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData, _data_);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked (DinoUiManageAccountsAddAccountDialog* self,
                                                                               GAsyncReadyCallback _callback_,
                                                                               gpointer _user_data_)
{
	DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData* _data_;
	DinoUiManageAccountsAddAccountDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_co (_data_);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_finish (DinoUiManageAccountsAddAccountDialog* self,
                                                                                      GAsyncResult* _res_)
{
	DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block83Data*
block83_data_ref (Block83Data* _data83_)
{
	g_atomic_int_inc (&_data83_->_ref_count_);
	return _data83_;
}

static void
block83_data_unref (void * _userdata_)
{
	Block83Data* _data83_;
	_data83_ = (Block83Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data83_->_ref_count_)) {
		DinoUiManageAccountsAddAccountDialog* self;
		self = _data83_->self;
		_g_object_unref0 (self);
		g_slice_free (Block83Data, _data83_);
	}
}

static void
___lambda234_ (Block83Data* _data83_)
{
	DinoUiManageAccountsAddAccountDialog* self;
	AdwEntryRow* _tmp0_;
	self = _data83_->self;
	_tmp0_ = self->priv->jid_entry;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _data83_->jid_entry_changed_handler_id);
	dino_ui_manage_accounts_add_account_dialog_show_sign_in (self, TRUE);
	return;
}

static void
____lambda234__gtk_editable_changed (GtkEditable* _sender,
                                     gpointer self)
{
	___lambda234_ (self);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_ready (GObject* source_object,
                                                                                     GAsyncResult* _res_,
                                                                                     gpointer _user_data_)
{
	DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_co (_data_);
}

static gboolean
dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_co (DinoUiManageAccountsAddAccountDialogOnSignInContinueButtonClickedData* _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_->_data83_ = g_slice_new0 (Block83Data);
		_data_->_data83_->_ref_count_ = 1;
		_data_->_data83_->self = g_object_ref (_data_->self);
		_data_->_tmp1_ = _data_->self->priv->jid_entry;
		_data_->_tmp2_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp1_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = xmpp_jid_new (_data_->_tmp3_, &_data_->_inner_error0_);
		_data_->_tmp0_ = _data_->_tmp4_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block83_data_unref (_data_->_data83_);
			_data_->_data83_ = NULL;
			if (_data_->_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			g_critical ("file %s: line %d: unexpected 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_->_tmp5_ = _data_->_tmp0_;
		_data_->_tmp0_ = NULL;
		_xmpp_jid_unref0 (_data_->self->priv->login_jid);
		_data_->self->priv->login_jid = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->self->priv->sign_in_tls_label;
		gtk_label_set_label (_data_->_tmp6_, "");
		_data_->_tmp7_ = _data_->self->priv->sign_in_error_label;
		gtk_widget_set_visible ((GtkWidget*) _data_->_tmp7_, FALSE);
		_data_->_tmp8_ = _data_->self->priv->sign_in_continue_button;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp8_, FALSE);
		_data_->_tmp9_ = _data_->self->priv->sign_in_continue_spinner;
		gtk_widget_set_visible ((GtkWidget*) _data_->_tmp9_, TRUE);
		_data_->_data83_->jid_entry_changed_handler_id = (gulong) -1;
		_data_->_tmp10_ = _data_->self->priv->jid_entry;
		_data_->_tmp11_ = g_signal_connect_data ((GtkEditable*) _data_->_tmp10_, "changed", (GCallback) ____lambda234__gtk_editable_changed, block83_data_ref (_data_->_data83_), (GClosureNotify) block83_data_unref, 0);
		_data_->_data83_->jid_entry_changed_handler_id = _data_->_tmp11_;
		_data_->_tmp12_ = _data_->self->priv->password_group;
		_data_->_tmp13_ = gtk_widget_get_visible ((GtkWidget*) _data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		if (_data_->_tmp14_) {
			_data_->_tmp15_ = _data_->self->priv->password_entry;
			_data_->_tmp16_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp15_);
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
			_data_->password = _data_->_tmp18_;
			_data_->_tmp19_ = _data_->self->priv->login_jid;
			_data_->_tmp20_ = _data_->password;
			_data_->_tmp21_ = dino_entities_account_new (_data_->_tmp19_, _data_->_tmp20_);
			_data_->account = _data_->_tmp21_;
			_data_->_tmp22_ = _data_->self->priv->stream_interactor;
			_data_->_tmp23_ = dino_register_IDENTITY;
			_data_->_tmp24_ = dino_stream_interactor_get_module (_data_->_tmp22_, DINO_TYPE_REGISTER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp23_);
			_data_->_tmp25_ = (DinoRegister*) _data_->_tmp24_;
			_data_->_tmp26_ = _data_->account;
			_data_->_state_ = 1;
			dino_register_add_check_account (_data_->_tmp25_, _data_->_tmp26_, dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp27_ = dino_register_add_check_account_finish (_data_->_tmp25_, _data_->_res_);
			_data_->_tmp28_ = _data_->_tmp27_;
			_g_object_unref0 (_data_->_tmp25_);
			_data_->_error_ = _data_->_tmp28_;
			_data_->_tmp29_ = _data_->self->priv->sign_in_continue_spinner;
			gtk_widget_set_visible ((GtkWidget*) _data_->_tmp29_, FALSE);
			_data_->_tmp30_ = _data_->self->priv->sign_in_continue_button;
			gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp30_, TRUE);
			_data_->_tmp31_ = _data_->_error_;
			if (_data_->_tmp31_ != NULL) {
				_data_->_tmp32_ = _data_->self->priv->sign_in_error_label;
				gtk_widget_set_visible ((GtkWidget*) _data_->_tmp32_, TRUE);
				_data_->_tmp33_ = _data_->_error_;
				switch (*_data_->_tmp33_) {
					case DINO_CONNECTION_MANAGER_CONNECTION_ERROR_SOURCE_SASL:
					{
						_data_->_tmp34_ = _data_->self->priv->sign_in_error_label;
						_data_->_tmp35_ = dino_gettext ("Wrong username or password");
						gtk_label_set_label (_data_->_tmp34_, _data_->_tmp35_);
						break;
					}
					default:
					{
						_data_->_tmp36_ = _data_->self->priv->sign_in_error_label;
						_data_->_tmp37_ = dino_gettext ("Something went wrong");
						gtk_label_set_label (_data_->_tmp36_, _data_->_tmp37_);
						break;
					}
				}
			} else {
				_data_->_tmp38_ = _data_->account;
				dino_ui_manage_accounts_add_account_dialog_add_activate_account (_data_->self, _data_->_tmp38_);
				_data_->_tmp39_ = _data_->account;
				dino_ui_manage_accounts_add_account_dialog_show_success (_data_->self, _data_->_tmp39_);
			}
			_g_free0 (_data_->_error_);
			_g_object_unref0 (_data_->account);
			_g_free0 (_data_->password);
		} else {
			_data_->_tmp40_ = _data_->self->priv->login_jid;
			_data_->_state_ = 2;
			dino_register_check_server_availability (_data_->_tmp40_, dino_ui_manage_accounts_add_account_dialog_on_sign_in_continue_button_clicked_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp41_ = dino_register_check_server_availability_finish (_data_->_res_);
			_data_->server_status = _data_->_tmp41_;
			_data_->_tmp42_ = _data_->self->priv->sign_in_continue_spinner;
			gtk_widget_set_visible ((GtkWidget*) _data_->_tmp42_, FALSE);
			_data_->_tmp43_ = _data_->self->priv->sign_in_continue_button;
			gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp43_, TRUE);
			_data_->_tmp44_ = _data_->server_status;
			_data_->_tmp45_ = dino_register_server_availability_return_get_available (_data_->_tmp44_);
			_data_->_tmp46_ = _data_->_tmp45_;
			if (_data_->_tmp46_) {
				_data_->_tmp47_ = _data_->self->priv->password_group;
				gtk_widget_set_visible ((GtkWidget*) _data_->_tmp47_, TRUE);
				_data_->_tmp48_ = _data_->self->priv->password_entry;
				gtk_widget_grab_focus ((GtkWidget*) _data_->_tmp48_);
				_data_->_tmp49_ = _data_->self->priv->sign_in_serverlist_button;
				gtk_widget_set_visible ((GtkWidget*) _data_->_tmp49_, FALSE);
			} else {
				_data_->_tmp50_ = _data_->server_status;
				_data_->_tmp51_ = dino_register_server_availability_return_get_error_flags (_data_->_tmp50_);
				_data_->_tmp52_ = _data_->_tmp51_;
				if (_data_->_tmp52_ != NULL) {
					_data_->_tmp53_ = _data_->self->priv->login_jid;
					_data_->_tmp54_ = _data_->_tmp53_->domainpart;
					_data_->_tmp55_ = _data_->server_status;
					_data_->_tmp56_ = dino_register_server_availability_return_get_error_flags (_data_->_tmp55_);
					_data_->_tmp57_ = _data_->_tmp56_;
					dino_ui_manage_accounts_add_account_dialog_show_tls_error (_data_->self, _data_->_tmp54_, *_data_->_tmp57_);
				} else {
					_data_->_tmp58_ = _data_->self->priv->sign_in_error_label;
					gtk_widget_set_visible ((GtkWidget*) _data_->_tmp58_, TRUE);
					_data_->_tmp59_ = _data_->self->priv->sign_in_error_label;
					_data_->_tmp60_ = dino_gettext ("Could not connect to %s");
					_data_->_tmp61_ = _data_->self->priv->login_jid;
					_data_->_tmp62_ = _data_->_tmp61_->domainpart;
					_data_->_tmp63_ = g_strdup_printf (_data_->_tmp60_, _data_->_tmp62_);
					_data_->_tmp64_ = _data_->_tmp63_;
					gtk_label_set_label (_data_->_tmp59_, _data_->_tmp64_);
					_g_free0 (_data_->_tmp64_);
				}
			}
			_dino_register_server_availability_return_unref0 (_data_->server_status);
		}
		_xmpp_jid_unref0 (_data_->_tmp0_);
		block83_data_unref (_data_->_data83_);
		_data_->_data83_ = NULL;
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp65_ = _data_->e;
		_data_->_tmp66_ = _data_->_tmp65_->message;
		g_warning ("add_account_dialog.vala:253: Invalid address from interface allowed lo" \
"gin: %s", _data_->_tmp66_);
		_data_->_tmp67_ = _data_->self->priv->sign_in_error_label;
		gtk_widget_set_visible ((GtkWidget*) _data_->_tmp67_, TRUE);
		_data_->_tmp68_ = _data_->self->priv->sign_in_error_label;
		_data_->_tmp69_ = dino_gettext ("Invalid address");
		gtk_label_set_label (_data_->_tmp68_, _data_->_tmp69_);
		_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
dino_ui_manage_accounts_add_account_dialog_on_select_server_continue (DinoUiManageAccountsAddAccountDialog* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		XmppJid* _tmp0_ = NULL;
		GtkEntry* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		XmppJid* _tmp4_;
		XmppJid* _tmp5_;
		XmppJid* _tmp6_;
		_tmp1_ = self->priv->server_entry;
		_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = xmpp_jid_new (_tmp3_, &_inner_error0_);
		_tmp0_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_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;
		}
		_tmp5_ = _tmp0_;
		_tmp0_ = NULL;
		_xmpp_jid_unref0 (self->priv->server_jid);
		self->priv->server_jid = _tmp5_;
		_tmp6_ = self->priv->server_jid;
		dino_ui_manage_accounts_add_account_dialog_request_show_register_form (self, _tmp6_, NULL, NULL);
		_xmpp_jid_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		g_warning ("add_account_dialog.vala:264: Invalid address from interface allowed se" \
"rver: %s", _tmp8_);
		_tmp9_ = dino_gettext ("Invalid address");
		dino_ui_manage_accounts_add_account_dialog_display_notification (self, _tmp9_);
		_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
dino_ui_manage_accounts_add_account_dialog_on_server_list_row_activated (DinoUiManageAccountsAddAccountDialog* self,
                                                                         GtkListBox* box,
                                                                         GtkListBoxRow* row)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (box != NULL);
	g_return_if_fail (row != NULL);
	{
		XmppJid* _tmp0_ = NULL;
		GeeHashMap* _tmp1_;
		gpointer _tmp2_;
		gchar* _tmp3_;
		XmppJid* _tmp4_;
		XmppJid* _tmp5_;
		XmppJid* _tmp6_;
		XmppJid* _tmp7_;
		_tmp1_ = self->priv->list_box_jids;
		_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, row);
		_tmp3_ = (gchar*) _tmp2_;
		_tmp4_ = xmpp_jid_new (_tmp3_, &_inner_error0_);
		_tmp5_ = _tmp4_;
		_g_free0 (_tmp3_);
		_tmp0_ = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_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;
		}
		_tmp6_ = _tmp0_;
		_tmp0_ = NULL;
		_xmpp_jid_unref0 (self->priv->server_jid);
		self->priv->server_jid = _tmp6_;
		_tmp7_ = self->priv->server_jid;
		dino_ui_manage_accounts_add_account_dialog_request_show_register_form (self, _tmp7_, NULL, NULL);
		_xmpp_jid_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		g_warning ("add_account_dialog.vala:274: Invalid address from selected server: %s", _tmp9_);
		_tmp10_ = dino_gettext ("Invalid address");
		dino_ui_manage_accounts_add_account_dialog_display_notification (self, _tmp10_);
		_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
dino_ui_manage_accounts_add_account_dialog_request_show_register_form_data_free (gpointer _data)
{
	DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData* _data_;
	_data_ = _data;
	_xmpp_jid_unref0 (_data_->server_jid);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData, _data_);
}

static gpointer
_xmpp_jid_ref0 (gpointer self)
{
	return self ? xmpp_jid_ref (self) : NULL;
}

static void
dino_ui_manage_accounts_add_account_dialog_request_show_register_form (DinoUiManageAccountsAddAccountDialog* self,
                                                                       XmppJid* server_jid,
                                                                       GAsyncReadyCallback _callback_,
                                                                       gpointer _user_data_)
{
	DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData* _data_;
	DinoUiManageAccountsAddAccountDialog* _tmp0_;
	XmppJid* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (server_jid != NULL);
	_data_ = g_slice_new0 (DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_ui_manage_accounts_add_account_dialog_request_show_register_form_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (server_jid);
	_xmpp_jid_unref0 (_data_->server_jid);
	_data_->server_jid = _tmp1_;
	dino_ui_manage_accounts_add_account_dialog_request_show_register_form_co (_data_);
}

static void
dino_ui_manage_accounts_add_account_dialog_request_show_register_form_finish (DinoUiManageAccountsAddAccountDialog* self,
                                                                              GAsyncResult* _res_)
{
	DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_ui_manage_accounts_add_account_dialog_request_show_register_form_ready (GObject* source_object,
                                                                             GAsyncResult* _res_,
                                                                             gpointer _user_data_)
{
	DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_ui_manage_accounts_add_account_dialog_request_show_register_form_co (_data_);
}

static gpointer
_xmpp_xep_data_forms_data_form_ref0 (gpointer self)
{
	return self ? xmpp_xep_data_forms_data_form_ref (self) : NULL;
}

static gboolean
dino_ui_manage_accounts_add_account_dialog_request_show_register_form_co (DinoUiManageAccountsAddAccountDialogRequestShowRegisterFormData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->select_server_continue_spinner;
	gtk_widget_set_visible ((GtkWidget*) _data_->_tmp0_, TRUE);
	_data_->_state_ = 1;
	dino_register_get_registration_form (_data_->server_jid, dino_ui_manage_accounts_add_account_dialog_request_show_register_form_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = dino_register_get_registration_form_finish (_data_->_res_);
	_data_->form_return = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->select_server_continue_spinner;
	if (_data_->_tmp2_ == NULL) {
		_dino_register_registration_form_return_unref0 (_data_->form_return);
		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_->_tmp3_ = _data_->self->priv->select_server_continue_spinner;
	gtk_widget_set_visible ((GtkWidget*) _data_->_tmp3_, FALSE);
	_data_->_tmp4_ = _data_->form_return;
	_data_->_tmp5_ = dino_register_registration_form_return_get_form (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->form_return;
		_data_->_tmp8_ = dino_register_registration_form_return_get_form (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = _xmpp_xep_data_forms_data_form_ref0 (_data_->_tmp9_);
		_xmpp_xep_data_forms_data_form_unref0 (_data_->self->priv->form);
		_data_->self->priv->form = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->self->priv->form;
		dino_ui_manage_accounts_add_account_dialog_set_register_form (_data_->self, _data_->server_jid, _data_->_tmp11_);
		dino_ui_manage_accounts_add_account_dialog_show_register_form (_data_->self);
	} else {
		_data_->_tmp12_ = _data_->form_return;
		_data_->_tmp13_ = dino_register_registration_form_return_get_error_flags (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		if (_data_->_tmp14_ != NULL) {
			_data_->_tmp15_ = _data_->server_jid->domainpart;
			_data_->_tmp16_ = _data_->form_return;
			_data_->_tmp17_ = dino_register_registration_form_return_get_error_flags (_data_->_tmp16_);
			_data_->_tmp18_ = _data_->_tmp17_;
			dino_ui_manage_accounts_add_account_dialog_show_tls_error (_data_->self, _data_->_tmp15_, *_data_->_tmp18_);
		} else {
			_data_->_tmp19_ = dino_gettext ("No response from server");
			dino_ui_manage_accounts_add_account_dialog_display_notification (_data_->self, _data_->_tmp19_);
		}
	}
	_dino_register_registration_form_return_unref0 (_data_->form_return);
	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 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
dino_ui_manage_accounts_add_account_dialog_set_register_form (DinoUiManageAccountsAddAccountDialog* self,
                                                              XmppJid* server,
                                                              XmppXepInBandRegistrationForm* form)
{
	GtkWidget* widget = NULL;
	GtkBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (server != NULL);
	g_return_if_fail (form != NULL);
	_tmp0_ = self->priv->form_box;
	_tmp1_ = gtk_widget_get_first_child ((GtkWidget*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	widget = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		GtkBox* _tmp4_;
		GtkWidget* _tmp5_;
		GtkBox* _tmp6_;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		_tmp3_ = widget;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = self->priv->form_box;
		_tmp5_ = widget;
		gtk_box_remove (_tmp4_, _tmp5_);
		_tmp6_ = self->priv->form_box;
		_tmp7_ = gtk_widget_get_first_child ((GtkWidget*) _tmp6_);
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (widget);
		widget = _tmp8_;
	}
	_tmp9_ = dino_gettext ("Register on %s");
	_tmp10_ = xmpp_jid_to_string (server);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strdup_printf (_tmp9_, _tmp11_);
	_tmp13_ = _tmp12_;
	gtk_window_set_title ((GtkWindow*) self, _tmp13_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	_tmp14_ = form->oob;
	if (_tmp14_ != NULL) {
		GtkBox* _tmp15_;
		const gchar* _tmp16_;
		GtkLabel* _tmp17_;
		GtkLabel* _tmp18_;
		GtkBox* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
		GtkLabel* _tmp26_ = NULL;
		GtkLabel* _tmp27_;
		GtkLabel* _tmp28_;
		const gchar* _tmp29_;
		GtkButton* _tmp30_;
		GtkButton* _tmp31_;
		_tmp15_ = self->priv->form_box;
		_tmp16_ = dino_gettext ("The server requires to sign up through a website");
		_tmp17_ = (GtkLabel*) gtk_label_new (_tmp16_);
		g_object_ref_sink (_tmp17_);
		_tmp18_ = _tmp17_;
		gtk_box_append (_tmp15_, (GtkWidget*) _tmp18_);
		_g_object_unref0 (_tmp18_);
		_tmp19_ = self->priv->form_box;
		_tmp20_ = form->oob;
		_tmp21_ = string_to_string (_tmp20_);
		_tmp22_ = form->oob;
		_tmp23_ = string_to_string (_tmp22_);
		_tmp24_ = g_strconcat ("<a href=\"", _tmp21_, "\">", _tmp23_, "</a>", NULL);
		_tmp25_ = _tmp24_;
		_tmp26_ = (GtkLabel*) gtk_label_new (_tmp25_);
		gtk_label_set_use_markup (_tmp26_, TRUE);
		g_object_ref_sink (_tmp26_);
		_tmp27_ = _tmp26_;
		gtk_box_append (_tmp19_, (GtkWidget*) _tmp27_);
		_g_object_unref0 (_tmp27_);
		_g_free0 (_tmp25_);
		_tmp28_ = self->priv->register_form_continue_label;
		_tmp29_ = dino_gettext ("Open website");
		gtk_label_set_label (_tmp28_, _tmp29_);
		_tmp30_ = self->priv->register_form_continue;
		gtk_widget_set_visible ((GtkWidget*) _tmp30_, TRUE);
		_tmp31_ = self->priv->register_form_continue;
		gtk_widget_grab_focus ((GtkWidget*) _tmp31_);
	} else {
		GeeList* _tmp32_;
		gint _tmp33_;
		gint _tmp34_;
		_tmp32_ = ((XmppXepDataFormsDataForm*) form)->fields;
		_tmp33_ = gee_collection_get_size ((GeeCollection*) _tmp32_);
		_tmp34_ = _tmp33_;
		if (_tmp34_ > 0) {
			gboolean _tmp35_ = FALSE;
			const gchar* _tmp36_;
			AdwPreferencesGroup* form_preference_group = NULL;
			GListStore* _tmp48_;
			GListStore* _tmp49_;
			AdwPreferencesGroup* _tmp50_;
			AdwPreferencesGroup* _tmp51_;
			GtkBox* _tmp52_;
			AdwPreferencesGroup* _tmp53_;
			GtkButton* _tmp54_;
			GtkLabel* _tmp55_;
			const gchar* _tmp56_;
			_tmp36_ = ((XmppXepDataFormsDataForm*) form)->instructions;
			if (_tmp36_ != NULL) {
				const gchar* _tmp37_;
				_tmp37_ = ((XmppXepDataFormsDataForm*) form)->instructions;
				_tmp35_ = g_strcmp0 (_tmp37_, "") != 0;
			} else {
				_tmp35_ = FALSE;
			}
			if (_tmp35_) {
				gchar* markup_instructions = NULL;
				const gchar* _tmp38_;
				gchar* _tmp39_;
				gchar* _tmp40_;
				gchar* _tmp41_;
				gchar* _tmp42_;
				gchar* _tmp43_;
				GtkBox* _tmp44_;
				const gchar* _tmp45_;
				GtkLabel* _tmp46_ = NULL;
				GtkLabel* _tmp47_;
				_tmp38_ = ((XmppXepDataFormsDataForm*) form)->instructions;
				_tmp39_ = g_strdup (_tmp38_);
				_tmp40_ = dino_ui_util_unbreak_space_around_non_spacing_mark (_tmp39_);
				_tmp41_ = _tmp40_;
				_tmp42_ = dino_ui_util_parse_add_markup (_tmp41_, NULL, TRUE, FALSE);
				_tmp43_ = _tmp42_;
				_g_free0 (_tmp41_);
				markup_instructions = _tmp43_;
				_tmp44_ = self->priv->form_box;
				_tmp45_ = markup_instructions;
				_tmp46_ = (GtkLabel*) gtk_label_new (_tmp45_);
				gtk_label_set_use_markup (_tmp46_, TRUE);
				gtk_label_set_xalign (_tmp46_, (gfloat) 0);
				gtk_widget_set_margin_top ((GtkWidget*) _tmp46_, 7);
				gtk_label_set_wrap (_tmp46_, TRUE);
				gtk_label_set_wrap_mode (_tmp46_, PANGO_WRAP_WORD_CHAR);
				g_object_ref_sink (_tmp46_);
				_tmp47_ = _tmp46_;
				gtk_box_append (_tmp44_, (GtkWidget*) _tmp47_);
				_g_object_unref0 (_tmp47_);
				_g_free0 (markup_instructions);
			}
			_tmp48_ = dino_ui_util_get_data_form_view_model ((XmppXepDataFormsDataForm*) form);
			_tmp49_ = _tmp48_;
			_tmp50_ = dino_ui_util_rows_to_preference_group (_tmp49_, "");
			_tmp51_ = _tmp50_;
			_g_object_unref0 (_tmp49_);
			form_preference_group = _tmp51_;
			_tmp52_ = self->priv->form_box;
			_tmp53_ = form_preference_group;
			gtk_box_append (_tmp52_, (GtkWidget*) _tmp53_);
			_tmp54_ = self->priv->register_form_continue;
			gtk_widget_set_visible ((GtkWidget*) _tmp54_, TRUE);
			_tmp55_ = self->priv->register_form_continue_label;
			_tmp56_ = dino_gettext ("Register");
			gtk_label_set_label (_tmp55_, _tmp56_);
			_g_object_unref0 (form_preference_group);
		} else {
			GtkBox* _tmp57_;
			const gchar* _tmp58_;
			gchar* _tmp59_;
			gchar* _tmp60_;
			gchar* _tmp61_;
			gchar* _tmp62_;
			gchar* _tmp63_;
			gchar* _tmp64_;
			gchar* _tmp65_;
			gchar* _tmp66_;
			GtkLabel* _tmp67_ = NULL;
			GtkLabel* _tmp68_;
			GtkButton* _tmp69_;
			_tmp57_ = self->priv->form_box;
			_tmp58_ = dino_gettext ("Check %s for information on how to sign up");
			_tmp59_ = xmpp_jid_to_string (server);
			_tmp60_ = _tmp59_;
			_tmp61_ = xmpp_jid_to_string (server);
			_tmp62_ = _tmp61_;
			_tmp63_ = g_strconcat ("<a href=\"http://", _tmp60_, "\">", _tmp62_, "</a>", NULL);
			_tmp64_ = _tmp63_;
			_tmp65_ = g_strdup_printf (_tmp58_, _tmp64_);
			_tmp66_ = _tmp65_;
			_tmp67_ = (GtkLabel*) gtk_label_new (_tmp66_);
			gtk_label_set_use_markup (_tmp67_, TRUE);
			g_object_ref_sink (_tmp67_);
			_tmp68_ = _tmp67_;
			gtk_box_append (_tmp57_, (GtkWidget*) _tmp68_);
			_g_object_unref0 (_tmp68_);
			_g_free0 (_tmp66_);
			_g_free0 (_tmp64_);
			_g_free0 (_tmp62_);
			_g_free0 (_tmp60_);
			_tmp69_ = self->priv->register_form_continue;
			gtk_widget_set_visible ((GtkWidget*) _tmp69_, FALSE);
		}
	}
	_g_object_unref0 (widget);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_data_free (gpointer _data)
{
	DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData, _data_);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked (DinoUiManageAccountsAddAccountDialog* self,
                                                                              GAsyncReadyCallback _callback_,
                                                                              gpointer _user_data_)
{
	DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData* _data_;
	DinoUiManageAccountsAddAccountDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_co (_data_);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_finish (DinoUiManageAccountsAddAccountDialog* self,
                                                                                     GAsyncResult* _res_)
{
	DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_ready (GObject* source_object,
                                                                                    GAsyncResult* _res_,
                                                                                    gpointer _user_data_)
{
	DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_co (_data_);
}

static gboolean
dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_co (DinoUiManageAccountsAddAccountDialogOnRegisterFormContinueClickedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->notification_revealer;
	gtk_revealer_set_reveal_child (_data_->_tmp0_, FALSE);
	_data_->_tmp1_ = _data_->self->priv->form;
	_data_->_tmp2_ = _data_->_tmp1_->oob;
	if (_data_->_tmp2_ != NULL) {
		{
			_data_->_tmp3_ = _data_->self->priv->form;
			_data_->_tmp4_ = _data_->_tmp3_->oob;
			g_app_info_launch_default_for_uri (_data_->_tmp4_, NULL, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_data_->_inner_error0_);
		}
		__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;
		}
		dino_ui_manage_accounts_add_account_dialog_show_sign_in (_data_->self, 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_->_tmp5_ = _data_->self->priv->register_form_continue_spinner;
	gtk_widget_set_visible ((GtkWidget*) _data_->_tmp5_, TRUE);
	_data_->_tmp6_ = _data_->self->priv->server_jid;
	_data_->_tmp7_ = _data_->self->priv->form;
	_data_->_state_ = 1;
	dino_register_submit_form (_data_->_tmp6_, _data_->_tmp7_, dino_ui_manage_accounts_add_account_dialog_on_register_form_continue_clicked_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dino_register_submit_form_finish (_data_->_res_);
	_data_->_error_ = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->self->priv->register_form_continue_spinner;
	if (_data_->_tmp9_ == NULL) {
		_g_free0 (_data_->_error_);
		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_->_tmp10_ = _data_->self->priv->register_form_continue_spinner;
	gtk_widget_set_visible ((GtkWidget*) _data_->_tmp10_, FALSE);
	_data_->_tmp11_ = _data_->_error_;
	if (_data_->_tmp11_ == NULL) {
		_data_->username = NULL;
		_data_->password = NULL;
		{
			_data_->_tmp12_ = _data_->self->priv->form;
			_data_->_tmp13_ = ((XmppXepDataFormsDataForm*) _data_->_tmp12_)->fields;
			_data_->_field_list = _data_->_tmp13_;
			_data_->_tmp14_ = _data_->_field_list;
			_data_->_tmp15_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp14_);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_field_size = _data_->_tmp16_;
			_data_->_field_index = -1;
			while (TRUE) {
				static GQuark _tmp25_label0 = 0;
				static GQuark _tmp25_label1 = 0;
				_data_->_field_index = _data_->_field_index + 1;
				_data_->_tmp17_ = _data_->_field_index;
				_data_->_tmp18_ = _data_->_field_size;
				if (!(_data_->_tmp17_ < _data_->_tmp18_)) {
					break;
				}
				_data_->_tmp19_ = _data_->_field_list;
				_data_->_tmp20_ = gee_list_get (_data_->_tmp19_, _data_->_field_index);
				_data_->field = (XmppXepDataFormsDataFormField*) _data_->_tmp20_;
				_data_->_tmp21_ = _data_->field;
				_data_->_tmp22_ = xmpp_xep_data_forms_data_form_field_get_var (_data_->_tmp21_);
				_data_->_tmp23_ = _data_->_tmp22_;
				_data_->_tmp26_ = 0U;
				_data_->_tmp24_ = _data_->_tmp23_;
				_data_->_tmp26_ = (NULL == _data_->_tmp24_) ? 0 : g_quark_from_string (_data_->_tmp24_);
				if (_data_->_tmp26_ == ((0 != _tmp25_label0) ? _tmp25_label0 : (_tmp25_label0 = g_quark_from_static_string ("username")))) {
					switch (0) {
						default:
						{
							_data_->_tmp27_ = _data_->field;
							_data_->_tmp28_ = xmpp_xep_data_forms_data_form_field_get_value_string (_data_->_tmp27_);
							_g_free0 (_data_->username);
							_data_->username = _data_->_tmp28_;
							break;
						}
					}
				} else if (_data_->_tmp26_ == ((0 != _tmp25_label1) ? _tmp25_label1 : (_tmp25_label1 = g_quark_from_static_string ("password")))) {
					switch (0) {
						default:
						{
							_data_->_tmp29_ = _data_->field;
							_data_->_tmp30_ = xmpp_xep_data_forms_data_form_field_get_value_string (_data_->_tmp29_);
							_g_free0 (_data_->password);
							_data_->password = _data_->_tmp30_;
							break;
						}
					}
				}
				_g_object_unref0 (_data_->field);
			}
		}
		{
			_data_->_tmp32_ = _data_->username;
			_data_->_tmp33_ = _data_->self->priv->server_jid;
			_data_->_tmp34_ = _data_->_tmp33_->domainpart;
			_data_->_tmp35_ = xmpp_jid_new_components (_data_->_tmp32_, _data_->_tmp34_, NULL, &_data_->_inner_error0_);
			_data_->_tmp31_ = _data_->_tmp35_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch1_xmpp_invalid_jid_error;
				}
				_g_free0 (_data_->password);
				_g_free0 (_data_->username);
				_g_free0 (_data_->_error_);
				g_critical ("file %s: line %d: unexpected 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_->_tmp36_ = _data_->password;
			_data_->_tmp37_ = dino_entities_account_new (_data_->_tmp31_, _data_->_tmp36_);
			_data_->account = _data_->_tmp37_;
			_data_->_tmp38_ = _data_->account;
			dino_ui_manage_accounts_add_account_dialog_add_activate_account (_data_->self, _data_->_tmp38_);
			_data_->_tmp39_ = _data_->account;
			dino_ui_manage_accounts_add_account_dialog_show_success (_data_->self, _data_->_tmp39_);
			_g_object_unref0 (_data_->account);
			_xmpp_jid_unref0 (_data_->_tmp31_);
		}
		goto __finally1;
		__catch1_xmpp_invalid_jid_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp40_ = _data_->e;
			_data_->_tmp41_ = _data_->_tmp40_->message;
			g_warning ("add_account_dialog.vala:358: Invalid address from components of regist" \
"ration: %s", _data_->_tmp41_);
			_data_->_tmp42_ = dino_gettext ("Invalid address");
			dino_ui_manage_accounts_add_account_dialog_display_notification (_data_->self, _data_->_tmp42_);
			_g_error_free0 (_data_->e);
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->password);
			_g_free0 (_data_->username);
			_g_free0 (_data_->_error_);
			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_free0 (_data_->password);
		_g_free0 (_data_->username);
	} else {
		_data_->_tmp43_ = _data_->_error_;
		dino_ui_manage_accounts_add_account_dialog_display_notification (_data_->self, _data_->_tmp43_);
	}
	_g_free0 (_data_->_error_);
	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
__lambda235_ (DinoUiManageAccountsAddAccountDialog* self)
{
	GtkRevealer* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->notification_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, FALSE);
	result = FALSE;
	return result;
}

static gboolean
___lambda235__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda235_ ((DinoUiManageAccountsAddAccountDialog*) self);
	return result;
}

static void
dino_ui_manage_accounts_add_account_dialog_display_notification (DinoUiManageAccountsAddAccountDialog* self,
                                                                 const gchar* text)
{
	GtkLabel* _tmp0_;
	GtkRevealer* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_tmp0_ = self->priv->notification_label;
	gtk_label_set_label (_tmp0_, text);
	_tmp1_ = self->priv->notification_revealer;
	gtk_revealer_set_reveal_child (_tmp1_, TRUE);
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda235__gsource_func, g_object_ref (self), g_object_unref);
}

static void
dino_ui_manage_accounts_add_account_dialog_add_activate_account (DinoUiManageAccountsAddAccountDialog* self,
                                                                 DinoEntitiesAccount* account)
{
	DinoDatabase* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	dino_entities_account_set_enabled (account, TRUE);
	_tmp0_ = self->priv->db;
	dino_entities_account_persist (account, _tmp0_);
	_tmp1_ = self->priv->stream_interactor;
	dino_stream_interactor_connect_account (_tmp1_, account);
	g_signal_emit (self, dino_ui_manage_accounts_add_account_dialog_signals[DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_ADDED_SIGNAL], 0, account);
}

static void
dino_ui_manage_accounts_add_account_dialog_switch_stack_page (DinoUiManageAccountsAddAccountDialog* self,
                                                              DinoUiManageAccountsAddAccountDialogPage page)
{
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	GtkBox* _tmp4_;
	GtkStack* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GtkButton* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->sign_in_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, page == DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN);
	_tmp1_ = self->priv->sign_in_tls_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, page == DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN_TLS_ERROR);
	_tmp2_ = self->priv->create_account_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, page == DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_SELECT_SERVER);
	_tmp3_ = self->priv->register_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, page == DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_REGISTER_FORM);
	_tmp4_ = self->priv->success_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp4_, page == DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SUCCESS);
	_tmp5_ = self->priv->stack;
	_tmp6_ = dino_ui_manage_accounts_add_account_dialog_get_visible_stack_child_name (self, page);
	_tmp7_ = _tmp6_;
	gtk_stack_set_visible_child_name (_tmp5_, _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = self->priv->back_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp8_, page == DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_REGISTER_FORM);
}

static gchar*
dino_ui_manage_accounts_add_account_dialog_get_visible_stack_child_name (DinoUiManageAccountsAddAccountDialog* self,
                                                                         DinoUiManageAccountsAddAccountDialogPage page)
{
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	switch (page) {
		case DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("login_jid");
			result = _tmp0_;
			return result;
		}
		case DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SIGN_IN_TLS_ERROR:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("tls_error");
			result = _tmp1_;
			return result;
		}
		case DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_SELECT_SERVER:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("server");
			result = _tmp2_;
			return result;
		}
		case DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_CREATE_ACCOUNT_REGISTER_FORM:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("form");
			result = _tmp3_;
			return result;
		}
		case DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_PAGE_SUCCESS:
		{
			gchar* _tmp4_;
			_tmp4_ = g_strdup ("success");
			result = _tmp4_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static void
dino_ui_manage_accounts_add_account_dialog_class_init (DinoUiManageAccountsAddAccountDialogClass * klass,
                                                       gpointer klass_data)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	dino_ui_manage_accounts_add_account_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiManageAccountsAddAccountDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_manage_accounts_add_account_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/im/dino/Dino/preferences_window/add_account_dialog.ui");
	dino_ui_manage_accounts_add_account_dialog_signals[DINO_UI_MANAGE_ACCOUNTS_ADD_ACCOUNT_DIALOG_ADDED_SIGNAL] = g_signal_new ("added", DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_ENTITIES_TYPE_ACCOUNT);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stack", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "notification_revealer", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, notification_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "notification_label", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, notification_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_box", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_error_label", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_error_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "jid_entry", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, jid_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "password_group", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, password_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "password_entry", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, password_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_continue_button", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_continue_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_continue_spinner", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_continue_spinner));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_serverlist_button", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_serverlist_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_tls_box", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_tls_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_tls_label", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_tls_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sign_in_tls_back_button", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, sign_in_tls_back_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "create_account_box", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, create_account_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "login_button", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, login_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "select_server_continue_spinner", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, select_server_continue_spinner));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "select_server_continue", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, select_server_continue));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "register_form_continue_label", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, register_form_continue_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "server_list_box", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, server_list_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "server_entry", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, server_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "back_button", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, back_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "register_box", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, register_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "form_box", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, form_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "register_form_continue_spinner", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, register_form_continue_spinner));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "register_form_continue", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, register_form_continue));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "success_box", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, success_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "success_description", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, success_description));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "success_continue_button", FALSE, DinoUiManageAccountsAddAccountDialog_private_offset + G_STRUCT_OFFSET (DinoUiManageAccountsAddAccountDialogPrivate, success_continue_button));
	_tmp0_ = g_strdup ("5222.de");
	_tmp1_ = g_strdup ("jabber.fr");
	_tmp2_ = g_strdup ("movim.eu");
	_tmp3_ = g_strdup ("yax.im");
	_tmp4_ = g_new0 (gchar*, 4 + 1);
	_tmp4_[0] = _tmp0_;
	_tmp4_[1] = _tmp1_;
	_tmp4_[2] = _tmp2_;
	_tmp4_[3] = _tmp3_;
	dino_ui_manage_accounts_add_account_dialog_server_list = _tmp4_;
	dino_ui_manage_accounts_add_account_dialog_server_list_length1 = 4;
	_dino_ui_manage_accounts_add_account_dialog_server_list_size_ = dino_ui_manage_accounts_add_account_dialog_server_list_length1;
}

static void
dino_ui_manage_accounts_add_account_dialog_instance_init (DinoUiManageAccountsAddAccountDialog * self,
                                                          gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = dino_ui_manage_accounts_add_account_dialog_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (gtk_list_box_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->list_box_jids = _tmp0_;
	self->priv->server_jid = NULL;
	self->priv->login_jid = NULL;
	self->priv->form = NULL;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
dino_ui_manage_accounts_add_account_dialog_finalize (GObject * obj)
{
	DinoUiManageAccountsAddAccountDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_MANAGE_ACCOUNTS_TYPE_ADD_ACCOUNT_DIALOG, DinoUiManageAccountsAddAccountDialog);
	_g_object_unref0 (self->priv->stream_interactor);
	_qlite_database_unref0 (self->priv->db);
	_g_object_unref0 (self->priv->list_box_jids);
	_xmpp_jid_unref0 (self->priv->server_jid);
	_xmpp_jid_unref0 (self->priv->login_jid);
	_xmpp_xep_data_forms_data_form_unref0 (self->priv->form);
	G_OBJECT_CLASS (dino_ui_manage_accounts_add_account_dialog_parent_class)->finalize (obj);
}

static GType
dino_ui_manage_accounts_add_account_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiManageAccountsAddAccountDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_manage_accounts_add_account_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiManageAccountsAddAccountDialog), 0, (GInstanceInitFunc) dino_ui_manage_accounts_add_account_dialog_instance_init, NULL };
	GType dino_ui_manage_accounts_add_account_dialog_type_id;
	dino_ui_manage_accounts_add_account_dialog_type_id = g_type_register_static (adw_window_get_type (), "DinoUiManageAccountsAddAccountDialog", &g_define_type_info, 0);
	DinoUiManageAccountsAddAccountDialog_private_offset = g_type_add_instance_private (dino_ui_manage_accounts_add_account_dialog_type_id, sizeof (DinoUiManageAccountsAddAccountDialogPrivate));
	return dino_ui_manage_accounts_add_account_dialog_type_id;
}

GType
dino_ui_manage_accounts_add_account_dialog_get_type (void)
{
	static volatile gsize dino_ui_manage_accounts_add_account_dialog_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_manage_accounts_add_account_dialog_type_id__once)) {
		GType dino_ui_manage_accounts_add_account_dialog_type_id;
		dino_ui_manage_accounts_add_account_dialog_type_id = dino_ui_manage_accounts_add_account_dialog_get_type_once ();
		g_once_init_leave (&dino_ui_manage_accounts_add_account_dialog_type_id__once, dino_ui_manage_accounts_add_account_dialog_type_id);
	}
	return dino_ui_manage_accounts_add_account_dialog_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

