@seznam/szn-select
Version:
Accessible HTML selectbox with customizable UI. Based on web components and easy to integrate with various frameworks like React or Angular.
1 lines • 47.2 kB
JavaScript
;(t=>{const e=t.SznElements=t.SznElements||{},n={LEFT:"HORIZONTAL_ALIGN.LEFT",RIGHT:"HORIZONTAL_ALIGN.RIGHT"},o={TOP:"VERTICAL_ALIGN.TOP",BOTTOM:"VERTICAL_ALIGN.BOTTOM"},s=["resize","scroll","wheel","touchmove"];Object.freeze&&(Object.freeze(n),Object.freeze(o));let i=null;e["szn-tethered"]=class{constructor(t){null===i&&(i="transform"in t.style),t.HORIZONTAL_ALIGN=n,t.VERTICAL_ALIGN=o,t.setTether=(t=>this.setTether(t)),t.updatePosition=(()=>this.updatePosition()),t.hasOwnProperty("horizontalAlign")||Object.defineProperty(t,"horizontalAlign",{get:()=>t._broker.horizontalAlignment}),t.hasOwnProperty("verticalAlignment")||Object.defineProperty(t,"verticalAlignment",{get:()=>t._broker.verticalAlignment}),t.hasOwnProperty("minBottomSpace")||Object.defineProperty(t,"minBottomSpace",{get:()=>t._broker.minBottomSpace,set:e=>{t._broker.minBottomSpace=e}}),t.onVerticalAlignmentChange=null,t.onHorizontalAlignmentChange=null,this.horizontalAlignment=n.LEFT,this.verticalAlignment=o.BOTTOM,this.minBottomSpace=160,this._root=t,this._tether=null,this._mounted=!1,this._lastHorizontalAlignment=null,this._lastVerticalAlignment=null,e.injectStyles("\n szn-tethered {\n display: block;\n\n position: absolute;\n left: 0;\n top: 0;\n\n width: 0;\n height: 0;\n\n transform: translate(0, 0);\n }\n\n szn-tethered > [data-szn-tethered--content] {\n position: absolute;\n left: 0;\n top: 0;\n }\n\n szn-tethered[data-horizontal-align='right'] > [data-szn-tethered--content] {\n left: auto;\n right: 0;\n }\n\n szn-tethered[data-vertical-align='top'] > [data-szn-tethered--content] {\n top: auto;\n bottom: 0;\n }\n ","szn-tethered")}onMount(){for(const t of s)addEventListener(t,this._root.updatePosition);this._mounted=!0,this.updatePosition()}onUnmount(){for(const t of s)removeEventListener(t,this._root.updatePosition);this._mounted=!1}setTether(t){t!==this._tether&&(this._tether=t,this.updatePosition())}updatePosition(){if(!this._mounted||!this._tether)return;const t=function(t){const e=t.getBoundingClientRect(),n=e.width,o=e.height;let s=0,i=0,r=t;for(;r;)s+=r.offsetLeft,i+=r.offsetTop,r=r.offsetParent;return{screenX:e.left,screenY:e.top,x:s,y:i,width:n,height:o}}(this._tether),e=function(t){const e=t._root.firstElementChild;if(!e)return{width:0,height:0};let n,o;if(window.devicePixelRatio>1){const t=e.getBoundingClientRect();n=t.width,o=t.height}else n=e.scrollWidth,o=e.scrollHeight;return{width:n,height:o}}(this),s=document.documentElement.clientWidth,r=Math.min(document.documentElement.clientHeight,window.innerHeight),l=this.horizontalAlignment,a=this.verticalAlignment;t.screenX+e.width>s&&t.screenX+t.width-e.width>=0?this.horizontalAlignment=n.RIGHT:this.horizontalAlignment=n.LEFT,r-(t.screenY+t.height)<this.minBottomSpace?this.verticalAlignment=o.TOP:this.verticalAlignment=o.BOTTOM,function(t){if(t.horizontalAlignment!==t._lastHorizontalAlignment){const e=t.horizontalAlignment===n.LEFT?"left":"right";t._root.setAttribute("data-horizontal-align",e),t._lastHorizontalAlignment=t.horizontalAlignment}if(t.verticalAlignment!==t._lastVerticalAlignment){const e=t.verticalAlignment===o.TOP?"top":"bottom";t._root.setAttribute("data-vertical-align",e),t._lastVerticalAlignment=t.verticalAlignment}}(this),function(t,e){const s=e.x+(t.horizontalAlignment===n.LEFT?0:e.width),r=e.y+(t.verticalAlignment===o.TOP?0:e.height);i?t._root.style.transform=`translate(${s}px, ${r}px)`:(t._root.style.left=`${s}px`,t._root.style.top=`${r}px`)}(this,t),this.horizontalAlignment!==l&&this._root.onHorizontalAlignmentChange&&this._root.onHorizontalAlignmentChange(this.horizontalAlignment),this.verticalAlignment!==a&&this._root.onVerticalAlignmentChange&&this._root.onVerticalAlignmentChange(this.verticalAlignment)}},e.init&&e.init()})(self),(t=>{const e=t.SznElements=t.SznElements||{},n={UP:"OPENING_POSITION.UP",DOWN:"OPENING_POSITION.DOWN"};function o(t){t._select&&t._select.addEventListener("change",t._onChange)}function s(t){t._select&&t._select.removeEventListener("change",t._onChange)}function i(t){t._select&&t._observer.observe(t._select,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeFilter:["disabled","selected"]})}function r(t){if(!t._select)return;const e=t._select.options.item(t._select.selectedIndex).text;t._label.innerText!==e&&(t._label.innerText=e)}function l(t){t._select&&(t._select.disabled?t._root.setAttribute("disabled",""):t._root.removeAttribute("disabled"))}Object.freeze&&Object.freeze(n),e["szn-select--button"]=class{constructor(t){this.OPENING_POSITION=n,this._root=t,this._select=null,this._label=null,this._observer=new MutationObserver(()=>{r(this),l(this)}),t.OPENING_POSITION=n,t.setSelectElement=this.setSelectElement.bind(this),t.setOpen=this.setOpen.bind(this),t.setOpeningPosition=this.setOpeningPosition.bind(this),this._onChange=function(t){r(t)}.bind(null,this),e.injectStyles('\nszn-select--button{display:block;position:relative;box-sizing:border-box;border:1px solid #ccc;border:var(--szn-select--button--border-width,1px) solid var(--szn-select--button--border-color,#ccc);border-radius:4px;border-radius:var(--szn-select--button--border-radius,4px);width:100%;height:100%;line-height:30px;line-height:calc(var(--szn-select--button--height-px, 32px) - 2 * var(--szn-select--button--border-width, 1px));line-height:calc(2em - 2 * 1px);line-height:calc(var(--szn-select--button--height, 2em) - 2 * var(--szn-select--button--border-width, 1px));color:#000;color:var(--szn-select--button--text-color,#000);background:#fff;background:var(--szn-select--button--background-color,#fff);cursor:pointer;user-select:none;-moz-user-select:none}szn-select--button[data-szn-select--button--open]{border-radius:4px 4px 0 0;border-radius:var(--szn-select--button--border-radius,4px) var(--szn-select--button--border-radius,4px) 0 0}szn-select--button[data-szn-select--button--open-at-top]{border-radius:0 0 4px 4px;border-radius:0 0 var(--szn-select--button--border-radius,4px) var(--szn-select--button--border-radius,4px)}szn-select--button[disabled]{color:#ccc;color:var(--szn-select--button--disabled-text-color,#ccc);cursor:default}szn-select--button [data-szn-select--button--label]{display:block;box-sizing:border-box;border-right:2em solid transparent;border-right:var(--szn-select--button--mark-width,2em) transparent solid;padding:0 5px 0 12px;padding:var(--szn-select--button--padding,0 5px 0 12px);width:100%;height:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}szn-select--button [data-szn-select--button--mark]{display:block;position:absolute;right:0;top:0;width:2em;width:var(--szn-select--button--mark-width,2em);height:100%;text-align:center}szn-select--button [data-szn-select--button--mark]:after{display:inline;content:"▼";content:var(--szn-select--button--icon-closed,"▼")}szn-select--button[data-szn-select--button--open] [data-szn-select--button--mark]:after{content:"▲";content:var(--szn-select--button--icon-opened,"▲")}\n ',"szn-select--button")}onMount(){i(this),o(this),r(this),l(this)}onUnmount(){this._observer.disconnect(),s(this)}setSelectElement(t){var n;t!==this._select&&(this._label||this._root.appendChild((n=this,e.buildDom("\n <szn- data-szn-select--button--label data-szn-ref></szn->\n <szn- data-szn-select--button--mark></szn->\n ",t=>{n._label=t},!1))),this._select&&(s(this),this._observer.disconnect()),this._select=t,i(this),o(this),r(this),l(this))}setOpen(t){t?this._root.setAttribute("data-szn-select--button--open",""):(this._root.removeAttribute("data-szn-select--button--open"),this._root.removeAttribute("data-szn-select--button--open-at-top"))}setOpeningPosition(t){t===n.UP?this._root.setAttribute("data-szn-select--button--open-at-top",""):this._root.removeAttribute("data-szn-select--button--open-at-top")}}})(self),(t=>{const e=t.SznElements=t.SznElements||{},n="\nszn-select--options{display:block;z-index:1;border:solid #ccc;border:solid var(--szn-select--options--border-color,#ccc);border-width:1px;border-width:var(--szn-select--options--border-width,1px);border-radius:0 0 4px 4px;border-radius:var(--szn-select--options--border-radius-dropdown,0 0 4px 4px);height:100%;box-sizing:border-box;white-space:nowrap;color:#000;color:var(--szn-select--options--text-color,#000);background:#fff;background:var(--szn-select--options--background-color,#fff);user-select:none;-moz-user-select:none}szn-select--options[data-szn-select--options--multiple]{border-radius:4px;border-radius:var(--szn-select--options--border-radius-mutli-select,4px)}szn-select--options [data-szn-select--options--option]{display:block;padding:5px 5px 5px 12px;padding:var(--szn-select--options--item-padding,5px 5px 5px 12px);overflow:auto;overflow-x:hidden;text-overflow:ellipsis;cursor:pointer}szn-select--options [data-szn-select--options--option][disabled],szn-select--options [disabled] [data-szn-select--options--option],szn-select--options[disabled] [data-szn-select-options--option]{cursor:default}szn-select--options [data-szn-select--options--selected]{background:#eee;background:var(--szn-select--options--selected-background,#eee)}szn-select--options [data-szn-select--options--optgroup]{display:block}szn-select--options [data-szn-select--options--optgroup] [data-szn-select--options--option]{padding-left:24px;padding-left:calc(2 * var(--szn-select--options--item-indent, 12px))}szn-select--options [data-szn-select--options--optgroup-label]:before{display:block;padding:5px 5px 5px 12px;padding:var(--szn-select--options--item-padding,5px 5px 5px 12px);content:attr(data-szn-select--options--optgroup-label);font-weight:700}szn-select--options[data-szn-select--options--highlighting] [data-szn-select-options--selected]{background:none}szn-select--options[data-szn-select--options--highlighting] [data-szn-select--options--highlighted]{background:#eee;background:var(--szn-select--options--selected-background,#eee)}szn-select--options[disabled],szn-select--options [disabled]{color:#ccc;color:var(--szn-select--options--disabled-text,#ccc)}szn-tethered[data-vertical-align=top] szn-select--options{border-radius:4px 4px 0 0;border-radius:var(--szn-select--options--border-radius-dropup,4px 4px 0 0)}\n ";function o(t){t._mounted&&t._options&&t._observer.observe(t._options,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeFilter:["disabled","label","selected","title","multiple"]})}function s(t){t._mounted&&t._options&&(t._options.addEventListener("change",t._onSelectionChange),t._root.addEventListener("mouseover",t._onItemHovered),t._root.addEventListener("mousedown",t._onItemSelectionStart),t._root.addEventListener("mouseup",t._onItemClicked),t._root.addEventListener("touchstart",t._onTouchStart),addEventListener("mouseup",t._onSelectionEnd),addEventListener("touchend",t._onTouchEnd))}function i(t){t._options&&t._options.removeEventListener("change",t._onSelectionChange),t._root.removeEventListener("mouseover",t._onItemHovered),t._root.removeEventListener("mousedown",t._onItemSelectionStart),t._root.removeEventListener("mouseup",t._onItemClicked),t._root.removeEventListener("touchstart",t._onTouchStart),removeEventListener("mouseup",t._onSelectionEnd),removeEventListener("touchend",t._onTouchEnd)}function r(t,e,n){const o=t._lastSelectionIndexes;if(-1!==e&&(e!==o.start||n!==o.end)){!function(t,e){const n=t._root;if(n.clientHeight>=n.scrollHeight)return;const o=n.getBoundingClientRect(),s=t._root.querySelectorAll("[data-szn-select--options--option]")[e].getBoundingClientRect();if(s.top>=o.top&&s.bottom<=o.bottom)return;const i=s.top<o.top?s.top-o.top:s.bottom-o.bottom;n.scrollTop+=i}(t,e!==o.start?e:n)}o.start=e,o.end=n}function l(t,e){const n=t._dragSelectionStartOption.index,o=e._option.index,s=Math.min(n,o),i=Math.max(n,o),r=t._options.options,l=t._additionalSelectedIndexes;for(let e=0,n=r.length;e<n;e++){const n=r.item(e);if(d(n)){let o=l.indexOf(e)>-1;e>=s&&e<=i&&(o=!t._invertSelection),n.selected=o}}t._options.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))}function a(t){return t.hasAttribute("data-szn-select--options--option")&&d(t._option)}function d(t){return!t.disabled&&!t.parentNode.disabled}function c(t){if(t._options&&(t._options.disabled?t._root.setAttribute("disabled",""):t._root.removeAttribute("disabled"),t._options.multiple?t._root.setAttribute("data-szn-select--options--multiple",""):t._root.removeAttribute("data-szn-select--options--multiple"),u(t._root,t._options),t._mounted)){const e=t._options.options;let n=-1;for(let t=e.length-1;t>=0;t--)if(e.item(t).selected){n=t;break}r(t,t._options.selectedIndex,n)}}function u(t,e){!function(t,e){const n=Array.prototype.slice.call(e.children);let o=t.firstElementChild;for(;o;){if(n.indexOf(o._option)>-1){o=o.nextElementSibling;continue}const e=o;o=o.nextElementSibling,t.removeChild(e)}}(t,e),function(t){let e=t.firstElementChild;for(;e;)h(e),e=e.nextElementSibling}(t),function(t,e){let n=t.firstElementChild,o=e.firstElementChild;for(;o;){if(n&&n._option===o)n=n&&n.nextElementSibling;else{const e=document.createElement("szn-");e._option=o,e.setAttribute("data-szn-select--options--"+("OPTGROUP"===o.tagName?"optgroup":"option"),""),h(e),t.insertBefore(e,n)}o=o.nextElementSibling}}(t,e)}function h(t){const e=t._option;if(e.disabled?t.setAttribute("disabled",""):t.removeAttribute("disabled"),"OPTGROUP"===e.tagName)return u(t,e),void t.setAttribute("data-szn-select--options--optgroup-label",e.label);t.innerText=e.text,e.title?t.setAttribute("title",e.title):t.removeAttribute("title"),e.selected?t.setAttribute("data-szn-select--options--selected",""):t.removeAttribute("data-szn-select--options--selected")}e["szn-select--options"]=class{constructor(t){t.setOptions=(t=>this.setOptions(t)),t.updateUi=(()=>c(this)),this._root=t,this._options=null,this._dragSelectionStartOption=null,this._mounted=!1,this._observer=new MutationObserver(t.updateUi),this._lastSelectionIndexes={start:-1,end:-1},this._additionalSelectedIndexes=[],this._invertSelection=!1,this._previousSelectionStartIndex=-1,this._observedTouchId=null,this._onItemHovered=(t=>(function(t,e){if(t._options.disabled||!a(e))return;if(t._options.multiple)return void(t._dragSelectionStartOption&&l(t,e));t._root.setAttribute("data-szn-select--options--highlighting","");const n=t._root.querySelector("[data-szn-select--options--highlighted]");n&&n.removeAttribute("data-szn-select--options--highlighted"),e.setAttribute("data-szn-select--options--highlighted","")})(this,t.target)),this._onItemClicked=(t=>(function(t,e){t._dragSelectionStartOption?t._dragSelectionStartOption=null:!t._options.disabled&&a(e)&&(t._root.removeAttribute("data-szn-select--options--highlighting"),t._options.selectedIndex=e._option.index,t._options.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0})))})(this,t.target)),this._onItemSelectionStart=(t=>(function(t,e,n){if(t._options.disabled||!t._options.multiple||!a(e))return;const o=t._options.options;if(n.shiftKey&&t._previousSelectionStartIndex>-1)t._dragSelectionStartOption=o.item(t._previousSelectionStartIndex);else{if(n.ctrlKey){t._additionalSelectedIndexes=[];for(let e=0,n=o.length;e<n;e++)o.item(e).selected&&t._additionalSelectedIndexes.push(e);t._invertSelection=e._option.selected}else t._invertSelection=!1;t._dragSelectionStartOption=e._option}t._previousSelectionStartIndex=t._dragSelectionStartOption.index,l(t,e)})(this,t.target,t)),this._onTouchStart=function(t,e){if(t._observedTouchId)return;const n=e.changedTouches[0];t._observedTouchId=n.identifier}.bind(null,this),this._onTouchEnd=function(t,e){if(!t._options.multiple)return;if(!Array.from(e.changedTouches).find(e=>e.identifier===t._observedTouchId))return;t._observedTouchId=null,e.preventDefault();const n=e.target._option;d(n)&&(n.selected=!n.selected,t._options.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0})))}.bind(null,this),this._onSelectionEnd=(()=>{this._dragSelectionStartOption=null,this._additionalSelectedIndexes=[]}),this._onSelectionChange=(()=>{this._root.removeAttribute("data-szn-select--options--highlighting"),c(this)}),e.injectStyles(n,"szn-options")}onMount(){this._mounted=!0,s(this),c(this),o(this),this._options&&r(this,this._options.selectedIndex,this._options.selectedIndex)}onUnmount(){i(this),this._root.removeAttribute("data-szn-select--options--highlighting"),this._mounted=!1,this._observer.disconnect()}setOptions(t){if(t===this._options)return;this._options&&(i(this),this._observer.disconnect()),this._options=t,s(this),c(this),o(this);const e="number"==typeof t.selectedIndex?t.selectedIndex:-1;this._previousSelectionStartIndex=e,this._mounted&&r(this,e,e)}}})(self),(t=>{const e=t.SznElements=t.SznElements||{},n=["mousedown","click","touchstart"],o=["resize","scroll","wheel","touchmove"],s=document.body;function i(t){if(!t._dropdown||!t._dropdown._broker||!t._dropdownOptions._broker||t._dropdownContainer!==s)return;const e=t._dropdownOptions.scrollHeight,n=getComputedStyle(t._dropdownOptions),o=e+parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10),i=t._dropdownContent.getBoundingClientRect(),r=t._dropdown.verticalAlignment===t._dropdown.VERTICAL_ALIGN.TOP,l=Math.min(document.documentElement.clientHeight,window.innerHeight),a=r?Math.min(o,i.bottom):Math.min(o,l-i.top);a!==(i.height||i.bottom-i.top)&&(t._dropdownContent.style.height=`${a}px`)}function r(t,e){const n=e===t._dropdown.VERTICAL_ALIGN.TOP;if(t._dropdownPosition=e,t._button&&t._button._broker){const{OPENING_POSITION:e}=t._button;t._button.setOpeningPosition(n?e.UP:e.DOWN)}i(t)}function l(t){!function(t){t._root.innerHTML="",t._dropdownContent.innerHTML="",t._dropdown&&t._dropdown.parentNode&&t._dropdown.parentNode.removeChild(t._dropdown);t._button=null,t._dropdown=null,t._dropdownPosition=null,t._dropdownOptions=null}(t),t._select&&(t._select.multiple?function(t){const n=t._select,o=document.createElement("szn-select--options");t._root.appendChild(o),e.awaitElementReady(o,()=>o.setOptions(n))}(t):function(t){(function(t){const n=document.createElement("szn-select--button");e.awaitElementReady(n,()=>{t._button===n&&(t._button.setSelectElement(t._select),t._dropdown.parentNode&&t._dropdownContainer===s&&t._button.setOpen(!0),t._dropdownPosition&&r(t,t._dropdownPosition))}),t._button=n,t._root.appendChild(n)})(t),t._dropdownOptions=document.createElement("szn-select--options"),t._dropdownOptions.className=t._dropdownClassName,t._dropdown=a(t),t._dropdown.appendChild(t._dropdownContent),t._dropdownContent.appendChild(t._dropdownOptions)}(t))}function a(t){if(t._dropdownContainer===s){for(const e of n)t._dropdownContent.addEventListener(e,t._onUiInteracted);return document.createElement("szn-tethered")}for(const e of n)t._dropdownContainer.addEventListener(e,t._onUiInteracted);const o=e.buildDom("<szn- data-szn-select--dropdown></szn->");return o._broker={},o}function d(t,e,n){t._dropdownContainer===s&&e.setTether(t._root),n.setOptions(t._select),e.minBottomSpace=t._minBottomSpace,e.onVerticalAlignmentChange=t._onDropdownPositionChange,t._dropdownContainer===s&&t._onDropdownPositionChange(e.verticalAlignment),i(t)}e["szn-select--ui"]=class{constructor(t){t.hasOwnProperty("minBottomSpace")||Object.defineProperty(t,"minBottomSpace",{get:()=>t._broker._minBottomSpace,set:e=>{t._broker._dropdown&&t._broker._dropdown._broker&&(t._broker._dropdown.minBottomSpace=e),t._broker._minBottomSpace=e}}),t.hasOwnProperty("dropdownClassName")||Object.defineProperty(t,"dropdownClassName",{get:()=>t._broker._dropdownClassName,set:e=>{const n=t._broker;n._dropdownClassName=e,n._dropdownOptions&&n._select&&!n._select.multiple&&(n._dropdownOptions.className=e)}}),t.hasOwnProperty("dropdownContainer")||Object.defineProperty(t,"dropdownContainer",{get:()=>t._broker._dropdownContainer,set:e=>{if("function"==typeof Node&&!(e instanceof Node))throw new TypeError("The provided dropdown container is not a DOM node: "+e);const n=t._broker;if(!n||e===n._dropdownContainer)return;const o=[n._dropdownContainer,e].includes(s);n._dropdownContainer=e,n._dropdown&&n._dropdown.parentNode&&(o?(n._dropdown=a(n),e.appendChild(n._dropdown),e===s?r(n,n._dropdown.verticalAlignment):n._dropdownContent.style.height=""):e.appendChild(n._dropdown))}}),t.setSelectElement=this.setSelectElement.bind(this),t.setFocus=this.setFocus.bind(this),t.setOpen=this.setOpen.bind(this),t.onUiInteracted=t.onUiInteracted||null,this._root=t,this._select=null,this._button=null,this._dropdown=null,this._dropdownClassName="",this._dropdownPosition=null,this._dropdownContent=e.buildDom("<szn- data-szn-select--ui--dropdown data-szn-tethered--content></szn->"),this._dropdownOptions=null,this._dropdownContainer=s,this._minBottomSpace=160,this._observer=new MutationObserver(function(t){const e=t._select;e&&(e.multiple&&t._button||!e.multiple&&!t._button)&&l(t)}.bind(this)),this._onDropdownPositionChange=r.bind(null,this),this._onDropdownSizeUpdateNeeded=i.bind(null,this),this._onUiInteracted=function(t,e){t._root.onUiInteracted&&t._root.onUiInteracted(e)}.bind(null,this),e.injectStyles("\nszn-select--ui{display:inline-block;width:100%;height:100%}szn-select--ui[data-szn-select--ui--active] szn-select--button,szn-select--ui[data-szn-select--ui--active] szn-select--options{border-color:#7dbfff;border-color:var(--szn-select--ui--active-border-color,#7dbfff);box-shadow:0 0 3px rgba(0,132,255,.4);box-shadow:var(--szn-select--ui--active-box-shadow,0 0 3px rgba(0,132,255,.4))}body>szn-tethered>[data-szn-select--ui--dropdown]{display:block;top:-1px;top:var(--szn-select--ui--dropdown-offset,-1px);min-width:109px;min-width:var(--szn-select--ui--dropdown-min-width,109px)}body>szn-tethered[data-vertical-align=top]>[data-szn-select--ui--dropdown]{bottom:-1px;bottom:var(--szn-select--ui--dropdown-offset,-1px)}\n ","szn-select--ui")}onMount(){this._root.setAttribute("aria-hidden","true"),function(t){for(const e of n)t._root.addEventListener(e,t._onUiInteracted);for(const e of o)addEventListener(e,t._onDropdownSizeUpdateNeeded)}(this),this._observer.observe(this._root,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeFilter:["disabled","multiple","selected"]})}onUnmount(){this._dropdown&&this._dropdown.parentNode&&this._dropdown.parentNode.removeChild(this._dropdown),function(t){for(const e of n)t._root.removeEventListener(e,t._onUiInteracted),t._dropdownContent.removeEventListener(e,t._onUiInteracted),t._dropdownContainer.removeEventListener(e,t._onUiInteracted);for(const e of o)removeEventListener(e,t._onDropdownSizeUpdateNeeded)}(this),this._observer.disconnect()}setSelectElement(t){t!==this._select&&(this._select=t,l(this))}setOpen(t){if(!this._select.multiple&&!this._select.disabled)if(t){this._button._broker&&this._button.setOpen(!0),this._dropdownContainer.appendChild(this._dropdown);let t=!1,n=!1;e.awaitElementReady(this._dropdown,()=>{t=!0,n&&d(this,this._dropdown,this._dropdownOptions)}),e.awaitElementReady(this._dropdownOptions,()=>{n=!0,t&&d(this,this._dropdown,this._dropdownOptions)})}else{if(!this._dropdown.parentNode)return;this._button._broker&&this._button.setOpen(!1),this._dropdown.parentNode.removeChild(this._dropdown)}}setFocus(t){t?this._root.setAttribute("data-szn-select--ui--active",""):this._root.removeAttribute("data-szn-select--ui--active")}}})(self),(t=>{const e=t.SznElements=t.SznElements||{};function n(){return/ MSIE \d/.test(navigator.userAgent)?"complete"===document.readyState:"loading"!==document.readyState}function o(t){if(t._accessiblityBroker&&t._accessiblityBroker.onUnmount(),!t._mounted)return;const e=function(t){for(const e of i.implementations)if(e.compatibilityTest(t))return e;throw new Error("There is no compatible accessibility broker implementation for the provided select element")}(t._select);t._accessiblityBroker&&t._accessiblityBroker.constructor===e||(t._accessiblityBroker=new e(t._select,t._ui,t),s(t),t._accessiblityBroker.onMount())}function s(t){const e={};for(const n of Object.keys(t._lastMetaAttributes))e[n]=null;e["data-szn-select--ready"]="",e["data-szn-select--single"]=t._select.multiple?null:"";const n=t._accessiblityBroker.generateMetaAttributes(e);t._root.hasAttribute("data-szn-select--standalone")?function(t,e){for(const n of Object.keys(e))null===e[n]?t.removeAttribute(n):t.setAttribute(n,e[n])}(t._root,n):(t._root.dispatchEvent(new CustomEvent("szn-select:ready",{bubbles:!0,cancelable:!0,detail:{attributes:n}})),t._root.requestedAttributes=n,t._root.isReady=!0),t._lastMetaAttributes=n}e["szn-select"]=class{constructor(t){t.hasOwnProperty("minBottomSpace")||Object.defineProperty(t,"minBottomSpace",{get:()=>t._broker._minBottomSpace,set:e=>{t._broker&&t._broker._ui._broker&&(t._broker._ui.minBottomSpace=e),t._broker._minBottomSpace=e}}),t.hasOwnProperty("dropdownClassName")||Object.defineProperty(t,"dropdownClassName",{get:()=>t._broker._ui.dropdownClassName||"",set:e=>{t._broker&&t._broker._ui._broker&&(t._broker._ui.dropdownClassName=e)}}),t.hasOwnProperty("dropdownContainer")||Object.defineProperty(t,"dropdownContainer",{get:()=>t._broker._ui.dropdownContainer||"",set:e=>{t._broker&&t._broker._ui._broker&&(t._broker._ui.dropdownContainer=e)}}),this.isOpen=!1,this._root=t,this._select=t.querySelector("select"),this._uiContainer=null,this._ui=document.createElement("szn-select--ui"),this._minBottomSpace=160,this._accessiblityBroker=null,this._mounted=!1,this._selectAttributesObserver=new MutationObserver(o.bind(null,this)),this._lastMetaAttributes={},this._onUiClicked=function(t,e){t._accessiblityBroker.onUiClicked(e)}.bind(null,this),this._onChange=function(t){t._accessiblityBroker.onChange()}.bind(null,this),e.injectStyles('\n:root{--szn-select--border-width:1px;--szn-select--border-color:#ccc;--szn-select--active-border-color:#7dbfff;--szn-select--border-radius:4px;--szn-select--min-width:109px;--szn-select--height:2em;--szn-select--height-px:32px;--szn-select--option-indent:12px;--szn-select--option-padding:5px 5px 5px 12px;--szn-select--option-padding:5px 5px 5px var(--szn-select--option-indent);--szn-select--selected-option-background:#eee;--szn-select--button-padding:0 5px 0 12px;--szn-select--button-padding:0 5px 0 var(--szn-select--option-indent);--szn-select--state-arrow-width:2em;--szn-select--state-arrow-width:var(--szn-select--height);--szn-select--state-arrow-closed:"▼";--szn-select--state-arrow-opened:"▲";--szn-select--text-color:#000;--szn-select--disabled-text-color:#ccc;--szn-select--background:#fff;--szn-select--active-box-shadow:0 0 3px rgba(0,132,255,.4)}szn-select{display:inline-block;position:relative}szn-select,szn-tethered [data-szn-select--ui--dropdown]{--szn-select--button--border-width:1px;--szn-select--button--border-width:var(--szn-select--border-width);--szn-select--button--border-color:#ccc;--szn-select--button--border-color:var(--szn-select--border-color);--szn-select--button--border-radius:4px;--szn-select--button--border-radius:var(--szn-select--border-radius);--szn-select--button--padding:0 5px 0 12px;--szn-select--button--padding:var(--szn-select--button-padding);--szn-select--button--height:2em;--szn-select--button--height:var(--szn-select--height);--szn-select--button--height-px:32px;--szn-select--button--height-px:var(--szn-select--height-px);--szn-select--button--text-color:#000;--szn-select--button--text-color:var(--szn-select--text-color);--szn-select--button--disabled-text-color:#ccc;--szn-select--button--disabled-text-color:var(--szn-select--disabled-text-color);--szn-select--button--mark-width:2em;--szn-select--button--mark-width:var(--szn-select--state-arrow-width);--szn-select--button--background-color:#fff;--szn-select--button--background-color:var(--szn-select--background);--szn-select--button--icon-closed:"▼";--szn-select--button--icon-closed:var(--szn-select--state-arrow-closed);--szn-select--button--icon-opened:"▲";--szn-select--button--icon-opened:var(--szn-select--state-arrow-opened);--szn-select--options--border-width:1px;--szn-select--options--border-width:var(--szn-select--border-width);--szn-select--options--border-color:#ccc;--szn-select--options--border-color:var(--szn-select--border-color);--szn-select--options--border-radius-dropdown:0 0 4px 4px;--szn-select--options--border-radius-dropdown:0 0 var(--szn-select--border-radius) var(--szn-select--border-radius);--szn-select--options--border-radius-dropup:4px 4px 0 0;--szn-select--options--border-radius-dropup:var(--szn-select--border-radius) var(--szn-select--border-radius) 0 0;--szn-select--options--border-radius-mutli-select:4px;--szn-select--options--border-radius-mutli-select:var(--szn-select--border-radius);--szn-select--options--item-padding:5px 5px 5px 12px;--szn-select--options--item-padding:var(--szn-select--option-padding);--szn-select--options--item-indent:12px;--szn-select--options--item-indent:var(--szn-select--option-indent);--szn-select--options--text-color:#000;--szn-select--options--text-color:var(--szn-select--text-color);--szn-select--options--disabled-text:#ccc;--szn-select--options--disabled-text:var(--szn-select--disabled-text-color);--szn-select--options--background-color:#fff;--szn-select--options--background-color:var(--szn-select--background);--szn-select--options--selected-background:#eee;--szn-select--options--selected-background:var(--szn-select--selected-option-background);--szn-select--ui--active-border-color:#7dbfff;--szn-select--ui--active-border-color:var(--szn-select--active-border-color);--szn-select--ui--active-box-shadow:0 0 3px rgba(0,132,255,.4);--szn-select--ui--active-box-shadow:var(--szn-select--active-box-shadow);--szn-select--ui--dropdown-offset:-1px;--szn-select--ui--dropdown-offset:calc(-1 * var(--szn-select--border-width));--szn-select--ui--dropdown-min-width:109px;--szn-select--ui--dropdown-min-width:var(--szn-select--min-width)}szn-select[data-szn-select--ready] select{position:fixed;right:999999px;right:1000vw}szn-select[data-szn-select--single]{min-width:109px;min-width:var(--szn-select--min-width);height:2em;height:var(--szn-select--height)}szn-select [data-szn-select--ui]{display:none;position:relative;width:100%;height:100%}szn-select[data-szn-select--ready] [data-szn-select--ui]{display:block}szn-select[data-szn-select--touch-only] select{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1;min-width:0;width:100%;height:100%;opacity:0}szn-select[data-szn-select--vanilla-aria] select{display:none}szn-select[data-szn-select--vanilla-aria] szn-select--ui{position:relative}szn-select[data-szn-select--vanilla-aria] ul[aria-hidden=true]{display:none}szn-select[data-szn-select--vanilla-aria] [data-szn-select--vanilla-aria-button],szn-select[data-szn-select--vanilla-aria] [data-szn-select--vanilla-aria-dropdown]{position:absolute;left:0;top:0;box-sizing:border-box;width:100%;height:100%;overflow:hidden;opacity:0}\n ',"szn-select"),this._ui.onUiInteracted=(t=>{this._accessiblityBroker&&this._accessiblityBroker.onUiClicked(t)})}onMount(){if(this._mounted=!0,this._uiContainer||(this._uiContainer=this._root.querySelector("[data-szn-select--ui]")),this._select||(this._select=this._root.querySelector("select")),this._uiContainer&&this._select)!function(t){if(!t._mounted)return;t._ui.parentNode||t._uiContainer.appendChild(t._ui);t._selectAttributesObserver.observe(t._select,{attributes:!0,attributeFilter:["disabled","multiple"]}),e.awaitElementReady(t._ui,()=>{t._mounted&&(t._ui.minBottomSpace=t._minBottomSpace,t._ui.setSelectElement(t._select),o(t),function(t){t._uiContainer.addEventListener("click",t._onUiClicked),t._select.addEventListener("change",t._onChange)}(t),s(t))})}(this);else{if(n())return void console.error("The szn-select element requires a select element and another element with the data-szn-select--ui attribute to be in its children, but at least one of these is missing",this._root);const t=()=>{n()&&(document.removeEventListener("readystatechange",t),this._mounted&&this.onMount())};document.addEventListener("readystatechange",t)}}onUnmount(){var t;this._mounted=!1,this._selectAttributesObserver.disconnect(),this._accessiblityBroker&&(this._accessiblityBroker.onUnmount(),this._accessiblityBroker=null),(t=this)._uiContainer.removeEventListener("click",t._onUiClicked),t._select.removeEventListener("change",t._onChange)}};class i{constructor(t,e,n){this.select=t,this.sznSelect=n,this.ui=e}setOpen(t){this.sznSelect.isOpen=t,this.ui.setOpen(t)}generateMetaAttributes(t){return t}onMount(){}onUnmount(){}onUiClicked(t){}onChange(){}}i.compatibilityTest=(()=>{throw new TypeError("The compatibility test is not implemented for this accessibility implementation")});class r extends i{}r.compatibilityTest=(t=>t.disabled);class l extends i{constructor(t,e,n){super(t,e,n),this._onFocus=this.onFocus.bind(this),this._onBlur=this.onBlur.bind(this),this._blurTimeout=null}generateMetaAttributes(t){return/(?:\(iP(?:ad|hone|od(?: touch)?);| Android )/.test(navigator.userAgent)?Object.assign({},t,{"data-szn-select--touch-only":/\(iP(?:ad|hone|od(?: touch)?);/.test(navigator.userAgent)?"ios":""}):Object.assign({},t,{role:"application"})}onMount(){super.onMount(),this.select.addEventListener("focus",this._onFocus),this.select.addEventListener("blur",this._onBlur)}onUnmount(){super.onUnmount(),this.select.removeEventListener("focus",this._onFocus),this.select.removeEventListener("blur",this._onBlur)}onUiClicked(t){document.activeElement!==this.select&&this.select.focus(),setTimeout(()=>{this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=null),document.activeElement!==this.select&&this.select.focus()},0)}onFocus(){this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=null),this.ui.setFocus(!0)}onBlur(){this._blurTimeout&&clearTimeout(this._blurTimeout),this._blurTimeout=setTimeout(()=>{this.ui.setFocus(!1)},1e3/30)}}l.compatibilityTest=(t=>!t.disabled&&t.multiple);class a extends i{constructor(t,e,n){super(t,e,n),this._onFocus=this.onFocus.bind(this),this._onBlur=this.onBlur.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onCloseDropdown=this.onCloseDropdown.bind(this),this._blurTimeout=null}generateMetaAttributes(t){return/(?:\(iP(?:ad|hone|od(?: touch)?);| Android )/.test(navigator.userAgent)?Object.assign({},t,{"data-szn-select--touch-only":""}):Object.assign({},t,{role:"application"})}onMount(){super.onMount(),this._addEventListeners()}onUnmount(){super.onUnmount(),this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=null),this._removeEventListeners()}onFocus(){this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=null),this.ui.setFocus(!0)}onBlur(){this._blurTimeout&&clearTimeout(this._blurTimeout),this._blurTimeout=setTimeout(()=>{this.ui.setFocus(!1),this.onCloseDropdown()},1e3/30)}onUiClicked(t){switch(super.onUiClicked(t),document.activeElement!==this.select&&this.select.focus(),t.type){case"click":t.stopPropagation(),this.ui.contains(t.target)?t.preventDefault():this.setOpen(!1);break;case"mousedown":this.sznSelect.isOpen?this.ui.contains(t.target)&&this.setOpen(!1):this.setOpen(!0)}setTimeout(()=>{this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=null),document.activeElement!==this.select&&this.select.focus()},0)}onKeyDown(t){let e=!1;switch(t.keyCode){case 27:e=this.sznSelect.isOpen;break;case 38:case 40:e=t.altKey;break;case 32:e=!this.sznSelect.isOpen;break;case 13:e=!0}e&&this.setOpen(!this.sznSelect.isOpen)}onCloseDropdown(){this.sznSelect.isOpen&&this.setOpen(!1)}_addEventListeners(){this.select.addEventListener("focus",this._onFocus),this.select.addEventListener("blur",this._onBlur),this.select.addEventListener("keydown",this._onKeyDown),addEventListener("click",this._onCloseDropdown)}_removeEventListeners(){this.select.removeEventListener("focus",this._onFocus),this.select.removeEventListener("blur",this._onBlur),this.select.removeEventListener("keydown",this._onKeyDown),removeEventListener("click",this._onCloseDropdown)}}a.compatibilityTest=(t=>!t.disabled&&!t.multiple&&(/(?:\(iP(?:ad|hone|od(?: touch)?);| Android )/.test(navigator.userAgent)||!/(?: Firefox\/| Mac OS X )/.test(navigator.userAgent)));class d extends i{constructor(t,e,n){super(t,e,n),this._instanceId=this._generateInstanceId();const[o,s]=this._createA11yUI();this._uiContainer=e.parentNode,this._a11yButton=o,this._a11yMenu=s,this._selectObserver=new MutationObserver(()=>{this._updateA11yMenu(),this._updateA11yButton()}),this._blurTimeout=null,this._lastOptionId=0,this._typedText="",this._typingTimeout=null,this._onFocus=this.onFocus.bind(this),this._onBlur=this.onBlur.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onMouseUp=this.onMouseUp.bind(this),this._onClick=this.onClick.bind(this)}setOpen(t){super.setOpen(t),this._a11yButton.setAttribute("aria-expanded",`${t}`),this._a11yButton.setAttribute("aria-disabled",`${!t}`),this._a11yMenu.firstElementChild.setAttribute("aria-hidden",`${!t}`)}generateMetaAttributes(t){return Object.assign({},t,{"data-szn-select--vanilla-aria":""})}onMount(){this._updateA11yMenu(),this._updateA11yButton(),this._uiContainer.insertBefore(this._a11yButton,this._uiContainer.firstChild),this._uiContainer.insertBefore(this._a11yMenu,this._a11yButton.nextSibling),this._selectObserver.observe(this.select,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeFilter:["disabled","selected","title"]}),this._addEventListeners()}onUnmount(){this._uiContainer.removeChild(this._a11yButton),this._uiContainer.removeChild(this._a11yMenu),this._removeEventListeners(),this._selectObserver.disconnect(),this._typingTimeout&&(clearTimeout(this._typingTimeout),this._typingTimeout=null)}onUiClicked(t){switch(super.onUiClicked(t),document.activeElement!==this._a11yButton&&this._a11yButton.focus(),t.type){case"click":t.stopPropagation(),this.ui.contains(t.target)||this.setOpen(!1);break;case"mousedown":this.sznSelect.isOpen?this.ui.contains(t.target)&&this.setOpen(!1):this.setOpen(!0)}setTimeout(()=>{this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=null),document.activeElement!==this.select&&this.select.focus()},0)}onMouseUp(t){this.ui.contains(t.target)||this.setOpen(!1)}onChange(){this._updateA11yButton(),document.activeElement!==this._a11yButton&&this._a11yButton.focus()}onFocus(){this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=null),this.ui.setFocus(!0)}onBlur(){this._blurTimeout&&clearTimeout(this._blurTimeout),this._blurTimeout=setTimeout(()=>{this.ui.setFocus(!1),this.setOpen(!1)},1e3/30)}onKeyDown(t){const e=Array.from(this.select.options).filter(t=>!t.disabled&&!t.parentNode.disabled),n=e.findIndex(t=>t.selected),{isOpen:o}=this.sznSelect;let s=null;switch(t.keyCode){case 38:case 40:if(t.preventDefault(),t.altKey){this.setOpen(!o);break}s=e[n+(38===t.keyCode?-1:1)];break;case 13:t.preventDefault(),this.setOpen(!o);break;case 32:t.preventDefault(),o||this.setOpen(!0);break;case 27:t.preventDefault(),this.setOpen(!1);break;case 33:case 34:t.preventDefault(),s=e[33===t.keyCode?Math.max(0,n-(o?10:1)):Math.min(e.length-1,n+(o?10:1))];break;case 36:t.preventDefault(),s=e[0];break;case 35:t.preventDefault(),s=e[e.length-1]}if(!t.altKey&&!t.ctrlKey&&!t.metaKey&&1===t.key.length){this._typingTimeout&&clearTimeout(this._typingTimeout),this._typedText+=t.key.toLowerCase();for(const t of e)if(t.text.toLowerCase().substring(0,this._typedText.length)===this._typedText){s=t;break}if((!s||s===e[n])&&/ Firefox\//.test(navigator.userAgent)){const t=d.transliterate(this._typedText);for(const n of e){if(d.transliterate(n.text).toLowerCase().substring(0,t.length)===t){s=n;break}}}this._typingTimeout=setTimeout(()=>{this._typingTimeout=null,this._typedText=""},d.TYPING_TIMEOUT)}s&&s!==e[n]&&(s.selected=!0,this.select.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0})))}onClick(t){const e=t.target.closest("label");if(e){if(e.htmlFor){if(e.htmlFor!==this.select.id)return}else if(!e.contains(this.select))return;this._a11yButton.focus(),t.preventDefault()}}_addEventListeners(){this._a11yButton.addEventListener("focus",this._onFocus),this._a11yButton.addEventListener("blur",this._onBlur),this._uiContainer.addEventListener("keydown",this._onKeyDown),addEventListener("mouseup",this._onMouseUp),addEventListener("click",this._onClick)}_removeEventListeners(){this._a11yButton.removeEventListener("focus",this._onFocus),this._a11yButton.removeEventListener("blur",this._onBlur),this._uiContainer.removeEventListener("keydown",this._onKeyDown),removeEventListener("mouseup",this._onMouseUp),removeEventListener("click",this._onClick)}_updateA11yButton(){const t=this.select.options.item(this.select.selectedIndex);if(t){const e=Array.from(this._a11yMenu.querySelectorAll("li")).find(e=>e.option===t);this._a11yButton.setAttribute("aria-activedescendant",e.firstElementChild.id),this._a11yButton.setAttribute("aria-labelledby",e.firstElementChild.id)}else this._a11yButton.setAttribute("aria-activedescendant",""),this._a11yButton.setAttribute("aria-labelledby","");this.select.title?this._a11yButton.setAttribute("title",this.select.title):this._a11yButton.removeAttribute("title"),this.select.hasAttribute("aria-label")?this._a11yButton.setAttribute("aria-label",this.select.getAttribute("aria-label")):this._a11yButton.removeAttribute("aria-label")}_updateA11yMenu(){const t=this._a11yMenu.firstElementChild,n=Array.from(this.select.options);for(const e of Array.from(t.querySelectorAll("li"))){if(!n.includes(e.option)){t.removeChild(e);continue}const o=e.firstElementChild,{option:s}=e;e.option.disabled||e.option.parentNode.disabled?(o.setAttribute("aria-disabled","true"),o.setAttribute("disabled","")):(o.setAttribute("aria-disabled","false"),o.removeAttribute("disabled")),o.innerText=s.text,s.title?o.setAttribute("title",s.title):o.removeAttribute("title")}let o=t.firstElementChild;for(const s of n){if(o&&o.option===s){o=o.nextElementSibling;continue}const n=s.disabled||s.parentNode.disabled,i=e.buildDom(`\n <li>\n <szn-\n id="${this._generateOptionId()}"\n tabindex="-1"\n role="option"\n aria-disabled="${n}"\n ${n?"disabled":""}\n ${s.title?`title="${s.title.replace('"',""")}"`:""}\n >\n ${s.text.replace("<","<")}\n </szn->\n </li>\n `);i.option=s,t.insertBefore(i,o)}}_createA11yUI(){const t=this._instanceId,n=/ Mac OS X /.test(navigator.userAgent);return[e.buildDom(`\n <${n?"input":"szn-"}\n tabindex="0"\n role="combobox"\n aria-expanded="false"\n aria-autocomplete="list"\n aria-owns="${t}"\n aria-haspopup="true"\n aria-activedescendant=""\n aria-disabled="true"\n data-szn-select--vanilla-aria-button\n >\n ${n?"":"</szn->"}\n `),e.buildDom(`\n <szn- id="${t}" data-szn-select--vanilla-aria-dropdown>\n <ul tabindex="-1" role="listbox" aria-hidden="true" aria-disabled="false"></ul>\n </szn->\n `)]}_generateInstanceId(){return`szn-select:VanillaAriaLabelledBySelect:${++d._lastId}`}_generateOptionId(){return`${this._instanceId}:${++this._lastOptionId}`}}d.compatibilityTest=(t=>!t.disabled&&!t.multiple&&!/(?:\(iP(?:ad|hone|od(?: touch)?);| Android )/.test(navigator.userAgent)&&/(?: Firefox\/| Mac OS X )/.test(navigator.userAgent)),d._lastId=0,d.TYPING_TIMEOUT=500,d.transliterate=(t=>t.split("").map(t=>t.charCodeAt(0)>127&&void 0!==d.TRANSLITERATION_TABLE[t]?d.TRANSLITERATION_TABLE[t]:t).join("")),d.TRANSLITERATION_TABLE={"ä":"ae","æ":"ae","ǽ":"ae","ö":"oe","œ":"oe","ü":"ue","Ä":"Ae","Ü":"Ue","Ö":"Oe","À":"A","Á":"A","Â":"A","Ã":"A","Å":"A","Ǻ":"A","Ā":"A","Ă":"A","Ą":"A","Ǎ":"A","à":"a","á":"a","â":"a","ã":"a","å":"a","ǻ":"a","ā":"a","ă":"a","ą":"a","ǎ":"a","ª":"a","Ç":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ç":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","Ð":"D","Ď":"D","Đ":"D","ð":"d","ď":"d","đ":"d","È":"E","É":"E","Ê":"E","Ë":"E","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","è":"e","é":"e","ê":"e","ë":"e","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ì":"I","Í":"I","Î":"I","Ï":"I","Ĩ":"I","Ī":"I","Ĭ":"I","Ǐ":"I","Į":"I","İ":"I","ì":"i","í":"i","î":"i","ï":"i","ĩ":"i","ī":"i","ĭ":"i","ǐ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ñ":"N","Ń":"N","Ņ":"N","Ň":"N","ñ":"n","ń":"n","ņ":"n","ň":"n","ʼn":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ō":"O","Ŏ":"O","Ǒ":"O","Ő":"O","Ơ":"O","Ø":"O","Ǿ":"O","ò":"o","ó":"o","ô":"o","õ":"o","ō":"o","ŏ":"o","ǒ":"o","ő":"o","ơ":"o","ø":"o","ǿ":"o","º":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","ſ":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","Ư":"U","Ǔ":"U","Ǖ":"U","Ǘ":"U","Ǚ":"U","Ǜ":"U","ù":"u","ú":"u","û":"u","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","ư":"u","ǔ":"u","ǖ":"u","ǘ":"u","ǚ":"u","ǜ":"u","Ý":"Y","Ÿ":"Y","Ŷ":"Y","ý":"y","ÿ":"y","ŷ":"y","Ŵ":"W","ŵ":"w","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","Æ":"AE","Ǽ":"AE","ß":"ss","IJ":"IJ","ij":"ij","Œ":"OE","ƒ":"f"},i.implementations=[r,l,a,d]})(self),SznElements.init&&SznElements.init(),(t=>{const e=t.SznElements=t.SznElements||{},n={},o=[],s={};e.init=(()=>{if(e.registerElement)for(const[t,o]of function(){const t=[];for(const o of Object.keys(e))o.includes("-")&&!n[o]&&t.push([o,e[o]]);return t}())n[t]=!0,e.registerElement(t,o)}),e.awaitElementReady=((t,e)=>{t._broker?setTimeout(e,0):o.push([t,e])}),e.buildDom=((t,e=(()=>{}),n=!0)=>{const o=document.createElement("template");o.innerHTML=t;const s=document.importNode(o.content,!0);for(const t of Array.from(s.querySelectorAll("[data-szn-ref]")))e(t,t.getAttribute("data-szn-ref"));return n?s.firstElementChild:s}),e.injectStyles=((t,n)=>{if(!s[n]){if(!/^[-a-z0-9]+$/.test(n)||!n.includes("-"))throw new Error("The styles identifier must contain only the lower-case english alphabet letters and numbers and it must "+`contain a dash, but "${n}" has been provided`);const o=e.buildDom(`<style data-szn-elements-styles--${n}>${t}</style>`);document.head.appendChild(o),s[n]=!0}}),e._onElementReady=(t=>{for(let e=o.length-1;e>=0;e--){const[n,s]=o[e];n===t&&(s(),o.splice(e,1))}}),e.init()})(self),(t=>{const e=t.SznElements=t.SznElements||{};e.registerElement=((t,n)=>{customElements.define(t,class extends HTMLElement{static get is(){return t}constructor(){super(),this._broker=new n(this),e._onElementReady(this)}connectedCallback(){this._broker.onMount&&!this.hasAttribute("data-szn-elements--init-on-demand")&&this._broker.onMount()}disconnectedCallback(){this._broker.onUnmount&&!this.hasAttribute("data-szn-elements--init-on-demand")&&this._broker.onUnmount()}})}),e.init&&e.init()})(self);