{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/theme-18cbe2cc.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-searchbar-md.entry.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/index-3476b023.js"],"names":["hostContext","selector","el","closest","createColorClasses","color","_a","length","undefined","getClassMap","classes","map","Array","isArray","split","filter","c","trim","forEach","SCHEME","openURL","url","ev","direction","router","this","test","document","querySelector","preventDefault","push","Searchbar","class_1","prototype","debounceChanged","ionChange","debounce","valueChanged","inputEl","nativeInput","value","getValue","emit","showCancelButtonChanged","_this","requestAnimationFrame","positionElements","forceUpdate","connectedCallback","emitStyle","componentDidLoad","showCancelButton","console","warn","setTimeout","noAnimate","ionStyle","setFocus","focus","getInputElement","Promise","resolve","prevAlignLeft","shouldAlignLeft","mode","animated","focused","positionPlaceholder","positionCancelButton","isRTL","iconEl","inputLeft","iconLeft","dir","shadowRoot","removeAttribute","tempSpan","doc","createElement","innerHTML","placeholder","body","appendChild","textWidth","offsetWidth","remove","style","paddingRight","marginRight","paddingLeft","marginLeft","cancelStyle","cancelButton","shouldShowCancel","shouldShowCancelButton","isCancelVisible","offset","hasValue","isCancelButtonSetToNever","isCancelButtonSetToFocus","render","getBoolean","clearIcon","searchIcon","type","tabIndex","onMouseDown","onCancelSearchbar","onTouchStart","class","icon","cancelButtonIcon","lazy","cancelButtonText","role","disabled","Object","assign","ref","inputMode","inputmode","onInput","onBlur","onFocus","autoComplete","autocomplete","autoCorrect","autocorrect","spellCheck","spellcheck","onClearInput","defineProperty","get","enumerable","configurable","hostRef","ionClear","stopPropagation","ionInput","ionCancel","blur","input","target","ionBlur","ionFocus","sanitizeDOMString","untrustedString","documentFragment_1","createDocumentFragment","workingDiv","dfChildren","blockedTags","blockedTag","getElementsToRemove","querySelectorAll","elementIndex","element","childElements","parentNode","removeChild","getElementChildren","childIndex","sanitizeElement","fragmentDiv","getInnerDiv","err","error","nodeType","i","attributes","attribute","item","attributeName","name","allowedAttribut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C,EAMgBD,EAAmBb,CAAkB,GAE7Cc,EAAa,EAAGA,EAAaX,EAAW/I,OAAQ0J,CAAU,GAC/DC,EAAgBZ,EAAWW,EAAW,EAG1C,IAAIE,EAAcxI,SAASmD,cAAc,KAAK,EAG1CsF,GAFJD,EAAYjF,YAAYiE,CAAkB,EAExBgB,EAAYvI,cAAc,KAAK,GACjD,OAAwB,OAAhBwI,EAAwBA,EAAwBD,GAAZpF,SAKhD,CAHA,MAAOsF,GAEH,OADAjH,QAAQkH,MAAMD,CAAG,EACV,EACX,CACJ,EAMIH,EAAkB,SAAUN,GAE5B,GAAIA,GAAQW,UAAiC,IAArBX,EAAQW,SAAhC,CAGA,IAAK,IAAIC,EAAIZ,EAAQa,WAAWlK,OAAS,EAAQ,GAALiK,EAAQA,CAAC,GAAI,CACrD,IAAIE,EAAYd,EAAQa,WAAWE,KAAKH,CAAC,EACrCI,EAAgBF,EAAUG,KAEzBC,EAAkBC,SAASH,EAAcI,YAAY,CAAC,EAQrC,OAFlBC,EAAiBP,EAAUlI,QAEDyI,EAAeD,YAAY,EAAED,SAAS,aAAa,GAC7EnB,EAAQjF,gBAAgBiG,CAAa,EARrChB,EAAQjF,gBAAgBiG,CAAa,CAU7C,CAMA,IAFA,IAAIf,EAAgBG,EAAmBJ,CAAO,EAErCY,EAAI,EAAGA,EAAIX,EAActJ,OAAQiK,CAAC,GACvCN,EAAgBL,EAAcW,EAAE,CAvBpC,CAyBJ,EAKIR,EAAqB,SAAU9J,GAC/B,OAAuB,MAAfA,EAAGgL,SAAoBhL,EAAGgL,SAAWhL,EAAGiL,UACpD,EACIL,EAAoB,CAAC,QAAS,KAAM,OAAQ,MAAO,OAAQ,QAC3DvB,EAAc,CAAC,SAAU,QAAS,SAAU,OAAQ,OAAQ,SAAU,Q","file":"js/chunk-173239cb.7454a4a7.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nvar hostContext = function (selector, el) {\n    return el.closest(selector) !== null;\n};\n/**\n * Create the mode and color classes for the component based on the classes passed in\n */\nvar createColorClasses = function (color) {\n    var _a;\n    return (typeof color === 'string' && color.length > 0) ? (_a = {\n            'ion-color': true\n        },\n        _a[\"ion-color-\" + color] = true,\n        _a) : undefined;\n};\nvar getClassList = function (classes) {\n    if (classes !== undefined) {\n        var array = Array.isArray(classes) ? classes : classes.split(' ');\n        return array\n            .filter(function (c) { return c != null; })\n            .map(function (c) { return c.trim(); })\n            .filter(function (c) { return c !== ''; });\n    }\n    return [];\n};\nvar getClassMap = function (classes) {\n    var map = {};\n    getClassList(classes).forEach(function (c) { return map[c] = true; });\n    return map;\n};\nvar SCHEME = /^[a-z][a-z0-9+\\-.]*:/;\nvar openURL = function (url, ev, direction) { return __awaiter(void 0, void 0, void 0, function () {\n    var router;\n    return __generator(this, function (_a) {\n        if (url != null && url[0] !== '#' && !SCHEME.test(url)) {\n            router = document.querySelector('ion-router');\n            if (router) {\n                if (ev != null) {\n                    ev.preventDefault();\n                }\n                return [2 /*return*/, router.push(url, direction)];\n            }\n        }\n        return [2 /*return*/, false];\n    });\n}); };\nexport { createColorClasses as c, getClassMap as g, hostContext as h, openURL as o };\n","import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, d as createEvent, c as getIonMode, h, H as Host, e as getElement } from './core-feeeff0d.js';\nimport { b as config } from './config-3c7f3790.js';\nimport { d as debounceEvent } from './helpers-46f4a262.js';\nimport { c as createColorClasses } from './theme-18cbe2cc.js';\nimport { s as sanitizeDOMString } from './index-3476b023.js';\nvar Searchbar = /** @class */ (function () {\n    function class_1(hostRef) {\n        var _this = this;\n        registerInstance(this, hostRef);\n        this.isCancelVisible = false;\n        this.shouldAlignLeft = true;\n        this.focused = false;\n        this.noAnimate = true;\n        /**\n         * If `true`, enable searchbar animation.\n         */\n        this.animated = false;\n        /**\n         * Set the input's autocomplete property.\n         */\n        this.autocomplete = 'off';\n        /**\n         * Set the input's autocorrect property.\n         */\n        this.autocorrect = 'off';\n        /**\n         * Set the cancel button icon. Only applies to `md` mode.\n         */\n        this.cancelButtonIcon = 'md-arrow-back';\n        /**\n         * Set the the cancel button text. Only applies to `ios` mode.\n         */\n        this.cancelButtonText = 'Cancel';\n        /**\n         * Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke.\n         */\n        this.debounce = 250;\n        /**\n         * If `true`, the user cannot interact with the input.\n         */\n        this.disabled = false;\n        /**\n         * A hint to the browser for which keyboard to display.\n         * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n         * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n         */\n        this.inputmode = 'search';\n        /**\n         * Set the input's placeholder.\n         * `placeholder` can accept either plaintext or HTML as a string.\n         * To display characters normally reserved for HTML, they\n         * must be escaped. For example `<Ionic>` would become\n         * `&lt;Ionic&gt;`\n         *\n         * For more information: [Security Documentation](https://ionicframework.com/docs/faq/security)\n         */\n        this.placeholder = 'Search';\n        /**\n         * The icon to use as the search icon.\n         */\n        this.searchIcon = 'search';\n        /**\n         * Sets the behavior for the cancel button. Defaults to `\"never\"`.\n         * Setting to `\"focus\"` shows the cancel button on focus.\n         * Setting to `\"never\"` hides the cancel button.\n         * Setting to `\"always\"` shows the cancel button regardless\n         * of focus state.\n         */\n        this.showCancelButton = 'never';\n        /**\n         * If `true`, enable spellcheck on the input.\n         */\n        this.spellcheck = false;\n        /**\n         * Set the type of the input.\n         */\n        this.type = 'search';\n        /**\n         * the value of the searchbar.\n         */\n        this.value = '';\n        /**\n         * Clears the input field and triggers the control change.\n         */\n        this.onClearInput = function (ev) {\n            _this.ionClear.emit();\n            if (ev) {\n                ev.preventDefault();\n                ev.stopPropagation();\n            }\n            // setTimeout() fixes https://github.com/ionic-team/ionic/issues/7527\n            // wait for 4 frames\n            setTimeout(function () {\n                var value = _this.getValue();\n                if (value !== '') {\n                    _this.value = '';\n                    _this.ionInput.emit();\n                }\n            }, 16 * 4);\n        };\n        /**\n         * Clears the input field and tells the input to blur since\n         * the clearInput function doesn't want the input to blur\n         * then calls the custom cancel function if the user passed one in.\n         */\n        this.onCancelSearchbar = function (ev) {\n            if (ev) {\n                ev.preventDefault();\n                ev.stopPropagation();\n            }\n            _this.ionCancel.emit();\n            _this.onClearInput();\n            if (_this.nativeInput) {\n                _this.nativeInput.blur();\n            }\n        };\n        /**\n         * Update the Searchbar input value when the input changes\n         */\n        this.onInput = function (ev) {\n            var input = ev.target;\n            if (input) {\n                _this.value = input.value;\n            }\n            _this.ionInput.emit(ev);\n        };\n        /**\n         * Sets the Searchbar to not focused and checks if it should align left\n         * based on whether there is a value in the searchbar or not.\n         */\n        this.onBlur = function () {\n            _this.focused = false;\n            _this.ionBlur.emit();\n            _this.positionElements();\n        };\n        /**\n         * Sets the Searchbar to focused and active on input focus.\n         */\n        this.onFocus = function () {\n            _this.focused = true;\n            _this.ionFocus.emit();\n            _this.positionElements();\n        };\n        this.ionInput = createEvent(this, \"ionInput\", 7);\n        this.ionChange = createEvent(this, \"ionChange\", 7);\n        this.ionCancel = createEvent(this, \"ionCancel\", 7);\n        this.ionClear = createEvent(this, \"ionClear\", 7);\n        this.ionBlur = createEvent(this, \"ionBlur\", 7);\n        this.ionFocus = createEvent(this, \"ionFocus\", 7);\n        this.ionStyle = createEvent(this, \"ionStyle\", 7);\n    }\n    class_1.prototype.debounceChanged = function () {\n        this.ionChange = debounceEvent(this.ionChange, this.debounce);\n    };\n    class_1.prototype.valueChanged = function () {\n        var inputEl = this.nativeInput;\n        var value = this.getValue();\n        if (inputEl && inputEl.value !== value) {\n            inputEl.value = value;\n        }\n        this.ionChange.emit({ value: value });\n    };\n    class_1.prototype.showCancelButtonChanged = function () {\n        var _this = this;\n        requestAnimationFrame(function () {\n            _this.positionElements();\n            _this.el.forceUpdate();\n        });\n    };\n    class_1.prototype.connectedCallback = function () {\n        this.emitStyle();\n    };\n    class_1.prototype.componentDidLoad = function () {\n        var _this = this;\n        if (this.showCancelButton === 'false' || this.showCancelButton === false) {\n            console.warn('The boolean values of showCancelButton are deprecated. Please use \"never\" instead of \"false\".');\n        }\n        if (this.showCancelButton === '' || this.showCancelButton === 'true' || this.showCancelButton === true) {\n            console.warn('The boolean values of showCancelButton are deprecated. Please use \"focus\" instead of \"true\".');\n        }\n        this.positionElements();\n        this.debounceChanged();\n        setTimeout(function () {\n            _this.noAnimate = false;\n        }, 300);\n    };\n    class_1.prototype.emitStyle = function () {\n        this.ionStyle.emit({\n            'searchbar': true\n        });\n    };\n    /**\n     * Sets focus on the specified `ion-searchbar`. Use this method instead of the global\n     * `input.focus()`.\n     */\n    class_1.prototype.setFocus = function () {\n        return __awaiter(this, void 0, void 0, function () {\n            return __generator(this, function (_a) {\n                if (this.nativeInput) {\n                    this.nativeInput.focus();\n                }\n                return [2 /*return*/];\n            });\n        });\n    };\n    /**\n     * Returns the native `<input>` element used under the hood.\n     */\n    class_1.prototype.getInputElement = function () {\n        return Promise.resolve(this.nativeInput);\n    };\n    /**\n     * Positions the input search icon, placeholder, and the cancel button\n     * based on the input value and if it is focused. (ios only)\n     */\n    class_1.prototype.positionElements = function () {\n        var value = this.getValue();\n        var prevAlignLeft = this.shouldAlignLeft;\n        var mode = getIonMode(this);\n        var shouldAlignLeft = (!this.animated || value.trim() !== '' || !!this.focused);\n        this.shouldAlignLeft = shouldAlignLeft;\n        if (mode !== 'ios') {\n            return;\n        }\n        if (prevAlignLeft !== shouldAlignLeft) {\n            this.positionPlaceholder();\n        }\n        if (this.animated) {\n            this.positionCancelButton();\n        }\n    };\n    /**\n     * Positions the input placeholder\n     */\n    class_1.prototype.positionPlaceholder = function () {\n        var inputEl = this.nativeInput;\n        if (!inputEl) {\n            return;\n        }\n        var isRTL = document.dir === 'rtl';\n        var iconEl = (this.el.shadowRoot || this.el).querySelector('.searchbar-search-icon');\n        if (this.shouldAlignLeft) {\n            inputEl.removeAttribute('style');\n            iconEl.removeAttribute('style');\n        }\n        else {\n            // Create a dummy span to get the placeholder width\n            var doc = document;\n            var tempSpan = doc.createElement('span');\n            tempSpan.innerHTML = sanitizeDOMString(this.placeholder) || '';\n            doc.body.appendChild(tempSpan);\n            // Get the width of the span then remove it\n            var textWidth = tempSpan.offsetWidth;\n            tempSpan.remove();\n            // Calculate the input padding\n            var inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)';\n            // Calculate the icon margin\n            var iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)';\n            // Set the input padding start and icon margin start\n            if (isRTL) {\n                inputEl.style.paddingRight = inputLeft;\n                iconEl.style.marginRight = iconLeft;\n            }\n            else {\n                inputEl.style.paddingLeft = inputLeft;\n                iconEl.style.marginLeft = iconLeft;\n            }\n        }\n    };\n    /**\n     * Show the iOS Cancel button on focus, hide it offscreen otherwise\n     */\n    class_1.prototype.positionCancelButton = function () {\n        var isRTL = document.dir === 'rtl';\n        var cancelButton = (this.el.shadowRoot || this.el).querySelector('.searchbar-cancel-button');\n        var shouldShowCancel = this.shouldShowCancelButton();\n        if (cancelButton && shouldShowCancel !== this.isCancelVisible) {\n            var cancelStyle = cancelButton.style;\n            this.isCancelVisible = shouldShowCancel;\n            if (shouldShowCancel) {\n                if (isRTL) {\n                    cancelStyle.marginLeft = '0';\n                }\n                else {\n                    cancelStyle.marginRight = '0';\n                }\n            }\n            else {\n                var offset = cancelButton.offsetWidth;\n                if (offset > 0) {\n                    if (isRTL) {\n                        cancelStyle.marginLeft = -offset + 'px';\n                    }\n                    else {\n                        cancelStyle.marginRight = -offset + 'px';\n                    }\n                }\n            }\n        }\n    };\n    class_1.prototype.getValue = function () {\n        return this.value || '';\n    };\n    class_1.prototype.hasValue = function () {\n        return this.getValue() !== '';\n    };\n    /**\n     * Determines whether or not the cancel button should be visible onscreen.\n     * Cancel button should be shown if one of two conditions applies:\n     * 1. `showCancelButton` is set to `always`.\n     * 2. `showCancelButton` is set to `focus`, and the searchbar has been focused.\n     */\n    class_1.prototype.shouldShowCancelButton = function () {\n        if (isCancelButtonSetToNever(this.showCancelButton) ||\n            (isCancelButtonSetToFocus(this.showCancelButton) && !this.focused)) {\n            return false;\n        }\n        return true;\n    };\n    class_1.prototype.render = function () {\n        var _a;\n        var _this = this;\n        var animated = this.animated && config.getBoolean('animated', true);\n        var mode = getIonMode(this);\n        var clearIcon = this.clearIcon || (mode === 'ios' ? 'ios-close-circle' : 'md-close');\n        var searchIcon = this.searchIcon;\n        var cancelButton = !isCancelButtonSetToNever(this.showCancelButton) && (h(\"button\", { \"aria-label\": \"cancel\", type: \"button\", tabIndex: mode === 'ios' && !this.shouldShowCancelButton() ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: \"searchbar-cancel-button\" }, h(\"div\", null, mode === 'md'\n            ? h(\"ion-icon\", { \"aria-hidden\": \"true\", mode: mode, icon: this.cancelButtonIcon, lazy: false })\n            : this.cancelButtonText)));\n        return (h(Host, { role: \"search\", \"aria-disabled\": this.disabled ? 'true' : null, class: Object.assign(Object.assign({}, createColorClasses(this.color)), (_a = {}, _a[mode] = true, _a['searchbar-animated'] = animated, _a['searchbar-disabled'] = this.disabled, _a['searchbar-no-animate'] = animated && this.noAnimate, _a['searchbar-has-value'] = this.hasValue(), _a['searchbar-left-aligned'] = this.shouldAlignLeft, _a['searchbar-has-focus'] = this.focused, _a['searchbar-should-show-cancel'] = this.shouldShowCancelButton(), _a)) }, h(\"div\", { class: \"searchbar-input-container\" }, h(\"input\", { \"aria-label\": \"search text\", disabled: this.disabled, ref: function (el) { return _this.nativeInput = el; }, class: \"searchbar-input\", inputMode: this.inputmode, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellCheck: this.spellcheck }), mode === 'md' && cancelButton, h(\"ion-icon\", { mode: mode, icon: searchIcon, lazy: false, class: \"searchbar-search-icon\" }), h(\"button\", { \"aria-label\": \"reset\", type: \"button\", \"no-blur\": true, class: \"searchbar-clear-button\", onMouseDown: this.onClearInput, onTouchStart: this.onClearInput }, h(\"ion-icon\", { \"aria-hidden\": \"true\", mode: mode, icon: clearIcon, lazy: false, class: \"searchbar-clear-icon\" }))), mode === 'ios' && cancelButton));\n    };\n    Object.defineProperty(class_1.prototype, \"el\", {\n        get: function () { return getElement(this); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(class_1, \"watchers\", {\n        get: function () {\n            return {\n                \"debounce\": [\"debounceChanged\"],\n                \"value\": [\"valueChanged\"],\n                \"showCancelButton\": [\"showCancelButtonChanged\"]\n            };\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(class_1, \"style\", {\n        get: function () { return \".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family,inherit);-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, .ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md, .ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;-ms-flex-negative:1;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-input.sc-ion-searchbar-md::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-ms-clear, .searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md > div.sc-ion-searchbar-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-has-value.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:.4;pointer-events:none}.sc-ion-searchbar-md-h{--clear-button-color:initial;--cancel-button-color:var(--ion-color-step-900,#1a1a1a);--color:var(--ion-color-step-850,#262626);--icon-color:var(--ion-color-step-600,#666);--background:var(--ion-background-color,#fff);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;background:inherit}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.searchbar-search-icon.sc-ion-searchbar-md{left:16px;top:11px;width:21px;height:21px}[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}.searchbar-cancel-button.sc-ion-searchbar-md{left:5px;top:0;background-color:transparent;font-size:1.6em}[dir=rtl].sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:5px}.searchbar-cancel-button.sc-ion-searchbar-md, .searchbar-search-icon.sc-ion-searchbar-md{position:absolute}.searchbar-cancel-button.activated.sc-ion-searchbar-md, .searchbar-search-icon.activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-input.sc-ion-searchbar-md{padding-left:55px;padding-right:55px;padding-top:6px;padding-bottom:6px;border-radius:2px;background-position:left 8px center;height:auto;font-size:16px;font-weight:400;line-height:30px;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.searchbar-input.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:55px;padding-inline-start:55px;-webkit-padding-end:55px;padding-inline-end:55px}}[dir=rtl].sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}.searchbar-clear-button.sc-ion-searchbar-md{right:13px;top:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;position:absolute;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}.searchbar-clear-button.activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-clear-icon.sc-ion-searchbar-md{width:22px;height:100%}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, .searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md, .searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md + .searchbar-search-icon.sc-ion-searchbar-md, .searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md + .searchbar-search-icon.sc-ion-searchbar-md{display:none}ion-toolbar.sc-ion-searchbar-md-h, ion-toolbar .sc-ion-searchbar-md-h{padding-left:7px;padding-right:7px;padding-top:3px;padding-bottom:3px}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){ion-toolbar.sc-ion-searchbar-md-h, ion-toolbar .sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:7px;padding-inline-start:7px;-webkit-padding-end:7px;padding-inline-end:7px}}\"; },\n        enumerable: true,\n        configurable: true\n    });\n    return class_1;\n}());\n/**\n * Check if the cancel button should never be shown.\n *\n * TODO: Remove this when the `true` and `false`\n * options are removed.\n */\nvar isCancelButtonSetToNever = function (showCancelButton) {\n    return (showCancelButton === 'never' ||\n        showCancelButton === 'false' ||\n        showCancelButton === false);\n};\n/**\n * Check if the cancel button should be shown on focus.\n *\n * TODO: Remove this when the `true` and `false`\n * options are removed.\n */\nvar isCancelButtonSetToFocus = function (showCancelButton) {\n    return (showCancelButton === 'focus' ||\n        showCancelButton === 'true' ||\n        showCancelButton === true ||\n        showCancelButton === '');\n};\nexport { Searchbar as ion_searchbar };\n","/**\n * Does a simple sanitization of all elements\n * in an untrusted string\n */\nvar sanitizeDOMString = function (untrustedString) {\n    try {\n        if (typeof untrustedString !== 'string' || untrustedString === '') {\n            return untrustedString;\n        }\n        /**\n         * Create a document fragment\n         * separate from the main DOM,\n         * create a div to do our work in\n         */\n        var documentFragment_1 = document.createDocumentFragment();\n        var workingDiv = document.createElement('div');\n        documentFragment_1.appendChild(workingDiv);\n        workingDiv.innerHTML = untrustedString;\n        /**\n         * Remove any elements\n         * that are blocked\n         */\n        blockedTags.forEach(function (blockedTag) {\n            var getElementsToRemove = documentFragment_1.querySelectorAll(blockedTag);\n            for (var elementIndex = getElementsToRemove.length - 1; elementIndex >= 0; elementIndex--) {\n                var element = getElementsToRemove[elementIndex];\n                if (element.parentNode) {\n                    element.parentNode.removeChild(element);\n                }\n                else {\n                    documentFragment_1.removeChild(element);\n                }\n                /**\n                 * We still need to sanitize\n                 * the children of this element\n                 * as they are left behind\n                 */\n                var childElements = getElementChildren(element);\n                /* tslint:disable-next-line */\n                for (var childIndex = 0; childIndex < childElements.length; childIndex++) {\n                    sanitizeElement(childElements[childIndex]);\n                }\n            }\n        });\n        /**\n         * Go through remaining elements and remove\n         * non-allowed attribs\n         */\n        // IE does not support .children on document fragments, only .childNodes\n        var dfChildren = getElementChildren(documentFragment_1);\n        /* tslint:disable-next-line */\n        for (var childIndex = 0; childIndex < dfChildren.length; childIndex++) {\n            sanitizeElement(dfChildren[childIndex]);\n        }\n        // Append document fragment to div\n        var fragmentDiv = document.createElement('div');\n        fragmentDiv.appendChild(documentFragment_1);\n        // First child is always the div we did our work in\n        var getInnerDiv = fragmentDiv.querySelector('div');\n        return (getInnerDiv !== null) ? getInnerDiv.innerHTML : fragmentDiv.innerHTML;\n    }\n    catch (err) {\n        console.error(err);\n        return '';\n    }\n};\n/**\n * Clean up current element based on allowed attributes\n * and then recursively dig down into any child elements to\n * clean those up as well\n */\nvar sanitizeElement = function (element) {\n    // IE uses childNodes, so ignore nodes that are not elements\n    if (element.nodeType && element.nodeType !== 1) {\n        return;\n    }\n    for (var i = element.attributes.length - 1; i >= 0; i--) {\n        var attribute = element.attributes.item(i);\n        var attributeName = attribute.name;\n        // remove non-allowed attribs\n        if (!allowedAttributes.includes(attributeName.toLowerCase())) {\n            element.removeAttribute(attributeName);\n            continue;\n        }\n        // clean up any allowed attribs\n        // that attempt to do any JS funny-business\n        var attributeValue = attribute.value;\n        /* tslint:disable-next-line */\n        if (attributeValue != null && attributeValue.toLowerCase().includes('javascript:')) {\n            element.removeAttribute(attributeName);\n        }\n    }\n    /**\n     * Sanitize any nested children\n     */\n    var childElements = getElementChildren(element);\n    /* tslint:disable-next-line */\n    for (var i = 0; i < childElements.length; i++) {\n        sanitizeElement(childElements[i]);\n    }\n};\n/**\n * IE doesn't always support .children\n * so we revert to .childNodes instead\n */\nvar getElementChildren = function (el) {\n    return (el.children != null) ? el.children : el.childNodes;\n};\nvar allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];\nvar blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed'];\nexport { sanitizeDOMString as s };\n"],"sourceRoot":""}