import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
import { L as Lang } from './lang.js';
import { k as getMeta, t as tinyMDtoHTML } from './helpers.js';
import { a as axios } from './axios.js';
import { d as defineCustomElement$j } from './component2.js';
import { d as defineCustomElement$i } from './component3.js';
import { d as defineCustomElement$h } from './component5.js';
import { d as defineCustomElement$g } from './component6.js';
import { d as defineCustomElement$f } from './component7.js';
import { d as defineCustomElement$e } from './component-segment.js';
import { d as defineCustomElement$d } from './component10.js';
import { d as defineCustomElement$c } from './component17.js';
import { d as defineCustomElement$b } from './component11.js';
import { d as defineCustomElement$a } from './component-image.js';
import { d as defineCustomElement$9 } from './component.js';
import { d as defineCustomElement$8 } from './component14.js';
import { d as defineCustomElement$7 } from './component-image2.js';
import { d as defineCustomElement$6 } from './components.js';
import { d as defineCustomElement$5 } from './component12.js';
import { d as defineCustomElement$4 } from './component-tab.js';
import { d as defineCustomElement$3 } from './component18.js';
import { d as defineCustomElement$2 } from './component13.js';

const styleCss = ".gallery-picker .card-body{padding-bottom:0}.gallery-picker .results{display:block;clear:both}.gallery-picker .media-gallery{display:block;max-height:calc(100vh - 265px);overflow-y:auto;padding:4px 4px 0}.gallery-picker .items{display:grid;width:100%;position:relative;grid-template-columns:repeat(5, 1fr);gap:1rem;margin-bottom:1rem}.gallery-picker x-input-image{width:8rem;height:8rem;min-width:8rem;min-height:8rem;padding:0;border-radius:0.5rem;border:1px dashed var(--color-border-tinted);background-color:var(--color-white);-webkit-transition:0.3s;transition:0.3s;color:var(--color-text);cursor:pointer;margin:0 auto}.gallery-picker x-input-image:after,.gallery-picker x-input-image:before{display:none}.is-dark-mode .gallery-picker x-input-image{background-color:var(--color-dark);border:1px dashed var(--color-border-shaded)}.gallery-picker x-input-image .upload-zone{width:8rem;height:8rem;top:0;right:0;left:0;bottom:0;padding:0.5rem}.gallery-picker x-input-image:hover{border-color:var(--color-primary);-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb), 0.1);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb), 0.1);cursor:pointer}.gallery-picker x-gallery-image{position:relative;display:inline-block;width:8rem;height:8rem;margin:0 auto;border-radius:0.5rem;background-position:center;background-size:cover;border:1px solid var(--color-border-tinted, #d9d8db);background-color:var(--color-white, #FFFFFF);-webkit-transition:0.3s;transition:0.3s}.is-dark-mode .gallery-picker x-gallery-image{background-color:var(--color-dark, #1F1F1F) !important;border:1px solid var(--color-dark-tint, #414141);color:var(--color-light, #FEFEFE)}.is-mobile .gallery-picker x-gallery-image .actions a{display:none}@media (hover: hover) and (pointer: fine){.gallery-picker x-gallery-image:hover{border-color:var(--color-primary, #4275F2);-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1);cursor:pointer}.gallery-picker x-gallery-image:hover.selected{-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 4px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25) !important;box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 4px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25) !important}.gallery-picker x-gallery-image:hover .actions{-webkit-transform:translateX(0px);transform:translateX(0px);opacity:1;visibility:visible;pointer-events:initial}}@media (hover: none) and (pointer: coarse){.gallery-picker x-gallery-image.selected .actions{-webkit-transform:translateX(0px);transform:translateX(0px);opacity:1;visibility:visible;pointer-events:initial}}.gallery-picker x-gallery-image.selected{border-color:var(--color-primary, #4275F2);-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25)}.is-dark-mode .gallery-picker x-gallery-image.selected{-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25)}.gallery-picker x-gallery-image.selected .checkmark{background-color:var(--color-primary, #4275F2);-webkit-transform:translateY(0px);transform:translateY(0px);opacity:1;-webkit-box-shadow:0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25);box-shadow:0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25)}.is-dark-mode .gallery-picker x-gallery-image.selected .checkmark{-webkit-box-shadow:0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25) !important;box-shadow:0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25) !important}.gallery-picker x-gallery-image.selected .checkmark:after{display:block}.gallery-picker x-gallery-image.loading{cursor:not-allowed;background-image:none !important;pointer-events:none}.gallery-picker x-gallery-image.loading .actions{display:none !important}.gallery-picker x-gallery-image .loading-indicator{width:2em;height:2em;position:absolute;color:inherit;display:inline-block;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-animation:cycle 0.8s infinite linear;animation:cycle 0.8s infinite linear;padding:0px;top:calc(50% - 1em);left:calc(50% - 1em)}.gallery-picker x-gallery-image .loading-indicator:after{content:\" \";display:block;width:4em;height:4em;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform-origin:0em 0em;transform-origin:0em 0em;-webkit-transform:translateZ(0) scale(0.5);transform:translateZ(0) scale(0.5);-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:50%;border:0.3em solid currentColor;border-left-color:transparent}.gallery-picker x-gallery-image .actions{display:block;position:absolute;bottom:0.25rem;right:0.25rem;-webkit-transition:0.3s;transition:0.3s;-webkit-transform:translateX(-30px);transform:translateX(-30px);opacity:0;visibility:hidden}.gallery-picker x-gallery-image .actions>button,.gallery-picker x-gallery-image .actions>a{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background-color:rgba(0, 0, 0, 0.5);border:1px solid transparent;width:2rem;height:2rem;border-radius:5px;margin-top:3px;-webkit-transition:0.3s;transition:0.3s}.gallery-picker x-gallery-image .actions>button x-icon,.gallery-picker x-gallery-image .actions>a x-icon{color:white;display:inline-block;-webkit-transition:0.3s;transition:0.3s}.gallery-picker x-gallery-image .actions>button:hover,.gallery-picker x-gallery-image .actions>a:hover{background-color:rgba(0, 0, 0, 0.7);-webkit-box-shadow:0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1), 0px 0px 0px 1px var(--color-primary, #4275F2);box-shadow:0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1), 0px 0px 0px 1px var(--color-primary, #4275F2)}.gallery-picker x-gallery-image .actions>button:hover x-icon,.gallery-picker x-gallery-image .actions>a:hover x-icon{-webkit-transform:scale(1.1);transform:scale(1.1)}.gallery-picker x-gallery-image .checkmark{position:absolute;bottom:-0.625rem;left:-0.625rem;height:1.6rem;width:1.6rem;border-radius:50%;-webkit-transition:0.3s;transition:0.3s;-webkit-transform:translateY(10px);transform:translateY(10px);opacity:0;z-index:5}.gallery-picker x-gallery-image .checkmark:after{content:\"\";position:absolute;display:none;left:8px;top:4px;width:5px;height:10px;border:solid white;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:content-box !important;box-sizing:content-box !important}@-webkit-keyframes onDrag{from{-webkit-transform:translateY(-3px);transform:translateY(-3px)}to{-webkit-transform:translateY(3px);transform:translateY(3px)}}@keyframes onDrag{from{-webkit-transform:translateY(-3px);transform:translateY(-3px)}to{-webkit-transform:translateY(3px);transform:translateY(3px)}}@media screen and (max-width: 680px){.gallery-picker .items{gap:0.5rem}}@media screen and (max-width: 650px){.image-gallery-modal .modal-slot{max-width:38rem !important}.gallery-picker .items{grid-template-columns:repeat(4, 1fr);gap:1rem}}@media screen and (max-width: 536px){.gallery-picker .items{grid-template-columns:repeat(5, 1fr)}.gallery-picker .items x-input-image{width:5rem;height:5rem;min-width:5rem;min-height:5rem}.gallery-picker .items x-input-image .upload-zone{width:5rem;height:5rem}.gallery-picker .items x-input-image .upload-zone>p{display:none}.gallery-picker .items x-gallery-image{width:5rem;height:5rem}}@media screen and (max-width: 452px){.gallery-picker .items{gap:0.5rem}}@media screen and (max-width: 422px){.gallery-picker .items{grid-template-columns:repeat(4, 1fr);gap:1rem}}@media screen and (max-width: 370px){.gallery-picker .items{gap:0.5rem}}@media screen and (max-width: 346px){.gallery-picker .items{grid-template-columns:repeat(4, 1fr)}}@media screen and (max-width: 336px){.gallery-picker .items{grid-template-columns:repeat(3, 1fr)}}";
const XGalleryStyle0 = styleCss;

const GALLERY_ROUTE = '/services/media';
const XGallery$1 = /*@__PURE__*/ proxyCustomElement(class XGallery extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.onSelected = createEvent(this, "selected", 3);
        this.onCanceled = createEvent(this, "canceled", 3);
        this.appendHeaders = {};
        this.endpoint = '';
        this.loading = false;
        this.errorMessage = undefined;
        this.selectedMedia = undefined;
        this.galleryCollection = [];
        this.galleryPage = 1;
        this.galleryResultsCount = 0;
        this.galleryHasMore = false;
        this.galleryUploadProgress = undefined;
        this.generatedCollection = [];
    }
    /**
     * Call the gallery window
     */
    async load(cropperOptions) {
        this.resetData();
        this.loadGalleryAssets();
        this.loadGeneratedAssets();
        cropperOptions && this.inputImage.setCropperOptions(cropperOptions);
        this.modal.open();
    }
    /**
     * Add initial values to components
     */
    resetData() {
        this.loading = false;
        this.errorMessage = null;
        this.galleryCollection = [];
        this.galleryPage = 1;
        this.galleryResultsCount = 0;
        this.galleryHasMore = false;
        this.generatedCollection = [];
        this.selectedMedia = null;
    }
    /**
     * Axios response error capture
     */
    catchRequestFail(err) {
        if (err.response) {
            let data = err.response.data;
            return data.message ? data.message : `Response ${err.response.status}`;
        }
        else if (err.request) {
            return err.request;
        }
        else {
            return err.message;
        }
    }
    /**
     * Get element by UUID
     */
    getIndexCollectionByUUID(collection, uuid) {
        return collection.findIndex(x => x.uuid === uuid);
    }
    /**
     * Loading all images saved for actual user
     */
    loadGalleryAssets(page = 1) {
        this.errorMessage = null;
        this.loading = true;
        axios({
            method: 'GET',
            url: `${this.endpoint}${GALLERY_ROUTE}/gallery?page=${page}`,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            this.galleryPage = page;
            if (page > 1) {
                this.galleryCollection = this.galleryCollection.concat(data.items);
            }
            else {
                this.galleryCollection = data.items;
            }
            this.galleryHasMore = data.has_more;
            this.galleryResultsCount = data.total;
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
        });
    }
    /**
     * Loading last generated images for actual user
     */
    loadGeneratedAssets() {
        this.errorMessage = null;
        this.loading = true;
        axios({
            method: 'GET',
            url: `${this.endpoint}${GALLERY_ROUTE}/generate`,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            this.generatedCollection = data.items;
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
        });
    }
    /**
     * Select the element ready for choose
     */
    onSelectMedia(media) {
        this.selectedMedia = media;
    }
    /**
     * Upload image and return file
     */
    onUploadImage(e) {
        if (this.loading) {
            return;
        }
        this.galleryCollection.unshift({
            uuid: 'upload-image',
            url: URL.createObjectURL(e.detail),
            type: 'image',
            loading: true,
        });
        this.errorMessage = null;
        this.galleryUploadProgress = null;
        this.loading = true;
        const data = new FormData();
        data.append('image', e.detail);
        axios({
            method: 'POST',
            url: `${this.endpoint}${GALLERY_ROUTE}/gallery`,
            data: data,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') }),
            onUploadProgress: progressEvent => {
                this.galleryUploadProgress = Math.round((progressEvent.loaded * 100) / progressEvent.total);
            }
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            const index = this.getIndexCollectionByUUID(this.galleryCollection, 'upload-image');
            this.galleryCollection[index] = data;
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
            this.galleryUploadProgress = null;
        });
    }
    /**
     * Delete image and return confirmation
     */
    onDeleteImage(uuid) {
        this.errorMessage = null;
        this.loading = true;
        axios({
            method: 'DELETE',
            url: `${this.endpoint}${GALLERY_ROUTE}/gallery?uuid=${uuid}`,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            const index = this.getIndexCollectionByUUID(this.galleryCollection, data.uuid);
            if (index != -1) {
                this.galleryCollection.splice(index, 1);
                this.selectedMedia = null;
            }
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
        });
    }
    /**
     * Send IA prompt and return image result
     */
    onPromptImage(prompt) {
        if (this.loading) {
            return;
        }
        this.generatedCollection.unshift({
            uuid: 'generate-image',
            url: '',
            type: 'image',
            loading: true,
        });
        this.errorMessage = null;
        this.loading = true;
        this.promptInput.setAttribute('disabled', 'disabled');
        const data = new FormData();
        data.append('prompt', prompt);
        axios({
            method: 'POST',
            url: `${this.endpoint}${GALLERY_ROUTE}/generate`,
            data: data,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            const index = this.getIndexCollectionByUUID(this.generatedCollection, 'generate-image');
            this.generatedCollection[index] = data;
        })
            .catch(err => {
            this.generatedCollection.shift();
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
            this.promptInput.removeAttribute('disabled');
        });
    }
    /**
     * On window finish selection of media element
     */
    onFinishSelectMedia(media) {
        this.modal.close();
        setTimeout(() => {
            this.resetData();
        }, 500);
        media ? this.onSelected.emit(media) : this.onCanceled.emit();
    }
    /**
     * Render the component
     */
    render() {
        var _a;
        return (h(Host, { key: '6ec66ce340c0418e53ac0e55d95620bda3e14324' }, h("x-modal", { key: '1b37ce8172531043b6945c03b9c3f0ee5718bde6', class: "image-gallery-modal", ref: el => (this.modal = el), closable: false, size: "big" }, h("x-card", { key: 'ecc9f511b593df1de10580d89fe167ea84c35620', icon: "image-gallery", "icon-color": "primary", class: "gallery-picker" }, h("x-tabs", { key: '632d04045d2cac40751673a710a5a581ff1f4b5e' }, h("x-tab", { key: 'fa1de15f462f78972c294b9d70e8f68de9d27224', label: Lang.get('gallery.gallery'), badge: ((_a = this.selectedMedia) === null || _a === void 0 ? void 0 : _a.type) == 'image' ? 1 : null }, h("div", { key: '4a8595061b568f62d46bc94235874aa16547c6b8', class: "items" }, h("x-input-image", { key: '337f55f8a9b71c8a8ced67f3dc872cd97d199b92', ref: el => this.inputImage = el, "without-preview": true, onFile: e => this.onUploadImage(e) }, h("x-cropper", { key: '96e89a5e830c40fedbcc72c3cdc212b787e45695' })), this.galleryCollection.map(item => {
            var _a;
            return (h("x-gallery-image", { url: item.url, key: item.uuid, uuid: item.uuid, selected: ((_a = this.selectedMedia) === null || _a === void 0 ? void 0 : _a.uuid) == item.uuid, loading: item.loading, onClick: () => this.onSelectMedia(item) }, h("a", { href: item.url, download: true, title: Lang.get('gallery.download') }, h("x-icon", { name: "download" })), h("button", { onClick: () => this.onDeleteImage(item.uuid), title: Lang.get('gallery.delete') }, h("x-icon", { name: "trash" }))));
        })), this.galleryHasMore && !this.loading && (h("x-divider", { key: '21909e237bf65bd5a6625705dbdb67e64a0a783c', align: "center" }, h("a", { key: 'c7bfd5fe9be1d3599517399fd1b7b2a5fb4af3d0', href: "#", class: { disabled: this.loading }, onClick: () => this.loadGalleryAssets(this.galleryPage + 1) }, Lang.get('gallery.view-more')))), !!this.galleryResultsCount && !this.loading && (h("div", { key: '52fbb2db3279696db733c549d90895152e4a0fb5', class: "results mt-4", innerHTML: tinyMDtoHTML(Lang.get('gallery.gallery-results', {
                length: this.galleryCollection.length,
                total: this.galleryResultsCount,
            })) })), this.errorMessage && (h("x-alert", { key: '0777155f30afbeb2f58e12bfdab147a53725eda9', small: true, color: "danger", icon: "danger" }, this.errorMessage)), this.loading && h("x-progress", { key: '8269654f0ecd331f931437285d9e52e3bac03fcc', loading: !this.galleryUploadProgress, value: this.galleryUploadProgress })), h("x-tab", { key: '7247ba853b2ad6adb787e2b35a3fd6f781a92a4b', label: Lang.get('gallery.generate') }, h("x-input", { key: '32ac3f3de670075e34763e8b7535743992110e75', ref: el => (this.promptInput = el), placeholder: Lang.get('gallery.generate-placeholder') }, h("x-icon", { key: '8cd94693e2a39dfffdae1a796f50b57be136d72e', name: "chatgpt", size: "24px", slot: "indicator" }), h("x-button", { key: '7805d0818f5b434e31a22918ce20710275f3f9cb', icon: "right", slot: "buttons", onClick: () => this.onPromptImage(String(this.promptInput.value)) })), this.generatedCollection.length > 0 && h("x-divider", { key: '34838f7753b804210a00a4c850172a15b522648d', class: "my-4" }, Lang.get('gallery.generated-images')), this.generatedCollection.length > 0 && (h("div", { key: 'b3966cf2ec6d690e2995ca3e5739ad143785808c', class: "items" }, this.generatedCollection.map(item => {
            var _a;
            return (h("x-gallery-image", { url: item.url, key: item.uuid, uuid: item.uuid, selected: ((_a = this.selectedMedia) === null || _a === void 0 ? void 0 : _a.uuid) == item.uuid, loading: item.loading, onClick: () => this.onSelectMedia(item) }, h("a", { href: item.url, download: true, target: "_blank", title: Lang.get('gallery.download') }, h("x-icon", { name: "download" })), h("button", { onClick: () => this.onPromptImage(item.prompt), title: Lang.get('gallery.reprompt', { prompt: item.prompt }) }, h("x-icon", { name: "sparkling" }))));
        }))), this.errorMessage && (h("x-alert", { key: 'c57b02deb8e9d5f565938bd9aed1bc04928cc3d0', small: true, class: "mt-3", color: "danger", icon: "danger" }, this.errorMessage)), this.loading && h("x-progress", { key: 'af8520f0f9c6b893b9c4ee9833c6b18819e6f793', loading: true }))), h("x-card-segment", { key: '0a9e492af57a70a754042b4edb6acee4389366d9', slot: "footer", tinted: true }, h("x-button", { key: 'd5254b66c68685123ec6fe99eabffe8b01908941', small: true, icon: "left", onClick: () => this.onFinishSelectMedia() }, Lang.get('gallery.back')), h("x-button", { key: 'd42d3cd9f188102230d694e062aed4c83ad77ad4', small: true, icon: "check", color: "primary", disabled: !this.selectedMedia, onClick: () => this.onFinishSelectMedia(this.selectedMedia) }, Lang.get('gallery.select')))))));
    }
    static get style() { return XGalleryStyle0; }
}, [0, "x-gallery", {
        "appendHeaders": [16],
        "endpoint": [1],
        "loading": [32],
        "errorMessage": [32],
        "selectedMedia": [32],
        "galleryCollection": [32],
        "galleryPage": [32],
        "galleryResultsCount": [32],
        "galleryHasMore": [32],
        "galleryUploadProgress": [32],
        "generatedCollection": [32],
        "load": [64]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["x-gallery", "x-alert", "x-animate", "x-badge", "x-button", "x-card", "x-card-segment", "x-cropper", "x-divider", "x-dropdown", "x-gallery-image", "x-icon", "x-input", "x-input-image", "x-modal", "x-progress", "x-tab", "x-tabs", "x-tooltip"];
    components.forEach(tagName => { switch (tagName) {
        case "x-gallery":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, XGallery$1);
            }
            break;
        case "x-alert":
            if (!customElements.get(tagName)) {
                defineCustomElement$j();
            }
            break;
        case "x-animate":
            if (!customElements.get(tagName)) {
                defineCustomElement$i();
            }
            break;
        case "x-badge":
            if (!customElements.get(tagName)) {
                defineCustomElement$h();
            }
            break;
        case "x-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$g();
            }
            break;
        case "x-card":
            if (!customElements.get(tagName)) {
                defineCustomElement$f();
            }
            break;
        case "x-card-segment":
            if (!customElements.get(tagName)) {
                defineCustomElement$e();
            }
            break;
        case "x-cropper":
            if (!customElements.get(tagName)) {
                defineCustomElement$d();
            }
            break;
        case "x-divider":
            if (!customElements.get(tagName)) {
                defineCustomElement$c();
            }
            break;
        case "x-dropdown":
            if (!customElements.get(tagName)) {
                defineCustomElement$b();
            }
            break;
        case "x-gallery-image":
            if (!customElements.get(tagName)) {
                defineCustomElement$a();
            }
            break;
        case "x-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$9();
            }
            break;
        case "x-input":
            if (!customElements.get(tagName)) {
                defineCustomElement$8();
            }
            break;
        case "x-input-image":
            if (!customElements.get(tagName)) {
                defineCustomElement$7();
            }
            break;
        case "x-modal":
            if (!customElements.get(tagName)) {
                defineCustomElement$6();
            }
            break;
        case "x-progress":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "x-tab":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "x-tabs":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "x-tooltip":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const XGallery = XGallery$1;
const defineCustomElement = defineCustomElement$1;

export { XGallery, defineCustomElement };
