{"version":3,"sources":["jsdelivr-header.js","/npm/@fluidnext-polymer/paper-autocomplete@3.1.1/paper-autocomplete.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,KAAM,mBAAsB,yCAC9B,yCACA,qDACA,uCACA,mCAEP,MAAM,0BAA0B,eAC5B,mBAAW,GACP,OAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2Hf,CAEA,qBAAW,GACP,MAAO,CAIH,aAAc,CACV,KAAM,QACN,OAAO,GAKX,QAAS,CACL,KAAM,QACN,QAAQ,EACR,OAAO,GAKX,eAAgB,CACZ,KAAM,QAMV,aAAc,CACV,KAAM,QAMV,MAAO,CACH,KAAM,QAMV,aAAc,CACV,KAAM,QACN,OAAO,GAMX,iBAAkB,CACd,KAAM,QACN,OAAO,GAMX,YAAa,CACT,KAAM,QAMV,SAAU,CACN,KAAM,QACN,OAAO,GAMX,SAAU,CACN,KAAM,QACN,OAAO,GAMX,QAAS,CACL,KAAM,QACN,OAAO,EACP,QAAQ,GAMZ,SAAU,CACN,KAAM,QACN,OAAO,GAMX,OAAQ,CACJ,KAAM,MACN,SAAU,kBAMd,aAAc,CACV,KAAM,OACN,MAAO,QAMX,MAAO,CACH,KAAM,OACN,QAAQ,EACR,MAAO,IAAc,KACrB,SAAU,gBAMd,KAAM,CACF,KAAM,OACN,QAAQ,EACR,MAAO,GACP,SAAU,iBAMd,iBAAkB,CACd,KAAM,QACN,OAAO,GAMX,aAAc,CACV,KAAM,QACN,OAAO,GAMX,eAAgB,CACZ,KAAM,OACN,MAAO,KAMX,UAAW,CACP,KAAM,OACN,MAAO,GAMX,QAAS,CACL,KAAM,QAMV,eAAgB,CACZ,KAAM,QAMV,YAAa,CACT,KAAM,QACN,OAAO,GAMX,UAAW,CACP,KAAM,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AK,EAAE,MAAM,MAAM,QAAU,OAC7B,KAAK,uBAAwB,EACjC,CAEA,MAAA,GACI,IAAI,EAAK,KAAK,aAAa,MAE3B,OADK,IAAI,EAAK,KAAK,QAAQ,IACpB,CACX,CAKA,WAAA,GACI,KAAK,KAAO,GACZ,KAAK,MAAQ,KACb,KAAK,kBACT,CAMA,SAAA,CAAU,GACF,KAAK,KAAO,EAAM,KAAK,cACvB,KAAK,kBACb,CAKA,MAAA,CAAO,GACH,IAAI,EAAS,CACT,KAAM,KAAK,KACX,MAAO,KAAK,OAIhB,KAAK,cAEL,KAAK,WAAW,EAAQ,cAGnB,KAAK,EAAE,kBAAkB,SAC1B,KAAK,EAAE,kBAAkB,OAEjC,CAEA,YAAA,CAAa,EAAU,GACnB,IAAQ,KACC,GAAiC,iBAAf,IAA6B,MAAM,QAAQ,IAC9D,KAAK,UAAU,QAGf,KAAK,aAGjB,CAUA,SAAA,GACI,MAAO,CACH,KAAM,KAAK,KACX,MAAO,KAAK,MAEpB,CAMA,WAAA,CAAY,GACR,KAAK,EAAE,6BAA6B,YAAY,EACpD,CAMA,QAAA,GACI,OAAO,KAAK,EAAE,kBAAkB,UACpC,CAKA,KAAA,GACI,KAAK,QACT,CAKA,eAAA,GACI,KAAK,mBACL,KAAK,EAAE,6BAA6B,iBACxC,CAOA,eAAA,CAAgB,GACZ,KAAK,EAAE,6BAA6B,UAAU,EAClD,EAqDJ,OAAO,eAAe,OAAO,qBAAsB","file":"/npm/@fluidnext-polymer/paper-autocomplete@3.1.1/paper-autocomplete.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@fluidnext-polymer/paper-autocomplete@3.1.1/paper-autocomplete.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { html, PolymerElement } from '@polymer/polymer/polymer-element';\nimport '@polymer/paper-input/paper-input';\nimport '@polymer/paper-icon-button/paper-icon-button';\nimport './icons/paper-input-file-icons';\nimport './paper-autocomplete-suggestions';\n\nclass PaperAutocomplete extends PolymerElement {\n    static get template() {\n        return html`\n            <style>\n                :host {\n                    display: block;\n                    box-sizing: border-box;\n                    position: relative;\n                    color: var(--paper-autocomplete-main-color);\n                    min-height: var(--paper-autocomplete-min-height);\n                }\n                \n                /**\n                 * TODO rewrite\n                 */\n                paper-icon-button {\n                \n                    --paper-icon-button : {\n                        padding: 2px;\n                        height: 24px;\n                        width: 24px;\n                       \n                    }\n                    \n                     --iron-icon : {\n                        height: 18px;\n                        width: 18px;\n                        margin-bottom: 9px;\n                     }\n                }\n                \n                ::slotted(paper-icon-button) {\n\n                    padding: 0;\n                    margin: 2px;\n                    top: -4px;\n                    height: 18px;\n                    width: 18px;\n                }\n                \n                :host(paper-icon-button[slot=\"suffix\"]) {\n                    background-color: green;\n                }\n\n                #clear {\n                    display: none;\n                }\n\n                .sr-only {\n                    position: absolute;\n                    clip: rect(1px, 1px, 1px, 1px);\n                }\n                \n                paper-autocomplete-suggestions {\n                    --suggestions-wrapper: {\n                        color: var(--paper-autocomplete-suggestions-color, var(--paper-autocomplete-main-color));\n                        --paper-item-min-height: var(--suggestions-item-min-height);\n                    }\n                }\n                \n                paper-input{\n                    --paper-input-container-color: var(--paper-autocomplete-main-color);\n                    --paper-input-container-focus-color: var(--paper-autocomplete-main-color);\n                    --paper-input-container-input-color: var(--paper-input-font-color);\n                }\n            </style>\n            <div class=\"autocomplete-wrapper\">\n                <!-- Find all information for WAI-ARIA (role attribute ecc..) in this site https://www.w3.org/TR/wai-aria-1.1/#combobox -->\n                <div class=\"input-wrapper\" role=\"combobox\" aria-haspopup=\"true\" aria-owns=\"suggestionsWrapper\" aria-expanded$=\"[[_isSuggestionsOpened]]\">\n                    <!-- For accessibility, it is needed to have a label or aria-label. Label is preferred -->\n                    <label for=\"autocompleteInput\" class=\"sr-only\">[[label]]</label>\n\n                    <paper-input id=\"autocompleteInput\"\n                                label=\"[[label]]\"\n                                autocapitalize=\"[[autocapitalize]]\"\n                                no-label-float=\"[[noLabelFloat]]\"\n                                disabled=\"{{disabled}}\"\n                                readonly=\"[[readonly]]\"\n                                focused=\"{{focused}}\"\n                                auto-validate$=\"[[autoValidate]]\"\n                                error-message$=\"[[errorMessage]]\"\n                                required$=\"[[required]]\"\n                                value=\"{{text}}\"\n                                allowed-pattern=\"[[allowedPattern]]\"\n                                pattern=\"[[pattern]]\"\n                                no-label-float=\"[[noLabelFloat]]\"\n                                always-float-label=\"[[alwaysFloatLabel]]\"\n                                char-counter$=\"[[charCounter]]\"\n                                maxlength$=\"[[maxlength]]\"\n                                placeholder=\"[[placeholder]]\"\n                                invalid=\"{{invalid}}\"\n\n                                role=\"textbox\"\n                                aria-autocomplete=\"list\"\n                                aria-multiline=\"false\"\n                                aria-activedescendant$=\"[[_highlightedSuggestion.elementId]]\"\n                                aria-disabled$=\"[[disabled]]\"\n                                aria-controls=\"autocompleteStatus suggestionsWrapper\"\n                    >\n\n                        <slot name=\"prefix\" slot=\"prefix\"></slot>\n                        <paper-icon-button slot=\"suffix\" suffix id=\"clear\" icon=\"paper-autocomplete:clear\" on-click=\"_clear\"></paper-icon-button>\n                        <slot name=\"suffix\" slot=\"suffix\"></slot>\n                    </paper-input>\n                    <!-- to announce current selection to screen reader -->\n                    <!-- <span id=\"autocompleteStatus\" role=\"status\" class=\"sr-only\">[[_highlightedSuggestion.textValue]]</span> -->\n                </div>\n\n                <paper-autocomplete-suggestions for=\"autocompleteInput\"\n                                                id=\"paperAutocompleteSuggestions\"\n                                                min-length=\"[[minLength]]\"\n                                                text-property=\"[[textProperty]]\"\n                                                source=\"[[source]]\"\n                                                remote-source=\"[[remoteSource]]\"\n                                                query-fn=\"[[queryFn]]\"\n                                                event-namespace=\"[[eventNamespace]]\"\n                                                highlighted-suggestion=\"{{_highlightedSuggestion}}\"\n                                                is-open=\"{{_isSuggestionsOpened}}\"\n                                                highlight-first=\"[[highlightFirst]]\"\n                                                show-results-on-focus=\"[[showResultsOnFocus]]\">\n\n                    <slot id=\"customTemplate\" name=\"autocomplete-custom-template\"></slot>\n                </paper-autocomplete-suggestions>\n            </div>\n        `;\n    }\n\n    static get properties() {\n        return {\n            /**\n             * `autoValidate` Set to true to auto-validate the input value.\n             */\n            autoValidate: {\n                type: Boolean,\n                value: false\n            },\n            /**\n             * Setter/getter manually invalid input\n             */\n            invalid: {\n                type: Boolean,\n                notify: true,\n                value: false\n            },\n            /**\n             * `autocapitalize` Sets auto-capitalization for the input element.\n             */\n            autocapitalize: {\n                type: String\n            },\n\n            /**\n             * `errorMessage` The error message to display when the input is invalid.\n             */\n            errorMessage: {\n                type: String\n            },\n\n            /**\n             * `label` Text to display as the input label\n             */\n            label: {\n                type: String\n            },\n\n            /**\n             * `noLabelFloat` Set to true to disable the floating label.\n             */\n            noLabelFloat: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * `alwaysFloatLabel` Set to true to always float label\n             */\n            alwaysFloatLabel: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * The placeholder text\n             */\n            placeholder: {\n                type: String\n            },\n\n            /**\n             * `required` Set to true to mark the input as required.\n             */\n            required: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * `readonly` Set to true to mark the input as readonly.\n             */\n            readonly: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * `focused` If true, the element currently has focus.\n             */\n            focused: {\n                type: Boolean,\n                value: false,\n                notify: true\n            },\n\n            /**\n             * `disabled` Set to true to mark the input as disabled.\n             */\n            disabled: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * `source` Array of objects with the options to execute the autocomplete feature\n             */\n            source: {\n                type: Array,\n                observer: '_sourceChanged'\n            },\n\n            /**\n             * Property of local datasource to as the text property\n             */\n            textProperty: {\n                type: String,\n                value: 'text'\n            },\n\n            /**\n             * `value` Selected object from the suggestions\n             */\n            value: {\n                type: Object,\n                notify: true,\n                value: () => {return null},\n                observer: '_changeValue'\n            },\n\n            /**\n             * The current/selected text of the input\n             */\n            text: {\n                type: String,\n                notify: true,\n                value: '',\n                observer: '_textObserver'\n            },\n\n            /**\n             * Disable showing the clear X button\n             */\n            disableShowClear: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * Binds to a remote data source\n             */\n            remoteSource: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * Event type separator\n             */\n            eventNamespace: {\n                type: String,\n                value: '-'\n            },\n\n            /**\n             * Minimum length to trigger suggestions\n             */\n            minLength: {\n                type: Number,\n                value: 1\n            },\n\n            /**\n             * `pattern` Pattern to validate input field\n             */\n            pattern: {\n                type: String\n            },\n\n            /**\n             * `allowedPattern` to validate input field\n             */\n            allowedPattern: {\n                type: String\n            },\n\n            /**\n             * Set to `true` to show a character counter.\n             */\n            charCounter: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * The maximum length of the input value.\n             */\n            maxlength: {\n                type: Number\n            },\n\n            /**\n             * Name to be used by the autocomplete input. This is necessary if wanted to be integrated with iron-form.\n             */\n            name: {\n                type: String\n            },\n\n            /**\n             * Function used to filter available items. This function is actually used by paper-autocomplete-suggestions,\n             * it is also exposed here so it is possible to provide a custom queryFn.\n             */\n            queryFn: {\n                type: Function\n            },\n\n            /**\n             * If `true`, it will always highlight the first result each time new suggestions are presented.\n             */\n            highlightFirst: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * Set to `true` to show available suggestions on focus. This overrides the default behavior that only shows\n             * notifications after user types\n             */\n            showResultsOnFocus: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * Set to `true` for auto clear paper-input after the select\n             */\n            autoClear: {\n                type: Boolean,\n                value: false,\n                notify: true\n            },\n\n            /**\n             * Delay for clear paper-input after the select\n             */\n            clearDelay: {\n                type: Number,\n                value: 200,\n                notify: true\n            },\n\n            /*************\n            * PRIVATE\n            *************/\n\n            /**\n             * Indicates whether the clear button is visible or not\n             */\n            _isClearButtonVisible: {\n                type: Boolean,\n                value: false\n            },\n\n            /**\n             * Indicates whether the suggestion popup is visible or not.\n             */\n            _isSuggestionsOpened: {\n                type: Boolean,\n                value: false\n            }\n        }\n    }\n\n    ready() {\n        super.ready();\n        this.addEventListener('autocomplete-selected', this._onAutocompleteSelected);\n    }\n\n    _sourceChanged(newSource) {\n        var text = this.text;\n        if (!Array.isArray(newSource) || newSource.length === 0 || text == null || text.length < this.minLength) {\n            return;\n        }\n        if (!this.$.autocompleteInput.focused) {\n            return;\n        }\n        this.$.paperAutocompleteSuggestions._handleSuggestions({\n            target: {\n                value: text\n            }\n        });\n    }\n\n    /**\n     * Dispatches autocomplete events\n     */\n    _fireEvent(option, evt) {\n        var id = this._getId();\n        var event = 'autocomplete' + this.eventNamespace + evt;\n\n        this.dispatchEvent(new CustomEvent(event, {\n            detail:\n            {\n                id: id,\n                value: option.value,\n                text: option[this.textProperty] || option.text,\n                target: this\n            },\n            bubbles: true,\n            composed: true\n        }));\n    }\n\n    /**\n     * On text event handler\n     */\n    _textObserver(text) {\n        if (text && text.trim()) {\n            this._showClearButton();\n        } else {\n            this._hideClearButton();\n        }\n    }\n\n    /**\n     * On autocomplete selection\n     */\n    _onAutocompleteSelected(evt) {\n        var selection = evt.detail.value;\n        this.value = selection;\n        if (this.autoClear === true) {\n            setTimeout(this._clear.bind(this), this.clearDelay);\n        }\n    }\n\n    /**\n     * On autocomplete change\n     */\n    _onAutocompleteChange(evt) {\n        var selection = evt.detail;\n        this._fireEvent(selection.value, 'change');\n    }\n\n    /**\n     * Show the clear button (X)\n     */\n    _showClearButton() {\n        if (this.disableShowClear) {\n            return;\n        }\n\n        if (this._isClearButtonVisible) {\n            return;\n        }\n\n        this.$.clear.style.display = 'inline-block';\n        this._isClearButtonVisible = true;\n    }\n\n    /**\n     * Hide the clear button (X)\n     */\n    _hideClearButton() {\n        if (!this._isClearButtonVisible) {\n            return;\n        }\n\n        this.$.clear.style.display = 'none';\n        this._isClearButtonVisible = false;\n    }\n\n    _getId() {\n        var id = this.getAttribute('id');\n        if (!id) id = this.dataset.id;\n        return id;\n    }\n\n    /**\n     * Clear value and text\n     */\n    _clearValue(){\n        this.text = '';\n        this.value = null;\n        this._hideClearButton();\n    }\n\n    /**\n     * Sets the current text/value option of the input\n     * @param {Object} option\n     */\n    _setValue(value){\n            this.text = value[this.textProperty];\n            this._showClearButton();\n    }\n\n    /**\n     * Clear the input text\n     */\n    _clear(evt) {\n        var option = {\n            text: this.text,\n            value: this.value\n        };\n        // console.warn('option', option);\n\n        this._clearValue();\n\n        this._fireEvent(option, 'reset-blur');\n\n        // Fix: https://github.com/PolymerElements/paper-input/issues/493\n        if (!this.$.autocompleteInput.focused) {\n            this.$.autocompleteInput.focus();\n        }\n    }\n    \n    _changeValue(newValue, oldValue) {\n        switch (true){\n            case newValue && typeof(newValue) === \"object\"  && !Array.isArray(newValue) :\n                this._setValue(newValue);\n                break;\n            default :\n                this._clearValue();\n                break;\n        }\n    }\n\n    /****************************\n     * PUBLIC\n     ****************************/\n\n    /**\n     * Gets the current text/value option of the input\n     * @returns {Object}\n     */\n    getOption() {\n        return {\n            text: this.text,\n            value: this.value\n        };\n    }\n\n    /**\n     * Sets the component's current suggestions\n     * @param {Array} arr\n     */\n    suggestions(arr) {\n        this.$.paperAutocompleteSuggestions.suggestions(arr);\n    }\n\n    /**\n     * Validates the input\n     * @returns {Boolean}\n     */\n    validate() {\n        return this.$.autocompleteInput.validate();\n    }\n\n    /**\n     * Clears the current input\n     */\n    clear() {\n        this._clear();\n    }\n\n    /**\n     * Hides the suggestions popup\n     */\n    hideSuggestions() {\n        this._hideClearButton();\n        this.$.paperAutocompleteSuggestions.hideSuggestions();\n    }\n\n    /**\n     * Allows calling the onSelect function from outside\n     * This in time triggers the autocomplete-selected event\n     * with all the data required\n     */\n    onSelectHandler(event) {\n        this.$.paperAutocompleteSuggestions._onSelect(event);\n    }\n\n    /**\n     * Fired when a selection is made\n     *\n     * @event autocomplete-selected\n     * @param {String} id\n     * @param {Object} value\n     * @param {String} text\n     * @param {Element} target\n     */\n\n    /**\n     * Fired on input change\n     *\n     * @event autocomplete-change\n     * @param {String} id\n     * @param {Object} value\n     * @param {String} text\n     * @param {Element} target\n     */\n\n    /**\n     * Fired on input focus\n     *\n     * @event autocomplete-focus\n     * @param {String} id\n     * @param {Object} value\n     * @param {String} text\n     * @param {Element} target\n     */\n\n    /**\n     * Fired on input blur\n     *\n     * @event autocomplete-blur\n     * @param {String} id\n     * @param {Object} value\n     * @param {String} text\n     * @param {Element} target\n     */\n\n    /**\n     * Fired on input reset/clear\n     *\n     * @event autocomplete-reset-blur\n     * @param {String} id\n     * @param {Object} value\n     * @param {String} text\n     * @param {Element} target\n     */\n}\n\nwindow.customElements.define('paper-autocomplete', PaperAutocomplete);\n"]}