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

/*
 * Copyright © 2025 Alain M. (https://github.com/alainm23/planify)
 *
 * 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 3 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, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <glib.h>
#include <adwaita.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.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

enum  {
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_0_PROPERTY,
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_IS_CREATING_PROPERTY,
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_SUGGESTIONS_VIEW_PROPERTY,
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_HAS_REMINDERS_PROPERTY,
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_NUM_PROPERTIES
};
static GParamSpec* widgets_reminder_picker_reminder_picker_properties[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block44Data Block44Data;
enum  {
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_REMINDER_ADDED_SIGNAL,
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_REMINDER_DELETED_SIGNAL,
	WIDGETS_REMINDER_PICKER_REMINDER_PICKER_NUM_SIGNALS
};
static guint widgets_reminder_picker_reminder_picker_signals[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_NUM_SIGNALS] = {0};

struct _WidgetsReminderPickerReminderPickerPrivate {
	gboolean _is_creating;
	LayoutsHeaderItem* reminders_view;
	WidgetsCalendarCalendar* calendar;
	WidgetsDateTimePickerTimePicker* time_picker;
	AdwNavigationView* navigation_view;
	WidgetsLoadingButton* submit_button;
	GeeHashMap* reminders_map;
	GeeHashMap* pages_map;
	GeeHashMap* signal_map;
};

struct _Block44Data {
	int _ref_count_;
	WidgetsReminderPickerReminderPicker* self;
	ObjectsReminder* reminder;
};

static gint WidgetsReminderPickerReminderPicker_private_offset;
static gpointer widgets_reminder_picker_reminder_picker_parent_class = NULL;

static AdwNavigationPage* widgets_reminder_picker_reminder_picker_build_page (WidgetsReminderPickerReminderPicker* self,
                                                                       const gchar* page);
static AdwNavigationPage* widgets_reminder_picker_reminder_picker_build_main_page (WidgetsReminderPickerReminderPicker* self);
static AdwNavigationPage* widgets_reminder_picker_reminder_picker_build_picker_page (WidgetsReminderPickerReminderPicker* self);
static AdwNavigationPage* widgets_reminder_picker_reminder_picker_build_suggestions_page (WidgetsReminderPickerReminderPicker* self);
static void __lambda240_ (WidgetsReminderPickerReminderPicker* self);
static void ___lambda240__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void widgets_reminder_picker_reminder_picker_insert_reminder (WidgetsReminderPickerReminderPicker* self);
static void _widgets_reminder_picker_reminder_picker_insert_reminder_gtk_button_clicked (GtkButton* _sender,
                                                                                  gpointer self);
static void _widgets_reminder_picker_reminder_picker_insert_reminder_widgets_date_time_picker_time_picker_activated (WidgetsDateTimePickerTimePicker* _sender,
                                                                                                              gpointer self);
static void __lambda241_ (WidgetsReminderPickerReminderPicker* self);
static void _widgets_reminder_picker_reminder_picker_insert_reminder (WidgetsReminderPickerReminderPicker* self,
                                                               GDateTime* date,
                                                               GDateTime* time,
                                                               gboolean is_suggestion);
static void ___lambda241__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda242_ (WidgetsReminderPickerReminderPicker* self);
static void ___lambda242__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda243_ (WidgetsReminderPickerReminderPicker* self);
static void ___lambda243__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda244_ (WidgetsReminderPickerReminderPicker* self);
static void ___lambda244__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda245_ (WidgetsReminderPickerReminderPicker* self);
static void ___lambda245__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda246_ (WidgetsReminderPickerReminderPicker* self);
static void ___lambda246__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static Block44Data* block44_data_ref (Block44Data* _data44_);
static void block44_data_unref (void * _userdata_);
static void ___lambda247_ (Block44Data* _data44_);
static void ____lambda247__widgets_reminder_picker_reminder_row_deleted (WidgetsReminderPickerReminderRow* _sender,
                                                                  gpointer self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static GObject * widgets_reminder_picker_reminder_picker_constructor (GType type,
                                                               guint n_construct_properties,
                                                               GObjectConstructParam * construct_properties);
static void _widgets_reminder_picker_reminder_picker___lambda248_ (WidgetsReminderPickerReminderPicker* self);
static void __widgets_reminder_picker_reminder_picker___lambda248__gtk_popover_closed (GtkPopover* _sender,
                                                                                gpointer self);
static void widgets_reminder_picker_reminder_picker_finalize (GObject * obj);
static GType widgets_reminder_picker_reminder_picker_get_type_once (void);
static void _vala_widgets_reminder_picker_reminder_picker_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec);
static void _vala_widgets_reminder_picker_reminder_picker_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
widgets_reminder_picker_reminder_picker_get_instance_private (WidgetsReminderPickerReminderPicker* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsReminderPickerReminderPicker_private_offset);
}

WidgetsReminderPickerReminderPicker*
widgets_reminder_picker_reminder_picker_construct (GType object_type,
                                                   gboolean is_creating)
{
	WidgetsReminderPickerReminderPicker * self = NULL;
	self = (WidgetsReminderPickerReminderPicker*) g_object_new (object_type, "has-arrow", FALSE, "is-creating", is_creating, "position", GTK_POS_BOTTOM, "width-request", 275, NULL);
	return self;
}

WidgetsReminderPickerReminderPicker*
widgets_reminder_picker_reminder_picker_new (gboolean is_creating)
{
	return widgets_reminder_picker_reminder_picker_construct (WIDGETS_REMINDER_PICKER_TYPE_REMINDER_PICKER, is_creating);
}

static AdwNavigationPage*
widgets_reminder_picker_reminder_picker_build_page (WidgetsReminderPickerReminderPicker* self,
                                                    const gchar* page)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp12_;
	gpointer _tmp13_;
	AdwNavigationPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (page != NULL, NULL);
	_tmp0_ = self->priv->pages_map;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, page)) {
		GeeHashMap* _tmp1_;
		gpointer _tmp2_;
		_tmp1_ = self->priv->pages_map;
		_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, page);
		result = (AdwNavigationPage*) _tmp2_;
		return result;
	}
	if (g_strcmp0 (page, "main") == 0) {
		GeeHashMap* _tmp3_;
		AdwNavigationPage* _tmp4_;
		AdwNavigationPage* _tmp5_;
		_tmp3_ = self->priv->pages_map;
		_tmp4_ = widgets_reminder_picker_reminder_picker_build_main_page (self);
		_tmp5_ = _tmp4_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, page, _tmp5_);
		_g_object_unref0 (_tmp5_);
	} else {
		if (g_strcmp0 (page, "picker") == 0) {
			GeeHashMap* _tmp6_;
			AdwNavigationPage* _tmp7_;
			AdwNavigationPage* _tmp8_;
			_tmp6_ = self->priv->pages_map;
			_tmp7_ = widgets_reminder_picker_reminder_picker_build_picker_page (self);
			_tmp8_ = _tmp7_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, page, _tmp8_);
			_g_object_unref0 (_tmp8_);
		} else {
			if (g_strcmp0 (page, "suggestions") == 0) {
				GeeHashMap* _tmp9_;
				AdwNavigationPage* _tmp10_;
				AdwNavigationPage* _tmp11_;
				_tmp9_ = self->priv->pages_map;
				_tmp10_ = widgets_reminder_picker_reminder_picker_build_suggestions_page (self);
				_tmp11_ = _tmp10_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, page, _tmp11_);
				_g_object_unref0 (_tmp11_);
			}
		}
	}
	_tmp12_ = self->priv->pages_map;
	_tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, page);
	result = (AdwNavigationPage*) _tmp13_;
	return result;
}

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

static void
__lambda240_ (WidgetsReminderPickerReminderPicker* self)
{
	WidgetsCalendarCalendar* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	WidgetsDateTimePickerTimePicker* _tmp3_;
	GDateTime* _tmp4_;
	GDateTime* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	AdwNavigationView* _tmp8_;
	AdwNavigationPage* _tmp9_;
	AdwNavigationPage* _tmp10_;
	_tmp0_ = self->priv->calendar;
	_tmp1_ = g_date_time_new_now_local ();
	_tmp2_ = _tmp1_;
	widgets_calendar_calendar_set_date (_tmp0_, _tmp2_);
	_g_date_time_unref0 (_tmp2_);
	_tmp3_ = self->priv->time_picker;
	_tmp4_ = g_date_time_new_now_local ();
	_tmp5_ = _tmp4_;
	_tmp6_ = g_date_time_add_hours (_tmp5_, 1);
	_tmp7_ = _tmp6_;
	widgets_date_time_picker_time_picker_set_time (_tmp3_, _tmp7_);
	_g_date_time_unref0 (_tmp7_);
	_g_date_time_unref0 (_tmp5_);
	_tmp8_ = self->priv->navigation_view;
	_tmp9_ = widgets_reminder_picker_reminder_picker_build_page (self, "picker");
	_tmp10_ = _tmp9_;
	adw_navigation_view_push (_tmp8_, _tmp10_);
	_g_object_unref0 (_tmp10_);
}

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

static AdwNavigationPage*
widgets_reminder_picker_reminder_picker_build_main_page (WidgetsReminderPickerReminderPicker* self)
{
	LayoutsHeaderItem* _tmp0_;
	LayoutsHeaderItem* _tmp1_;
	LayoutsHeaderItem* _tmp2_;
	GtkButton* add_button = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkButton* _tmp6_ = NULL;
	LayoutsHeaderItem* _tmp7_;
	GtkScrolledWindow* scrolled_window = NULL;
	LayoutsHeaderItem* _tmp8_;
	GtkWidget* _tmp9_;
	GtkScrolledWindow* _tmp10_ = NULL;
	GeeHashMap* _tmp11_;
	gulong _tmp12_;
	AdwNavigationPage* _tmp13_;
	AdwNavigationPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = layouts_header_item_new (_ ("Reminders"));
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->reminders_view);
	self->priv->reminders_view = _tmp0_;
	_tmp1_ = self->priv->reminders_view;
	layouts_header_item_set_reveal_child (_tmp1_, TRUE);
	_tmp2_ = self->priv->reminders_view;
	layouts_header_item_set_placeholder_message (_tmp2_, _ ("Your list of reminders will show up here. Add one by clicking the '+' " \
"button."));
	_tmp3_ = g_strdup ("flat");
	_tmp4_ = g_strdup ("header-item-button");
	_tmp5_ = g_new0 (gchar*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = (GtkButton*) gtk_button_new_from_icon_name ("plus-large-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp6_, GTK_ALIGN_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp6_);
	add_button = _tmp6_;
	_tmp7_ = self->priv->reminders_view;
	layouts_header_item_add_widget_end (_tmp7_, (GtkWidget*) add_button);
	_tmp8_ = self->priv->reminders_view;
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _tmp8_);
	_tmp10_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp10_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp10_, TRUE);
	g_object_set (_tmp10_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (_tmp10_, "vscrollbar-policy", GTK_POLICY_NEVER, NULL);
	gtk_scrolled_window_set_child (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	g_object_ref_sink (_tmp10_);
	scrolled_window = _tmp10_;
	_tmp11_ = self->priv->signal_map;
	_tmp12_ = g_signal_connect_object (add_button, "clicked", (GCallback) ___lambda240__gtk_button_clicked, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp11_, (gpointer) ((guintptr) _tmp12_), (GObject*) add_button);
	_tmp13_ = adw_navigation_page_new ((GtkWidget*) scrolled_window, "listbox");
	g_object_ref_sink (_tmp13_);
	result = _tmp13_;
	_g_object_unref0 (scrolled_window);
	_g_object_unref0 (add_button);
	return result;
}

static void
_widgets_reminder_picker_reminder_picker_insert_reminder_gtk_button_clicked (GtkButton* _sender,
                                                                             gpointer self)
{
	widgets_reminder_picker_reminder_picker_insert_reminder ((WidgetsReminderPickerReminderPicker*) self);
}

static void
_widgets_reminder_picker_reminder_picker_insert_reminder_widgets_date_time_picker_time_picker_activated (WidgetsDateTimePickerTimePicker* _sender,
                                                                                                         gpointer self)
{
	widgets_reminder_picker_reminder_picker_insert_reminder ((WidgetsReminderPickerReminderPicker*) self);
}

static AdwNavigationPage*
widgets_reminder_picker_reminder_picker_build_picker_page (WidgetsReminderPickerReminderPicker* self)
{
	GtkImage* time_icon = NULL;
	GtkImage* _tmp0_;
	GtkLabel* time_label = NULL;
	gchar* _tmp1_;
	gchar** _tmp2_;
	GtkLabel* _tmp3_ = NULL;
	GtkBox* time_box = NULL;
	GtkBox* _tmp4_ = NULL;
	WidgetsDateTimePickerTimePicker* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	WidgetsLoadingButton* _tmp8_ = NULL;
	GtkBox* main_box = NULL;
	GtkBox* _tmp9_;
	WidgetsCalendarCalendar* _tmp10_;
	GtkSeparator* _tmp11_ = NULL;
	GtkSeparator* _tmp12_;
	WidgetsLoadingButton* _tmp13_;
	AdwToolbarView* toolbar_view = NULL;
	GtkWidget* _tmp14_;
	AdwToolbarView* _tmp15_ = NULL;
	AdwHeaderBar* _tmp16_ = NULL;
	AdwHeaderBar* _tmp17_;
	GeeHashMap* _tmp18_;
	WidgetsLoadingButton* _tmp19_;
	gulong _tmp20_;
	WidgetsLoadingButton* _tmp21_;
	GeeHashMap* _tmp22_;
	WidgetsDateTimePickerTimePicker* _tmp23_;
	gulong _tmp24_;
	WidgetsDateTimePickerTimePicker* _tmp25_;
	AdwNavigationPage* _tmp26_;
	AdwNavigationPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkImage*) gtk_image_new_from_icon_name ("clock-symbolic");
	g_object_ref_sink (_tmp0_);
	time_icon = _tmp0_;
	_tmp1_ = g_strdup ("font-weight-500");
	_tmp2_ = g_new0 (gchar*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = (GtkLabel*) gtk_label_new (_ ("Time"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp3_, _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp3_);
	time_label = _tmp3_;
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp4_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp4_, 12);
	g_object_ref_sink (_tmp4_);
	time_box = _tmp4_;
	gtk_box_append (time_box, (GtkWidget*) time_icon);
	gtk_box_append (time_box, (GtkWidget*) time_label);
	_tmp5_ = self->priv->time_picker;
	gtk_box_append (time_box, (GtkWidget*) _tmp5_);
	_tmp6_ = g_strdup ("suggested-action");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = widgets_loading_button_new (LOADING_BUTTON_TYPE_LABEL, _ ("Add Reminder"));
	gtk_widget_set_margin_top ((GtkWidget*) _tmp8_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp8_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp8_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp8_, 6);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp8_, _tmp7_);
	_tmp7_ = (_vala_array_free (_tmp7_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->submit_button);
	self->priv->submit_button = _tmp8_;
	_tmp9_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp9_);
	main_box = _tmp9_;
	_tmp10_ = self->priv->calendar;
	gtk_box_append (main_box, (GtkWidget*) _tmp10_);
	_tmp11_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_VERTICAL);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp11_, 9);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp11_, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp11_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp11_, 6);
	g_object_ref_sink (_tmp11_);
	_tmp12_ = _tmp11_;
	gtk_box_append (main_box, (GtkWidget*) _tmp12_);
	_g_object_unref0 (_tmp12_);
	gtk_box_append (main_box, (GtkWidget*) time_box);
	_tmp13_ = self->priv->submit_button;
	gtk_box_append (main_box, (GtkWidget*) _tmp13_);
	_tmp14_ = _g_object_ref0 ((GtkWidget*) main_box);
	_tmp15_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp15_, _tmp14_);
	_g_object_unref0 (_tmp14_);
	g_object_ref_sink (_tmp15_);
	toolbar_view = _tmp15_;
	_tmp16_ = (AdwHeaderBar*) adw_header_bar_new ();
	adw_header_bar_set_show_title (_tmp16_, FALSE);
	adw_header_bar_set_show_end_title_buttons (_tmp16_, FALSE);
	g_object_ref_sink (_tmp16_);
	_tmp17_ = _tmp16_;
	adw_toolbar_view_add_top_bar (toolbar_view, (GtkWidget*) _tmp17_);
	_g_object_unref0 (_tmp17_);
	_tmp18_ = self->priv->signal_map;
	_tmp19_ = self->priv->submit_button;
	_tmp20_ = g_signal_connect_object ((GtkButton*) _tmp19_, "clicked", (GCallback) _widgets_reminder_picker_reminder_picker_insert_reminder_gtk_button_clicked, self, 0);
	_tmp21_ = self->priv->submit_button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp18_, (gpointer) ((guintptr) _tmp20_), (GObject*) _tmp21_);
	_tmp22_ = self->priv->signal_map;
	_tmp23_ = self->priv->time_picker;
	_tmp24_ = g_signal_connect_object (_tmp23_, "activated", (GCallback) _widgets_reminder_picker_reminder_picker_insert_reminder_widgets_date_time_picker_time_picker_activated, self, 0);
	_tmp25_ = self->priv->time_picker;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp22_, (gpointer) ((guintptr) _tmp24_), (GObject*) _tmp25_);
	_tmp26_ = adw_navigation_page_new ((GtkWidget*) toolbar_view, "picker");
	g_object_ref_sink (_tmp26_);
	result = _tmp26_;
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (main_box);
	_g_object_unref0 (time_box);
	_g_object_unref0 (time_label);
	_g_object_unref0 (time_icon);
	return result;
}

static void
__lambda241_ (WidgetsReminderPickerReminderPicker* self)
{
	GDateTime* datetime = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_add_minutes (_tmp1_, 5);
	_tmp3_ = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	datetime = _tmp3_;
	_widgets_reminder_picker_reminder_picker_insert_reminder (self, datetime, datetime, TRUE);
	_g_date_time_unref0 (datetime);
}

static void
___lambda241__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda241_ ((WidgetsReminderPickerReminderPicker*) self);
}

static void
__lambda242_ (WidgetsReminderPickerReminderPicker* self)
{
	GDateTime* datetime = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_add_minutes (_tmp1_, 15);
	_tmp3_ = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	datetime = _tmp3_;
	_widgets_reminder_picker_reminder_picker_insert_reminder (self, datetime, datetime, TRUE);
	_g_date_time_unref0 (datetime);
}

static void
___lambda242__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda242_ ((WidgetsReminderPickerReminderPicker*) self);
}

static void
__lambda243_ (WidgetsReminderPickerReminderPicker* self)
{
	GDateTime* datetime = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_add_minutes (_tmp1_, 30);
	_tmp3_ = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	datetime = _tmp3_;
	_widgets_reminder_picker_reminder_picker_insert_reminder (self, datetime, datetime, TRUE);
	_g_date_time_unref0 (datetime);
}

static void
___lambda243__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda243_ ((WidgetsReminderPickerReminderPicker*) self);
}

static void
__lambda244_ (WidgetsReminderPickerReminderPicker* self)
{
	GDateTime* datetime = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_add_hours (_tmp1_, 1);
	_tmp3_ = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	datetime = _tmp3_;
	_widgets_reminder_picker_reminder_picker_insert_reminder (self, datetime, datetime, TRUE);
	_g_date_time_unref0 (datetime);
}

static void
___lambda244__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda244_ ((WidgetsReminderPickerReminderPicker*) self);
}

static void
__lambda245_ (WidgetsReminderPickerReminderPicker* self)
{
	GDateTime* datetime = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_add_hours (_tmp1_, 3);
	_tmp3_ = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	datetime = _tmp3_;
	_widgets_reminder_picker_reminder_picker_insert_reminder (self, datetime, datetime, TRUE);
	_g_date_time_unref0 (datetime);
}

static void
___lambda245__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda245_ ((WidgetsReminderPickerReminderPicker*) self);
}

static void
__lambda246_ (WidgetsReminderPickerReminderPicker* self)
{
	GDateTime* datetime = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_add_hours (_tmp1_, 6);
	_tmp3_ = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	datetime = _tmp3_;
	_widgets_reminder_picker_reminder_picker_insert_reminder (self, datetime, datetime, TRUE);
	_g_date_time_unref0 (datetime);
}

static void
___lambda246__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda246_ ((WidgetsReminderPickerReminderPicker*) self);
}

static AdwNavigationPage*
widgets_reminder_picker_reminder_picker_build_suggestions_page (WidgetsReminderPickerReminderPicker* self)
{
	WidgetsContextMenuMenuItem* _5_m_item_ = NULL;
	WidgetsContextMenuMenuItem* _tmp0_;
	WidgetsContextMenuMenuItem* _15_m_item_ = NULL;
	WidgetsContextMenuMenuItem* _tmp1_;
	WidgetsContextMenuMenuItem* _30_m_item_ = NULL;
	WidgetsContextMenuMenuItem* _tmp2_;
	WidgetsContextMenuMenuItem* _1_h_item_ = NULL;
	WidgetsContextMenuMenuItem* _tmp3_;
	WidgetsContextMenuMenuItem* _3_h_item_ = NULL;
	WidgetsContextMenuMenuItem* _tmp4_;
	WidgetsContextMenuMenuItem* _6_h_item_ = NULL;
	WidgetsContextMenuMenuItem* _tmp5_;
	GtkBox* menu_box = NULL;
	GtkBox* _tmp6_;
	GeeHashMap* _tmp7_;
	gulong _tmp8_;
	GeeHashMap* _tmp9_;
	gulong _tmp10_;
	GeeHashMap* _tmp11_;
	gulong _tmp12_;
	GeeHashMap* _tmp13_;
	gulong _tmp14_;
	GeeHashMap* _tmp15_;
	gulong _tmp16_;
	GeeHashMap* _tmp17_;
	gulong _tmp18_;
	AdwNavigationPage* _tmp19_;
	AdwNavigationPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = widgets_context_menu_menu_item_new (_ ("In 5 minutes"), "delay-symbolic");
	g_object_ref_sink (_tmp0_);
	_5_m_item_ = _tmp0_;
	_tmp1_ = widgets_context_menu_menu_item_new (_ ("In 15 minutes"), "delay-symbolic");
	g_object_ref_sink (_tmp1_);
	_15_m_item_ = _tmp1_;
	_tmp2_ = widgets_context_menu_menu_item_new (_ ("In 30 minutes"), "delay-symbolic");
	g_object_ref_sink (_tmp2_);
	_30_m_item_ = _tmp2_;
	_tmp3_ = widgets_context_menu_menu_item_new (_ ("In 1 hour"), "delay-symbolic");
	g_object_ref_sink (_tmp3_);
	_1_h_item_ = _tmp3_;
	_tmp4_ = widgets_context_menu_menu_item_new (_ ("In 3 hours"), "delay-symbolic");
	g_object_ref_sink (_tmp4_);
	_3_h_item_ = _tmp4_;
	_tmp5_ = widgets_context_menu_menu_item_new (_ ("In 6 hours"), "delay-symbolic");
	g_object_ref_sink (_tmp5_);
	_6_h_item_ = _tmp5_;
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp6_);
	menu_box = _tmp6_;
	gtk_widget_set_margin_bottom ((GtkWidget*) menu_box, 3);
	gtk_widget_set_margin_top ((GtkWidget*) menu_box, 3);
	gtk_box_append (menu_box, (GtkWidget*) _5_m_item_);
	gtk_box_append (menu_box, (GtkWidget*) _15_m_item_);
	gtk_box_append (menu_box, (GtkWidget*) _30_m_item_);
	gtk_box_append (menu_box, (GtkWidget*) _1_h_item_);
	gtk_box_append (menu_box, (GtkWidget*) _3_h_item_);
	gtk_box_append (menu_box, (GtkWidget*) _6_h_item_);
	_tmp7_ = self->priv->signal_map;
	_tmp8_ = g_signal_connect_object ((GtkButton*) _5_m_item_, "clicked", (GCallback) ___lambda241__gtk_button_clicked, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp7_, (gpointer) ((guintptr) _tmp8_), (GObject*) _5_m_item_);
	_tmp9_ = self->priv->signal_map;
	_tmp10_ = g_signal_connect_object ((GtkButton*) _15_m_item_, "clicked", (GCallback) ___lambda242__gtk_button_clicked, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, (gpointer) ((guintptr) _tmp10_), (GObject*) _15_m_item_);
	_tmp11_ = self->priv->signal_map;
	_tmp12_ = g_signal_connect_object ((GtkButton*) _30_m_item_, "clicked", (GCallback) ___lambda243__gtk_button_clicked, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp11_, (gpointer) ((guintptr) _tmp12_), (GObject*) _30_m_item_);
	_tmp13_ = self->priv->signal_map;
	_tmp14_ = g_signal_connect_object ((GtkButton*) _1_h_item_, "clicked", (GCallback) ___lambda244__gtk_button_clicked, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, (gpointer) ((guintptr) _tmp14_), (GObject*) _1_h_item_);
	_tmp15_ = self->priv->signal_map;
	_tmp16_ = g_signal_connect_object ((GtkButton*) _3_h_item_, "clicked", (GCallback) ___lambda245__gtk_button_clicked, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp15_, (gpointer) ((guintptr) _tmp16_), (GObject*) _3_h_item_);
	_tmp17_ = self->priv->signal_map;
	_tmp18_ = g_signal_connect_object ((GtkButton*) _6_h_item_, "clicked", (GCallback) ___lambda246__gtk_button_clicked, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, (gpointer) ((guintptr) _tmp18_), (GObject*) _6_h_item_);
	_tmp19_ = adw_navigation_page_new ((GtkWidget*) menu_box, "suggestions");
	g_object_ref_sink (_tmp19_);
	result = _tmp19_;
	_g_object_unref0 (menu_box);
	_g_object_unref0 (_6_h_item_);
	_g_object_unref0 (_3_h_item_);
	_g_object_unref0 (_1_h_item_);
	_g_object_unref0 (_30_m_item_);
	_g_object_unref0 (_15_m_item_);
	_g_object_unref0 (_5_m_item_);
	return result;
}

static void
widgets_reminder_picker_reminder_picker_insert_reminder (WidgetsReminderPickerReminderPicker* self)
{
	gboolean _tmp0_ = FALSE;
	WidgetsCalendarCalendar* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	WidgetsCalendarCalendar* _tmp7_;
	GDateTime* _tmp8_;
	GDateTime* _tmp9_;
	WidgetsDateTimePickerTimePicker* _tmp10_;
	GDateTime* _tmp11_;
	GDateTime* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->calendar;
	_tmp2_ = widgets_calendar_calendar_get_date (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		WidgetsDateTimePickerTimePicker* _tmp4_;
		GDateTime* _tmp5_;
		GDateTime* _tmp6_;
		_tmp4_ = self->priv->time_picker;
		_tmp5_ = widgets_date_time_picker_time_picker_get_time (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp7_ = self->priv->calendar;
	_tmp8_ = widgets_calendar_calendar_get_date (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = self->priv->time_picker;
	_tmp11_ = widgets_date_time_picker_time_picker_get_time (_tmp10_);
	_tmp12_ = _tmp11_;
	_widgets_reminder_picker_reminder_picker_insert_reminder (self, _tmp9_, _tmp12_, FALSE);
}

static void
_widgets_reminder_picker_reminder_picker_insert_reminder (WidgetsReminderPickerReminderPicker* self,
                                                          GDateTime* date,
                                                          GDateTime* time,
                                                          gboolean is_suggestion)
{
	ObjectsReminder* reminder = NULL;
	ObjectsReminder* _tmp0_;
	ObjectsReminder* _tmp1_;
	ObjectsDueDate* _tmp2_;
	ObjectsDueDate* _tmp3_;
	GDateTime* _tmp4_;
	GDateTime* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	ObjectsReminder* _tmp8_;
	AdwNavigationView* _tmp9_;
	WidgetsLoadingButton* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (date != NULL);
	g_return_if_fail (time != NULL);
	_tmp0_ = objects_reminder_new ();
	reminder = _tmp0_;
	_tmp1_ = reminder;
	_tmp2_ = objects_reminder_get_due (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = utils_datetime_get_datetime_no_seconds (date, time);
	_tmp5_ = _tmp4_;
	_tmp6_ = utils_datetime_get_todoist_datetime_format (_tmp5_);
	_tmp7_ = _tmp6_;
	objects_due_date_set_date (_tmp3_, _tmp7_);
	_g_free0 (_tmp7_);
	_g_date_time_unref0 (_tmp5_);
	_tmp8_ = reminder;
	g_signal_emit (self, widgets_reminder_picker_reminder_picker_signals[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_REMINDER_ADDED_SIGNAL], 0, _tmp8_);
	if (is_suggestion) {
		gtk_popover_popdown ((GtkPopover*) self);
		_g_object_unref0 (reminder);
		return;
	}
	_tmp9_ = self->priv->navigation_view;
	adw_navigation_view_pop (_tmp9_);
	_tmp10_ = self->priv->submit_button;
	widgets_loading_button_set_is_loading (_tmp10_, FALSE);
	_g_object_unref0 (reminder);
}

void
widgets_reminder_picker_reminder_picker_set_reminders (WidgetsReminderPickerReminderPicker* self,
                                                       GeeArrayList* reminders)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (reminders != NULL);
	widgets_reminder_picker_reminder_picker_clear (self);
	{
		GeeArrayList* _reminder_list = NULL;
		gint _reminder_size = 0;
		GeeArrayList* _tmp0_;
		gint _tmp1_;
		gint _tmp2_;
		gint _reminder_index = 0;
		_reminder_list = reminders;
		_tmp0_ = _reminder_list;
		_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp0_);
		_tmp2_ = _tmp1_;
		_reminder_size = _tmp2_;
		_reminder_index = -1;
		while (TRUE) {
			gint _tmp3_;
			gint _tmp4_;
			ObjectsReminder* reminder = NULL;
			GeeArrayList* _tmp5_;
			gpointer _tmp6_;
			ObjectsReminder* _tmp7_;
			_reminder_index = _reminder_index + 1;
			_tmp3_ = _reminder_index;
			_tmp4_ = _reminder_size;
			if (!(_tmp3_ < _tmp4_)) {
				break;
			}
			_tmp5_ = _reminder_list;
			_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _tmp5_, _reminder_index);
			reminder = (ObjectsReminder*) _tmp6_;
			_tmp7_ = reminder;
			widgets_reminder_picker_reminder_picker_add_reminder (self, _tmp7_);
			_g_object_unref0 (reminder);
		}
	}
}

void
widgets_reminder_picker_reminder_picker_clear (WidgetsReminderPickerReminderPicker* self)
{
	LayoutsHeaderItem* _tmp0_;
	GeeHashMap* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->reminders_view;
	layouts_header_item_clear (_tmp0_);
	_tmp1_ = self->priv->reminders_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp1_);
}

static Block44Data*
block44_data_ref (Block44Data* _data44_)
{
	g_atomic_int_inc (&_data44_->_ref_count_);
	return _data44_;
}

static void
block44_data_unref (void * _userdata_)
{
	Block44Data* _data44_;
	_data44_ = (Block44Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data44_->_ref_count_)) {
		WidgetsReminderPickerReminderPicker* self;
		self = _data44_->self;
		_g_object_unref0 (_data44_->reminder);
		_g_object_unref0 (self);
		g_slice_free (Block44Data, _data44_);
	}
}

static void
___lambda247_ (Block44Data* _data44_)
{
	WidgetsReminderPickerReminderPicker* self;
	gboolean _tmp0_;
	self = _data44_->self;
	_tmp0_ = self->priv->_is_creating;
	if (!_tmp0_) {
		objects_reminder_delete (_data44_->reminder);
	} else {
		widgets_reminder_picker_reminder_picker_delete_reminder (self, _data44_->reminder);
	}
	g_signal_emit (self, widgets_reminder_picker_reminder_picker_signals[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_REMINDER_DELETED_SIGNAL], 0, _data44_->reminder);
}

static void
____lambda247__widgets_reminder_picker_reminder_row_deleted (WidgetsReminderPickerReminderRow* _sender,
                                                             gpointer self)
{
	___lambda247_ (self);
}

void
widgets_reminder_picker_reminder_picker_add_reminder (WidgetsReminderPickerReminderPicker* self,
                                                      ObjectsReminder* reminder)
{
	Block44Data* _data44_;
	ObjectsReminder* _tmp0_;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (reminder != NULL);
	_data44_ = g_slice_new0 (Block44Data);
	_data44_->_ref_count_ = 1;
	_data44_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (reminder);
	_g_object_unref0 (_data44_->reminder);
	_data44_->reminder = _tmp0_;
	_tmp1_ = self->priv->reminders_map;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) _data44_->reminder);
	_tmp3_ = _tmp2_;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, _tmp3_)) {
		GeeHashMap* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		WidgetsReminderPickerReminderRow* _tmp7_;
		WidgetsReminderPickerReminderRow* _tmp8_;
		GeeHashMap* _tmp9_;
		GeeHashMap* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gpointer _tmp13_;
		WidgetsReminderPickerReminderRow* _tmp14_;
		gulong _tmp15_;
		GeeHashMap* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		gpointer _tmp19_;
		WidgetsReminderPickerReminderRow* _tmp20_;
		LayoutsHeaderItem* _tmp21_;
		GeeHashMap* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		gpointer _tmp25_;
		WidgetsReminderPickerReminderRow* _tmp26_;
		_tmp4_ = self->priv->reminders_map;
		_tmp5_ = objects_base_object_get_id ((ObjectsBaseObject*) _data44_->reminder);
		_tmp6_ = _tmp5_;
		_tmp7_ = widgets_reminder_picker_reminder_row_new (_data44_->reminder);
		g_object_ref_sink (_tmp7_);
		_tmp8_ = _tmp7_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp4_, _tmp6_, _tmp8_);
		_g_object_unref0 (_tmp8_);
		_tmp9_ = self->priv->signal_map;
		_tmp10_ = self->priv->reminders_map;
		_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) _data44_->reminder);
		_tmp12_ = _tmp11_;
		_tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, _tmp12_);
		_tmp14_ = (WidgetsReminderPickerReminderRow*) _tmp13_;
		_tmp15_ = g_signal_connect_data (_tmp14_, "deleted", (GCallback) ____lambda247__widgets_reminder_picker_reminder_row_deleted, block44_data_ref (_data44_), (GClosureNotify) block44_data_unref, 0);
		_tmp16_ = self->priv->reminders_map;
		_tmp17_ = objects_base_object_get_id ((ObjectsBaseObject*) _data44_->reminder);
		_tmp18_ = _tmp17_;
		_tmp19_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp16_, _tmp18_);
		_tmp20_ = (WidgetsReminderPickerReminderRow*) _tmp19_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, (gpointer) ((guintptr) _tmp15_), (GObject*) _tmp20_);
		_g_object_unref0 (_tmp20_);
		_g_object_unref0 (_tmp14_);
		_tmp21_ = self->priv->reminders_view;
		_tmp22_ = self->priv->reminders_map;
		_tmp23_ = objects_base_object_get_id ((ObjectsBaseObject*) _data44_->reminder);
		_tmp24_ = _tmp23_;
		_tmp25_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp22_, _tmp24_);
		_tmp26_ = (WidgetsReminderPickerReminderRow*) _tmp25_;
		layouts_header_item_add_child (_tmp21_, (GtkWidget*) _tmp26_);
		_g_object_unref0 (_tmp26_);
	}
	block44_data_unref (_data44_);
	_data44_ = NULL;
}

void
widgets_reminder_picker_reminder_picker_delete_reminder (WidgetsReminderPickerReminderPicker* self,
                                                         ObjectsReminder* reminder)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (reminder != NULL);
	_tmp0_ = self->priv->reminders_map;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) reminder);
	_tmp2_ = _tmp1_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gpointer _tmp6_;
		WidgetsReminderPickerReminderRow* _tmp7_;
		GeeHashMap* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp3_ = self->priv->reminders_map;
		_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) reminder);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp5_);
		_tmp7_ = (WidgetsReminderPickerReminderRow*) _tmp6_;
		widgets_reminder_picker_reminder_row_hide_destroy (_tmp7_);
		_g_object_unref0 (_tmp7_);
		_tmp8_ = self->priv->reminders_map;
		_tmp9_ = objects_base_object_get_id ((ObjectsBaseObject*) reminder);
		_tmp10_ = _tmp9_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp8_, _tmp10_, NULL);
	}
}

GeeArrayList*
widgets_reminder_picker_reminder_picker_reminders (WidgetsReminderPickerReminderPicker* self)
{
	GeeArrayList* return_value = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_array_list_new (OBJECTS_TYPE_REMINDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	return_value = _tmp0_;
	{
		GeeIterator* _row_it = NULL;
		GeeHashMap* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->priv->reminders_map;
		_tmp2_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			WidgetsReminderPickerReminderRow* row = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			GeeArrayList* _tmp10_;
			WidgetsReminderPickerReminderRow* _tmp11_;
			ObjectsReminder* _tmp12_;
			ObjectsReminder* _tmp13_;
			_tmp7_ = _row_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _row_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			row = (WidgetsReminderPickerReminderRow*) _tmp9_;
			_tmp10_ = return_value;
			_tmp11_ = row;
			_tmp12_ = widgets_reminder_picker_reminder_row_get_reminder (_tmp11_);
			_tmp13_ = _tmp12_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, _tmp13_);
			_g_object_unref0 (row);
		}
		_g_object_unref0 (_row_it);
	}
	result = return_value;
	return result;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

void
widgets_reminder_picker_reminder_picker_clean_up (WidgetsReminderPickerReminderPicker* self)
{
	GeeHashMap* _tmp15_;
	WidgetsCalendarCalendar* _tmp16_;
	WidgetsDateTimePickerTimePicker* _tmp18_;
	LayoutsHeaderItem* _tmp20_;
	GList* _tmp21_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->signal_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) _tmp11_, (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->priv->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
	_tmp16_ = self->priv->calendar;
	if (_tmp16_ != NULL) {
		WidgetsCalendarCalendar* _tmp17_;
		_tmp17_ = self->priv->calendar;
		widgets_calendar_calendar_clean_up (_tmp17_);
	}
	_tmp18_ = self->priv->time_picker;
	if (_tmp18_ != NULL) {
		WidgetsDateTimePickerTimePicker* _tmp19_;
		_tmp19_ = self->priv->time_picker;
		widgets_date_time_picker_time_picker_clean_up (_tmp19_);
	}
	_tmp20_ = self->priv->reminders_view;
	_tmp21_ = layouts_header_item_get_children (_tmp20_);
	{
		GList* row_collection = NULL;
		GList* row_it = NULL;
		row_collection = _tmp21_;
		for (row_it = row_collection; row_it != NULL; row_it = row_it->next) {
			GtkListBoxRow* _tmp22_;
			GtkListBoxRow* row = NULL;
			_tmp22_ = _g_object_ref0 ((GtkListBoxRow*) row_it->data);
			row = _tmp22_;
			{
				GtkListBoxRow* _tmp23_;
				_tmp23_ = row;
				widgets_reminder_picker_reminder_row_clean_up (WIDGETS_REMINDER_PICKER_IS_REMINDER_ROW (_tmp23_) ? ((WidgetsReminderPickerReminderRow*) _tmp23_) : NULL);
				_g_object_unref0 (row);
			}
		}
		(row_collection == NULL) ? NULL : (row_collection = (_g_list_free__g_object_unref0_ (row_collection), NULL));
	}
}

gboolean
widgets_reminder_picker_reminder_picker_get_is_creating (WidgetsReminderPickerReminderPicker* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_creating;
	return result;
}

static void
widgets_reminder_picker_reminder_picker_set_is_creating (WidgetsReminderPickerReminderPicker* self,
                                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_reminder_picker_reminder_picker_get_is_creating (self);
	if (old_value != value) {
		self->priv->_is_creating = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_reminder_picker_reminder_picker_properties[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_IS_CREATING_PROPERTY]);
	}
}

void
widgets_reminder_picker_reminder_picker_set_suggestions_view (WidgetsReminderPickerReminderPicker* self,
                                                              gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		AdwNavigationView* _tmp0_;
		AdwNavigationPage* _tmp1_;
		AdwNavigationPage* _tmp2_;
		_tmp0_ = self->priv->navigation_view;
		_tmp1_ = widgets_reminder_picker_reminder_picker_build_page (self, "suggestions");
		_tmp2_ = _tmp1_;
		adw_navigation_view_push (_tmp0_, _tmp2_);
		_g_object_unref0 (_tmp2_);
	} else {
		AdwNavigationView* _tmp3_;
		AdwNavigationPage* _tmp4_;
		AdwNavigationPage* _tmp5_;
		_tmp3_ = self->priv->navigation_view;
		_tmp4_ = widgets_reminder_picker_reminder_picker_build_page (self, "main");
		_tmp5_ = _tmp4_;
		adw_navigation_view_push (_tmp3_, _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	g_object_notify_by_pspec ((GObject *) self, widgets_reminder_picker_reminder_picker_properties[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_SUGGESTIONS_VIEW_PROPERTY]);
}

gboolean
widgets_reminder_picker_reminder_picker_get_has_reminders (WidgetsReminderPickerReminderPicker* self)
{
	gboolean result;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->reminders_map;
	_tmp1_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_ > 0;
	return result;
}

static void
_widgets_reminder_picker_reminder_picker___lambda248_ (WidgetsReminderPickerReminderPicker* self)
{
	AdwNavigationView* _tmp0_;
	WidgetsLoadingButton* _tmp1_;
	_tmp0_ = self->priv->navigation_view;
	adw_navigation_view_pop (_tmp0_);
	_tmp1_ = self->priv->submit_button;
	widgets_loading_button_set_is_loading (_tmp1_, FALSE);
}

static void
__widgets_reminder_picker_reminder_picker___lambda248__gtk_popover_closed (GtkPopover* _sender,
                                                                           gpointer self)
{
	_widgets_reminder_picker_reminder_picker___lambda248_ ((WidgetsReminderPickerReminderPicker*) self);
}

static GObject *
widgets_reminder_picker_reminder_picker_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsReminderPickerReminderPicker * self;
	WidgetsCalendarCalendar* _tmp0_ = NULL;
	WidgetsDateTimePickerTimePicker* _tmp1_ = NULL;
	AdwNavigationView* _tmp2_;
	AdwNavigationView* _tmp3_;
	AdwNavigationPage* _tmp4_;
	AdwNavigationPage* _tmp5_;
	AdwNavigationView* _tmp6_;
	GeeHashMap* _tmp7_;
	gulong _tmp8_;
	parent_class = G_OBJECT_CLASS (widgets_reminder_picker_reminder_picker_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_REMINDER_PICKER_TYPE_REMINDER_PICKER, WidgetsReminderPickerReminderPicker);
	_tmp0_ = widgets_calendar_calendar_new (CONSTANTS_BLOCK_PAST_DAYS);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->calendar);
	self->priv->calendar = _tmp0_;
	_tmp1_ = widgets_date_time_picker_time_picker_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->time_picker);
	self->priv->time_picker = _tmp1_;
	_tmp2_ = (AdwNavigationView*) adw_navigation_view_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->navigation_view);
	self->priv->navigation_view = _tmp2_;
	_tmp3_ = self->priv->navigation_view;
	_tmp4_ = widgets_reminder_picker_reminder_picker_build_page (self, "main");
	_tmp5_ = _tmp4_;
	adw_navigation_view_add (_tmp3_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = self->priv->navigation_view;
	gtk_popover_set_child ((GtkPopover*) self, (GtkWidget*) _tmp6_);
	_tmp7_ = self->priv->signal_map;
	_tmp8_ = g_signal_connect_object ((GtkPopover*) self, "closed", (GCallback) __widgets_reminder_picker_reminder_picker___lambda248__gtk_popover_closed, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp7_, (gpointer) ((guintptr) _tmp8_), (GObject*) self);
	return obj;
}

static void
widgets_reminder_picker_reminder_picker_class_init (WidgetsReminderPickerReminderPickerClass * klass,
                                                    gpointer klass_data)
{
	widgets_reminder_picker_reminder_picker_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsReminderPickerReminderPicker_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_reminder_picker_reminder_picker_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_reminder_picker_reminder_picker_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_reminder_picker_reminder_picker_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_reminder_picker_reminder_picker_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_REMINDER_PICKER_REMINDER_PICKER_IS_CREATING_PROPERTY, widgets_reminder_picker_reminder_picker_properties[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_IS_CREATING_PROPERTY] = g_param_spec_boolean ("is-creating", "is-creating", "is-creating", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_REMINDER_PICKER_REMINDER_PICKER_SUGGESTIONS_VIEW_PROPERTY, widgets_reminder_picker_reminder_picker_properties[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_SUGGESTIONS_VIEW_PROPERTY] = g_param_spec_boolean ("suggestions-view", "suggestions-view", "suggestions-view", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_REMINDER_PICKER_REMINDER_PICKER_HAS_REMINDERS_PROPERTY, widgets_reminder_picker_reminder_picker_properties[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_HAS_REMINDERS_PROPERTY] = g_param_spec_boolean ("has-reminders", "has-reminders", "has-reminders", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	widgets_reminder_picker_reminder_picker_signals[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_REMINDER_ADDED_SIGNAL] = g_signal_new ("reminder-added", WIDGETS_REMINDER_PICKER_TYPE_REMINDER_PICKER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_REMINDER);
	widgets_reminder_picker_reminder_picker_signals[WIDGETS_REMINDER_PICKER_REMINDER_PICKER_REMINDER_DELETED_SIGNAL] = g_signal_new ("reminder-deleted", WIDGETS_REMINDER_PICKER_TYPE_REMINDER_PICKER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_REMINDER);
}

static void
widgets_reminder_picker_reminder_picker_instance_init (WidgetsReminderPickerReminderPicker * self,
                                                       gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	self->priv = widgets_reminder_picker_reminder_picker_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, WIDGETS_REMINDER_PICKER_TYPE_REMINDER_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->reminders_map = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, adw_navigation_page_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->pages_map = _tmp1_;
	_tmp2_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signal_map = _tmp2_;
}

static void
widgets_reminder_picker_reminder_picker_finalize (GObject * obj)
{
	WidgetsReminderPickerReminderPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_REMINDER_PICKER_TYPE_REMINDER_PICKER, WidgetsReminderPickerReminderPicker);
	g_debug ("ReminderPicker.vala:64: Destroying - Widgets.ReminderPicker.ReminderPi" \
"cker\n");
	_g_object_unref0 (self->priv->reminders_view);
	_g_object_unref0 (self->priv->calendar);
	_g_object_unref0 (self->priv->time_picker);
	_g_object_unref0 (self->priv->navigation_view);
	_g_object_unref0 (self->priv->submit_button);
	_g_object_unref0 (self->priv->reminders_map);
	_g_object_unref0 (self->priv->pages_map);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (widgets_reminder_picker_reminder_picker_parent_class)->finalize (obj);
}

static GType
widgets_reminder_picker_reminder_picker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsReminderPickerReminderPickerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_reminder_picker_reminder_picker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsReminderPickerReminderPicker), 0, (GInstanceInitFunc) widgets_reminder_picker_reminder_picker_instance_init, NULL };
	GType widgets_reminder_picker_reminder_picker_type_id;
	widgets_reminder_picker_reminder_picker_type_id = g_type_register_static (gtk_popover_get_type (), "WidgetsReminderPickerReminderPicker", &g_define_type_info, 0);
	WidgetsReminderPickerReminderPicker_private_offset = g_type_add_instance_private (widgets_reminder_picker_reminder_picker_type_id, sizeof (WidgetsReminderPickerReminderPickerPrivate));
	return widgets_reminder_picker_reminder_picker_type_id;
}

GType
widgets_reminder_picker_reminder_picker_get_type (void)
{
	static volatile gsize widgets_reminder_picker_reminder_picker_type_id__once = 0;
	if (g_once_init_enter (&widgets_reminder_picker_reminder_picker_type_id__once)) {
		GType widgets_reminder_picker_reminder_picker_type_id;
		widgets_reminder_picker_reminder_picker_type_id = widgets_reminder_picker_reminder_picker_get_type_once ();
		g_once_init_leave (&widgets_reminder_picker_reminder_picker_type_id__once, widgets_reminder_picker_reminder_picker_type_id);
	}
	return widgets_reminder_picker_reminder_picker_type_id__once;
}

static void
_vala_widgets_reminder_picker_reminder_picker_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec)
{
	WidgetsReminderPickerReminderPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_REMINDER_PICKER_TYPE_REMINDER_PICKER, WidgetsReminderPickerReminderPicker);
	switch (property_id) {
		case WIDGETS_REMINDER_PICKER_REMINDER_PICKER_IS_CREATING_PROPERTY:
		g_value_set_boolean (value, widgets_reminder_picker_reminder_picker_get_is_creating (self));
		break;
		case WIDGETS_REMINDER_PICKER_REMINDER_PICKER_HAS_REMINDERS_PROPERTY:
		g_value_set_boolean (value, widgets_reminder_picker_reminder_picker_get_has_reminders (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_reminder_picker_reminder_picker_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec)
{
	WidgetsReminderPickerReminderPicker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_REMINDER_PICKER_TYPE_REMINDER_PICKER, WidgetsReminderPickerReminderPicker);
	switch (property_id) {
		case WIDGETS_REMINDER_PICKER_REMINDER_PICKER_IS_CREATING_PROPERTY:
		widgets_reminder_picker_reminder_picker_set_is_creating (self, g_value_get_boolean (value));
		break;
		case WIDGETS_REMINDER_PICKER_REMINDER_PICKER_SUGGESTIONS_VIEW_PROPERTY:
		widgets_reminder_picker_reminder_picker_set_suggestions_view (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

