{"version":3,"sources":["webpack:///./node_modules/ionicons/dist/esm/legacy/ion-icon.entry.js"],"names":["validateContent","svgContent","div","document","createElement","innerHTML","i","childNodes","length","nodeName","toLowerCase","removeChild","svgElm","firstElementChild","setAttribute","isValid","elm","nodeType","attributes","val","value","indexOf","requests","Map","getSvgContent","url","req","get","fetch","then","rsp","status","text","Promise","resolve","set","Icon","hostRef","this","mode","getIonMode","isVisible","lazy","prototype","connectedCallback","_this","waitUntilVisible","el","loadIcon","disconnectedCallback","io","disconnect","undefined","rootMargin","cb","window","IntersectionObserver","io_1","data","isIntersecting","observe","ariaLabel","label","name","icon","ios","md","replace","render","_a","_b","flipRtl","role","class","Object","assign","createColorClasses","color","size","ownerDocument","dir","defineProperty","enumerable","configurable","ref","documentElement","getAttribute"],"mappings":"kHAAA,4EAEIA,EAAkB,SAAUC,GAC5B,GAAIA,EAAY,CACZ,IAAIC,EAAMC,SAASC,cAAc,OACjCF,EAAIG,UAAYJ,EAEhB,IAAK,IAAIK,EAAIJ,EAAIK,WAAWC,OAAS,EAAGF,GAAK,EAAGA,IACK,QAA7CJ,EAAIK,WAAWD,GAAGG,SAASC,eAC3BR,EAAIS,YAAYT,EAAIK,WAAWD,IAIvC,IAAIM,EAASV,EAAIW,kBACjB,GAAID,GAA4C,QAAlCA,EAAOH,SAASC,gBAC1BE,EAAOE,aAAa,QAAS,cAIzBC,EAAQH,IACR,OAAOV,EAAIG,UAIvB,MAAO,IAEPU,EAAU,SAAUC,GACpB,GAAqB,IAAjBA,EAAIC,SAAgB,CACpB,GAAmC,WAA/BD,EAAIP,SAASC,cACb,OAAO,EAEX,IAAK,IAAIJ,EAAI,EAAGA,EAAIU,EAAIE,WAAWV,OAAQF,IAAK,CAC5C,IAAIa,EAAMH,EAAIE,WAAWZ,GAAGc,MAC5B,GAAI,eAAMD,IAA4C,IAApCA,EAAIT,cAAcW,QAAQ,MACxC,OAAO,EAGf,IAASf,EAAI,EAAGA,EAAIU,EAAIT,WAAWC,OAAQF,I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C,aAAa,SAAW,MAExEV,EAAqB,SAAUC,GAC/B,IAAIR,EACJ,OAAO,GAAWA,EAAK,CACf,aAAa,GAEjBA,EAAG,aAAeQ,IAAS,EAC3BR,GAAM","file":"js/chunk-2d0df486.1e4c7f41.js","sourcesContent":["import { r as registerInstance, c as getMode, h, H as Host, d as getElement } from './chunk-58252182.js';\nimport { i as isStr, g as getUrl, b as getName } from './chunk-2a882949.js';\nvar validateContent = function (svgContent) {\n if (svgContent) {\n var div = document.createElement('div');\n div.innerHTML = svgContent;\n // setup this way to ensure it works on our buddy IE\n for (var i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n // must only have 1 root element\n var svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n svgElm.setAttribute('class', 's-ion-icon');\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm)) {\n return div.innerHTML;\n }\n }\n }\n return '';\n};\nvar isValid = function (elm) {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n for (var i = 0; i < elm.attributes.length; i++) {\n var val = elm.attributes[i].value;\n if (isStr(val) && val.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n for (var i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i])) {\n return false;\n }\n }\n }\n return true;\n};\nvar requests = new Map();\nvar getSvgContent = function (url) {\n // see if we already have a request for this url\n var req = requests.get(url);\n if (!req) {\n // we don't already have a request\n req = fetch(url).then(function (rsp) {\n if (rsp.status <= 299) {\n return rsp.text();\n }\n return Promise.resolve(null);\n }).then(function (svgContent) { return validateContent(svgContent); });\n // cache for the same requests\n requests.set(url, req);\n }\n return req;\n};\n/**\n * @virtualProp {\"ios\" | \"md\"} mode - The mode determines which platform styles to use.\n */\nvar Icon = /** @class */ (function () {\n function Icon(hostRef) {\n registerInstance(this, hostRef);\n this.mode = getIonMode(this);\n this.isVisible = false;\n /**\n * If enabled, ion-icon will be loaded lazily when it's visible in the viewport.\n * Default, `false`.\n */\n this.lazy = false;\n }\n Icon.prototype.connectedCallback = function () {\n var _this = this;\n // purposely do not return the promise here because loading\n // the svg file should not hold up loading the app\n // only load the svg if it's visible\n this.waitUntilVisible(this.el, '50px', function () {\n _this.isVisible = true;\n _this.loadIcon();\n });\n };\n Icon.prototype.disconnectedCallback = function () {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n };\n Icon.prototype.waitUntilVisible = function (el, rootMargin, cb) {\n var _this = this;\n if (this.lazy && typeof window !== 'undefined' && window.IntersectionObserver) {\n var io_1 = this.io = new window.IntersectionObserver(function (data) {\n if (data[0].isIntersecting) {\n io_1.disconnect();\n _this.io = undefined;\n cb();\n }\n }, { rootMargin: rootMargin });\n io_1.observe(el);\n }\n else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n };\n Icon.prototype.loadIcon = function () {\n var _this = this;\n if (this.isVisible) {\n var url = getUrl(this);\n if (url) {\n getSvgContent(url)\n .then(function (svgContent) { return _this.svgContent = svgContent; });\n }\n }\n if (!this.ariaLabel) {\n var label = getName(this.name, this.icon, this.mode, this.ios, this.md);\n // user did not provide a label\n // come up with the label based on the icon name\n if (label) {\n this.ariaLabel = label\n .replace('ios-', '')\n .replace('md-', '')\n .replace(/\\-/g, ' ');\n }\n }\n };\n Icon.prototype.render = function () {\n var _a, _b;\n var mode = this.mode || 'md';\n var flipRtl = this.flipRtl || (this.ariaLabel && this.ariaLabel.indexOf('arrow') > -1 && this.flipRtl !== false);\n return (h(Host, { role: \"img\", class: Object.assign((_a = {}, _a[mode] = true, _a), createColorClasses(this.color), (_b = {}, _b[\"icon-\" + this.size] = !!this.size, _b['flip-rtl'] = !!flipRtl && this.el.ownerDocument.dir === 'rtl', _b)) }, ((this.svgContent)\n ? h(\"div\", { class: \"icon-inner\", innerHTML: this.svgContent })\n : h(\"div\", { class: \"icon-inner\" }))));\n };\n Object.defineProperty(Icon, \"assetsDirs\", {\n get: function () { return [\"svg\"]; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Icon.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Icon, \"watchers\", {\n get: function () {\n return {\n \"name\": [\"loadIcon\"],\n \"src\": [\"loadIcon\"],\n \"icon\": [\"loadIcon\"]\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Icon, \"style\", {\n get: function () { return \":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;-webkit-box-sizing:content-box!important;box-sizing:content-box!important}.icon-inner,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{-webkit-transform:scaleX(-1);transform:scaleX(-1)}:host(.icon-small){font-size:18px!important}:host(.icon-large){font-size:32px!important}:host(.ion-color){color:var(--ion-color-base)!important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary,#3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary,#0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary,#f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success,#10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning,#ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger,#f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light,#f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium,#989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark,#222428)}\"; },\n enumerable: true,\n configurable: true\n });\n return Icon;\n}());\nvar getIonMode = function (ref) {\n return getMode(ref) || document.documentElement.getAttribute('mode') || 'md';\n};\nvar createColorClasses = function (color) {\n var _a;\n return (color) ? (_a = {\n 'ion-color': true\n },\n _a[\"ion-color-\" + color] = true,\n _a) : null;\n};\nexport { Icon as ion_icon };\n"],"sourceRoot":""}