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

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

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

#define TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;
typedef struct _TubaEntityPrivate TubaEntityPrivate;

#define TUBA_API_TYPE_PREVIEW_CARD (tuba_api_preview_card_get_type ())
#define TUBA_API_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCard))
#define TUBA_API_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCardClass))
#define TUBA_API_IS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_PREVIEW_CARD))
#define TUBA_API_IS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_PREVIEW_CARD))
#define TUBA_API_PREVIEW_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCardClass))

typedef struct _TubaAPIPreviewCard TubaAPIPreviewCard;
typedef struct _TubaAPIPreviewCardClass TubaAPIPreviewCardClass;
typedef struct _TubaAPIPreviewCardPrivate TubaAPIPreviewCardPrivate;

#define TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY (tuba_api_preview_card_author_entity_get_type ())
#define TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntity))
#define TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntityClass))
#define TUBA_API_PREVIEW_CARD_IS_AUTHOR_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY))
#define TUBA_API_PREVIEW_CARD_IS_AUTHOR_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY))
#define TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntityClass))

typedef struct _TubaAPIPreviewCardAuthorEntity TubaAPIPreviewCardAuthorEntity;
typedef struct _TubaAPIPreviewCardAuthorEntityClass TubaAPIPreviewCardAuthorEntityClass;

#define TUBA_API_TYPE_TAG_HISTORY (tuba_api_tag_history_get_type ())
#define TUBA_API_TAG_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_TAG_HISTORY, TubaAPITagHistory))
#define TUBA_API_TAG_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_TAG_HISTORY, TubaAPITagHistoryClass))
#define TUBA_API_IS_TAG_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_TAG_HISTORY))
#define TUBA_API_IS_TAG_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_TAG_HISTORY))
#define TUBA_API_TAG_HISTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_TAG_HISTORY, TubaAPITagHistoryClass))

typedef struct _TubaAPITagHistory TubaAPITagHistory;
typedef struct _TubaAPITagHistoryClass TubaAPITagHistoryClass;
typedef enum  {
	TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BASIC,
	TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_PEERTUBE,
	TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_FUNKWHALE,
	TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BOOKWYRM,
	TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_CLAPPER
} TubaAPIPreviewCardCardSpecialType;

#define TUBA_API_PREVIEW_CARD_TYPE_CARD_SPECIAL_TYPE (tuba_api_preview_card_card_special_type_get_type ())
enum  {
	TUBA_API_PREVIEW_CARD_0_PROPERTY,
	TUBA_API_PREVIEW_CARD_URL_PROPERTY,
	TUBA_API_PREVIEW_CARD_TITLE_PROPERTY,
	TUBA_API_PREVIEW_CARD_DESCRIPTION_PROPERTY,
	TUBA_API_PREVIEW_CARD_KIND_PROPERTY,
	TUBA_API_PREVIEW_CARD_AUTHOR_NAME_PROPERTY,
	TUBA_API_PREVIEW_CARD_AUTHOR_URL_PROPERTY,
	TUBA_API_PREVIEW_CARD_AUTHORS_PROPERTY,
	TUBA_API_PREVIEW_CARD_PROVIDER_NAME_PROPERTY,
	TUBA_API_PREVIEW_CARD_PROVIDER_URL_PROPERTY,
	TUBA_API_PREVIEW_CARD_IMAGE_PROPERTY,
	TUBA_API_PREVIEW_CARD_BLURHASH_PROPERTY,
	TUBA_API_PREVIEW_CARD_HISTORY_PROPERTY,
	TUBA_API_PREVIEW_CARD_TUBA_URI_PROPERTY,
	TUBA_API_PREVIEW_CARD_SPECIAL_CARD_PROPERTY,
	TUBA_API_PREVIEW_CARD_NUM_PROPERTIES
};
static GParamSpec* tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_uri_unref0(var) ((var == NULL) ? NULL : (var = (g_uri_unref (var), NULL)))

#define TUBA_WIDGETS_TYPE_PREVIEW_CARD_EXPLORE (tuba_widgets_preview_card_explore_get_type ())
#define TUBA_WIDGETS_PREVIEW_CARD_EXPLORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD_EXPLORE, TubaWidgetsPreviewCardExplore))
#define TUBA_WIDGETS_PREVIEW_CARD_EXPLORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD_EXPLORE, TubaWidgetsPreviewCardExploreClass))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_EXPLORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD_EXPLORE))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_EXPLORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD_EXPLORE))
#define TUBA_WIDGETS_PREVIEW_CARD_EXPLORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD_EXPLORE, TubaWidgetsPreviewCardExploreClass))

typedef struct _TubaWidgetsPreviewCardExplore TubaWidgetsPreviewCardExplore;
typedef struct _TubaWidgetsPreviewCardExploreClass TubaWidgetsPreviewCardExploreClass;

#define TUBA_WIDGETS_TYPE_PREVIEW_CARD (tuba_widgets_preview_card_get_type ())
#define TUBA_WIDGETS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCard))
#define TUBA_WIDGETS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))
#define TUBA_WIDGETS_IS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_PREVIEW_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))

typedef struct _TubaWidgetsPreviewCard TubaWidgetsPreviewCard;
typedef struct _TubaWidgetsPreviewCardClass TubaWidgetsPreviewCardClass;

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;

#define TUBA_DIALOGS_TYPE_MAIN_WINDOW (tuba_dialogs_main_window_get_type ())
#define TUBA_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindow))
#define TUBA_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))
#define TUBA_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;
typedef enum  {
	TUBA_ATTACHMENT_MEDIA_TYPE_IMAGE,
	TUBA_ATTACHMENT_MEDIA_TYPE_VIDEO,
	TUBA_ATTACHMENT_MEDIA_TYPE_GIFV,
	TUBA_ATTACHMENT_MEDIA_TYPE_AUDIO,
	TUBA_ATTACHMENT_MEDIA_TYPE_UNKNOWN
} TubaAttachmentMediaType;

#define TUBA_ATTACHMENT_TYPE_MEDIA_TYPE (tuba_attachment_media_type_get_type ())

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())

#define TUBA_TYPE_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;

#define TUBA_API_TYPE_FUNKWHALE (tuba_api_funkwhale_get_type ())
#define TUBA_API_FUNKWHALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_FUNKWHALE, TubaAPIFunkwhale))
#define TUBA_API_FUNKWHALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_FUNKWHALE, TubaAPIFunkwhaleClass))
#define TUBA_API_IS_FUNKWHALE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_FUNKWHALE))
#define TUBA_API_IS_FUNKWHALE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_FUNKWHALE))
#define TUBA_API_FUNKWHALE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_FUNKWHALE, TubaAPIFunkwhaleClass))

typedef struct _TubaAPIFunkwhale TubaAPIFunkwhale;
typedef struct _TubaAPIFunkwhaleClass TubaAPIFunkwhaleClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))

#define TUBA_API_TYPE_BOOK_WYRM (tuba_api_book_wyrm_get_type ())
#define TUBA_API_BOOK_WYRM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_BOOK_WYRM, TubaAPIBookWyrm))
#define TUBA_API_BOOK_WYRM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_BOOK_WYRM, TubaAPIBookWyrmClass))
#define TUBA_API_IS_BOOK_WYRM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_BOOK_WYRM))
#define TUBA_API_IS_BOOK_WYRM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_BOOK_WYRM))
#define TUBA_API_BOOK_WYRM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_BOOK_WYRM, TubaAPIBookWyrmClass))

typedef struct _TubaAPIBookWyrm TubaAPIBookWyrm;
typedef struct _TubaAPIBookWyrmClass TubaAPIBookWyrmClass;
typedef struct _TubaApiPreviewCardOpenSpecialCardRealData TubaApiPreviewCardOpenSpecialCardRealData;

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

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

typedef struct _TubaSettings TubaSettings;
typedef struct _TubaSettingsClass TubaSettingsClass;

#define TUBA_VIEWS_TYPE_BROWSER (tuba_views_browser_get_type ())
#define TUBA_VIEWS_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_BROWSER, TubaViewsBrowser))
#define TUBA_VIEWS_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_BROWSER, TubaViewsBrowserClass))
#define TUBA_VIEWS_IS_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_BROWSER))
#define TUBA_VIEWS_IS_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_BROWSER))
#define TUBA_VIEWS_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_BROWSER, TubaViewsBrowserClass))

typedef struct _TubaViewsBrowser TubaViewsBrowser;
typedef struct _TubaViewsBrowserClass TubaViewsBrowserClass;
typedef struct _TubaApiPreviewCardOpenUrlData TubaApiPreviewCardOpenUrlData;
typedef struct _TubaAPIPreviewCardAuthorEntityPrivate TubaAPIPreviewCardAuthorEntityPrivate;
enum  {
	TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_0_PROPERTY,
	TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NAME_PROPERTY,
	TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_URL_PROPERTY,
	TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_ACCOUNT_PROPERTY,
	TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NUM_PROPERTIES
};
static GParamSpec* tuba_api_preview_card_author_entity_properties[TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NUM_PROPERTIES];

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

struct _TubaEntity {
	GObject parent_instance;
	TubaEntityPrivate * priv;
};

struct _TubaEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TubaEntity* self, TubaInstanceAccount* account);
	GType (*deserialize_array_type) (TubaEntity* self, const gchar* prop);
};

struct _TubaAPIPreviewCard {
	TubaEntity parent_instance;
	TubaAPIPreviewCardPrivate * priv;
};

struct _TubaAPIPreviewCardClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIPreviewCardPrivate {
	gchar* _url;
	gchar* _title;
	gchar* _description;
	gchar* _kind;
	gchar* _author_name;
	gchar* _author_url;
	GeeArrayList* _authors;
	gchar* _provider_name;
	gchar* _provider_url;
	gchar* _image;
	gchar* _blurhash;
	GeeArrayList* _history;
	GUri* _tuba_uri;
	TubaAPIPreviewCardCardSpecialType* _special_card;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaApiPreviewCardOpenSpecialCardRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaAPIPreviewCard* self;
	gchar* api_url;
	gchar* host;
	TubaRequestV2* req;
	TubaRequestV2* _tmp0_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp1_;
	GInputStream* _tmp2_;
	JsonParser* parser;
	GInputStream* _tmp3_;
	JsonParser* _tmp4_;
	JsonNode* node;
	TubaNetwork* _tmp5_;
	JsonParser* _tmp6_;
	JsonNode* _tmp7_;
	TubaAPIPreviewCardCardSpecialType _tmp8_;
	TubaAPIPreviewCardCardSpecialType _tmp9_;
	TubaAPIFunkwhale* funkwhale_obj;
	JsonNode* _tmp10_;
	TubaAPIFunkwhale* _tmp11_;
	gchar* res_url;
	TubaAPIFunkwhale* _tmp12_;
	gchar* _tmp13_;
	gboolean _tmp14_;
	TubaApplication* _tmp15_;
	TubaDialogsMainWindow* _tmp16_;
	TubaDialogsMainWindow* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	TubaAPIBookWyrm* bookwyrm_obj;
	JsonNode* _tmp20_;
	TubaAPIBookWyrm* _tmp21_;
	gboolean _tmp22_;
	TubaAPIBookWyrm* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	TubaAPIBookWyrm* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	TubaApplication* _tmp29_;
	TubaDialogsMainWindow* _tmp30_;
	TubaDialogsMainWindow* _tmp31_;
	TubaAPIBookWyrm* _tmp32_;
	GError* _inner_error0_;
};

struct _TubaApiPreviewCardOpenUrlData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaAPIPreviewCard* self;
	GUri* _tmp0_;
	GUri* _tmp1_;
	const gchar* _tmp2_;
	TubaEntity* _tmp3_;
	TubaAccountStore* _tmp4_;
	TubaInstanceAccount* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	const gchar* _tmp7_;
	TubaEntity* _tmp8_;
	GError* e;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	GError* _tmp13_;
	const gchar* _tmp14_;
	gboolean _tmp15_;
	TubaSettings* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	GUri* _tmp19_;
	GUri* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	TubaViewsBrowser* _tmp23_;
	TubaViewsBrowser* _tmp24_;
	TubaApplication* _tmp25_;
	TubaDialogsMainWindow* _tmp26_;
	TubaDialogsMainWindow* _tmp27_;
	GUri* _tmp28_;
	GUri* _tmp29_;
	GUri* _tmp30_;
	GUri* _tmp31_;
	const gchar* _tmp32_;
	GError* _inner_error0_;
};

struct _TubaAPIPreviewCardAuthorEntity {
	TubaEntity parent_instance;
	TubaAPIPreviewCardAuthorEntityPrivate * priv;
};

struct _TubaAPIPreviewCardAuthorEntityClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIPreviewCardAuthorEntityPrivate {
	gchar* _name;
	gchar* _url;
	TubaAPIAccount* _account;
};

static gint TubaAPIPreviewCard_private_offset;
static gpointer tuba_api_preview_card_parent_class = NULL;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaNetwork* tuba_network;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaSettings* tuba_settings;
VALA_EXTERN GRegex* tuba_bookwyrm_regex;
static gint TubaAPIPreviewCardAuthorEntity_private_offset;
static gpointer tuba_api_preview_card_author_entity_parent_class = NULL;
static TubaWidgetizableIface * tuba_api_preview_card_tuba_widgetizable_parent_iface = NULL;

VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GType tuba_api_preview_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPreviewCard, g_object_unref)
VALA_EXTERN GType tuba_api_preview_card_author_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPreviewCardAuthorEntity, g_object_unref)
VALA_EXTERN GType tuba_api_tag_history_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPITagHistory, g_object_unref)
VALA_EXTERN GType tuba_api_preview_card_card_special_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_entity_deserialize_array_type (TubaEntity* self,
                                          const gchar* prop);
VALA_EXTERN gchar* tuba_api_preview_card_card_special_type_to_string (TubaAPIPreviewCardCardSpecialType self);
VALA_EXTERN gchar* tuba_api_preview_card_card_special_type_to_dialog_body (TubaAPIPreviewCardCardSpecialType self,
                                                               const gchar* t_url);
static gboolean tuba_api_preview_card_enhancer_check (TubaAPIPreviewCard* self,
                                               const gchar* scheme,
                                               const gchar* t_host);
static GType tuba_api_preview_card_real_deserialize_array_type (TubaEntity* base,
                                                         const gchar* prop);
static GtkWidget* tuba_api_preview_card_real_to_widget (TubaWidgetizable* base);
VALA_EXTERN const gchar* tuba_api_preview_card_get_kind (TubaAPIPreviewCard* self);
VALA_EXTERN GeeArrayList* tuba_api_preview_card_get_history (TubaAPIPreviewCard* self);
VALA_EXTERN TubaWidgetsPreviewCardExplore* tuba_widgets_preview_card_explore_new (TubaAPIPreviewCard* card_obj);
VALA_EXTERN TubaWidgetsPreviewCardExplore* tuba_widgets_preview_card_explore_construct (GType object_type,
                                                                            TubaAPIPreviewCard* card_obj);
VALA_EXTERN GType tuba_widgets_preview_card_explore_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsPreviewCardExplore, g_object_unref)
VALA_EXTERN TubaWidgetsPreviewCard* tuba_widgets_preview_card_new (TubaAPIPreviewCard* card_obj);
VALA_EXTERN TubaWidgetsPreviewCard* tuba_widgets_preview_card_construct (GType object_type,
                                                             TubaAPIPreviewCard* card_obj);
VALA_EXTERN GType tuba_widgets_preview_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsPreviewCard, g_object_unref)
VALA_EXTERN void tuba_api_preview_card_open_special_card (TubaAPIPreviewCard* self);
VALA_EXTERN GUri* tuba_api_preview_card_get_tuba_uri (TubaAPIPreviewCard* self);
static void tuba_api_preview_card_open_url (TubaAPIPreviewCard* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static void tuba_api_preview_card_open_url_finish (TubaAPIPreviewCard* self,
                                            GAsyncResult* _res_);
VALA_EXTERN TubaAPIPreviewCardCardSpecialType tuba_api_preview_card_get_special_card (TubaAPIPreviewCard* self);
VALA_EXTERN const gchar* tuba_api_preview_card_get_url (TubaAPIPreviewCard* self);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN GType tuba_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsMainWindow, g_object_unref)
VALA_EXTERN TubaDialogsMainWindow* tuba_application_get_main_window (TubaApplication* self);
VALA_EXTERN GType tuba_attachment_media_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void tuba_dialogs_main_window_show_media_viewer (TubaDialogsMainWindow* self,
                                                 const gchar* url,
                                                 TubaAttachmentMediaType media_type,
                                                 GdkPaintable* preview,
                                                 GtkWidget* source_widget,
                                                 gboolean as_is,
                                                 const gchar* alt_text,
                                                 const gchar* user_friendly_url,
                                                 const gchar* blurhash,
                                                 gboolean stream,
                                                 gboolean* load_and_scroll,
                                                 gboolean reveal_media_viewer);
static void tuba_api_preview_card_open_special_card_real (TubaAPIPreviewCard* self,
                                                   const gchar* api_url,
                                                   const gchar* host,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void tuba_api_preview_card_open_special_card_real_finish (TubaAPIPreviewCard* self,
                                                          GAsyncResult* _res_);
static void tuba_api_preview_card_open_special_card_real_data_free (gpointer _data);
static gboolean tuba_api_preview_card_open_special_card_real_co (TubaApiPreviewCardOpenSpecialCardRealData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_api_preview_card_open_special_card_real_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN GType tuba_api_funkwhale_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIFunkwhale, g_object_unref)
VALA_EXTERN TubaAPIFunkwhale* tuba_api_funkwhale_from (JsonNode* node,
                                           GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN gboolean tuba_api_funkwhale_get_track (TubaAPIFunkwhale* self,
                                       const gchar* special_host,
                                       gchar** res_url);
VALA_EXTERN GType tuba_api_book_wyrm_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIBookWyrm, g_object_unref)
VALA_EXTERN TubaAPIBookWyrm* tuba_api_book_wyrm_from (JsonNode* node,
                                          GError** error);
VALA_EXTERN const gchar* tuba_api_book_wyrm_get_title (TubaAPIBookWyrm* self);
VALA_EXTERN void tuba_dialogs_main_window_show_book (TubaDialogsMainWindow* self,
                                         TubaAPIBookWyrm* book,
                                         const gchar* fallback);
static void tuba_api_preview_card_open_url_data_free (gpointer _data);
static gboolean tuba_api_preview_card_open_url_co (TubaApiPreviewCardOpenUrlData* _data_);
VALA_EXTERN gboolean tuba_widgets_rich_label_should_resolve (GUri* uri,
                                                 const gchar* url);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN void tuba_instance_account_resolve (TubaInstanceAccount* self,
                                    const gchar* url,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN TubaEntity* tuba_instance_account_resolve_finish (TubaInstanceAccount* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static void tuba_api_preview_card_open_url_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
VALA_EXTERN void tuba_widgetizable_open (TubaWidgetizable* self);
VALA_EXTERN GType tuba_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaSettings, g_object_unref)
VALA_EXTERN gboolean tuba_settings_get_use_in_app_browser_if_available (TubaSettings* self);
VALA_EXTERN gboolean tuba_views_browser_can_handle (GUri* uri,
                                        const gchar* url);
VALA_EXTERN TubaViewsBrowser* tuba_views_browser_new_with_url (const gchar* url);
VALA_EXTERN TubaViewsBrowser* tuba_views_browser_construct_with_url (GType object_type,
                                                         const gchar* url);
VALA_EXTERN GType tuba_views_browser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBrowser, g_object_unref)
VALA_EXTERN void tuba_utils_host_open_uri (GUri* uri,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gboolean tuba_utils_host_open_uri_finish (GAsyncResult* _res_);
VALA_EXTERN void tuba_utils_host_open_url (const gchar* _uri,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gboolean tuba_utils_host_open_url_finish (GAsyncResult* _res_);
VALA_EXTERN TubaAPIPreviewCard* tuba_api_preview_card_new (void);
VALA_EXTERN TubaAPIPreviewCard* tuba_api_preview_card_construct (GType object_type);
VALA_EXTERN TubaEntity* tuba_entity_new (void);
VALA_EXTERN TubaEntity* tuba_entity_construct (GType object_type);
VALA_EXTERN void tuba_api_preview_card_set_url (TubaAPIPreviewCard* self,
                                    const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_title (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_title (TubaAPIPreviewCard* self,
                                      const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_description (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_description (TubaAPIPreviewCard* self,
                                            const gchar* value);
VALA_EXTERN void tuba_api_preview_card_set_kind (TubaAPIPreviewCard* self,
                                     const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_author_name (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_author_name (TubaAPIPreviewCard* self,
                                            const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_author_url (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_author_url (TubaAPIPreviewCard* self,
                                           const gchar* value);
VALA_EXTERN GeeArrayList* tuba_api_preview_card_get_authors (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_authors (TubaAPIPreviewCard* self,
                                        GeeArrayList* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_provider_name (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_provider_name (TubaAPIPreviewCard* self,
                                              const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_provider_url (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_provider_url (TubaAPIPreviewCard* self,
                                             const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_image (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_image (TubaAPIPreviewCard* self,
                                      const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_get_blurhash (TubaAPIPreviewCard* self);
VALA_EXTERN void tuba_api_preview_card_set_blurhash (TubaAPIPreviewCard* self,
                                         const gchar* value);
VALA_EXTERN void tuba_api_preview_card_set_history (TubaAPIPreviewCard* self,
                                        GeeArrayList* value);
static gboolean tuba_api_preview_card_get_is_peertube (TubaAPIPreviewCard* self);
static TubaAPIPreviewCardCardSpecialType* _tuba_api_preview_card_card_special_type_dup (TubaAPIPreviewCardCardSpecialType* self);
static gboolean tuba_api_preview_card_get_is_funkwhale (TubaAPIPreviewCard* self);
static gboolean tuba_api_preview_card_get_is_bookwyrm (TubaAPIPreviewCard* self);
VALA_EXTERN TubaAPIPreviewCardAuthorEntity* tuba_api_preview_card_author_entity_new (void);
VALA_EXTERN TubaAPIPreviewCardAuthorEntity* tuba_api_preview_card_author_entity_construct (GType object_type);
VALA_EXTERN const gchar* tuba_api_preview_card_author_entity_get_name (TubaAPIPreviewCardAuthorEntity* self);
VALA_EXTERN void tuba_api_preview_card_author_entity_set_name (TubaAPIPreviewCardAuthorEntity* self,
                                                   const gchar* value);
VALA_EXTERN const gchar* tuba_api_preview_card_author_entity_get_url (TubaAPIPreviewCardAuthorEntity* self);
VALA_EXTERN void tuba_api_preview_card_author_entity_set_url (TubaAPIPreviewCardAuthorEntity* self,
                                                  const gchar* value);
VALA_EXTERN TubaAPIAccount* tuba_api_preview_card_author_entity_get_account (TubaAPIPreviewCardAuthorEntity* self);
VALA_EXTERN void tuba_api_preview_card_author_entity_set_account (TubaAPIPreviewCardAuthorEntity* self,
                                                      TubaAPIAccount* value);
static void tuba_api_preview_card_author_entity_finalize (GObject * obj);
static GType tuba_api_preview_card_author_entity_get_type_once (void);
static void _vala_tuba_api_preview_card_author_entity_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_tuba_api_preview_card_author_entity_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);
VALA_EXTERN GtkWidget* tuba_widgetizable_to_widget (TubaWidgetizable* self);
static void tuba_api_preview_card_finalize (GObject * obj);
static GType tuba_api_preview_card_get_type_once (void);
static void _vala_tuba_api_preview_card_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_tuba_api_preview_card_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
tuba_api_preview_card_get_instance_private (TubaAPIPreviewCard* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIPreviewCard_private_offset);
}

gchar*
tuba_api_preview_card_card_special_type_to_string (TubaAPIPreviewCardCardSpecialType self)
{
	gchar* result;
	switch (self) {
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_PEERTUBE:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("PeerTube");
			result = _tmp0_;
			return result;
		}
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_FUNKWHALE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("Funkwhale");
			result = _tmp1_;
			return result;
		}
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BOOKWYRM:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("BookWyrm");
			result = _tmp2_;
			return result;
		}
		default:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("");
			result = _tmp3_;
			return result;
		}
	}
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

gchar*
tuba_api_preview_card_card_special_type_to_dialog_body (TubaAPIPreviewCardCardSpecialType self,
                                                        const gchar* t_url)
{
	gchar* dlg_url = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* result;
	g_return_val_if_fail (t_url != NULL, NULL);
	_tmp0_ = g_strdup (t_url);
	dlg_url = _tmp0_;
	_tmp1_ = dlg_url;
	_tmp2_ = strlen (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ > 64) {
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp4_ = string_substring (t_url, (glong) 0, (glong) 62);
		_tmp5_ = _tmp4_;
		_tmp6_ = g_strconcat (_tmp5_, "…", NULL);
		_g_free0 (dlg_url);
		dlg_url = _tmp6_;
		_g_free0 (_tmp5_);
	}
	switch (self) {
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BASIC:
		{
			const gchar* _tmp7_;
			gchar* _tmp8_;
			_tmp7_ = dlg_url;
			_tmp8_ = g_strdup_printf (_ ("If you proceed, \"%s\" will open in your browser."), _tmp7_);
			result = _tmp8_;
			_g_free0 (dlg_url);
			return result;
		}
		default:
		{
			const gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp9_ = dlg_url;
			_tmp10_ = g_strdup_printf (_ ("If you proceed, %s will connect to \"%s\"."), BUILD_NAME, _tmp9_);
			result = _tmp10_;
			_g_free0 (dlg_url);
			return result;
		}
	}
}

 G_GNUC_NO_INLINE static GType
tuba_api_preview_card_card_special_type_get_type_once (void)
{
	static const GEnumValue values[] = {{TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BASIC, "TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BASIC", "basic"}, {TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_PEERTUBE, "TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_PEERTUBE", "peertube"}, {TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_FUNKWHALE, "TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_FUNKWHALE", "funkwhale"}, {TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BOOKWYRM, "TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BOOKWYRM", "bookwyrm"}, {TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_CLAPPER, "TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_CLAPPER", "clapper"}, {0, NULL, NULL}};
	GType tuba_api_preview_card_card_special_type_type_id;
	tuba_api_preview_card_card_special_type_type_id = g_enum_register_static ("TubaAPIPreviewCardCardSpecialType", values);
	return tuba_api_preview_card_card_special_type_type_id;
}

GType
tuba_api_preview_card_card_special_type_get_type (void)
{
	static GType tuba_api_preview_card_card_special_type_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_preview_card_card_special_type_type_id__once)) {
		GType tuba_api_preview_card_card_special_type_type_id;
		tuba_api_preview_card_card_special_type_type_id = tuba_api_preview_card_card_special_type_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_preview_card_card_special_type_type_id__once, tuba_api_preview_card_card_special_type_type_id);
	}
	return tuba_api_preview_card_card_special_type_type_id__once;
}

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

static gboolean
tuba_api_preview_card_enhancer_check (TubaAPIPreviewCard* self,
                                      const gchar* scheme,
                                      const gchar* t_host)
{
	gboolean supported = FALSE;
	gchar* host = NULL;
	gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	ClapperEnhancerProxyList* proxies = NULL;
	ClapperEnhancerProxyList* _tmp6_;
	ClapperEnhancerProxyList* _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (scheme != NULL, FALSE);
	if (!CLAPPER_WITH_ENHANCERS_LOADER) {
		result = FALSE;
		return result;
	}
	supported = FALSE;
	_tmp0_ = g_strdup (t_host);
	host = _tmp0_;
	_tmp2_ = host;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		_tmp3_ = host;
		_tmp1_ = g_str_has_prefix (_tmp3_, "www.");
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = host;
		_tmp5_ = string_substring (_tmp4_, (glong) 4, (glong) -1);
		_g_free0 (host);
		host = _tmp5_;
	}
	_tmp6_ = clapper_get_global_enhancer_proxies ();
	_tmp7_ = _g_object_ref0 (_tmp6_);
	proxies = _tmp7_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp8_ = FALSE;
			_tmp8_ = TRUE;
			while (TRUE) {
				ClapperEnhancerProxyList* _tmp10_;
				ClapperEnhancerProxy* proxy = NULL;
				ClapperEnhancerProxyList* _tmp11_;
				ClapperEnhancerProxy* _tmp12_;
				ClapperEnhancerProxy* _tmp13_;
				ClapperEnhancerProxy* _tmp14_;
				ClapperEnhancerProxy* _tmp15_;
				const gchar* _tmp16_;
				ClapperEnhancerProxy* _tmp17_;
				const gchar* _tmp18_;
				if (!_tmp8_) {
					gint _tmp9_;
					_tmp9_ = i;
					i = _tmp9_ + 1;
				}
				_tmp8_ = FALSE;
				_tmp10_ = proxies;
				if (!(((guint) i) < clapper_enhancer_proxy_list_get_n_proxies (_tmp10_))) {
					break;
				}
				_tmp11_ = proxies;
				_tmp12_ = clapper_enhancer_proxy_list_peek_proxy (_tmp11_, (guint) i);
				_tmp13_ = _g_object_ref0 (_tmp12_);
				proxy = _tmp13_;
				_tmp14_ = proxy;
				if (!clapper_enhancer_proxy_target_has_interface (_tmp14_, clapper_extractable_get_type ())) {
					_g_object_unref0 (proxy);
					continue;
				}
				_tmp15_ = proxy;
				if (!clapper_enhancer_proxy_extra_data_lists_value (_tmp15_, "X-Schemes", scheme)) {
					_g_object_unref0 (proxy);
					continue;
				}
				_tmp16_ = host;
				if (_tmp16_ == NULL) {
					supported = TRUE;
					_g_object_unref0 (proxy);
					break;
				}
				_tmp17_ = proxy;
				_tmp18_ = host;
				if (!clapper_enhancer_proxy_extra_data_lists_value (_tmp17_, "X-Hosts", _tmp18_)) {
					_g_object_unref0 (proxy);
					continue;
				}
				supported = TRUE;
				_g_object_unref0 (proxy);
				break;
			}
		}
	}
	result = supported;
	_g_object_unref0 (proxies);
	_g_free0 (host);
	return result;
}

static GType
tuba_api_preview_card_real_deserialize_array_type (TubaEntity* base,
                                                   const gchar* prop)
{
	TubaAPIPreviewCard * self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	GType result;
	self = (TubaAPIPreviewCard*) base;
	g_return_val_if_fail (prop != NULL, G_TYPE_INVALID);
	_tmp0_ = prop;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("history")))) {
		switch (0) {
			default:
			{
				result = TUBA_API_TYPE_TAG_HISTORY;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("authors")))) {
		switch (0) {
			default:
			{
				result = TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY;
				return result;
			}
		}
	}
	result = TUBA_ENTITY_CLASS (tuba_api_preview_card_parent_class)->deserialize_array_type (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_TYPE_ENTITY, TubaEntity), prop);
	return result;
}

static GtkWidget*
tuba_api_preview_card_real_to_widget (TubaWidgetizable* base)
{
	TubaAPIPreviewCard * self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	TubaWidgetsPreviewCard* _tmp4_;
	GtkWidget* result;
	self = (TubaAPIPreviewCard*) base;
	_tmp1_ = self->priv->_kind;
	if (g_strcmp0 (_tmp1_, "link") == 0) {
		GeeArrayList* _tmp2_;
		_tmp2_ = self->priv->_history;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		TubaWidgetsPreviewCardExplore* _tmp3_;
		_tmp3_ = tuba_widgets_preview_card_explore_new (self);
		g_object_ref_sink (_tmp3_);
		result = (GtkWidget*) _tmp3_;
		return result;
	}
	_tmp4_ = tuba_widgets_preview_card_new (self);
	g_object_ref_sink (_tmp4_);
	result = (GtkWidget*) _tmp4_;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gint
string_index_of_char (const gchar* self,
                      gunichar c,
                      gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_utf8_strchr (((gchar*) self) + start_index, (gssize) -1, c);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

void
tuba_api_preview_card_open_special_card (TubaAPIPreviewCard* self)
{
	GUri* _tmp0_;
	GUri* _tmp1_;
	gchar* api_url = NULL;
	gchar* _tmp2_;
	gchar* host = NULL;
	GUri* _tmp3_;
	GUri* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	TubaAPIPreviewCardCardSpecialType _tmp7_;
	TubaAPIPreviewCardCardSpecialType _tmp8_;
	const gchar* _tmp63_;
	const gchar* _tmp64_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_api_preview_card_get_tuba_uri (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		tuba_api_preview_card_open_url (self, NULL, NULL);
		return;
	}
	_tmp2_ = g_strdup ("");
	api_url = _tmp2_;
	_tmp3_ = tuba_api_preview_card_get_tuba_uri (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_uri_get_host (_tmp4_);
	_tmp6_ = g_strdup (_tmp5_);
	host = _tmp6_;
	_tmp7_ = tuba_api_preview_card_get_special_card (self);
	_tmp8_ = _tmp7_;
	switch (_tmp8_) {
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_FUNKWHALE:
		{
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			GUri* _tmp11_;
			GUri* _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			const gchar* _tmp16_;
			gchar* _tmp17_;
			_tmp9_ = host;
			_tmp10_ = string_to_string (_tmp9_);
			_tmp11_ = tuba_api_preview_card_get_tuba_uri (self);
			_tmp12_ = _tmp11_;
			_tmp13_ = g_uri_get_path (_tmp12_);
			_tmp14_ = g_path_get_basename (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = string_to_string (_tmp15_);
			_tmp17_ = g_strconcat ("https://", _tmp10_, "/api/v1/tracks/", _tmp16_, NULL);
			_g_free0 (api_url);
			api_url = _tmp17_;
			_g_free0 (_tmp15_);
			break;
		}
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BOOKWYRM:
		{
			gchar* bookwyrm_path = NULL;
			GUri* _tmp18_;
			GUri* _tmp19_;
			const gchar* _tmp20_;
			gchar* _tmp21_;
			gint b_id_start = 0;
			const gchar* _tmp22_;
			gint b_id_end = 0;
			const gchar* _tmp23_;
			gchar* bookwyrm_id = NULL;
			const gchar* _tmp27_;
			gchar* _tmp28_;
			const gchar* _tmp29_;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			const gchar* _tmp32_;
			gchar* _tmp33_;
			_tmp18_ = tuba_api_preview_card_get_tuba_uri (self);
			_tmp19_ = _tmp18_;
			_tmp20_ = g_uri_get_path (_tmp19_);
			_tmp21_ = g_strdup (_tmp20_);
			bookwyrm_path = _tmp21_;
			_tmp22_ = bookwyrm_path;
			b_id_start = string_index_of_char (_tmp22_, (gunichar) '/', 1);
			_tmp23_ = bookwyrm_path;
			b_id_end = string_index_of_char (_tmp23_, (gunichar) '/', b_id_start + 1) - 1;
			if (b_id_end <= -1) {
				const gchar* _tmp24_;
				gint _tmp25_;
				gint _tmp26_;
				_tmp24_ = bookwyrm_path;
				_tmp25_ = strlen (_tmp24_);
				_tmp26_ = _tmp25_;
				b_id_end = _tmp26_ - 1;
			}
			_tmp27_ = bookwyrm_path;
			_tmp28_ = string_substring (_tmp27_, (glong) (b_id_start + 1), (glong) (b_id_end - b_id_start));
			bookwyrm_id = _tmp28_;
			_tmp29_ = host;
			_tmp30_ = string_to_string (_tmp29_);
			_tmp31_ = bookwyrm_id;
			_tmp32_ = string_to_string (_tmp31_);
			_tmp33_ = g_strconcat ("https://", _tmp30_, "/book/", _tmp32_, ".json", NULL);
			_g_free0 (api_url);
			api_url = _tmp33_;
			_g_free0 (bookwyrm_id);
			_g_free0 (bookwyrm_path);
			break;
		}
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_CLAPPER:
		case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_PEERTUBE:
		{
			gchar* fin_url = NULL;
			const gchar* _tmp34_;
			gchar* _tmp35_;
			TubaAPIPreviewCardCardSpecialType _tmp36_;
			TubaAPIPreviewCardCardSpecialType _tmp37_;
			TubaApplication* _tmp58_;
			TubaDialogsMainWindow* _tmp59_;
			TubaDialogsMainWindow* _tmp60_;
			const gchar* _tmp61_;
			const gchar* _tmp62_;
			_tmp34_ = self->priv->_url;
			_tmp35_ = g_strdup (_tmp34_);
			fin_url = _tmp35_;
			_tmp36_ = tuba_api_preview_card_get_special_card (self);
			_tmp37_ = _tmp36_;
			if (_tmp37_ == TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_PEERTUBE) {
				GUri* _tmp38_;
				GUri* _tmp39_;
				GUri* _tmp40_;
				GUri* _tmp41_;
				const gchar* _tmp42_;
				const gchar* _tmp43_;
				GUri* _tmp44_;
				GUri* _tmp45_;
				GUri* _tmp46_;
				GUri* _tmp47_;
				const gchar* _tmp48_;
				GUri* _tmp49_;
				GUri* _tmp50_;
				const gchar* _tmp51_;
				GUri* _tmp52_;
				GUri* _tmp53_;
				const gchar* _tmp54_;
				GUri* _tmp55_;
				GUri* _tmp56_;
				gchar* _tmp57_;
				_tmp38_ = tuba_api_preview_card_get_tuba_uri (self);
				_tmp39_ = _tmp38_;
				_tmp40_ = tuba_api_preview_card_get_tuba_uri (self);
				_tmp41_ = _tmp40_;
				_tmp42_ = g_uri_get_userinfo (_tmp41_);
				_tmp43_ = host;
				_tmp44_ = tuba_api_preview_card_get_tuba_uri (self);
				_tmp45_ = _tmp44_;
				_tmp46_ = tuba_api_preview_card_get_tuba_uri (self);
				_tmp47_ = _tmp46_;
				_tmp48_ = g_uri_get_path (_tmp47_);
				_tmp49_ = tuba_api_preview_card_get_tuba_uri (self);
				_tmp50_ = _tmp49_;
				_tmp51_ = g_uri_get_query (_tmp50_);
				_tmp52_ = tuba_api_preview_card_get_tuba_uri (self);
				_tmp53_ = _tmp52_;
				_tmp54_ = g_uri_get_fragment (_tmp53_);
				_tmp55_ = g_uri_build (g_uri_get_flags (_tmp39_), "peertube", _tmp42_, _tmp43_, g_uri_get_port (_tmp45_), _tmp48_, _tmp51_, _tmp54_);
				_tmp56_ = _tmp55_;
				_tmp57_ = g_uri_to_string (_tmp56_);
				_g_free0 (fin_url);
				fin_url = _tmp57_;
				_g_uri_unref0 (_tmp56_);
			}
			_tmp58_ = tuba_app;
			_tmp59_ = tuba_application_get_main_window (_tmp58_);
			_tmp60_ = _tmp59_;
			_tmp61_ = fin_url;
			_tmp62_ = fin_url;
			tuba_dialogs_main_window_show_media_viewer (_tmp60_, _tmp61_, TUBA_ATTACHMENT_MEDIA_TYPE_VIDEO, NULL, NULL, FALSE, NULL, _tmp62_, NULL, TRUE, NULL, TRUE);
			_g_free0 (fin_url);
			_g_free0 (host);
			_g_free0 (api_url);
			return;
		}
		default:
		{
			tuba_api_preview_card_open_url (self, NULL, NULL);
			_g_free0 (host);
			_g_free0 (api_url);
			return;
		}
	}
	_tmp63_ = api_url;
	_tmp64_ = host;
	tuba_api_preview_card_open_special_card_real (self, _tmp63_, _tmp64_, NULL, NULL);
	_g_free0 (host);
	_g_free0 (api_url);
}

static void
tuba_api_preview_card_open_special_card_real_data_free (gpointer _data)
{
	TubaApiPreviewCardOpenSpecialCardRealData* _data_;
	_data_ = _data;
	_g_free0 (_data_->api_url);
	_g_free0 (_data_->host);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaApiPreviewCardOpenSpecialCardRealData, _data_);
}

static void
tuba_api_preview_card_open_special_card_real (TubaAPIPreviewCard* self,
                                              const gchar* api_url,
                                              const gchar* host,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	TubaApiPreviewCardOpenSpecialCardRealData* _data_;
	TubaAPIPreviewCard* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (api_url != NULL);
	g_return_if_fail (host != NULL);
	_data_ = g_slice_new0 (TubaApiPreviewCardOpenSpecialCardRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_api_preview_card_open_special_card_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (api_url);
	_g_free0 (_data_->api_url);
	_data_->api_url = _tmp1_;
	_tmp2_ = g_strdup (host);
	_g_free0 (_data_->host);
	_data_->host = _tmp2_;
	tuba_api_preview_card_open_special_card_real_co (_data_);
}

static void
tuba_api_preview_card_open_special_card_real_finish (TubaAPIPreviewCard* self,
                                                     GAsyncResult* _res_)
{
	TubaApiPreviewCardOpenSpecialCardRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_api_preview_card_open_special_card_real_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	TubaApiPreviewCardOpenSpecialCardRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_api_preview_card_open_special_card_real_co (_data_);
}

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

static gboolean
tuba_api_preview_card_open_special_card_real_co (TubaApiPreviewCardOpenSpecialCardRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = tuba_request_v2_new (_data_->api_url, TUBA_REQUEST_V2_METHOD_GET);
	_data_->req = _data_->_tmp0_;
	{
		_data_->_tmp1_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp1_, tuba_api_preview_card_open_special_card_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = tuba_request_v2_exec_finish (_data_->_tmp1_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp3_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp3_, NULL, tuba_api_preview_card_open_special_card_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp4_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp4_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp5_ = tuba_network;
		_data_->_tmp6_ = _data_->parser;
		_data_->_tmp7_ = tuba_network_parse_node (_data_->_tmp5_, _data_->_tmp6_);
		_data_->node = _data_->_tmp7_;
		_data_->_tmp8_ = tuba_api_preview_card_get_special_card (_data_->self);
		_data_->_tmp9_ = _data_->_tmp8_;
		switch (_data_->_tmp9_) {
			case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_FUNKWHALE:
			{
				_data_->_tmp10_ = _data_->node;
				_data_->_tmp11_ = tuba_api_funkwhale_from (_data_->_tmp10_, &_data_->_inner_error0_);
				_data_->funkwhale_obj = _data_->_tmp11_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					__vala_JsonNode_free0 (_data_->node);
					_g_object_unref0 (_data_->parser);
					_g_object_unref0 (_data_->in_stream);
					goto __catch0_g_error;
				}
				_data_->_tmp12_ = _data_->funkwhale_obj;
				_data_->_tmp13_ = NULL;
				_data_->_tmp14_ = tuba_api_funkwhale_get_track (_data_->_tmp12_, _data_->host, &_data_->_tmp13_);
				_g_free0 (_data_->res_url);
				_data_->res_url = _data_->_tmp13_;
				if (_data_->_tmp14_) {
					_data_->_tmp15_ = tuba_app;
					_data_->_tmp16_ = tuba_application_get_main_window (_data_->_tmp15_);
					_data_->_tmp17_ = _data_->_tmp16_;
					_data_->_tmp18_ = _data_->res_url;
					_data_->_tmp19_ = _data_->self->priv->_url;
					tuba_dialogs_main_window_show_media_viewer (_data_->_tmp17_, _data_->_tmp18_, TUBA_ATTACHMENT_MEDIA_TYPE_AUDIO, NULL, NULL, FALSE, NULL, _data_->_tmp19_, NULL, TRUE, NULL, TRUE);
				}
				_g_free0 (_data_->res_url);
				_g_object_unref0 (_data_->funkwhale_obj);
				break;
			}
			case TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BOOKWYRM:
			{
				_data_->_tmp20_ = _data_->node;
				_data_->_tmp21_ = tuba_api_book_wyrm_from (_data_->_tmp20_, &_data_->_inner_error0_);
				_data_->bookwyrm_obj = _data_->_tmp21_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					__vala_JsonNode_free0 (_data_->node);
					_g_object_unref0 (_data_->parser);
					_g_object_unref0 (_data_->in_stream);
					goto __catch0_g_error;
				}
				_data_->_tmp23_ = _data_->bookwyrm_obj;
				_data_->_tmp24_ = tuba_api_book_wyrm_get_title (_data_->_tmp23_);
				_data_->_tmp25_ = _data_->_tmp24_;
				if (_data_->_tmp25_ != NULL) {
					_data_->_tmp26_ = _data_->bookwyrm_obj;
					_data_->_tmp27_ = tuba_api_book_wyrm_get_title (_data_->_tmp26_);
					_data_->_tmp28_ = _data_->_tmp27_;
					_data_->_tmp22_ = g_strcmp0 (_data_->_tmp28_, "") != 0;
				} else {
					_data_->_tmp22_ = FALSE;
				}
				if (_data_->_tmp22_) {
					_data_->_tmp29_ = tuba_app;
					_data_->_tmp30_ = tuba_application_get_main_window (_data_->_tmp29_);
					_data_->_tmp31_ = _data_->_tmp30_;
					_data_->_tmp32_ = _data_->bookwyrm_obj;
					tuba_dialogs_main_window_show_book (_data_->_tmp31_, _data_->_tmp32_, NULL);
				}
				_g_object_unref0 (_data_->bookwyrm_obj);
				break;
			}
			default:
			{
				_data_->_state_ = 3;
				tuba_api_preview_card_open_url (_data_->self, tuba_api_preview_card_open_special_card_real_ready, _data_);
				return FALSE;
				_state_3:
				tuba_api_preview_card_open_url_finish (_data_->self, _data_->_res_);
				break;
			}
		}
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->_state_ = 4;
		tuba_api_preview_card_open_url (_data_->self, tuba_api_preview_card_open_special_card_real_ready, _data_);
		return FALSE;
		_state_4:
		tuba_api_preview_card_open_url_finish (_data_->self, _data_->_res_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->req);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
tuba_api_preview_card_open_url (TubaAPIPreviewCard* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	TubaApiPreviewCardOpenUrlData* _data_;
	TubaAPIPreviewCard* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaApiPreviewCardOpenUrlData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_api_preview_card_open_url_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_api_preview_card_open_url_co (_data_);
}

static void
tuba_api_preview_card_open_url_finish (TubaAPIPreviewCard* self,
                                       GAsyncResult* _res_)
{
	TubaApiPreviewCardOpenUrlData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_api_preview_card_open_url_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	TubaApiPreviewCardOpenUrlData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_api_preview_card_open_url_co (_data_);
}

static gboolean
tuba_api_preview_card_open_url_co (TubaApiPreviewCardOpenUrlData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = tuba_api_preview_card_get_tuba_uri (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_url;
	if (tuba_widgets_rich_label_should_resolve (_data_->_tmp1_, _data_->_tmp2_)) {
		{
			_data_->_tmp4_ = tuba_accounts;
			_data_->_tmp5_ = tuba_account_store_get_active (_data_->_tmp4_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->_tmp7_ = _data_->self->priv->_url;
			_data_->_state_ = 1;
			tuba_instance_account_resolve (_data_->_tmp6_, _data_->_tmp7_, tuba_api_preview_card_open_url_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp8_ = tuba_instance_account_resolve_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp3_ = _data_->_tmp8_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			tuba_widgetizable_open ((TubaWidgetizable*) _data_->_tmp3_);
			_g_object_unref0 (_data_->_tmp3_);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp9_ = _data_->self->priv->_url;
			_data_->_tmp10_ = string_to_string (_data_->_tmp9_);
			_data_->_tmp11_ = g_strconcat ("Failed to resolve URL \"", _data_->_tmp10_, "\":", NULL);
			_data_->_tmp12_ = _data_->_tmp11_;
			g_warning ("PreviewCard.vala:295: %s", _data_->_tmp12_);
			_g_free0 (_data_->_tmp12_);
			_data_->_tmp13_ = _data_->e;
			_data_->_tmp14_ = _data_->_tmp13_->message;
			g_warning ("PreviewCard.vala:296: %s", _data_->_tmp14_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp16_ = tuba_settings;
	_data_->_tmp17_ = tuba_settings_get_use_in_app_browser_if_available (_data_->_tmp16_);
	_data_->_tmp18_ = _data_->_tmp17_;
	if (_data_->_tmp18_) {
		_data_->_tmp19_ = tuba_api_preview_card_get_tuba_uri (_data_->self);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = _data_->self->priv->_url;
		_data_->_tmp15_ = tuba_views_browser_can_handle (_data_->_tmp20_, _data_->_tmp21_);
	} else {
		_data_->_tmp15_ = FALSE;
	}
	if (_data_->_tmp15_) {
		_data_->_tmp22_ = _data_->self->priv->_url;
		_data_->_tmp23_ = tuba_views_browser_new_with_url (_data_->_tmp22_);
		g_object_ref_sink (_data_->_tmp23_);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = tuba_app;
		_data_->_tmp26_ = tuba_application_get_main_window (_data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		adw_dialog_present ((AdwDialog*) _data_->_tmp24_, (GtkWidget*) _data_->_tmp27_);
		_g_object_unref0 (_data_->_tmp24_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp28_ = tuba_api_preview_card_get_tuba_uri (_data_->self);
	_data_->_tmp29_ = _data_->_tmp28_;
	if (_data_->_tmp29_ != NULL) {
		_data_->_tmp30_ = tuba_api_preview_card_get_tuba_uri (_data_->self);
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_state_ = 2;
		tuba_utils_host_open_uri (_data_->_tmp31_, tuba_api_preview_card_open_url_ready, _data_);
		return FALSE;
		_state_2:
		tuba_utils_host_open_uri_finish (_data_->_res_);
	} else {
		_data_->_tmp32_ = _data_->self->priv->_url;
		_data_->_state_ = 3;
		tuba_utils_host_open_url (_data_->_tmp32_, tuba_api_preview_card_open_url_ready, _data_);
		return FALSE;
		_state_3:
		tuba_utils_host_open_url_finish (_data_->_res_);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

TubaAPIPreviewCard*
tuba_api_preview_card_construct (GType object_type)
{
	TubaAPIPreviewCard * self = NULL;
	self = (TubaAPIPreviewCard*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIPreviewCard*
tuba_api_preview_card_new (void)
{
	return tuba_api_preview_card_construct (TUBA_API_TYPE_PREVIEW_CARD);
}

const gchar*
tuba_api_preview_card_get_url (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_url (TubaAPIPreviewCard* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_url);
		self->priv->_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_URL_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_title (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_title (TubaAPIPreviewCard* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_TITLE_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_description (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_description;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_description (TubaAPIPreviewCard* self,
                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_description (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_description);
		self->priv->_description = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_DESCRIPTION_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_kind (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_kind;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_kind (TubaAPIPreviewCard* self,
                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_kind (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_kind);
		self->priv->_kind = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_KIND_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_author_name (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_author_name;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_author_name (TubaAPIPreviewCard* self,
                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_author_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_author_name);
		self->priv->_author_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_AUTHOR_NAME_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_author_url (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_author_url;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_author_url (TubaAPIPreviewCard* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_author_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_author_url);
		self->priv->_author_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_AUTHOR_URL_PROPERTY]);
	}
}

GeeArrayList*
tuba_api_preview_card_get_authors (TubaAPIPreviewCard* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_authors;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_authors (TubaAPIPreviewCard* self,
                                   GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_authors (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_authors);
		self->priv->_authors = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_AUTHORS_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_provider_name (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_provider_name;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_provider_name (TubaAPIPreviewCard* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_provider_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_provider_name);
		self->priv->_provider_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_PROVIDER_NAME_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_provider_url (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_provider_url;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_provider_url (TubaAPIPreviewCard* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_provider_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_provider_url);
		self->priv->_provider_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_PROVIDER_URL_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_image (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_image;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_image (TubaAPIPreviewCard* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_image (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_image);
		self->priv->_image = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_IMAGE_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_get_blurhash (TubaAPIPreviewCard* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_blurhash;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_blurhash (TubaAPIPreviewCard* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_blurhash (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_blurhash);
		self->priv->_blurhash = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_BLURHASH_PROPERTY]);
	}
}

GeeArrayList*
tuba_api_preview_card_get_history (TubaAPIPreviewCard* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_history;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_set_history (TubaAPIPreviewCard* self,
                                   GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_get_history (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_history);
		self->priv->_history = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_HISTORY_PROPERTY]);
	}
}

GUri*
tuba_api_preview_card_get_tuba_uri (TubaAPIPreviewCard* self)
{
	GUri* result;
	GUri* _tmp0_;
	GUri* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tuba_uri;
	if (_tmp0_ == NULL) {
		{
			GUri* _tmp1_ = NULL;
			const gchar* _tmp2_;
			GUri* _tmp3_;
			GUri* _tmp4_;
			_tmp2_ = self->priv->_url;
			_tmp3_ = g_uri_parse (_tmp2_, G_URI_FLAGS_NONE, &_inner_error0_);
			_tmp1_ = _tmp3_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp4_ = _tmp1_;
			_tmp1_ = NULL;
			_g_uri_unref0 (self->priv->_tuba_uri);
			self->priv->_tuba_uri = _tmp4_;
			_g_uri_unref0 (_tmp1_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp5_ = self->priv->_tuba_uri;
	result = _tmp5_;
	return result;
}

static TubaAPIPreviewCardCardSpecialType*
_tuba_api_preview_card_card_special_type_dup (TubaAPIPreviewCardCardSpecialType* self)
{
	TubaAPIPreviewCardCardSpecialType* dup;
	dup = g_new0 (TubaAPIPreviewCardCardSpecialType, 1);
	memcpy (dup, self, sizeof (TubaAPIPreviewCardCardSpecialType));
	return dup;
}

static gpointer
__tuba_api_preview_card_card_special_type_dup0 (gpointer self)
{
	return self ? _tuba_api_preview_card_card_special_type_dup (self) : NULL;
}

TubaAPIPreviewCardCardSpecialType
tuba_api_preview_card_get_special_card (TubaAPIPreviewCard* self)
{
	TubaAPIPreviewCardCardSpecialType result;
	TubaAPIPreviewCardCardSpecialType* _tmp0_;
	TubaAPIPreviewCardCardSpecialType* _tmp25_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_special_card;
	if (_tmp0_ == NULL) {
		gboolean _tmp1_;
		gboolean _tmp2_;
		_tmp1_ = tuba_api_preview_card_get_is_peertube (self);
		_tmp2_ = _tmp1_;
		if (_tmp2_) {
			if (tuba_api_preview_card_enhancer_check (self, "peertube", NULL)) {
				TubaAPIPreviewCardCardSpecialType _tmp3_;
				TubaAPIPreviewCardCardSpecialType* _tmp4_;
				_tmp3_ = TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_PEERTUBE;
				_tmp4_ = __tuba_api_preview_card_card_special_type_dup0 (&_tmp3_);
				_g_free0 (self->priv->_special_card);
				self->priv->_special_card = _tmp4_;
			} else {
				TubaAPIPreviewCardCardSpecialType _tmp5_;
				TubaAPIPreviewCardCardSpecialType* _tmp6_;
				_tmp5_ = TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BASIC;
				_tmp6_ = __tuba_api_preview_card_card_special_type_dup0 (&_tmp5_);
				_g_free0 (self->priv->_special_card);
				self->priv->_special_card = _tmp6_;
			}
		} else {
			gboolean _tmp7_;
			gboolean _tmp8_;
			_tmp7_ = tuba_api_preview_card_get_is_funkwhale (self);
			_tmp8_ = _tmp7_;
			if (_tmp8_) {
				TubaAPIPreviewCardCardSpecialType _tmp9_;
				TubaAPIPreviewCardCardSpecialType* _tmp10_;
				_tmp9_ = TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_FUNKWHALE;
				_tmp10_ = __tuba_api_preview_card_card_special_type_dup0 (&_tmp9_);
				_g_free0 (self->priv->_special_card);
				self->priv->_special_card = _tmp10_;
			} else {
				gboolean _tmp11_;
				gboolean _tmp12_;
				_tmp11_ = tuba_api_preview_card_get_is_bookwyrm (self);
				_tmp12_ = _tmp11_;
				if (_tmp12_) {
					TubaAPIPreviewCardCardSpecialType _tmp13_;
					TubaAPIPreviewCardCardSpecialType* _tmp14_;
					_tmp13_ = TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BOOKWYRM;
					_tmp14_ = __tuba_api_preview_card_card_special_type_dup0 (&_tmp13_);
					_g_free0 (self->priv->_special_card);
					self->priv->_special_card = _tmp14_;
				} else {
					TubaAPIPreviewCardCardSpecialType _tmp15_;
					TubaAPIPreviewCardCardSpecialType* _tmp16_;
					GUri* _tmp17_;
					GUri* _tmp18_;
					const gchar* _tmp19_;
					GUri* _tmp20_;
					GUri* _tmp21_;
					const gchar* _tmp22_;
					_tmp15_ = TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_BASIC;
					_tmp16_ = __tuba_api_preview_card_card_special_type_dup0 (&_tmp15_);
					_g_free0 (self->priv->_special_card);
					self->priv->_special_card = _tmp16_;
					_tmp17_ = tuba_api_preview_card_get_tuba_uri (self);
					_tmp18_ = _tmp17_;
					_tmp19_ = g_uri_get_scheme (_tmp18_);
					_tmp20_ = tuba_api_preview_card_get_tuba_uri (self);
					_tmp21_ = _tmp20_;
					_tmp22_ = g_uri_get_host (_tmp21_);
					if (tuba_api_preview_card_enhancer_check (self, _tmp19_, _tmp22_)) {
						TubaAPIPreviewCardCardSpecialType _tmp23_;
						TubaAPIPreviewCardCardSpecialType* _tmp24_;
						_tmp23_ = TUBA_API_PREVIEW_CARD_CARD_SPECIAL_TYPE_CLAPPER;
						_tmp24_ = __tuba_api_preview_card_card_special_type_dup0 (&_tmp23_);
						_g_free0 (self->priv->_special_card);
						self->priv->_special_card = _tmp24_;
					}
				}
			}
		}
	}
	_tmp25_ = self->priv->_special_card;
	result = *_tmp25_;
	return result;
}

static gboolean
tuba_api_preview_card_get_is_peertube (TubaAPIPreviewCard* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_kind;
	if (g_strcmp0 (_tmp1_, "video") == 0) {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->_provider_name;
		_tmp0_ = g_strcmp0 (_tmp2_, "PeerTube") == 0;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gint
string_last_index_of (const gchar* self,
                      const gchar* needle,
                      gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (needle != NULL, -1);
	_tmp0_ = g_strrstr (((gchar*) self) + start_index, (gchar*) needle);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

static gboolean
tuba_api_preview_card_get_is_funkwhale (TubaAPIPreviewCard* self)
{
	gboolean result;
	gboolean provider_fw = FALSE;
	const gchar* _tmp0_;
	gboolean url_fw = FALSE;
	const gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_provider_name;
	provider_fw = string_last_index_of (_tmp0_, "- Funkwhale", 0) > 0;
	_tmp1_ = self->priv->_url;
	url_fw = string_last_index_of (_tmp1_, "/library/tracks/", 0) > -1;
	_tmp4_ = self->priv->_kind;
	if (g_strcmp0 (_tmp4_, "video") == 0) {
		_tmp3_ = provider_fw;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = url_fw;
	} else {
		_tmp2_ = FALSE;
	}
	result = _tmp2_;
	return result;
}

static gboolean
tuba_api_preview_card_get_is_bookwyrm (TubaAPIPreviewCard* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_kind;
	if (g_strcmp0 (_tmp1_, "link") == 0) {
		GRegex* _tmp2_;
		const gchar* _tmp3_;
		_tmp2_ = tuba_bookwyrm_regex;
		_tmp3_ = self->priv->_url;
		_tmp0_ = g_regex_match (_tmp2_, _tmp3_, 0, NULL);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static inline gpointer
tuba_api_preview_card_author_entity_get_instance_private (TubaAPIPreviewCardAuthorEntity* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIPreviewCardAuthorEntity_private_offset);
}

TubaAPIPreviewCardAuthorEntity*
tuba_api_preview_card_author_entity_construct (GType object_type)
{
	TubaAPIPreviewCardAuthorEntity * self = NULL;
	self = (TubaAPIPreviewCardAuthorEntity*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIPreviewCardAuthorEntity*
tuba_api_preview_card_author_entity_new (void)
{
	return tuba_api_preview_card_author_entity_construct (TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY);
}

const gchar*
tuba_api_preview_card_author_entity_get_name (TubaAPIPreviewCardAuthorEntity* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_author_entity_set_name (TubaAPIPreviewCardAuthorEntity* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_author_entity_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_author_entity_properties[TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NAME_PROPERTY]);
	}
}

const gchar*
tuba_api_preview_card_author_entity_get_url (TubaAPIPreviewCardAuthorEntity* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_author_entity_set_url (TubaAPIPreviewCardAuthorEntity* self,
                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_author_entity_get_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_url);
		self->priv->_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_author_entity_properties[TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_URL_PROPERTY]);
	}
}

TubaAPIAccount*
tuba_api_preview_card_author_entity_get_account (TubaAPIPreviewCardAuthorEntity* self)
{
	TubaAPIAccount* result;
	TubaAPIAccount* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

void
tuba_api_preview_card_author_entity_set_account (TubaAPIPreviewCardAuthorEntity* self,
                                                 TubaAPIAccount* value)
{
	TubaAPIAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_preview_card_author_entity_get_account (self);
	if (old_value != value) {
		TubaAPIAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_account);
		self->priv->_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_preview_card_author_entity_properties[TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_ACCOUNT_PROPERTY]);
	}
}

static void
tuba_api_preview_card_author_entity_class_init (TubaAPIPreviewCardAuthorEntityClass * klass,
                                                gpointer klass_data)
{
	tuba_api_preview_card_author_entity_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIPreviewCardAuthorEntity_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_preview_card_author_entity_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_preview_card_author_entity_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_preview_card_author_entity_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NAME_PROPERTY, tuba_api_preview_card_author_entity_properties[TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_URL_PROPERTY, tuba_api_preview_card_author_entity_properties[TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_ACCOUNT_PROPERTY, tuba_api_preview_card_author_entity_properties[TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", TUBA_API_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_api_preview_card_author_entity_instance_init (TubaAPIPreviewCardAuthorEntity * self,
                                                   gpointer klass)
{
	self->priv = tuba_api_preview_card_author_entity_get_instance_private (self);
}

static void
tuba_api_preview_card_author_entity_finalize (GObject * obj)
{
	TubaAPIPreviewCardAuthorEntity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntity);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_url);
	_g_object_unref0 (self->priv->_account);
	G_OBJECT_CLASS (tuba_api_preview_card_author_entity_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_preview_card_author_entity_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIPreviewCardAuthorEntityClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_preview_card_author_entity_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIPreviewCardAuthorEntity), 0, (GInstanceInitFunc) tuba_api_preview_card_author_entity_instance_init, NULL };
	GType tuba_api_preview_card_author_entity_type_id;
	tuba_api_preview_card_author_entity_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIPreviewCardAuthorEntity", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaAPIPreviewCardAuthorEntity_private_offset = g_type_add_instance_private (tuba_api_preview_card_author_entity_type_id, sizeof (TubaAPIPreviewCardAuthorEntityPrivate));
	return tuba_api_preview_card_author_entity_type_id;
}

GType
tuba_api_preview_card_author_entity_get_type (void)
{
	static GType tuba_api_preview_card_author_entity_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_preview_card_author_entity_type_id__once)) {
		GType tuba_api_preview_card_author_entity_type_id;
		tuba_api_preview_card_author_entity_type_id = tuba_api_preview_card_author_entity_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_preview_card_author_entity_type_id__once, tuba_api_preview_card_author_entity_type_id);
	}
	return tuba_api_preview_card_author_entity_type_id__once;
}

static void
_vala_tuba_api_preview_card_author_entity_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	TubaAPIPreviewCardAuthorEntity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntity);
	switch (property_id) {
		case TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NAME_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_author_entity_get_name (self));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_URL_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_author_entity_get_url (self));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_ACCOUNT_PROPERTY:
		g_value_set_object (value, tuba_api_preview_card_author_entity_get_account (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_preview_card_author_entity_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	TubaAPIPreviewCardAuthorEntity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PREVIEW_CARD_TYPE_AUTHOR_ENTITY, TubaAPIPreviewCardAuthorEntity);
	switch (property_id) {
		case TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_NAME_PROPERTY:
		tuba_api_preview_card_author_entity_set_name (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_URL_PROPERTY:
		tuba_api_preview_card_author_entity_set_url (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_ENTITY_ACCOUNT_PROPERTY:
		tuba_api_preview_card_author_entity_set_account (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
tuba_api_preview_card_class_init (TubaAPIPreviewCardClass * klass,
                                  gpointer klass_data)
{
	tuba_api_preview_card_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIPreviewCard_private_offset);
	((TubaEntityClass *) klass)->deserialize_array_type = (GType (*) (TubaEntity*, const gchar*)) tuba_api_preview_card_real_deserialize_array_type;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_preview_card_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_preview_card_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_preview_card_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_URL_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_TITLE_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_DESCRIPTION_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_KIND_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_KIND_PROPERTY] = g_param_spec_string ("kind", "kind", "kind", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_AUTHOR_NAME_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_AUTHOR_NAME_PROPERTY] = g_param_spec_string ("author-name", "author-name", "author-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_AUTHOR_URL_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_AUTHOR_URL_PROPERTY] = g_param_spec_string ("author-url", "author-url", "author-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_AUTHORS_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_AUTHORS_PROPERTY] = g_param_spec_object ("authors", "authors", "authors", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_PROVIDER_NAME_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_PROVIDER_NAME_PROPERTY] = g_param_spec_string ("provider-name", "provider-name", "provider-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_PROVIDER_URL_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_PROVIDER_URL_PROPERTY] = g_param_spec_string ("provider-url", "provider-url", "provider-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_IMAGE_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_IMAGE_PROPERTY] = g_param_spec_string ("image", "image", "image", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_BLURHASH_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_BLURHASH_PROPERTY] = g_param_spec_string ("blurhash", "blurhash", "blurhash", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_HISTORY_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_HISTORY_PROPERTY] = g_param_spec_object ("history", "history", "history", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_TUBA_URI_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_TUBA_URI_PROPERTY] = g_param_spec_boxed ("tuba-uri", "tuba-uri", "tuba-uri", G_TYPE_URI, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PREVIEW_CARD_SPECIAL_CARD_PROPERTY, tuba_api_preview_card_properties[TUBA_API_PREVIEW_CARD_SPECIAL_CARD_PROPERTY] = g_param_spec_enum ("special-card", "special-card", "special-card", TUBA_API_PREVIEW_CARD_TYPE_CARD_SPECIAL_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_api_preview_card_tuba_widgetizable_interface_init (TubaWidgetizableIface * iface,
                                                        gpointer iface_data)
{
	tuba_api_preview_card_tuba_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_widget = (GtkWidget* (*) (TubaWidgetizable*)) tuba_api_preview_card_real_to_widget;
}

static void
tuba_api_preview_card_instance_init (TubaAPIPreviewCard * self,
                                     gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self->priv = tuba_api_preview_card_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_title = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_description = _tmp1_;
	_tmp2_ = g_strdup ("link");
	self->priv->_kind = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_author_name = _tmp3_;
	_tmp4_ = g_strdup ("");
	self->priv->_author_url = _tmp4_;
	self->priv->_authors = NULL;
	_tmp5_ = g_strdup ("");
	self->priv->_provider_name = _tmp5_;
	_tmp6_ = g_strdup ("");
	self->priv->_provider_url = _tmp6_;
	self->priv->_image = NULL;
	self->priv->_blurhash = NULL;
	self->priv->_history = NULL;
	self->priv->_tuba_uri = NULL;
	self->priv->_special_card = NULL;
}

static void
tuba_api_preview_card_finalize (GObject * obj)
{
	TubaAPIPreviewCard * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCard);
	_g_free0 (self->priv->_url);
	_g_free0 (self->priv->_title);
	_g_free0 (self->priv->_description);
	_g_free0 (self->priv->_kind);
	_g_free0 (self->priv->_author_name);
	_g_free0 (self->priv->_author_url);
	_g_object_unref0 (self->priv->_authors);
	_g_free0 (self->priv->_provider_name);
	_g_free0 (self->priv->_provider_url);
	_g_free0 (self->priv->_image);
	_g_free0 (self->priv->_blurhash);
	_g_object_unref0 (self->priv->_history);
	_g_uri_unref0 (self->priv->_tuba_uri);
	_g_free0 (self->priv->_special_card);
	G_OBJECT_CLASS (tuba_api_preview_card_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_preview_card_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIPreviewCardClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_preview_card_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIPreviewCard), 0, (GInstanceInitFunc) tuba_api_preview_card_instance_init, NULL };
	static const GInterfaceInfo tuba_widgetizable_info = { (GInterfaceInitFunc) tuba_api_preview_card_tuba_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_api_preview_card_type_id;
	tuba_api_preview_card_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIPreviewCard", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_api_preview_card_type_id, TUBA_TYPE_WIDGETIZABLE, &tuba_widgetizable_info);
	TubaAPIPreviewCard_private_offset = g_type_add_instance_private (tuba_api_preview_card_type_id, sizeof (TubaAPIPreviewCardPrivate));
	return tuba_api_preview_card_type_id;
}

GType
tuba_api_preview_card_get_type (void)
{
	static GType tuba_api_preview_card_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_preview_card_type_id__once)) {
		GType tuba_api_preview_card_type_id;
		tuba_api_preview_card_type_id = tuba_api_preview_card_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_preview_card_type_id__once, tuba_api_preview_card_type_id);
	}
	return tuba_api_preview_card_type_id__once;
}

static void
_vala_tuba_api_preview_card_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	TubaAPIPreviewCard * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCard);
	switch (property_id) {
		case TUBA_API_PREVIEW_CARD_URL_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_url (self));
		break;
		case TUBA_API_PREVIEW_CARD_TITLE_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_title (self));
		break;
		case TUBA_API_PREVIEW_CARD_DESCRIPTION_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_description (self));
		break;
		case TUBA_API_PREVIEW_CARD_KIND_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_kind (self));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_NAME_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_author_name (self));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_URL_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_author_url (self));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHORS_PROPERTY:
		g_value_set_object (value, tuba_api_preview_card_get_authors (self));
		break;
		case TUBA_API_PREVIEW_CARD_PROVIDER_NAME_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_provider_name (self));
		break;
		case TUBA_API_PREVIEW_CARD_PROVIDER_URL_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_provider_url (self));
		break;
		case TUBA_API_PREVIEW_CARD_IMAGE_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_image (self));
		break;
		case TUBA_API_PREVIEW_CARD_BLURHASH_PROPERTY:
		g_value_set_string (value, tuba_api_preview_card_get_blurhash (self));
		break;
		case TUBA_API_PREVIEW_CARD_HISTORY_PROPERTY:
		g_value_set_object (value, tuba_api_preview_card_get_history (self));
		break;
		case TUBA_API_PREVIEW_CARD_TUBA_URI_PROPERTY:
		g_value_set_boxed (value, tuba_api_preview_card_get_tuba_uri (self));
		break;
		case TUBA_API_PREVIEW_CARD_SPECIAL_CARD_PROPERTY:
		g_value_set_enum (value, tuba_api_preview_card_get_special_card (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_preview_card_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	TubaAPIPreviewCard * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_PREVIEW_CARD, TubaAPIPreviewCard);
	switch (property_id) {
		case TUBA_API_PREVIEW_CARD_URL_PROPERTY:
		tuba_api_preview_card_set_url (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_TITLE_PROPERTY:
		tuba_api_preview_card_set_title (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_DESCRIPTION_PROPERTY:
		tuba_api_preview_card_set_description (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_KIND_PROPERTY:
		tuba_api_preview_card_set_kind (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_NAME_PROPERTY:
		tuba_api_preview_card_set_author_name (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHOR_URL_PROPERTY:
		tuba_api_preview_card_set_author_url (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_AUTHORS_PROPERTY:
		tuba_api_preview_card_set_authors (self, g_value_get_object (value));
		break;
		case TUBA_API_PREVIEW_CARD_PROVIDER_NAME_PROPERTY:
		tuba_api_preview_card_set_provider_name (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_PROVIDER_URL_PROPERTY:
		tuba_api_preview_card_set_provider_url (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_IMAGE_PROPERTY:
		tuba_api_preview_card_set_image (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_BLURHASH_PROPERTY:
		tuba_api_preview_card_set_blurhash (self, g_value_get_string (value));
		break;
		case TUBA_API_PREVIEW_CARD_HISTORY_PROPERTY:
		tuba_api_preview_card_set_history (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

