@oiz/stzh-components 2.6.0 → 2.7.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-4dcdf160.js → app-globals-d0d1f796.js} +2 -2
- package/dist/cjs/{app-globals-4dcdf160.js.map → app-globals-d0d1f796.js.map} +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-amount.cjs.entry.js +30 -79
- package/dist/cjs/stzh-amount.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-dropdown.cjs.entry.js +60 -25
- package/dist/cjs/stzh-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js +191 -0
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js.map +1 -0
- package/dist/cjs/stzh-pagetitle.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagetitle.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-timepicker.cjs.entry.js +82 -0
- package/dist/cjs/stzh-timepicker.cjs.entry.js.map +1 -0
- package/dist/cjs/translation-utils-73073e44.js.map +1 -1
- package/dist/collection/assets/i18n/de.json +10 -7
- package/dist/collection/assets/i18n/en.json +8 -5
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/stzh-amount/stzh-amount.js +32 -85
- package/dist/collection/components/stzh-amount/stzh-amount.js.map +1 -1
- package/dist/collection/components/stzh-amount/stzh-amount.localization.js.map +1 -1
- package/dist/collection/components/stzh-amount/stzh-amount.stories.js +1 -1
- package/dist/collection/components/stzh-card/stzh-card.stories.js +5 -5
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +1 -1
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.js.map +1 -1
- package/dist/collection/components/stzh-datepicker/stzh-datepicker.stories.js +3 -0
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +32 -20
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +40 -9
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.js.map +1 -1
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.css +123 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.js +724 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.js.map +1 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.localization.js +2 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.localization.js.map +1 -0
- package/dist/collection/components/stzh-monthyearpicker/stzh-monthyearpicker.stories.js +61 -0
- package/dist/collection/components/stzh-pagetitle/stzh-pagetitle.css +3 -0
- package/dist/collection/components/stzh-skin-portal-mitwirken/stzh-skin-portal-mitwirken.css +1 -1
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.css +109 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.js +438 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.js.map +1 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.localization.js +2 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.localization.js.map +1 -0
- package/dist/collection/components/stzh-timepicker/stzh-timepicker.stories.js +45 -0
- package/dist/collection/components/stzh-upload/stzh-upload.stories.js +2 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/libraries/tom-select/cjs/tom-select.complete.js +47 -18
- package/dist/collection/libraries/tom-select/cjs/tom-select.js +47 -18
- package/dist/collection/libraries/tom-select/cjs/tom-select.popular.js +47 -18
- package/dist/collection/libraries/tom-select/esm/tom-select.complete.js +47 -18
- package/dist/collection/libraries/tom-select/esm/tom-select.js +47 -18
- package/dist/collection/libraries/tom-select/esm/tom-select.popular.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.base.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.base.min.js +16 -17
- package/dist/collection/libraries/tom-select/js/tom-select.complete.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.complete.min.js +12 -13
- package/dist/collection/libraries/tom-select/js/tom-select.popular.js +47 -18
- package/dist/collection/libraries/tom-select/js/tom-select.popular.min.js +21 -22
- package/dist/collection/utils/translation-utils.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/stzh-amount.js +40 -83
- package/dist/components/stzh-amount.js.map +1 -1
- package/dist/components/stzh-buttongroup.js +1 -31
- package/dist/components/stzh-buttongroup.js.map +1 -1
- package/dist/components/stzh-buttongroup2.js +35 -0
- package/dist/components/stzh-buttongroup2.js.map +1 -0
- package/dist/components/stzh-datepicker2.js.map +1 -1
- package/dist/components/stzh-dropdown2.js +61 -25
- package/dist/components/stzh-dropdown2.js.map +1 -1
- package/dist/components/stzh-monthyearpicker.d.ts +11 -0
- package/dist/components/stzh-monthyearpicker.js +251 -0
- package/dist/components/stzh-monthyearpicker.js.map +1 -0
- package/dist/components/stzh-pagetitle.js +1 -1
- package/dist/components/stzh-pagetitle.js.map +1 -1
- package/dist/components/stzh-skin-portal-mitwirken.js +1 -1
- package/dist/components/stzh-skin-portal-mitwirken.js.map +1 -1
- package/dist/components/stzh-timepicker.d.ts +11 -0
- package/dist/components/stzh-timepicker.js +132 -0
- package/dist/components/stzh-timepicker.js.map +1 -0
- package/dist/components/translation-utils.js.map +1 -1
- package/dist/esm/{app-globals-91875913.js → app-globals-bd1f456b.js} +2 -2
- package/dist/esm/{app-globals-91875913.js.map → app-globals-bd1f456b.js.map} +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-amount.entry.js +30 -79
- package/dist/esm/stzh-amount.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm/stzh-dropdown.entry.js +60 -25
- package/dist/esm/stzh-dropdown.entry.js.map +1 -1
- package/dist/esm/stzh-monthyearpicker.entry.js +187 -0
- package/dist/esm/stzh-monthyearpicker.entry.js.map +1 -0
- package/dist/esm/stzh-pagetitle.entry.js +1 -1
- package/dist/esm/stzh-pagetitle.entry.js.map +1 -1
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js +1 -1
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js.map +1 -1
- package/dist/esm/stzh-timepicker.entry.js +78 -0
- package/dist/esm/stzh-timepicker.entry.js.map +1 -0
- package/dist/esm/translation-utils-2623783f.js.map +1 -1
- package/dist/esm-es5/{app-globals-91875913.js → app-globals-bd1f456b.js} +2 -2
- package/dist/esm-es5/{app-globals-91875913.js.map → app-globals-bd1f456b.js.map} +1 -1
- package/dist/esm-es5/index.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/stzh-amount.entry.js +1 -1
- package/dist/esm-es5/stzh-amount.entry.js.map +1 -1
- package/dist/esm-es5/stzh-components.js +1 -1
- package/dist/esm-es5/stzh-components.js.map +1 -1
- package/dist/esm-es5/stzh-datepicker_3.entry.js.map +1 -1
- package/dist/esm-es5/stzh-dropdown.entry.js +2 -2
- package/dist/esm-es5/stzh-dropdown.entry.js.map +1 -1
- package/dist/esm-es5/stzh-monthyearpicker.entry.js +2 -0
- package/dist/esm-es5/stzh-monthyearpicker.entry.js.map +1 -0
- package/dist/esm-es5/stzh-pagetitle.entry.js +1 -1
- package/dist/esm-es5/stzh-pagetitle.entry.js.map +1 -1
- package/dist/esm-es5/stzh-skin-portal-mitwirken.entry.js +1 -1
- package/dist/esm-es5/stzh-skin-portal-mitwirken.entry.js.map +1 -1
- package/dist/esm-es5/stzh-timepicker.entry.js +2 -0
- package/dist/esm-es5/stzh-timepicker.entry.js.map +1 -0
- package/dist/esm-es5/translation-utils-2623783f.js.map +1 -1
- package/dist/stzh-components/assets/i18n/de.json +10 -7
- package/dist/stzh-components/assets/i18n/en.json +8 -5
- package/dist/stzh-components/index.esm.js.map +1 -1
- package/dist/stzh-components/p-14e782cb.entry.js +2 -0
- package/dist/stzh-components/{p-85504842.entry.js.map → p-14e782cb.entry.js.map} +1 -1
- package/dist/stzh-components/p-25a09313.js.map +1 -1
- package/dist/stzh-components/p-51f1714c.system.entry.js +2 -0
- package/dist/stzh-components/p-51f1714c.system.entry.js.map +1 -0
- package/dist/stzh-components/p-5aa96b49.system.entry.js +2 -0
- package/dist/stzh-components/p-5aa96b49.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-1ef5420a.entry.js → p-6c219530.entry.js} +2 -2
- package/dist/stzh-components/p-6c219530.entry.js.map +1 -0
- package/dist/stzh-components/p-7b297848.system.entry.js +2 -0
- package/dist/stzh-components/p-7b297848.system.entry.js.map +1 -0
- package/dist/stzh-components/p-82e886d4.entry.js.map +1 -1
- package/dist/stzh-components/p-9f31cf7d.entry.js +2 -0
- package/dist/stzh-components/p-9f31cf7d.entry.js.map +1 -0
- package/dist/stzh-components/p-9fe69be8.system.entry.js +2 -0
- package/dist/stzh-components/{p-479a02fb.system.entry.js.map → p-9fe69be8.system.entry.js.map} +1 -1
- package/dist/stzh-components/{p-61b66e55.system.js → p-a1be7b8e.system.js} +2 -2
- package/dist/stzh-components/{p-61b66e55.system.js.map → p-a1be7b8e.system.js.map} +1 -1
- package/dist/stzh-components/p-a408bfba.system.js.map +1 -1
- package/dist/stzh-components/p-ad33db31.entry.js +2 -0
- package/dist/stzh-components/p-ad33db31.entry.js.map +1 -0
- package/dist/stzh-components/p-b5cda655.entry.js +2 -0
- package/dist/stzh-components/p-b5cda655.entry.js.map +1 -0
- package/dist/stzh-components/p-c0f971f2.entry.js +9 -0
- package/dist/stzh-components/p-c0f971f2.entry.js.map +1 -0
- package/dist/stzh-components/p-c901fe72.system.entry.js +9 -0
- package/dist/stzh-components/p-c901fe72.system.entry.js.map +1 -0
- package/dist/stzh-components/{p-362af013.js → p-cb675f5e.js} +2 -2
- package/dist/stzh-components/{p-362af013.js.map → p-cb675f5e.js.map} +1 -1
- package/dist/stzh-components/p-daf83e0b.system.js +2 -0
- package/dist/stzh-components/{p-3e10addb.system.js.map → p-daf83e0b.system.js.map} +1 -1
- package/dist/stzh-components/p-e8545386.system.entry.js +2 -0
- package/dist/stzh-components/p-e8545386.system.entry.js.map +1 -0
- package/dist/stzh-components/p-eaa65f52.system.js.map +1 -1
- package/dist/stzh-components/p-f2d74491.system.entry.js.map +1 -1
- package/dist/stzh-components/stzh-components.css +1 -1
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/stzh-components/stzh-components.js +1 -1
- package/dist/types/components/stzh-amount/stzh-amount.localization.d.ts +0 -2
- package/dist/types/components/stzh-monthyearpicker/stzh-monthyearpicker.localization.d.ts +5 -0
- package/dist/types/components/stzh-timepicker/stzh-timepicker.localization.d.ts +2 -0
- package/dist/types/components.d.ts +428 -6
- package/dist/types/index.d.ts +14 -0
- package/dist/types/utils/translation-utils.d.ts +1 -0
- package/dist/vscode-data.json +263 -1
- package/package.json +1 -1
- package/dist/stzh-components/p-1cc48f98.entry.js +0 -9
- package/dist/stzh-components/p-1cc48f98.entry.js.map +0 -1
- package/dist/stzh-components/p-1ef5420a.entry.js.map +0 -1
- package/dist/stzh-components/p-3e10addb.system.js +0 -2
- package/dist/stzh-components/p-479a02fb.system.entry.js +0 -2
- package/dist/stzh-components/p-67b11b03.system.entry.js +0 -2
- package/dist/stzh-components/p-67b11b03.system.entry.js.map +0 -1
- package/dist/stzh-components/p-6bb83b30.system.entry.js +0 -9
- package/dist/stzh-components/p-6bb83b30.system.entry.js.map +0 -1
- package/dist/stzh-components/p-7605ae9a.system.entry.js +0 -2
- package/dist/stzh-components/p-7605ae9a.system.entry.js.map +0 -1
- package/dist/stzh-components/p-85504842.entry.js +0 -2
- package/dist/stzh-components/p-c94f7331.entry.js +0 -2
- package/dist/stzh-components/p-c94f7331.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","Constructor","protoProps","staticProps","prototype","_classCallCheck","instance","TypeError","window","slice","Array","matches","Element","msMatchesSelector","_focusableElementsString","join","InertRoot","rootElement","inertManager","this","_inertManager","_rootElement","_managedNodes","Set","hasAttribute","_savedAriaHidden","getAttribute","setAttribute","_makeSubtreeUnfocusable","_observer","MutationObserver","_onMutation","bind","observe","attributes","childList","subtree","value","destructor","disconnect","removeAttribute","forEach","inertNode","_unmanageNode","node","startNode","_this2","composedTreeWalk","_visitNode","activeElement","document","body","contains","root","undefined","nodeType","Node","DOCUMENT_FRAGMENT_NODE","parentNode","blur","focus","ELEMENT_NODE","element","_adoptInertRoot","call","_manageNode","register","add","deregister","_unmanageSubtree","_this3","inertSubroot","getInertRoot","setInert","managedNodes","savedInertNode","records","self","record","type","addedNodes","removedNodes","attributeName","managedNode","get","set","ariaHidden","InertNode","inertRoot","_node","_overrodeFocusMethod","_inertRoots","_savedTabIndex","_destroyed","ensureUntabbable","_throwIfDestroyed","destroyed","Error","tabIndex","hasSavedTabIndex","addInertRoot","removeInertRoot","size","InertManager","_document","Map","_watchForInert","addInertStyle","head","documentElement","readyState","addEventListener","_onDocumentLoaded","inert","has","parent","_inertRoot","inertElements","querySelectorAll","inertElement","_this","unshift","callback","shadowRootAncestor","shadowRoot","localName","content","distributedNodes","getDistributedNodes","slot","_distributedNodes","assignedNodes","flatten","_i","child","firstChild","nextSibling","querySelector","style","createElement","textContent","appendChild","HTMLElement","hasOwnProperty","packageName","packageNameScoped","substring","indexOf","applyAutofocus","event","autofocus","detail","namespace","tagName","toLowerCase","setFocus","observeScrollbarWidth","config","threshold","handleIntersect","entries","entry","scrollbarWidth","intersectionRatio","innerWidth","clientWidth","setProperty","bodyScrollObserver","IntersectionObserver","appGlobalScript","stzhComponents","assign","version","labels","cacheTranslations","pathTranslations","formats","globalScripts","exports"],"sources":["node_modules/wicg-inert/dist/inert.esm.js","src/global/js/helpers/autofocus.js","src/global/js/helpers/scrollbar-width.js","src/global/js/script.js","@stencil/core/internal/app-globals"],"sourcesContent":["var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * This work is licensed under the W3C Software and Document License\n * (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).\n */\n\n(function () {\n // Return early if we're not running inside of the browser.\n if (typeof window === 'undefined') {\n return;\n }\n\n // Convenience function for converting NodeLists.\n /** @type {typeof Array.prototype.slice} */\n var slice = Array.prototype.slice;\n\n /**\n * IE has a non-standard name for \"matches\".\n * @type {typeof Element.prototype.matches}\n */\n var matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n\n /** @type {string} */\n var _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', '[contenteditable]'].join(',');\n\n /**\n * `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert`\n * attribute.\n *\n * Its main functions are:\n *\n * - to create and maintain a set of managed `InertNode`s, including when mutations occur in the\n * subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering\n * each focusable node in the subtree with the singleton `InertManager` which manages all known\n * focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode`\n * instance exists for each focusable node which has at least one inert root as an ancestor.\n *\n * - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert`\n * attribute is removed from the root node). This is handled in the destructor, which calls the\n * `deregister` method on `InertManager` for each managed inert node.\n */\n\n var InertRoot = function () {\n /**\n * @param {!HTMLElement} rootElement The HTMLElement at the root of the inert subtree.\n * @param {!InertManager} inertManager The global singleton InertManager object.\n */\n function InertRoot(rootElement, inertManager) {\n _classCallCheck(this, InertRoot);\n\n /** @type {!InertManager} */\n this._inertManager = inertManager;\n\n /** @type {!HTMLElement} */\n this._rootElement = rootElement;\n\n /**\n * @type {!Set<!InertNode>}\n * All managed focusable nodes in this InertRoot's subtree.\n */\n this._managedNodes = new Set();\n\n // Make the subtree hidden from assistive technology\n if (this._rootElement.hasAttribute('aria-hidden')) {\n /** @type {?string} */\n this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden');\n } else {\n this._savedAriaHidden = null;\n }\n this._rootElement.setAttribute('aria-hidden', 'true');\n\n // Make all focusable elements in the subtree unfocusable and add them to _managedNodes\n this._makeSubtreeUnfocusable(this._rootElement);\n\n // Watch for:\n // - any additions in the subtree: make them unfocusable too\n // - any removals from the subtree: remove them from this inert root's managed nodes\n // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable\n // element, make that node a managed node.\n this._observer = new MutationObserver(this._onMutation.bind(this));\n this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true });\n }\n\n /**\n * Call this whenever this object is about to become obsolete. This unwinds all of the state\n * stored in this object and updates the state of all of the managed nodes.\n */\n\n\n _createClass(InertRoot, [{\n key: 'destructor',\n value: function destructor() {\n this._observer.disconnect();\n\n if (this._rootElement) {\n if (this._savedAriaHidden !== null) {\n this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden);\n } else {\n this._rootElement.removeAttribute('aria-hidden');\n }\n }\n\n this._managedNodes.forEach(function (inertNode) {\n this._unmanageNode(inertNode.node);\n }, this);\n\n // Note we cast the nulls to the ANY type here because:\n // 1) We want the class properties to be declared as non-null, or else we\n // need even more casts throughout this code. All bets are off if an\n // instance has been destroyed and a method is called.\n // 2) We don't want to cast \"this\", because we want type-aware optimizations\n // to know which properties we're setting.\n this._observer = /** @type {?} */null;\n this._rootElement = /** @type {?} */null;\n this._managedNodes = /** @type {?} */null;\n this._inertManager = /** @type {?} */null;\n }\n\n /**\n * @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set.\n */\n\n }, {\n key: '_makeSubtreeUnfocusable',\n\n\n /**\n * @param {!Node} startNode\n */\n value: function _makeSubtreeUnfocusable(startNode) {\n var _this2 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this2._visitNode(node);\n });\n\n var activeElement = document.activeElement;\n\n if (!document.body.contains(startNode)) {\n // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement.\n var node = startNode;\n /** @type {!ShadowRoot|undefined} */\n var root = undefined;\n while (node) {\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n root = /** @type {!ShadowRoot} */node;\n break;\n }\n node = node.parentNode;\n }\n if (root) {\n activeElement = root.activeElement;\n }\n }\n if (startNode.contains(activeElement)) {\n activeElement.blur();\n // In IE11, if an element is already focused, and then set to tabindex=-1\n // calling blur() will not actually move the focus.\n // To work around this we call focus() on the body instead.\n if (activeElement === document.activeElement) {\n document.body.focus();\n }\n }\n }\n\n /**\n * @param {!Node} node\n */\n\n }, {\n key: '_visitNode',\n value: function _visitNode(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */node;\n\n // If a descendant inert root becomes un-inert, its descendants will still be inert because of\n // this inert root, so all of its managed nodes need to be adopted by this InertRoot.\n if (element !== this._rootElement && element.hasAttribute('inert')) {\n this._adoptInertRoot(element);\n }\n\n if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) {\n this._manageNode(element);\n }\n }\n\n /**\n * Register the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_manageNode',\n value: function _manageNode(node) {\n var inertNode = this._inertManager.register(node, this);\n this._managedNodes.add(inertNode);\n }\n\n /**\n * Unregister the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_unmanageNode',\n value: function _unmanageNode(node) {\n var inertNode = this._inertManager.deregister(node, this);\n if (inertNode) {\n this._managedNodes['delete'](inertNode);\n }\n }\n\n /**\n * Unregister the entire subtree starting at `startNode`.\n * @param {!Node} startNode\n */\n\n }, {\n key: '_unmanageSubtree',\n value: function _unmanageSubtree(startNode) {\n var _this3 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this3._unmanageNode(node);\n });\n }\n\n /**\n * If a descendant node is found with an `inert` attribute, adopt its managed nodes.\n * @param {!HTMLElement} node\n */\n\n }, {\n key: '_adoptInertRoot',\n value: function _adoptInertRoot(node) {\n var inertSubroot = this._inertManager.getInertRoot(node);\n\n // During initialisation this inert root may not have been registered yet,\n // so register it now if need be.\n if (!inertSubroot) {\n this._inertManager.setInert(node, true);\n inertSubroot = this._inertManager.getInertRoot(node);\n }\n\n inertSubroot.managedNodes.forEach(function (savedInertNode) {\n this._manageNode(savedInertNode.node);\n }, this);\n }\n\n /**\n * Callback used when mutation observer detects subtree additions, removals, or attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_onMutation',\n value: function _onMutation(records, self) {\n records.forEach(function (record) {\n var target = /** @type {!HTMLElement} */record.target;\n if (record.type === 'childList') {\n // Manage added nodes\n slice.call(record.addedNodes).forEach(function (node) {\n this._makeSubtreeUnfocusable(node);\n }, this);\n\n // Un-manage removed nodes\n slice.call(record.removedNodes).forEach(function (node) {\n this._unmanageSubtree(node);\n }, this);\n } else if (record.type === 'attributes') {\n if (record.attributeName === 'tabindex') {\n // Re-initialise inert node if tabindex changes\n this._manageNode(target);\n } else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) {\n // If a new inert root is added, adopt its managed nodes and make sure it knows about the\n // already managed nodes from this inert subroot.\n this._adoptInertRoot(target);\n var inertSubroot = this._inertManager.getInertRoot(target);\n this._managedNodes.forEach(function (managedNode) {\n if (target.contains(managedNode.node)) {\n inertSubroot._manageNode(managedNode.node);\n }\n });\n }\n }\n }, this);\n }\n }, {\n key: 'managedNodes',\n get: function get() {\n return new Set(this._managedNodes);\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'hasSavedAriaHidden',\n get: function get() {\n return this._savedAriaHidden !== null;\n }\n\n /** @param {?string} ariaHidden */\n\n }, {\n key: 'savedAriaHidden',\n set: function set(ariaHidden) {\n this._savedAriaHidden = ariaHidden;\n }\n\n /** @return {?string} */\n ,\n get: function get() {\n return this._savedAriaHidden;\n }\n }]);\n\n return InertRoot;\n }();\n\n /**\n * `InertNode` initialises and manages a single inert node.\n * A node is inert if it is a descendant of one or more inert root elements.\n *\n * On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and\n * either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element\n * is intrinsically focusable or not.\n *\n * `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an\n * `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the\n * `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s\n * remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists,\n * or removes the `tabindex` attribute if the element is intrinsically focusable.\n */\n\n\n var InertNode = function () {\n /**\n * @param {!Node} node A focusable element to be made inert.\n * @param {!InertRoot} inertRoot The inert root element associated with this inert node.\n */\n function InertNode(node, inertRoot) {\n _classCallCheck(this, InertNode);\n\n /** @type {!Node} */\n this._node = node;\n\n /** @type {boolean} */\n this._overrodeFocusMethod = false;\n\n /**\n * @type {!Set<!InertRoot>} The set of descendant inert roots.\n * If and only if this set becomes empty, this node is no longer inert.\n */\n this._inertRoots = new Set([inertRoot]);\n\n /** @type {?number} */\n this._savedTabIndex = null;\n\n /** @type {boolean} */\n this._destroyed = false;\n\n // Save any prior tabindex info and make this node untabbable\n this.ensureUntabbable();\n }\n\n /**\n * Call this whenever this object is about to become obsolete.\n * This makes the managed node focusable again and deletes all of the previously stored state.\n */\n\n\n _createClass(InertNode, [{\n key: 'destructor',\n value: function destructor() {\n this._throwIfDestroyed();\n\n if (this._node && this._node.nodeType === Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */this._node;\n if (this._savedTabIndex !== null) {\n element.setAttribute('tabindex', this._savedTabIndex);\n } else {\n element.removeAttribute('tabindex');\n }\n\n // Use `delete` to restore native focus method.\n if (this._overrodeFocusMethod) {\n delete element.focus;\n }\n }\n\n // See note in InertRoot.destructor for why we cast these nulls to ANY.\n this._node = /** @type {?} */null;\n this._inertRoots = /** @type {?} */null;\n this._destroyed = true;\n }\n\n /**\n * @type {boolean} Whether this object is obsolete because the managed node is no longer inert.\n * If the object has been destroyed, any attempt to access it will cause an exception.\n */\n\n }, {\n key: '_throwIfDestroyed',\n\n\n /**\n * Throw if user tries to access destroyed InertNode.\n */\n value: function _throwIfDestroyed() {\n if (this.destroyed) {\n throw new Error('Trying to access destroyed InertNode');\n }\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'ensureUntabbable',\n\n\n /** Save the existing tabindex value and make the node untabbable and unfocusable */\n value: function ensureUntabbable() {\n if (this.node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */this.node;\n if (matches.call(element, _focusableElementsString)) {\n if ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) {\n return;\n }\n\n if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n }\n element.setAttribute('tabindex', '-1');\n if (element.nodeType === Node.ELEMENT_NODE) {\n element.focus = function () {};\n this._overrodeFocusMethod = true;\n }\n } else if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n element.removeAttribute('tabindex');\n }\n }\n\n /**\n * Add another inert root to this inert node's set of managing inert roots.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'addInertRoot',\n value: function addInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots.add(inertRoot);\n }\n\n /**\n * Remove the given inert root from this inert node's set of managing inert roots.\n * If the set of managing inert roots becomes empty, this node is no longer inert,\n * so the object should be destroyed.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'removeInertRoot',\n value: function removeInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots['delete'](inertRoot);\n if (this._inertRoots.size === 0) {\n this.destructor();\n }\n }\n }, {\n key: 'destroyed',\n get: function get() {\n return (/** @type {!InertNode} */this._destroyed\n );\n }\n }, {\n key: 'hasSavedTabIndex',\n get: function get() {\n return this._savedTabIndex !== null;\n }\n\n /** @return {!Node} */\n\n }, {\n key: 'node',\n get: function get() {\n this._throwIfDestroyed();\n return this._node;\n }\n\n /** @param {?number} tabIndex */\n\n }, {\n key: 'savedTabIndex',\n set: function set(tabIndex) {\n this._throwIfDestroyed();\n this._savedTabIndex = tabIndex;\n }\n\n /** @return {?number} */\n ,\n get: function get() {\n this._throwIfDestroyed();\n return this._savedTabIndex;\n }\n }]);\n\n return InertNode;\n }();\n\n /**\n * InertManager is a per-document singleton object which manages all inert roots and nodes.\n *\n * When an element becomes an inert root by having an `inert` attribute set and/or its `inert`\n * property set to `true`, the `setInert` method creates an `InertRoot` object for the element.\n * The `InertRoot` in turn registers itself as managing all of the element's focusable descendant\n * nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance\n * is created for each such node, via the `_managedNodes` map.\n */\n\n\n var InertManager = function () {\n /**\n * @param {!Document} document\n */\n function InertManager(document) {\n _classCallCheck(this, InertManager);\n\n if (!document) {\n throw new Error('Missing required argument; InertManager needs to wrap a document.');\n }\n\n /** @type {!Document} */\n this._document = document;\n\n /**\n * All managed nodes known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertNode>}\n */\n this._managedNodes = new Map();\n\n /**\n * All inert roots known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertRoot>}\n */\n this._inertRoots = new Map();\n\n /**\n * Observer for mutations on `document.body`.\n * @type {!MutationObserver}\n */\n this._observer = new MutationObserver(this._watchForInert.bind(this));\n\n // Add inert style.\n addInertStyle(document.head || document.body || document.documentElement);\n\n // Wait for document to be loaded.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this));\n } else {\n this._onDocumentLoaded();\n }\n }\n\n /**\n * Set whether the given element should be an inert root or not.\n * @param {!HTMLElement} root\n * @param {boolean} inert\n */\n\n\n _createClass(InertManager, [{\n key: 'setInert',\n value: function setInert(root, inert) {\n if (inert) {\n if (this._inertRoots.has(root)) {\n // element is already inert\n return;\n }\n\n var inertRoot = new InertRoot(root, this);\n root.setAttribute('inert', '');\n this._inertRoots.set(root, inertRoot);\n // If not contained in the document, it must be in a shadowRoot.\n // Ensure inert styles are added there.\n if (!this._document.body.contains(root)) {\n var parent = root.parentNode;\n while (parent) {\n if (parent.nodeType === 11) {\n addInertStyle(parent);\n }\n parent = parent.parentNode;\n }\n }\n } else {\n if (!this._inertRoots.has(root)) {\n // element is already non-inert\n return;\n }\n\n var _inertRoot = this._inertRoots.get(root);\n _inertRoot.destructor();\n this._inertRoots['delete'](root);\n root.removeAttribute('inert');\n }\n }\n\n /**\n * Get the InertRoot object corresponding to the given inert root element, if any.\n * @param {!Node} element\n * @return {!InertRoot|undefined}\n */\n\n }, {\n key: 'getInertRoot',\n value: function getInertRoot(element) {\n return this._inertRoots.get(element);\n }\n\n /**\n * Register the given InertRoot as managing the given node.\n * In the case where the node has a previously existing inert root, this inert root will\n * be added to its set of inert roots.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {!InertNode} inertNode\n */\n\n }, {\n key: 'register',\n value: function register(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (inertNode !== undefined) {\n // node was already in an inert subtree\n inertNode.addInertRoot(inertRoot);\n } else {\n inertNode = new InertNode(node, inertRoot);\n }\n\n this._managedNodes.set(node, inertNode);\n\n return inertNode;\n }\n\n /**\n * De-register the given InertRoot as managing the given inert node.\n * Removes the inert root from the InertNode's set of managing inert roots, and remove the inert\n * node from the InertManager's set of managed nodes if it is destroyed.\n * If the node is not currently managed, this is essentially a no-op.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.\n */\n\n }, {\n key: 'deregister',\n value: function deregister(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (!inertNode) {\n return null;\n }\n\n inertNode.removeInertRoot(inertRoot);\n if (inertNode.destroyed) {\n this._managedNodes['delete'](node);\n }\n\n return inertNode;\n }\n\n /**\n * Callback used when document has finished loading.\n */\n\n }, {\n key: '_onDocumentLoaded',\n value: function _onDocumentLoaded() {\n // Find all inert roots in document and make them actually inert.\n var inertElements = slice.call(this._document.querySelectorAll('[inert]'));\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, this);\n\n // Comment this out to use programmatic API only.\n this._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true });\n }\n\n /**\n * Callback used when mutation observer detects attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_watchForInert',\n value: function _watchForInert(records, self) {\n var _this = this;\n records.forEach(function (record) {\n switch (record.type) {\n case 'childList':\n slice.call(record.addedNodes).forEach(function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var inertElements = slice.call(node.querySelectorAll('[inert]'));\n if (matches.call(node, '[inert]')) {\n inertElements.unshift(node);\n }\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, _this);\n }, _this);\n break;\n case 'attributes':\n if (record.attributeName !== 'inert') {\n return;\n }\n var target = /** @type {!HTMLElement} */record.target;\n var inert = target.hasAttribute('inert');\n _this.setInert(target, inert);\n break;\n }\n }, this);\n }\n }]);\n\n return InertManager;\n }();\n\n /**\n * Recursively walk the composed tree from |node|.\n * @param {!Node} node\n * @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed,\n * before descending into child nodes.\n * @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any.\n */\n\n\n function composedTreeWalk(node, callback, shadowRootAncestor) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */node;\n if (callback) {\n callback(element);\n }\n\n // Descend into node:\n // If it has a ShadowRoot, ignore all child elements - these will be picked\n // up by the <content> or <shadow> elements. Descend straight into the\n // ShadowRoot.\n var shadowRoot = /** @type {!HTMLElement} */element.shadowRoot;\n if (shadowRoot) {\n composedTreeWalk(shadowRoot, callback, shadowRoot);\n return;\n }\n\n // If it is a <content> element, descend into distributed elements - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'content') {\n var content = /** @type {!HTMLContentElement} */element;\n // Verifies if ShadowDom v0 is supported.\n var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : [];\n for (var i = 0; i < distributedNodes.length; i++) {\n composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor);\n }\n return;\n }\n\n // If it is a <slot> element, descend into assigned nodes - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'slot') {\n var slot = /** @type {!HTMLSlotElement} */element;\n // Verify if ShadowDom v1 is supported.\n var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : [];\n for (var _i = 0; _i < _distributedNodes.length; _i++) {\n composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor);\n }\n return;\n }\n }\n\n // If it is neither the parent of a ShadowRoot, a <content> element, a <slot>\n // element, nor a <shadow> element recurse normally.\n var child = node.firstChild;\n while (child != null) {\n composedTreeWalk(child, callback, shadowRootAncestor);\n child = child.nextSibling;\n }\n }\n\n /**\n * Adds a style element to the node containing the inert specific styles\n * @param {!Node} node\n */\n function addInertStyle(node) {\n if (node.querySelector('style#inert-style, link#inert-style')) {\n return;\n }\n var style = document.createElement('style');\n style.setAttribute('id', 'inert-style');\n style.textContent = '\\n' + '[inert] {\\n' + ' pointer-events: none;\\n' + ' cursor: default;\\n' + '}\\n' + '\\n' + '[inert], [inert] * {\\n' + ' -webkit-user-select: none;\\n' + ' -moz-user-select: none;\\n' + ' -ms-user-select: none;\\n' + ' user-select: none;\\n' + '}\\n';\n node.appendChild(style);\n }\n\n if (!HTMLElement.prototype.hasOwnProperty('inert')) {\n /** @type {!InertManager} */\n var inertManager = new InertManager(document);\n\n Object.defineProperty(HTMLElement.prototype, 'inert', {\n enumerable: true,\n /** @this {!HTMLElement} */\n get: function get() {\n return this.hasAttribute('inert');\n },\n /** @this {!HTMLElement} */\n set: function set(inert) {\n inertManager.setInert(this, inert);\n }\n });\n }\n})();\n","import { name as packageNameScoped } from '../../../../package.json';\n\nconst packageName = packageNameScoped.substring(packageNameScoped.indexOf('/')+1);\n\n/**\n * Execute setFocus method if it exists\n * on stzh-element with autofocus on pageload\n * when (child components are loaded)\n */\nexport function applyAutofocus() {\n window.addEventListener('appload', (event) => {\n const autofocus = document.querySelector('[autofocus]');\n\n if (autofocus\n && event.detail.namespace === packageName\n && autofocus.tagName.toLowerCase().indexOf('stzh-') === 0\n && 'setFocus' in autofocus\n ) {\n autofocus.setFocus();\n }\n });\n}\n","export function observeScrollbarWidth() {\n const config = {\n threshold: 1.0\n };\n\n const handleIntersect = (entries) => {\n entries.forEach(entry => {\n let scrollbarWidth = 0;\n\n if (entry.intersectionRatio < 1) {\n scrollbarWidth = window.innerWidth - document.body.clientWidth;\n }\n\n document.documentElement.style.setProperty('--stzh-scrollbar-width', scrollbarWidth + 'px');\n });\n };\n\n const bodyScrollObserver = new IntersectionObserver(handleIntersect, config);\n bodyScrollObserver.observe(document.body);\n}\n","import \"wicg-inert\";\n\nimport { version } from '../../../package.json';\nimport { applyAutofocus } from './helpers/autofocus';\nimport { observeScrollbarWidth } from './helpers/scrollbar-width';\n\nexport default function () {\n window.stzhComponents = {\n version,\n labels: 'fixed',\n cacheTranslations: true,\n pathTranslations: '/',\n formats: {},\n ...window.stzhComponents || {}\n };\n\n applyAutofocus();\n observeScrollbarWidth();\n}\n","import appGlobalScript from '/builds/OE-5041/desi/desi-code/stzh-components/src/global/js/script.js';\nexport const globalScripts = appGlobalScript;\n"],"mappings":"uEAAA,IAAIA,EAAe,WAAc,SAASC,EAAiBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAWC,YAAc,MAAOD,EAAWE,aAAe,KAAM,GAAI,UAAWF,EAAYA,EAAWG,SAAW,KAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,E,CAAc,CAAG,OAAO,SAAUO,EAAaC,EAAYC,GAAe,GAAID,EAAYb,EAAiBY,EAAYG,UAAWF,GAAa,GAAIC,EAAad,EAAiBY,EAAaE,GAAc,OAAOF,CAAY,CAAG,CAA5hB,GAEnB,SAASI,EAAgBC,EAAUL,GAAe,KAAMK,aAAoBL,GAAc,CAAE,MAAM,IAAIM,UAAU,oC,CAAuC,EAOvJ,WAEE,UAAWC,SAAW,YAAa,CACjC,M,CAKF,IAAIC,EAAQC,MAAMN,UAAUK,MAM5B,IAAIE,EAAUC,QAAQR,UAAUO,SAAWC,QAAQR,UAAUS,kBAG7D,IAAIC,EAA2B,CAAC,UAAW,aAAc,wBAAyB,yBAA0B,2BAA4B,yBAA0B,UAAW,UAAW,SAAU,SAAU,QAAS,qBAAqBC,KAAK,KAmB/O,IAAIC,EAAY,WAKd,SAASA,EAAUC,EAAaC,GAC9Bb,EAAgBc,KAAMH,GAGtBG,KAAKC,cAAgBF,EAGrBC,KAAKE,aAAeJ,EAMpBE,KAAKG,cAAgB,IAAIC,IAGzB,GAAIJ,KAAKE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,WAAalH,SAASC,KAAKkH,W,CAGrDnH,SAAS2D,gBAAgB6B,MAAM4B,YAAY,yBAA0BJ,EAAiB,KAC5F,GACA,EAEE,IAAMK,EAAqB,IAAIC,qBAAqBT,EAAiBF,GACrEU,EAAmBtI,QAAQiB,SAASC,KACtC,CCde,SAAAsH,IACfjK,OAAAkK,eAAA5K,OAAA6K,OAAA,CAAAC,UAAAC,OAAA,QAAAC,kBAAA,KAAAC,iBAAA,IAAAC,QAAA,IAAAxK,OAAAkK,gBAAA,IACEtB,IACAQ,GACF,CCRY,IAACqB,EAAaC,EAAA,IAAGT,E"}
|
|
1
|
+
{"version":3,"names":["_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","Constructor","protoProps","staticProps","prototype","_classCallCheck","instance","TypeError","window","slice","Array","matches","Element","msMatchesSelector","_focusableElementsString","join","InertRoot","rootElement","inertManager","this","_inertManager","_rootElement","_managedNodes","Set","hasAttribute","_savedAriaHidden","getAttribute","setAttribute","_makeSubtreeUnfocusable","_observer","MutationObserver","_onMutation","bind","observe","attributes","childList","subtree","value","destructor","disconnect","removeAttribute","forEach","inertNode","_unmanageNode","node","startNode","_this2","composedTreeWalk","_visitNode","activeElement","document","body","contains","root","undefined","nodeType","Node","DOCUMENT_FRAGMENT_NODE","parentNode","blur","focus","ELEMENT_NODE","element","_adoptInertRoot","call","_manageNode","register","add","deregister","_unmanageSubtree","_this3","inertSubroot","getInertRoot","setInert","managedNodes","savedInertNode","records","self","record","type","addedNodes","removedNodes","attributeName","managedNode","get","set","ariaHidden","InertNode","inertRoot","_node","_overrodeFocusMethod","_inertRoots","_savedTabIndex","_destroyed","ensureUntabbable","_throwIfDestroyed","destroyed","Error","tabIndex","hasSavedTabIndex","addInertRoot","removeInertRoot","size","InertManager","_document","Map","_watchForInert","addInertStyle","head","documentElement","readyState","addEventListener","_onDocumentLoaded","inert","has","parent","_inertRoot","inertElements","querySelectorAll","inertElement","_this","unshift","callback","shadowRootAncestor","shadowRoot","localName","content","distributedNodes","getDistributedNodes","slot","_distributedNodes","assignedNodes","flatten","_i","child","firstChild","nextSibling","querySelector","style","createElement","textContent","appendChild","HTMLElement","hasOwnProperty","packageName","packageNameScoped","substring","indexOf","applyAutofocus","event","autofocus","detail","namespace","tagName","toLowerCase","setFocus","observeScrollbarWidth","config","threshold","handleIntersect","entries","entry","scrollbarWidth","intersectionRatio","innerWidth","clientWidth","setProperty","bodyScrollObserver","IntersectionObserver","appGlobalScript","stzhComponents","assign","version","labels","cacheTranslations","pathTranslations","formats","globalScripts","exports"],"sources":["node_modules/wicg-inert/dist/inert.esm.js","src/global/js/helpers/autofocus.js","src/global/js/helpers/scrollbar-width.js","src/global/js/script.js","@stencil/core/internal/app-globals"],"sourcesContent":["var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * This work is licensed under the W3C Software and Document License\n * (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).\n */\n\n(function () {\n // Return early if we're not running inside of the browser.\n if (typeof window === 'undefined') {\n return;\n }\n\n // Convenience function for converting NodeLists.\n /** @type {typeof Array.prototype.slice} */\n var slice = Array.prototype.slice;\n\n /**\n * IE has a non-standard name for \"matches\".\n * @type {typeof Element.prototype.matches}\n */\n var matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n\n /** @type {string} */\n var _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', '[contenteditable]'].join(',');\n\n /**\n * `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert`\n * attribute.\n *\n * Its main functions are:\n *\n * - to create and maintain a set of managed `InertNode`s, including when mutations occur in the\n * subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering\n * each focusable node in the subtree with the singleton `InertManager` which manages all known\n * focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode`\n * instance exists for each focusable node which has at least one inert root as an ancestor.\n *\n * - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert`\n * attribute is removed from the root node). This is handled in the destructor, which calls the\n * `deregister` method on `InertManager` for each managed inert node.\n */\n\n var InertRoot = function () {\n /**\n * @param {!HTMLElement} rootElement The HTMLElement at the root of the inert subtree.\n * @param {!InertManager} inertManager The global singleton InertManager object.\n */\n function InertRoot(rootElement, inertManager) {\n _classCallCheck(this, InertRoot);\n\n /** @type {!InertManager} */\n this._inertManager = inertManager;\n\n /** @type {!HTMLElement} */\n this._rootElement = rootElement;\n\n /**\n * @type {!Set<!InertNode>}\n * All managed focusable nodes in this InertRoot's subtree.\n */\n this._managedNodes = new Set();\n\n // Make the subtree hidden from assistive technology\n if (this._rootElement.hasAttribute('aria-hidden')) {\n /** @type {?string} */\n this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden');\n } else {\n this._savedAriaHidden = null;\n }\n this._rootElement.setAttribute('aria-hidden', 'true');\n\n // Make all focusable elements in the subtree unfocusable and add them to _managedNodes\n this._makeSubtreeUnfocusable(this._rootElement);\n\n // Watch for:\n // - any additions in the subtree: make them unfocusable too\n // - any removals from the subtree: remove them from this inert root's managed nodes\n // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable\n // element, make that node a managed node.\n this._observer = new MutationObserver(this._onMutation.bind(this));\n this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true });\n }\n\n /**\n * Call this whenever this object is about to become obsolete. This unwinds all of the state\n * stored in this object and updates the state of all of the managed nodes.\n */\n\n\n _createClass(InertRoot, [{\n key: 'destructor',\n value: function destructor() {\n this._observer.disconnect();\n\n if (this._rootElement) {\n if (this._savedAriaHidden !== null) {\n this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden);\n } else {\n this._rootElement.removeAttribute('aria-hidden');\n }\n }\n\n this._managedNodes.forEach(function (inertNode) {\n this._unmanageNode(inertNode.node);\n }, this);\n\n // Note we cast the nulls to the ANY type here because:\n // 1) We want the class properties to be declared as non-null, or else we\n // need even more casts throughout this code. All bets are off if an\n // instance has been destroyed and a method is called.\n // 2) We don't want to cast \"this\", because we want type-aware optimizations\n // to know which properties we're setting.\n this._observer = /** @type {?} */null;\n this._rootElement = /** @type {?} */null;\n this._managedNodes = /** @type {?} */null;\n this._inertManager = /** @type {?} */null;\n }\n\n /**\n * @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set.\n */\n\n }, {\n key: '_makeSubtreeUnfocusable',\n\n\n /**\n * @param {!Node} startNode\n */\n value: function _makeSubtreeUnfocusable(startNode) {\n var _this2 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this2._visitNode(node);\n });\n\n var activeElement = document.activeElement;\n\n if (!document.body.contains(startNode)) {\n // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement.\n var node = startNode;\n /** @type {!ShadowRoot|undefined} */\n var root = undefined;\n while (node) {\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n root = /** @type {!ShadowRoot} */node;\n break;\n }\n node = node.parentNode;\n }\n if (root) {\n activeElement = root.activeElement;\n }\n }\n if (startNode.contains(activeElement)) {\n activeElement.blur();\n // In IE11, if an element is already focused, and then set to tabindex=-1\n // calling blur() will not actually move the focus.\n // To work around this we call focus() on the body instead.\n if (activeElement === document.activeElement) {\n document.body.focus();\n }\n }\n }\n\n /**\n * @param {!Node} node\n */\n\n }, {\n key: '_visitNode',\n value: function _visitNode(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */node;\n\n // If a descendant inert root becomes un-inert, its descendants will still be inert because of\n // this inert root, so all of its managed nodes need to be adopted by this InertRoot.\n if (element !== this._rootElement && element.hasAttribute('inert')) {\n this._adoptInertRoot(element);\n }\n\n if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) {\n this._manageNode(element);\n }\n }\n\n /**\n * Register the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_manageNode',\n value: function _manageNode(node) {\n var inertNode = this._inertManager.register(node, this);\n this._managedNodes.add(inertNode);\n }\n\n /**\n * Unregister the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_unmanageNode',\n value: function _unmanageNode(node) {\n var inertNode = this._inertManager.deregister(node, this);\n if (inertNode) {\n this._managedNodes['delete'](inertNode);\n }\n }\n\n /**\n * Unregister the entire subtree starting at `startNode`.\n * @param {!Node} startNode\n */\n\n }, {\n key: '_unmanageSubtree',\n value: function _unmanageSubtree(startNode) {\n var _this3 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this3._unmanageNode(node);\n });\n }\n\n /**\n * If a descendant node is found with an `inert` attribute, adopt its managed nodes.\n * @param {!HTMLElement} node\n */\n\n }, {\n key: '_adoptInertRoot',\n value: function _adoptInertRoot(node) {\n var inertSubroot = this._inertManager.getInertRoot(node);\n\n // During initialisation this inert root may not have been registered yet,\n // so register it now if need be.\n if (!inertSubroot) {\n this._inertManager.setInert(node, true);\n inertSubroot = this._inertManager.getInertRoot(node);\n }\n\n inertSubroot.managedNodes.forEach(function (savedInertNode) {\n this._manageNode(savedInertNode.node);\n }, this);\n }\n\n /**\n * Callback used when mutation observer detects subtree additions, removals, or attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_onMutation',\n value: function _onMutation(records, self) {\n records.forEach(function (record) {\n var target = /** @type {!HTMLElement} */record.target;\n if (record.type === 'childList') {\n // Manage added nodes\n slice.call(record.addedNodes).forEach(function (node) {\n this._makeSubtreeUnfocusable(node);\n }, this);\n\n // Un-manage removed nodes\n slice.call(record.removedNodes).forEach(function (node) {\n this._unmanageSubtree(node);\n }, this);\n } else if (record.type === 'attributes') {\n if (record.attributeName === 'tabindex') {\n // Re-initialise inert node if tabindex changes\n this._manageNode(target);\n } else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) {\n // If a new inert root is added, adopt its managed nodes and make sure it knows about the\n // already managed nodes from this inert subroot.\n this._adoptInertRoot(target);\n var inertSubroot = this._inertManager.getInertRoot(target);\n this._managedNodes.forEach(function (managedNode) {\n if (target.contains(managedNode.node)) {\n inertSubroot._manageNode(managedNode.node);\n }\n });\n }\n }\n }, this);\n }\n }, {\n key: 'managedNodes',\n get: function get() {\n return new Set(this._managedNodes);\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'hasSavedAriaHidden',\n get: function get() {\n return this._savedAriaHidden !== null;\n }\n\n /** @param {?string} ariaHidden */\n\n }, {\n key: 'savedAriaHidden',\n set: function set(ariaHidden) {\n this._savedAriaHidden = ariaHidden;\n }\n\n /** @return {?string} */\n ,\n get: function get() {\n return this._savedAriaHidden;\n }\n }]);\n\n return InertRoot;\n }();\n\n /**\n * `InertNode` initialises and manages a single inert node.\n * A node is inert if it is a descendant of one or more inert root elements.\n *\n * On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and\n * either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element\n * is intrinsically focusable or not.\n *\n * `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an\n * `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the\n * `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s\n * remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists,\n * or removes the `tabindex` attribute if the element is intrinsically focusable.\n */\n\n\n var InertNode = function () {\n /**\n * @param {!Node} node A focusable element to be made inert.\n * @param {!InertRoot} inertRoot The inert root element associated with this inert node.\n */\n function InertNode(node, inertRoot) {\n _classCallCheck(this, InertNode);\n\n /** @type {!Node} */\n this._node = node;\n\n /** @type {boolean} */\n this._overrodeFocusMethod = false;\n\n /**\n * @type {!Set<!InertRoot>} The set of descendant inert roots.\n * If and only if this set becomes empty, this node is no longer inert.\n */\n this._inertRoots = new Set([inertRoot]);\n\n /** @type {?number} */\n this._savedTabIndex = null;\n\n /** @type {boolean} */\n this._destroyed = false;\n\n // Save any prior tabindex info and make this node untabbable\n this.ensureUntabbable();\n }\n\n /**\n * Call this whenever this object is about to become obsolete.\n * This makes the managed node focusable again and deletes all of the previously stored state.\n */\n\n\n _createClass(InertNode, [{\n key: 'destructor',\n value: function destructor() {\n this._throwIfDestroyed();\n\n if (this._node && this._node.nodeType === Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */this._node;\n if (this._savedTabIndex !== null) {\n element.setAttribute('tabindex', this._savedTabIndex);\n } else {\n element.removeAttribute('tabindex');\n }\n\n // Use `delete` to restore native focus method.\n if (this._overrodeFocusMethod) {\n delete element.focus;\n }\n }\n\n // See note in InertRoot.destructor for why we cast these nulls to ANY.\n this._node = /** @type {?} */null;\n this._inertRoots = /** @type {?} */null;\n this._destroyed = true;\n }\n\n /**\n * @type {boolean} Whether this object is obsolete because the managed node is no longer inert.\n * If the object has been destroyed, any attempt to access it will cause an exception.\n */\n\n }, {\n key: '_throwIfDestroyed',\n\n\n /**\n * Throw if user tries to access destroyed InertNode.\n */\n value: function _throwIfDestroyed() {\n if (this.destroyed) {\n throw new Error('Trying to access destroyed InertNode');\n }\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'ensureUntabbable',\n\n\n /** Save the existing tabindex value and make the node untabbable and unfocusable */\n value: function ensureUntabbable() {\n if (this.node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */this.node;\n if (matches.call(element, _focusableElementsString)) {\n if ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) {\n return;\n }\n\n if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n }\n element.setAttribute('tabindex', '-1');\n if (element.nodeType === Node.ELEMENT_NODE) {\n element.focus = function () {};\n this._overrodeFocusMethod = true;\n }\n } else if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n element.removeAttribute('tabindex');\n }\n }\n\n /**\n * Add another inert root to this inert node's set of managing inert roots.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'addInertRoot',\n value: function addInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots.add(inertRoot);\n }\n\n /**\n * Remove the given inert root from this inert node's set of managing inert roots.\n * If the set of managing inert roots becomes empty, this node is no longer inert,\n * so the object should be destroyed.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'removeInertRoot',\n value: function removeInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots['delete'](inertRoot);\n if (this._inertRoots.size === 0) {\n this.destructor();\n }\n }\n }, {\n key: 'destroyed',\n get: function get() {\n return (/** @type {!InertNode} */this._destroyed\n );\n }\n }, {\n key: 'hasSavedTabIndex',\n get: function get() {\n return this._savedTabIndex !== null;\n }\n\n /** @return {!Node} */\n\n }, {\n key: 'node',\n get: function get() {\n this._throwIfDestroyed();\n return this._node;\n }\n\n /** @param {?number} tabIndex */\n\n }, {\n key: 'savedTabIndex',\n set: function set(tabIndex) {\n this._throwIfDestroyed();\n this._savedTabIndex = tabIndex;\n }\n\n /** @return {?number} */\n ,\n get: function get() {\n this._throwIfDestroyed();\n return this._savedTabIndex;\n }\n }]);\n\n return InertNode;\n }();\n\n /**\n * InertManager is a per-document singleton object which manages all inert roots and nodes.\n *\n * When an element becomes an inert root by having an `inert` attribute set and/or its `inert`\n * property set to `true`, the `setInert` method creates an `InertRoot` object for the element.\n * The `InertRoot` in turn registers itself as managing all of the element's focusable descendant\n * nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance\n * is created for each such node, via the `_managedNodes` map.\n */\n\n\n var InertManager = function () {\n /**\n * @param {!Document} document\n */\n function InertManager(document) {\n _classCallCheck(this, InertManager);\n\n if (!document) {\n throw new Error('Missing required argument; InertManager needs to wrap a document.');\n }\n\n /** @type {!Document} */\n this._document = document;\n\n /**\n * All managed nodes known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertNode>}\n */\n this._managedNodes = new Map();\n\n /**\n * All inert roots known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertRoot>}\n */\n this._inertRoots = new Map();\n\n /**\n * Observer for mutations on `document.body`.\n * @type {!MutationObserver}\n */\n this._observer = new MutationObserver(this._watchForInert.bind(this));\n\n // Add inert style.\n addInertStyle(document.head || document.body || document.documentElement);\n\n // Wait for document to be loaded.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this));\n } else {\n this._onDocumentLoaded();\n }\n }\n\n /**\n * Set whether the given element should be an inert root or not.\n * @param {!HTMLElement} root\n * @param {boolean} inert\n */\n\n\n _createClass(InertManager, [{\n key: 'setInert',\n value: function setInert(root, inert) {\n if (inert) {\n if (this._inertRoots.has(root)) {\n // element is already inert\n return;\n }\n\n var inertRoot = new InertRoot(root, this);\n root.setAttribute('inert', '');\n this._inertRoots.set(root, inertRoot);\n // If not contained in the document, it must be in a shadowRoot.\n // Ensure inert styles are added there.\n if (!this._document.body.contains(root)) {\n var parent = root.parentNode;\n while (parent) {\n if (parent.nodeType === 11) {\n addInertStyle(parent);\n }\n parent = parent.parentNode;\n }\n }\n } else {\n if (!this._inertRoots.has(root)) {\n // element is already non-inert\n return;\n }\n\n var _inertRoot = this._inertRoots.get(root);\n _inertRoot.destructor();\n this._inertRoots['delete'](root);\n root.removeAttribute('inert');\n }\n }\n\n /**\n * Get the InertRoot object corresponding to the given inert root element, if any.\n * @param {!Node} element\n * @return {!InertRoot|undefined}\n */\n\n }, {\n key: 'getInertRoot',\n value: function getInertRoot(element) {\n return this._inertRoots.get(element);\n }\n\n /**\n * Register the given InertRoot as managing the given node.\n * In the case where the node has a previously existing inert root, this inert root will\n * be added to its set of inert roots.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {!InertNode} inertNode\n */\n\n }, {\n key: 'register',\n value: function register(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (inertNode !== undefined) {\n // node was already in an inert subtree\n inertNode.addInertRoot(inertRoot);\n } else {\n inertNode = new InertNode(node, inertRoot);\n }\n\n this._managedNodes.set(node, inertNode);\n\n return inertNode;\n }\n\n /**\n * De-register the given InertRoot as managing the given inert node.\n * Removes the inert root from the InertNode's set of managing inert roots, and remove the inert\n * node from the InertManager's set of managed nodes if it is destroyed.\n * If the node is not currently managed, this is essentially a no-op.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.\n */\n\n }, {\n key: 'deregister',\n value: function deregister(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (!inertNode) {\n return null;\n }\n\n inertNode.removeInertRoot(inertRoot);\n if (inertNode.destroyed) {\n this._managedNodes['delete'](node);\n }\n\n return inertNode;\n }\n\n /**\n * Callback used when document has finished loading.\n */\n\n }, {\n key: '_onDocumentLoaded',\n value: function _onDocumentLoaded() {\n // Find all inert roots in document and make them actually inert.\n var inertElements = slice.call(this._document.querySelectorAll('[inert]'));\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, this);\n\n // Comment this out to use programmatic API only.\n this._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true });\n }\n\n /**\n * Callback used when mutation observer detects attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_watchForInert',\n value: function _watchForInert(records, self) {\n var _this = this;\n records.forEach(function (record) {\n switch (record.type) {\n case 'childList':\n slice.call(record.addedNodes).forEach(function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var inertElements = slice.call(node.querySelectorAll('[inert]'));\n if (matches.call(node, '[inert]')) {\n inertElements.unshift(node);\n }\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, _this);\n }, _this);\n break;\n case 'attributes':\n if (record.attributeName !== 'inert') {\n return;\n }\n var target = /** @type {!HTMLElement} */record.target;\n var inert = target.hasAttribute('inert');\n _this.setInert(target, inert);\n break;\n }\n }, this);\n }\n }]);\n\n return InertManager;\n }();\n\n /**\n * Recursively walk the composed tree from |node|.\n * @param {!Node} node\n * @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed,\n * before descending into child nodes.\n * @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any.\n */\n\n\n function composedTreeWalk(node, callback, shadowRootAncestor) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */node;\n if (callback) {\n callback(element);\n }\n\n // Descend into node:\n // If it has a ShadowRoot, ignore all child elements - these will be picked\n // up by the <content> or <shadow> elements. Descend straight into the\n // ShadowRoot.\n var shadowRoot = /** @type {!HTMLElement} */element.shadowRoot;\n if (shadowRoot) {\n composedTreeWalk(shadowRoot, callback, shadowRoot);\n return;\n }\n\n // If it is a <content> element, descend into distributed elements - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'content') {\n var content = /** @type {!HTMLContentElement} */element;\n // Verifies if ShadowDom v0 is supported.\n var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : [];\n for (var i = 0; i < distributedNodes.length; i++) {\n composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor);\n }\n return;\n }\n\n // If it is a <slot> element, descend into assigned nodes - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'slot') {\n var slot = /** @type {!HTMLSlotElement} */element;\n // Verify if ShadowDom v1 is supported.\n var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : [];\n for (var _i = 0; _i < _distributedNodes.length; _i++) {\n composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor);\n }\n return;\n }\n }\n\n // If it is neither the parent of a ShadowRoot, a <content> element, a <slot>\n // element, nor a <shadow> element recurse normally.\n var child = node.firstChild;\n while (child != null) {\n composedTreeWalk(child, callback, shadowRootAncestor);\n child = child.nextSibling;\n }\n }\n\n /**\n * Adds a style element to the node containing the inert specific styles\n * @param {!Node} node\n */\n function addInertStyle(node) {\n if (node.querySelector('style#inert-style, link#inert-style')) {\n return;\n }\n var style = document.createElement('style');\n style.setAttribute('id', 'inert-style');\n style.textContent = '\\n' + '[inert] {\\n' + ' pointer-events: none;\\n' + ' cursor: default;\\n' + '}\\n' + '\\n' + '[inert], [inert] * {\\n' + ' -webkit-user-select: none;\\n' + ' -moz-user-select: none;\\n' + ' -ms-user-select: none;\\n' + ' user-select: none;\\n' + '}\\n';\n node.appendChild(style);\n }\n\n if (!HTMLElement.prototype.hasOwnProperty('inert')) {\n /** @type {!InertManager} */\n var inertManager = new InertManager(document);\n\n Object.defineProperty(HTMLElement.prototype, 'inert', {\n enumerable: true,\n /** @this {!HTMLElement} */\n get: function get() {\n return this.hasAttribute('inert');\n },\n /** @this {!HTMLElement} */\n set: function set(inert) {\n inertManager.setInert(this, inert);\n }\n });\n }\n})();\n","import { name as packageNameScoped } from '../../../../package.json';\n\nconst packageName = packageNameScoped.substring(packageNameScoped.indexOf('/')+1);\n\n/**\n * Execute setFocus method if it exists\n * on stzh-element with autofocus on pageload\n * when (child components are loaded)\n */\nexport function applyAutofocus() {\n window.addEventListener('appload', (event) => {\n const autofocus = document.querySelector('[autofocus]');\n\n if (autofocus\n && event.detail.namespace === packageName\n && autofocus.tagName.toLowerCase().indexOf('stzh-') === 0\n && 'setFocus' in autofocus\n ) {\n autofocus.setFocus();\n }\n });\n}\n","export function observeScrollbarWidth() {\n const config = {\n threshold: 1.0\n };\n\n const handleIntersect = (entries) => {\n entries.forEach(entry => {\n let scrollbarWidth = 0;\n\n if (entry.intersectionRatio < 1) {\n scrollbarWidth = window.innerWidth - document.body.clientWidth;\n }\n\n document.documentElement.style.setProperty('--stzh-scrollbar-width', scrollbarWidth + 'px');\n });\n };\n\n const bodyScrollObserver = new IntersectionObserver(handleIntersect, config);\n bodyScrollObserver.observe(document.body);\n}\n","import \"wicg-inert\";\n\nimport { version } from '../../../package.json';\nimport { applyAutofocus } from './helpers/autofocus';\nimport { observeScrollbarWidth } from './helpers/scrollbar-width';\n\nexport default function () {\n window.stzhComponents = {\n version,\n labels: 'fixed',\n cacheTranslations: true,\n pathTranslations: '/',\n formats: {},\n ...window.stzhComponents || {}\n };\n\n applyAutofocus();\n observeScrollbarWidth();\n}\n","import appGlobalScript from '/builds/OE-5041/desi/desi-code/stzh-components/src/global/js/script.js';\nexport const globalScripts = appGlobalScript;\n"],"mappings":"uEAAA,IAAIA,EAAe,WAAc,SAASC,EAAiBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAWC,YAAc,MAAOD,EAAWE,aAAe,KAAM,GAAI,UAAWF,EAAYA,EAAWG,SAAW,KAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,E,CAAc,CAAG,OAAO,SAAUO,EAAaC,EAAYC,GAAe,GAAID,EAAYb,EAAiBY,EAAYG,UAAWF,GAAa,GAAIC,EAAad,EAAiBY,EAAaE,GAAc,OAAOF,CAAY,CAAG,CAA5hB,GAEnB,SAASI,EAAgBC,EAAUL,GAAe,KAAMK,aAAoBL,GAAc,CAAE,MAAM,IAAIM,UAAU,oC,CAAuC,EAOvJ,WAEE,UAAWC,SAAW,YAAa,CACjC,M,CAKF,IAAIC,EAAQC,MAAMN,UAAUK,MAM5B,IAAIE,EAAUC,QAAQR,UAAUO,SAAWC,QAAQR,UAAUS,kBAG7D,IAAIC,EAA2B,CAAC,UAAW,aAAc,wBAAyB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cAAcP,QAAQ,WAAa,GACrD,aAAcG,EACnB,CACAA,EAAUK,U,CAEhB,GACA,CCrBO,SAASC,IACd,IAAMC,EAAS,CACbC,UAAW,GAGb,IAAMC,EAAkB,SAACC,GACvBA,EAAQvH,SAAQ,SAAAwH,GACd,IAAIC,EAAiB,EAErB,GAAID,EAAME,kBAAoB,EAAG,CAC/BD,EAAiB1J,OAAO4J,WAAalH,SAASC,KAAKkH,W,CAGrDnH,SAAS2D,gBAAgB6B,MAAM4B,YAAY,yBAA0BJ,EAAiB,KAC5F,GACA,EAEE,IAAMK,EAAqB,IAAIC,qBAAqBT,EAAiBF,GACrEU,EAAmBtI,QAAQiB,SAASC,KACtC,CCde,SAAAsH,IACfjK,OAAAkK,eAAA5K,OAAA6K,OAAA,CAAAC,UAAAC,OAAA,QAAAC,kBAAA,KAAAC,iBAAA,IAAAC,QAAA,IAAAxK,OAAAkK,gBAAA,IACEtB,IACAQ,GACF,CCRY,IAACqB,EAAaC,EAAA,IAAGT,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LANG_DE","LANG_EN","LANG_DEFAULT","SUPPORTED_LANGUAGES","getLocale","element","closestElement","closest","locale","lang","split","indexOf","tc","translation","count","parts","part","trim","length","replace","toString","fetchTranslations","host","component","existingTranslations","JSON","parse","sessionStorage","getItem","concat","window","stzhComponents","version","cacheTranslations","match","Object","keys","assign","$globals","$locale","$code","$formats","fetch","pathTranslations","result","_a","sent","ok","json","data","setItem","stringify","console","error","exception_1"],"sources":["src/utils/translation-utils.ts"],"sourcesContent":["import {\n StzhDateFormat,\n StzhDateParse\n} from \"./date-adapter\";\n\nconst LANG_DE = \"de\";\nconst LANG_EN = \"en\";\nconst LANG_DEFAULT = LANG_DE;\n\nexport const SUPPORTED_LANGUAGES = [\n LANG_DE,\n LANG_EN\n];\n\nexport type StzhLocaleFormats = {\n inputdate: {\n format: string | StzhDateFormat,\n parse: string | StzhDateParse\n },\n date: {\n format: string | StzhDateFormat\n },\n dateRange: string,\n timeRange: string,\n timePostfix: string,\n time: {\n format: string | StzhDateFormat\n }\n}\n\ntype MonthsNames = [string, string, string, string, string, string, string, string, string, string, string, string]\ntype DayNames = [string, string, string, string, string, string, string]\n\nexport type StzhLocaleGlobals = {\n externalLinkLabel: string\n downloadLinkLabel: string\n requiredFieldMarker: string\n requiredFieldText: string\n optionalFieldMarker: string\n optionalFieldText: string\n clearButtonLabel: string\n moreInfoButtonLabel: string\n dayNames: DayNames\n monthNames: MonthsNames\n monthNamesShort: MonthsNames\n}\n\nexport type StzhLocaleComponent = {\n $locale: typeof LANG_DE | typeof LANG_EN,\n $formats: StzhLocaleFormats,\n $globals: StzhLocaleGlobals\n}\n\nfunction getLocale(element: HTMLElement) {\n const closestElement = element.closest(\"[lang]\") as HTMLElement;\n const locale = closestElement && closestElement.lang.split(\"-\")[0];\n\n if (SUPPORTED_LANGUAGES.indexOf(locale) === -1 || !locale) {\n return LANG_DEFAULT;\n } else {\n return locale;\n }\n}\n\nexport function tc(translation: string, count: number): string {\n if (!translation) {\n return \"\";\n }\n\n const parts = translation.split('|');\n let part = parts[0].trim();\n\n if (parts.length === 3 && count === 1) {\n part = parts[1].trim();\n } else if (parts.length === 3 && count > 1) {\n part = parts[2].trim();\n }\n\n if (parts.length === 2 && count !== 1) {\n part = parts[1].trim();\n }\n\n return part.replace(/\\{n\\}/ig, count.toString());\n}\n\nexport async function fetchTranslations(host: HTMLElement, component: string) {\n const locale = getLocale(host);\n const existingTranslations = JSON.parse(sessionStorage.getItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${locale}`));\n\n if (\n window.stzhComponents.cacheTranslations\n && window.stzhComponents.version.match(/-dev-snapshot/i) === null\n && existingTranslations\n && Object.keys(existingTranslations).length > 0\n ) {\n return {\n ...existingTranslations[component] || {},\n $globals: existingTranslations.$globals,\n $locale: existingTranslations.$code,\n $formats: existingTranslations.$formats\n };\n }\n\n try {\n const result = await fetch(\n `${window.stzhComponents.pathTranslations}/${locale}.json`\n );\n\n if (result.ok) {\n const data = await result.json();\n sessionStorage.setItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${locale}`, JSON.stringify(data));\n return {\n ...data[component] || {},\n $globals: data.$globals,\n $locale: data.$code,\n $formats: data.$formats\n };\n }\n\n } catch (exception) {\n console.error(`Error loading locale: ${locale}`, exception);\n }\n}\n"],"mappings":"kiDAKA,IAAMA,EAAU,KAChB,IAAMC,EAAU,KAChB,IAAMC,EAAeF,EAEd,IAAMG,EAAsB,CACjCH,EACAC,
|
|
1
|
+
{"version":3,"names":["LANG_DE","LANG_EN","LANG_DEFAULT","SUPPORTED_LANGUAGES","getLocale","element","closestElement","closest","locale","lang","split","indexOf","tc","translation","count","parts","part","trim","length","replace","toString","fetchTranslations","host","component","existingTranslations","JSON","parse","sessionStorage","getItem","concat","window","stzhComponents","version","cacheTranslations","match","Object","keys","assign","$globals","$locale","$code","$formats","fetch","pathTranslations","result","_a","sent","ok","json","data","setItem","stringify","console","error","exception_1"],"sources":["src/utils/translation-utils.ts"],"sourcesContent":["import {\n StzhDateFormat,\n StzhDateParse\n} from \"./date-adapter\";\n\nconst LANG_DE = \"de\";\nconst LANG_EN = \"en\";\nconst LANG_DEFAULT = LANG_DE;\n\nexport const SUPPORTED_LANGUAGES = [\n LANG_DE,\n LANG_EN\n];\n\nexport type StzhLocaleFormats = {\n inputdate: {\n format: string | StzhDateFormat,\n parse: string | StzhDateParse\n },\n date: {\n format: string | StzhDateFormat\n },\n dateRange: string,\n timeRange: string,\n timePostfix: string,\n time: {\n format: string | StzhDateFormat\n }\n}\n\ntype MonthsNames = [string, string, string, string, string, string, string, string, string, string, string, string]\ntype DayNames = [string, string, string, string, string, string, string]\n\nexport type StzhLocaleGlobals = {\n externalLinkLabel: string\n downloadLinkLabel: string\n requiredFieldMarker: string\n requiredFieldText: string\n optionalFieldMarker: string\n optionalFieldText: string\n invalidFieldText: string\n clearButtonLabel: string\n moreInfoButtonLabel: string\n dayNames: DayNames\n monthNames: MonthsNames\n monthNamesShort: MonthsNames\n}\n\nexport type StzhLocaleComponent = {\n $locale: typeof LANG_DE | typeof LANG_EN,\n $formats: StzhLocaleFormats,\n $globals: StzhLocaleGlobals\n}\n\nfunction getLocale(element: HTMLElement) {\n const closestElement = element.closest(\"[lang]\") as HTMLElement;\n const locale = closestElement && closestElement.lang.split(\"-\")[0];\n\n if (SUPPORTED_LANGUAGES.indexOf(locale) === -1 || !locale) {\n return LANG_DEFAULT;\n } else {\n return locale;\n }\n}\n\nexport function tc(translation: string, count: number): string {\n if (!translation) {\n return \"\";\n }\n\n const parts = translation.split('|');\n let part = parts[0].trim();\n\n if (parts.length === 3 && count === 1) {\n part = parts[1].trim();\n } else if (parts.length === 3 && count > 1) {\n part = parts[2].trim();\n }\n\n if (parts.length === 2 && count !== 1) {\n part = parts[1].trim();\n }\n\n return part.replace(/\\{n\\}/ig, count.toString());\n}\n\nexport async function fetchTranslations(host: HTMLElement, component: string) {\n const locale = getLocale(host);\n const existingTranslations = JSON.parse(sessionStorage.getItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${locale}`));\n\n if (\n window.stzhComponents.cacheTranslations\n && window.stzhComponents.version.match(/-dev-snapshot/i) === null\n && existingTranslations\n && Object.keys(existingTranslations).length > 0\n ) {\n return {\n ...existingTranslations[component] || {},\n $globals: existingTranslations.$globals,\n $locale: existingTranslations.$code,\n $formats: existingTranslations.$formats\n };\n }\n\n try {\n const result = await fetch(\n `${window.stzhComponents.pathTranslations}/${locale}.json`\n );\n\n if (result.ok) {\n const data = await result.json();\n sessionStorage.setItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${locale}`, JSON.stringify(data));\n return {\n ...data[component] || {},\n $globals: data.$globals,\n $locale: data.$code,\n $formats: data.$formats\n };\n }\n\n } catch (exception) {\n console.error(`Error loading locale: ${locale}`, exception);\n }\n}\n"],"mappings":"kiDAKA,IAAMA,EAAU,KAChB,IAAMC,EAAU,KAChB,IAAMC,EAAeF,EAEd,IAAMG,EAAsB,C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B,QAAQ,mBAAArB,OAAmBC,OAAOC,eAAeC,QAAO,UAAAH,OAASrB,GAAUiB,KAAK0B,UAAUF,IACzG,SAAAd,OAAAE,OAAAF,OAAAE,OAAA,GACKY,EAAK1B,IAAc,IAAE,CACxBe,SAAUW,EAAKX,SACfC,QAASU,EAAKT,MACdC,SAAUQ,EAAKR,Y,qCAKnBW,QAAQC,MAAM,yBAAAxB,OAAyBrB,GAAU8C,G"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,a as e,g as h}from"./p-9e02896c.js";import{f as r}from"./p-25a09313.js";const o=".sc-stzh-timepicker-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-timepicker-h{display:none}.sc-stzh-timepicker-h *.sc-stzh-timepicker,.sc-stzh-timepicker-h *.sc-stzh-timepicker::before,.sc-stzh-timepicker-h *.sc-stzh-timepicker::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-timepicker-h{width:100%}.stzh-timepicker__dropdown.sc-stzh-timepicker{--icon-angle-size:var(--stzh-icon-size-small);--active-icon-angle-transform:rotate(0deg) translateY(-50%)}";const n=class{constructor(s){t(this,s);this.stzhChange=i(this,"stzhChange",7);this.onRootFocus=()=>{if(this.input){this.input.setFocus()}};this.onDropdownChange=t=>{this.value=t.detail.value;this.stzhChange.emit({component:"stzh-timepicker",value:this.value})};this.min=0;this.max=1439;this.step=15;this.name="";this.value="";this.popoverPlacement="bottom";this.label="";this.readonly=false;this.disabled=false;this.description=undefined;this.descriptionLong=undefined;this.error=undefined;this.invalid=false;this.required=false;this.showMarker=false;this.size="default";this.a11yDescribedby="";this.localization=undefined}minMaxWatcher(){this.updateDropdownOptions()}updateDropdownOptions(){const t=[];for(let i=this.min;i<=this.max;i=i+this.step){let s=Math.floor(i/60);let e=i%60;let h=("00"+s).slice(-2);let r=("00"+e).slice(-2);let o=`${h}.${r}`;t.push({text:o,value:o})}this._dropdownOptions=t}async componentWillLoad(){this.minMaxWatcher();if(!this.localization){this.localization=await r(this.element,"timepicker")}}render(){const t={"stzh-timepicker":true};return s(e,{tabindex:this.disabled?null:"-1",onFocus:this.onRootFocus},s("div",{class:t},s("stzh-dropdown",{class:"stzh-timepicker__dropdown",iconAngle:"clock",label:this.label,ref:t=>this.input=t,onStzhChange:this.onDropdownChange,options:this._dropdownOptions,items:[this.value],required:this.required,disabled:this.disabled,description:this.description,descriptionLong:this.descriptionLong,error:this.error,popoverPlacement:this.popoverPlacement,a11yDescribedby:this.a11yDescribedby,name:this.name,size:this.size,invalid:this.invalid,showMarker:this.showMarker})))}get element(){return h(this)}static get watchers(){return{min:["minMaxWatcher"],max:["minMaxWatcher"]}}};n.style=o;export{n as stzh_timepicker};
|
|
2
|
+
//# sourceMappingURL=p-ad33db31.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stzhTimepickerCss","StzhTimepicker","this","onRootFocus","input","setFocus","onDropdownChange","event","value","detail","stzhChange","emit","component","minMaxWatcher","updateDropdownOptions","options","i","min","max","step","hours","Math","floor","minutes","paddedHours","slice","paddedMinutes","time","push","text","_dropdownOptions","async","localization","fetchTranslations","element","render","classes","h","Host","tabindex","disabled","onFocus","class","iconAngle","label","ref","el","onStzhChange","items","required","description","descriptionLong","error","popoverPlacement","a11yDescribedby","name","size","invalid","showMarker"],"sources":["./src/components/stzh-timepicker/stzh-timepicker.scss?tag=stzh-timepicker&encapsulation=scoped","./src/components/stzh-timepicker/stzh-timepicker.tsx"],"sourcesContent":[":host {\n width: 100%;\n}\n\n.stzh-timepicker {\n &__dropdown {\n --icon-angle-size: #{iconSize('small')};\n --active-icon-angle-transform: rotate(0deg) translateY(-50%);\n }\n}\n","import {\n Component,\n Prop,\n Host,\n Element,\n h,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\n\nimport {\n StzhDropdownOption,\n StzhDropdownChangeEvent,\n StzhTimepickerChangeEvent\n} from \"../../index\";\n\nimport { fetchTranslations } from \"../../utils/translation-utils\";\nimport { StzhTimepickerLocalizedText } from \"./stzh-timepicker.localization\";\n\n/**\n */\n@Component({\n tag: \"stzh-timepicker\",\n styleUrl: \"stzh-timepicker.scss\",\n scoped: true\n})\nexport class StzhTimepicker {\n /**\n * Minimum time allowed to be picked in minutes. Can not be lower than 0.\n * This setting can be used alone or together with the max property.\n */\n @Prop() min: number = 0\n\n /**\n * Maximum time allowed to be picked in minutes. Can not be higher than 1440 (24h * 60).\n * This setting can be used alone or together with the min property.\n */\n @Prop() max: number = 1439;\n\n /** Time added for each step in minutes. */\n @Prop() step: number = 15;\n\n /** Name of the hidden date picker input. */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Value of hidden date picker input (current selected date in ISO format). */\n @Prop({ mutable: true }) value: string = \"\";\n\n /** Popover placement for the dropdown (if applicable) */\n @Prop({ reflect: true }) popoverPlacement: \"bottom\" | \"bottom-end\" | \"bottom-center\" | \"top\" | \"top-end\" | \"top-center\" = \"bottom\";\n\n /** Label for dropdown */\n @Prop() label: string = \"\";\n\n /** Whether the element is readonly or not */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Append text to label depending if field is optional/required. true -> show \"(optional)\", false -> show nothing */\n @Prop({ reflect: true }) showMarker: boolean = false;\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Id of the element which describes the input */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = '';\n\n /** Translation strings. */\n @Prop() localization: StzhTimepickerLocalizedText;\n\n /** Timepicker change event */\n @Event() stzhChange: EventEmitter<StzhTimepickerChangeEvent>;\n\n @Element() element: HTMLStzhTimepickerElement;\n\n @Watch(\"min\")\n @Watch(\"max\")\n minMaxWatcher() {\n this.updateDropdownOptions();\n }\n\n private input: HTMLStzhDropdownElement;\n private _dropdownOptions: StzhDropdownOption[];\n\n private onRootFocus = () => {\n if (this.input) {\n this.input.setFocus();\n }\n }\n\n private onDropdownChange = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n this.value = event.detail.value;\n\n this.stzhChange.emit({\n component: \"stzh-timepicker\",\n value: this.value\n });\n }\n\n private updateDropdownOptions(): void {\n const options = [];\n\n for (let i = this.min; i <= this.max; i = i + this.step) {\n let hours: number = Math.floor(i / 60);\n let minutes: number = i % 60;\n\n let paddedHours: string = ('00' + hours).slice(-2);\n let paddedMinutes: string = ('00' + minutes).slice(-2);\n let time = `${paddedHours}.${paddedMinutes}`;\n\n options.push({ text: time, value: time });\n }\n\n this._dropdownOptions = options;\n }\n\n async componentWillLoad() {\n this.minMaxWatcher();\n\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"timepicker\");\n }\n }\n\n render() {\n const classes = {\n \"stzh-timepicker\": true\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes}>\n <stzh-dropdown\n class=\"stzh-timepicker__dropdown\"\n iconAngle={\"clock\"}\n label={this.label}\n ref={(el) => (this.input = el as HTMLStzhDropdownElement)}\n onStzhChange={this.onDropdownChange}\n options={this._dropdownOptions}\n items={[this.value]}\n required={this.required}\n disabled={this.disabled}\n description={this.description}\n descriptionLong={this.descriptionLong}\n error={this.error}\n popoverPlacement={this.popoverPlacement}\n a11yDescribedby={this.a11yDescribedby}\n name={this.name}\n size={this.size}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AQ0C,EAC3BC,aAAc7C,KAAKI,iBACnBS,QAASb,KAAK4B,iBACdkB,MAAO,CAAC9C,KAAKM,OACbyC,SAAU/C,KAAK+C,SACfT,SAAUtC,KAAKsC,SACfU,YAAahD,KAAKgD,YAClBC,gBAAiBjD,KAAKiD,gBACtBC,MAAOlD,KAAKkD,MACZC,iBAAkBnD,KAAKmD,iBACvBC,gBAAiBpD,KAAKoD,gBACtBC,KAAMrD,KAAKqD,KACXC,KAAMtD,KAAKsD,KACXC,QAASvD,KAAKuD,QACdC,WAAYxD,KAAKwD,c"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,a as e,g as o}from"./p-9e02896c.js";import{f as n}from"./p-25a09313.js";const h=":host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.stzh-amount__marker-symbol{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal}.stzh-amount__marker-text{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-amount__description-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.stzh-amount__error,.stzh-amount__description{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);color:var(--stzh-base-color)}.stzh-amount__error{color:var(--stzh-color-error)}.stzh-amount__error-list{list-style:none;margin:0;padding:0}.stzh-amount__description{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.stzh-amount__description-long{margin-left:var(--stzh-space-xxsmall);margin-top:0.1875rem}.stzh-amount__description-long-popover{--width:auto;--max-width:27.3125rem}.stzh-amount__description-long-popover[open]:not([open=false]) .stzh-amount__description-long-button{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-amount__description-long-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer;-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);color:var(--stzh-base-lead-color)}.stzh-amount__description-long-button:hover{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-amount stzh-icon.stzh-amount__description-long-icon{--size:var(--stzh-icon-size-xsmall)}.stzh-amount--has-error .stzh-amount__error,.stzh-amount--has-description .stzh-amount__description{margin-top:var(--stzh-space-xxsmall)}.stzh-amount__stepper-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;gap:var(--stzh-space-xxsmall)}.stzh-amount stzh-input.stzh-amount__stepper-input{--text-align:center;width:100%}";const r="stzh-amount__dropdown-plus-option";let a=0;const l=class{constructor(i){t(this,i);this.stzhChange=s(this,"stzhChange",7);this._showDropdown=!Number.isNaN(this.minValueDropdown)&&!Number.isNaN(this.maxValueDropdown)&&this.minValueDropdown<this.maxValueDropdown;this.onRootFocus=()=>{if(this.input){this.input.setFocus()}};this.onDropdownChange=t=>{if(t.detail.value===r){this._showDropdown=false;this.value=(this.maxValueDropdown+this.step).toString()}else{this.value=t.detail.value}this.stzhChange.emit({component:"stzh-amount",value:this.value})};this.onInputMinusStepClick=()=>{if(Number(this.value)<=this.minValue){return}this.value=(Number(this.value)-this.step).toString();this.value=this.roundToStep(Number(this.value)).toString();this.stzhChange.emit({component:"stzh-amount",value:this.value})};this.onInputPlusStepClick=()=>{if(Number(this.value)>=this.maxValue){return}this.value=(Number(this.value)+this.step).toString();this.value=this.roundToStep(Number(this.value)).toString();this.stzhChange.emit({component:"stzh-amount",value:this.value})};this.onStepperInputChange=t=>{this.value=t.detail.value;this.stzhChange.emit({component:"stzh-amount",value:this.value})};this.minValue=-9007199254740991;this.maxValue=9007199254740991;this.minValueDropdown=null;this.maxValueDropdown=null;this.value="";this.step=1;this.name="";this.size="default";this.disabled=false;this.popoverPlacement="bottom";this.label="";this.invalid=false;this.required=false;this.clearable=false;this.showMarker=false;this.description=undefined;this.descriptionLong=undefined;this.error=undefined;this.a11yDescribedby="";this.localization=undefined}minMaxValueDropdownWatcher(){this.setDropdownOptions()}setDropdownOptions(){if(!this._showDropdown){return}const t=[];for(let s=this.minValueDropdown;s<=this.maxValueDropdown;s++){t.push({text:s.toString(),value:s.toString()})}if(this.maxValue!=undefined&&this.maxValue>this.maxValueDropdown){t.push({text:`${this.maxValueDropdown.toString()}+`,value:r})}this._dropdownOptions=t}roundToStep(t){const s=Math.max(0,-Math.floor(Math.log10(this.step)));const i=Math.pow(10,s);const e=Math.round(t/this.step)*this.step;return Number((e*i/i).toFixed(s))}async componentWillLoad(){if(!this.localization){this.localization=await n(this.element,"amount")}this.amountId=`stzh-amount-${a++}`;if(this._showDropdown){this.setDropdownOptions()}else{this.stepperInputId=`${this.amountId}-stepper-input`}}renderDropdown(){const t={"stzh-amount__dropdown":true,[`stzh-amount--popover-placement-${this.popoverPlacement}`]:!!this.popoverPlacement};return i("div",{class:t},i("stzh-dropdown",{ref:t=>this.input=t,options:this._dropdownOptions,items:[this.value],label:this.label,required:this.required,disabled:this.disabled,description:this.description,descriptionLong:this.descriptionLong,error:this.error,invalid:this.invalid,popoverPlacement:this.popoverPlacement,a11yDescribedby:this.a11yDescribedby,name:this.name,size:this.size,showMarker:this.showMarker,onStzhChange:this.onDropdownChange}))}renderInputStepper(){return i("div",{class:"stzh-amount__stepper"},i("div",{class:"stzh-amount__stepper-wrapper"},i("stzh-input",{ref:t=>this.input=t,class:"stzh-amount__stepper-input",value:this.value,type:"number",label:this.label,min:this.minValue,max:this.maxValue,error:this.error,invalid:this.invalid,required:this.required,name:this.name,id:this.stepperInputId,size:this.size,step:this.step,showMarker:this.showMarker,description:this.description,descriptionLong:this.descriptionLong,clearable:this.clearable,disabled:this.disabled,a11yDescribedby:this.a11yDescribedby,onStzhChange:this.onStepperInputChange}),i("stzh-buttongroup",null,i("stzh-button",{class:"stzh-amount__stepper-minus",onClick:this.onInputMinusStepClick,variant:"secondary",icon:"minus",iconOnly:true,a11yControls:this.stepperInputId,a11yDescribedby:this.a11yDescribedby,a11yLabel:`${this.label} ${this.localization.stepperMinusLabel}, ${this.localization.selectedAmountMessage} ${this.value}`,size:this.size,a11yDisabled:Number(this.value)<=this.minValue||this.disabled,disabled:this.disabled}),i("stzh-button",{class:"stzh-amount__stepper-plus",onClick:this.onInputPlusStepClick,variant:"secondary",icon:"plus",iconOnly:true,a11yControls:this.stepperInputId,a11yDescribedby:this.a11yDescribedby,a11yLabel:`${this.label} ${this.localization.stepperPlusLabel}, ${this.localization.selectedAmountMessage} ${this.value}`,size:this.size,a11yDisabled:Number(this.value)>=this.maxValue||this.disabled,disabled:this.disabled}))))}render(){const t={"stzh-amount":true,"stzh-amount--has-description":!!this.description,"stzh-amount--has-description-long":!!this.descriptionLong,"stzh-amount--has-error":!!this.error,"stzh-amount--is-required":!!this.required,"stzh-amount--is-disabled":!!this.disabled};return i(e,{tabindex:this.disabled?null:"-1",onFocus:this.onRootFocus},i("div",{class:t,id:this.amountId},this._showDropdown?this.renderDropdown():this.renderInputStepper()))}get element(){return o(this)}static get watchers(){return{minValueDropdown:["minMaxValueDropdownWatcher"],maxValueDropdown:["minMaxValueDropdownWatcher"]}}};l.style=h;export{l as stzh_amount};
|
|
2
|
+
//# sourceMappingURL=p-b5cda655.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stzhAmountCss","DROPDOWN_ITEM_PLUS_OPTION_VALUE","amountCounter","StzhAmount","this","_showDropdown","Number","isNaN","minValueDropdown","maxValueDropdown","onRootFocus","input","setFocus","onDropdownChange","event","detail","value","step","toString","stzhChange","emit","component","onInputMinusStepClick","minValue","roundToStep","onInputPlusStepClick","maxValue","onStepperInputChange","minMaxValueDropdownWatcher","setDropdownOptions","options","i","push","text","undefined","_dropdownOptions","decimals","Math","max","floor","log10","factor","pow","rounded","round","toFixed","async","localization","fetchTranslations","element","amountId","stepperInputId","renderDropdown","classes","popoverPlacement","h","class","ref","el","items","label","required","disabled","description","descriptionLong","error","invalid","a11yDescribedby","name","size","showMarker","onStzhChange","renderInputStepper","type","min","id","clearable","onClick","variant","icon","iconOnly","a11yControls","a11yLabel","stepperMinusLabel","selectedAmountMessage","a11yDisabled","stepperPlusLabel","render","Host","tabindex","onFocus"],"sources":["./src/components/stzh-amount/stzh-amount.scss?tag=stzh-amount","./src/components/stzh-amount/stzh-amount.tsx"],"sourcesContent":[".stzh-amount {\n @include input-description;\n\n &__stepper-wrapper {\n display: flex;\n align-items: flex-start;\n gap: space('xxsmall');\n }\n\n stzh-input#{&}__stepper-input {\n --text-align: center;\n width: 100%;\n }\n}\n","import {\n Component,\n Host,\n Prop,\n h,\n Watch,\n Element,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport {\n StzhDropdownOption,\n StzhAmountChangeEvent,\n StzhDropdownChangeEvent,\n StzhInputChangeEvent,\n} from \"../../index\";\n\nimport { StzhAmountLocalizedText } from './stzh-amount.localization';\nimport { fetchTranslations } from '../../utils/translation-utils';\n\nconst DROPDOWN_ITEM_PLUS_OPTION_VALUE = \"stzh-amount__dropdown-plus-option\"\n\nlet amountCounter = 0;\n\n@Component({\n tag: \"stzh-amount\",\n styleUrl: \"stzh-amount.scss\"\n})\nexport class StzhAmount {\n /** The lowest allowed amount (can be negative). */\n @Prop() minValue: number = -9007199254740991;\n\n /** The highest allowed amount. */\n @Prop() maxValue: number = 9007199254740991;\n\n /** The lowest amount as option in the dropdown. Needs to be set to initially display a dropdown. */\n @Prop() minValueDropdown: number | null = null;\n\n /** The highest amount as option in the dropdown. Needs to be set to initially display a dropdown. */\n @Prop() maxValueDropdown: number | null = null;\n private _showDropdown: boolean = !Number.isNaN(this.minValueDropdown) && !Number.isNaN(this.maxValueDropdown)\n && this.minValueDropdown < this.maxValueDropdown;\n\n private _dropdownOptions: StzhDropdownOption[];\n\n /** The initial value of the amount element */\n @Prop({ mutable: true }) value: string = \"\";\n\n /** The step the amount can be increased or decreased */\n @Prop() step: number = 1;\n\n /** Name of the element (hidden select element in case of dropdown) */\n @Prop({ reflect: true }) name: string = \"\";\n\n /** Size variant */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Whether the amount component is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Popover placement for the dropdown (if applicable) */\n @Prop({ reflect: true }) popoverPlacement: \"bottom\" | \"bottom-end\" | \"bottom-center\" | \"top\" | \"top-end\" | \"top-center\" = \"bottom\";\n\n /** Label */\n @Prop() label: string = \"\";\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Whether clearable button is showing for the input field (does not apply to dropdown) */\n @Prop({ reflect: true }) clearable: boolean = false;\n\n /** Show text in label depending on whether field is optional/required */\n @Prop({ reflect: true }) showMarker: boolean = false;\n\n /** Description placed below the amount */\n @Prop() description: string;\n\n /** Long description message appearing in a popover */\n @Prop() descriptionLong: string;\n\n /** One or multiple error message(s) */\n @Prop({ mutable: true }) error: string | string[];\n\n /** Id of the element which describes the input */\n @Prop({ attribute: \"a11y-describedby\" }) a11yDescribedby: string = '';\n\n /** Translation strings. */\n @Prop() localization: StzhAmountLocalizedText;\n\n @Watch(\"minValueDropdown\")\n @Watch(\"maxValueDropdown\")\n minMaxValueDropdownWatcher() {\n this.setDropdownOptions();\n }\n\n /** Amount change event */\n @Event() stzhChange: EventEmitter<StzhAmountChangeEvent>;\n\n @Element() element: HTMLStzhAmountElement;\n\n private amountId: string;\n private stepperInputId: string;\n private input: HTMLStzhInputElement | HTMLStzhDropdownElement;\n\n private onRootFocus = () => {\n if (this.input) {\n this.input.setFocus();\n }\n }\n\n /** Fill the dropdown with options according to maxValueDropdown & minValueDropdown. */\n private setDropdownOptions() {\n if (!this._showDropdown) {\n return;\n }\n\n const options = [];\n\n for (let i = this.minValueDropdown; i <= this.maxValueDropdown; i++) {\n options.push({text: i.toString(), value: i.toString()});\n }\n if (this.maxValue != undefined && this.maxValue > this.maxValueDropdown) {\n options.push({text: `${this.maxValueDropdown.toString()}+`, value: DROPDOWN_ITEM_PLUS_OPTION_VALUE})\n }\n\n this._dropdownOptions = options;\n }\n\n /** Handling dropdown changes (switch to input stepper if the plus option is selected in the dropdown). */\n private onDropdownChange = (event: CustomEvent<StzhDropdownChangeEvent>) => {\n if (event.detail.value === DROPDOWN_ITEM_PLUS_OPTION_VALUE) {\n this._showDropdown = false;\n this.value = (this.maxValueDropdown + this.step).toString();\n } else {\n this.value = event.detail.value;\n }\n\n this.stzhChange.emit({\n component: \"stzh-amount\",\n value: this.value\n });\n }\n\n /** Handling the minus button. */\n private onInputMinusStepClick = () => {\n if (Number(this.value) <= this.minValue) {\n return;\n }\n\n this.value = (Number(this.value) - this.step).toString();\n this.value = this.roundToStep(Number(this.value)).toString();\n\n this.stzhChange.emit({\n component: \"stzh-amount\",\n value: this.value\n });\n }\n\n /** Handling the plus button. */\n private onInputPlusStepClick = () => {\n if (Number(this.value) >= this.maxValue) {\n return;\n }\n\n this.value = (Number(this.value) + this.step).toString();\n this.value = this.roundToStep(Number(this.value)).toString();\n\n this.stzhChange.emit({\n component: \"stzh-amount\",\n value: this.value\n })\n }\n\n /** Handling manual value change of the stepper input. */\n private onStepperInputChange = (event: CustomEvent<StzhInputChangeEvent>) => {\n this.value = event.detail.value;\n\n this.stzhChange.emit({\n component: \"stzh-amount\",\n value: this.value\n });\n }\n\n /** Making sure, that the value is rounded correctly according to the step */\n private roundToStep(input: number): number {\n const decimals = Math.max(0, -Math.floor(Math.log10(this.step)));\n const factor = Math.pow(10, decimals);\n const rounded = Math.round(input / this.step) * this.step;\n return Number((rounded * factor / factor).toFixed(decimals));\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await fetchTranslations(this.element, \"amount\");\n }\n\n this.amountId = `stzh-amount-${amountCounter++}`;\n\n if (this._showDropdown) {\n this.setDropdownOptions()\n } else {\n this.stepperInputId = `${this.amountId}-stepper-input`\n }\n }\n\n private renderDropdown(): HTMLDivElement {\n const classes = {\n \"stzh-amount__dropdown\": true,\n [`stzh-amount--popover-placement-${this.popoverPlacement}`]: !!this.popoverPlacement,\n };\n return (\n <div class={classes}>\n <stzh-dropdown\n ref={(el) => (this.input = el as HTMLStzhDropdownElement)}\n options={this._dropdownOptions}\n items={[this.value]}\n label={this.label}\n required={this.required}\n disabled={this.disabled}\n description={this.description}\n descriptionLong={this.descriptionLong}\n error={this.error}\n invalid={this.invalid}\n popoverPlacement={this.popoverPlacement}\n a11yDescribedby={this.a11yDescribedby}\n name={this.name}\n size={this.size}\n showMarker={this.showMarker}\n onStzhChange={this.onDropdownChange}\n ></stzh-dropdown>\n </div>\n );\n }\n\n private renderInputStepper(): HTMLDivElement {\n return (\n <div class=\"stzh-amount__stepper\">\n <div class=\"stzh-amount__stepper-wrapper\">\n <stzh-input\n ref={(el) => (this.input = el as HTMLStzhInputElement)}\n class=\"stzh-amount__stepper-input\"\n value={this.value}\n type=\"number\"\n label={this.label}\n min={this.minValue}\n max={this.maxValue}\n error={this.error}\n invalid={this.invalid}\n required={this.required}\n name={this.name}\n id={this.stepperInputId}\n size={this.size}\n step={this.step}\n showMarker={this.showMarker}\n description={this.description}\n descriptionLong={this.descriptionLong}\n clearable={this.clearable}\n disabled={this.disabled}\n a11yDescribedby={this.a11yDescribedby}\n onStzhChange={this.onStepperInputChange}\n ></stzh-input>\n <stzh-buttongroup>\n <stzh-button\n class=\"stzh-amount__stepper-minus\"\n onClick={this.onInputMinusStepClick}\n variant=\"secondary\"\n icon=\"minus\"\n iconOnly={true}\n a11yControls={this.stepperInputId}\n a11yDescribedby={this.a11yDescribedby}\n a11yLabel={`${this.label} ${this.localization.stepperMinusLabel}, ${this.localization.selectedAmountMessage} ${this.value}`}\n size={this.size}\n a11yDisabled={Number(this.value) <= this.minValue || this.disabled}\n disabled={this.disabled}\n ></stzh-button>\n <stzh-button\n class=\"stzh-amount__stepper-plus\"\n onClick={this.onInputPlusStepClick}\n variant=\"secondary\"\n icon=\"plus\"\n iconOnly={true}\n a11yControls={this.stepperInputId}\n a11yDescribedby={this.a11yDescribedby}\n a11yLabel={`${this.label} ${this.localization.stepperPlusLabel}, ${this.localization.selectedAmountMessage} ${this.value}`}\n size={this.size}\n a11yDisabled={Number(this.value) >= this.maxValue || this.disabled}\n disabled={this.disabled}\n ></stzh-button>\n </stzh-buttongroup>\n </div>\n </div>\n );\n }\n\n render() {\n const classes = {\n \"stzh-amount\": true,\n \"stzh-amount--has-description\": !!this.description,\n \"stzh-amount--has-description-long\": !!this.descriptionLong,\n \"stzh-amount--has-error\": !!this.error,\n \"stzh-amount--is-required\": !!this.required,\n \"stzh-amount--is-disabled\": !!this.disabled\n };\n\n return (\n <Host tabindex={this.disabled ? null : \"-1\"} onFocus={this.onRootFocus}>\n <div class={classes} id={this.amountId}>\n {\n this._showDropdown ?\n this.renderDropdown()\n :\n this.renderInputStepper()\n }\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAgB,mmFCqBtB,MAAMC,EAAkC,oCAExC,IAAIC,EAAgB,E,MAMPC,EAAU,M,gEAYbC,KAAAC,eAA0BC,OAAOC,MAAMH,KAAKI,oBAAsBF,OAAOC,MAAMH,KAAKK,mBACvFL,KAAKI,iBAAmBJ,KAAKK,iBAmE1BL,KAAAM,YAAc,KACpB,GAAIN,KAAKO,MAAO,CACdP,KAAKO,MAAMC,U,GAuBPR,KAAAS,iBAAoBC,IAC1B,GAAIA,EAAMC,OAAOC,QAAUf,EAAiC,CAC1DG,KAAKC,cAAgB,MACrBD,KAAKY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,UAAYtB,KAAK0D,SAC1DA,SAAU1D,KAAK0D,a,CAQ3ByB,SACE,MAAMlC,EAAU,CACd,cAAe,KACf,iCAAkCjD,KAAK2D,YACvC,sCAAuC3D,KAAK4D,gBAC5C,2BAA4B5D,KAAK6D,MACjC,6BAA8B7D,KAAKyD,SACnC,6BAA8BzD,KAAK0D,UAGrC,OACEP,EAACiC,EAAI,CAACC,SAAUrF,KAAK0D,SAAW,KAAO,KAAM4B,QAAStF,KAAKM,aACzD6C,EAAA,OAAKC,MAAOH,EAASsB,GAAIvE,KAAK8C,UAE1B9C,KAAKC,cACLD,KAAKgD,iBAELhD,KAAKoE,sB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as t,c as e,h as o,a as r,g as s}from"./p-9e02896c.js";import{h as i}from"./p-5c697491.js";import{f as n}from"./p-25a09313.js";import{S as l}from"./p-ea61b128.js";function a(t,e){t.split(/\s+/).forEach((t=>{e(t)}))}class d{constructor(){this._events=void 0;this._events={}}on(t,e){a(t,(t=>{const o=this._events[t]||[];o.push(e);this._events[t]=o}))}off(t,e){var o=arguments.length;if(o===0){this._events={};return}a(t,(t=>{if(o===1){delete this._events[t];return}const r=this._events[t];if(r===undefined)return;r.splice(r.indexOf(e),1);this._events[t]=r}))}trigger(t,...e){var o=this;a(t,(t=>{const r=o._events[t];if(r===undefined)return;r.forEach((t=>{t.apply(o,e)}))}))}}function h(t){t.plugins={};return class extends t{constructor(...t){super(...t);this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(e,o){t.plugins[e]={name:e,fn:o}}initializePlugins(t){var e,o;const r=this;const s=[];if(Array.isArray(t)){t.forEach((t=>{if(typeof t==="string"){s.push(t)}else{r.plugins.settings[t.name]=t.options;s.push(t.name)}}))}else if(t){for(e in t){if(t.hasOwnProperty(e)){r.plugins.settings[e]=t[e];s.push(e)}}}while(o=s.shift()){r.require(o)}}loadPlugin(e){var o=this;var r=o.plugins;var s=t.plugins[e];if(!t.plugins.hasOwnProperty(e)){throw new Error('Unable to find "'+e+'" plugin')}r.requested[e]=true;r.loaded[e]=s.fn.apply(o,[o.plugins.settings[e]||{}]);r.names.push(e)}require(t){var e=this;var o=e.plugins;if(!e.plugins.loaded.hasOwnProperty(t)){if(o.requested[t]){throw new Error('Plugin has circular dependency ("'+t+'")')}e.loadPlugin(t)}return o.loaded[t]}}}
|
|
2
|
+
/*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */const c=t=>{t=t.filter(Boolean);if(t.length<2){return t[0]||""}return z(t)==1?"["+t.join("")+"]":"(?:"+t.join("|")+")"};const p=t=>{if(!f(t)){return t.join("")}let e="";let o=0;const r=()=>{if(o>1){e+="{"+o+"}"}};t.forEach(((s,i)=>{if(s===t[i-1]){o++;return}r();e+=s;o=1}));r();return e};const u=t=>{let e=m(t);return c(e)};const f=t=>new Set(t).size!==t.length;const v=t=>(t+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1");const z=t=>t.reduce(((t,e)=>Math.max(t,w(e))),0);const w=t=>m(t).length;const m=t=>Array.from(t)
|
|
3
|
+
/*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */;const _=t=>{if(t.length===1)return[[t]];let e=[];const o=t.substring(1);const r=_(o);r.forEach((function(o){let r=o.slice(0);r[0]=t.charAt(0)+r[0];e.push(r);r=o.slice(0);r.unshift(t.charAt(0));e.push(r)}));return e};
|
|
4
|
+
/*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */const g=[[0,65535]];const b="[̀-ͯ·ʾʼ]";let y;let x;const k=3;const O={};const S={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in S){let e=S[t]||"";for(let o=0;o<e.length;o++){let r=e.substring(o,o+1);O[r]=t}}const F=new RegExp(Object.keys(O).join("|")+"|"+b,"gu");const $=t=>{if(y!==undefined)return;y=T(t||g)};const A=(t,e="NFKD")=>t.normalize(e);const C=t=>m(t).reduce(((t,e)=>t+I(e)),"");const I=t=>{t=A(t).toLowerCase().replace(F,(t=>O[t]||""));return A(t,"NFC")};function*j(t){for(const[e,o]of t){for(let t=e;t<=o;t++){let e=String.fromCharCode(t);let o=C(e);if(o==e.toLowerCase()){continue}if(o.length>k){continue}if(o.length==0){continue}yield{folded:o,composed:e,code_point:t}}}}const E=t=>{const e={};const o=(t,o)=>{const r=e[t]||new Set;const s=new RegExp("^"+u(r)+"$","iu");if(o.match(s)){return}r.add(v(o));e[t]=r};for(let e of j(t)){o(e.folded,e.folded);o(e.folded,e.composed)}return e};const T=t=>{const e=E(t);const o={};let r=[];for(let t in e){let s=e[t];if(s){o[t]=u(s)}if(t.length>1){r.push(v(t))}}r.sort(((t,e)=>e.length-t.length));const s=c(r);x=new RegExp("^"+s,"u");return o};const L=(t,e=1)=>{let o=0;t=t.map((t=>{if(y[t]){o+=t.length}return y[t]||t}));if(o>=e){return p(t)}return""};const R=(t,e=1)=>{e=Math.max(e,t.length-1);return c(_(t).map((t=>L(t,e))))};const M=(t,e=true)=>{let o=t.length>1?1:0;return c(t.map((t=>{let r=[];const s=e?t.length():t.length()-1;for(let e=0;e<s;e++){r.push(R(t.substrs[e]||"",o))}return p(r)})))};const N=(t,e)=>{for(const o of e){if(o.start!=t.start||o.end!=t.end){continue}if(o.substrs.join("")!==t.substrs.join("")){continue}let e=t.parts;const r=t=>{for(const o of e){if(o.start===t.start&&o.substr===t.substr){return false}if(t.length==1||o.length==1){continue}if(t.start<o.start&&t.end>o.start){return true}if(o.start<t.start&&o.end>t.start){return true}}return false};let s=o.parts.filter(r);if(s.length>0){continue}return true}return false};class W{constructor(){this.parts=[];this.substrs=[];this.start=0;this.end=0}add(t){if(t){this.parts.push(t);this.substrs.push(t.substr);this.start=Math.min(t.start,this.start);this.end=Math.max(t.end,this.end)}}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(t,e){let o=new W;let r=JSON.parse(JSON.stringify(this.parts));let s=r.pop();for(const t of r){o.add(t)}let i=e.substr.substring(0,t-s.start);let n=i.length;o.add({start:s.start,end:s.start+n,length:n,substr:i});return o}}const q=t=>{$();t=C(t);let e="";let o=[new W];for(let r=0;r<t.length;r++){let s=t.substring(r);let i=s.match(x);const n=t.substring(r,r+1);const l=i?i[0]:null;let a=[];let d=new Set;for(const t of o){const e=t.last();if(!e||e.length==1||e.end<=r){if(l){const e=l.length;t.add({start:r,end:r+e,length:e,substr:l});d.add("1")}else{t.add({start:r,end:r+1,length:1,substr:n});d.add("2")}}else if(l){let o=t.clone(r,e);const s=l.length;o.add({start:r,end:r+s,length:s,substr:l});a.push(o)}else{d.add("3")}}if(a.length>0){a=a.sort(((t,e)=>t.length()-e.length()));for(let t of a){if(N(t,o)){continue}o.push(t)}continue}if(r>0&&d.size==1&&!d.has("3")){e+=M(o,false);let t=new W;const r=o[0];if(r){t.add(r.last())}o=[t]}}e+=M(o,true);return e};
|
|
5
|
+
/*! sifter.js | https://github.com/orchidjs/sifter.js | Apache License (v2) */const D=(t,e)=>{if(!t)return;return t[e]};const P=(t,e)=>{if(!t)return;var o,r=e.split(".");while((o=r.shift())&&(t=t[o]));return t};const V=(t,e,o)=>{var r,s;if(!t)return 0;t=t+"";if(e.regex==null)return 0;s=t.search(e.regex);if(s===-1)return 0;r=e.string.length/t.length;if(s===0)r+=.5;return r*o};const J=(t,e)=>{var o=t[e];if(typeof o=="function")return o;if(o&&!Array.isArray(o)){t[e]=[o]}};const B=(t,e)=>{if(Array.isArray(t)){t.forEach(e)}else{for(var o in t){if(t.hasOwnProperty(o)){e(t[o],o)}}}};const H=(t,e)=>{if(typeof t==="number"&&typeof e==="number"){return t>e?1:t<e?-1:0}t=C(t+"").toLowerCase();e=C(e+"").toLowerCase();if(t>e)return 1;if(e>t)return-1;return 0};
|
|
6
|
+
/*! sifter.js | https://github.com/orchidjs/sifter.js | Apache License (v2) */class K{constructor(t,e){this.items=void 0;this.settings=void 0;this.items=t;this.settings=e||{diacritics:true}}tokenize(t,e,o){if(!t||!t.length)return[];const r=[];const s=t.split(/\s+/);var i;if(o){i=new RegExp("^("+Object.keys(o).map(v).join("|")+"):(.*)$")}s.forEach((t=>{let o;let s=null;let n=null;if(i&&(o=t.match(i))){s=o[1];t=o[2]}if(t.length>0){if(this.settings.diacritics){n=q(t)||null}else{n=v(t)}if(n&&e)n="\\b"+n}r.push({string:t,regex:n?new RegExp(n,"iu"):null,field:s})}));return r}getScoreFunction(t,e){var o=this.prepareSearch(t,e);return this._getScoreFunction(o)}_getScoreFunction(t){const e=t.tokens,o=e.length;if(!o){return function(){return 0}}const r=t.options.fields,s=t.weights,i=r.length,n=t.getAttrFn;if(!i){return function(){return 1}}const l=function(){if(i===1){return function(t,e){const o=r[0].field;return V(n(e,o),t,s[o]||1)}}return function(t,e){var o=0;if(t.field){const r=n(e,t.field);if(!t.regex&&r){o+=1/i}else{o+=V(r,t,1)}}else{B(s,((r,s)=>{o+=V(n(e,s),t,r)}))}return o/i}}();if(o===1){return function(t){return l(e[0],t)}}if(t.options.conjunction==="and"){return function(t){var r,s=0;for(let o of e){r=l(o,t);if(r<=0)return 0;s+=r}return s/o}}else{return function(t){var r=0;B(e,(e=>{r+=l(e,t)}));return r/o}}}getSortFunction(t,e){var o=this.prepareSearch(t,e);return this._getSortFunction(o)}_getSortFunction(t){var e,o=[];const r=this,s=t.options,i=!t.query&&s.sort_empty?s.sort_empty:s.sort;if(typeof i=="function"){return i.bind(this)}const n=function e(o,s){if(o==="$score")return s.score;return t.getAttrFn(r.items[s.id],o)};if(i){for(let e of i){if(t.query||e.field!=="$score"){o.push(e)}}}if(t.query){e=true;for(let t of o){if(t.field==="$score"){e=false;break}}if(e){o.unshift({field:"$score",direction:"desc"})}}else{o=o.filter((t=>t.field!=="$score"))}const l=o.length;if(!l){return null}return function(t,e){var r,s;for(let i of o){s=i.field;let o=i.direction==="desc"?-1:1;r=o*H(n(s,t),n(s,e));if(r)return r}return 0}}prepareSearch(t,e){const o={};var r=Object.assign({},e);J(r,"sort");J(r,"sort_empty");if(r.fields){J(r,"fields");const t=[];r.fields.forEach((e=>{if(typeof e=="string"){e={field:e,weight:1}}t.push(e);o[e.field]="weight"in e?e.weight:1}));r.fields=t}return{options:r,query:t.toLowerCase().trim(),tokens:this.tokenize(t,r.respect_word_boundaries,o),total:0,items:[],weights:o,getAttrFn:r.nesting?P:D}}search(t,e){var o=this,r,s;s=this.prepareSearch(t,e);e=s.options;t=s.query;const i=e.score||o._getScoreFunction(s);if(t.length){B(o.items,((t,o)=>{r=i(t);if(e.filter===false||r>0){s.items.push({score:r,id:o})}}))}else{B(o.items,((t,e)=>{s.items.push({score:1,id:e})}))}const n=o._getSortFunction(s);if(n)s.items.sort(n);s.total=s.items.length;if(typeof e.limit==="number"){s.items=s.items.slice(0,e.limit)}return s}}const G=(t,e)=>{if(Array.isArray(t)){t.forEach(e)}else{for(var o in t){if(t.hasOwnProperty(o)){e(t[o],o)}}}};const Y=t=>{if(t.jquery){return t[0]}if(t instanceof HTMLElement){return t}if(U(t)){var e=document.createElement("template");e.innerHTML=t.trim();return e.content.firstChild}return document.querySelector(t)};const U=t=>{if(typeof t==="string"&&t.indexOf("<")>-1){return true}return false};const X=t=>t.replace(/['"\\]/g,"\\$&");const Q=(t,e)=>{var o=document.createEvent("HTMLEvents");o.initEvent(e,true,false);t.dispatchEvent(o)};const Z=(t,e)=>{Object.assign(t.style,e)};const tt=(t,...e)=>{var o=ot(e);t=rt(t);t.map((t=>{o.map((e=>{t.classList.add(e)}))}))};const et=(t,...e)=>{var o=ot(e);t=rt(t);t.map((t=>{o.map((e=>{t.classList.remove(e)}))}))};const ot=t=>{var e=[];G(t,(t=>{if(typeof t==="string"){t=t.trim().split(/[\11\12\14\15\40]/)}if(Array.isArray(t)){e=e.concat(t)}}));return e.filter(Boolean)};const rt=t=>{if(!Array.isArray(t)){t=[t]}return t};const st=(t,e,o)=>{if(o&&!o.contains(t)){return}while(t&&t.matches){if(t.matches(e)){return t}t=t.parentNode}};const it=(t,e=0)=>{if(e>0){return t[t.length-1]}return t[0]};const nt=t=>Object.keys(t).length===0;const lt=(t,e)=>{if(!t)return-1;e=e||t.nodeName;var o=0;while(t=t.previousElementSibling){if(t.matches(e)){o++}}return o};const at=(t,e)=>{G(e,((e,o)=>{if(e==null){t.removeAttribute(o)}else{t.setAttribute(o,""+e)}}))};const dt=(t,e)=>{if(t.parentNode)t.parentNode.replaceChild(e,t)};const ht=(t,e)=>{if(e===null)return;if(typeof e==="string"){if(!e.length)return;e=new RegExp(e,"i")}const o=t=>{var o=t.data.match(e);if(o&&t.data.length>0){var r=document.createElement("span");r.className="highlight";var s=t.splitText(o.index);s.splitText(o[0].length);var i=s.cloneNode(true);r.appendChild(i);dt(s,r);return 1}return 0};const r=t=>{if(t.nodeType===1&&t.childNodes&&!/(script|style)/i.test(t.tagName)&&(t.className!=="highlight"||t.tagName!=="SPAN")){Array.from(t.childNodes).forEach((t=>{s(t)}))}};const s=t=>{if(t.nodeType===3){return o(t)}r(t);return 0};s(t)};const ct=t=>{var e=t.querySelectorAll("span.highlight");Array.prototype.forEach.call(e,(function(t){var e=t.parentNode;e.replaceChild(t.firstChild,t);e.normalize()}))};const pt=65;const ut=13;const ft=27;const vt=37;const zt=38;const wt=39;const mt=40;const _t=8;const gt=46;const bt=9;const yt=typeof navigator==="undefined"?false:/Mac/.test(navigator.userAgent);const xt=yt?"metaKey":"ctrlKey";var kt={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:true,diacritics:true,create:null,createOnBlur:false,createFilter:null,highlight:true,openOnFocus:true,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:false,addPrecedence:false,selectOnTab:false,preload:null,allowEmptyOption:false,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:false,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:false,placeholder:null,hidePlaceholder:null,shouldLoad:function(t){return t.length>0},render:{}};const Ot=t=>{if(typeof t==="undefined"||t===null)return null;return St(t)};const St=t=>{if(typeof t==="boolean")return t?"1":"0";return t+""};const Ft=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");const $t=(t,e)=>{var o;return function(r,s){var i=this;if(o){i.loading=Math.max(i.loading-1,0);clearTimeout(o)}o=setTimeout((function(){o=null;i.loadedSearches[r]=true;t.call(i,r,s)}),e)}};const At=(t,e,o)=>{var r;var s=t.trigger;var i={};t.trigger=function(){var o=arguments[0];if(e.indexOf(o)!==-1){i[o]=arguments}else{return s.apply(t,arguments)}};o.apply(t,[]);t.trigger=s;for(r of e){if(r in i){s.apply(t,i[r])}}};const Ct=t=>({start:t.selectionStart||0,length:(t.selectionEnd||0)-(t.selectionStart||0)});const It=(t,e=false)=>{if(t){t.preventDefault();if(e){t.stopPropagation()}}};const jt=(t,e,o,r)=>{t.addEventListener(e,o,r)};const Et=(t,e)=>{if(!e){return false}if(!e[t]){return false}var o=(e.altKey?1:0)+(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.metaKey?1:0);if(o===1){return true}return false};const Tt=(t,e)=>{const o=t.getAttribute("id");if(o){return o}t.setAttribute("id",e);return e};const Lt=t=>t.replace(/[\\"']/g,"\\$&");const Rt=(t,e)=>{if(e)t.append(e)};function Mt(t,e){var o=Object.assign({},kt,e);var r=o.dataAttr;var s=o.labelField;var i=o.valueField;var n=o.disabledField;var l=o.optgroupField;var a=o.optgroupLabelField;var d=o.optgroupValueField;var h=t.tagName.toLowerCase();var c=t.getAttribute("placeholder")||t.getAttribute("data-placeholder");if(!c&&!o.allowEmptyOption){let e=t.querySelector('option[value=""]');if(e){c=e.textContent}}var p={placeholder:c,options:[],optgroups:[],items:[],maxItems:null};var u=()=>{var e;var h=p.options;var c={};var u=1;var f=t=>{var e=Object.assign({},t.dataset);var o=r&&e[r];if(typeof o==="string"&&o.length){e=Object.assign(e,JSON.parse(o))}return e};var v=(t,e)=>{var r=Ot(t.value);if(r==null)return;if(!r&&!o.allowEmptyOption)return;if(c.hasOwnProperty(r)){if(e){var a=c[r][l];if(!a){c[r][l]=e}else if(!Array.isArray(a)){c[r][l]=[a,e]}else{a.push(e)}}}else{var d=f(t);d[s]=d[s]||t.textContent;d[i]=d[i]||r;d[n]=d[n]||t.disabled;d[l]=d[l]||e;d.$option=t;c[r]=d;h.push(d)}if(t.selected){p.items.push(r)}};var z=t=>{var e,o;o=f(t);o[a]=o[a]||t.getAttribute("label")||"";o[d]=o[d]||u++;o[n]=o[n]||t.disabled;p.optgroups.push(o);e=o[d];G(t.children,(t=>{v(t,e)}))};p.maxItems=t.hasAttribute("multiple")?null:1;G(t.children,(t=>{e=t.tagName.toLowerCase();if(e==="optgroup"){z(t)}else if(e==="option"){v(t)}}))};var f=()=>{const e=t.getAttribute(r);if(!e){var n=t.value.trim()||"";if(!o.allowEmptyOption&&!n.length)return;const e=n.split(o.delimiter);G(e,(t=>{const e={};e[s]=t;e[i]=t;p.options.push(e)}));p.items=e}else{p.options=JSON.parse(e);G(p.options,(t=>{p.items.push(t[i])}))}};if(h==="select"){u()}else{f()}return Object.assign({},kt,p,e)}var Nt=0;class Wt extends(h(d)){constructor(t,e){super();this.control_input=void 0;this.wrapper=void 0;this.dropdown=void 0;this.control=void 0;this.dropdown_content=void 0;this.focus_node=void 0;this.order=0;this.settings=void 0;this.input=void 0;this.tabIndex=void 0;this.is_select_tag=void 0;this.rtl=void 0;this.inputId=void 0;this._destroy=void 0;this.sifter=void 0;this.isOpen=false;this.isDisabled=false;this.isRequired=void 0;this.isInvalid=false;this.isValid=true;this.isLocked=false;this.isFocused=false;this.isInputHidden=false;this.isSetup=false;this.ignoreFocus=false;this.ignoreHover=false;this.hasOptions=false;this.currentResults=void 0;this.lastValue="";this.caretPos=0;this.loading=0;this.loadedSearches={};this.activeOption=null;this.activeItems=[];this.optgroups={};this.options={};this.userOptions={};this.items=[];Nt++;var o;var r=Y(t);if(r.tomselect){throw new Error("Tom Select already initialized on this element")}r.tomselect=this;var s=window.getComputedStyle&&window.getComputedStyle(r,null);o=s.getPropertyValue("direction");const i=Mt(r,e);this.settings=i;this.input=r;this.tabIndex=r.tabIndex||0;this.is_select_tag=r.tagName.toLowerCase()==="select";this.rtl=/rtl/i.test(o);this.inputId=Tt(r,"tomselect-"+Nt);this.isRequired=r.required;this.sifter=new K(this.options,{diacritics:i.diacritics});i.mode=i.mode||(i.maxItems===1?"single":"multi");if(typeof i.hideSelected!=="boolean"){i.hideSelected=i.mode==="multi"}if(typeof i.hidePlaceholder!=="boolean"){i.hidePlaceholder=i.mode!=="multi"}var n=i.createFilter;if(typeof n!=="function"){if(typeof n==="string"){n=new RegExp(n)}if(n instanceof RegExp){i.createFilter=t=>n.test(t)}else{i.createFilter=t=>this.settings.duplicates||!this.options[t]}}this.initializePlugins(i.plugins);this.setupCallbacks();this.setupTemplates();const l=Y("<div>");const a=Y("<div>");const d=this._render("dropdown");const h=Y(`<div role="listbox" tabindex="-1">`);const c=this.input.getAttribute("class")||"";const p=i.mode;var u;tt(l,i.wrapperClass,c,p);tt(a,i.controlClass);Rt(l,a);tt(d,i.dropdownClass,p);if(i.copyClassesToDropdown){tt(d,c)}tt(h,i.dropdownContentClass);Rt(d,h);Y(i.dropdownParent||l).appendChild(d);if(U(i.controlInput)){u=Y(i.controlInput);var f=["autocorrect","autocapitalize","autocomplete"];B(f,(t=>{if(r.getAttribute(t)){at(u,{[t]:r.getAttribute(t)})}}));u.tabIndex=-1;a.appendChild(u);this.focus_node=u}else if(i.controlInput){u=Y(i.controlInput);this.focus_node=u}else{u=Y("<input/>");this.focus_node=a}this.wrapper=l;this.dropdown=d;this.dropdown_content=h;this.control=a;this.control_input=u;this.setup()}setup(){const t=this;const e=t.settings;const o=t.control_input;const r=t.dropdown;const s=t.dropdown_content;const i=t.wrapper;const n=t.control;const l=t.input;const a=t.focus_node;const d={passive:true};const h=t.inputId+"-ts-dropdown";at(s,{id:h});at(a,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":h});const c=Tt(a,t.inputId+"-ts-control");const p="label[for='"+X(t.inputId)+"']";const u=document.querySelector(p);const f=t.focus.bind(t);const z=l.getAttribute("aria-labelledby");if(u){jt(u,"click",f);at(u,{for:c})}if(z){at(a,{"aria-labelledby":z});at(s,{"aria-labelledby":z})}i.style.width=l.style.width;if(t.plugins.names.length){const e="plugin-"+t.plugins.names.join(" plugin-");tt([i,r],e)}if(e.mode==="multi"){at(s,{"aria-multiselectable":"true"});if(t.is_select_tag){at(l,{multiple:"multiple"})}}if(e.placeholder){at(o,{placeholder:e.placeholder})}if(!e.splitOn&&e.delimiter){e.splitOn=new RegExp("\\s*"+v(e.delimiter)+"+\\s*")}if(e.load&&e.loadThrottle){e.load=$t(e.load,e.loadThrottle)}t.control_input.type=l.type;jt(r,"mousemove",(()=>{t.ignoreHover=false}));jt(r,"mouseenter",(e=>{var o=st(e.target,"[data-selectable]",r);if(o)t.onOptionHover(e,o)}),{capture:true});jt(r,"click",(e=>{const o=st(e.target,"[data-selectable]");if(o){t.onOptionSelect(e,o);It(e,true)}}));jt(n,"click",(e=>{var r=st(e.target,"[data-ts-item]",n);if(r&&t.onItemSelect(e,r)){It(e,true);return}if(o.value!=""){return}t.onClick();It(e,true)}));jt(a,"keydown",(e=>t.onKeyDown(e)));jt(o,"keypress",(e=>t.onKeyPress(e)));jt(o,"input",(e=>t.onInput(e)));jt(a,"blur",(e=>t.onBlur(e)));jt(a,"focus",(e=>t.onFocus(e)));jt(o,"paste",(e=>t.onPaste(e)));const w=e=>{const s=e.composedPath()[0];if(!i.contains(s)&&!r.contains(s)){if(t.isFocused){t.blur()}t.inputState();return}if(s==o&&t.isOpen){e.stopPropagation()}else{It(e,true)}};const m=()=>{if(t.isOpen){t.positionDropdown()}};jt(document,"mousedown",w);jt(window,"scroll",m,d);jt(window,"resize",m,d);this._destroy=()=>{document.removeEventListener("mousedown",w);window.removeEventListener("scroll",m);window.removeEventListener("resize",m);if(u)u.removeEventListener("click",f)};this.revertSettings={innerHTML:l.innerHTML,tabIndex:l.tabIndex};l.tabIndex=-1;l.insertAdjacentElement("afterend",t.wrapper);t.sync(false);e.items=[];delete e.optgroups;delete e.options;jt(l,"invalid",(()=>{if(t.isValid){t.isValid=false;t.isInvalid=true;t.refreshState()}}));t.updateOriginalInput();t.refreshItems();t.close(false);t.inputState();t.isSetup=true;if(l.disabled){t.disable()}else{t.enable()}t.on("change",this.onChange);tt(l,"tomselected","ts-hidden-accessible");t.trigger("initialize");if(e.preload===true){t.preload()}}setupOptions(t=[],e=[]){this.addOptions(t);B(e,(t=>{this.registerOptionGroup(t)}))}setupTemplates(){var t=this;var e=t.settings.labelField;var o=t.settings.optgroupLabelField;var r={optgroup:t=>{let e=document.createElement("div");e.className="optgroup";e.appendChild(t.options);return e},optgroup_header:(t,e)=>'<div class="optgroup-header">'+e(t[o])+"</div>",option:(t,o)=>"<div>"+o(t[e])+"</div>",item:(t,o)=>"<div>"+o(t[e])+"</div>",option_create:(t,e)=>'<div class="create">Add <strong>'+e(t.input)+"</strong>…</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};t.settings.render=Object.assign({},r,t.settings.render)}setupCallbacks(){var t,e;var o={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(t in o){e=this.settings[o[t]];if(e)this.on(t,e)}}sync(t=true){const e=this;const o=t?Mt(e.input,{delimiter:e.settings.delimiter}):e.settings;e.setupOptions(o.options,o.optgroups);e.setValue(o.items||[],true);e.lastQuery=null}onClick(){var t=this;if(t.activeItems.length>0){t.clearActiveItems();t.focus();return}if(t.isFocused&&t.isOpen){t.blur()}else{t.focus()}}onMouseDown(){}onChange(){Q(this.input,"input");Q(this.input,"change")}onPaste(t){var e=this;if(e.isInputHidden||e.isLocked){It(t);return}if(!e.settings.splitOn){return}setTimeout((()=>{var t=e.inputValue();if(!t.match(e.settings.splitOn)){return}var o=t.trim().split(e.settings.splitOn);B(o,(t=>{const o=Ot(t);if(o){if(this.options[t]){e.addItem(t)}else{e.createItem(t)}}}))}),0)}onKeyPress(t){var e=this;if(e.isLocked){It(t);return}var o=String.fromCharCode(t.keyCode||t.which);if(e.settings.create&&e.settings.mode==="multi"&&o===e.settings.delimiter){e.createItem();It(t);return}}onKeyDown(t){var e=this;e.ignoreHover=true;if(e.isLocked){if(t.keyCode!==bt){It(t)}return}switch(t.keyCode){case pt:if(Et(xt,t)){if(e.control_input.value==""){It(t);e.selectAll();return}}break;case ft:if(e.isOpen){It(t,true);e.close()}e.clearActiveItems();return;case mt:if(!e.isOpen&&e.hasOptions){e.open()}else if(e.activeOption){let t=e.getAdjacent(e.activeOption,1);if(t)e.setActiveOption(t)}It(t);return;case zt:if(e.activeOption){let t=e.getAdjacent(e.activeOption,-1);if(t)e.setActiveOption(t)}It(t);return;case ut:if(e.canSelect(e.activeOption)){e.onOptionSelect(t,e.activeOption);It(t)}else if(e.settings.create&&e.createItem()){It(t)}else if(document.activeElement==e.control_input&&e.isOpen){It(t)}return;case vt:e.advanceSelection(-1,t);return;case wt:e.advanceSelection(1,t);return;case bt:if(e.settings.selectOnTab){if(e.canSelect(e.activeOption)){e.onOptionSelect(t,e.activeOption);It(t)}if(e.settings.create&&e.createItem()){It(t)}}return;case _t:case gt:e.deleteSelection(t);return}if(e.isInputHidden&&!Et(xt,t)){It(t)}}onInput(t){var e=this;if(e.isLocked){return}var o=e.inputValue();if(e.lastValue!==o){e.lastValue=o;if(e.settings.shouldLoad.call(e,o)){e.load(o)}e.refreshOptions();e.trigger("type",o)}}onOptionHover(t,e){if(this.ignoreHover)return;this.setActiveOption(e,false)}onFocus(t){var e=this;var o=e.isFocused;if(e.isDisabled){e.blur();It(t);return}if(e.ignoreFocus)return;e.isFocused=true;if(e.settings.preload==="focus")e.preload();if(!o)e.trigger("focus");if(!e.activeItems.length){e.showInput();e.refreshOptions(!!e.settings.openOnFocus)}e.refreshState()}onBlur(t){if(document.hasFocus()===false)return;var e=this;if(!e.isFocused)return;e.isFocused=false;e.ignoreFocus=false;var o=()=>{e.close();e.setActiveItem();e.setCaret(e.items.length);e.trigger("blur")};if(e.settings.create&&e.settings.createOnBlur){e.createItem(null,o)}else{o()}}onOptionSelect(t,e){var o,r=this;if(e.parentElement&&e.parentElement.matches("[data-disabled]")){return}if(e.classList.contains("create")){r.createItem(null,(()=>{if(r.settings.closeAfterSelect){r.close()}}))}else{o=e.dataset.value;if(typeof o!=="undefined"){r.lastQuery=null;r.addItem(o);if(r.settings.closeAfterSelect){r.close()}if(!r.settings.hideSelected&&t.type&&/click/.test(t.type)){r.setActiveOption(e)}}}}canSelect(t){if(this.isOpen&&t&&this.dropdown_content.contains(t)){return true}return false}onItemSelect(t,e){var o=this;if(!o.isLocked&&o.settings.mode==="multi"){It(t);o.setActiveItem(e,t);return true}return false}canLoad(t){if(!this.settings.load)return false;if(this.loadedSearches.hasOwnProperty(t))return false;return true}load(t){const e=this;if(!e.canLoad(t))return;tt(e.wrapper,e.settings.loadingClass);e.loading++;const o=e.loadCallback.bind(e);e.settings.load.call(e,t,o)}loadCallback(t,e){const o=this;o.loading=Math.max(o.loading-1,0);o.lastQuery=null;o.clearActiveOption();o.setupOptions(t,e);o.refreshOptions(o.isFocused&&!o.isInputHidden);if(!o.loading){et(o.wrapper,o.settings.loadingClass)}o.trigger("load",t,e)}preload(){var t=this.wrapper.classList;if(t.contains("preloaded"))return;t.add("preloaded");this.load("")}setTextboxValue(t=""){var e=this.control_input;var o=e.value!==t;if(o){e.value=t;Q(e,"update");this.lastValue=t}}getValue(){if(this.settings.mode==="multi"&&this.is_select_tag){return this.items}return this.items.join(this.settings.delimiter)}setValue(t,e){var o=e?[]:["change"];At(this,o,(()=>{this.clear(e);this.addItems(t,e)}))}setMaxItems(t){if(t===0)t=null;this.settings.maxItems=t;this.refreshState()}setActiveItem(t,e){var o=this;var r;var s,i,n,l;var a;if(o.settings.mode==="single")return;if(!t){o.clearActiveItems();if(o.isFocused){o.showInput()}return}r=e&&e.type.toLowerCase();if(r==="click"&&Et("shiftKey",e)&&o.activeItems.length){a=o.getLastActive();i=Array.prototype.indexOf.call(o.control.children,a);n=Array.prototype.indexOf.call(o.control.children,t);if(i>n){l=i;i=n;n=l}for(s=i;s<=n;s++){t=o.control.children[s];if(o.activeItems.indexOf(t)===-1){o.setActiveItemClass(t)}}It(e)}else if(r==="click"&&Et(xt,e)||r==="keydown"&&Et("shiftKey",e)){if(t.classList.contains("active")){o.removeActiveItem(t)}else{o.setActiveItemClass(t)}}else{o.clearActiveItems();o.setActiveItemClass(t)}o.hideInput();if(!o.isFocused){o.focus()}}setActiveItemClass(t){const e=this;const o=e.control.querySelector(".last-active");if(o)et(o,"last-active");tt(t,"active last-active");e.trigger("item_select",t);if(e.activeItems.indexOf(t)==-1){e.activeItems.push(t)}}removeActiveItem(t){var e=this.activeItems.indexOf(t);this.activeItems.splice(e,1);et(t,"active")}clearActiveItems(){et(this.activeItems,"active");this.activeItems=[]}setActiveOption(t,e=true){if(t===this.activeOption){return}this.clearActiveOption();if(!t)return;this.activeOption=t;at(this.focus_node,{"aria-activedescendant":t.getAttribute("id")});if(this.settings.mode==="single"||this.settings.hideSelected){at(t,{"aria-selected":"true"})}tt(t,"active");if(e)this.scrollToOption(t)}scrollToOption(t,e){if(!t)return;const o=this.dropdown_content;const r=o.clientHeight;const s=o.scrollTop||0;const i=t.offsetHeight;const n=t.getBoundingClientRect().top-o.getBoundingClientRect().top+s;if(n+i>r+s){this.scroll(n-r+i,e)}else if(n<s){this.scroll(n,e)}}scroll(t,e){const o=this.dropdown_content;if(e){o.style.scrollBehavior=e}o.scrollTop=t;o.style.scrollBehavior=""}clearActiveOption(){if(this.activeOption){et(this.activeOption,"active");if(this.settings.mode==="single"||this.settings.hideSelected){at(this.activeOption,{"aria-selected":null})}}this.activeOption=null;at(this.focus_node,{"aria-activedescendant":null})}selectAll(){const t=this;if(t.settings.mode==="single")return;const e=t.controlChildren();if(!e.length)return;t.hideInput();t.close();t.activeItems=e;B(e,(e=>{t.setActiveItemClass(e)}))}inputState(){var t=this;if(!t.control.contains(t.control_input))return;at(t.control_input,{placeholder:t.settings.placeholder});if(t.activeItems.length>0||!t.isFocused&&t.settings.hidePlaceholder&&t.items.length>0){t.setTextboxValue();t.isInputHidden=true}else{if(t.settings.hidePlaceholder&&t.items.length>0){at(t.control_input,{placeholder:""})}t.isInputHidden=false}t.wrapper.classList.toggle("input-hidden",t.isInputHidden)}hideInput(){this.inputState()}showInput(){this.inputState()}inputValue(){return this.control_input.value.trim()}focus(){var t=this;if(t.isDisabled)return;t.ignoreFocus=true;if(t.control_input.offsetWidth){t.control_input.focus()}else{t.focus_node.focus()}setTimeout((()=>{t.ignoreFocus=false;t.onFocus()}),0)}blur(){this.focus_node.blur();this.onBlur()}getScoreFunction(t){return this.sifter.getScoreFunction(t,this.getSearchOptions())}getSearchOptions(){var t=this.settings;var e=t.sortField;if(typeof t.sortField==="string"){e=[{field:t.sortField}]}return{fields:t.searchField,conjunction:t.searchConjunction,sort:e,nesting:t.nesting}}search(t){var e,o;var r=this;var s=this.getSearchOptions();if(r.settings.score){o=r.settings.score.call(r,t);if(typeof o!=="function"){throw new Error('Tom Select "score" setting must be a function that returns a function')}}if(t!==r.lastQuery){r.lastQuery=t;e=r.sifter.search(t,Object.assign(s,{score:o}));r.currentResults=e}else{e=Object.assign({},r.currentResults)}if(r.settings.hideSelected){e.items=e.items.filter((t=>{let e=Ot(t.id);return!(e&&r.items.indexOf(e)!==-1)}))}return e}refreshOptions(t=true){var e,o,r,s,i,n,l,a,d;var h;const c={};const p=[];var u=this;var f=u.inputValue();const v=f===u.lastQuery||f==""&&u.lastQuery==null;var z=u.search(f);var w=null;var m=u.settings.shouldOpen||false;var _=u.dropdown_content;if(v){w=u.activeOption;if(w){d=w.closest("[data-group]")}}s=z.items.length;if(typeof u.settings.maxOptions==="number"){s=Math.min(s,u.settings.maxOptions)}if(s>0){m=true}for(e=0;e<s;e++){let t=z.items[e];if(!t)continue;let s=t.id;let l=u.options[s];if(l===undefined)continue;let a=St(s);let h=u.getOption(a,true);const f=u.items.includes(a);if(!u.settings.hideSelected){h.classList.toggle("selected",f);if(this.settings.mode==="multi"){at(h,{"aria-selected":f?"true":"false"})}}i=l[u.settings.optgroupField]||"";n=Array.isArray(i)?i:[i];for(o=0,r=n&&n.length;o<r;o++){i=n[o];if(!u.optgroups.hasOwnProperty(i)){i=""}let t=c[i];if(t===undefined){t=document.createDocumentFragment();p.push(i)}if(o>0){h=h.cloneNode(true);if(this.settings.mode==="multi"&&!u.settings.hideSelected){at(h,{id:l.$id+"-clone-"+o,"aria-selected":f?"true":"false"})}else{at(h,{id:l.$id+"-clone-"+o,"aria-selected":null})}h.classList.add("ts-cloned");et(h,"active");if(u.activeOption&&u.activeOption.dataset.value==s){if(d&&d.dataset.group===i.toString()){w=h}}}t.appendChild(h);c[i]=t}}if(u.settings.lockOptgroupOrder){p.sort(((t,e)=>{const o=u.optgroups[t];const r=u.optgroups[e];const s=o&&o.$order||0;const i=r&&r.$order||0;return s-i}))}l=document.createDocumentFragment();B(p,(t=>{let e=c[t];if(!e||!e.children.length)return;let o=u.optgroups[t];if(o!==undefined){let t=document.createDocumentFragment();let r=u.render("optgroup_header",o);Rt(t,r);Rt(t,e);let s=u.render("optgroup",{group:o,options:t});Rt(l,s)}else{Rt(l,e)}}));_.innerHTML="";Rt(_,l);if(u.settings.highlight){ct(_);if(z.query.length&&z.tokens.length){B(z.tokens,(t=>{ht(_,t.regex)}))}}var g=t=>{let e=u.render(t,{input:f});if(e){m=true;_.insertBefore(e,_.firstChild)}return e};if(u.loading){g("loading")}else if(!u.settings.shouldLoad.call(u,f)){g("not_loading")}else if(z.items.length===0){g("no_results")}a=u.canCreate(f);if(a){h=g("option_create")}u.hasOptions=z.items.length>0||a;if(m){if(z.items.length>0){if(!w&&u.settings.mode==="single"&&u.items[0]!=undefined){w=u.getOption(u.items[0])}if(!_.contains(w)){let t=0;if(h&&!u.settings.addPrecedence){t=1}w=u.selectable()[t]}}else if(h){w=h}if(t&&!u.isOpen){u.open();u.scrollToOption(w,"auto")}u.setActiveOption(w)}else{u.clearActiveOption();if(t&&u.isOpen){u.close(false)}}}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(t,e=false){const o=this;if(Array.isArray(t)){o.addOptions(t,e);return false}const r=Ot(t[o.settings.valueField]);if(r===null||o.options.hasOwnProperty(r)){return false}t.$order=t.$order||++o.order;t.$id=o.inputId+"-opt-"+t.$order;o.options[r]=t;o.lastQuery=null;if(e){o.userOptions[r]=e;o.trigger("option_add",r,t)}return r}addOptions(t,e=false){B(t,(t=>{this.addOption(t,e)}))}registerOption(t){return this.addOption(t)}registerOptionGroup(t){var e=Ot(t[this.settings.optgroupValueField]);if(e===null)return false;t.$order=t.$order||++this.order;this.optgroups[e]=t;return e}addOptionGroup(t,e){var o;e[this.settings.optgroupValueField]=t;if(o=this.registerOptionGroup(e)){this.trigger("optgroup_add",o,e)}}removeOptionGroup(t){if(this.optgroups.hasOwnProperty(t)){delete this.optgroups[t];this.clearCache();this.trigger("optgroup_remove",t)}}clearOptionGroups(){this.optgroups={};this.clearCache();this.trigger("optgroup_clear")}updateOption(t,e){const o=this;var r;var s;const i=Ot(t);const n=Ot(e[o.settings.valueField]);if(i===null)return;const l=o.options[i];if(l==undefined)return;if(typeof n!=="string")throw new Error("Value must be set in option data");const a=o.getOption(i);const d=o.getItem(i);e.$order=e.$order||l.$order;delete o.options[i];o.uncacheValue(n);o.options[n]=e;if(a){if(o.dropdown_content.contains(a)){const t=o._render("option",e);dt(a,t);if(o.activeOption===a){o.setActiveOption(t)}}a.remove()}if(d){s=o.items.indexOf(i);if(s!==-1){o.items.splice(s,1,n)}r=o._render("item",e);if(d.classList.contains("active"))tt(r,"active");dt(d,r)}o.lastQuery=null}removeOption(t,e){const o=this;t=St(t);o.uncacheValue(t);delete o.userOptions[t];delete o.options[t];o.lastQuery=null;o.trigger("option_remove",t);o.removeItem(t,e)}clearOptions(t){const e=(t||this.clearFilter).bind(this);this.loadedSearches={};this.userOptions={};this.clearCache();const o={};B(this.options,((t,r)=>{if(e(t,r)){o[r]=t}}));this.options=this.sifter.items=o;this.lastQuery=null;this.trigger("option_clear")}clearFilter(t,e){if(this.items.indexOf(e)>=0){return true}return false}getOption(t,e=false){const o=Ot(t);if(o===null)return null;const r=this.options[o];if(r!=undefined){if(r.$div){return r.$div}if(e){return this._render("option",r)}}return null}getAdjacent(t,e,o="option"){var r=this,s;if(!t){return null}if(o=="item"){s=r.controlChildren()}else{s=r.dropdown_content.querySelectorAll("[data-selectable]")}for(let o=0;o<s.length;o++){if(s[o]!=t){continue}if(e>0){return s[o+1]}return s[o-1]}return null}getItem(t){if(typeof t=="object"){return t}var e=Ot(t);return e!==null?this.control.querySelector(`[data-value="${Lt(e)}"]`):null}addItems(t,e){var o=this;var r=Array.isArray(t)?t:[t];r=r.filter((t=>o.items.indexOf(t)===-1));const s=r[r.length-1];r.forEach((t=>{o.isPending=t!==s;o.addItem(t,e)}))}addItem(t,e){var o=e?[]:["change","dropdown_close"];At(this,o,(()=>{var o,r;const s=this;const i=s.settings.mode;const n=Ot(t);if(n&&s.items.indexOf(n)!==-1){if(i==="single"){s.close()}if(i==="single"||!s.settings.duplicates){return}}if(n===null||!s.options.hasOwnProperty(n))return;if(i==="single")s.clear(e);if(i==="multi"&&s.isFull())return;o=s._render("item",s.options[n]);if(s.control.contains(o)){o=o.cloneNode(true)}r=s.isFull();s.items.splice(s.caretPos,0,n);s.insertAtCaret(o);if(s.isSetup){if(!s.isPending&&s.settings.hideSelected){let t=s.getOption(n);let e=s.getAdjacent(t,1);if(e){s.setActiveOption(e)}}if(!s.isPending&&!s.settings.closeAfterSelect){s.refreshOptions(s.isFocused&&i!=="single")}if(s.settings.closeAfterSelect!=false&&s.isFull()){s.close()}else if(!s.isPending){s.positionDropdown()}s.trigger("item_add",n,o);if(!s.isPending){s.updateOriginalInput({silent:e})}}if(!s.isPending||!r&&s.isFull()){s.inputState();s.refreshState()}}))}removeItem(t=null,e){const o=this;t=o.getItem(t);if(!t)return;var r,s;const i=t.dataset.value;r=lt(t);t.remove();if(t.classList.contains("active")){s=o.activeItems.indexOf(t);o.activeItems.splice(s,1);et(t,"active")}o.items.splice(r,1);o.lastQuery=null;if(!o.settings.persist&&o.userOptions.hasOwnProperty(i)){o.removeOption(i,e)}if(r<o.caretPos){o.setCaret(o.caretPos-1)}o.updateOriginalInput({silent:e});o.refreshState();o.positionDropdown();o.trigger("item_remove",i,t)}createItem(t=null,e=(()=>{})){if(arguments.length===3){e=arguments[2]}if(typeof e!="function"){e=()=>{}}var o=this;var r=o.caretPos;var s;t=t||o.inputValue();if(!o.canCreate(t)){e();return false}o.lock();var i=false;var n=t=>{o.unlock();if(!t||typeof t!=="object")return e();var s=Ot(t[o.settings.valueField]);if(typeof s!=="string"){return e()}o.setTextboxValue();o.addOption(t,true);o.setCaret(r);o.addItem(s);e(t);i=true};if(typeof o.settings.create==="function"){s=o.settings.create.call(this,t,n)}else{s={[o.settings.labelField]:t,[o.settings.valueField]:t}}if(!i){n(s)}return true}refreshItems(){var t=this;t.lastQuery=null;if(t.isSetup){t.addItems(t.items)}t.updateOriginalInput();t.refreshState()}refreshState(){const t=this;t.refreshValidityState();const e=t.isFull();const o=t.isLocked;t.wrapper.classList.toggle("rtl",t.rtl);const r=t.wrapper.classList;r.toggle("focus",t.isFocused);r.toggle("disabled",t.isDisabled);r.toggle("required",t.isRequired);r.toggle("invalid",!t.isValid);r.toggle("locked",o);r.toggle("full",e);r.toggle("input-active",t.isFocused&&!t.isInputHidden);r.toggle("dropdown-active",t.isOpen);r.toggle("has-options",nt(t.options));r.toggle("has-items",t.items.length>0)}refreshValidityState(){var t=this;if(!t.input.validity){return}t.isValid=t.input.validity.valid;t.isInvalid=!t.isValid}isFull(){return this.settings.maxItems!==null&&this.items.length>=this.settings.maxItems}updateOriginalInput(t={}){const e=this;var o,r;const s=e.input.querySelector('option[value=""]');if(e.is_select_tag){const i=[];const n=e.input.querySelectorAll("option:checked").length;function l(t,o,r){if(!t){t=Y('<option value="'+Ft(o)+'">'+Ft(r)+"</option>")}if(t!=s){e.input.append(t)}i.push(t);if(t!=s||n>0){t.selected=true}return t}e.input.querySelectorAll("option:checked").forEach((t=>{t.selected=false}));if(e.items.length==0&&e.settings.mode=="single"){l(s,"","")}else{e.items.forEach((t=>{o=e.options[t];r=o[e.settings.labelField]||"";if(i.includes(o.$option)){const o=e.input.querySelector(`option[value="${Lt(t)}"]:not(:checked)`);l(o,t,r)}else{o.$option=l(o.$option,t,r)}}))}}else{e.input.value=e.getValue()}if(e.isSetup){if(!t.silent){e.trigger("change",e.getValue())}}}open(){var t=this;if(t.isLocked||t.isOpen||t.settings.mode==="multi"&&t.isFull())return;t.isOpen=true;at(t.focus_node,{"aria-expanded":"true"});t.refreshState();Z(t.dropdown,{visibility:"hidden",display:"block"});t.positionDropdown();Z(t.dropdown,{visibility:"visible",display:"block"});t.focus();t.trigger("dropdown_open",t.dropdown)}close(t=true){var e=this;var o=e.isOpen;if(t){e.setTextboxValue();if(e.settings.mode==="single"&&e.items.length){e.hideInput()}}e.isOpen=false;at(e.focus_node,{"aria-expanded":"false"});Z(e.dropdown,{display:"none"});if(e.settings.hideSelected){e.clearActiveOption()}e.refreshState();if(o)e.trigger("dropdown_close",e.dropdown)}positionDropdown(){if(this.settings.dropdownParent!=="body"){return}var t=this.control;var e=t.getBoundingClientRect();var o=t.offsetHeight+e.top+window.scrollY;var r=e.left+window.scrollX;Z(this.dropdown,{width:e.width+"px",top:o+"px",left:r+"px"})}clear(t){var e=this;if(!e.items.length)return;var o=e.controlChildren();B(o,(t=>{e.removeItem(t,true)}));e.showInput();if(!t)e.updateOriginalInput();e.trigger("clear")}insertAtCaret(t){const e=this;const o=e.caretPos;const r=e.control;r.insertBefore(t,r.children[o]||null);e.setCaret(o+1)}deleteSelection(t){var e,o,r,s;var i=this;e=t&&t.keyCode===_t?-1:1;o=Ct(i.control_input);const n=[];if(i.activeItems.length){s=it(i.activeItems,e);r=lt(s);if(e>0){r++}B(i.activeItems,(t=>n.push(t)))}else if((i.isFocused||i.settings.mode==="single")&&i.items.length){const t=i.controlChildren();let r;if(e<0&&o.start===0&&o.length===0){r=t[i.caretPos-1]}else if(e>0&&o.start===i.inputValue().length){r=t[i.caretPos]}if(r!==undefined){n.push(r)}}if(!i.shouldDelete(n,t)){return false}It(t,true);if(typeof r!=="undefined"){i.setCaret(r)}while(n.length){i.removeItem(n.pop())}i.showInput();i.positionDropdown();i.refreshOptions(false);return true}shouldDelete(t,e){const o=t.map((t=>t.dataset.value));if(!o.length||typeof this.settings.onDelete==="function"&&this.settings.onDelete(o,e)===false){return false}return true}advanceSelection(t,e){var o,r,s=this;if(s.rtl)t*=-1;if(s.inputValue().length)return;if(Et(xt,e)||Et("shiftKey",e)){o=s.getLastActive(t);if(o){if(!o.classList.contains("active")){r=o}else{r=s.getAdjacent(o,t,"item")}}else if(t>0){r=s.control_input.nextElementSibling}else{r=s.control_input.previousElementSibling}if(r){if(r.classList.contains("active")){s.removeActiveItem(o)}s.setActiveItemClass(r)}}else{s.moveCaret(t)}}moveCaret(t){}getLastActive(t){let e=this.control.querySelector(".last-active");if(e){return e}var o=this.control.querySelectorAll(".active");if(o){return it(o,t)}}setCaret(t){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.isLocked=true;this.refreshState()}unlock(){this.isLocked=false;this.refreshState()}disable(){var t=this;t.input.disabled=true;t.control_input.disabled=true;t.focus_node.tabIndex=-1;t.isDisabled=true;this.close();t.lock()}enable(){var t=this;t.input.disabled=false;t.control_input.disabled=false;t.focus_node.tabIndex=t.tabIndex;t.isDisabled=false;t.unlock()}destroy(){var t=this;var e=t.revertSettings;t.trigger("destroy");t.off();t.wrapper.remove();t.dropdown.remove();t.input.innerHTML=e.innerHTML;t.input.tabIndex=e.tabIndex;et(t.input,"tomselected","ts-hidden-accessible");t._destroy();delete t.input.tomselect}render(t,e){var o,r;const s=this;if(typeof this.settings.render[t]!=="function"){return null}r=s.settings.render[t].call(this,e,Ft);if(!r){return null}r=Y(r);if(t==="option"||t==="option_create"){if(e[s.settings.disabledField]){at(r,{"aria-disabled":"true"})}else{at(r,{"data-selectable":""})}}else if(t==="optgroup"){o=e.group[s.settings.optgroupValueField];at(r,{"data-group":o});if(e.group[s.settings.disabledField]){at(r,{"data-disabled":""})}}if(t==="option"||t==="item"){const o=St(e[s.settings.valueField]);at(r,{"data-value":o});if(t==="item"){tt(r,s.settings.itemClass);at(r,{"data-ts-item":""})}else{tt(r,s.settings.optionClass);at(r,{role:"option",id:e.$id});e.$div=r;s.options[o]=e}}return r}_render(t,e){const o=this.render(t,e);if(o==null){throw"HTMLElement expected"}return o}clearCache(){B(this.options,(t=>{if(t.$div){t.$div.remove();delete t.$div}}))}uncacheValue(t){const e=this.getOption(t);if(e)e.remove()}canCreate(t){return this.settings.create&&t.length>0&&this.settings.createFilter.call(this,t)}hook(t,e,o){var r=this;var s=r[e];r[e]=function(){var e,i;if(t==="after"){e=s.apply(r,arguments)}i=o.apply(r,arguments);if(t==="instead"){return i}if(t==="before"){e=s.apply(r,arguments)}return e}}}
|
|
7
|
+
/*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */const qt="[̀-ͯ·ʾʼ]";const Dt={};const Pt={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in Pt){let e=Pt[t]||"";for(let o=0;o<e.length;o++){let r=e.substring(o,o+1);Dt[r]=t}}new RegExp(Object.keys(Dt).join("|")+"|"+qt,"gu");const Vt=t=>{if(t.jquery){return t[0]}if(t instanceof HTMLElement){return t}if(Jt(t)){var e=document.createElement("template");e.innerHTML=t.trim();return e.content.firstChild}return document.querySelector(t)};const Jt=t=>{if(typeof t==="string"&&t.indexOf("<")>-1){return true}return false};const Bt=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");const Ht=(t,e=false)=>{if(t){t.preventDefault();if(e){t.stopPropagation()}}};const Kt=(t,e,o,r)=>{t.addEventListener(e,o,r)};function Gt(t){const e=Object.assign({label:"×",title:"Remove",className:"remove",append:true},t);var o=this;if(!e.append){return}var r='<a href="javascript:void(0)" class="'+e.className+'" tabindex="-1" title="'+Bt(e.title)+'">'+e.label+"</a>";o.hook("after","setupTemplates",(()=>{var t=o.settings.render.item;o.settings.render.item=(e,s)=>{var i=Vt(t.call(o,e,s));var n=Vt(r);i.appendChild(n);Kt(n,"mousedown",(t=>{Ht(t,true)}));Kt(n,"click",(t=>{Ht(t,true);if(o.isLocked)return;if(!o.shouldDelete([i],t))return;o.removeItem(i);o.refreshOptions(false);o.inputState()}));return i}}))}const Yt=t=>{if(typeof t==="undefined"||t===null)return null;return Ut(t)};const Ut=t=>{if(typeof t==="boolean")return t?"1":"0";return t+""};const Xt=(t,e=false)=>{if(t){t.preventDefault();if(e){t.stopPropagation()}}};
|
|
8
|
+
/*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */const Qt="[̀-ͯ·ʾʼ]";const Zt={};const te={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in te){let e=te[t]||"";for(let o=0;o<e.length;o++){let r=e.substring(o,o+1);Zt[r]=t}}new RegExp(Object.keys(Zt).join("|")+"|"+Qt,"gu");const ee=t=>{if(t.jquery){return t[0]}if(t instanceof HTMLElement){return t}if(oe(t)){var e=document.createElement("template");e.innerHTML=t.trim();return e.content.firstChild}return document.querySelector(t)};const oe=t=>{if(typeof t==="string"&&t.indexOf("<")>-1){return true}return false};function re(){var t=this;var e=t.onOptionSelect;t.settings.hideSelected=false;var o=function t(e){setTimeout((()=>{var t=e.querySelector("input");if(t instanceof HTMLInputElement){if(e.classList.contains("selected")){t.checked=true}else{t.checked=false}}}),1)};t.hook("after","setupTemplates",(()=>{var e=t.settings.render.option;t.settings.render.option=(o,r)=>{var s=ee(e.call(t,o,r));var i=document.createElement("input");i.addEventListener("click",(function(t){Xt(t)}));i.type="checkbox";const n=Yt(o[t.settings.valueField]);if(n&&t.items.indexOf(n)>-1){i.checked=true}s.prepend(i);return s}}));t.on("item_remove",(e=>{var r=t.getOption(e);if(r){r.classList.remove("selected");o(r)}}));t.on("item_add",(e=>{var r=t.getOption(e);if(r){o(r)}}));t.hook("instead","onOptionSelect",((r,s)=>{if(s.classList.contains("selected")){s.classList.remove("selected");t.removeItem(s.dataset.value);t.refreshOptions();Xt(r,true);return}e.call(t,r,s);o(s)}))}const se=(t,e,o,r)=>{t.addEventListener(e,o,r)};function ie(){var t=this;t.on("initialize",(()=>{var e=document.createElement("span");var o=t.control_input;e.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ";t.wrapper.appendChild(e);var r=["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"];for(const t of r){e.style[t]=o.style[t]}var s=()=>{e.textContent=o.value;o.style.width=e.clientWidth+"px"};s();t.on("update item_add item_remove",s);se(o,"input",s);se(o,"keyup",s);se(o,"blur",s);se(o,"update",s)}))}function ne(){var t=this;var e=t.deleteSelection;this.hook("instead","deleteSelection",(o=>{if(t.activeItems.length){return e.call(t,o)}return false}))}const le='@charset "UTF-8";:host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-dropdown{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;--color:var(--stzh-color-primary, var(--stzh-color-zueriblue));--border-color:var(--stzh-color-grey61);--label-color:var(--stzh-color-grey61);--placeholder-color:var(--stzh-color-grey61);--background-color:var(--stzh-color-white);--label-background:var(--stzh-color-white);--icon-size:var(--stzh-icon-size-small);--icon-angle-size:var(--stzh-icon-size-medium);--hover-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));--hover-border-color:var(--hover-color);--popover-width:100%;--popover-min-width:var(--stzh-popover-min-width);--popover-max-width:var(--stzh-popover-min-width);--popover-max-height:calc(6.5 * var(--stzh-menu-item-height));--active-icon-angle-transform:rotate(180deg) translateY(50%);width:100%;border-radius:var(--stzh-form-input-border-radius);}stzh-dropdown[hidden]{display:none}stzh-dropdown *,stzh-dropdown *::before,stzh-dropdown *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-dropdown[variant=plain]{--background-color:transparent}stzh-dropdown[inline]:not([inline=false]){--popover-width:auto;width:auto}stzh-dropdown[size=small]{--icon-angle-size:var(--stzh-icon-size-small)}stzh-dropdown[invalid]:not([invalid=false]){--color:var(--stzh-color-error);--border-color:var(--stzh-color-error);--label-color:var(--stzh-color-error);--placeholder-color:var(--stzh-color-error);--hover-color:var(--stzh-color-error);--hover-border-color:var(--stzh-color-error)}stzh-dropdown[disabled]:not([disabled=false]){--color:var(--stzh-color-grey61);--border-color:transparent;--label-color:var(--stzh-color-grey61);--placeholder-color:var(--stzh-color-grey61);--background-color:var(--stzh-color-black8);--label-background:transparent;--hover-color:var(--stzh-color-grey61);--hover-border-color:transparent}stzh-dropdown[disabled]:not([disabled=false])[variant=plain]{--background-color:transparent}.stzh-dropdown{}.stzh-dropdown__marker-symbol{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal}.stzh-dropdown__marker-text{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-dropdown__description-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.stzh-dropdown__error,.stzh-dropdown__description{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);color:var(--stzh-base-color)}.stzh-dropdown__error{color:var(--stzh-color-error)}.stzh-dropdown__error-list{list-style:none;margin:0;padding:0}.stzh-dropdown__description{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.stzh-dropdown__description-long{margin-left:var(--stzh-space-xxsmall);margin-top:0.1875rem}.stzh-dropdown__description-long-popover{--width:auto;--max-width:27.3125rem}.stzh-dropdown__description-long-popover[open]:not([open=false]) .stzh-dropdown__description-long-button{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-dropdown__description-long-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;padding:0;border:none;background-color:transparent;border-radius:0.5rem;cursor:pointer;-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);color:var(--stzh-base-lead-color)}.stzh-dropdown__description-long-button:hover{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-dropdown stzh-icon.stzh-dropdown__description-long-icon{--size:var(--stzh-icon-size-xsmall)}.stzh-dropdown--has-error .stzh-dropdown__error,.stzh-dropdown--has-description .stzh-dropdown__description{margin-top:var(--stzh-space-xxsmall)}.stzh-dropdown .ts-hidden-accessible{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-dropdown .ts-dropdown-content{max-height:var(--popover-max-height);overflow-y:auto;overflow-x:hidden;overflow-scrolling:touch;scroll-behavior:smooth}.stzh-dropdown .ts-control{overflow:hidden;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;border-radius:var(--stzh-form-input-border-radius);background-color:var(--background-color);-webkit-transition-property:color, border-color;transition-property:color, border-color;-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-dropdown .ts-control:hover,.stzh-dropdown .ts-control:focus-within{border-color:var(--hover-border-color)}.stzh-dropdown .ts-control>*{vertical-align:baseline;display:inline-block}.stzh-dropdown .ts-control,.stzh-dropdown__sizer{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;width:100%;min-height:var(--stzh-form-input-height);border:0.0625rem solid var(--border-color)}.stzh-dropdown .ts-control>input{font-size:inherit;line-height:inherit;-ms-flex:1 1 auto;flex:1 1 auto;display:inline-block;padding:0;min-height:0;max-height:none;max-width:100%;margin:0;text-indent:0;border:0 none;background:none;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;-webkit-box-shadow:none;box-shadow:none;cursor:pointer}.stzh-dropdown .ts-control>input::-webkit-input-placeholder{color:var(--placeholder-color)}.stzh-dropdown .ts-control>input:-moz-placeholder{color:var(--placeholder-color)}.stzh-dropdown .ts-control>input::-moz-placeholder{color:var(--placeholder-color)}.stzh-dropdown .ts-control>input:-ms-input-placeholder{color:var(--placeholder-color)}.stzh-dropdown .ts-control>input::-ms-clear{display:none}.stzh-dropdown .ts-control>input:focus{outline:none}.stzh-dropdown .ts-control>input:-moz-placeholder-shown{text-overflow:ellipsis}.stzh-dropdown .ts-control>input:-ms-input-placeholder{text-overflow:ellipsis}.stzh-dropdown .ts-control>input:placeholder-shown{text-overflow:ellipsis}.stzh-dropdown__vhidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-dropdown__field-wrapper,.stzh-dropdown__select{position:relative}.stzh-dropdown__icon-wrapper{position:absolute}.stzh-dropdown__select .ts-control>input,.stzh-dropdown__select.single .stzh-dropdown__item,.stzh-dropdown__icon-wrapper,.stzh-dropdown__icon-angle-wrapper{color:var(--color);-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed)}.stzh-dropdown__select.multi .stzh-dropdown__item{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-dropdown__select:hover .ts-control>input,.stzh-dropdown__select:focus-within .ts-control>input,.stzh-dropdown__select.single:hover .stzh-dropdown__item,.stzh-dropdown__select.single:focus-within .stzh-dropdown__item,.stzh-dropdown__select:hover~.stzh-dropdown__icon-wrapper,.stzh-dropdown__select:focus-within~.stzh-dropdown__icon-wrapper,.stzh-dropdown__select:hover~.stzh-dropdown__icon-angle-wrapper,.stzh-dropdown__select:focus-within~.stzh-dropdown__icon-angle-wrapper,.stzh-dropdown__select:hover~.stzh-dropdown__label,.stzh-dropdown__select:focus-within~.stzh-dropdown__label{color:var(--hover-color)}.stzh-dropdown__sizer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-top:calc(var(--stzh-form-input-height) / -1);pointer-events:none;visibility:hidden}.stzh-dropdown__select.has-items~.stzh-dropdown__sizer{display:none}.stzh-dropdown__select.plugin-input_hide~.stzh-dropdown__sizer{visibility:visible}.stzh-dropdown__select.input-active .ts-control,.stzh-dropdown__select.input-active .ts-control>input{cursor:text}.stzh-dropdown__select.input-hidden .ts-control>input,.stzh-dropdown__select.plugin-input_hide .ts-control>input{opacity:0;position:absolute;left:-625rem}.stzh-dropdown__select.single .ts-control,.stzh-dropdown__select.multi .ts-control,.stzh-dropdown__sizer{padding:var(--stzh-space-xsmall) var(--stzh-space-medium);padding-right:calc(var(--stzh-icon-size-medium) + var(--stzh-space-medium) + var(--stzh-space-xsmall))}.stzh-dropdown__icon-wrapper,.stzh-dropdown__icon-angle-wrapper{display:-ms-flexbox;display:flex;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);pointer-events:none}.stzh-dropdown__icon-wrapper{left:var(--stzh-space-medium)}.stzh-dropdown__icon-angle-wrapper{right:var(--stzh-space-medium)}.stzh-dropdown__icon-wrapper stzh-icon,.stzh-dropdown__icon{--size:var(--icon-size)}.stzh-dropdown__icon-angle-wrapper stzh-icon,.stzh-dropdown__icon-angle{--size:var(--icon-angle-size)}.stzh-dropdown__label{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:var(--label-color);display:block;width:auto;position:absolute;top:calc(var(--stzh-form-input-height) / 2);left:calc(var(--stzh-space-medium) + 0.0625rem);max-width:calc(100% - var(--stzh-space-medium) * 2);-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:all var(--stzh-base-transition-animation-speed);transition:all var(--stzh-base-transition-animation-speed);pointer-events:none}.stzh-dropdown__label:empty{display:none}.stzh-dropdown__label::before{content:"";display:none;background:var(--label-background);position:absolute;width:100%;z-index:-1;left:0;top:50%;height:0.125rem;margin-top:-0.5px}.stzh-dropdown__option,.stzh-dropdown__create{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:stretch;justify-content:stretch;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;-webkit-text-decoration-line:none;text-decoration-line:none;outline:none;border:none;padding:var(--stzh-space-xsmall) var(--stzh-space-medium);padding-left:var(--stzh-space-large);color:var(--stzh-color-grey70);height:var(--stzh-menu-item-height);line-height:var(--stzh-menu-item-height);-webkit-transition:all var(--stzh-base-transition-animation-speed);transition:all var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-dropdown__option:hover,.stzh-dropdown__option.active,.stzh-dropdown__create:hover,.stzh-dropdown__create.active{background-color:var(--stzh-color-grey5)}.stzh-dropdown__option.selected,.stzh-dropdown__create.selected{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-dropdown__option.selected:hover,.stzh-dropdown__option.selected.active,.stzh-dropdown__create.selected:hover,.stzh-dropdown__create.selected.active{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));background-color:var(--stzh-color-primary8)}.stzh-dropdown__option input,.stzh-dropdown__create input{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-dropdown__create{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);display:block}.stzh-dropdown__option-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stzh-dropdown__option[data-selectable] .highlight{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal}.stzh-dropdown__select .stzh-dropdown__option-check{display:none;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-dropdown__option.selected::before{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute;content:"✓"}.stzh-dropdown__option.selected:hover .stzh-dropdown__option-check,.stzh-dropdown__option.selected.active .stzh-dropdown__option-check{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-dropdown__no-results{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.stzh-dropdown__no-results,.stzh-dropdown__not-loading{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);padding:var(--stzh-space-xsmall) var(--stzh-space-medium);padding-left:var(--stzh-space-large)}.stzh-dropdown__optgroup-header{cursor:default}.stzh-dropdown__loader{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:2.375rem}.stzh-dropdown__dropdown{position:absolute;top:100%;left:0;width:var(--popover-width);margin-top:var(--stzh-space-xsmall);background-color:var(--stzh-color-white);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);z-index:var(--stzh-z-index-popover);border-radius:var(--stzh-popover-border-radius);overflow:hidden}@media screen and (min-width: 600px){.stzh-dropdown__dropdown{min-width:var(--popover-min-width);max-width:var(--popover-max-width)}}.stzh-dropdown__select.plugin-input_autogrow.has-items .ts-control>input{min-width:0}.stzh-dropdown__select.plugin-input_autogrow.has-items.focus .ts-control>input{-ms-flex:none;flex:none;min-width:0.25rem}.stzh-dropdown__select.has-items .ts-control>input{margin:0 0.25rem}.stzh-dropdown__select.has-items .ts-control>input::-webkit-input-placeholder{color:transparent}.stzh-dropdown__select.has-items .ts-control>input:-moz-placeholder{color:transparent}.stzh-dropdown__select.has-items .ts-control>input::-moz-placeholder{color:transparent}.stzh-dropdown__select.has-items .ts-control>input:-ms-input-placeholder{color:transparent}.stzh-dropdown__select.dropdown-active~.stzh-dropdown__icon-angle-wrapper{-webkit-transform:var(--active-icon-angle-transform);transform:var(--active-icon-angle-transform)}.stzh-dropdown--is-multiple .stzh-dropdown__option-check{display:-ms-inline-flexbox;display:inline-flex;opacity:0;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed);margin-right:var(--stzh-space-xsmall)}.stzh-dropdown--is-multiple .stzh-dropdown__option{padding-left:var(--stzh-space-small)}.stzh-dropdown--is-multiple .stzh-dropdown__option.selected .stzh-dropdown__option-check{opacity:1}.stzh-dropdown--is-multiple .stzh-dropdown__select.multi.has-items .ts-control{padding-top:calc(var(--stzh-space-xsmall) - 0.0625rem);padding-bottom:calc(var(--stzh-space-xsmall) - 0.0625rem)}.stzh-dropdown--is-multiple .stzh-dropdown__select.multi .stzh-dropdown__item{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);position:relative;height:1.5rem;line-height:1.5rem;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;border-radius:0.75rem;padding:0 var(--stzh-space-medium);-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:0.0625rem solid transparent;background-color:var(--stzh-color-grey5);-webkit-transition:all var(--stzh-base-transition-animation-speed);transition:all var(--stzh-base-transition-animation-speed);margin:var(--stzh-space-xxsmall) var(--stzh-space-xxsmall) var(--stzh-space-xxsmall) 0;cursor:pointer}.stzh-dropdown--is-multiple .stzh-dropdown__select.multi .stzh-dropdown__item:hover{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));background-color:var(--stzh-color-primary8)}.stzh-dropdown--is-multiple .stzh-dropdown__select.multi .stzh-dropdown__item.active{color:var(--stzh-color-white);background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-dropdown--is-multiple .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-right:calc(1.5rem + var(--stzh-space-xxsmall))}.stzh-dropdown--is-multiple .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item .remove{position:absolute;top:50%;right:-0.0625rem;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-text-decoration-line:none;text-decoration-line:none;width:1.5rem;height:1.5rem;border-radius:1.5rem;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-left:var(--stzh-space-xxsmall);color:var(--stzh-base-lead-color);-webkit-transition:all var(--stzh-base-transition-animation-speed);transition:all var(--stzh-base-transition-animation-speed)}.stzh-dropdown--is-multiple .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item .remove:hover{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));background-color:var(--stzh-color-primary8)}.stzh-dropdown--is-multiple .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__remove-icon{--size:var(--stzh-icon-size-xxsmall)}.stzh-dropdown--is-multiple .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item.active .stzh-dropdown__remove-icon{color:var(--stzh-color-white)}.stzh-dropdown--popover-placement-top .stzh-dropdown__dropdown,.stzh-dropdown--popover-placement-top-end .stzh-dropdown__dropdown,.stzh-dropdown--popover-placement-top-center .stzh-dropdown__dropdown{margin-top:0;top:auto;bottom:100%;margin-bottom:var(--stzh-space-xsmall)}.stzh-dropdown--popover-placement-top.stzh-dropdown--plain .stzh-dropdown__dropdown,.stzh-dropdown--popover-placement-top-end.stzh-dropdown--plain .stzh-dropdown__dropdown,.stzh-dropdown--popover-placement-top-center.stzh-dropdown--plain .stzh-dropdown__dropdown{margin-bottom:0}.stzh-dropdown--popover-placement-top-end .stzh-dropdown__dropdown,.stzh-dropdown--popover-placement-bottom-end .stzh-dropdown__dropdown{left:auto;right:0}.stzh-dropdown--popover-placement-top-center .stzh-dropdown__dropdown,.stzh-dropdown--popover-placement-bottom-center .stzh-dropdown__dropdown{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.stzh-dropdown--size-small .ts-control,.stzh-dropdown--size-small .stzh-dropdown__sizer{font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height)}.stzh-dropdown--size-small .ts-control{min-height:var(--stzh-form-input-small-height)}.stzh-dropdown--size-small .stzh-dropdown__sizer{min-height:initial;height:var(--stzh-form-input-small-height);margin-top:calc(var(--stzh-form-input-small-height) / -1)}.stzh-dropdown--size-small .stzh-dropdown__label{top:calc(var(--stzh-form-input-small-height) / 2)}.stzh-dropdown--size-small .stzh-dropdown__select.single .ts-control,.stzh-dropdown--size-small .stzh-dropdown__select.multi .ts-control,.stzh-dropdown--size-small .stzh-dropdown__sizer{padding:var(--stzh-space-xxsmall) var(--stzh-space-medium);padding-right:calc(var(--stzh-icon-size-small) + var(--stzh-space-medium) + var(--stzh-space-xsmall))}.stzh-dropdown--has-icon .stzh-dropdown__select.single .ts-control,.stzh-dropdown--has-icon .stzh-dropdown__select.multi .ts-control,.stzh-dropdown--has-icon .stzh-dropdown__sizer{padding-left:calc(var(--icon-size) + var(--stzh-space-medium) + var(--stzh-space-xsmall))}.stzh-dropdown--has-icon .stzh-dropdown__label{left:calc(var(--icon-size) + var(--stzh-space-medium) + var(--stzh-space-xsmall) + 0.0625rem)}.stzh-dropdown--plain .stzh-dropdown__select.single .ts-control,.stzh-dropdown--plain .stzh-dropdown__select.multi .ts-control,.stzh-dropdown--plain .stzh-dropdown__sizer{border:none;padding-left:0;padding-right:calc(var(--stzh-icon-size-medium) + var(--stzh-space-xsmall))}.stzh-dropdown--plain .stzh-dropdown__icon-wrapper{left:0}.stzh-dropdown--plain .stzh-dropdown__icon-angle-wrapper{right:0}.stzh-dropdown--plain .stzh-dropdown__label{left:0;max-width:100%;padding:0}.stzh-dropdown--plain .stzh-dropdown__label::before{content:none}.stzh-dropdown--plain .stzh-dropdown__dropdown{margin-top:0}.stzh-dropdown--plain.stzh-dropdown--size-small .stzh-dropdown__select.single .ts-control,.stzh-dropdown--plain.stzh-dropdown--size-small .stzh-dropdown__select.multi .ts-control,.stzh-dropdown--plain.stzh-dropdown--size-small .stzh-dropdown__sizer{padding-right:calc(var(--stzh-icon-size-small) + var(--stzh-space-xsmall))}.stzh-dropdown--plain.stzh-dropdown--has-icon .stzh-dropdown__select.single .ts-control,.stzh-dropdown--plain.stzh-dropdown--has-icon .stzh-dropdown__select.multi .ts-control,.stzh-dropdown--plain.stzh-dropdown--has-icon .stzh-dropdown__sizer{padding-left:calc(var(--icon-size) + var(--stzh-space-xsmall))}.stzh-dropdown--plain.stzh-dropdown--has-icon .stzh-dropdown__label{left:calc(var(--icon-size) + var(--stzh-space-xsmall) + 0.0625rem)}.stzh-dropdown--has-fixed-label .stzh-dropdown__label,.stzh-dropdown--is-filled .stzh-dropdown__label,.stzh-dropdown--is-disabled .stzh-dropdown__label,.stzh-dropdown--is-invalid .stzh-dropdown__label,.stzh-dropdown--has-focus .stzh-dropdown__label{top:0;left:calc(var(--stzh-space-medium) - var(--stzh-space-xxsmall));height:1.25rem;line-height:1.25rem;padding:0 var(--stzh-space-xxsmall);max-width:calc(100% - (var(--stzh-space-medium) - var(--stzh-space-xxsmall)) * 2);pointer-events:all}.stzh-dropdown--has-fixed-label .stzh-dropdown__label:not(:empty)::before,.stzh-dropdown--is-filled .stzh-dropdown__label:not(:empty)::before,.stzh-dropdown--is-disabled .stzh-dropdown__label:not(:empty)::before,.stzh-dropdown--is-invalid .stzh-dropdown__label:not(:empty)::before,.stzh-dropdown--has-focus .stzh-dropdown__label:not(:empty)::before{display:block}.stzh-dropdown--plain.stzh-dropdown--has-fixed-label .stzh-dropdown__label,.stzh-dropdown--plain.stzh-dropdown--is-filled .stzh-dropdown__label,.stzh-dropdown--plain.stzh-dropdown--is-disabled .stzh-dropdown__label,.stzh-dropdown--plain.stzh-dropdown--is-invalid .stzh-dropdown__label,.stzh-dropdown--plain.stzh-dropdown--has-focus .stzh-dropdown__label{left:0;padding:0;max-width:100%}.stzh-dropdown--has-no-search .ts-control>input{position:absolute;width:0px;height:0px}.stzh-dropdown--is-disabled .stzh-dropdown__select.multi .stzh-dropdown__item,.stzh-dropdown--is-disabled .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item .remove{cursor:not-allowed}.stzh-dropdown--is-disabled .stzh-dropdown__select.multi .stzh-dropdown__item,.stzh-dropdown--is-disabled .stzh-dropdown__select.multi .stzh-dropdown__item:hover{color:var(--stzh-color-grey25);background-color:var(--stzh-color-white);border-color:var(--stzh-base-border-color)}.stzh-dropdown--is-disabled .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item .remove,.stzh-dropdown--is-disabled .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item .remove:hover{color:var(--stzh-color-grey13);background-color:transparent}';const ae=function(t){const e=this;e.on("initialize",(()=>{const t=e.control_input;if(t)t.readOnly=true}))};const de="stzh-dropdown--is-filled";const he="stzh-dropdown--has-focus";Wt.define("remove_button",Gt);Wt.define("checkbox_options",re);Wt.define("input_autogrow",ie);Wt.define("no_backspace_delete",ne);Wt.define("input_readonly",ae);let ce=0;const pe=class{constructor(o){t(this,o);this.stzhChange=e(this,"stzhChange",7);this.stzhItemAdd=e(this,"stzhItemAdd",7);this.stzhItemRemove=e(this,"stzhItemRemove",7);this.stzhOptionAdd=e(this,"stzhOptionAdd",7);this.stzhOptionRemove=e(this,"stzhOptionRemove",7);this.stzhOpen=e(this,"stzhOpen",7);this.stzhClose=e(this,"stzhClose",7);this.stzhFocus=e(this,"stzhFocus",7);this.stzhBlur=e(this,"stzhBlur",7);this.stzhInit=e(this,"stzhInit",7);this.focusedByInput=false;this.onRootFocus=()=>{if(!this.focusedByInput){this.setFocus()}this.focusedByInput=false};this.options=undefined;this.optgroups=undefined;this.items=undefined;this.searchField=["text"];this.multiple=false;this.inline=false;this.maxOptions=null;this.searchConjunction="and";this.allowEmptyOption=false;this.openOnFocus=true;this.closeAfterSelect=null;this.load=null;this.minCharacters=3;this.loadThrottle=300;this.preload=false;this.labelField="text";this.valueField="value";this.optgroupField="optgroup";this.optgroupLabelField="label";this.optgroupValueField="value";this.lockOptgroupOrder=undefined;this.name="";this.open=false;this.isOpen=false;this.variant="default";this.size="default";this.disabled=false;this.popoverPlacement="bottom";this.label="";this.icon="";this.iconAngle="angle-down";this.noSearch=false;this.noBackspaceDelete=false;this.invalid=false;this.required=false;this.showMarker=false;this.description=undefined;this.descriptionLong=undefined;this.error=undefined;this.localization=undefined;this.a11yDescribedby=""}optionsWatcher(t){if(typeof t==="string"){this._options=JSON.parse(t)}else{this._options=t}}itemsWatcher(t){if(typeof t==="string"){this._items=JSON.parse(t)}else{this._items=t}}searchFieldWatcher(t){if(typeof t==="string"){this._searchField=JSON.parse(t)}else{this._searchField=t}}optgroupsWatcher(t){if(typeof t==="string"){this._optgroups=JSON.parse(t)}else{this._optgroups=t}}errorWatcher(t){if(typeof t==="string"){try{this._error=JSON.parse(t)}catch(e){if(t){this._error=[t]}else{this._error=[]}}}else if(t){this._error=t}else{this._error=[]}this.invalid=this._error.length>0}async getValue(){return this.tomSelect.getValue()}async setValue(t,e=false){this.tomSelect.setValue(t,e)}async setFocus(){this.tomSelect.focus()}async resetLoadedSearches(){this.tomSelect.loadedSearches={}}async getLoadedSearches(){return this.tomSelect.loadedSearches}async getItems(){return this.tomSelect.items}async loadItems(t){return this.tomSelect.load(t)}async show(){return this.tomSelect.open()}async hide(){return this.tomSelect.close()}updateFilled(){if(this._items.length>0){this.rootElement.classList.add(de)}else{this.rootElement.classList.remove(de)}}async componentWillLoad(){this.dropdownId=`stzh-dropdown-${ce++}`;this.optionsWatcher(this.options);this.optgroupsWatcher(this.optgroups);this.itemsWatcher(this.items);this.searchFieldWatcher(this.searchField);this.errorWatcher(this.error);if(!this.localization){this.localization=await n(this.element,"dropdown")}}componentShouldUpdate(t,e,o){return["isOpen"].includes(o)===false}async componentWillUpdate(){if(this.tomSelect){this.tomSelect.destroy();this.tomSelect=null}}async componentDidRender(){if(this.tomSelect){return}const t={};if(this.noSearch){t["input_readonly"]={}}else{t["input_autogrow"]={}}if(this.noBackspaceDelete){t["no_backspace_delete"]={}}if(this.multiple){t["checkbox_options"]={};t["remove_button"]={title:this.localization.removeButtonTitle,label:'<stzh-icon name="close" class="stzh-dropdown__remove-icon"></stzh-icon>'}}const e={plugins:t,maxItems:this.multiple?null:1,maxOptions:this.maxOptions,items:this._items,optgroups:this._optgroups,searchField:this._searchField,searchConjunction:this.searchConjunction,allowEmptyOption:this.allowEmptyOption,closeAfterSelect:this.closeAfterSelect!==null?this.closeAfterSelect:!this.multiple,labelField:this.labelField,valueField:this.valueField,optgroupField:this.optgroupField,optgroupLabelField:this.optgroupLabelField,optgroupValueField:this.optgroupValueField,lockOptgroupOrder:this.lockOptgroupOrder,load:this.load,shouldLoad:t=>t.length>=this.minCharacters,loadThrottle:this.loadThrottle,preload:this.preload,openOnFocus:this.openOnFocus,loadingClass:"is-loading",hideSelected:false,duplicates:false,delimiter:",",copyClassesToDropdown:false,hidePlaceholder:null,render:{option:(t,e)=>`\n <div class="stzh-dropdown__option">\n <stzh-icon name="checkmark" class="stzh-dropdown__option-check"></stzh-icon>\n <span class="stzh-dropdown__option-title">\n ${e(t[this.labelField])}\n </span>\n </div>\n `,item:(t,e)=>`\n <div class="stzh-dropdown__item">\n ${e(t[this.labelField])}\n </div>\n `,option_create:(t,e)=>`\n <div class="stzh-dropdown__create">\n ${this.localization.create.replace(/{x}/gi,e(t.input))}…\n </div>\n `,no_results:(t,e)=>`\n <div class="stzh-dropdown__no-results" id="${this.dropdownId}-no-results">\n ${this.localization.noResults.replace(/{x}/gi,e(t.input))}\n </div>`,not_loading:this.load===null?null:(t,e)=>`\n <div class="stzh-dropdown__not-loading" id="${this.dropdownId}-not-loading">\n ${this.localization.notLoading.replace(/{x}/gi,e(this.minCharacters.toString()))}\n </div>\n `,optgroup:t=>{let e=document.createElement("div");e.className="stzh-dropdown__optgroup";e.appendChild(t.options);return e},optgroup_header:(t,e)=>`\n <div class="stzh-dropdown__optgroup-header">\n ${e(t.label)}\n </div>\n `,loading:()=>`\n <div class="stzh-dropdown__loader">\n <stzh-loader></stzh-loader>\n </div>\n `,dropdown:()=>`<div class="stzh-dropdown__dropdown"></div>`},onChange:t=>{this._items=this.tomSelect.items;this.updateFilled();this.stzhChange.emit({component:"stzh-dropdown",value:t})},onItemAdd:t=>{this._items=this.tomSelect.items;this.stzhItemAdd.emit({component:"stzh-dropdown",value:t})},onItemRemove:t=>{this._items=this.tomSelect.items;this.stzhItemRemove.emit({component:"stzh-dropdown",value:t})},onOptionAdd:t=>{this._options=this.tomSelect.options;this.updateFilled();this.stzhOptionAdd.emit({component:"stzh-dropdown",value:t})},onOptionRemove:t=>{this._options=this.tomSelect.options;this.updateFilled();this.stzhOptionRemove.emit({component:"stzh-dropdown",value:t})},onDropdownOpen:()=>{this.isOpen=true;this.stzhOpen.emit({component:"stzh-dropdown"})},onDropdownClose:()=>{this.isOpen=false;this.stzhClose.emit({component:"stzh-dropdown"})},onFocus:()=>{this.focusedByInput=true;if(this.tomSelect.load&&this.preload==="focus"){this.resetLoadedSearches();if(this.tomSelect.wrapper.classList.contains("preloaded")){this.tomSelect.load("")}}this.rootElement.classList.add(he);const t=new FocusEvent("focus",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(t);this.stzhFocus.emit({component:"stzh-dropdown",originalEvent:{target:this.tomSelect.control}})},onBlur:()=>{this.rootElement.classList.remove(he);const t=new FocusEvent("blur",{view:window,bubbles:false,cancelable:false});this.element.dispatchEvent(t);this.stzhBlur.emit({component:"stzh-dropdown"})},onInitialize:()=>{this.stzhInit.emit({component:"stzh-dropdown"})},onLoad:()=>{this._options=this.tomSelect.options}};if(this._options){e.options=this._options}if(this._optgroups){e.optgroups=this._optgroups}if(this._items){e.items=this._items}this.tomSelect=new Wt(this.select,e);if(!this.openOnFocus){this.tomSelect.control.addEventListener("click",(()=>{this.tomSelect.open()}))}if(this.open){this.show()}}disconnectedCallback(){if(this.tomSelect){this.tomSelect.destroy();this.tomSelect=null}}render(){var t;const e=i(this.element,"icon")||!!this.icon;const s=i(this.element,"description")||!!this.description;const n=i(this.element,"description-long")||!!this.descriptionLong;const a=i(this.element,"error")||!!this.error;const d={"stzh-dropdown":true,"stzh-dropdown--is-inline":this.inline,"stzh-dropdown--is-multiple":this.multiple,"stzh-dropdown--is-disabled":this.disabled,"stzh-dropdown--is-required":this.required,"stzh-dropdown--is-invalid":this.invalid,[de]:this._items&&this._items.length>0,"stzh-dropdown--has-icon":e,"stzh-dropdown--has-description":s,"stzh-dropdown--has-description-long":n,"stzh-dropdown--has-error":a,"stzh-dropdown--has-no-search":this.noSearch,"stzh-dropdown--has-fixed-label":((t=window===null||window===void 0?void 0:window.stzhComponents)===null||t===void 0?void 0:t.labels)==="fixed",[`stzh-dropdown--popover-placement-${this.popoverPlacement}`]:!!this.popoverPlacement,[`stzh-dropdown--size-${this.size}`]:!!this.size,[`stzh-dropdown--${this.variant}`]:!!this.variant};return o(r,{tabindex:this.disabled?null:"-1",onFocus:this.onRootFocus},o("div",{class:d,ref:t=>this.rootElement=t},o("div",{class:"stzh-dropdown__field-wrapper"},o("select",{id:this.dropdownId,class:"stzh-dropdown__select",ref:t=>this.select=t,multiple:this.multiple,name:this.name,disabled:this.disabled,"aria-labelledby":`${this.dropdownId}-label ${this.dropdownId}-not-loading ${this.dropdownId}-no-results ${!this.showMarker&&this.required&&`${this.dropdownId}-required`} ${this.invalid&&`${this.dropdownId}-invalid`} ${this.dropdownId}-description ${this.a11yDescribedby}`},o("slot",null)),o("div",{class:"stzh-dropdown__icon-angle-wrapper"},this.iconAngle?o("stzh-icon",{name:this.iconAngle,class:"stzh-dropdown__icon-angle"}):o("slot",{name:"icon-angle"})),o("div",{class:"stzh-dropdown__icon-wrapper"},this.icon?o("stzh-icon",{class:"stzh-dropdown__icon",name:this.icon}):o("slot",{name:"icon"})),o("label",{id:`${this.dropdownId}-label`,class:"stzh-dropdown__label",htmlFor:this.dropdownId},this.label?this.label:o("slot",{name:"label"}),this.showMarker&&o("span",{class:"stzh-dropdown__marker"},o("span",{class:"stzh-dropdown__marker-symbol","aria-hidden":"true"},this.required?this.localization.$globals.requiredFieldMarker:this.localization.$globals.optionalFieldMarker),o("span",{class:"stzh-dropdown__marker-text"},this.required?this.localization.$globals.requiredFieldText:this.localization.$globals.optionalFieldText))),!this.showMarker&&this.required&&o("div",{id:`${this.dropdownId}-required`,class:"stzh-dropdown__vhidden"},this.localization.$globals.requiredFieldText),this.invalid&&o("div",{id:`${this.dropdownId}-invalid`,class:"stzh-dropdown__vhidden"},this.localization.$globals.invalidFieldText)),o(l,{classPrefix:"stzh-dropdown",id:`${this.dropdownId}-description`,error:this._error,description:this.description,descriptionLong:this.descriptionLong,descriptionLongUsed:n,moreInfoButtonLabel:this.localization.$globals.moreInfoButtonLabel})))}get element(){return s(this)}static get watchers(){return{options:["optionsWatcher"],items:["itemsWatcher"],searchField:["searchFieldWatcher"],optgroups:["optgroupsWatcher"],error:["errorWatcher"]}}};pe.style=le;export{pe as stzh_dropdown};
|
|
9
|
+
//# sourceMappingURL=p-c0f971f2.entry.js.map
|