/* contacts-contact-sheet.c generated by valac 0.21.2.6-90bab, the Vala compiler
 * generated from contacts-contact-sheet.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <pango/pango.h>
#include <folks/folks.h>
#include <gee.h>
#include <gio/gio.h>
#include <telepathy-glib/telepathy-glib.h>
#include <folks/folks-telepathy.h>
#include <glib/gi18n-lib.h>


#define CONTACTS_TYPE_CONTACT_SHEET (contacts_contact_sheet_get_type ())
#define CONTACTS_CONTACT_SHEET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheet))
#define CONTACTS_CONTACT_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheetClass))
#define CONTACTS_IS_CONTACT_SHEET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_SHEET))
#define CONTACTS_IS_CONTACT_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_SHEET))
#define CONTACTS_CONTACT_SHEET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_SHEET, ContactsContactSheetClass))

typedef struct _ContactsContactSheet ContactsContactSheet;
typedef struct _ContactsContactSheetClass ContactsContactSheetClass;
typedef struct _ContactsContactSheetPrivate ContactsContactSheetPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define CONTACTS_TYPE_CONTACT (contacts_contact_get_type ())
#define CONTACTS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT, ContactsContact))
#define CONTACTS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT, ContactsContactClass))
#define CONTACTS_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT))
#define CONTACTS_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT))
#define CONTACTS_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT, ContactsContactClass))

typedef struct _ContactsContact ContactsContact;
typedef struct _ContactsContactClass ContactsContactClass;
typedef struct _Block15Data Block15Data;

#define CONTACTS_TYPE_CONTACT_FRAME (contacts_contact_frame_get_type ())
#define CONTACTS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrame))
#define CONTACTS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
#define CONTACTS_IS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_IS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_CONTACT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))

typedef struct _ContactsContactFrame ContactsContactFrame;
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
typedef struct _ContactsContactPrivate ContactsContactPrivate;

#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
#define CONTACTS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_STORE, ContactsStore))
#define CONTACTS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_STORE, ContactsStoreClass))
#define CONTACTS_IS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_STORE))
#define CONTACTS_IS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_STORE))
#define CONTACTS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_STORE, ContactsStoreClass))

typedef struct _ContactsStore ContactsStore;
typedef struct _ContactsStoreClass ContactsStoreClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block16Data Block16Data;

#define CONTACTS_TYPE_TYPESET (contacts_typeset_get_type ())
#define CONTACTS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSet))
#define CONTACTS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))
#define CONTACTS_IS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_TYPESET))
#define CONTACTS_IS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_TYPESET))
#define CONTACTS_TYPESET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))

typedef struct _ContactsTypeSet ContactsTypeSet;
typedef struct _ContactsTypeSetClass ContactsTypeSetClass;
typedef struct _Block17Data Block17Data;

#define CONTACTS_TYPE_APP (contacts_app_get_type ())
#define CONTACTS_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_APP, ContactsApp))
#define CONTACTS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_APP, ContactsAppClass))
#define CONTACTS_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_APP))
#define CONTACTS_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_APP))
#define CONTACTS_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_APP, ContactsAppClass))

typedef struct _ContactsApp ContactsApp;
typedef struct _ContactsAppClass ContactsAppClass;
typedef struct _ContactsAppPrivate ContactsAppPrivate;

#define CONTACTS_TYPE_WINDOW (contacts_window_get_type ())
#define CONTACTS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_WINDOW, ContactsWindow))
#define CONTACTS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_WINDOW, ContactsWindowClass))
#define CONTACTS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_WINDOW))
#define CONTACTS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_WINDOW))
#define CONTACTS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_WINDOW, ContactsWindowClass))

typedef struct _ContactsWindow ContactsWindow;
typedef struct _ContactsWindowClass ContactsWindowClass;
typedef struct _ContactsStorePrivate ContactsStorePrivate;
typedef struct _Block18Data Block18Data;
typedef struct _Block19Data Block19Data;

#define CONTACTS_CONTACT_TYPE_IM_DISPLAY (contacts_contact_im_display_get_type ())
typedef struct _Block20Data Block20Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

struct _ContactsContactSheet {
	GtkGrid parent_instance;
	ContactsContactSheetPrivate * priv;
};

struct _ContactsContactSheetClass {
	GtkGridClass parent_class;
};

struct _Block15Data {
	int _ref_count_;
	ContactsContactSheet * self;
	ContactsContact* c;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksPresenceType presence_type;
	gchar* presence_message;
	gboolean is_phone;
	FolksIndividual* individual;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};

struct _Block16Data {
	int _ref_count_;
	Block15Data * _data15_;
	FolksEmailFieldDetails* email;
};

struct _Block17Data {
	int _ref_count_;
	Block15Data * _data15_;
	FolksPhoneFieldDetails* phone;
};

struct _ContactsApp {
	GtkApplication parent_instance;
	ContactsAppPrivate * priv;
	GSettings* settings;
	ContactsStore* contacts_store;
	ContactsWindow* window;
};

struct _ContactsAppClass {
	GtkApplicationClass parent_class;
};

struct _ContactsStore {
	GObject parent_instance;
	ContactsStorePrivate * priv;
	GeeHashMap* calling_accounts;
	GeeHashMultiMap* dont_suggest_link;
};

struct _ContactsStoreClass {
	GObjectClass parent_class;
};

struct _Block18Data {
	int _ref_count_;
	Block15Data * _data15_;
	gchar* protocol;
};

struct _Block19Data {
	int _ref_count_;
	Block18Data * _data18_;
	FolksImFieldDetails* id;
};

typedef enum  {
	CONTACTS_CONTACT_IM_DISPLAY_DEFAULT,
	CONTACTS_CONTACT_IM_DISPLAY_ALIAS_SERVICE
} ContactsContactImDisplay;

struct _Block20Data {
	int _ref_count_;
	Block15Data * _data15_;
	FolksUrlFieldDetails* url;
};


static gpointer contacts_contact_sheet_parent_class = NULL;
extern ContactsApp* contacts_app_app;

GType contacts_contact_sheet_get_type (void) G_GNUC_CONST;
enum  {
	CONTACTS_CONTACT_SHEET_DUMMY_PROPERTY
};
static GtkButton* contacts_contact_sheet_add_row_with_button (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value);
static void contacts_contact_sheet_add_row_with_label (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value);
ContactsContactSheet* contacts_contact_sheet_new (void);
ContactsContactSheet* contacts_contact_sheet_construct (GType object_type);
GType contacts_contact_get_type (void) G_GNUC_CONST;
void contacts_contact_sheet_update (ContactsContactSheet* self, ContactsContact* c);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
GType contacts_contact_frame_get_type (void) G_GNUC_CONST;
#define PROFILE_SIZE 96
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static void __lambda32_ (Block15Data* _data15_, GtkWidget* w);
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
GType contacts_store_get_type (void) G_GNUC_CONST;
static void ___lambda32__gtk_callback (GtkWidget* widget, gpointer self);
static void __lambda33_ (Block15Data* _data15_, GtkWidget* w);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
static void ___lambda33__gtk_callback (GtkWidget* widget, gpointer self);
GtkWidget* contacts_contact_create_merged_presence_widget (ContactsContact* self);
GeeList* contacts_contact_get_personas_for_display (ContactsContact* self);
gchar* contacts_contact_format_persona_store_name_for_contact (FolksPersona* persona);
GeeArrayList* contacts_contact_sort_fields (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GeeCollection* fields);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
GType contacts_typeset_get_type (void) G_GNUC_CONST;
ContactsTypeSet* contacts_typeset_get_email (void);
gchar* contacts_typeset_format_type (ContactsTypeSet* self, FolksAbstractFieldDetails* detail);
static void _______lambda34_ (Block16Data* _data16_);
void contacts_utils_compose_mail (const gchar* email);
static void ________lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
GType contacts_app_get_type (void) G_GNUC_CONST;
GType contacts_window_get_type (void) G_GNUC_CONST;
gboolean contacts_store_get_can_call (ContactsStore* self);
ContactsTypeSet* contacts_typeset_get_phone (void);
static void ________lambda35_ (Block17Data* _data17_);
void contacts_utils_start_call (const gchar* contact_id, GeeHashMap* accounts);
static void _________lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
GType contacts_contact_im_display_get_type (void) G_GNUC_CONST;
gchar* contacts_contact_format_im_service (const gchar* service, ContactsContactImDisplay* display);
static void __________lambda36_ (Block19Data* _data19_);
TpfPersona* contacts_contact_find_im_persona (ContactsContact* self, const gchar* protocol, const gchar* im_address);
void contacts_utils_start_chat (ContactsContact* contact, const gchar* protocol, const gchar* id);
static void ___________lambda36__gtk_button_clicked (GtkButton* _sender, gpointer self);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
gchar* contacts_contact_format_uri_link_text (FolksUrlFieldDetails* detail);
static void _______lambda37_ (Block20Data* _data20_);
static void ________lambda37__gtk_button_clicked (GtkButton* _sender, gpointer self);
gboolean contacts_is_set (const gchar* str);
gchar** contacts_contact_format_address (FolksPostalAddress* addr, int* result_length1);
ContactsTypeSet* contacts_typeset_get_general (void);
void contacts_contact_sheet_clear (ContactsContactSheet* self);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static GtkButton* contacts_contact_sheet_add_row_with_button (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value) {
	GtkButton* result = NULL;
	GtkLabel* type_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkStyleContext* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GtkButton* value_button = NULL;
	const gchar* _tmp4_ = NULL;
	GtkButton* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	GtkWidget* _tmp8_ = NULL;
	GtkWidget* _tmp9_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (label_value != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = label_value;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	type_label = _tmp1_;
	g_object_set ((GtkMisc*) type_label, "xalign", 1.0f, NULL);
	gtk_widget_set_halign ((GtkWidget*) type_label, GTK_ALIGN_END);
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) type_label);
	gtk_style_context_add_class (_tmp2_, "dim-label");
	_tmp3_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) type_label, 0, _tmp3_, 1, 1);
	_tmp4_ = value;
	_tmp5_ = (GtkButton*) gtk_button_new_with_label (_tmp4_);
	g_object_ref_sink (_tmp5_);
	value_button = _tmp5_;
	gtk_button_set_focus_on_click (value_button, FALSE);
	gtk_button_set_relief (value_button, GTK_RELIEF_NONE);
	g_object_set (value_button, "xalign", 0.0f, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) value_button, TRUE);
	_tmp6_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) value_button, 1, _tmp6_, 1, 1);
	_tmp7_ = *row;
	*row = _tmp7_ + 1;
	_tmp8_ = gtk_bin_get_child ((GtkBin*) value_button);
	gtk_label_set_ellipsize (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp8_) : NULL, PANGO_ELLIPSIZE_END);
	_tmp9_ = gtk_bin_get_child ((GtkBin*) value_button);
	g_object_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp9_) : NULL, "wrap-mode", PANGO_WRAP_CHAR, NULL);
	result = value_button;
	_g_object_unref0 (type_label);
	return result;
}


static void contacts_contact_sheet_add_row_with_label (ContactsContactSheet* self, gint* row, const gchar* label_value, const gchar* value) {
	GtkLabel* type_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	GtkStyleContext* _tmp6_ = NULL;
	GtkLabel* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	GtkLabel* value_label = NULL;
	const gchar* _tmp9_ = NULL;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_ = NULL;
	GtkLabel* _tmp12_ = NULL;
	GtkLabel* _tmp13_ = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_ = NULL;
	GtkLabel* _tmp16_ = NULL;
	GtkLabel* _tmp17_ = NULL;
	GtkTextDirection _tmp18_ = 0;
	GtkLabel* _tmp21_ = NULL;
	GtkLabel* _tmp22_ = NULL;
	GtkLabel* _tmp23_ = NULL;
	gint _tmp24_ = 0;
	gint _tmp25_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label_value != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = label_value;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	type_label = _tmp1_;
	_tmp2_ = type_label;
	g_object_set ((GtkMisc*) _tmp2_, "xalign", 1.0f, NULL);
	_tmp3_ = type_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_END);
	_tmp4_ = type_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	_tmp5_ = type_label;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	gtk_style_context_add_class (_tmp6_, "dim-label");
	_tmp7_ = type_label;
	_tmp8_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp7_, 0, _tmp8_, 1, 1);
	_tmp9_ = value;
	_tmp10_ = (GtkLabel*) gtk_label_new (_tmp9_);
	g_object_ref_sink (_tmp10_);
	value_label = _tmp10_;
	_tmp11_ = value_label;
	gtk_label_set_line_wrap (_tmp11_, TRUE);
	_tmp12_ = value_label;
	g_object_set ((GtkMisc*) _tmp12_, "xalign", 0.0f, NULL);
	_tmp13_ = value_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_START);
	_tmp14_ = value_label;
	gtk_label_set_ellipsize (_tmp14_, PANGO_ELLIPSIZE_END);
	_tmp15_ = value_label;
	g_object_set (_tmp15_, "wrap-mode", PANGO_WRAP_CHAR, NULL);
	_tmp16_ = type_label;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp16_, 3);
	_tmp17_ = value_label;
	_tmp18_ = gtk_widget_get_direction ((GtkWidget*) _tmp17_);
	if (_tmp18_ == GTK_TEXT_DIR_LTR) {
		GtkLabel* _tmp19_ = NULL;
		_tmp19_ = value_label;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp19_, 6);
	} else {
		GtkLabel* _tmp20_ = NULL;
		_tmp20_ = value_label;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp20_, 6);
	}
	_tmp21_ = value_label;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp21_, 3);
	_tmp22_ = value_label;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp22_, 3);
	_tmp23_ = value_label;
	_tmp24_ = *row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp23_, 1, _tmp24_, 1, 1);
	_tmp25_ = *row;
	*row = _tmp25_ + 1;
	_g_object_unref0 (value_label);
	_g_object_unref0 (type_label);
}


ContactsContactSheet* contacts_contact_sheet_construct (GType object_type) {
	ContactsContactSheet * self = NULL;
	self = (ContactsContactSheet*) g_object_new (object_type, NULL);
	gtk_grid_set_row_spacing ((GtkGrid*) self, (guint) 12);
	gtk_grid_set_column_spacing ((GtkGrid*) self, (guint) 16);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	return self;
}


ContactsContactSheet* contacts_contact_sheet_new (void) {
	return contacts_contact_sheet_construct (CONTACTS_TYPE_CONTACT_SHEET);
}


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


static Block15Data* block15_data_ref (Block15Data* _data15_) {
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}


static void block15_data_unref (void * _userdata_) {
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		ContactsContactSheet * self;
		self = _data15_->self;
		_g_object_unref0 (_data15_->c);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}


static void __lambda32_ (Block15Data* _data15_, GtkWidget* w) {
	ContactsContactSheet * self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	self = _data15_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data15_->c;
	_tmp2_ = _tmp1_->individual;
	_tmp3_ = _data15_->c;
	contacts_contact_frame_set_image (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp0_) : NULL, (FolksAvatarDetails*) _tmp2_, _tmp3_);
}


static void ___lambda32__gtk_callback (GtkWidget* widget, gpointer self) {
	__lambda32_ (self, widget);
}


static void __lambda33_ (Block15Data* _data15_, GtkWidget* w) {
	ContactsContactSheet * self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	self = _data15_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data15_->c;
	_tmp2_ = contacts_contact_get_display_name (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_markup_printf_escaped ("<span font='16'>%s</span>", _tmp3_);
	_tmp5_ = _tmp4_;
	gtk_label_set_markup (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp0_) : NULL, _tmp5_);
	_g_free0 (_tmp5_);
}


static void ___lambda33__gtk_callback (GtkWidget* widget, gpointer self) {
	__lambda33_ (self, widget);
}


static Block16Data* block16_data_ref (Block16Data* _data16_) {
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}


static void block16_data_unref (void * _userdata_) {
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		ContactsContactSheet * self;
		self = _data16_->_data15_->self;
		_g_object_unref0 (_data16_->email);
		block15_data_unref (_data16_->_data15_);
		_data16_->_data15_ = NULL;
		g_slice_free (Block16Data, _data16_);
	}
}


static void _______lambda34_ (Block16Data* _data16_) {
	Block15Data* _data15_;
	ContactsContactSheet * self;
	ContactsContact* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	FolksEmailFieldDetails* _tmp3_ = NULL;
	gconstpointer _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	_data15_ = _data16_->_data15_;
	self = _data15_->self;
	_tmp0_ = _data15_->c;
	_tmp1_ = contacts_contact_get_display_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _data16_->email;
	_tmp4_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup_printf ("%s <%s>", _tmp2_, (const gchar*) _tmp5_);
	_tmp7_ = _tmp6_;
	contacts_utils_compose_mail (_tmp7_);
	_g_free0 (_tmp7_);
}


static void ________lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_______lambda34_ (self);
}


static Block17Data* block17_data_ref (Block17Data* _data17_) {
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}


static void block17_data_unref (void * _userdata_) {
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		ContactsContactSheet * self;
		self = _data17_->_data15_->self;
		_g_object_unref0 (_data17_->phone);
		block15_data_unref (_data17_->_data15_);
		_data17_->_data15_ = NULL;
		g_slice_free (Block17Data, _data17_);
	}
}


static void ________lambda35_ (Block17Data* _data17_) {
	Block15Data* _data15_;
	ContactsContactSheet * self;
	FolksPhoneFieldDetails* _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	ContactsApp* _tmp3_ = NULL;
	ContactsStore* _tmp4_ = NULL;
	GeeHashMap* _tmp5_ = NULL;
	_data15_ = _data17_->_data15_;
	self = _data15_->self;
	_tmp0_ = _data17_->phone;
	_tmp1_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = contacts_app_app;
	_tmp4_ = _tmp3_->contacts_store;
	_tmp5_ = _tmp4_->calling_accounts;
	contacts_utils_start_call ((const gchar*) _tmp2_, _tmp5_);
}


static void _________lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	________lambda35_ (self);
}


static Block18Data* block18_data_ref (Block18Data* _data18_) {
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}


static void block18_data_unref (void * _userdata_) {
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		ContactsContactSheet * self;
		self = _data18_->_data15_->self;
		_g_free0 (_data18_->protocol);
		block15_data_unref (_data18_->_data15_);
		_data18_->_data15_ = NULL;
		g_slice_free (Block18Data, _data18_);
	}
}


static Block19Data* block19_data_ref (Block19Data* _data19_) {
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}


static void block19_data_unref (void * _userdata_) {
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		ContactsContactSheet * self;
		self = _data19_->_data18_->_data15_->self;
		_g_object_unref0 (_data19_->id);
		block18_data_unref (_data19_->_data18_);
		_data19_->_data18_ = NULL;
		g_slice_free (Block19Data, _data19_);
	}
}


static void __________lambda36_ (Block19Data* _data19_) {
	Block18Data* _data18_;
	Block15Data* _data15_;
	ContactsContactSheet * self;
	TpfPersona* im_persona = NULL;
	ContactsContact* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	FolksImFieldDetails* _tmp2_ = NULL;
	gconstpointer _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	TpfPersona* _tmp5_ = NULL;
	TpfPersona* _tmp6_ = NULL;
	_data18_ = _data19_->_data18_;
	_data15_ = _data18_->_data15_;
	self = _data15_->self;
	_tmp0_ = _data15_->c;
	_tmp1_ = _data18_->protocol;
	_tmp2_ = _data19_->id;
	_tmp3_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = contacts_contact_find_im_persona (_tmp0_, _tmp1_, (const gchar*) _tmp4_);
	im_persona = _tmp5_;
	_tmp6_ = im_persona;
	if (_tmp6_ != NULL) {
		FolksPresenceType type = 0;
		TpfPersona* _tmp7_ = NULL;
		FolksPresenceType _tmp8_ = 0;
		FolksPresenceType _tmp9_ = 0;
		gboolean _tmp10_ = FALSE;
		gboolean _tmp11_ = FALSE;
		gboolean _tmp12_ = FALSE;
		FolksPresenceType _tmp13_ = 0;
		gboolean _tmp15_ = FALSE;
		gboolean _tmp17_ = FALSE;
		gboolean _tmp19_ = FALSE;
		_tmp7_ = im_persona;
		_tmp8_ = folks_presence_details_get_presence_type ((FolksPresenceDetails*) _tmp7_);
		_tmp9_ = _tmp8_;
		type = _tmp9_;
		_tmp13_ = type;
		if (_tmp13_ != FOLKS_PRESENCE_TYPE_UNSET) {
			FolksPresenceType _tmp14_ = 0;
			_tmp14_ = type;
			_tmp12_ = _tmp14_ != FOLKS_PRESENCE_TYPE_ERROR;
		} else {
			_tmp12_ = FALSE;
		}
		_tmp15_ = _tmp12_;
		if (_tmp15_) {
			FolksPresenceType _tmp16_ = 0;
			_tmp16_ = type;
			_tmp11_ = _tmp16_ != FOLKS_PRESENCE_TYPE_OFFLINE;
		} else {
			_tmp11_ = FALSE;
		}
		_tmp17_ = _tmp11_;
		if (_tmp17_) {
			FolksPresenceType _tmp18_ = 0;
			_tmp18_ = type;
			_tmp10_ = _tmp18_ != FOLKS_PRESENCE_TYPE_UNKNOWN;
		} else {
			_tmp10_ = FALSE;
		}
		_tmp19_ = _tmp10_;
		if (_tmp19_) {
			ContactsContact* _tmp20_ = NULL;
			const gchar* _tmp21_ = NULL;
			FolksImFieldDetails* _tmp22_ = NULL;
			gconstpointer _tmp23_ = NULL;
			const gchar* _tmp24_ = NULL;
			_tmp20_ = _data15_->c;
			_tmp21_ = _data18_->protocol;
			_tmp22_ = _data19_->id;
			_tmp23_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp22_);
			_tmp24_ = _tmp23_;
			contacts_utils_start_chat (_tmp20_, _tmp21_, (const gchar*) _tmp24_);
		}
	}
	_g_object_unref0 (im_persona);
}


static void ___________lambda36__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__________lambda36_ (self);
}


static Block20Data* block20_data_ref (Block20Data* _data20_) {
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}


static void block20_data_unref (void * _userdata_) {
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		ContactsContactSheet * self;
		self = _data20_->_data15_->self;
		_g_object_unref0 (_data20_->url);
		block15_data_unref (_data20_->_data15_);
		_data20_->_data15_ = NULL;
		g_slice_free (Block20Data, _data20_);
	}
}


static void _______lambda37_ (Block20Data* _data20_) {
	Block15Data* _data15_;
	ContactsContactSheet * self;
	GError * _inner_error_ = NULL;
	_data15_ = _data20_->_data15_;
	self = _data15_->self;
	{
		FolksUrlFieldDetails* _tmp0_ = NULL;
		gconstpointer _tmp1_ = NULL;
		const gchar* _tmp2_ = NULL;
		_tmp0_ = _data20_->url;
		_tmp1_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp0_);
		_tmp2_ = _tmp1_;
		gtk_show_uri (NULL, (const gchar*) _tmp2_, (guint32) 0, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch4_g_error;
		}
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* e1 = NULL;
		FolksUrlFieldDetails* _tmp3_ = NULL;
		gconstpointer _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		GError* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		e1 = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = _data20_->url;
		_tmp4_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = e1;
		_tmp7_ = _tmp6_->message;
		g_warning ("contacts-contact-sheet.vala:191: Error opening website ‘%s’: %s", (const gchar*) _tmp5_, _tmp7_);
		_g_error_free0 (e1);
	}
	__finally4:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ________lambda37__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_______lambda37_ (self);
}


void contacts_contact_sheet_update (ContactsContactSheet* self, ContactsContact* c) {
	Block15Data* _data15_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContactFrame* image_frame = NULL;
	ContactsContactFrame* _tmp2_ = NULL;
	ContactsContactFrame* _tmp3_ = NULL;
	GtkStyleContext* _tmp4_ = NULL;
	ContactsContactFrame* _tmp5_ = NULL;
	ContactsContactFrame* _tmp6_ = NULL;
	ContactsContactFrame* _tmp7_ = NULL;
	ContactsContact* _tmp8_ = NULL;
	ContactsContactFrame* _tmp9_ = NULL;
	ContactsContactFrame* _tmp10_ = NULL;
	GtkLabel* name_label = NULL;
	GtkLabel* _tmp11_ = NULL;
	GtkLabel* _tmp12_ = NULL;
	GtkLabel* _tmp13_ = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_ = NULL;
	GtkTextDirection _tmp16_ = 0;
	GtkLabel* _tmp19_ = NULL;
	GtkLabel* _tmp20_ = NULL;
	ContactsContact* _tmp21_ = NULL;
	GtkLabel* _tmp22_ = NULL;
	GtkLabel* _tmp23_ = NULL;
	GtkWidget* merged_presence = NULL;
	ContactsContact* _tmp24_ = NULL;
	GtkWidget* _tmp25_ = NULL;
	GtkWidget* _tmp26_ = NULL;
	GtkWidget* _tmp27_ = NULL;
	GtkWidget* _tmp28_ = NULL;
	gint i = 0;
	gint last_store_position = 0;
	gboolean is_first_persona = FALSE;
	GeeList* personas = NULL;
	ContactsContact* _tmp29_ = NULL;
	GeeList* _tmp30_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (c != NULL);
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	_data15_->self = g_object_ref (self);
	_tmp0_ = c;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data15_->c);
	_data15_->c = _tmp1_;
	_tmp2_ = contacts_contact_frame_new (PROFILE_SIZE, FALSE);
	g_object_ref_sink (_tmp2_);
	image_frame = _tmp2_;
	_tmp3_ = image_frame;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	gtk_style_context_add_class (_tmp4_, "main-avatar-frame");
	_tmp5_ = image_frame;
	gtk_frame_set_shadow_type ((GtkFrame*) _tmp5_, GTK_SHADOW_IN);
	_tmp6_ = image_frame;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp6_, FALSE);
	_tmp7_ = image_frame;
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_START);
	_tmp8_ = _data15_->c;
	_tmp9_ = image_frame;
	contacts_contact_keep_widget_uptodate (_tmp8_, (GtkWidget*) _tmp9_, ___lambda32__gtk_callback, block15_data_ref (_data15_), block15_data_unref);
	_tmp10_ = image_frame;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp10_, 0, 0, 1, 3);
	_tmp11_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp11_);
	name_label = _tmp11_;
	_tmp12_ = name_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	_tmp13_ = name_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_START);
	_tmp14_ = name_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp14_, GTK_ALIGN_CENTER);
	_tmp15_ = name_label;
	_tmp16_ = gtk_widget_get_direction ((GtkWidget*) _tmp15_);
	if (_tmp16_ == GTK_TEXT_DIR_LTR) {
		GtkLabel* _tmp17_ = NULL;
		_tmp17_ = name_label;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp17_, 6);
	} else {
		GtkLabel* _tmp18_ = NULL;
		_tmp18_ = name_label;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp18_, 6);
	}
	_tmp19_ = name_label;
	gtk_label_set_ellipsize (_tmp19_, PANGO_ELLIPSIZE_END);
	_tmp20_ = name_label;
	g_object_set ((GtkMisc*) _tmp20_, "xalign", 0.0f, NULL);
	_tmp21_ = _data15_->c;
	_tmp22_ = name_label;
	contacts_contact_keep_widget_uptodate (_tmp21_, (GtkWidget*) _tmp22_, ___lambda33__gtk_callback, block15_data_ref (_data15_), block15_data_unref);
	_tmp23_ = name_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp23_, 1, 0, 1, 3);
	_tmp24_ = _data15_->c;
	_tmp25_ = contacts_contact_create_merged_presence_widget (_tmp24_);
	merged_presence = _tmp25_;
	_tmp26_ = merged_presence;
	gtk_widget_set_halign (_tmp26_, GTK_ALIGN_START);
	_tmp27_ = merged_presence;
	gtk_widget_set_valign (_tmp27_, GTK_ALIGN_START);
	_tmp28_ = merged_presence;
	gtk_grid_attach ((GtkGrid*) self, _tmp28_, 1, 1, 1, 1);
	i = 3;
	last_store_position = 0;
	is_first_persona = TRUE;
	_tmp29_ = _data15_->c;
	_tmp30_ = contacts_contact_get_personas_for_display (_tmp29_);
	personas = _tmp30_;
	{
		GeeList* _p_list = NULL;
		GeeList* _tmp31_ = NULL;
		GeeList* _tmp32_ = NULL;
		gint _p_size = 0;
		GeeList* _tmp33_ = NULL;
		gint _tmp34_ = 0;
		gint _tmp35_ = 0;
		gint _p_index = 0;
		_tmp31_ = personas;
		_tmp32_ = _g_object_ref0 (_tmp31_);
		_p_list = _tmp32_;
		_tmp33_ = _p_list;
		_tmp34_ = gee_collection_get_size ((GeeCollection*) _tmp33_);
		_tmp35_ = _tmp34_;
		_p_size = _tmp35_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp36_ = 0;
			gint _tmp37_ = 0;
			gint _tmp38_ = 0;
			FolksPersona* p = NULL;
			GeeList* _tmp39_ = NULL;
			gint _tmp40_ = 0;
			gpointer _tmp41_ = NULL;
			gboolean _tmp42_ = FALSE;
			FolksEmailDetails* details = NULL;
			FolksPersona* _tmp60_ = NULL;
			FolksEmailDetails* _tmp61_ = NULL;
			FolksEmailDetails* _tmp62_ = NULL;
			FolksPhoneDetails* phone_details = NULL;
			FolksPersona* _tmp89_ = NULL;
			FolksPhoneDetails* _tmp90_ = NULL;
			FolksPhoneDetails* _tmp91_ = NULL;
			FolksImDetails* im_details = NULL;
			FolksPersona* _tmp130_ = NULL;
			FolksImDetails* _tmp131_ = NULL;
			FolksImDetails* _tmp132_ = NULL;
			FolksUrlDetails* url_details = NULL;
			FolksPersona* _tmp166_ = NULL;
			FolksUrlDetails* _tmp167_ = NULL;
			FolksUrlDetails* _tmp168_ = NULL;
			FolksNameDetails* name_details = NULL;
			FolksPersona* _tmp184_ = NULL;
			FolksNameDetails* _tmp185_ = NULL;
			FolksNameDetails* _tmp186_ = NULL;
			FolksBirthdayDetails* birthday_details = NULL;
			FolksPersona* _tmp195_ = NULL;
			FolksBirthdayDetails* _tmp196_ = NULL;
			FolksBirthdayDetails* _tmp197_ = NULL;
			FolksNoteDetails* note_details = NULL;
			FolksPersona* _tmp209_ = NULL;
			FolksNoteDetails* _tmp210_ = NULL;
			FolksNoteDetails* _tmp211_ = NULL;
			FolksPostalAddressDetails* addr_details = NULL;
			FolksPersona* _tmp224_ = NULL;
			FolksPostalAddressDetails* _tmp225_ = NULL;
			FolksPostalAddressDetails* _tmp226_ = NULL;
			gint _tmp254_ = 0;
			gint _tmp255_ = 0;
			gint _tmp256_ = 0;
			_tmp36_ = _p_index;
			_p_index = _tmp36_ + 1;
			_tmp37_ = _p_index;
			_tmp38_ = _p_size;
			if (!(_tmp37_ < _tmp38_)) {
				break;
			}
			_tmp39_ = _p_list;
			_tmp40_ = _p_index;
			_tmp41_ = gee_list_get (_tmp39_, _tmp40_);
			p = (FolksPersona*) _tmp41_;
			_tmp42_ = is_first_persona;
			if (!_tmp42_) {
				GtkLabel* store_name = NULL;
				GtkLabel* _tmp43_ = NULL;
				GtkLabel* _tmp44_ = NULL;
				FolksPersona* _tmp45_ = NULL;
				gchar* _tmp46_ = NULL;
				gchar* _tmp47_ = NULL;
				gchar* _tmp48_ = NULL;
				gchar* _tmp49_ = NULL;
				GtkLabel* _tmp50_ = NULL;
				GtkLabel* _tmp51_ = NULL;
				GtkLabel* _tmp52_ = NULL;
				GtkTextDirection _tmp53_ = 0;
				GtkLabel* _tmp56_ = NULL;
				gint _tmp57_ = 0;
				gint _tmp58_ = 0;
				gint _tmp59_ = 0;
				_tmp43_ = (GtkLabel*) gtk_label_new ("");
				g_object_ref_sink (_tmp43_);
				store_name = _tmp43_;
				_tmp44_ = store_name;
				_tmp45_ = p;
				_tmp46_ = contacts_contact_format_persona_store_name_for_contact (_tmp45_);
				_tmp47_ = _tmp46_;
				_tmp48_ = g_markup_printf_escaped ("<span font='16px bold'>%s</span>", _tmp47_);
				_tmp49_ = _tmp48_;
				gtk_label_set_markup (_tmp44_, _tmp49_);
				_g_free0 (_tmp49_);
				_g_free0 (_tmp47_);
				_tmp50_ = store_name;
				gtk_widget_set_halign ((GtkWidget*) _tmp50_, GTK_ALIGN_START);
				_tmp51_ = store_name;
				g_object_set ((GtkMisc*) _tmp51_, "xalign", 0.0f, NULL);
				_tmp52_ = store_name;
				_tmp53_ = gtk_widget_get_direction ((GtkWidget*) _tmp52_);
				if (_tmp53_ == GTK_TEXT_DIR_LTR) {
					GtkLabel* _tmp54_ = NULL;
					_tmp54_ = store_name;
					gtk_widget_set_margin_left ((GtkWidget*) _tmp54_, 6);
				} else {
					GtkLabel* _tmp55_ = NULL;
					_tmp55_ = store_name;
					gtk_widget_set_margin_right ((GtkWidget*) _tmp55_, 6);
				}
				_tmp56_ = store_name;
				_tmp57_ = i;
				gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp56_, 0, _tmp57_, 3, 1);
				_tmp58_ = i;
				i = _tmp58_ + 1;
				_tmp59_ = i;
				last_store_position = _tmp59_;
				_g_object_unref0 (store_name);
			}
			_tmp60_ = p;
			_tmp61_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp60_, FOLKS_TYPE_EMAIL_DETAILS) ? ((FolksEmailDetails*) _tmp60_) : NULL);
			details = _tmp61_;
			_tmp62_ = details;
			if (_tmp62_ != NULL) {
				GeeArrayList* emails = NULL;
				FolksEmailDetails* _tmp63_ = NULL;
				GeeSet* _tmp64_ = NULL;
				GeeSet* _tmp65_ = NULL;
				GeeArrayList* _tmp66_ = NULL;
				_tmp63_ = details;
				_tmp64_ = folks_email_details_get_email_addresses (_tmp63_);
				_tmp65_ = _tmp64_;
				_tmp66_ = contacts_contact_sort_fields (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp65_);
				emails = _tmp66_;
				{
					GeeArrayList* _email_list = NULL;
					GeeArrayList* _tmp67_ = NULL;
					GeeArrayList* _tmp68_ = NULL;
					gint _email_size = 0;
					GeeArrayList* _tmp69_ = NULL;
					gint _tmp70_ = 0;
					gint _tmp71_ = 0;
					gint _email_index = 0;
					_tmp67_ = emails;
					_tmp68_ = _g_object_ref0 (_tmp67_);
					_email_list = _tmp68_;
					_tmp69_ = _email_list;
					_tmp70_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp69_);
					_tmp71_ = _tmp70_;
					_email_size = _tmp71_;
					_email_index = -1;
					while (TRUE) {
						Block16Data* _data16_;
						gint _tmp72_ = 0;
						gint _tmp73_ = 0;
						gint _tmp74_ = 0;
						GeeArrayList* _tmp75_ = NULL;
						gint _tmp76_ = 0;
						gpointer _tmp77_ = NULL;
						GtkButton* button = NULL;
						ContactsTypeSet* _tmp78_ = NULL;
						ContactsTypeSet* _tmp79_ = NULL;
						FolksEmailFieldDetails* _tmp80_ = NULL;
						gchar* _tmp81_ = NULL;
						gchar* _tmp82_ = NULL;
						FolksEmailFieldDetails* _tmp83_ = NULL;
						gconstpointer _tmp84_ = NULL;
						const gchar* _tmp85_ = NULL;
						GtkButton* _tmp86_ = NULL;
						GtkButton* _tmp87_ = NULL;
						GtkButton* _tmp88_ = NULL;
						_data16_ = g_slice_new0 (Block16Data);
						_data16_->_ref_count_ = 1;
						_data16_->_data15_ = block15_data_ref (_data15_);
						_tmp72_ = _email_index;
						_email_index = _tmp72_ + 1;
						_tmp73_ = _email_index;
						_tmp74_ = _email_size;
						if (!(_tmp73_ < _tmp74_)) {
							block16_data_unref (_data16_);
							_data16_ = NULL;
							break;
						}
						_tmp75_ = _email_list;
						_tmp76_ = _email_index;
						_tmp77_ = gee_abstract_list_get ((GeeAbstractList*) _tmp75_, _tmp76_);
						_data16_->email = (FolksEmailFieldDetails*) _tmp77_;
						_tmp78_ = contacts_typeset_get_email ();
						_tmp79_ = _tmp78_;
						_tmp80_ = _data16_->email;
						_tmp81_ = contacts_typeset_format_type (_tmp79_, (FolksAbstractFieldDetails*) _tmp80_);
						_tmp82_ = _tmp81_;
						_tmp83_ = _data16_->email;
						_tmp84_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp83_);
						_tmp85_ = _tmp84_;
						_tmp86_ = contacts_contact_sheet_add_row_with_button (self, &i, _tmp82_, (const gchar*) _tmp85_);
						_tmp87_ = _tmp86_;
						_g_free0 (_tmp82_);
						button = _tmp87_;
						_tmp88_ = button;
						g_signal_connect_data (_tmp88_, "clicked", (GCallback) ________lambda34__gtk_button_clicked, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
						_g_object_unref0 (button);
						block16_data_unref (_data16_);
						_data16_ = NULL;
					}
					_g_object_unref0 (_email_list);
				}
				_g_object_unref0 (emails);
			}
			_tmp89_ = p;
			_tmp90_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp89_, FOLKS_TYPE_PHONE_DETAILS) ? ((FolksPhoneDetails*) _tmp89_) : NULL);
			phone_details = _tmp90_;
			_tmp91_ = phone_details;
			if (_tmp91_ != NULL) {
				GeeArrayList* phones = NULL;
				FolksPhoneDetails* _tmp92_ = NULL;
				GeeSet* _tmp93_ = NULL;
				GeeSet* _tmp94_ = NULL;
				GeeArrayList* _tmp95_ = NULL;
				_tmp92_ = phone_details;
				_tmp93_ = folks_phone_details_get_phone_numbers (_tmp92_);
				_tmp94_ = _tmp93_;
				_tmp95_ = contacts_contact_sort_fields (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp94_);
				phones = _tmp95_;
				{
					GeeArrayList* _phone_list = NULL;
					GeeArrayList* _tmp96_ = NULL;
					GeeArrayList* _tmp97_ = NULL;
					gint _phone_size = 0;
					GeeArrayList* _tmp98_ = NULL;
					gint _tmp99_ = 0;
					gint _tmp100_ = 0;
					gint _phone_index = 0;
					_tmp96_ = phones;
					_tmp97_ = _g_object_ref0 (_tmp96_);
					_phone_list = _tmp97_;
					_tmp98_ = _phone_list;
					_tmp99_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp98_);
					_tmp100_ = _tmp99_;
					_phone_size = _tmp100_;
					_phone_index = -1;
					while (TRUE) {
						Block17Data* _data17_;
						gint _tmp101_ = 0;
						gint _tmp102_ = 0;
						gint _tmp103_ = 0;
						GeeArrayList* _tmp104_ = NULL;
						gint _tmp105_ = 0;
						gpointer _tmp106_ = NULL;
						ContactsApp* _tmp107_ = NULL;
						ContactsStore* _tmp108_ = NULL;
						gboolean _tmp109_ = FALSE;
						gboolean _tmp110_ = FALSE;
						_data17_ = g_slice_new0 (Block17Data);
						_data17_->_ref_count_ = 1;
						_data17_->_data15_ = block15_data_ref (_data15_);
						_tmp101_ = _phone_index;
						_phone_index = _tmp101_ + 1;
						_tmp102_ = _phone_index;
						_tmp103_ = _phone_size;
						if (!(_tmp102_ < _tmp103_)) {
							block17_data_unref (_data17_);
							_data17_ = NULL;
							break;
						}
						_tmp104_ = _phone_list;
						_tmp105_ = _phone_index;
						_tmp106_ = gee_abstract_list_get ((GeeAbstractList*) _tmp104_, _tmp105_);
						_data17_->phone = (FolksPhoneFieldDetails*) _tmp106_;
						_tmp107_ = contacts_app_app;
						_tmp108_ = _tmp107_->contacts_store;
						_tmp109_ = contacts_store_get_can_call (_tmp108_);
						_tmp110_ = _tmp109_;
						if (_tmp110_) {
							GtkButton* button = NULL;
							ContactsTypeSet* _tmp111_ = NULL;
							ContactsTypeSet* _tmp112_ = NULL;
							FolksPhoneFieldDetails* _tmp113_ = NULL;
							gchar* _tmp114_ = NULL;
							gchar* _tmp115_ = NULL;
							FolksPhoneFieldDetails* _tmp116_ = NULL;
							gconstpointer _tmp117_ = NULL;
							const gchar* _tmp118_ = NULL;
							GtkButton* _tmp119_ = NULL;
							GtkButton* _tmp120_ = NULL;
							GtkButton* _tmp121_ = NULL;
							_tmp111_ = contacts_typeset_get_phone ();
							_tmp112_ = _tmp111_;
							_tmp113_ = _data17_->phone;
							_tmp114_ = contacts_typeset_format_type (_tmp112_, (FolksAbstractFieldDetails*) _tmp113_);
							_tmp115_ = _tmp114_;
							_tmp116_ = _data17_->phone;
							_tmp117_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp116_);
							_tmp118_ = _tmp117_;
							_tmp119_ = contacts_contact_sheet_add_row_with_button (self, &i, _tmp115_, (const gchar*) _tmp118_);
							_tmp120_ = _tmp119_;
							_g_free0 (_tmp115_);
							button = _tmp120_;
							_tmp121_ = button;
							g_signal_connect_data (_tmp121_, "clicked", (GCallback) _________lambda35__gtk_button_clicked, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
							_g_object_unref0 (button);
						} else {
							ContactsTypeSet* _tmp122_ = NULL;
							ContactsTypeSet* _tmp123_ = NULL;
							FolksPhoneFieldDetails* _tmp124_ = NULL;
							gchar* _tmp125_ = NULL;
							gchar* _tmp126_ = NULL;
							FolksPhoneFieldDetails* _tmp127_ = NULL;
							gconstpointer _tmp128_ = NULL;
							const gchar* _tmp129_ = NULL;
							_tmp122_ = contacts_typeset_get_phone ();
							_tmp123_ = _tmp122_;
							_tmp124_ = _data17_->phone;
							_tmp125_ = contacts_typeset_format_type (_tmp123_, (FolksAbstractFieldDetails*) _tmp124_);
							_tmp126_ = _tmp125_;
							_tmp127_ = _data17_->phone;
							_tmp128_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp127_);
							_tmp129_ = _tmp128_;
							contacts_contact_sheet_add_row_with_label (self, &i, _tmp126_, (const gchar*) _tmp129_);
							_g_free0 (_tmp126_);
						}
						block17_data_unref (_data17_);
						_data17_ = NULL;
					}
					_g_object_unref0 (_phone_list);
				}
				_g_object_unref0 (phones);
			}
			_tmp130_ = p;
			_tmp131_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp130_, FOLKS_TYPE_IM_DETAILS) ? ((FolksImDetails*) _tmp130_) : NULL);
			im_details = _tmp131_;
			_tmp132_ = im_details;
			if (_tmp132_ != NULL) {
				{
					GeeIterator* _protocol_it = NULL;
					FolksImDetails* _tmp133_ = NULL;
					GeeMultiMap* _tmp134_ = NULL;
					GeeMultiMap* _tmp135_ = NULL;
					GeeSet* _tmp136_ = NULL;
					GeeSet* _tmp137_ = NULL;
					GeeIterator* _tmp138_ = NULL;
					GeeIterator* _tmp139_ = NULL;
					_tmp133_ = im_details;
					_tmp134_ = folks_im_details_get_im_addresses (_tmp133_);
					_tmp135_ = _tmp134_;
					_tmp136_ = gee_multi_map_get_keys (_tmp135_);
					_tmp137_ = _tmp136_;
					_tmp138_ = gee_iterable_iterator ((GeeIterable*) _tmp137_);
					_tmp139_ = _tmp138_;
					_g_object_unref0 (_tmp137_);
					_protocol_it = _tmp139_;
					while (TRUE) {
						Block18Data* _data18_;
						GeeIterator* _tmp140_ = NULL;
						gboolean _tmp141_ = FALSE;
						GeeIterator* _tmp142_ = NULL;
						gpointer _tmp143_ = NULL;
						_data18_ = g_slice_new0 (Block18Data);
						_data18_->_ref_count_ = 1;
						_data18_->_data15_ = block15_data_ref (_data15_);
						_tmp140_ = _protocol_it;
						_tmp141_ = gee_iterator_next (_tmp140_);
						if (!_tmp141_) {
							block18_data_unref (_data18_);
							_data18_ = NULL;
							break;
						}
						_tmp142_ = _protocol_it;
						_tmp143_ = gee_iterator_get (_tmp142_);
						_data18_->protocol = (gchar*) _tmp143_;
						{
							GeeIterator* _id_it = NULL;
							FolksImDetails* _tmp144_ = NULL;
							GeeMultiMap* _tmp145_ = NULL;
							GeeMultiMap* _tmp146_ = NULL;
							const gchar* _tmp147_ = NULL;
							GeeCollection* _tmp148_ = NULL;
							GeeCollection* _tmp149_ = NULL;
							GeeIterator* _tmp150_ = NULL;
							GeeIterator* _tmp151_ = NULL;
							_tmp144_ = im_details;
							_tmp145_ = folks_im_details_get_im_addresses (_tmp144_);
							_tmp146_ = _tmp145_;
							_tmp147_ = _data18_->protocol;
							_tmp148_ = gee_multi_map_get (_tmp146_, _tmp147_);
							_tmp149_ = _tmp148_;
							_tmp150_ = gee_iterable_iterator ((GeeIterable*) _tmp149_);
							_tmp151_ = _tmp150_;
							_g_object_unref0 (_tmp149_);
							_id_it = _tmp151_;
							while (TRUE) {
								Block19Data* _data19_;
								GeeIterator* _tmp152_ = NULL;
								gboolean _tmp153_ = FALSE;
								GeeIterator* _tmp154_ = NULL;
								gpointer _tmp155_ = NULL;
								FolksPersona* _tmp156_ = NULL;
								_data19_ = g_slice_new0 (Block19Data);
								_data19_->_ref_count_ = 1;
								_data19_->_data18_ = block18_data_ref (_data18_);
								_tmp152_ = _id_it;
								_tmp153_ = gee_iterator_next (_tmp152_);
								if (!_tmp153_) {
									block19_data_unref (_data19_);
									_data19_ = NULL;
									break;
								}
								_tmp154_ = _id_it;
								_tmp155_ = gee_iterator_get (_tmp154_);
								_data19_->id = (FolksImFieldDetails*) _tmp155_;
								_tmp156_ = p;
								if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp156_, TPF_TYPE_PERSONA)) {
									GtkButton* button = NULL;
									const gchar* _tmp157_ = NULL;
									gchar* _tmp158_ = NULL;
									gchar* _tmp159_ = NULL;
									FolksImFieldDetails* _tmp160_ = NULL;
									gconstpointer _tmp161_ = NULL;
									const gchar* _tmp162_ = NULL;
									GtkButton* _tmp163_ = NULL;
									GtkButton* _tmp164_ = NULL;
									GtkButton* _tmp165_ = NULL;
									_tmp157_ = _data18_->protocol;
									_tmp158_ = contacts_contact_format_im_service (_tmp157_, NULL);
									_tmp159_ = _tmp158_;
									_tmp160_ = _data19_->id;
									_tmp161_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp160_);
									_tmp162_ = _tmp161_;
									_tmp163_ = contacts_contact_sheet_add_row_with_button (self, &i, _tmp159_, (const gchar*) _tmp162_);
									_tmp164_ = _tmp163_;
									_g_free0 (_tmp159_);
									button = _tmp164_;
									_tmp165_ = button;
									g_signal_connect_data (_tmp165_, "clicked", (GCallback) ___________lambda36__gtk_button_clicked, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
									_g_object_unref0 (button);
								}
								block19_data_unref (_data19_);
								_data19_ = NULL;
							}
							_g_object_unref0 (_id_it);
						}
						block18_data_unref (_data18_);
						_data18_ = NULL;
					}
					_g_object_unref0 (_protocol_it);
				}
			}
			_tmp166_ = p;
			_tmp167_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp166_, FOLKS_TYPE_URL_DETAILS) ? ((FolksUrlDetails*) _tmp166_) : NULL);
			url_details = _tmp167_;
			_tmp168_ = url_details;
			if (_tmp168_ != NULL) {
				{
					GeeIterator* _url_it = NULL;
					FolksUrlDetails* _tmp169_ = NULL;
					GeeSet* _tmp170_ = NULL;
					GeeSet* _tmp171_ = NULL;
					GeeIterator* _tmp172_ = NULL;
					_tmp169_ = url_details;
					_tmp170_ = folks_url_details_get_urls (_tmp169_);
					_tmp171_ = _tmp170_;
					_tmp172_ = gee_iterable_iterator ((GeeIterable*) _tmp171_);
					_url_it = _tmp172_;
					while (TRUE) {
						Block20Data* _data20_;
						GeeIterator* _tmp173_ = NULL;
						gboolean _tmp174_ = FALSE;
						GeeIterator* _tmp175_ = NULL;
						gpointer _tmp176_ = NULL;
						GtkButton* button = NULL;
						const gchar* _tmp177_ = NULL;
						FolksUrlFieldDetails* _tmp178_ = NULL;
						gchar* _tmp179_ = NULL;
						gchar* _tmp180_ = NULL;
						GtkButton* _tmp181_ = NULL;
						GtkButton* _tmp182_ = NULL;
						GtkButton* _tmp183_ = NULL;
						_data20_ = g_slice_new0 (Block20Data);
						_data20_->_ref_count_ = 1;
						_data20_->_data15_ = block15_data_ref (_data15_);
						_tmp173_ = _url_it;
						_tmp174_ = gee_iterator_next (_tmp173_);
						if (!_tmp174_) {
							block20_data_unref (_data20_);
							_data20_ = NULL;
							break;
						}
						_tmp175_ = _url_it;
						_tmp176_ = gee_iterator_get (_tmp175_);
						_data20_->url = (FolksUrlFieldDetails*) _tmp176_;
						_tmp177_ = _ ("Website");
						_tmp178_ = _data20_->url;
						_tmp179_ = contacts_contact_format_uri_link_text (_tmp178_);
						_tmp180_ = _tmp179_;
						_tmp181_ = contacts_contact_sheet_add_row_with_button (self, &i, _tmp177_, _tmp180_);
						_tmp182_ = _tmp181_;
						_g_free0 (_tmp180_);
						button = _tmp182_;
						_tmp183_ = button;
						g_signal_connect_data (_tmp183_, "clicked", (GCallback) ________lambda37__gtk_button_clicked, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
						_g_object_unref0 (button);
						block20_data_unref (_data20_);
						_data20_ = NULL;
					}
					_g_object_unref0 (_url_it);
				}
			}
			_tmp184_ = p;
			_tmp185_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp184_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _tmp184_) : NULL);
			name_details = _tmp185_;
			_tmp186_ = name_details;
			if (_tmp186_ != NULL) {
				FolksNameDetails* _tmp187_ = NULL;
				const gchar* _tmp188_ = NULL;
				const gchar* _tmp189_ = NULL;
				gboolean _tmp190_ = FALSE;
				_tmp187_ = name_details;
				_tmp188_ = folks_name_details_get_nickname (_tmp187_);
				_tmp189_ = _tmp188_;
				_tmp190_ = contacts_is_set (_tmp189_);
				if (_tmp190_) {
					const gchar* _tmp191_ = NULL;
					FolksNameDetails* _tmp192_ = NULL;
					const gchar* _tmp193_ = NULL;
					const gchar* _tmp194_ = NULL;
					_tmp191_ = _ ("Nickname");
					_tmp192_ = name_details;
					_tmp193_ = folks_name_details_get_nickname (_tmp192_);
					_tmp194_ = _tmp193_;
					contacts_contact_sheet_add_row_with_label (self, &i, _tmp191_, _tmp194_);
				}
			}
			_tmp195_ = p;
			_tmp196_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp195_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _tmp195_) : NULL);
			birthday_details = _tmp196_;
			_tmp197_ = birthday_details;
			if (_tmp197_ != NULL) {
				FolksBirthdayDetails* _tmp198_ = NULL;
				GDateTime* _tmp199_ = NULL;
				GDateTime* _tmp200_ = NULL;
				_tmp198_ = birthday_details;
				_tmp199_ = folks_birthday_details_get_birthday (_tmp198_);
				_tmp200_ = _tmp199_;
				if (_tmp200_ != NULL) {
					const gchar* _tmp201_ = NULL;
					FolksBirthdayDetails* _tmp202_ = NULL;
					GDateTime* _tmp203_ = NULL;
					GDateTime* _tmp204_ = NULL;
					GDateTime* _tmp205_ = NULL;
					GDateTime* _tmp206_ = NULL;
					gchar* _tmp207_ = NULL;
					gchar* _tmp208_ = NULL;
					_tmp201_ = _ ("Birthday");
					_tmp202_ = birthday_details;
					_tmp203_ = folks_birthday_details_get_birthday (_tmp202_);
					_tmp204_ = _tmp203_;
					_tmp205_ = g_date_time_to_local (_tmp204_);
					_tmp206_ = _tmp205_;
					_tmp207_ = g_date_time_format (_tmp206_, "%d %B");
					_tmp208_ = _tmp207_;
					contacts_contact_sheet_add_row_with_label (self, &i, _tmp201_, _tmp208_);
					_g_free0 (_tmp208_);
					_g_date_time_unref0 (_tmp206_);
				}
			}
			_tmp209_ = p;
			_tmp210_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp209_, FOLKS_TYPE_NOTE_DETAILS) ? ((FolksNoteDetails*) _tmp209_) : NULL);
			note_details = _tmp210_;
			_tmp211_ = note_details;
			if (_tmp211_ != NULL) {
				{
					GeeIterator* _note_it = NULL;
					FolksNoteDetails* _tmp212_ = NULL;
					GeeSet* _tmp213_ = NULL;
					GeeSet* _tmp214_ = NULL;
					GeeIterator* _tmp215_ = NULL;
					_tmp212_ = note_details;
					_tmp213_ = folks_note_details_get_notes (_tmp212_);
					_tmp214_ = _tmp213_;
					_tmp215_ = gee_iterable_iterator ((GeeIterable*) _tmp214_);
					_note_it = _tmp215_;
					while (TRUE) {
						GeeIterator* _tmp216_ = NULL;
						gboolean _tmp217_ = FALSE;
						FolksNoteFieldDetails* note = NULL;
						GeeIterator* _tmp218_ = NULL;
						gpointer _tmp219_ = NULL;
						const gchar* _tmp220_ = NULL;
						FolksNoteFieldDetails* _tmp221_ = NULL;
						gconstpointer _tmp222_ = NULL;
						const gchar* _tmp223_ = NULL;
						_tmp216_ = _note_it;
						_tmp217_ = gee_iterator_next (_tmp216_);
						if (!_tmp217_) {
							break;
						}
						_tmp218_ = _note_it;
						_tmp219_ = gee_iterator_get (_tmp218_);
						note = (FolksNoteFieldDetails*) _tmp219_;
						_tmp220_ = _ ("Note");
						_tmp221_ = note;
						_tmp222_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp221_);
						_tmp223_ = _tmp222_;
						contacts_contact_sheet_add_row_with_label (self, &i, _tmp220_, (const gchar*) _tmp223_);
						_g_object_unref0 (note);
					}
					_g_object_unref0 (_note_it);
				}
			}
			_tmp224_ = p;
			_tmp225_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp224_, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS) ? ((FolksPostalAddressDetails*) _tmp224_) : NULL);
			addr_details = _tmp225_;
			_tmp226_ = addr_details;
			if (_tmp226_ != NULL) {
				{
					GeeIterator* _addr_it = NULL;
					FolksPostalAddressDetails* _tmp227_ = NULL;
					GeeSet* _tmp228_ = NULL;
					GeeSet* _tmp229_ = NULL;
					GeeIterator* _tmp230_ = NULL;
					_tmp227_ = addr_details;
					_tmp228_ = folks_postal_address_details_get_postal_addresses (_tmp227_);
					_tmp229_ = _tmp228_;
					_tmp230_ = gee_iterable_iterator ((GeeIterable*) _tmp229_);
					_addr_it = _tmp230_;
					while (TRUE) {
						GeeIterator* _tmp231_ = NULL;
						gboolean _tmp232_ = FALSE;
						FolksPostalAddressFieldDetails* addr = NULL;
						GeeIterator* _tmp233_ = NULL;
						gpointer _tmp234_ = NULL;
						gchar** strs = NULL;
						FolksPostalAddressFieldDetails* _tmp235_ = NULL;
						gconstpointer _tmp236_ = NULL;
						FolksPostalAddress* _tmp237_ = NULL;
						gint _tmp238_ = 0;
						gchar** _tmp239_ = NULL;
						gint strs_length1 = 0;
						gint _strs_size_ = 0;
						gchar* all_strs = NULL;
						gchar* _tmp240_ = NULL;
						gchar** _tmp241_ = NULL;
						gint _tmp241__length1 = 0;
						ContactsTypeSet* _tmp248_ = NULL;
						ContactsTypeSet* _tmp249_ = NULL;
						FolksPostalAddressFieldDetails* _tmp250_ = NULL;
						gchar* _tmp251_ = NULL;
						gchar* _tmp252_ = NULL;
						const gchar* _tmp253_ = NULL;
						_tmp231_ = _addr_it;
						_tmp232_ = gee_iterator_next (_tmp231_);
						if (!_tmp232_) {
							break;
						}
						_tmp233_ = _addr_it;
						_tmp234_ = gee_iterator_get (_tmp233_);
						addr = (FolksPostalAddressFieldDetails*) _tmp234_;
						_tmp235_ = addr;
						_tmp236_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp235_);
						_tmp237_ = _tmp236_;
						_tmp239_ = contacts_contact_format_address ((FolksPostalAddress*) _tmp237_, &_tmp238_);
						strs = _tmp239_;
						strs_length1 = _tmp238_;
						_strs_size_ = strs_length1;
						_tmp240_ = g_strdup ("");
						all_strs = _tmp240_;
						_tmp241_ = strs;
						_tmp241__length1 = strs_length1;
						{
							gchar** s_collection = NULL;
							gint s_collection_length1 = 0;
							gint _s_collection_size_ = 0;
							gint s_it = 0;
							s_collection = _tmp241_;
							s_collection_length1 = _tmp241__length1;
							for (s_it = 0; s_it < _tmp241__length1; s_it = s_it + 1) {
								gchar* _tmp242_ = NULL;
								gchar* s = NULL;
								_tmp242_ = g_strdup (s_collection[s_it]);
								s = _tmp242_;
								{
									const gchar* _tmp243_ = NULL;
									const gchar* _tmp244_ = NULL;
									gchar* _tmp245_ = NULL;
									gchar* _tmp246_ = NULL;
									gchar* _tmp247_ = NULL;
									_tmp243_ = all_strs;
									_tmp244_ = s;
									_tmp245_ = g_strconcat (_tmp244_, "\n", NULL);
									_tmp246_ = _tmp245_;
									_tmp247_ = g_strconcat (_tmp243_, _tmp246_, NULL);
									_g_free0 (all_strs);
									all_strs = _tmp247_;
									_g_free0 (_tmp246_);
									_g_free0 (s);
								}
							}
						}
						_tmp248_ = contacts_typeset_get_general ();
						_tmp249_ = _tmp248_;
						_tmp250_ = addr;
						_tmp251_ = contacts_typeset_format_type (_tmp249_, (FolksAbstractFieldDetails*) _tmp250_);
						_tmp252_ = _tmp251_;
						_tmp253_ = all_strs;
						contacts_contact_sheet_add_row_with_label (self, &i, _tmp252_, _tmp253_);
						_g_free0 (_tmp252_);
						_g_free0 (all_strs);
						strs = (_vala_array_free (strs, strs_length1, (GDestroyNotify) g_free), NULL);
						_g_object_unref0 (addr);
					}
					_g_object_unref0 (_addr_it);
				}
			}
			_tmp254_ = i;
			if (_tmp254_ != 3) {
				is_first_persona = FALSE;
			}
			_tmp255_ = i;
			_tmp256_ = last_store_position;
			if (_tmp255_ == _tmp256_) {
				gint _tmp257_ = 0;
				GtkWidget* _tmp258_ = NULL;
				_tmp257_ = i;
				_tmp258_ = gtk_grid_get_child_at ((GtkGrid*) self, 0, _tmp257_ - 1);
				gtk_widget_destroy (_tmp258_);
			}
			_g_object_unref0 (addr_details);
			_g_object_unref0 (note_details);
			_g_object_unref0 (birthday_details);
			_g_object_unref0 (name_details);
			_g_object_unref0 (url_details);
			_g_object_unref0 (im_details);
			_g_object_unref0 (phone_details);
			_g_object_unref0 (details);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_list);
	}
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (personas);
	_g_object_unref0 (merged_presence);
	_g_object_unref0 (name_label);
	_g_object_unref0 (image_frame);
	block15_data_unref (_data15_);
	_data15_ = NULL;
}


void contacts_contact_sheet_clear (ContactsContactSheet* self) {
	GList* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp0_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* w = NULL;
			w = (GtkWidget*) w_it->data;
			{
				GtkWidget* _tmp1_ = NULL;
				_tmp1_ = w;
				gtk_widget_destroy (_tmp1_);
			}
		}
		_g_list_free0 (w_collection);
	}
}


static void contacts_contact_sheet_class_init (ContactsContactSheetClass * klass) {
	contacts_contact_sheet_parent_class = g_type_class_peek_parent (klass);
}


static void contacts_contact_sheet_instance_init (ContactsContactSheet * self) {
}


GType contacts_contact_sheet_get_type (void) {
	static volatile gsize contacts_contact_sheet_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_sheet_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsContactSheetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_contact_sheet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsContactSheet), 0, (GInstanceInitFunc) contacts_contact_sheet_instance_init, NULL };
		GType contacts_contact_sheet_type_id;
		contacts_contact_sheet_type_id = g_type_register_static (GTK_TYPE_GRID, "ContactsContactSheet", &g_define_type_info, 0);
		g_once_init_leave (&contacts_contact_sheet_type_id__volatile, contacts_contact_sheet_type_id);
	}
	return contacts_contact_sheet_type_id__volatile;
}


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


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



