{"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","getClassList","classes","array","Array","isArray","split","filter","c","map","trim","getClassMap","forEach","SCHEME","openURL","url","ev","direction","router","this","test","document","querySelector","preventDefault","push","Searchbar","class_1","hostRef","_this","isCancelVisible","shouldAlignLeft","focused","noAnimate","animated","autocomplete","autocorrect","cancelButtonIcon","cancelButtonText","debounce","disabled","inputmode","placeholder","searchIcon","showCancelButton","spellcheck","type","value","onClearInput","ionClear","emit","stopPropagation","setTimeout","getValue","ionInput","onCancelSearchbar","ionCancel","nativeInput","blur","onInput","input","target","onBlur","ionBlur","positionElements","onFocus","ionFocus","ionChange","ionStyle","prototype","debounceChanged","valueChanged","inputEl","showCancelButtonChanged","requestAnimationFrame","forceUpdate","connectedCallback","emitStyle","componentDidLoad","console","warn","setFocus","focus","getInputElement","Promise","resolve","prevAlignLeft","mode","positionPlaceholder","positionCancelButton","isRTL","dir","iconEl","shadowRoot","removeAttribute","doc","tempSpan","createElement","innerHTML","body","appendChild","textWidth","offsetWidth","remove","inputLeft","iconLeft","style","paddingRight","marginRight","paddingLeft","marginLeft","cancelButton","shouldShowCancel","shouldShowCancelButton","cancelStyle","offset","hasValue","isCancelButtonSetToNever","isCancelButtonSetToFocus","render","getBoolean","clearIcon","tabIndex","onMouseDown","onTouchStart","class","icon","lazy","role","Object","assign","ref","inputMode","autoComplete","autoCorrect","spellCheck","defineProperty","get","enumerable","configurable","sanitizeDOMString","untrustedString","documentFragment_1","createDocumentFragment","workingDiv","blockedTags","blockedTag","getElementsToRemove","querySelectorAll","elementIndex","element","parentNode","removeChild","childElements","getElementChildren","childIndex","sanitizeElement","dfChildren","fragmentDiv","getInnerDiv","err","error","nodeType","i","attributes","attribute","item","attributeName","name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AgBC,EAAmBJ,GAEvC,IAASa,EAAI,EAAGA,EAAIV,EAAczJ,OAAQmK,IACtCP,EAAgBH,EAAcU,MAOlCT,EAAqB,SAAU/J,GAC/B,OAAuB,MAAfA,EAAGkL,SAAoBlL,EAAGkL,SAAWlL,EAAGmL,YAEhDL,EAAoB,CAAC,QAAS,KAAM,OAAQ,MAAO,OAAQ,QAC3DxB,EAAc,CAAC,SAAU,QAAS,SAAU,OAAQ,OAAQ,SAAU","file":"js/chunk-173239cb.73abbc99.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 `` would become\n * `<Ionic>`\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 `` 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":""}