{"version":3,"sources":["webpack:///./node_modules/@esri/calcite-components/dist/components/guid.js","webpack:///./node_modules/@esri/calcite-components/dist/components/observers.js","webpack:///./node_modules/@esri/calcite-components/dist/components/calcite-icon.js","webpack:///./node_modules/@esri/calcite-components/dist/components/dom.js","webpack:///./node_modules/@esri/calcite-components/dist/components/icon.js"],"names":["gen","counts","map","count","out","i","Math","random","toString","substring","join","guid","createObserver","type","callback","options","Observer","getObserver","isBrowser","undefined","window","IntersectionObserver","MutationObserver","ResizeObserver","CalciteIcon","defineCustomElement","autoTheme","darkTheme","lightTheme","CSS_UTILITY","rtl","TEXT","loading","getElementDir","el","prop","selector","closest","closestElementCrossShadowBoundary","getAttribute","getElementProp","fallbackValue","getRootNode","getHost","root","host","queryElementRoots","element","id","queryFrom","assignedSlot","rootNode","found","getElementById","querySelector","closestFrom","isCalciteFocusable","setFocus","async","focusElement","focus","defaultSlotSelector","getSlotted","slotName","Array","isArray","slotSelector","name","all","queryMultiple","querySingle","getDirectChildren","from","children","filter","child","matches","querySelectorAll","direct","parentElement","item","reduce","previousValue","currentValue","match","setRequestedIcon","iconObject","iconValue","matchedValue","CSS","icon","flipRtl","iconCache","requestCache","scaleToPx","s","m","l","fetchIcon","scale","size","normalizeIconName","filled","charAt","length","iconName","fetch","then","resp","json","catch","console","error","path","numberLeadingName","isNaN","Number","parts","split","part","index","toUpperCase","slice","iconCss","Icon","super","this","__registerHost","__attachShadow","visible","waitUntilVisible","loadIconPathData","_a","intersectionObserver","disconnect","pathData","textLabel","dir","semantic","paths","concat","role","class","svg","fill","height","viewBox","width","xmlns","d","opacity","entries","forEach","entry","isIntersecting","rootMargin","observe","customElements","components","tagName","get","define"],"mappings":";;;;;AAIA,SAASA,EAAIC,GACX,OAAOA,EACJC,IAAKC,IACN,IAAIC,EAAM,GACV,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAOE,IACzBD,IAA+B,OAArB,EAAIE,KAAKC,UAAuB,GAAGC,SAAS,IAAIC,UAAU,GAEt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chunk-14c00e1a.6d22509c.js","sourcesContent":["/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n */\nfunction gen(counts) {\n return counts\n .map((count) => {\n let out = \"\";\n for (let i = 0; i < count; i++) {\n out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\n }\n return out;\n })\n .join(\"-\");\n}\nconst guid = () => gen([2, 1, 1, 1, 3]);\n\nexport { guid as g };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n */\nimport { Build } from '@stencil/core/internal/client';\n\n/**\n * This utility ensures observers are created only for browser contexts.\n *\n * @param type - the type of observer to create\n * @param callback - the observer callback\n * @param options - the observer options\n */\nfunction createObserver(type, callback, options) {\n const Observer = getObserver(type);\n return Build.isBrowser ? new Observer(callback, options) : undefined;\n}\nfunction getObserver(type) {\n return (type === \"intersection\"\n ? window.IntersectionObserver\n : type === \"mutation\"\n ? window.MutationObserver\n : window.ResizeObserver);\n}\n\nexport { createObserver as c };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n */\nimport { I as Icon, d as defineCustomElement$1 } from './icon.js';\n\nconst CalciteIcon = Icon;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteIcon, defineCustomElement };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n */\nimport { g as guid } from './guid.js';\n\nconst autoTheme = \"calcite-theme-auto\";\nconst darkTheme = \"calcite-theme-dark\";\nconst lightTheme = \"calcite-theme-light\";\nconst CSS_UTILITY = {\n autoTheme,\n darkTheme,\n lightTheme,\n rtl: \"calcite--rtl\"\n};\nconst TEXT = {\n loading: \"Loading\"\n};\n\n/**\n * This helper will guarantee an ID on the provided element.\n *\n * If it already has an ID, it will be preserved, otherwise a unique one will be generated and assigned.\n *\n * @returns {string} The element's ID.\n */\nfunction ensureId(el) {\n if (!el) {\n return \"\";\n }\n return (el.id = el.id || `${el.tagName.toLowerCase()}-${guid()}`);\n}\nfunction nodeListToArray(nodeList) {\n return Array.isArray(nodeList) ? nodeList : Array.from(nodeList);\n}\nfunction getThemeName(el) {\n const closestElWithTheme = closestElementCrossShadowBoundary(el, `.${CSS_UTILITY.darkTheme}, .${CSS_UTILITY.lightTheme}`);\n return (closestElWithTheme === null || closestElWithTheme === void 0 ? void 0 : closestElWithTheme.classList.contains(\"calcite-theme-dark\")) ? \"dark\" : \"light\";\n}\nfunction getElementDir(el) {\n const prop = \"dir\";\n const selector = `[${prop}]`;\n const closest = closestElementCrossShadowBoundary(el, selector);\n return closest ? closest.getAttribute(prop) : \"ltr\";\n}\nfunction getElementProp(el, prop, fallbackValue) {\n const selector = `[${prop}]`;\n const closest = el.closest(selector);\n return closest ? closest.getAttribute(prop) : fallbackValue;\n}\nfunction getRootNode(el) {\n return el.getRootNode();\n}\nfunction getHost(root) {\n return root.host || null;\n}\n/**\n * This helper queries an element's rootNodes and any ancestor rootNodes.\n *\n * @returns {Element[]} The elements.\n */\nfunction queryElementsRoots(element, selector) {\n // Gets the rootNode and any ancestor rootNodes (shadowRoot or document) of an element and queries them for a selector.\n // Based on: https://stackoverflow.com/q/54520554/194216\n function queryFromAll(el, allResults) {\n if (!el) {\n return allResults;\n }\n if (el.assignedSlot) {\n el = el.assignedSlot;\n }\n const rootNode = getRootNode(el);\n const results = Array.from(rootNode.querySelectorAll(selector));\n const uniqueResults = results.filter((result) => !allResults.includes(result));\n allResults = [...allResults, ...uniqueResults];\n const host = getHost(rootNode);\n return host ? queryFromAll(host, allResults) : allResults;\n }\n return queryFromAll(element, []);\n}\n/**\n * This helper queries an element's rootNode and any ancestor rootNodes.\n *\n * If both an 'id' and 'selector' are supplied, 'id' will take precedence over 'selector'.\n *\n * @returns {Element} The element.\n */\nfunction queryElementRoots(element, { selector, id }) {\n // Gets the rootNode and any ancestor rootNodes (shadowRoot or document) of an element and queries them for a selector.\n // Based on: https://stackoverflow.com/q/54520554/194216\n function queryFrom(el) {\n if (!el) {\n return null;\n }\n if (el.assignedSlot) {\n el = el.assignedSlot;\n }\n const rootNode = getRootNode(el);\n const found = id\n ? rootNode.getElementById(id)\n : selector\n ? rootNode.querySelector(selector)\n : null;\n const host = getHost(rootNode);\n return found ? found : host ? queryFrom(host) : null;\n }\n return queryFrom(element);\n}\nfunction closestElementCrossShadowBoundary(element, selector) {\n // based on https://stackoverflow.com/q/54520554/194216\n function closestFrom(el) {\n return el ? el.closest(selector) || closestFrom(getHost(getRootNode(el))) : null;\n }\n return closestFrom(element);\n}\nfunction isCalciteFocusable(el) {\n return typeof (el === null || el === void 0 ? void 0 : el.setFocus) === \"function\";\n}\nasync function focusElement(el) {\n if (!el) {\n return;\n }\n return isCalciteFocusable(el) ? el.setFocus() : el.focus();\n}\nconst defaultSlotSelector = \":not([slot])\";\nfunction getSlotted(element, slotName, options) {\n if (slotName && !Array.isArray(slotName) && typeof slotName !== \"string\") {\n options = slotName;\n slotName = null;\n }\n const slotSelector = slotName\n ? Array.isArray(slotName)\n ? slotName.map((name) => `[slot=\"${name}\"]`).join(\",\")\n : `[slot=\"${slotName}\"]`\n : defaultSlotSelector;\n if (options === null || options === void 0 ? void 0 : options.all) {\n return queryMultiple(element, slotSelector, options);\n }\n return querySingle(element, slotSelector, options);\n}\nfunction getDirectChildren(el, selector) {\n return el ? Array.from(el.children || []).filter((child) => child === null || child === void 0 ? void 0 : child.matches(selector)) : [];\n}\nfunction queryMultiple(element, slotSelector, options) {\n let matches = slotSelector === defaultSlotSelector\n ? getDirectChildren(element, defaultSlotSelector)\n : Array.from(element.querySelectorAll(slotSelector));\n matches = options && options.direct === false ? matches : matches.filter((el) => el.parentElement === element);\n matches = (options === null || options === void 0 ? void 0 : options.matches) ? matches.filter((el) => el === null || el === void 0 ? void 0 : el.matches(options.matches)) : matches;\n const selector = options === null || options === void 0 ? void 0 : options.selector;\n return selector\n ? matches\n .map((item) => Array.from(item.querySelectorAll(selector)))\n .reduce((previousValue, currentValue) => [...previousValue, ...currentValue], [])\n .filter((match) => !!match)\n : matches;\n}\nfunction querySingle(element, slotSelector, options) {\n let match = slotSelector === defaultSlotSelector\n ? getDirectChildren(element, defaultSlotSelector)[0] || null\n : element.querySelector(slotSelector);\n match = options && options.direct === false ? match : (match === null || match === void 0 ? void 0 : match.parentElement) === element ? match : null;\n match = (options === null || options === void 0 ? void 0 : options.matches) ? ((match === null || match === void 0 ? void 0 : match.matches(options.matches)) ? match : null) : match;\n const selector = options === null || options === void 0 ? void 0 : options.selector;\n return selector ? match === null || match === void 0 ? void 0 : match.querySelector(selector) : match;\n}\nfunction filterDirectChildren(el, selector) {\n return Array.from(el.children).filter((child) => child.matches(selector));\n}\n// set a default icon from a defined set or allow an override with an icon name string\nfunction setRequestedIcon(iconObject, iconValue, matchedValue) {\n if (typeof iconValue === \"string\" && iconValue !== \"\") {\n return iconValue;\n }\n else if (iconValue === \"\") {\n return iconObject[matchedValue];\n }\n}\nfunction intersects(rect1, rect2) {\n return !(rect2.left > rect1.right ||\n rect2.right < rect1.left ||\n rect2.top > rect1.bottom ||\n rect2.bottom < rect1.top);\n}\n\nexport { CSS_UTILITY as C, TEXT as T, getElementDir as a, getSlotted as b, getThemeName as c, closestElementCrossShadowBoundary as d, filterDirectChildren as e, focusElement as f, getElementProp as g, ensureId as h, isCalciteFocusable as i, queryElementsRoots as j, intersects as k, nodeListToArray as n, queryElementRoots as q, setRequestedIcon as s };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n */\nimport { getAssetPath, HTMLElement, h, Host, Build, proxyCustomElement } from '@stencil/core/internal/client';\nimport { a as getElementDir } from './dom.js';\nimport { c as createObserver } from './observers.js';\n\nconst CSS = {\n icon: \"icon\",\n flipRtl: \"flip-rtl\"\n};\n\n/**\n * Icon data cache.\n * Exported for testing purposes.\n * @private\n */\nconst iconCache = {};\n/**\n * Icon request cache.\n * Exported for testing purposes.\n * @private\n */\nconst requestCache = {};\nconst scaleToPx = {\n s: 16,\n m: 24,\n l: 32\n};\nasync function fetchIcon({ icon, scale }) {\n const size = scaleToPx[scale];\n const name = normalizeIconName(icon);\n const filled = name.charAt(name.length - 1) === \"F\";\n const iconName = filled ? name.substring(0, name.length - 1) : name;\n const id = `${iconName}${size}${filled ? \"F\" : \"\"}`;\n if (iconCache[id]) {\n return iconCache[id];\n }\n if (!requestCache[id]) {\n requestCache[id] = fetch(getAssetPath(`./assets/icon/${id}.json`))\n .then((resp) => resp.json())\n .catch(() => {\n console.error(`\"${id}\" is not a valid calcite-ui-icon name`);\n return \"\";\n });\n }\n const path = await requestCache[id];\n iconCache[id] = path;\n return path;\n}\n/**\n * Normalize the icon name to match the path data module exports.\n * Exported for testing purposes.\n * @private\n */\nfunction normalizeIconName(name) {\n const numberLeadingName = !isNaN(Number(name.charAt(0)));\n const parts = name.split(\"-\");\n if (parts.length === 1) {\n return numberLeadingName ? `i${name}` : name;\n }\n return parts\n .map((part, index) => {\n if (index === 0) {\n return numberLeadingName ? `i${part.toUpperCase()}` : part;\n }\n return part.charAt(0).toUpperCase() + part.slice(1);\n })\n .join(\"\");\n}\n\nconst iconCss = \"@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:-ms-inline-flexbox;display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){height:1rem;width:1rem;min-width:1rem;min-height:1rem}:host([scale=m]){height:1.5rem;width:1.5rem;min-width:1.5rem;min-height:1.5rem}:host([scale=l]){height:2rem;width:2rem;min-width:2rem;min-height:2rem}.flip-rtl{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.svg{display:block}\";\n\nlet Icon = class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n //--------------------------------------------------------------------------\n //\n // Properties\n //\n //--------------------------------------------------------------------------\n /**\n * The name of the icon to display. The value of this property must match the icon name from https://esri.github.io/calcite-ui-icons/.\n */\n this.icon = null;\n /**\n * When true, the icon will be flipped when the element direction is 'rtl'.\n */\n this.flipRtl = false;\n /**\n * Icon scale.\n */\n this.scale = \"m\";\n this.visible = false;\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n connectedCallback() {\n this.waitUntilVisible(() => {\n this.visible = true;\n this.loadIconPathData();\n });\n }\n disconnectedCallback() {\n var _a;\n (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.intersectionObserver = null;\n }\n async componentWillLoad() {\n this.loadIconPathData();\n }\n render() {\n const { el, flipRtl, pathData, scale, textLabel } = this;\n const dir = getElementDir(el);\n const size = scaleToPx[scale];\n const semantic = !!textLabel;\n const paths = [].concat(pathData || \"\");\n return (h(Host, { \"aria-hidden\": (!semantic).toString(), \"aria-label\": semantic ? textLabel : null, role: semantic ? \"img\" : null }, h(\"svg\", { class: {\n [CSS.flipRtl]: dir === \"rtl\" && flipRtl,\n svg: true\n }, fill: \"currentColor\", height: \"100%\", viewBox: `0 0 ${size} ${size}`, width: \"100%\", xmlns: \"http://www.w3.org/2000/svg\" }, paths.map((path) => typeof path === \"string\" ? (h(\"path\", { d: path })) : (h(\"path\", { d: path.d, opacity: \"opacity\" in path ? path.opacity : 1 }))))));\n }\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n async loadIconPathData() {\n const { icon, scale, visible } = this;\n if (!Build.isBrowser || !icon || !visible) {\n return;\n }\n this.pathData = await fetchIcon({ icon, scale });\n }\n waitUntilVisible(callback) {\n this.intersectionObserver = createObserver(\"intersection\", (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n callback();\n }\n });\n }, { rootMargin: \"50px\" });\n if (!this.intersectionObserver) {\n callback();\n return;\n }\n this.intersectionObserver.observe(this.el);\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"icon\": [\"loadIconPathData\"],\n \"scale\": [\"loadIconPathData\"]\n }; }\n static get style() { return iconCss; }\n};\nIcon = /*@__PURE__*/ proxyCustomElement(Icon, [1, \"calcite-icon\", {\n \"icon\": [513],\n \"flipRtl\": [516, \"flip-rtl\"],\n \"scale\": [513],\n \"textLabel\": [1, \"text-label\"],\n \"pathData\": [32],\n \"visible\": [32]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-icon\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Icon);\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Icon as I, defineCustomElement as d };\n"],"sourceRoot":""}