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

/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2014-2023 elementary, Inc. (https://elementary.io)
 */

#include "useraccounts.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <act/act.h>
#include "run-passwd.h"
#include <stdlib.h>
#include <string.h>
#include <polkit/polkit.h>
#include <gio/gio.h>
#include <granite-7.h>
#include <glib/gi18n-lib.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

#define SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER (switchboard_plug_user_accounts_error_revealer_get_type ())
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealer))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealerClass))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_IS_ERROR_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_IS_ERROR_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealerClass))

typedef struct _SwitchboardPlugUserAccountsErrorRevealer SwitchboardPlugUserAccountsErrorRevealer;
typedef struct _SwitchboardPlugUserAccountsErrorRevealerClass SwitchboardPlugUserAccountsErrorRevealerClass;
enum  {
	SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_0_PROPERTY,
	SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_USER_PROPERTY,
	SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_NUM_PROPERTIES
};
static GParamSpec* switchboard_plug_user_accounts_change_password_dialog_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block1Data Block1Data;
enum  {
	SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_REQUEST_PASSWORD_CHANGE_SIGNAL,
	SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_NUM_SIGNALS
};
static guint switchboard_plug_user_accounts_change_password_dialog_signals[SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_NUM_SIGNALS] = {0};

struct _SwitchboardPlugUserAccountsChangePasswordDialogPrivate {
	gboolean _is_authenticated;
	SwitchboardPlugUserAccountsErrorRevealer* current_pw_error;
	GtkEntry* current_pw_entry;
	ActUser* _user;
};

struct _Block1Data {
	int _ref_count_;
	SwitchboardPlugUserAccountsChangePasswordDialog* self;
	SwitchboardPlugUserAccountsWidgetsPasswordEditor* pw_editor;
	GtkWidget* button_change;
};

static gint SwitchboardPlugUserAccountsChangePasswordDialog_private_offset;
static gpointer switchboard_plug_user_accounts_change_password_dialog_parent_class = NULL;

VALA_EXTERN GType switchboard_plug_user_accounts_error_revealer_get_type (void) G_GNUC_CONST ;
static void switchboard_plug_user_accounts_change_password_dialog_password_auth (SwitchboardPlugUserAccountsChangePasswordDialog* self);
static void __lambda16_ (SwitchboardPlugUserAccountsChangePasswordDialog* self,
                   PasswdHandler* h,
                  GError* e);
VALA_EXTERN void switchboard_plug_user_accounts_error_revealer_set_reveal_child (SwitchboardPlugUserAccountsErrorRevealer* self,
                                                                     gboolean value);
static void switchboard_plug_user_accounts_change_password_dialog_set_is_authenticated (SwitchboardPlugUserAccountsChangePasswordDialog* self,
                                                                                 gboolean value);
static void ___lambda16__passwd_passwd_callback ( PasswdHandler* handler,
                                          GError* e,
                                          gpointer self);
static gboolean switchboard_plug_user_accounts_change_password_dialog_get_is_authenticated (SwitchboardPlugUserAccountsChangePasswordDialog* self);
static void g_cclosure_user_marshal_VOID__ENUM_STRING (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data);
static GObject * switchboard_plug_user_accounts_change_password_dialog_constructor (GType type,
                                                                             guint n_construct_properties,
                                                                             GObjectConstructParam * construct_properties);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
VALA_EXTERN SwitchboardPlugUserAccountsErrorRevealer* switchboard_plug_user_accounts_error_revealer_new (const gchar* label);
VALA_EXTERN SwitchboardPlugUserAccountsErrorRevealer* switchboard_plug_user_accounts_error_revealer_construct (GType object_type,
                                                                                                   const gchar* label);
VALA_EXTERN GtkLabel* switchboard_plug_user_accounts_error_revealer_get_label_widget (SwitchboardPlugUserAccountsErrorRevealer* self);
static void _switchboard_plug_user_accounts_change_password_dialog____lambda17_ (SwitchboardPlugUserAccountsChangePasswordDialog* self);
static void __switchboard_plug_user_accounts_change_password_dialog____lambda17__gtk_editable_changed (GtkEditable* _sender,
                                                                                                gpointer self);
static void _switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_entry_activate (GtkEntry* _sender,
                                                                                              gpointer self);
static void _switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_entry_icon_release (GtkEntry* _sender,
                                                                                                  GtkEntryIconPosition icon_pos,
                                                                                                  gpointer self);
static void _switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                                                                            gpointer self);
static void _switchboard_plug_user_accounts_change_password_dialog___lambda20_ (Block1Data* _data1_);
static void __switchboard_plug_user_accounts_change_password_dialog___lambda20__switchboard_plug_user_accounts_widgets_password_editor_validation_changed (SwitchboardPlugUserAccountsWidgetsPasswordEditor* _sender,
                                                                                                                                                    gpointer self);
static void _switchboard_plug_user_accounts_change_password_dialog___lambda21_ (Block1Data* _data1_,
                                                                         gint response_id);
static void __switchboard_plug_user_accounts_change_password_dialog___lambda21__gtk_dialog_response (GtkDialog* _sender,
                                                                                              gint response_id,
                                                                                              gpointer self);
static void switchboard_plug_user_accounts_change_password_dialog_finalize (GObject * obj);
static GType switchboard_plug_user_accounts_change_password_dialog_get_type_once (void);
static void _vala_switchboard_plug_user_accounts_change_password_dialog_get_property (GObject * object,
                                                                               guint property_id,
                                                                               GValue * value,
                                                                               GParamSpec * pspec);
static void _vala_switchboard_plug_user_accounts_change_password_dialog_set_property (GObject * object,
                                                                               guint property_id,
                                                                               const GValue * value,
                                                                               GParamSpec * pspec);

static inline gpointer
switchboard_plug_user_accounts_change_password_dialog_get_instance_private (SwitchboardPlugUserAccountsChangePasswordDialog* self)
{
	return G_STRUCT_MEMBER_P (self, SwitchboardPlugUserAccountsChangePasswordDialog_private_offset);
}

SwitchboardPlugUserAccountsChangePasswordDialog*
switchboard_plug_user_accounts_change_password_dialog_construct (GType object_type,
                                                                 GtkWindow* parent,
                                                                 ActUser* user)
{
	SwitchboardPlugUserAccountsChangePasswordDialog * self = NULL;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (user != NULL, NULL);
	self = (SwitchboardPlugUserAccountsChangePasswordDialog*) g_object_new (object_type, "transient-for", parent, "user", user, NULL);
	return self;
}

SwitchboardPlugUserAccountsChangePasswordDialog*
switchboard_plug_user_accounts_change_password_dialog_new (GtkWindow* parent,
                                                           ActUser* user)
{
	return switchboard_plug_user_accounts_change_password_dialog_construct (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_CHANGE_PASSWORD_DIALOG, parent, user);
}

static void
__lambda16_ (SwitchboardPlugUserAccountsChangePasswordDialog* self,
              PasswdHandler* h,
             GError* e)
{
	GtkEntry* _tmp7_;
	g_return_if_fail (h != NULL);
	if (e != NULL) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		SwitchboardPlugUserAccountsErrorRevealer* _tmp3_;
		GtkEntry* _tmp4_;
		_tmp0_ = e->message;
		_tmp1_ = g_strdup_printf ("Authentication error: %s", _tmp0_);
		_tmp2_ = _tmp1_;
		g_debug ("ChangePasswordDialog.vala:109: %s", _tmp2_);
		_g_free0 (_tmp2_);
		_tmp3_ = self->priv->current_pw_error;
		switchboard_plug_user_accounts_error_revealer_set_reveal_child (_tmp3_, TRUE);
		switchboard_plug_user_accounts_change_password_dialog_set_is_authenticated (self, FALSE);
		_tmp4_ = self->priv->current_pw_entry;
		g_object_set (_tmp4_, "secondary-icon-name", "process-error-symbolic", NULL);
	} else {
		GtkEntry* _tmp5_;
		GtkEntry* _tmp6_;
		g_debug ("ChangePasswordDialog.vala:114: User is authenticated for password chan" \
"ge now");
		switchboard_plug_user_accounts_change_password_dialog_set_is_authenticated (self, TRUE);
		_tmp5_ = self->priv->current_pw_entry;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, FALSE);
		_tmp6_ = self->priv->current_pw_entry;
		g_object_set (_tmp6_, "secondary-icon-name", "process-completed-symbolic", NULL);
	}
	_tmp7_ = self->priv->current_pw_entry;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp7_, "spin");
}

static void
___lambda16__passwd_passwd_callback ( PasswdHandler* handler,
                                     GError* e,
                                     gpointer self)
{
	__lambda16_ ((SwitchboardPlugUserAccountsChangePasswordDialog*) self, handler, e);
}

static void
switchboard_plug_user_accounts_change_password_dialog_password_auth (SwitchboardPlugUserAccountsChangePasswordDialog* self)
{
	GtkEntry* _tmp0_;
	GtkEntry* _tmp1_;
	 PasswdHandler* _tmp2_;
	GtkEntry* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current_pw_entry;
	g_object_set (_tmp0_, "secondary-icon-name", "process-working-symbolic", NULL);
	_tmp1_ = self->priv->current_pw_entry;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "spin");
	_tmp2_ = switchboard_plug_user_accounts_get_passwd_handler (TRUE);
	_tmp3_ = self->priv->current_pw_entry;
	_tmp4_ = gtk_editable_get_text ((GtkEditable*) _tmp3_);
	_tmp5_ = _tmp4_;
	passwd_authenticate (_tmp2_, _tmp5_, ___lambda16__passwd_passwd_callback, self);
}

static gboolean
switchboard_plug_user_accounts_change_password_dialog_get_is_authenticated (SwitchboardPlugUserAccountsChangePasswordDialog* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_authenticated;
	return result;
}

static void
switchboard_plug_user_accounts_change_password_dialog_set_is_authenticated (SwitchboardPlugUserAccountsChangePasswordDialog* self,
                                                                            gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_is_authenticated = value;
}

ActUser*
switchboard_plug_user_accounts_change_password_dialog_get_user (SwitchboardPlugUserAccountsChangePasswordDialog* self)
{
	ActUser* result;
	ActUser* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user;
	result = _tmp0_;
	return result;
}

static void
switchboard_plug_user_accounts_change_password_dialog_set_user (SwitchboardPlugUserAccountsChangePasswordDialog* self,
                                                                ActUser* value)
{
	ActUser* old_value;
	g_return_if_fail (self != NULL);
	old_value = switchboard_plug_user_accounts_change_password_dialog_get_user (self);
	if (old_value != value) {
		self->priv->_user = value;
		g_object_notify_by_pspec ((GObject *) self, switchboard_plug_user_accounts_change_password_dialog_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_USER_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__ENUM_STRING (GClosure * closure,
                                           GValue * return_value,
                                           guint n_param_values,
                                           const GValue * param_values,
                                           gpointer invocation_hint,
                                           gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__ENUM_STRING) (gpointer data1, gint arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__ENUM_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__ENUM_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_enum (param_values + 1), g_value_get_string (param_values + 2), data2);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		SwitchboardPlugUserAccountsChangePasswordDialog* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->button_change);
		_g_object_unref0 (_data1_->pw_editor);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
_switchboard_plug_user_accounts_change_password_dialog____lambda17_ (SwitchboardPlugUserAccountsChangePasswordDialog* self)
{
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	SwitchboardPlugUserAccountsErrorRevealer* _tmp7_;
	_tmp0_ = self->priv->current_pw_entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = strlen (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 0) {
		GtkEntry* _tmp5_;
		_tmp5_ = self->priv->current_pw_entry;
		g_object_set (_tmp5_, "secondary-icon-name", "go-jump-symbolic", NULL);
	} else {
		GtkEntry* _tmp6_;
		_tmp6_ = self->priv->current_pw_entry;
		g_object_set (_tmp6_, "secondary-icon-name", NULL, NULL);
	}
	_tmp7_ = self->priv->current_pw_error;
	switchboard_plug_user_accounts_error_revealer_set_reveal_child (_tmp7_, FALSE);
}

static void
__switchboard_plug_user_accounts_change_password_dialog____lambda17__gtk_editable_changed (GtkEditable* _sender,
                                                                                           gpointer self)
{
	_switchboard_plug_user_accounts_change_password_dialog____lambda17_ ((SwitchboardPlugUserAccountsChangePasswordDialog*) self);
}

static void
_switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_entry_activate (GtkEntry* _sender,
                                                                                         gpointer self)
{
	switchboard_plug_user_accounts_change_password_dialog_password_auth ((SwitchboardPlugUserAccountsChangePasswordDialog*) self);
}

static void
_switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_entry_icon_release (GtkEntry* _sender,
                                                                                             GtkEntryIconPosition icon_pos,
                                                                                             gpointer self)
{
	switchboard_plug_user_accounts_change_password_dialog_password_auth ((SwitchboardPlugUserAccountsChangePasswordDialog*) self);
}

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

static void
_switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                                                                       gpointer self)
{
	switchboard_plug_user_accounts_change_password_dialog_password_auth ((SwitchboardPlugUserAccountsChangePasswordDialog*) self);
}

static void
_switchboard_plug_user_accounts_change_password_dialog___lambda20_ (Block1Data* _data1_)
{
	SwitchboardPlugUserAccountsChangePasswordDialog* self;
	PolkitPermission* permission = NULL;
	PolkitPermission* _tmp0_;
	PolkitPermission* _tmp1_;
	self = _data1_->self;
	_tmp0_ = switchboard_plug_user_accounts_get_permission ();
	permission = _tmp0_;
	_tmp1_ = permission;
	if (_tmp1_ != NULL) {
		gboolean _tmp2_ = FALSE;
		SwitchboardPlugUserAccountsWidgetsPasswordEditor* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		gboolean admin_requirements = FALSE;
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
		SwitchboardPlugUserAccountsWidgetsPasswordEditor* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		gboolean standard_requirements = FALSE;
		gboolean _tmp18_ = FALSE;
		_tmp3_ = _data1_->pw_editor;
		_tmp4_ = switchboard_plug_user_accounts_widgets_password_editor_get_is_valid (_tmp3_);
		_tmp5_ = _tmp4_;
		if (_tmp5_) {
			PolkitPermission* _tmp6_;
			gboolean _tmp7_;
			gboolean _tmp8_;
			_tmp6_ = permission;
			_tmp7_ = g_permission_get_allowed ((GPermission*) _tmp6_);
			_tmp8_ = _tmp7_;
			_tmp2_ = _tmp8_;
		} else {
			_tmp2_ = FALSE;
		}
		admin_requirements = _tmp2_;
		_tmp11_ = _data1_->pw_editor;
		_tmp12_ = switchboard_plug_user_accounts_widgets_password_editor_get_is_valid (_tmp11_);
		_tmp13_ = _tmp12_;
		if (_tmp13_) {
			SwitchboardPlugUserAccountsWidgetsPasswordEditor* _tmp14_;
			gboolean _tmp15_;
			gboolean _tmp16_;
			_tmp14_ = _data1_->pw_editor;
			_tmp15_ = switchboard_plug_user_accounts_widgets_password_editor_get_is_obscure (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp10_ = _tmp16_;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			gboolean _tmp17_;
			_tmp17_ = self->priv->_is_authenticated;
			_tmp9_ = _tmp17_;
		} else {
			_tmp9_ = FALSE;
		}
		standard_requirements = _tmp9_;
		if (admin_requirements) {
			_tmp18_ = TRUE;
		} else {
			_tmp18_ = standard_requirements;
		}
		if (_tmp18_) {
			GtkWidget* _tmp19_;
			_tmp19_ = _data1_->button_change;
			gtk_widget_set_sensitive (_tmp19_, TRUE);
		} else {
			GtkWidget* _tmp20_;
			_tmp20_ = _data1_->button_change;
			gtk_widget_set_sensitive (_tmp20_, FALSE);
		}
	}
	_g_object_unref0 (permission);
}

static void
__switchboard_plug_user_accounts_change_password_dialog___lambda20__switchboard_plug_user_accounts_widgets_password_editor_validation_changed (SwitchboardPlugUserAccountsWidgetsPasswordEditor* _sender,
                                                                                                                                               gpointer self)
{
	_switchboard_plug_user_accounts_change_password_dialog___lambda20_ (self);
}

static void
_switchboard_plug_user_accounts_change_password_dialog___lambda21_ (Block1Data* _data1_,
                                                                    gint response_id)
{
	SwitchboardPlugUserAccountsChangePasswordDialog* self;
	self = _data1_->self;
	if (response_id == ((gint) GTK_RESPONSE_OK)) {
		SwitchboardPlugUserAccountsWidgetsPasswordEditor* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp0_ = _data1_->pw_editor;
		_tmp1_ = switchboard_plug_user_accounts_widgets_password_editor_get_password (_tmp0_);
		_tmp2_ = _tmp1_;
		g_signal_emit (self, switchboard_plug_user_accounts_change_password_dialog_signals[SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_REQUEST_PASSWORD_CHANGE_SIGNAL], 0, ACT_USER_PASSWORD_MODE_REGULAR, _tmp2_);
		_g_free0 (_tmp2_);
	}
	gtk_window_destroy ((GtkWindow*) self);
}

static void
__switchboard_plug_user_accounts_change_password_dialog___lambda21__gtk_dialog_response (GtkDialog* _sender,
                                                                                         gint response_id,
                                                                                         gpointer self)
{
	_switchboard_plug_user_accounts_change_password_dialog___lambda21_ (self, response_id);
}

static GObject *
switchboard_plug_user_accounts_change_password_dialog_constructor (GType type,
                                                                   guint n_construct_properties,
                                                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwitchboardPlugUserAccountsChangePasswordDialog * self;
	Block1Data* _data1_;
	GtkBox* form_box = NULL;
	GtkBox* _tmp0_ = NULL;
	PolkitPermission* _tmp1_;
	PolkitPermission* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkEntry* _tmp27_;
	SwitchboardPlugUserAccountsWidgetsPasswordEditor* _tmp28_;
	GtkBox* _tmp29_;
	SwitchboardPlugUserAccountsWidgetsPasswordEditor* _tmp30_;
	GtkBox* _tmp31_;
	GtkBox* _tmp32_;
	GtkWidget* cancel_button = NULL;
	GtkWidget* _tmp33_;
	GtkWidget* _tmp34_;
	GtkWidget* _tmp35_;
	GtkWidget* _tmp36_;
	GtkWidget* _tmp37_;
	GtkWidget* _tmp38_;
	SwitchboardPlugUserAccountsWidgetsPasswordEditor* _tmp39_;
	parent_class = G_OBJECT_CLASS (switchboard_plug_user_accounts_change_password_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_CHANGE_PASSWORD_DIALOG, SwitchboardPlugUserAccountsChangePasswordDialog);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 12);
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	form_box = _tmp0_;
	_tmp1_ = switchboard_plug_user_accounts_get_permission ();
	_tmp2_ = _tmp1_;
	_tmp3_ = g_permission_get_allowed ((GPermission*) _tmp2_);
	_tmp4_ = _tmp3_;
	switchboard_plug_user_accounts_change_password_dialog_set_is_authenticated (self, _tmp4_);
	_g_object_unref0 (_tmp2_);
	_tmp5_ = self->priv->_is_authenticated;
	if (!_tmp5_) {
		GraniteHeaderLabel* current_pw_label = NULL;
		GraniteHeaderLabel* _tmp6_;
		gchar* _tmp7_;
		GtkEntry* _tmp8_ = NULL;
		SwitchboardPlugUserAccountsErrorRevealer* _tmp9_;
		SwitchboardPlugUserAccountsErrorRevealer* _tmp10_;
		GtkLabel* _tmp11_;
		GtkLabel* _tmp12_;
		GtkBox* _tmp13_;
		GraniteHeaderLabel* _tmp14_;
		GtkBox* _tmp15_;
		GtkEntry* _tmp16_;
		GtkBox* _tmp17_;
		SwitchboardPlugUserAccountsErrorRevealer* _tmp18_;
		GtkEntry* _tmp19_;
		GtkEntry* _tmp20_;
		GtkEntry* _tmp21_;
		GtkEventControllerFocus* focus_controller = NULL;
		GtkEventControllerFocus* _tmp22_;
		GtkEntry* _tmp23_;
		GtkEventControllerFocus* _tmp24_;
		GtkEventController* _tmp25_;
		GtkEventControllerFocus* _tmp26_;
		_tmp6_ = granite_header_label_new (_ ("Current Password"));
		g_object_ref_sink (_tmp6_);
		current_pw_label = _tmp6_;
		_tmp7_ = g_strdup (_ ("Press to authenticate"));
		_tmp8_ = (GtkEntry*) gtk_entry_new ();
		gtk_entry_set_input_purpose (_tmp8_, GTK_INPUT_PURPOSE_PASSWORD);
		g_object_set (_tmp8_, "secondary-icon-tooltip-text", _tmp7_, NULL);
		_g_free0 (_tmp7_);
		gtk_entry_set_visibility (_tmp8_, FALSE);
		g_object_ref_sink (_tmp8_);
		_g_object_unref0 (self->priv->current_pw_entry);
		self->priv->current_pw_entry = _tmp8_;
		_tmp9_ = switchboard_plug_user_accounts_error_revealer_new (_ ("Authentication failed"));
		g_object_ref_sink (_tmp9_);
		_g_object_unref0 (self->priv->current_pw_error);
		self->priv->current_pw_error = _tmp9_;
		_tmp10_ = self->priv->current_pw_error;
		_tmp11_ = switchboard_plug_user_accounts_error_revealer_get_label_widget (_tmp10_);
		_tmp12_ = _tmp11_;
		gtk_widget_add_css_class ((GtkWidget*) _tmp12_, GRANITE_STYLE_CLASS_ERROR);
		_tmp13_ = form_box;
		_tmp14_ = current_pw_label;
		gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
		_tmp15_ = form_box;
		_tmp16_ = self->priv->current_pw_entry;
		gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
		_tmp17_ = form_box;
		_tmp18_ = self->priv->current_pw_error;
		gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
		_tmp19_ = self->priv->current_pw_entry;
		g_signal_connect_object ((GtkEditable*) _tmp19_, "changed", (GCallback) __switchboard_plug_user_accounts_change_password_dialog____lambda17__gtk_editable_changed, self, 0);
		_tmp20_ = self->priv->current_pw_entry;
		g_signal_connect_object (_tmp20_, "activate", (GCallback) _switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_entry_activate, self, 0);
		_tmp21_ = self->priv->current_pw_entry;
		g_signal_connect_object (_tmp21_, "icon-release", (GCallback) _switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_entry_icon_release, self, 0);
		_tmp22_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
		focus_controller = _tmp22_;
		_tmp23_ = self->priv->current_pw_entry;
		_tmp24_ = focus_controller;
		_tmp25_ = _g_object_ref0 ((GtkEventController*) _tmp24_);
		gtk_widget_add_controller ((GtkWidget*) _tmp23_, _tmp25_);
		_tmp26_ = focus_controller;
		g_signal_connect_object (_tmp26_, "leave", (GCallback) _switchboard_plug_user_accounts_change_password_dialog_password_auth_gtk_event_controller_focus_leave, self, 0);
		_g_object_unref0 (focus_controller);
		_g_object_unref0 (current_pw_label);
	}
	_tmp27_ = self->priv->current_pw_entry;
	_tmp28_ = switchboard_plug_user_accounts_widgets_password_editor_new (_tmp27_);
	g_object_ref_sink (_tmp28_);
	_data1_->pw_editor = _tmp28_;
	_tmp29_ = form_box;
	_tmp30_ = _data1_->pw_editor;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
	gtk_window_set_modal ((GtkWindow*) self, TRUE);
	g_object_set ((GtkWindow*) self, "default-width", 350, NULL);
	_tmp31_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp32_ = form_box;
	gtk_box_append (_tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = granite_dialog_add_button ((GraniteDialog*) self, _ ("Cancel"), (gint) GTK_RESPONSE_CANCEL);
	_tmp34_ = _g_object_ref0 (_tmp33_);
	cancel_button = _tmp34_;
	_tmp35_ = granite_dialog_add_button ((GraniteDialog*) self, _ ("Change Password"), (gint) GTK_RESPONSE_OK);
	_tmp36_ = _g_object_ref0 (_tmp35_);
	_data1_->button_change = _tmp36_;
	_tmp37_ = _data1_->button_change;
	gtk_widget_set_sensitive (_tmp37_, FALSE);
	_tmp38_ = _data1_->button_change;
	gtk_widget_add_css_class (_tmp38_, GRANITE_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp39_ = _data1_->pw_editor;
	g_signal_connect_data (_tmp39_, "validation-changed", (GCallback) __switchboard_plug_user_accounts_change_password_dialog___lambda20__switchboard_plug_user_accounts_widgets_password_editor_validation_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	g_signal_connect_data ((GtkDialog*) self, "response", (GCallback) __switchboard_plug_user_accounts_change_password_dialog___lambda21__gtk_dialog_response, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_g_object_unref0 (cancel_button);
	_g_object_unref0 (form_box);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return obj;
}

static void
switchboard_plug_user_accounts_change_password_dialog_class_init (SwitchboardPlugUserAccountsChangePasswordDialogClass * klass,
                                                                  gpointer klass_data)
{
	switchboard_plug_user_accounts_change_password_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwitchboardPlugUserAccountsChangePasswordDialog_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_switchboard_plug_user_accounts_change_password_dialog_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_switchboard_plug_user_accounts_change_password_dialog_set_property;
	G_OBJECT_CLASS (klass)->constructor = switchboard_plug_user_accounts_change_password_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = switchboard_plug_user_accounts_change_password_dialog_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_USER_PROPERTY, switchboard_plug_user_accounts_change_password_dialog_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_USER_PROPERTY] = g_param_spec_object ("user", "user", "user", act_user_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	switchboard_plug_user_accounts_change_password_dialog_signals[SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_REQUEST_PASSWORD_CHANGE_SIGNAL] = g_signal_new ("request-password-change", SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_CHANGE_PASSWORD_DIALOG, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__ENUM_STRING, G_TYPE_NONE, 2, act_user_password_mode_get_type (), G_TYPE_STRING);
}

static void
switchboard_plug_user_accounts_change_password_dialog_instance_init (SwitchboardPlugUserAccountsChangePasswordDialog * self,
                                                                     gpointer klass)
{
	self->priv = switchboard_plug_user_accounts_change_password_dialog_get_instance_private (self);
	self->priv->_is_authenticated = FALSE;
}

static void
switchboard_plug_user_accounts_change_password_dialog_finalize (GObject * obj)
{
	SwitchboardPlugUserAccountsChangePasswordDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_CHANGE_PASSWORD_DIALOG, SwitchboardPlugUserAccountsChangePasswordDialog);
	_g_object_unref0 (self->priv->current_pw_error);
	_g_object_unref0 (self->priv->current_pw_entry);
	G_OBJECT_CLASS (switchboard_plug_user_accounts_change_password_dialog_parent_class)->finalize (obj);
}

static GType
switchboard_plug_user_accounts_change_password_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugUserAccountsChangePasswordDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_user_accounts_change_password_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwitchboardPlugUserAccountsChangePasswordDialog), 0, (GInstanceInitFunc) switchboard_plug_user_accounts_change_password_dialog_instance_init, NULL };
	GType switchboard_plug_user_accounts_change_password_dialog_type_id;
	switchboard_plug_user_accounts_change_password_dialog_type_id = g_type_register_static (GRANITE_TYPE_DIALOG, "SwitchboardPlugUserAccountsChangePasswordDialog", &g_define_type_info, 0);
	SwitchboardPlugUserAccountsChangePasswordDialog_private_offset = g_type_add_instance_private (switchboard_plug_user_accounts_change_password_dialog_type_id, sizeof (SwitchboardPlugUserAccountsChangePasswordDialogPrivate));
	return switchboard_plug_user_accounts_change_password_dialog_type_id;
}

GType
switchboard_plug_user_accounts_change_password_dialog_get_type (void)
{
	static volatile gsize switchboard_plug_user_accounts_change_password_dialog_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_user_accounts_change_password_dialog_type_id__once)) {
		GType switchboard_plug_user_accounts_change_password_dialog_type_id;
		switchboard_plug_user_accounts_change_password_dialog_type_id = switchboard_plug_user_accounts_change_password_dialog_get_type_once ();
		g_once_init_leave (&switchboard_plug_user_accounts_change_password_dialog_type_id__once, switchboard_plug_user_accounts_change_password_dialog_type_id);
	}
	return switchboard_plug_user_accounts_change_password_dialog_type_id__once;
}

static void
_vala_switchboard_plug_user_accounts_change_password_dialog_get_property (GObject * object,
                                                                          guint property_id,
                                                                          GValue * value,
                                                                          GParamSpec * pspec)
{
	SwitchboardPlugUserAccountsChangePasswordDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_CHANGE_PASSWORD_DIALOG, SwitchboardPlugUserAccountsChangePasswordDialog);
	switch (property_id) {
		case SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_USER_PROPERTY:
		g_value_set_object (value, switchboard_plug_user_accounts_change_password_dialog_get_user (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_switchboard_plug_user_accounts_change_password_dialog_set_property (GObject * object,
                                                                          guint property_id,
                                                                          const GValue * value,
                                                                          GParamSpec * pspec)
{
	SwitchboardPlugUserAccountsChangePasswordDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_CHANGE_PASSWORD_DIALOG, SwitchboardPlugUserAccountsChangePasswordDialog);
	switch (property_id) {
		case SWITCHBOARD_PLUG_USER_ACCOUNTS_CHANGE_PASSWORD_DIALOG_USER_PROPERTY:
		switchboard_plug_user_accounts_change_password_dialog_set_user (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

