@cas-smartdesign/token-selector 0.18.0 → 0.18.1
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/docs/doc.mjs
CHANGED
|
@@ -588,7 +588,7 @@ export function getItems(): ExtendedTokenData[] {
|
|
|
588
588
|
<div class="icon-wrapper" style="${le(e)}" role="img">
|
|
589
589
|
<div part="icon" class="icon"></div>
|
|
590
590
|
</div>
|
|
591
|
-
`}return z}updated(e){super.updated(e),(e.has("icon")||e.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Gs.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),e.has("disabled")&&!this.disabled&&this.checked&&(this.checked=!1)}setClickHandler(e){this._tokenClickHandler=e}setDeleteHandler(e){this._tokenDeleteHandler=e}},Ie.ID="sd-token",Ie.ensureDefined=()=>{customElements.get(Ie.ID)||customElements.define(Ie.ID,Ie)},Ie);je([b({type:String,attribute:!0,reflect:!0})],Le.prototype,"value",2);je([b({type:String,attribute:!0,reflect:!0})],Le.prototype,"type",2);je([b({type:String})],Le.prototype,"icon",2);je([b({type:String})],Le.prototype,"iconPlaceholder",2);je([b({type:String})],Le.prototype,"iconBackgroundColor",2);je([b({converter:Ci,reflect:!0,attribute:"aria-disabled"})],Le.prototype,"disabled",2);je([b({converter:Ci,reflect:!0,attribute:"aria-current"})],Le.prototype,"current",2);je([b({converter:Ci,reflect:!0,attribute:"aria-checked"})],Le.prototype,"checked",1);let In=Le;const zl=(i,e)=>{const t=document.createElement(In.ID);return i&&(t.value=i.caption,t.type=i.type,t.icon=i.icon,t.iconPlaceholder=i.iconPlaceholder,t.iconBackgroundColor=i.iconBackgroundColor,t.disabled=i.disabled,t.index=e),t};In.ensureDefined();const Xt="web application/json";class Ul{constructor(e,t,n){navigator.clipboard&&(e.addEventListener("copy",()=>{t()||this.writeToClipboard(e)}),e.addEventListener("cut",()=>{t()||(e.removeSelectionOrActiveToken(),this.writeToClipboard(e))}),e.addEventListener("paste",()=>{e.disabled||this.readFromClipboard(n)}))}writeToClipboard(e){const t=e.querySelectorAll("[slot='items'][aria-checked='true']"),n=[];if(t.length>0)t.forEach(s=>n.push(s.index));else if(e.activeTokenIndex!=-1){const s=e.activeTokenElement;s&&n.push(s.index)}if(n.length>0){const s=JSON.stringify(n.map(o=>e.items[o])),r=new Blob([s],{type:Xt});navigator.clipboard.write([new ClipboardItem({[Xt]:r})])}}async readFromClipboard(e){const t=await navigator.clipboard.read();for(const n of t)if(n.types.includes(Xt)){const r=await(await n.getType(Xt)).text(),o=JSON.parse(r);Array.isArray(o)&&e(o)}}}const Hl=":host{display:flex;contain:layout style}:host .additonal-content::slotted(*){align-self:end;flex-shrink:0}:host([drop]) ::slotted(*){pointer-events:none}:host(:not([readonly])) ::slotted(sd-token:last-of-type){max-width:calc(100% - 24px);margin-right:24px;margin-bottom:4px}.container{display:flex;flex-wrap:wrap;gap:8px;flex-grow:1;min-width:0;margin-top:auto}.container .placeholder{color:#767676;line-height:24px;align-self:flex-end}.input{flex-grow:1;min-width:0;width:100%;margin-top:auto}.input .token-wrapper{display:flex;flex-wrap:wrap;flex:1 0 auto;width:100%;gap:8px}";class Fl{constructor(e,t){this.tokenSelector=e;const n=new Map,s=r=>{const o=r.target;if(e.removeAttribute("drag-source"),!e.contains(o)){const a=r.addedIndexes;a&&e.removeTokens(a.map(l=>n.get(l)))}n.clear()};e.addEventListener("dragstart",r=>{const o=r.target;if(o instanceof In){if(o.disabled){r.preventDefault();return}e.setAttribute("drag-source",""),o.setAttribute("aria-checked","true");const a=e.querySelectorAll("[slot='items'][aria-checked='true']");if(a.length>0){const l=Array.from(a).filter(c=>!c.disabled).map((c,d)=>(n.set(d,c.index),e.items[c.index]));if(r.dataTransfer.setData("text/sd-token-selector",JSON.stringify(l)),r.dataTransfer.dropEffect="move",r.dataTransfer.effectAllowed="move",a.length>1){const c=this.createCustomDragImage(o,l.length);r.dataTransfer.setDragImage(c,-14,-14)}window.addEventListener("drop",s,{once:!0})}}}),e.addEventListener("dragenter",r=>{e.setAttribute("drop",""),r.preventDefault()}),e.addEventListener("dragover",r=>r.preventDefault()),e.addEventListener("dragleave",r=>{r.target==e&&e.removeAttribute("drop")}),e.addEventListener("drop",r=>{e.removeAttribute("drop");const o=r.dataTransfer.getData("text/sd-token-selector");if(o)try{const a=JSON.parse(o);Array.isArray(a)&&(r.addedIndexes=t(a),r.preventDefault())}catch{}}),e.addEventListener("dragend",()=>{window.removeEventListener("drop",s),n.clear()})}createCustomDragImage(e,t){let n=e.cloneNode(!0);if(n.setAttribute("aria-disabled","true"),this.tokenSelector.tokenType)n.value=t+" "+this.tokenSelector.tokenType;else{const s=document.createElement("div");s.innerText="+"+(t-1),Object.assign(s.style,{position:"absolute",left:"90%",top:"75%"});const r=document.createElement("div");r.appendChild(n),r.appendChild(s),n=r}return Object.assign(n.style,{height:e.offsetHeight,outline:"none",maxWidth:"500px",position:"absolute",display:"block",left:"-99999px",overflow:"visible",margin:"1px"}),n.slot="items",this.tokenSelector.appendChild(n),requestAnimationFrame(()=>n.remove()),n}}var Wl=Object.defineProperty,ql=Object.getOwnPropertyDescriptor,ge=(i,e,t,n)=>{for(var s=n>1?void 0:n?ql(e,t):e,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=(n?o(e,t,s):o(s))||s);return n&&s&&Wl(e,t,s),s};function Vl(i,e){let t;return function(...n){t!=null&&clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}var Se;const de=(Se=class extends ue{constructor(){super(...arguments),this.selectionMode="multi",this.items=[],this.selectedIndexes=[],this._tokenGenerator=zl,this._autoSuggestItemGenerator=Ks,this.additionalTokenCommittingKeys=[],this._activeTokenIndex=-1,this.handleInputKeyDown=(e,t)=>{if((e.key==="Enter"||this.additionalTokenCommittingKeys.includes(e.key))&&t.value){e.preventDefault(),e.stopPropagation(),this.commitTokenValue(t.value);return}switch(e.key){case"Escape":{e.preventDefault(),e.stopPropagation(),this.tokenSuggestPopover.hide();break}case"Tab":{this.commitTokenValue(t.value),this.tokenSuggestPopover.hide();break}default:this.handleKeyDown(e)}},this.handleKeyDown=e=>{switch(e.key){case"ArrowLeft":{this.hasInputValue||this.updateActiveToken(-1);break}case"ArrowRight":{this.hasInputValue||this.updateActiveToken(1);break}case"Enter":{if(!this.hasInputValue&&this.activeTokenIndex!=-1){const t=this.activeTokenElement;e.getModifierState("Control")?t.checked=!t.checked:(t.checked=!0,this.onTokenClick(t,!1)),document.activeElement!=this&&this.focus()}break}case"Backspace":{this.hasInputValue||(this.activeTokenIndex==-1?this.updateActiveToken(-1):this.removeSelectionOrActiveToken());break}case"Clear":case"Delete":{this.removeSelectionOrActiveToken();break}case"a":{!this.hasInputValue&&e.getModifierState("Control")&&(this.querySelectorAll("[slot='items']").forEach(t=>t.checked=!0),e.preventDefault(),e.stopPropagation());break}}},this.selectOrAddItems=e=>{const t=[],n=e.map((s,r)=>{const o=s.caption==null?-1:this.findIndex(s);return o!=-1&&!this.items[o].disabled&&!this.selectedIndexes.includes(o)?(t.push(r),o):-1}).filter(s=>s!=-1);return n.length>0&&this.handleTokenSelection(n),t},this.handleWindowPointerDown=e=>{const t=this.inputElement;if(!t||!t.value)return;e.composedPath().some(s=>{if(s instanceof HTMLElement&&(e.composedPath().indexOf(t)>-1||s.getAttribute("popover-for")==="token-autosuggest-popover"))return!0})||this.commitTokenValue(t.value)},this.debouncedShowTokenSuggestPopover=Vl(this.showFilteredTokenSuggestions.bind(this),200)}static get styles(){return Ze(Hl)}get tokenGenerator(){return this._tokenGenerator}set tokenGenerator(e){this._tokenGenerator=e,this.render()}get autoSuggestItemGenerator(){return this._autoSuggestItemGenerator}set autoSuggestItemGenerator(e){this._autoSuggestItemGenerator=e,this._tokenSuggestPopover&&(this._tokenSuggestPopover.list.itemGenerator=e)}setAdditionalTokenCommittingKeys(e){this.additionalTokenCommittingKeys=e}openSuggestions(){this.inputElement&&(this.focus(),this.tokenSuggestPopover.show())}focus(){this.inputElement?this.inputElement.focus():this.shadowRoot.querySelector(".container").focus()}render(){return this.selectionMode=="remove-only"?Z`<div class="container" tabindex="0">
|
|
591
|
+
`}return z}updated(e){super.updated(e),(e.has("icon")||e.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Gs.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),e.has("disabled")&&!this.disabled&&this.checked&&(this.checked=!1)}setClickHandler(e){this._tokenClickHandler=e}setDeleteHandler(e){this._tokenDeleteHandler=e}},Ie.ID="sd-token",Ie.ensureDefined=()=>{customElements.get(Ie.ID)||customElements.define(Ie.ID,Ie)},Ie);je([b({type:String,attribute:!0,reflect:!0})],Le.prototype,"value",2);je([b({type:String,attribute:!0,reflect:!0})],Le.prototype,"type",2);je([b({type:String})],Le.prototype,"icon",2);je([b({type:String})],Le.prototype,"iconPlaceholder",2);je([b({type:String})],Le.prototype,"iconBackgroundColor",2);je([b({converter:Ci,reflect:!0,attribute:"aria-disabled"})],Le.prototype,"disabled",2);je([b({converter:Ci,reflect:!0,attribute:"aria-current"})],Le.prototype,"current",2);je([b({converter:Ci,reflect:!0,attribute:"aria-checked"})],Le.prototype,"checked",1);let In=Le;const zl=(i,e)=>{const t=document.createElement(In.ID);return i&&(t.value=i.caption,t.type=i.type,t.icon=i.icon,t.iconPlaceholder=i.iconPlaceholder,t.iconBackgroundColor=i.iconBackgroundColor,t.disabled=i.disabled,t.index=e),t};In.ensureDefined();const Xt="web application/json";class Ul{constructor(e,t,n){navigator.clipboard&&(e.addEventListener("copy",()=>{t()||this.writeToClipboard(e)}),e.addEventListener("cut",()=>{t()||(e.removeSelectionOrActiveToken(),this.writeToClipboard(e))}),e.addEventListener("paste",()=>{e.disabled||this.readFromClipboard(n)}))}writeToClipboard(e){const t=e.querySelectorAll("[slot='items'][aria-checked='true']"),n=[];if(t.length>0)t.forEach(s=>n.push(s.index));else if(e.activeTokenIndex!=-1){const s=e.activeTokenElement;s&&n.push(s.index)}if(n.length>0){const s=JSON.stringify(n.map(o=>e.items[o])),r=new Blob([s],{type:Xt});navigator.clipboard.write([new ClipboardItem({[Xt]:r})])}}async readFromClipboard(e){const t=await navigator.clipboard.read();for(const n of t)if(n.types.includes(Xt)){const r=await(await n.getType(Xt)).text(),o=JSON.parse(r);Array.isArray(o)&&e(o)}}}const Hl=":host{display:flex;contain:layout style}:host .additonal-content::slotted(*){align-self:end;flex-shrink:0}:host([drop]) ::slotted(*){pointer-events:none}:host(:not([readonly])) ::slotted(sd-token:last-of-type){max-width:calc(100% - 24px);margin-right:24px;margin-bottom:4px}.container{display:flex;flex-wrap:wrap;gap:8px;flex-grow:1;min-width:0;margin-top:auto}.container .placeholder{color:#767676;line-height:24px;align-self:flex-end}.input{flex-grow:1;min-width:0;width:100%;margin-top:auto}.input .token-wrapper{display:flex;flex-wrap:wrap;flex:1 0 auto;width:100%;gap:8px}";class Fl{constructor(e,t){this.tokenSelector=e;const n=new Map,s=r=>{const o=r.target;if(e.removeAttribute("drag-source"),!e.contains(o)){const a=r.addedIndexes;a&&e.removeTokens(a.map(l=>n.get(l)))}n.clear()};e.addEventListener("dragstart",r=>{const o=r.target;if(o instanceof In){if(o.disabled){r.preventDefault();return}e.setAttribute("drag-source",""),o.setAttribute("aria-checked","true");const a=e.querySelectorAll("[slot='items'][aria-checked='true']");if(a.length>0){const l=Array.from(a).filter(c=>!c.disabled).map((c,d)=>(n.set(d,c.index),e.items[c.index]));if(r.dataTransfer.setData("text/sd-token-selector",JSON.stringify(l)),r.dataTransfer.dropEffect="move",r.dataTransfer.effectAllowed="move",a.length>1){const c=this.createCustomDragImage(o,l.length);r.dataTransfer.setDragImage(c,-14,-14)}window.addEventListener("drop",s,{once:!0})}}}),e.addEventListener("dragenter",r=>{e.setAttribute("drop",""),r.preventDefault()}),e.addEventListener("dragover",r=>r.preventDefault()),e.addEventListener("dragleave",r=>{r.target==e&&e.removeAttribute("drop")}),e.addEventListener("drop",r=>{e.removeAttribute("drop");const o=r.dataTransfer.getData("text/sd-token-selector");if(o)try{const a=JSON.parse(o);Array.isArray(a)&&(r.addedIndexes=t(a),r.preventDefault())}catch{}}),e.addEventListener("dragend",()=>{window.removeEventListener("drop",s),e.removeAttribute("drag-source"),n.clear()})}createCustomDragImage(e,t){let n=e.cloneNode(!0);if(n.setAttribute("aria-disabled","true"),this.tokenSelector.tokenType)n.value=t+" "+this.tokenSelector.tokenType;else{const s=document.createElement("div");s.innerText="+"+(t-1),Object.assign(s.style,{position:"absolute",left:"90%",top:"75%"});const r=document.createElement("div");r.appendChild(n),r.appendChild(s),n=r}return Object.assign(n.style,{height:e.offsetHeight,outline:"none",maxWidth:"500px",position:"absolute",display:"block",left:"-99999px",overflow:"visible",margin:"1px"}),n.slot="items",this.tokenSelector.appendChild(n),requestAnimationFrame(()=>n.remove()),n}}var Wl=Object.defineProperty,ql=Object.getOwnPropertyDescriptor,ge=(i,e,t,n)=>{for(var s=n>1?void 0:n?ql(e,t):e,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=(n?o(e,t,s):o(s))||s);return n&&s&&Wl(e,t,s),s};function Vl(i,e){let t;return function(...n){t!=null&&clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}var Se;const de=(Se=class extends ue{constructor(){super(...arguments),this.selectionMode="multi",this.items=[],this.selectedIndexes=[],this._tokenGenerator=zl,this._autoSuggestItemGenerator=Ks,this.additionalTokenCommittingKeys=[],this._activeTokenIndex=-1,this.handleInputKeyDown=(e,t)=>{if((e.key==="Enter"||this.additionalTokenCommittingKeys.includes(e.key))&&t.value){e.preventDefault(),e.stopPropagation(),this.commitTokenValue(t.value);return}switch(e.key){case"Escape":{e.preventDefault(),e.stopPropagation(),this.tokenSuggestPopover.hide();break}case"Tab":{this.commitTokenValue(t.value),this.tokenSuggestPopover.hide();break}default:this.handleKeyDown(e)}},this.handleKeyDown=e=>{switch(e.key){case"ArrowLeft":{this.hasInputValue||this.updateActiveToken(-1);break}case"ArrowRight":{this.hasInputValue||this.updateActiveToken(1);break}case"Enter":{if(!this.hasInputValue&&this.activeTokenIndex!=-1){const t=this.activeTokenElement;e.getModifierState("Control")?t.checked=!t.checked:(t.checked=!0,this.onTokenClick(t,!1)),document.activeElement!=this&&this.focus()}break}case"Backspace":{this.hasInputValue||(this.activeTokenIndex==-1?this.updateActiveToken(-1):this.removeSelectionOrActiveToken());break}case"Clear":case"Delete":{this.removeSelectionOrActiveToken();break}case"a":{!this.hasInputValue&&e.getModifierState("Control")&&(this.querySelectorAll("[slot='items']").forEach(t=>t.checked=!0),e.preventDefault(),e.stopPropagation());break}}},this.selectOrAddItems=e=>{const t=[],n=e.map((s,r)=>{const o=s.caption==null?-1:this.findIndex(s);return o!=-1&&!this.items[o].disabled&&!this.selectedIndexes.includes(o)?(t.push(r),o):-1}).filter(s=>s!=-1);return n.length>0&&this.handleTokenSelection(n),t},this.handleWindowPointerDown=e=>{const t=this.inputElement;if(!t||!t.value)return;e.composedPath().some(s=>{if(s instanceof HTMLElement&&(e.composedPath().indexOf(t)>-1||s.getAttribute("popover-for")==="token-autosuggest-popover"))return!0})||this.commitTokenValue(t.value)},this.debouncedShowTokenSuggestPopover=Vl(this.showFilteredTokenSuggestions.bind(this),200)}static get styles(){return Ze(Hl)}get tokenGenerator(){return this._tokenGenerator}set tokenGenerator(e){this._tokenGenerator=e,this.render()}get autoSuggestItemGenerator(){return this._autoSuggestItemGenerator}set autoSuggestItemGenerator(e){this._autoSuggestItemGenerator=e,this._tokenSuggestPopover&&(this._tokenSuggestPopover.list.itemGenerator=e)}setAdditionalTokenCommittingKeys(e){this.additionalTokenCommittingKeys=e}openSuggestions(){this.inputElement&&(this.focus(),this.tokenSuggestPopover.show())}focus(){this.inputElement?this.inputElement.focus():this.shadowRoot.querySelector(".container").focus()}render(){return this.selectionMode=="remove-only"?Z`<div class="container" tabindex="0">
|
|
592
592
|
<slot name="items"
|
|
593
593
|
>${this.placeholder?Z`<span part="remove-only-placeholder" class="placeholder"
|
|
594
594
|
>${this.placeholder}</span
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var qo=Object.prototype.hasOwnProperty;var Vo=(e,t)=>{for(var i in t)We(e,i,{get:t[i],enumerable:!0})},jo=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bo(t))!qo.call(e,r)&&r!==i&&We(e,r,{get:()=>t[r],enumerable:!(o=zo(t,r))||o.enumerable});return e};var Fo=e=>jo(We({},"__esModule",{value:!0}),e);var ls={};Vo(ls,{SelectionMode:()=>Po,default:()=>as,generator:()=>Oo});var
|
|
1
|
+
var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var qo=Object.prototype.hasOwnProperty;var Vo=(e,t)=>{for(var i in t)We(e,i,{get:t[i],enumerable:!0})},jo=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bo(t))!qo.call(e,r)&&r!==i&&We(e,r,{get:()=>t[r],enumerable:!(o=zo(t,r))||o.enumerable});return e};var Fo=e=>jo(We({},"__esModule",{value:!0}),e);var ls={};Vo(ls,{SelectionMode:()=>Po,default:()=>as,generator:()=>Oo});var Ee=window,ke=Ee.ShadowRoot&&(Ee.ShadyCSS===void 0||Ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ke=Symbol(),Ui=new WeakMap,oe=class{constructor(t,i,o){if(this._$cssResult$=!0,o!==Ke)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o,i=this.t;if(ke&&t===void 0){let o=i!==void 0&&i.length===1;o&&(t=Ui.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&Ui.set(i,t))}return t}toString(){return this.cssText}},X=e=>new oe(typeof e=="string"?e:e+"",void 0,Ke),at=(e,...t)=>{let i=e.length===1?e[0]:t.reduce((o,r,s)=>o+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[s+1],e[0]);return new oe(i,e,Ke)},Ge=(e,t)=>{ke?e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet):t.forEach(i=>{let o=document.createElement("style"),r=Ee.litNonce;r!==void 0&&o.setAttribute("nonce",r),o.textContent=i.cssText,e.appendChild(o)})},Se=ke?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(let o of t.cssRules)i+=o.cssText;return X(i)})(e):e;var Xe,Ie=window,zi=Ie.trustedTypes,Wo=zi?zi.emptyScript:"",Bi=Ie.reactiveElementPolyfillSupport,Je={toAttribute(e,t){switch(t){case Boolean:e=e?Wo:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},qi=(e,t)=>t!==e&&(t==t||e==e),Ye={attribute:!0,type:String,converter:Je,reflect:!1,hasChanged:qi},Ze="finalized",lt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var i;this.finalize(),((i=this.h)!==null&&i!==void 0?i:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((i,o)=>{let r=this._$Ep(o,i);r!==void 0&&(this._$Ev.set(r,o),t.push(r))}),t}static createProperty(t,i=Ye){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){let o=typeof t=="symbol"?Symbol():"__"+t,r=this.getPropertyDescriptor(t,o,i);r!==void 0&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,i,o){return{get(){return this[i]},set(r){let s=this[t];this[i]=r,this.requestUpdate(t,s,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||Ye}static finalize(){if(this.hasOwnProperty(Ze))return!1;this[Ze]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let i=this.properties,o=[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)];for(let r of o)this.createProperty(r,i[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let i=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let r of o)i.unshift(Se(r))}else t!==void 0&&i.push(Se(t));return i}static _$Ep(t,i){let o=i.attribute;return o===!1?void 0:typeof o=="string"?o:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(i=>i(this))}addController(t){var i,o;((i=this._$ES)!==null&&i!==void 0?i:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((o=t.hostConnected)===null||o===void 0||o.call(t))}removeController(t){var i;(i=this._$ES)===null||i===void 0||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])})}createRenderRoot(){var t;let i=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return Ge(i,this.constructor.elementStyles),i}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return(o=i.hostConnected)===null||o===void 0?void 0:o.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return(o=i.hostDisconnected)===null||o===void 0?void 0:o.call(i)})}attributeChangedCallback(t,i,o){this._$AK(t,o)}_$EO(t,i,o=Ye){var r;let s=this.constructor._$Ep(t,o);if(s!==void 0&&o.reflect===!0){let n=(((r=o.converter)===null||r===void 0?void 0:r.toAttribute)!==void 0?o.converter:Je).toAttribute(i,o.type);this._$El=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$El=null}}_$AK(t,i){var o;let r=this.constructor,s=r._$Ev.get(t);if(s!==void 0&&this._$El!==s){let n=r.getPropertyOptions(s),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)===null||o===void 0?void 0:o.fromAttribute)!==void 0?n.converter:Je;this._$El=s,this[s]=a.fromAttribute(i,n.type),this._$El=null}}requestUpdate(t,i,o){let r=!0;t!==void 0&&(((o=o||this.constructor.getPropertyOptions(t)).hasChanged||qi)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),o.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,o))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(i){Promise.reject(i)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((r,s)=>this[s]=r),this._$Ei=void 0);let i=!1,o=this._$AL;try{i=this.shouldUpdate(o),i?(this.willUpdate(o),(t=this._$ES)===null||t===void 0||t.forEach(r=>{var s;return(s=r.hostUpdate)===null||s===void 0?void 0:s.call(r)}),this.update(o)):this._$Ek()}catch(r){throw i=!1,this._$Ek(),r}i&&this._$AE(o)}willUpdate(t){}_$AE(t){var i;(i=this._$ES)===null||i===void 0||i.forEach(o=>{var r;return(r=o.hostUpdated)===null||r===void 0?void 0:r.call(o)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((i,o)=>this._$EO(o,this[o],i)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};lt[Ze]=!0,lt.elementProperties=new Map,lt.elementStyles=[],lt.shadowRootOptions={mode:"open"},Bi?.({ReactiveElement:lt}),((Xe=Ie.reactiveElementVersions)!==null&&Xe!==void 0?Xe:Ie.reactiveElementVersions=[]).push("1.6.3");var Qe,Ce=window,jt=Ce.trustedTypes,Vi=jt?jt.createPolicy("lit-html",{createHTML:e=>e}):void 0,ei="$lit$",vt=`lit$${(Math.random()+"").slice(9)}$`,Yi="?"+vt,Ko=`<${Yi}>`,Tt=document,se=()=>Tt.createComment(""),ne=e=>e===null||typeof e!="object"&&typeof e!="function",Ji=Array.isArray,Go=e=>Ji(e)||typeof e?.[Symbol.iterator]=="function",ti=`[
|
|
2
2
|
\f\r]`,re=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ji=/-->/g,Fi=/>/g,Ct=RegExp(`>|${ti}(?:([^\\s"'>=/]+)(${ti}*=${ti}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Wi=/'/g,Ki=/"/g,Zi=/^(?:script|style|textarea|title)$/i,Qi=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),E=Qi(1),fs=Qi(2),dt=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Gi=new WeakMap,$t=Tt.createTreeWalker(Tt,129,null,!1);function to(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vi!==void 0?Vi.createHTML(t):t}var Xo=(e,t)=>{let i=e.length-1,o=[],r,s=t===2?"<svg>":"",n=re;for(let a=0;a<i;a++){let l=e[a],c,d,p=-1,f=0;for(;f<l.length&&(n.lastIndex=f,d=n.exec(l),d!==null);)f=n.lastIndex,n===re?d[1]==="!--"?n=ji:d[1]!==void 0?n=Fi:d[2]!==void 0?(Zi.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=Ct):d[3]!==void 0&&(n=Ct):n===Ct?d[0]===">"?(n=r??re,p=-1):d[1]===void 0?p=-2:(p=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?Ct:d[3]==='"'?Ki:Wi):n===Ki||n===Wi?n=Ct:n===ji||n===Fi?n=re:(n=Ct,r=void 0);let u=n===Ct&&e[a+1].startsWith("/>")?" ":"";s+=n===re?l+Ko:p>=0?(o.push(c),l.slice(0,p)+ei+l.slice(p)+vt+u):l+vt+(p===-2?(o.push(void 0),a):u)}return[to(e,s+(e[i]||"<?>")+(t===2?"</svg>":"")),o]},ae=class e{constructor({strings:t,_$litType$:i},o){let r;this.parts=[];let s=0,n=0,a=t.length-1,l=this.parts,[c,d]=Xo(t,i);if(this.el=e.createElement(c,o),$t.currentNode=this.el.content,i===2){let p=this.el.content,f=p.firstChild;f.remove(),p.append(...f.childNodes)}for(;(r=$t.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes()){let p=[];for(let f of r.getAttributeNames())if(f.endsWith(ei)||f.startsWith(vt)){let u=d[n++];if(p.push(f),u!==void 0){let w=r.getAttribute(u.toLowerCase()+ei).split(vt),m=/([.?@])?(.*)/.exec(u);l.push({type:1,index:s,name:m[2],strings:w,ctor:m[1]==="."?oi:m[1]==="?"?ri:m[1]==="@"?si:Wt})}else l.push({type:6,index:s})}for(let f of p)r.removeAttribute(f)}if(Zi.test(r.tagName)){let p=r.textContent.split(vt),f=p.length-1;if(f>0){r.textContent=jt?jt.emptyScript:"";for(let u=0;u<f;u++)r.append(p[u],se()),$t.nextNode(),l.push({type:2,index:++s});r.append(p[f],se())}}}else if(r.nodeType===8)if(r.data===Yi)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(vt,p+1))!==-1;)l.push({type:7,index:s}),p+=vt.length-1}s++}}static createElement(t,i){let o=Tt.createElement("template");return o.innerHTML=t,o}};function Ft(e,t,i=e,o){var r,s,n,a;if(t===dt)return t;let l=o!==void 0?(r=i._$Co)===null||r===void 0?void 0:r[o]:i._$Cl,c=ne(t)?void 0:t._$litDirective$;return l?.constructor!==c&&((s=l?._$AO)===null||s===void 0||s.call(l,!1),c===void 0?l=void 0:(l=new c(e),l._$AT(e,i,o)),o!==void 0?((n=(a=i)._$Co)!==null&&n!==void 0?n:a._$Co=[])[o]=l:i._$Cl=l),l!==void 0&&(t=Ft(e,l._$AS(e,t.values),l,o)),t}var ii=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;let{el:{content:o},parts:r}=this._$AD,s=((i=t?.creationScope)!==null&&i!==void 0?i:Tt).importNode(o,!0);$t.currentNode=s;let n=$t.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let d;c.type===2?d=new le(n,n.nextSibling,this,t):c.type===1?d=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(d=new ni(n,this,t)),this._$AV.push(d),c=r[++l]}a!==c?.index&&(n=$t.nextNode(),a++)}return $t.currentNode=Tt,s}v(t){let i=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}},le=class e{constructor(t,i,o,r){var s;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=r,this._$Cp=(s=r?.isConnected)===null||s===void 0||s}get _$AU(){var t,i;return(i=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&i!==void 0?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Ft(this,t,i),ne(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==dt&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Go(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==b&&ne(this._$AH)?this._$AA.nextSibling.data=t:this.$(Tt.createTextNode(t)),this._$AH=t}g(t){var i;let{values:o,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=ae.createElement(to(r.h,r.h[0]),this.options)),r);if(((i=this._$AH)===null||i===void 0?void 0:i._$AD)===s)this._$AH.v(o);else{let n=new ii(s,this),a=n.u(this.options);n.v(o),this.$(a),this._$AH=n}}_$AC(t){let i=Gi.get(t.strings);return i===void 0&&Gi.set(t.strings,i=new ae(t)),i}T(t){Ji(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,o,r=0;for(let s of t)r===i.length?i.push(o=new e(this.k(se()),this.k(se()),this,this.options)):o=i[r],o._$AI(s),r++;r<i.length&&(this._$AR(o&&o._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,i){var o;for((o=this._$AP)===null||o===void 0||o.call(this,!1,!0,i);t&&t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){var i;this._$AM===void 0&&(this._$Cp=t,(i=this._$AP)===null||i===void 0||i.call(this,t))}},Wt=class{constructor(t,i,o,r,s){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=i,this._$AM=r,this.options=s,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=b}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,o,r){let s=this.strings,n=!1;if(s===void 0)t=Ft(this,t,i,0),n=!ne(t)||t!==this._$AH&&t!==dt,n&&(this._$AH=t);else{let a=t,l,c;for(t=s[0],l=0;l<s.length-1;l++)c=Ft(this,a[o+l],i,l),c===dt&&(c=this._$AH[l]),n||(n=!ne(c)||c!==this._$AH[l]),c===b?t=b:t!==b&&(t+=(c??"")+s[l+1]),this._$AH[l]=c}n&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},oi=class extends Wt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}},Yo=jt?jt.emptyScript:"",ri=class extends Wt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==b?this.element.setAttribute(this.name,Yo):this.element.removeAttribute(this.name)}},si=class extends Wt{constructor(t,i,o,r,s){super(t,i,o,r,s),this.type=5}_$AI(t,i=this){var o;if((t=(o=Ft(this,t,i,0))!==null&&o!==void 0?o:b)===dt)return;let r=this._$AH,s=t===b&&r!==b||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==b&&(r===b||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,o;typeof this._$AH=="function"?this._$AH.call((o=(i=this.options)===null||i===void 0?void 0:i.host)!==null&&o!==void 0?o:this.element,t):this._$AH.handleEvent(t)}},ni=class{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){Ft(this,t)}};var Xi=Ce.litHtmlPolyfillSupport;Xi?.(ae,le),((Qe=Ce.litHtmlVersions)!==null&&Qe!==void 0?Qe:Ce.litHtmlVersions=[]).push("2.8.0");var eo=(e,t,i)=>{var o,r;let s=(o=i?.renderBefore)!==null&&o!==void 0?o:t,n=s._$litPart$;if(n===void 0){let a=(r=i?.renderBefore)!==null&&r!==void 0?r:null;s._$litPart$=n=new le(t.insertBefore(se(),a),a,void 0,i??{})}return n._$AI(e),n};var ai,li;var P=class extends lt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;let o=super.createRenderRoot();return(t=(i=this.renderOptions).renderBefore)!==null&&t!==void 0||(i.renderBefore=o.firstChild),o}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=eo(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return dt}};P.finalized=!0,P._$litElement$=!0,(ai=globalThis.litElementHydrateSupport)===null||ai===void 0||ai.call(globalThis,{LitElement:P});var io=globalThis.litElementPolyfillSupport;io?.({LitElement:P});((li=globalThis.litElementVersions)!==null&&li!==void 0?li:globalThis.litElementVersions=[]).push("3.3.3");var Jo=(e,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}},Zo=(e,t,i)=>{t.constructor.createProperty(i,e)};function h(e){return(t,i)=>i!==void 0?Zo(e,t,i):Jo(e,t)}var V=e=>e??b;var Qo=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",tr="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",er="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",ir="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",or=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,di=(e,t,i,o)=>{for(var r=o>1?void 0:o?rr(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&or(t,i,r),r},Kt,ce=(Kt=class extends P{static parseLevel(e){if(e){let t=Object.keys(Gt).find(i=>i.toLowerCase()===e.toLowerCase());return t&&Gt[t]}}static get styles(){return[at`
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Wi=/'/g,Ki=/"/g,Zi=/^(?:script|style|textarea|title)$/i,Qi=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),A=Qi(1),fs=Qi(2),dt=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Gi=new WeakMap,$t=Tt.createTreeWalker(Tt,129,null,!1);function to(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vi!==void 0?Vi.createHTML(t):t}var Xo=(e,t)=>{let i=e.length-1,o=[],r,s=t===2?"<svg>":"",n=re;for(let a=0;a<i;a++){let l=e[a],c,d,p=-1,f=0;for(;f<l.length&&(n.lastIndex=f,d=n.exec(l),d!==null);)f=n.lastIndex,n===re?d[1]==="!--"?n=ji:d[1]!==void 0?n=Fi:d[2]!==void 0?(Zi.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=Ct):d[3]!==void 0&&(n=Ct):n===Ct?d[0]===">"?(n=r??re,p=-1):d[1]===void 0?p=-2:(p=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?Ct:d[3]==='"'?Ki:Wi):n===Ki||n===Wi?n=Ct:n===ji||n===Fi?n=re:(n=Ct,r=void 0);let u=n===Ct&&e[a+1].startsWith("/>")?" ":"";s+=n===re?l+Ko:p>=0?(o.push(c),l.slice(0,p)+ei+l.slice(p)+vt+u):l+vt+(p===-2?(o.push(void 0),a):u)}return[to(e,s+(e[i]||"<?>")+(t===2?"</svg>":"")),o]},ae=class e{constructor({strings:t,_$litType$:i},o){let r;this.parts=[];let s=0,n=0,a=t.length-1,l=this.parts,[c,d]=Xo(t,i);if(this.el=e.createElement(c,o),$t.currentNode=this.el.content,i===2){let p=this.el.content,f=p.firstChild;f.remove(),p.append(...f.childNodes)}for(;(r=$t.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes()){let p=[];for(let f of r.getAttributeNames())if(f.endsWith(ei)||f.startsWith(vt)){let u=d[n++];if(p.push(f),u!==void 0){let w=r.getAttribute(u.toLowerCase()+ei).split(vt),m=/([.?@])?(.*)/.exec(u);l.push({type:1,index:s,name:m[2],strings:w,ctor:m[1]==="."?oi:m[1]==="?"?ri:m[1]==="@"?si:Wt})}else l.push({type:6,index:s})}for(let f of p)r.removeAttribute(f)}if(Zi.test(r.tagName)){let p=r.textContent.split(vt),f=p.length-1;if(f>0){r.textContent=jt?jt.emptyScript:"";for(let u=0;u<f;u++)r.append(p[u],se()),$t.nextNode(),l.push({type:2,index:++s});r.append(p[f],se())}}}else if(r.nodeType===8)if(r.data===Yi)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(vt,p+1))!==-1;)l.push({type:7,index:s}),p+=vt.length-1}s++}}static createElement(t,i){let o=Tt.createElement("template");return o.innerHTML=t,o}};function Ft(e,t,i=e,o){var r,s,n,a;if(t===dt)return t;let l=o!==void 0?(r=i._$Co)===null||r===void 0?void 0:r[o]:i._$Cl,c=ne(t)?void 0:t._$litDirective$;return l?.constructor!==c&&((s=l?._$AO)===null||s===void 0||s.call(l,!1),c===void 0?l=void 0:(l=new c(e),l._$AT(e,i,o)),o!==void 0?((n=(a=i)._$Co)!==null&&n!==void 0?n:a._$Co=[])[o]=l:i._$Cl=l),l!==void 0&&(t=Ft(e,l._$AS(e,t.values),l,o)),t}var ii=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;let{el:{content:o},parts:r}=this._$AD,s=((i=t?.creationScope)!==null&&i!==void 0?i:Tt).importNode(o,!0);$t.currentNode=s;let n=$t.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let d;c.type===2?d=new le(n,n.nextSibling,this,t):c.type===1?d=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(d=new ni(n,this,t)),this._$AV.push(d),c=r[++l]}a!==c?.index&&(n=$t.nextNode(),a++)}return $t.currentNode=Tt,s}v(t){let i=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}},le=class e{constructor(t,i,o,r){var s;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=r,this._$Cp=(s=r?.isConnected)===null||s===void 0||s}get _$AU(){var t,i;return(i=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&i!==void 0?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Ft(this,t,i),ne(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==dt&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Go(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==b&&ne(this._$AH)?this._$AA.nextSibling.data=t:this.$(Tt.createTextNode(t)),this._$AH=t}g(t){var i;let{values:o,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=ae.createElement(to(r.h,r.h[0]),this.options)),r);if(((i=this._$AH)===null||i===void 0?void 0:i._$AD)===s)this._$AH.v(o);else{let n=new ii(s,this),a=n.u(this.options);n.v(o),this.$(a),this._$AH=n}}_$AC(t){let i=Gi.get(t.strings);return i===void 0&&Gi.set(t.strings,i=new ae(t)),i}T(t){Ji(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,o,r=0;for(let s of t)r===i.length?i.push(o=new e(this.k(se()),this.k(se()),this,this.options)):o=i[r],o._$AI(s),r++;r<i.length&&(this._$AR(o&&o._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,i){var o;for((o=this._$AP)===null||o===void 0||o.call(this,!1,!0,i);t&&t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){var i;this._$AM===void 0&&(this._$Cp=t,(i=this._$AP)===null||i===void 0||i.call(this,t))}},Wt=class{constructor(t,i,o,r,s){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=i,this._$AM=r,this.options=s,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=b}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,o,r){let s=this.strings,n=!1;if(s===void 0)t=Ft(this,t,i,0),n=!ne(t)||t!==this._$AH&&t!==dt,n&&(this._$AH=t);else{let a=t,l,c;for(t=s[0],l=0;l<s.length-1;l++)c=Ft(this,a[o+l],i,l),c===dt&&(c=this._$AH[l]),n||(n=!ne(c)||c!==this._$AH[l]),c===b?t=b:t!==b&&(t+=(c??"")+s[l+1]),this._$AH[l]=c}n&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},oi=class extends Wt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}},Yo=jt?jt.emptyScript:"",ri=class extends Wt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==b?this.element.setAttribute(this.name,Yo):this.element.removeAttribute(this.name)}},si=class extends Wt{constructor(t,i,o,r,s){super(t,i,o,r,s),this.type=5}_$AI(t,i=this){var o;if((t=(o=Ft(this,t,i,0))!==null&&o!==void 0?o:b)===dt)return;let r=this._$AH,s=t===b&&r!==b||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==b&&(r===b||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,o;typeof this._$AH=="function"?this._$AH.call((o=(i=this.options)===null||i===void 0?void 0:i.host)!==null&&o!==void 0?o:this.element,t):this._$AH.handleEvent(t)}},ni=class{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){Ft(this,t)}};var Xi=Ce.litHtmlPolyfillSupport;Xi?.(ae,le),((Qe=Ce.litHtmlVersions)!==null&&Qe!==void 0?Qe:Ce.litHtmlVersions=[]).push("2.8.0");var eo=(e,t,i)=>{var o,r;let s=(o=i?.renderBefore)!==null&&o!==void 0?o:t,n=s._$litPart$;if(n===void 0){let a=(r=i?.renderBefore)!==null&&r!==void 0?r:null;s._$litPart$=n=new le(t.insertBefore(se(),a),a,void 0,i??{})}return n._$AI(e),n};var ai,li;var P=class extends lt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;let o=super.createRenderRoot();return(t=(i=this.renderOptions).renderBefore)!==null&&t!==void 0||(i.renderBefore=o.firstChild),o}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=eo(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return dt}};P.finalized=!0,P._$litElement$=!0,(ai=globalThis.litElementHydrateSupport)===null||ai===void 0||ai.call(globalThis,{LitElement:P});var io=globalThis.litElementPolyfillSupport;io?.({LitElement:P});((li=globalThis.litElementVersions)!==null&&li!==void 0?li:globalThis.litElementVersions=[]).push("3.3.3");var Jo=(e,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}},Zo=(e,t,i)=>{t.constructor.createProperty(i,e)};function h(e){return(t,i)=>i!==void 0?Zo(e,t,i):Jo(e,t)}var V=e=>e??b;var Qo=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",tr="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",er="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",ir="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",or=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,di=(e,t,i,o)=>{for(var r=o>1?void 0:o?rr(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&or(t,i,r),r},Kt,ce=(Kt=class extends P{static parseLevel(e){if(e){let t=Object.keys(Gt).find(i=>i.toLowerCase()===e.toLowerCase());return t&&Gt[t]}}static get styles(){return[at`
|
|
4
4
|
${X(Qo)}
|
|
5
|
-
`]}render(){return
|
|
5
|
+
`]}render(){return A`${this.iconToUse&&A`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(e){return e.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(e)}get iconForLevel(){switch(Kt.parseLevel(this.level)){case"warn":return ir;case"suggest":return er;case"error":return tr;default:return null}}},Kt.ID="sd-field-validation-message",Kt.levelConverter={fromAttribute(e){return Kt.parseLevel(e)},toAttribute(e){return e&&e.toLowerCase()}},Kt);di([h({type:String,attribute:!0})],ce.prototype,"message",2);di([h({type:String,attribute:!0})],ce.prototype,"icon",2);di([h({converter:ce.levelConverter,reflect:!0})],ce.prototype,"level",2);var de=ce,Gt=(e=>(e.Warn="warn",e.Suggest="suggest",e.Error="error",e))(Gt||{});customElements.get(de.ID)||customElements.define(de.ID,de);var sr=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}:host([validationlevel=warn]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn]) .label,:host([validationlevel=warn]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest]) .label,:host([validationlevel=suggest]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error]) .label,:host([validationlevel=error]) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{position:relative}.validation-message{position:absolute;left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input,.validation-message{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}.input::-ms-clear{display:none}.input::placeholder{color:var(--sd-input-color, #767676)}.input:-ms-input-placeholder{color:var(--sd-input-color, #767676)}.input::-ms-input-placeholder{color:var(--sd-input-color, #767676)}.underline{height:2px;width:100%;position:relative}.unfocused-line,.focused-line{position:absolute;top:0;right:0;bottom:0;left:0}.unfocused-line{border-bottom:1px solid var(--sd-input-underline-color, #959595)}.focused-line{border-bottom:2px solid var(--sd-input-focused-color, #1467ba);transform-origin:center center;transform:scale3d(0,1,1)}.prefix,.suffix{display:flex;flex-wrap:nowrap;max-width:100%}.prefix ::slotted(*),.suffix ::slotted(*){display:flex}",nr=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,D=(e,t,i,o)=>{for(var r=o>1?void 0:o?ar(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&nr(t,i,r),r},lr="sd-lit-input",oo="delegatesFocus"in window.ShadowRoot.prototype,dr=0,nt,T=(nt=class extends P{constructor(){super(),this.rows=1,this.effectiveDisabled=!1,this.type="text",this.autocomplete="off";let e=dr++;this._validationMessageId=nt.ID+"_message_"+e,this._inputId=nt.ID+"_input_"+e,this.attachInternals&&!this.activeShadyDOM&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabIndex")||(this.tabIndex=0)}firstUpdated(e){super.firstUpdated(e),this.initAutocompleted(this.inputElement),this.updateInitialValue(),this.hasAttribute("disabled")&&(this.disabled=!0),this.inputElement.oninput=t=>{this.autocompleted=t.inputType==="insertReplacementText"||!("data"in t),this.currentText=this.inputElement.value,this.fireValueChange(!0)},this.inputElement.onchange=()=>this.fireValueChange(),oo||(this.inputElement.onfocus=()=>this.setAttribute("focused",""),this.inputElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",t=>{t.target===this&&this.inputElement.focus()})),this.addEventListener("keydown",t=>{var i,o;t.key=="Enter"&&((o=(i=this._internals)==null?void 0:i.form)==null||o.requestSubmit())}),this._initialized=!0}initAutocompleted(e){let t=i=>{/^onautofillstart(-sd-lit-input-\d+|\s?)$/.test(i.animationName)?this.autocompleted=!0:/^onautofillcancel(-sd-lit-input-\d+|\s?)$/.test(i.animationName)&&(this.autocompleted=!1)};this.activeShadyDOM?(this._needsAutocompletedCheck=!0,this.activeShadyDOM.nativeMethods.addEventListener.call(e,"animationstart",t)):e.addEventListener("animationstart",t)}get activeShadyDOM(){let e=window.ShadyDOM;return e&&e.inUse?e:null}updateInitialValue(){typeof this.currentText<"u"?this.value=this.currentText:this.value=this.getAttribute("value"),this.value&&(this.currentText=this.inputElement.value),this._initialValue=this.value}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this._internals||(this.effectiveDisabled=e)}get inputElement(){return this.shadowRoot&&!this._inputElement&&(this._inputElement=this.shadowRoot.querySelector(".input")),this._inputElement}get value(){return this.inputElement&&this.inputElement.value}set value(e){this.currentText=e||"",this.inputElement&&(this.inputElement.value=this.currentText),this.setFormValue(this.currentText)}get selectionStart(){return this.inputElement?this.inputElement.selectionStart:0}focus(){this.inputElement?this.inputElement.focus():super.focus()}select(){this.inputElement&&this.inputElement.select()}setSelectionRange(e,t){this.updateComplete.then(()=>{this.inputElement&&this.inputElement.setSelectionRange(e,t)})}static get styles(){return[at`
|
|
6
6
|
${X(sr)}
|
|
7
|
-
`]}render(){let e;return this.rows===1?e=
|
|
7
|
+
`]}render(){let e;return this.rows===1?e=A`
|
|
8
8
|
<input
|
|
9
9
|
id=${this._inputId}
|
|
10
10
|
class="input"
|
|
@@ -21,7 +21,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
21
21
|
aria-invalid=${V(!!this.validationMessage||void 0)}
|
|
22
22
|
aria-label=${V(this.sdAriaLabel||void 0)}
|
|
23
23
|
/>
|
|
24
|
-
`:e=
|
|
24
|
+
`:e=A`
|
|
25
25
|
<textarea
|
|
26
26
|
id=${this._inputId}
|
|
27
27
|
class="input"
|
|
@@ -38,12 +38,12 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
38
38
|
aria-invalid=${V(!!this.validationMessage||void 0)}
|
|
39
39
|
aria-label=${V(this.sdAriaLabel||void 0)}
|
|
40
40
|
></textarea>
|
|
41
|
-
`,
|
|
42
|
-
${this.label?
|
|
41
|
+
`,A`
|
|
42
|
+
${this.label?A` <div class="floated-label-placeholder" aria-hidden="true"> </div> `:b}
|
|
43
43
|
<div class="input-wrapper">
|
|
44
44
|
<span class="prefix"><slot name="prefix"></slot></span>
|
|
45
45
|
<div class="input-container" style="position:${this.shouldFloat()?"static":"relative"};">
|
|
46
|
-
${this.label&&
|
|
46
|
+
${this.label&&A`
|
|
47
47
|
<label for="${this._inputId}" class="label ${this.shouldFloat()?"float":""}"
|
|
48
48
|
>${this.label}</label
|
|
49
49
|
>
|
|
@@ -57,7 +57,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
57
57
|
<div class="focused-line"></div>
|
|
58
58
|
</div>
|
|
59
59
|
<div class="validation-message-wrapper" aria-hidden="true">
|
|
60
|
-
${this.validationMessage&&
|
|
60
|
+
${this.validationMessage&&A`
|
|
61
61
|
<sd-field-validation-message
|
|
62
62
|
id=${this._validationMessageId}
|
|
63
63
|
class="validation-message"
|
|
@@ -70,9 +70,9 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
70
70
|
</div>
|
|
71
71
|
`}updated(e){super.updated(e),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0)}update(e){var t,i;if(super.update(e),e.has("validationMessage")&&(this.validationMessage?(this.validationLevel||(this.validationLevel=Gt.Error),(t=this._internals)==null||t.setValidity({customError:!0},this.validationMessage)):(this.validationLevel=null,(i=this._internals)==null||i.setValidity({}))),this._initialized&&e.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(e){this.dispatchEvent(new CustomEvent(`${e?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted}setFormValue(e){var t;(t=this._internals)==null||t.setFormValue(e)}formResetCallback(){this.value=this._initialValue}formDisabledCallback(e){this.effectiveDisabled=e||this.hasAttribute("disabled")}formAssociatedCallback(e){this._needsAutocompletedCheck=!0}formStateRestoreCallback(e,t){typeof e=="string"&&(this.value=e)}},nt.ID=lr,nt.DEFAULT_MAX_LENGTH=524288,nt.formAssociated=!0,nt.shadowRootOptions={...P.shadowRootOptions,delegatesFocus:oo},nt);D([h({type:String,reflect:!0})],T.prototype,"label",2);D([h({type:String,attribute:!0})],T.prototype,"validationMessage",2);D([h({type:String,attribute:!0})],T.prototype,"validationIconSrc",2);D([h({type:Gt,attribute:!0,reflect:!0})],T.prototype,"validationLevel",2);D([h({type:String,hasChanged(e,t){return t!=null&&t!=e}})],T.prototype,"currentText",2);D([h({type:Boolean,attribute:!0})],T.prototype,"alwaysFloatLabel",2);D([h({type:Boolean,attribute:!0})],T.prototype,"autocompleted",2);D([h({type:Number,attribute:!0})],T.prototype,"rows",2);D([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],T.prototype,"effectiveDisabled",2);D([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],T.prototype,"extendedPrefix",2);D([h({type:String,reflect:!0})],T.prototype,"type",2);D([h({type:String,reflect:!0})],T.prototype,"placeholder",2);D([h({type:String,reflect:!0})],T.prototype,"sdAriaLabel",2);D([h({type:Number,reflect:!0})],T.prototype,"maxlength",2);D([h({type:Boolean,reflect:!0})],T.prototype,"readonly",2);D([h({type:Boolean,reflect:!0})],T.prototype,"required",2);D([h({type:String,reflect:!0})],T.prototype,"name",2);D([h({type:Boolean,reflect:!0})],T.prototype,"inactive",2);D([h({type:String,attribute:!0})],T.prototype,"autocomplete",2);var ci=T;customElements.get(ci.ID)||customElements.define(ci.ID,ci);var ro={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Te=e=>(...t)=>({_$litDirective$:e,values:t}),$e=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,o){this._$Ct=t,this._$AM=i,this._$Ci=o}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var Lt=class extends $e{constructor(t){if(super(t),this.et=b,t.type!==ro.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===b||t==null)return this.ft=void 0,this.et=t;if(t===dt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;let i=[t];return i.raw=i,this.ft={_$litType$:this.constructor.resultType,strings:i,values:[]}}};Lt.directiveName="unsafeHTML",Lt.resultType=1;var so=Te(Lt);var Xt=class{static showImage(t,i,o,r){let s;if(r||!(t instanceof HTMLImageElement)?s=n=>t.style.backgroundImage=this.prepareSrc(n):s=n=>t.src=n,s(o),i){let n=()=>{s(i)},a=new Image;a.addEventListener("load",n),a.src=i,a.complete&&(a.removeEventListener("load",n),n())}}static prepareSrc(t){return t?t.startsWith("url")?t:`url("${t}")`:null}};var cr=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',hr=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,W=(e,t,i,o)=>{for(var r=o>1?void 0:o?pr(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&hr(t,i,r),r},Ot,j=(Ot=class extends P{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[at`
|
|
72
72
|
${X(cr)}
|
|
73
|
-
`]}render(){return
|
|
73
|
+
`]}render(){return A`
|
|
74
74
|
<div class="container">
|
|
75
|
-
${this.getLevelIndicators().map((e,t)=>
|
|
75
|
+
${this.getLevelIndicators().map((e,t)=>A` <div class="level-indicator level-${t}"></div> `)}
|
|
76
76
|
<div class="side-content">
|
|
77
77
|
<slot name="left-content"></slot>
|
|
78
78
|
${this.renderIcon()}
|
|
@@ -85,7 +85,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
85
85
|
<slot name="right-content"></slot>
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
|
-
`}renderIcon(){if(this.icon||this.iconPlaceholder){let e=this.iconBackgroundColor!=null?`background-color:${this.iconBackgroundColor}`:void 0;return
|
|
88
|
+
`}renderIcon(){if(this.icon||this.iconPlaceholder){let e=this.iconBackgroundColor!=null?`background-color:${this.iconBackgroundColor}`:void 0;return A`
|
|
89
89
|
<div
|
|
90
90
|
class="icon-wrapper"
|
|
91
91
|
@pointerdown="${this.handleIconClick}"
|
|
@@ -96,44 +96,44 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var We=Object.
|
|
|
96
96
|
>
|
|
97
97
|
<div class="icon"></div>
|
|
98
98
|
</div>
|
|
99
|
-
`}return b}renderLabel(e,t,i){return t?
|
|
99
|
+
`}return b}renderLabel(e,t,i){return t?A`
|
|
100
100
|
<div class="${e}" title="${V(i)}">
|
|
101
101
|
${this.contentMode==="html"?so(t):t}
|
|
102
102
|
</div>
|
|
103
|
-
`:b}updated(e){super.updated(e),(e.has("icon")||e.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Xt.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),e.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let e=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,i=this.shadowRoot.querySelector(".caption");i&&(t+=i.scrollWidth-i.clientWidth);let o=this.shadowRoot.querySelector(".description");return o&&(t=Math.max(t,o.scrollWidth-o.clientWidth)),t>0&&t++,e&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(e){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",e))&&e.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Ot.ID="sd-list-item",Ot.ensureDefined=()=>{customElements.get(Ot.ID)||customElements.define(Ot.ID,Ot)},Ot);W([h({type:String})],j.prototype,"caption",2);W([h({type:String})],j.prototype,"description",2);W([h({type:Boolean})],j.prototype,"selected",2);W([h({type:String})],j.prototype,"icon",2);W([h({type:String})],j.prototype,"iconBackgroundColor",2);W([h({type:String})],j.prototype,"iconPlaceholder",2);W([h({type:Number})],j.prototype,"level",2);W([h()],j.prototype,"contentMode",2);W([h({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],j.prototype,"enableLineClamp",2);W([h({type:Boolean,reflect:!0,attribute:"aria-disabled"})],j.prototype,"disabled",2);W([h({type:String,attribute:"icon-attr-aria-label"})],j.prototype,"iconAttrAriaLabel",2);W([h({type:String,reflect:!0})],j.prototype,"role",2);W([h({type:String,attribute:"caption-attr-title"})],j.prototype,"captionAttrTitle",2);W([h({type:String,attribute:"description-attr-title"})],j.prototype,"descriptionAttrTitle",2);W([h({type:String,attribute:"icon-attr-title"})],j.prototype,"iconAttrTitle",2);var Pt=j,Le=(e,t)=>{let i=document.createElement(Pt.ID);if(e){if(i.caption=e.caption,i.description=e.description,i.icon=e.icon,i.iconBackgroundColor=e.iconBackgroundColor,i.iconPlaceholder=e.iconPlaceholder,i.level=e.level,i.disabled=e.disabled,e.contentMode&&(i.contentMode=e.contentMode),e.leftContentGenerator){let o=e.leftContentGenerator(e,i);o&&(o.slot="left-content",i.appendChild(o))}if(e.rightContentGenerator){let o=e.rightContentGenerator(e,i);o&&(o.slot="right-content",i.appendChild(o))}}return i};Pt.ensureDefined();var S="top",M="bottom",L="right",$="left",Oe="auto",gt=[S,M,L,$],ct="start",Dt="end",no="clippingParents",Pe="viewport",Yt="popper",ao="reference",hi=gt.reduce(function(e,t){return e.concat([t+"-"+ct,t+"-"+Dt])},[]),De=[].concat(gt,[Oe]).reduce(function(e,t){return e.concat([t,t+"-"+ct,t+"-"+Dt])},[]),ur="beforeRead",fr="read",mr="afterRead",vr="beforeMain",gr="main",br="afterMain",yr="beforeWrite",xr="write",wr="afterWrite",lo=[ur,fr,mr,vr,gr,br,yr,xr,wr];function H(e){return e?(e.nodeName||"").toLowerCase():null}function A(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function J(e){var t=A(e).Element;return e instanceof t||e instanceof Element}function R(e){var t=A(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Jt(e){if(typeof ShadowRoot>"u")return!1;var t=A(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _r(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var o=t.styles[i]||{},r=t.attributes[i]||{},s=t.elements[i];!R(s)||!H(s)||(Object.assign(s.style,o),Object.keys(r).forEach(function(n){var a=r[n];a===!1?s.removeAttribute(n):s.setAttribute(n,a===!0?"":a)}))})}function Er(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],s=t.attributes[o]||{},n=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:i[o]),a=n.reduce(function(l,c){return l[c]="",l},{});!R(r)||!H(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}var co={name:"applyStyles",enabled:!0,phase:"write",fn:_r,effect:Er,requires:["computeStyles"]};function U(e){return e.split("-")[0]}var ot=Math.max,Mt=Math.min,ht=Math.round;function Zt(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function he(){return!/^((?!chrome|android).)*safari/i.test(Zt())}function Z(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var o=e.getBoundingClientRect(),r=1,s=1;t&&R(e)&&(r=e.offsetWidth>0&&ht(o.width)/e.offsetWidth||1,s=e.offsetHeight>0&&ht(o.height)/e.offsetHeight||1);var n=J(e)?A(e):window,a=n.visualViewport,l=!he()&&i,c=(o.left+(l&&a?a.offsetLeft:0))/r,d=(o.top+(l&&a?a.offsetTop:0))/s,p=o.width/r,f=o.height/s;return{width:p,height:f,top:d,right:c+p,bottom:d+f,left:c,x:c,y:d}}function Rt(e){var t=Z(e),i=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:o}}function pe(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Jt(i)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function K(e){return A(e).getComputedStyle(e)}function pi(e){return["table","td","th"].indexOf(H(e))>=0}function B(e){return((J(e)?e.ownerDocument:e.document)||window.document).documentElement}function pt(e){return H(e)==="html"?e:e.assignedSlot||e.parentNode||(Jt(e)?e.host:null)||B(e)}function ho(e){return!R(e)||K(e).position==="fixed"?null:e.offsetParent}function Ar(e){var t=/firefox/i.test(Zt()),i=/Trident/i.test(Zt());if(i&&R(e)){var o=K(e);if(o.position==="fixed")return null}var r=pt(e);for(Jt(r)&&(r=r.host);R(r)&&["html","body"].indexOf(H(r))<0;){var s=K(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function rt(e){for(var t=A(e),i=ho(e);i&&pi(i)&&K(i).position==="static";)i=ho(i);return i&&(H(i)==="html"||H(i)==="body"&&K(i).position==="static")?t:i||Ar(e)||t}function Nt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ht(e,t,i){return ot(e,Mt(t,i))}function po(e,t,i){var o=Ht(e,t,i);return o>i?i:o}function ue(){return{top:0,right:0,bottom:0,left:0}}function fe(e){return Object.assign({},ue(),e)}function me(e,t){return t.reduce(function(i,o){return i[o]=e,i},{})}var kr=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,fe(typeof t!="number"?t:me(t,gt))};function Sr(e){var t,i=e.state,o=e.name,r=e.options,s=i.elements.arrow,n=i.modifiersData.popperOffsets,a=U(i.placement),l=Nt(a),c=[$,L].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!n)){var p=kr(r.padding,i),f=Rt(s),u=l==="y"?S:$,w=l==="y"?M:L,m=i.rects.reference[d]+i.rects.reference[l]-n[l]-i.rects.popper[d],g=n[l]-i.rects.reference[l],_=rt(s),I=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,C=m/2-g/2,v=p[u],y=I-f[d]-p[w],x=I/2-f[d]/2+C,k=Ht(v,x,y),z=l;i.modifiersData[o]=(t={},t[z]=k,t.centerOffset=k-x,t)}}function Ir(e){var t=e.state,i=e.options,o=i.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||pe(t.elements.popper,r)&&(t.elements.arrow=r))}var uo={name:"arrow",enabled:!0,phase:"main",fn:Sr,effect:Ir,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var Cr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $r(e,t){var i=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:ht(i*r)/r||0,y:ht(o*r)/r||0}}function fo(e){var t,i=e.popper,o=e.popperRect,r=e.placement,s=e.variation,n=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,f=n.x,u=f===void 0?0:f,w=n.y,m=w===void 0?0:w,g=typeof d=="function"?d({x:u,y:m}):{x:u,y:m};u=g.x,m=g.y;var _=n.hasOwnProperty("x"),I=n.hasOwnProperty("y"),C=$,v=S,y=window;if(c){var x=rt(i),k="clientHeight",z="clientWidth";if(x===A(i)&&(x=B(i),K(x).position!=="static"&&a==="absolute"&&(k="scrollHeight",z="scrollWidth")),x=x,r===S||(r===$||r===L)&&s===Dt){v=M;var N=p&&x===y&&y.visualViewport?y.visualViewport.height:x[k];m-=N-o.height,m*=l?1:-1}if(r===$||(r===S||r===M)&&s===Dt){C=L;var O=p&&x===y&&y.visualViewport?y.visualViewport.width:x[z];u-=O-o.width,u*=l?1:-1}}var q=Object.assign({position:a},c&&Cr),et=d===!0?$r({x:u,y:m},A(i)):{x:u,y:m};if(u=et.x,m=et.y,l){var F;return Object.assign({},q,(F={},F[v]=I?"0":"",F[C]=_?"0":"",F.transform=(y.devicePixelRatio||1)<=1?"translate("+u+"px, "+m+"px)":"translate3d("+u+"px, "+m+"px, 0)",F))}return Object.assign({},q,(t={},t[v]=I?m+"px":"",t[C]=_?u+"px":"",t.transform="",t))}function Tr(e){var t=e.state,i=e.options,o=i.gpuAcceleration,r=o===void 0?!0:o,s=i.adaptive,n=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:U(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,fo(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,fo(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var mo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Tr,data:{}};var Me={passive:!0};function Lr(e){var t=e.state,i=e.instance,o=e.options,r=o.scroll,s=r===void 0?!0:r,n=o.resize,a=n===void 0?!0:n,l=A(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,Me)}),a&&l.addEventListener("resize",i.update,Me),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,Me)}),a&&l.removeEventListener("resize",i.update,Me)}}var vo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Lr,data:{}};var Or={left:"right",right:"left",bottom:"top",top:"bottom"};function Qt(e){return e.replace(/left|right|bottom|top/g,function(t){return Or[t]})}var Pr={start:"end",end:"start"};function Re(e){return e.replace(/start|end/g,function(t){return Pr[t]})}function Ut(e){var t=A(e),i=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:i,scrollTop:o}}function zt(e){return Z(B(e)).left+Ut(e).scrollLeft}function ui(e,t){var i=A(e),o=B(e),r=i.visualViewport,s=o.clientWidth,n=o.clientHeight,a=0,l=0;if(r){s=r.width,n=r.height;var c=he();(c||!c&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:n,x:a+zt(e),y:l}}function fi(e){var t,i=B(e),o=Ut(e),r=(t=e.ownerDocument)==null?void 0:t.body,s=ot(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),n=ot(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+zt(e),l=-o.scrollTop;return K(r||i).direction==="rtl"&&(a+=ot(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:n,x:a,y:l}}function Bt(e){var t=K(e),i=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+o)}function Ne(e){return["html","body","#document"].indexOf(H(e))>=0?e.ownerDocument.body:R(e)&&Bt(e)?e:Ne(pt(e))}function bt(e,t){var i;t===void 0&&(t=[]);var o=Ne(e),r=o===((i=e.ownerDocument)==null?void 0:i.body),s=A(o),n=r?[s].concat(s.visualViewport||[],Bt(o)?o:[]):o,a=t.concat(n);return r?a:a.concat(bt(pt(n)))}function te(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Dr(e,t){var i=Z(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function go(e,t,i){return t===Pe?te(ui(e,i)):J(t)?Dr(t,i):te(fi(B(e)))}function Mr(e){var t=bt(pt(e)),i=["absolute","fixed"].indexOf(K(e).position)>=0,o=i&&R(e)?rt(e):e;return J(o)?t.filter(function(r){return J(r)&&pe(r,o)&&H(r)!=="body"}):[]}function mi(e,t,i,o){var r=t==="clippingParents"?Mr(e):[].concat(t),s=[].concat(r,[i]),n=s[0],a=s.reduce(function(l,c){var d=go(e,c,o);return l.top=ot(d.top,l.top),l.right=Mt(d.right,l.right),l.bottom=Mt(d.bottom,l.bottom),l.left=ot(d.left,l.left),l},go(e,n,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ve(e){var t=e.reference,i=e.element,o=e.placement,r=o?U(o):null,s=o?Q(o):null,n=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(r){case S:l={x:n,y:t.y-i.height};break;case M:l={x:n,y:t.y+t.height};break;case L:l={x:t.x+t.width,y:a};break;case $:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var c=r?Nt(r):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case ct:l[c]=l[c]-(t[d]/2-i[d]/2);break;case Dt:l[c]=l[c]+(t[d]/2-i[d]/2);break;default:}}return l}function st(e,t){t===void 0&&(t={});var i=t,o=i.placement,r=o===void 0?e.placement:o,s=i.strategy,n=s===void 0?e.strategy:s,a=i.boundary,l=a===void 0?no:a,c=i.rootBoundary,d=c===void 0?Pe:c,p=i.elementContext,f=p===void 0?Yt:p,u=i.altBoundary,w=u===void 0?!1:u,m=i.padding,g=m===void 0?0:m,_=fe(typeof g!="number"?g:me(g,gt)),I=f===Yt?ao:Yt,C=e.rects.popper,v=e.elements[w?I:f],y=mi(J(v)?v:v.contextElement||B(e.elements.popper),l,d,n),x=Z(e.elements.reference),k=ve({reference:x,element:C,strategy:"absolute",placement:r}),z=te(Object.assign({},C,k)),N=f===Yt?z:x,O={top:y.top-N.top+_.top,bottom:N.bottom-y.bottom+_.bottom,left:y.left-N.left+_.left,right:N.right-y.right+_.right},q=e.modifiersData.offset;if(f===Yt&&q){var et=q[r];Object.keys(O).forEach(function(F){var Et=[L,M].indexOf(F)>=0?1:-1,At=[S,M].indexOf(F)>=0?"y":"x";O[F]+=et[At]*Et})}return O}function vi(e,t){t===void 0&&(t={});var i=t,o=i.placement,r=i.boundary,s=i.rootBoundary,n=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?De:l,d=Q(o),p=d?a?hi:hi.filter(function(w){return Q(w)===d}):gt,f=p.filter(function(w){return c.indexOf(w)>=0});f.length===0&&(f=p);var u=f.reduce(function(w,m){return w[m]=st(e,{placement:m,boundary:r,rootBoundary:s,padding:n})[U(m)],w},{});return Object.keys(u).sort(function(w,m){return u[w]-u[m]})}function Rr(e){if(U(e)===Oe)return[];var t=Qt(e);return[Re(e),t,Re(t)]}function Nr(e){var t=e.state,i=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=i.mainAxis,s=r===void 0?!0:r,n=i.altAxis,a=n===void 0?!0:n,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,w=u===void 0?!0:u,m=i.allowedAutoPlacements,g=t.options.placement,_=U(g),I=_===g,C=l||(I||!w?[Qt(g)]:Rr(g)),v=[g].concat(C).reduce(function(Vt,mt){return Vt.concat(U(mt)===Oe?vi(t,{placement:mt,boundary:d,rootBoundary:p,padding:c,flipVariations:w,allowedAutoPlacements:m}):mt)},[]),y=t.rects.reference,x=t.rects.popper,k=new Map,z=!0,N=v[0],O=0;O<v.length;O++){var q=v[O],et=U(q),F=Q(q)===ct,Et=[S,M].indexOf(et)>=0,At=Et?"width":"height",G=st(t,{placement:q,boundary:d,rootBoundary:p,altBoundary:f,padding:c}),it=Et?F?L:$:F?M:S;y[At]>x[At]&&(it=Qt(it));var ye=Qt(it),kt=[];if(s&&kt.push(G[et]<=0),a&&kt.push(G[it]<=0,G[ye]<=0),kt.every(function(Vt){return Vt})){N=q,z=!1;break}k.set(q,kt)}if(z)for(var xe=w?3:1,qe=function(mt){var ie=v.find(function(_e){var St=k.get(_e);if(St)return St.slice(0,mt).every(function(Ve){return Ve})});if(ie)return N=ie,"break"},ee=xe;ee>0;ee--){var we=qe(ee);if(we==="break")break}t.placement!==N&&(t.modifiersData[o]._skip=!0,t.placement=N,t.reset=!0)}}var bo={name:"flip",enabled:!0,phase:"main",fn:Nr,requiresIfExists:["offset"],data:{_skip:!1}};function yo(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function xo(e){return[S,L,M,$].some(function(t){return e[t]>=0})}function Hr(e){var t=e.state,i=e.name,o=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,n=st(t,{elementContext:"reference"}),a=st(t,{altBoundary:!0}),l=yo(n,o),c=yo(a,r,s),d=xo(l),p=xo(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var wo={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Hr};function Ur(e,t,i){var o=U(e),r=[$,S].indexOf(o)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,n=s[0],a=s[1];return n=n||0,a=(a||0)*r,[$,L].indexOf(o)>=0?{x:a,y:n}:{x:n,y:a}}function zr(e){var t=e.state,i=e.options,o=e.name,r=i.offset,s=r===void 0?[0,0]:r,n=De.reduce(function(d,p){return d[p]=Ur(p,t.rects,s),d},{}),a=n[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=n}var _o={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:zr};function Br(e){var t=e.state,i=e.name;t.modifiersData[i]=ve({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Eo={name:"popperOffsets",enabled:!0,phase:"read",fn:Br,data:{}};function gi(e){return e==="x"?"y":"x"}function qr(e){var t=e.state,i=e.options,o=e.name,r=i.mainAxis,s=r===void 0?!0:r,n=i.altAxis,a=n===void 0?!1:n,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,f=i.tether,u=f===void 0?!0:f,w=i.tetherOffset,m=w===void 0?0:w,g=st(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),_=U(t.placement),I=Q(t.placement),C=!I,v=Nt(_),y=gi(v),x=t.modifiersData.popperOffsets,k=t.rects.reference,z=t.rects.popper,N=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,O=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),q=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,et={x:0,y:0};if(x){if(s){var F,Et=v==="y"?S:$,At=v==="y"?M:L,G=v==="y"?"height":"width",it=x[v],ye=it+g[Et],kt=it-g[At],xe=u?-z[G]/2:0,qe=I===ct?k[G]:z[G],ee=I===ct?-z[G]:-k[G],we=t.elements.arrow,Vt=u&&we?Rt(we):{width:0,height:0},mt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ue(),ie=mt[Et],_e=mt[At],St=Ht(0,k[G],Vt[G]),Ve=C?k[G]/2-xe-St-ie-O.mainAxis:qe-St-ie-O.mainAxis,Do=C?-k[G]/2+xe+St+_e+O.mainAxis:ee+St+_e+O.mainAxis,je=t.elements.arrow&&rt(t.elements.arrow),Mo=je?v==="y"?je.clientTop||0:je.clientLeft||0:0,Ti=(F=q?.[v])!=null?F:0,Ro=it+Ve-Ti-Mo,No=it+Do-Ti,Li=Ht(u?Mt(ye,Ro):ye,it,u?ot(kt,No):kt);x[v]=Li,et[v]=Li-it}if(a){var Oi,Ho=v==="x"?S:$,Uo=v==="x"?M:L,It=x[y],Ee=y==="y"?"height":"width",Pi=It+g[Ho],Di=It-g[Uo],Fe=[S,$].indexOf(_)!==-1,Mi=(Oi=q?.[y])!=null?Oi:0,Ri=Fe?Pi:It-k[Ee]-z[Ee]-Mi+O.altAxis,Ni=Fe?It+k[Ee]+z[Ee]-Mi-O.altAxis:Di,Hi=u&&Fe?po(Ri,It,Ni):Ht(u?Ri:Pi,It,u?Ni:Di);x[y]=Hi,et[y]=Hi-It}t.modifiersData[o]=et}}var Ao={name:"preventOverflow",enabled:!0,phase:"main",fn:qr,requiresIfExists:["offset"]};function bi(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function yi(e){return e===A(e)||!R(e)?Ut(e):bi(e)}function Vr(e){var t=e.getBoundingClientRect(),i=ht(t.width)/e.offsetWidth||1,o=ht(t.height)/e.offsetHeight||1;return i!==1||o!==1}function xi(e,t,i){i===void 0&&(i=!1);var o=R(t),r=R(t)&&Vr(t),s=B(t),n=Z(e,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!i)&&((H(t)!=="body"||Bt(s))&&(a=yi(t)),R(t)?(l=Z(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=zt(s))),{x:n.left+a.scrollLeft-l.x,y:n.top+a.scrollTop-l.y,width:n.width,height:n.height}}function jr(e){var t=new Map,i=new Set,o=[];e.forEach(function(s){t.set(s.name,s)});function r(s){i.add(s.name);var n=[].concat(s.requires||[],s.requiresIfExists||[]);n.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&r(l)}}),o.push(s)}return e.forEach(function(s){i.has(s.name)||r(s)}),o}function wi(e){var t=jr(e);return lo.reduce(function(i,o){return i.concat(t.filter(function(r){return r.phase===o}))},[])}function _i(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function Ei(e){var t=e.reduce(function(i,o){var r=i[o.name];return i[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,i},{});return Object.keys(t).map(function(i){return t[i]})}var ko={placement:"bottom",modifiers:[],strategy:"absolute"};function So(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Io(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,o=i===void 0?[]:i,r=t.defaultOptions,s=r===void 0?ko:r;return function(a,l,c){c===void 0&&(c=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},ko,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],f=!1,u={state:d,setOptions:function(_){var I=typeof _=="function"?_(d.options):_;m(),d.options=Object.assign({},s,d.options,I),d.scrollParents={reference:J(a)?bt(a):a.contextElement?bt(a.contextElement):[],popper:bt(l)};var C=wi(Ei([].concat(o,d.options.modifiers)));return d.orderedModifiers=C.filter(function(v){return v.enabled}),w(),u.update()},forceUpdate:function(){if(!f){var _=d.elements,I=_.reference,C=_.popper;if(So(I,C)){d.rects={reference:xi(I,rt(C),d.options.strategy==="fixed"),popper:Rt(C)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(O){return d.modifiersData[O.name]=Object.assign({},O.data)});for(var v=0;v<d.orderedModifiers.length;v++){if(d.reset===!0){d.reset=!1,v=-1;continue}var y=d.orderedModifiers[v],x=y.fn,k=y.options,z=k===void 0?{}:k,N=y.name;typeof x=="function"&&(d=x({state:d,options:z,name:N,instance:u})||d)}}}},update:_i(function(){return new Promise(function(g){u.forceUpdate(),g(d)})}),destroy:function(){m(),f=!0}};if(!So(a,l))return u;u.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function w(){d.orderedModifiers.forEach(function(g){var _=g.name,I=g.options,C=I===void 0?{}:I,v=g.effect;if(typeof v=="function"){var y=v({state:d,name:_,instance:u,options:C}),x=function(){};p.push(y||x)}})}function m(){p.forEach(function(g){return g()}),p=[]}return u}}var Fr=[vo,Eo,mo,co,_o,bo,Ao,uo,wo],Ai=Io({defaultModifiers:Fr});var Wr=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="12" viewBox="0 0 24 12">\r
|
|
103
|
+
`:b}updated(e){super.updated(e),(e.has("icon")||e.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Xt.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),e.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let e=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,i=this.shadowRoot.querySelector(".caption");i&&(t+=i.scrollWidth-i.clientWidth);let o=this.shadowRoot.querySelector(".description");return o&&(t=Math.max(t,o.scrollWidth-o.clientWidth)),t>0&&t++,e&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(e){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",e))&&e.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Ot.ID="sd-list-item",Ot.ensureDefined=()=>{customElements.get(Ot.ID)||customElements.define(Ot.ID,Ot)},Ot);W([h({type:String})],j.prototype,"caption",2);W([h({type:String})],j.prototype,"description",2);W([h({type:Boolean})],j.prototype,"selected",2);W([h({type:String})],j.prototype,"icon",2);W([h({type:String})],j.prototype,"iconBackgroundColor",2);W([h({type:String})],j.prototype,"iconPlaceholder",2);W([h({type:Number})],j.prototype,"level",2);W([h()],j.prototype,"contentMode",2);W([h({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],j.prototype,"enableLineClamp",2);W([h({type:Boolean,reflect:!0,attribute:"aria-disabled"})],j.prototype,"disabled",2);W([h({type:String,attribute:"icon-attr-aria-label"})],j.prototype,"iconAttrAriaLabel",2);W([h({type:String,reflect:!0})],j.prototype,"role",2);W([h({type:String,attribute:"caption-attr-title"})],j.prototype,"captionAttrTitle",2);W([h({type:String,attribute:"description-attr-title"})],j.prototype,"descriptionAttrTitle",2);W([h({type:String,attribute:"icon-attr-title"})],j.prototype,"iconAttrTitle",2);var Pt=j,Le=(e,t)=>{let i=document.createElement(Pt.ID);if(e){if(i.caption=e.caption,i.description=e.description,i.icon=e.icon,i.iconBackgroundColor=e.iconBackgroundColor,i.iconPlaceholder=e.iconPlaceholder,i.level=e.level,i.disabled=e.disabled,e.contentMode&&(i.contentMode=e.contentMode),e.leftContentGenerator){let o=e.leftContentGenerator(e,i);o&&(o.slot="left-content",i.appendChild(o))}if(e.rightContentGenerator){let o=e.rightContentGenerator(e,i);o&&(o.slot="right-content",i.appendChild(o))}}return i};Pt.ensureDefined();var S="top",M="bottom",L="right",$="left",Oe="auto",gt=[S,M,L,$],ct="start",Dt="end",no="clippingParents",Pe="viewport",Yt="popper",ao="reference",hi=gt.reduce(function(e,t){return e.concat([t+"-"+ct,t+"-"+Dt])},[]),De=[].concat(gt,[Oe]).reduce(function(e,t){return e.concat([t,t+"-"+ct,t+"-"+Dt])},[]),ur="beforeRead",fr="read",mr="afterRead",vr="beforeMain",gr="main",br="afterMain",yr="beforeWrite",xr="write",wr="afterWrite",lo=[ur,fr,mr,vr,gr,br,yr,xr,wr];function H(e){return e?(e.nodeName||"").toLowerCase():null}function E(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function J(e){var t=E(e).Element;return e instanceof t||e instanceof Element}function R(e){var t=E(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Jt(e){if(typeof ShadowRoot>"u")return!1;var t=E(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _r(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var o=t.styles[i]||{},r=t.attributes[i]||{},s=t.elements[i];!R(s)||!H(s)||(Object.assign(s.style,o),Object.keys(r).forEach(function(n){var a=r[n];a===!1?s.removeAttribute(n):s.setAttribute(n,a===!0?"":a)}))})}function Ar(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],s=t.attributes[o]||{},n=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:i[o]),a=n.reduce(function(l,c){return l[c]="",l},{});!R(r)||!H(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}var co={name:"applyStyles",enabled:!0,phase:"write",fn:_r,effect:Ar,requires:["computeStyles"]};function U(e){return e.split("-")[0]}var ot=Math.max,Mt=Math.min,ht=Math.round;function Zt(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function he(){return!/^((?!chrome|android).)*safari/i.test(Zt())}function Z(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var o=e.getBoundingClientRect(),r=1,s=1;t&&R(e)&&(r=e.offsetWidth>0&&ht(o.width)/e.offsetWidth||1,s=e.offsetHeight>0&&ht(o.height)/e.offsetHeight||1);var n=J(e)?E(e):window,a=n.visualViewport,l=!he()&&i,c=(o.left+(l&&a?a.offsetLeft:0))/r,d=(o.top+(l&&a?a.offsetTop:0))/s,p=o.width/r,f=o.height/s;return{width:p,height:f,top:d,right:c+p,bottom:d+f,left:c,x:c,y:d}}function Rt(e){var t=Z(e),i=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:o}}function pe(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Jt(i)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function K(e){return E(e).getComputedStyle(e)}function pi(e){return["table","td","th"].indexOf(H(e))>=0}function B(e){return((J(e)?e.ownerDocument:e.document)||window.document).documentElement}function pt(e){return H(e)==="html"?e:e.assignedSlot||e.parentNode||(Jt(e)?e.host:null)||B(e)}function ho(e){return!R(e)||K(e).position==="fixed"?null:e.offsetParent}function Er(e){var t=/firefox/i.test(Zt()),i=/Trident/i.test(Zt());if(i&&R(e)){var o=K(e);if(o.position==="fixed")return null}var r=pt(e);for(Jt(r)&&(r=r.host);R(r)&&["html","body"].indexOf(H(r))<0;){var s=K(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function rt(e){for(var t=E(e),i=ho(e);i&&pi(i)&&K(i).position==="static";)i=ho(i);return i&&(H(i)==="html"||H(i)==="body"&&K(i).position==="static")?t:i||Er(e)||t}function Nt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ht(e,t,i){return ot(e,Mt(t,i))}function po(e,t,i){var o=Ht(e,t,i);return o>i?i:o}function ue(){return{top:0,right:0,bottom:0,left:0}}function fe(e){return Object.assign({},ue(),e)}function me(e,t){return t.reduce(function(i,o){return i[o]=e,i},{})}var kr=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,fe(typeof t!="number"?t:me(t,gt))};function Sr(e){var t,i=e.state,o=e.name,r=e.options,s=i.elements.arrow,n=i.modifiersData.popperOffsets,a=U(i.placement),l=Nt(a),c=[$,L].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!n)){var p=kr(r.padding,i),f=Rt(s),u=l==="y"?S:$,w=l==="y"?M:L,m=i.rects.reference[d]+i.rects.reference[l]-n[l]-i.rects.popper[d],g=n[l]-i.rects.reference[l],_=rt(s),I=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,C=m/2-g/2,v=p[u],y=I-f[d]-p[w],x=I/2-f[d]/2+C,k=Ht(v,x,y),z=l;i.modifiersData[o]=(t={},t[z]=k,t.centerOffset=k-x,t)}}function Ir(e){var t=e.state,i=e.options,o=i.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||pe(t.elements.popper,r)&&(t.elements.arrow=r))}var uo={name:"arrow",enabled:!0,phase:"main",fn:Sr,effect:Ir,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var Cr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $r(e,t){var i=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:ht(i*r)/r||0,y:ht(o*r)/r||0}}function fo(e){var t,i=e.popper,o=e.popperRect,r=e.placement,s=e.variation,n=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,f=n.x,u=f===void 0?0:f,w=n.y,m=w===void 0?0:w,g=typeof d=="function"?d({x:u,y:m}):{x:u,y:m};u=g.x,m=g.y;var _=n.hasOwnProperty("x"),I=n.hasOwnProperty("y"),C=$,v=S,y=window;if(c){var x=rt(i),k="clientHeight",z="clientWidth";if(x===E(i)&&(x=B(i),K(x).position!=="static"&&a==="absolute"&&(k="scrollHeight",z="scrollWidth")),x=x,r===S||(r===$||r===L)&&s===Dt){v=M;var N=p&&x===y&&y.visualViewport?y.visualViewport.height:x[k];m-=N-o.height,m*=l?1:-1}if(r===$||(r===S||r===M)&&s===Dt){C=L;var O=p&&x===y&&y.visualViewport?y.visualViewport.width:x[z];u-=O-o.width,u*=l?1:-1}}var q=Object.assign({position:a},c&&Cr),et=d===!0?$r({x:u,y:m},E(i)):{x:u,y:m};if(u=et.x,m=et.y,l){var F;return Object.assign({},q,(F={},F[v]=I?"0":"",F[C]=_?"0":"",F.transform=(y.devicePixelRatio||1)<=1?"translate("+u+"px, "+m+"px)":"translate3d("+u+"px, "+m+"px, 0)",F))}return Object.assign({},q,(t={},t[v]=I?m+"px":"",t[C]=_?u+"px":"",t.transform="",t))}function Tr(e){var t=e.state,i=e.options,o=i.gpuAcceleration,r=o===void 0?!0:o,s=i.adaptive,n=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:U(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,fo(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,fo(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var mo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Tr,data:{}};var Me={passive:!0};function Lr(e){var t=e.state,i=e.instance,o=e.options,r=o.scroll,s=r===void 0?!0:r,n=o.resize,a=n===void 0?!0:n,l=E(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,Me)}),a&&l.addEventListener("resize",i.update,Me),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,Me)}),a&&l.removeEventListener("resize",i.update,Me)}}var vo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Lr,data:{}};var Or={left:"right",right:"left",bottom:"top",top:"bottom"};function Qt(e){return e.replace(/left|right|bottom|top/g,function(t){return Or[t]})}var Pr={start:"end",end:"start"};function Re(e){return e.replace(/start|end/g,function(t){return Pr[t]})}function Ut(e){var t=E(e),i=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:i,scrollTop:o}}function zt(e){return Z(B(e)).left+Ut(e).scrollLeft}function ui(e,t){var i=E(e),o=B(e),r=i.visualViewport,s=o.clientWidth,n=o.clientHeight,a=0,l=0;if(r){s=r.width,n=r.height;var c=he();(c||!c&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:n,x:a+zt(e),y:l}}function fi(e){var t,i=B(e),o=Ut(e),r=(t=e.ownerDocument)==null?void 0:t.body,s=ot(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),n=ot(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-o.scrollLeft+zt(e),l=-o.scrollTop;return K(r||i).direction==="rtl"&&(a+=ot(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:n,x:a,y:l}}function Bt(e){var t=K(e),i=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+o)}function Ne(e){return["html","body","#document"].indexOf(H(e))>=0?e.ownerDocument.body:R(e)&&Bt(e)?e:Ne(pt(e))}function bt(e,t){var i;t===void 0&&(t=[]);var o=Ne(e),r=o===((i=e.ownerDocument)==null?void 0:i.body),s=E(o),n=r?[s].concat(s.visualViewport||[],Bt(o)?o:[]):o,a=t.concat(n);return r?a:a.concat(bt(pt(n)))}function te(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Dr(e,t){var i=Z(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function go(e,t,i){return t===Pe?te(ui(e,i)):J(t)?Dr(t,i):te(fi(B(e)))}function Mr(e){var t=bt(pt(e)),i=["absolute","fixed"].indexOf(K(e).position)>=0,o=i&&R(e)?rt(e):e;return J(o)?t.filter(function(r){return J(r)&&pe(r,o)&&H(r)!=="body"}):[]}function mi(e,t,i,o){var r=t==="clippingParents"?Mr(e):[].concat(t),s=[].concat(r,[i]),n=s[0],a=s.reduce(function(l,c){var d=go(e,c,o);return l.top=ot(d.top,l.top),l.right=Mt(d.right,l.right),l.bottom=Mt(d.bottom,l.bottom),l.left=ot(d.left,l.left),l},go(e,n,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ve(e){var t=e.reference,i=e.element,o=e.placement,r=o?U(o):null,s=o?Q(o):null,n=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(r){case S:l={x:n,y:t.y-i.height};break;case M:l={x:n,y:t.y+t.height};break;case L:l={x:t.x+t.width,y:a};break;case $:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var c=r?Nt(r):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case ct:l[c]=l[c]-(t[d]/2-i[d]/2);break;case Dt:l[c]=l[c]+(t[d]/2-i[d]/2);break;default:}}return l}function st(e,t){t===void 0&&(t={});var i=t,o=i.placement,r=o===void 0?e.placement:o,s=i.strategy,n=s===void 0?e.strategy:s,a=i.boundary,l=a===void 0?no:a,c=i.rootBoundary,d=c===void 0?Pe:c,p=i.elementContext,f=p===void 0?Yt:p,u=i.altBoundary,w=u===void 0?!1:u,m=i.padding,g=m===void 0?0:m,_=fe(typeof g!="number"?g:me(g,gt)),I=f===Yt?ao:Yt,C=e.rects.popper,v=e.elements[w?I:f],y=mi(J(v)?v:v.contextElement||B(e.elements.popper),l,d,n),x=Z(e.elements.reference),k=ve({reference:x,element:C,strategy:"absolute",placement:r}),z=te(Object.assign({},C,k)),N=f===Yt?z:x,O={top:y.top-N.top+_.top,bottom:N.bottom-y.bottom+_.bottom,left:y.left-N.left+_.left,right:N.right-y.right+_.right},q=e.modifiersData.offset;if(f===Yt&&q){var et=q[r];Object.keys(O).forEach(function(F){var At=[L,M].indexOf(F)>=0?1:-1,Et=[S,M].indexOf(F)>=0?"y":"x";O[F]+=et[Et]*At})}return O}function vi(e,t){t===void 0&&(t={});var i=t,o=i.placement,r=i.boundary,s=i.rootBoundary,n=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?De:l,d=Q(o),p=d?a?hi:hi.filter(function(w){return Q(w)===d}):gt,f=p.filter(function(w){return c.indexOf(w)>=0});f.length===0&&(f=p);var u=f.reduce(function(w,m){return w[m]=st(e,{placement:m,boundary:r,rootBoundary:s,padding:n})[U(m)],w},{});return Object.keys(u).sort(function(w,m){return u[w]-u[m]})}function Rr(e){if(U(e)===Oe)return[];var t=Qt(e);return[Re(e),t,Re(t)]}function Nr(e){var t=e.state,i=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=i.mainAxis,s=r===void 0?!0:r,n=i.altAxis,a=n===void 0?!0:n,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,w=u===void 0?!0:u,m=i.allowedAutoPlacements,g=t.options.placement,_=U(g),I=_===g,C=l||(I||!w?[Qt(g)]:Rr(g)),v=[g].concat(C).reduce(function(Vt,mt){return Vt.concat(U(mt)===Oe?vi(t,{placement:mt,boundary:d,rootBoundary:p,padding:c,flipVariations:w,allowedAutoPlacements:m}):mt)},[]),y=t.rects.reference,x=t.rects.popper,k=new Map,z=!0,N=v[0],O=0;O<v.length;O++){var q=v[O],et=U(q),F=Q(q)===ct,At=[S,M].indexOf(et)>=0,Et=At?"width":"height",G=st(t,{placement:q,boundary:d,rootBoundary:p,altBoundary:f,padding:c}),it=At?F?L:$:F?M:S;y[Et]>x[Et]&&(it=Qt(it));var ye=Qt(it),kt=[];if(s&&kt.push(G[et]<=0),a&&kt.push(G[it]<=0,G[ye]<=0),kt.every(function(Vt){return Vt})){N=q,z=!1;break}k.set(q,kt)}if(z)for(var xe=w?3:1,qe=function(mt){var ie=v.find(function(_e){var St=k.get(_e);if(St)return St.slice(0,mt).every(function(Ve){return Ve})});if(ie)return N=ie,"break"},ee=xe;ee>0;ee--){var we=qe(ee);if(we==="break")break}t.placement!==N&&(t.modifiersData[o]._skip=!0,t.placement=N,t.reset=!0)}}var bo={name:"flip",enabled:!0,phase:"main",fn:Nr,requiresIfExists:["offset"],data:{_skip:!1}};function yo(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function xo(e){return[S,L,M,$].some(function(t){return e[t]>=0})}function Hr(e){var t=e.state,i=e.name,o=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,n=st(t,{elementContext:"reference"}),a=st(t,{altBoundary:!0}),l=yo(n,o),c=yo(a,r,s),d=xo(l),p=xo(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var wo={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Hr};function Ur(e,t,i){var o=U(e),r=[$,S].indexOf(o)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,n=s[0],a=s[1];return n=n||0,a=(a||0)*r,[$,L].indexOf(o)>=0?{x:a,y:n}:{x:n,y:a}}function zr(e){var t=e.state,i=e.options,o=e.name,r=i.offset,s=r===void 0?[0,0]:r,n=De.reduce(function(d,p){return d[p]=Ur(p,t.rects,s),d},{}),a=n[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=n}var _o={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:zr};function Br(e){var t=e.state,i=e.name;t.modifiersData[i]=ve({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Ao={name:"popperOffsets",enabled:!0,phase:"read",fn:Br,data:{}};function gi(e){return e==="x"?"y":"x"}function qr(e){var t=e.state,i=e.options,o=e.name,r=i.mainAxis,s=r===void 0?!0:r,n=i.altAxis,a=n===void 0?!1:n,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,f=i.tether,u=f===void 0?!0:f,w=i.tetherOffset,m=w===void 0?0:w,g=st(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),_=U(t.placement),I=Q(t.placement),C=!I,v=Nt(_),y=gi(v),x=t.modifiersData.popperOffsets,k=t.rects.reference,z=t.rects.popper,N=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,O=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),q=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,et={x:0,y:0};if(x){if(s){var F,At=v==="y"?S:$,Et=v==="y"?M:L,G=v==="y"?"height":"width",it=x[v],ye=it+g[At],kt=it-g[Et],xe=u?-z[G]/2:0,qe=I===ct?k[G]:z[G],ee=I===ct?-z[G]:-k[G],we=t.elements.arrow,Vt=u&&we?Rt(we):{width:0,height:0},mt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ue(),ie=mt[At],_e=mt[Et],St=Ht(0,k[G],Vt[G]),Ve=C?k[G]/2-xe-St-ie-O.mainAxis:qe-St-ie-O.mainAxis,Do=C?-k[G]/2+xe+St+_e+O.mainAxis:ee+St+_e+O.mainAxis,je=t.elements.arrow&&rt(t.elements.arrow),Mo=je?v==="y"?je.clientTop||0:je.clientLeft||0:0,Ti=(F=q?.[v])!=null?F:0,Ro=it+Ve-Ti-Mo,No=it+Do-Ti,Li=Ht(u?Mt(ye,Ro):ye,it,u?ot(kt,No):kt);x[v]=Li,et[v]=Li-it}if(a){var Oi,Ho=v==="x"?S:$,Uo=v==="x"?M:L,It=x[y],Ae=y==="y"?"height":"width",Pi=It+g[Ho],Di=It-g[Uo],Fe=[S,$].indexOf(_)!==-1,Mi=(Oi=q?.[y])!=null?Oi:0,Ri=Fe?Pi:It-k[Ae]-z[Ae]-Mi+O.altAxis,Ni=Fe?It+k[Ae]+z[Ae]-Mi-O.altAxis:Di,Hi=u&&Fe?po(Ri,It,Ni):Ht(u?Ri:Pi,It,u?Ni:Di);x[y]=Hi,et[y]=Hi-It}t.modifiersData[o]=et}}var Eo={name:"preventOverflow",enabled:!0,phase:"main",fn:qr,requiresIfExists:["offset"]};function bi(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function yi(e){return e===E(e)||!R(e)?Ut(e):bi(e)}function Vr(e){var t=e.getBoundingClientRect(),i=ht(t.width)/e.offsetWidth||1,o=ht(t.height)/e.offsetHeight||1;return i!==1||o!==1}function xi(e,t,i){i===void 0&&(i=!1);var o=R(t),r=R(t)&&Vr(t),s=B(t),n=Z(e,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!i)&&((H(t)!=="body"||Bt(s))&&(a=yi(t)),R(t)?(l=Z(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=zt(s))),{x:n.left+a.scrollLeft-l.x,y:n.top+a.scrollTop-l.y,width:n.width,height:n.height}}function jr(e){var t=new Map,i=new Set,o=[];e.forEach(function(s){t.set(s.name,s)});function r(s){i.add(s.name);var n=[].concat(s.requires||[],s.requiresIfExists||[]);n.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&r(l)}}),o.push(s)}return e.forEach(function(s){i.has(s.name)||r(s)}),o}function wi(e){var t=jr(e);return lo.reduce(function(i,o){return i.concat(t.filter(function(r){return r.phase===o}))},[])}function _i(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function Ai(e){var t=e.reduce(function(i,o){var r=i[o.name];return i[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,i},{});return Object.keys(t).map(function(i){return t[i]})}var ko={placement:"bottom",modifiers:[],strategy:"absolute"};function So(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Io(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,o=i===void 0?[]:i,r=t.defaultOptions,s=r===void 0?ko:r;return function(a,l,c){c===void 0&&(c=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},ko,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],f=!1,u={state:d,setOptions:function(_){var I=typeof _=="function"?_(d.options):_;m(),d.options=Object.assign({},s,d.options,I),d.scrollParents={reference:J(a)?bt(a):a.contextElement?bt(a.contextElement):[],popper:bt(l)};var C=wi(Ai([].concat(o,d.options.modifiers)));return d.orderedModifiers=C.filter(function(v){return v.enabled}),w(),u.update()},forceUpdate:function(){if(!f){var _=d.elements,I=_.reference,C=_.popper;if(So(I,C)){d.rects={reference:xi(I,rt(C),d.options.strategy==="fixed"),popper:Rt(C)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(O){return d.modifiersData[O.name]=Object.assign({},O.data)});for(var v=0;v<d.orderedModifiers.length;v++){if(d.reset===!0){d.reset=!1,v=-1;continue}var y=d.orderedModifiers[v],x=y.fn,k=y.options,z=k===void 0?{}:k,N=y.name;typeof x=="function"&&(d=x({state:d,options:z,name:N,instance:u})||d)}}}},update:_i(function(){return new Promise(function(g){u.forceUpdate(),g(d)})}),destroy:function(){m(),f=!0}};if(!So(a,l))return u;u.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function w(){d.orderedModifiers.forEach(function(g){var _=g.name,I=g.options,C=I===void 0?{}:I,v=g.effect;if(typeof v=="function"){var y=v({state:d,name:_,instance:u,options:C}),x=function(){};p.push(y||x)}})}function m(){p.forEach(function(g){return g()}),p=[]}return u}}var Fr=[vo,Ao,mo,co,_o,bo,Eo,uo,wo],Ei=Io({defaultModifiers:Fr});var Wr=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="12" viewBox="0 0 24 12">\r
|
|
104
104
|
<path d="M0 0l11.96 12L24 0z" fill="#999" class="arrow-border"/>\r
|
|
105
105
|
<path d="M12 11L1 0h22z" fill="#f2f2f2" class="arrow-background"/>\r
|
|
106
106
|
</svg>\r
|
|
107
|
-
`,Kr=navigator.userAgent.indexOf("Trident")!==-1,Co=1,$o="sd-popover-open",To=class extends HTMLElement{constructor(){super(...arguments),this._open=!1,this._firstUpdated=!1,this.toggle=()=>{this.open=!this.open},this.show=()=>{this.open=!0},this.hide=()=>{this.open=!1},this.hideIfExternalTarget=t=>{let i=t.target;(!(i instanceof HTMLElement)||!this._container.contains(i)&&!this.targetElement.contains(i))&&this.hide()}}get triggerType(){return this.getAttribute("trigger-type")}set triggerType(t){t?this.setAttribute("trigger-type",t):this.removeAttribute("trigger-type")}get placement(){return this.getAttribute("placement")}set placement(t){t?this.setAttribute("placement",t):this.removeAttribute("placement")}get targetElement(){return this._targetElement}set targetElement(t){this.removeTargetEventListener(this.targetElement),this._targetElement&&this._targetElement.getAttribute("aria-expanded")=="true"&&this._targetElement.setAttribute("aria-expanded","false"),this._targetElement=t,t&&t.setAttribute("aria-expanded","false"),this.addTargetEventListener(this.targetElement),this.updatePopper()}get targetSelector(){return this.getAttribute("target-selector")}set targetSelector(t){t?this.setAttribute("target-selector",t):this.removeAttribute("target-selector")}get modal(){return this.hasAttribute("modal")}set modal(t){t?this.setAttribute("modal",""):this.removeAttribute("modal")}get popoverFor(){return this.getAttribute("popover-for")}set popoverFor(t){t?this.setAttribute("popover-for",t):this.removeAttribute("popover-for")}get flipPriority(){return this._flipPriority}set flipPriority(t){t&&t.length>0?this._flipPriority=t:this._flipPriority=null,this.reConfigurePopper()}get offset(){return this.getAttribute("offset")?parseInt(this.getAttribute("offset")):0}set offset(t){t?this.setAttribute("offset",t.toString()):this.removeAttribute("offset"),this.reConfigurePopper()}reConfigurePopper(){this._popper&&this.configurePopper()}get noArrow(){return this.hasAttribute("no-arrow")}set noArrow(t){t?this.setAttribute("no-arrow",""):this.removeAttribute("no-arrow")}static get observedAttributes(){return["placement","target-selector","trigger-type"]}attributeChangedCallback(t,i){switch(t){case"placement":{this.updatePopper();break}case"trigger-type":{this.removeTargetEventListener(this.targetElement),this.addTargetEventListener(this.targetElement);break}case"target-selector":{this.handleTargetSelectorChange(i);break}}}connectedCallback(){this._firstUpdated||(this.firstUpdated(),this._firstUpdated=!0),this.targetElement?this.addTargetEventListener(this.targetElement):this.targetSelector&&requestAnimationFrame(()=>{this.isConnected&&this.handleTargetSelectorChange(null)}),this._arrow=document.createElement("div"),this._arrow.classList.add("popover-arrow"),this._arrow.setAttribute("data-popper-arrow",""),this._arrow.style.display="flex",this._arrow.innerHTML=Wr}disconnectedCallback(){this.targetElement&&(this.removeTargetEventListener(this.targetElement),this.removeTargetClassForOpen(this.targetElement)),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}firstUpdated(){this.style.display="none",this.triggerType=this.triggerType||"click",this.placement=this.placement||"auto"}get open(){return this._open}set open(t){t!==this._open&&(this._open=t,this.handleOpenChange())}handleOpenChange(){this.open?(this._popper||this.configurePopper(),this._container.innerHTML="",this.popoverFor&&this._container.setAttribute("popover-for",this.popoverFor),this.content&&(this._container.prepend(this.content),Object.assign(this.content.style,{position:"relative",display:"block",zIndex:1}),window.requestAnimationFrame(()=>{let t=getComputedStyle(this.content).backgroundColor;t=="rgba(0, 0, 0, 0)"&&(this.content.style.background=t="#f2f2f2"),this._arrow.querySelector(".arrow-background").style.fill=t})),this.ensureArrowIsAdded(),this.ownerDocument.body.appendChild(this._container),this.updatePopper(),this.setAttribute("open",""),this.modal&&(window.addEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.addEventListener("focus",this.hideIfExternalTarget,{capture:!0})),this.targetElement&&(this.addTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","true")),this.dispatchEvent(new CustomEvent("open"))):(this.ownerDocument.body.removeChild(this._container),this.removeAttribute("open"),window.removeEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.removeEventListener("focus",this.hideIfExternalTarget,{capture:!0}),this.targetElement&&(this.removeTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","false")),this.dispatchEvent(new CustomEvent("close")))}handleTargetSelectorChange(t){let i=document.querySelector(t);i&&(this.removeTargetEventListener(i),this.removeTargetClassForOpen(i)),this.targetSelector&&(this.targetElement=document.querySelector(this.targetSelector),this.addTargetEventListener(this.targetElement))}addTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.addEventListener("mouseenter",this.show),t.addEventListener("mouseleave",this.hide);break}case"click":{t.addEventListener("click",this.toggle);break}}}removeTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.removeEventListener("mouseenter",this.show),t.removeEventListener("mouseleave",this.hide);break}case"click":{t.removeEventListener("click",this.toggle);break}}}configurePopper(){this.createContentContainer(),this.ensureArrowIsAdded();let t=this,i={placement:t.placement,strategy:"absolute",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!Kr}},{name:"flip",options:{fallbackPlacements:t._flipPriority}},{name:"offset",options:{offset:()=>[0,t.noArrow?0+t.offset:this._arrow.clientHeight+t.offset]}},{name:"arrow",options:{padding:6}},{name:"resetArrowStyles",enabled:!0,phase:"beforeWrite",fn({state:o}){Object.assign(t._arrow.style,{top:o.styles.arrow.top||"",left:o.styles.arrow.left||"",bottom:o.styles.arrow.bottom||"",right:o.styles.arrow.right||""})}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn({state:o}){t.updateArrow(o.placement)}}]};this._popper=
|
|
107
|
+
`,Kr=navigator.userAgent.indexOf("Trident")!==-1,Co=1,$o="sd-popover-open",To=class extends HTMLElement{constructor(){super(...arguments),this._open=!1,this._firstUpdated=!1,this.toggle=()=>{this.open=!this.open},this.show=()=>{this.open=!0},this.hide=()=>{this.open=!1},this.hideIfExternalTarget=t=>{let i=t.target;(!(i instanceof HTMLElement)||!this._container.contains(i)&&!this.targetElement.contains(i))&&this.hide()}}get triggerType(){return this.getAttribute("trigger-type")}set triggerType(t){t?this.setAttribute("trigger-type",t):this.removeAttribute("trigger-type")}get placement(){return this.getAttribute("placement")}set placement(t){t?this.setAttribute("placement",t):this.removeAttribute("placement")}get targetElement(){return this._targetElement}set targetElement(t){this.removeTargetEventListener(this.targetElement),this._targetElement&&this._targetElement.getAttribute("aria-expanded")=="true"&&this._targetElement.setAttribute("aria-expanded","false"),this._targetElement=t,t&&t.setAttribute("aria-expanded","false"),this.addTargetEventListener(this.targetElement),this.updatePopper()}get targetSelector(){return this.getAttribute("target-selector")}set targetSelector(t){t?this.setAttribute("target-selector",t):this.removeAttribute("target-selector")}get modal(){return this.hasAttribute("modal")}set modal(t){t?this.setAttribute("modal",""):this.removeAttribute("modal")}get popoverFor(){return this.getAttribute("popover-for")}set popoverFor(t){t?this.setAttribute("popover-for",t):this.removeAttribute("popover-for")}get flipPriority(){return this._flipPriority}set flipPriority(t){t&&t.length>0?this._flipPriority=t:this._flipPriority=null,this.reConfigurePopper()}get offset(){return this.getAttribute("offset")?parseInt(this.getAttribute("offset")):0}set offset(t){t?this.setAttribute("offset",t.toString()):this.removeAttribute("offset"),this.reConfigurePopper()}reConfigurePopper(){this._popper&&this.configurePopper()}get noArrow(){return this.hasAttribute("no-arrow")}set noArrow(t){t?this.setAttribute("no-arrow",""):this.removeAttribute("no-arrow")}static get observedAttributes(){return["placement","target-selector","trigger-type"]}attributeChangedCallback(t,i){switch(t){case"placement":{this.updatePopper();break}case"trigger-type":{this.removeTargetEventListener(this.targetElement),this.addTargetEventListener(this.targetElement);break}case"target-selector":{this.handleTargetSelectorChange(i);break}}}connectedCallback(){this._firstUpdated||(this.firstUpdated(),this._firstUpdated=!0),this.targetElement?this.addTargetEventListener(this.targetElement):this.targetSelector&&requestAnimationFrame(()=>{this.isConnected&&this.handleTargetSelectorChange(null)}),this._arrow=document.createElement("div"),this._arrow.classList.add("popover-arrow"),this._arrow.setAttribute("data-popper-arrow",""),this._arrow.style.display="flex",this._arrow.innerHTML=Wr}disconnectedCallback(){this.targetElement&&(this.removeTargetEventListener(this.targetElement),this.removeTargetClassForOpen(this.targetElement)),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}firstUpdated(){this.style.display="none",this.triggerType=this.triggerType||"click",this.placement=this.placement||"auto"}get open(){return this._open}set open(t){t!==this._open&&(this._open=t,this.handleOpenChange())}handleOpenChange(){this.open?(this._popper||this.configurePopper(),this._container.innerHTML="",this.popoverFor&&this._container.setAttribute("popover-for",this.popoverFor),this.content&&(this._container.prepend(this.content),Object.assign(this.content.style,{position:"relative",display:"block",zIndex:1}),window.requestAnimationFrame(()=>{let t=getComputedStyle(this.content).backgroundColor;t=="rgba(0, 0, 0, 0)"&&(this.content.style.background=t="#f2f2f2"),this._arrow.querySelector(".arrow-background").style.fill=t})),this.ensureArrowIsAdded(),this.ownerDocument.body.appendChild(this._container),this.updatePopper(),this.setAttribute("open",""),this.modal&&(window.addEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.addEventListener("focus",this.hideIfExternalTarget,{capture:!0})),this.targetElement&&(this.addTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","true")),this.dispatchEvent(new CustomEvent("open"))):(this.ownerDocument.body.removeChild(this._container),this.removeAttribute("open"),window.removeEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.removeEventListener("focus",this.hideIfExternalTarget,{capture:!0}),this.targetElement&&(this.removeTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","false")),this.dispatchEvent(new CustomEvent("close")))}handleTargetSelectorChange(t){let i=document.querySelector(t);i&&(this.removeTargetEventListener(i),this.removeTargetClassForOpen(i)),this.targetSelector&&(this.targetElement=document.querySelector(this.targetSelector),this.addTargetEventListener(this.targetElement))}addTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.addEventListener("mouseenter",this.show),t.addEventListener("mouseleave",this.hide);break}case"click":{t.addEventListener("click",this.toggle);break}}}removeTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.removeEventListener("mouseenter",this.show),t.removeEventListener("mouseleave",this.hide);break}case"click":{t.removeEventListener("click",this.toggle);break}}}configurePopper(){this.createContentContainer(),this.ensureArrowIsAdded();let t=this,i={placement:t.placement,strategy:"absolute",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!Kr}},{name:"flip",options:{fallbackPlacements:t._flipPriority}},{name:"offset",options:{offset:()=>[0,t.noArrow?0+t.offset:this._arrow.clientHeight+t.offset]}},{name:"arrow",options:{padding:6}},{name:"resetArrowStyles",enabled:!0,phase:"beforeWrite",fn({state:o}){Object.assign(t._arrow.style,{top:o.styles.arrow.top||"",left:o.styles.arrow.left||"",bottom:o.styles.arrow.bottom||"",right:o.styles.arrow.right||""})}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn({state:o}){t.updateArrow(o.placement)}}]};this._popper=Ei(this.targetElement,this._container,i)}createContentContainer(){this._container=document.createElement("div"),this._container.classList.add("popover-container"),this._container.tabIndex=0,this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(()=>{this._popper&&this._popper.update()}),this._resizeObserver.observe(this._container),Object.assign(this._container.style,{boxShadow:`0 4px 5px 0 rgba(0, 0, 0, 0.14),
|
|
108
108
|
0 1px 10px 0 rgba(0, 0, 0, 0.12),
|
|
109
109
|
0 2px 4px -1px rgba(0, 0, 0, 0.4)`,border:"1px solid #999",boxSizing:"border-box",zIndex:2e4})}ensureArrowIsAdded(){!this.noArrow&&!this._container.contains(this._arrow)&&this._container.appendChild(this._arrow)}updatePopper(){this._popper&&(this._popper.state.elements.reference=this.targetElement,this._popper.state.options.placement=this.placement,this.open&&this._popper.update())}updateArrow(t){if(this._arrow){let i=this.getArrowVariant(t);if(this._arrow.setAttribute("variant",i),this._content){let o=this._arrow.querySelector("svg"),r=this._arrow.clientWidth,s=this._arrow.clientHeight,n=`-${s-Co}px`,a=(r-s)/2,l=`-${s+a-Co}px`;switch(i){case"bottom":{this._arrow.style.top=n,o.style.transform="rotate(180deg)";break}case"top":{this._arrow.style.bottom=n,o.style.transform="rotate(0deg)";break}case"left":{this._arrow.style.right=l,o.style.transform="rotate(270deg)";break}case"right":{this._arrow.style.left=l,o.style.transform="rotate(90deg)";break}}}}}getArrowVariant(t){if(t.indexOf("bottom")!==-1)return"bottom";if(t.indexOf("top")!==-1)return"top";if(t.indexOf("left")!==-1)return"left";if(t.indexOf("right")!==-1)return"right"}get content(){return this._content||(this._content=this.firstElementChild,this._content.setAttribute("data-popper-content","")),this._content}addTargetClassForOpen(t){t&&t.classList.add($o)}removeTargetClassForOpen(t){t&&t.classList.remove($o)}};To.ID="sd-popover";var ge=To;customElements.get(ge.ID)||customElements.define(ge.ID,ge);var ki=class{getOffsetForIndexAndAlignment(t,i,o,r,s,n){let a=Math.max(0,n*r),l=Math.min(a,t*r),c=Math.max(0,t*r-s+r);switch(i){case"start":return l;case"end":return c;case"center":{let d=Math.round(c+(l-c)/2);return d<Math.ceil(s/2)?0:d>a+Math.floor(s/2)?a:d}case"auto":default:return o>=c&&o<=l?o:o<c?c:l}}debounce(t){let i;return(...o)=>{i&&window.cancelAnimationFrame(i),i=window.requestAnimationFrame(()=>{t(...o),i=null})}}},Gr=new ki;var Xr=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}",Yr=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,xt=(e,t,i,o)=>{for(var r=o>1?void 0:o?Jr(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&Yr(t,i,r),r};var Zr=0,yt,ut=(yt=class extends P{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=yt.ID+"_"+Zr++,this.role="listbox",this.itemGenerator=Le,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":this.focusIndex=this.normalizeIndex(this.focusIndex+1);break;case"Up":case"ArrowUp":this.focusIndex=this.normalizeIndex(this.focusIndex-1);break;case"Enter":this.handleSelection(this.focusIndex,e.metaKey||e.ctrlKey);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(e.preventDefault(),e.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(e){this.toggleAttribute("focus-target",e)}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.itemCount){let t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToItem(e),t!=e&&(e==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(e){e?this._selectedIndices=e.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(e,t="auto"){this.scrollTop=Gr.getOffsetForIndexAndAlignment(this.normalizeIndex(e),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(e){return!this.shadowRoot||e<this._firstVisibleIndex||this._lastVisibleIndex<e?null:this.querySelector(`[item-index="${e}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){let e=this.getListItem(this.focusIndex);e&&(this.focusTarget||document.activeElement==this?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[at`
|
|
110
110
|
${X(Xr)}
|
|
111
|
-
`]}render(){return this.updateItemsRenderData(),
|
|
111
|
+
`]}render(){return this.updateItemsRenderData(),A`
|
|
112
112
|
<div class="container" style="height: ${this.itemCount*this.itemHeight}px">
|
|
113
113
|
<slot name="items"></slot>
|
|
114
114
|
</div>
|
|
115
115
|
`}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{let t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{let e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(o=>{if(o instanceof Pt){o.enableLineClamp=!1;let r=o.missingWidthForTexts;return r>e&&(o.enableLineClamp=!0),r}}),i=Math.max(...t);i>0&&(this.style.width=`${this.offsetWidth+i}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof Pt&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let e=[...this.querySelectorAll("[item-index]")],t=new Map,i=document.createDocumentFragment();for(let o of this._itemsRenderData){let r=this.renderItem(o);r.parentElement||i.appendChild(r),t.set(o.dataHash,r);let s=e.indexOf(r);s!==-1&&e.splice(s,1)}this.appendChild(i);for(let o of e)o instanceof Pt&&(o.enableLineClamp=!1),this.removeChild(o);t.forEach((o,r)=>{this._elementCache.set(r,o)})}renderItem({index:e,top:t,dataHash:i,data:o}){let r;return o?this._elementCache.has(i)?(r=this._elementCache.get(i),this._elementCache.delete(i)):(r=this.itemGenerator(o,e),r.setAttribute("slot","items")):(r=document.createElement("div"),r.setAttribute("placeholder-item",""),r.setAttribute("slot","items")),Object.assign(r.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),r.setAttribute("item-index",e.toString()),r.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),r.setAttribute("aria-posinset",String(e+1)),(!r.id||r.id.startsWith(this.id+"_item_"))&&(r.id=this.id+"_item_"+e),this.itemCount-1==e?r.setAttribute("last",""):r.removeAttribute("last"),this.updateSelectedAttribute(e,r),this.updateFocusedAttribute(e,r),r}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){let i=this.selectedIndices.indexOf(e)!==-1;i?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(i))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);let e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let i=e;i<=t;i++){let o=i-e,r=this.items[o],s;r?s=JSON.stringify(r):s=`placeholder-${o}`,this._itemsRenderData.push({index:i,top:this.itemHeight*i,physicalIndex:o,dataHash:s,data:r})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;let i=e%this._visibleItemsNum,o=this.items[i];if(!o||o.disabled)return;let r=!0;if(this.selectionType!=="trigger-only"){let s=this.selectedIndices.indexOf(e);r=s==-1,r?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(s,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,r,t)}dispatchSelectionEvent(e,t,i){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,hasModifier:i}}))}handleClick(e){let t=e.composedPath().find(i=>i.hasAttribute&&i.hasAttribute("item-index"));if(t){let i=parseInt(t.getAttribute("item-index"));if(Number.isInteger(i)){if(e.button==0||e.button==1){let o=e.type=="auxclick"&&e.button==1||e.metaKey||e.ctrlKey;this.handleSelection(i,o)}this.focusIndex=i}}}},yt.ID="sd-virtual-list",yt.ensureDefined=()=>{Pt.ensureDefined(),customElements.get(yt.ID)||customElements.define(yt.ID,yt)},yt);xt([h({type:Number,attribute:"item-height",reflect:!0})],ut.prototype,"itemHeight",2);xt([h({type:Number})],ut.prototype,"itemCount",2);xt([h({type:Array,attribute:!1})],ut.prototype,"items",2);xt([h({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],ut.prototype,"selectionType",2);xt([h({type:String,attribute:!0,reflect:!0})],ut.prototype,"id",2);xt([h({type:String,reflect:!0})],ut.prototype,"role",2);xt([h({type:Number,attribute:"focus-index",reflect:!0})],ut.prototype,"focusIndex",1);xt([h({type:Array,attribute:!1})],ut.prototype,"selectedIndices",1);var He=ut;He.ensureDefined();var Ue=class e{constructor(t,i){this.eventTarget=t,this.keydownHandler=i,this.catchedKeys=["Down","ArrowDown","Up","ArrowUp","Enter"],this.markAsFocusTargetHandler=()=>this.eventTarget.setAttribute("focus-target",""),this.unmarkAsFocusTargetHandler=()=>this.eventTarget.removeAttribute("focus-target"),this.delegateKeyDownEvent=o=>{if(this.catchedKeys.indexOf(o.key)!==-1){let r=o.key.toLocaleLowerCase(),s=0,n=r.includes("enter");n||(s=r.includes("down")?1:-1),this.keydownHandler(o,s,n),o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation()}}}static delegateTo(t){return new e(t,i=>t.dispatchEvent(new KeyboardEvent(i.type,i)))}connect(t){var i,o;if(t!=null){t.addEventListener("keydown",this.delegateKeyDownEvent),t.addEventListener("focus",this.markAsFocusTargetHandler),t.addEventListener("blur",this.unmarkAsFocusTargetHandler);let r=document.activeElement;(t.contains(r)||(o=(i=t.shadowRoot)==null?void 0:i.activeElement)!=null&&o.contains(r))&&this.markAsFocusTargetHandler()}}disconnect(t){t!=null&&(t.removeEventListener("keydown",this.delegateKeyDownEvent),t.removeEventListener("focus",this.markAsFocusTargetHandler),t.removeEventListener("blur",this.unmarkAsFocusTargetHandler),this.unmarkAsFocusTargetHandler())}};var be=class extends Lt{};be.directiveName="unsafeSVG",be.resultType=2;var Lo=Te(be);var Si=class{constructor(t,i,o,r){this.inputElement=t,this.notSelectedTokensProvider=i,this.initializeCallback=r,this.filter=(s,n)=>s?n.filter(a=>a.disabled||a.deactivated?!1:a.caption&&a.caption.toLowerCase().includes(s)):n,He.ensureDefined(),this._tokenList=new He,this._tokenList.style.minWidth="250px",this._tokenList.style.maxHeight="49vh",this._tokenList.itemHeight=50,this._tokenList.addEventListener("pointerdown",()=>{this.pointerDown=!0,window.addEventListener("pointerup",()=>{this.pointerDown=!1,this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.isUpdatePending||this._tokenList.requestUpdate()},{once:!0,capture:!0})}),this._tokenList.addEventListener("selection",s=>{let n=s.detail.index,a=this._suggestItems[n];o(a),this.hide()}),this._tokenList.addEventListener("data-request",s=>{this.lastRequestedStartIndex=s.detail.startIndex,this.lastRequestedStopIndex=s.detail.stopIndex,this.pointerDown||this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1)}),new Ue(this._tokenList,(s,n,a)=>{this._tokenList.dispatchEvent(new KeyboardEvent(s.type,s)),!a&&!this.isOpened&&this.show()}).connect(t)}show(){this.inputElement.effectiveDisabled||(this.popover,this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.focusIndex=-1,this._tokenList.style.width=null,requestAnimationFrame(()=>{this.lastRequestedStartIndex!=null&&(this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1))}),this.popover.show()))}refreshItems(){this.isOpened&&(this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.items=[],this._tokenList.style.width=null))}filterItems(t){let i=this.notSelectedTokensProvider();return this.filter(t,i)}hide(){var t;this._suggestItems=[],this._tokenList.itemCount=0,this._tokenList.items=[],(t=this._popover)==null||t.hide()}get list(){return this._tokenList}get popover(){return this._popover||(this._popover=this.createPopover(),this.initializeCallback(this)),this._popover}createPopover(){let t=new ge;return t.setAttribute("trigger-type","manual"),t.setAttribute("placement","bottom-start"),t.setAttribute("modal",""),t.setAttribute("popover-for","token-autosuggest-popover"),t.setAttribute("offset","-2"),t.targetElement=this.inputElement,t.appendChild(this._tokenList),t}get isOpened(){return this._popover&&this._popover.hasAttribute("open")}get focusedSuggestToken(){return this._suggestItems[this._tokenList.focusIndex]}},Qr=":host{flex-shrink:0;max-width:100%}.container{display:flex;height:28px;background-color:var(--token-background-color, #f3f3f3);border:var(--token-border);box-sizing:border-box}.container .icon-wrapper{display:flex;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:100%;overflow:hidden;background-color:var(--token-icon-background-color, transparent)}.container .icon-wrapper .icon{height:100%;width:100%;object-fit:contain;background-size:cover;background-repeat:no-repeat;background-position:center}.container .value{display:inline-block;align-self:center;padding:0 8px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.container .delete-button-wrapper{display:flex;align-self:center;height:16px;width:16px;padding-right:8px;opacity:.5}.container .delete-button-wrapper:hover{cursor:pointer;filter:brightness(10%);opacity:1}",ts=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\r
|
|
116
116
|
<path d="m3.5 12.5 9-9m-9 0 9 9" style="fill:none;stroke:#333;stroke-linecap:square;stroke-width:1.1px"/>\r
|
|
117
|
-
</svg>`,es=Object.defineProperty,is=Object.getOwnPropertyDescriptor,_t=(e,t,i,o)=>{for(var r=o>1?void 0:o?is(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&es(t,i,r),r},$i={fromAttribute:e=>e=="true",toAttribute:e=>e},qt,ft=(qt=class extends P{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return X(Qr)}set checked(e){let t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",i=>{i.stopPropagation(),i.getModifierState("Control")?this.checked=!this.checked:(this.checked=!0,this._tokenClickHandler&&this._tokenClickHandler(this.index))});let t=this.shadowRoot.querySelector(".delete-button-wrapper");t&&t.addEventListener("click",i=>{i.stopPropagation(),this._tokenDeleteHandler&&this._tokenDeleteHandler(this.index)})}render(){return
|
|
117
|
+
</svg>`,es=Object.defineProperty,is=Object.getOwnPropertyDescriptor,_t=(e,t,i,o)=>{for(var r=o>1?void 0:o?is(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&es(t,i,r),r},$i={fromAttribute:e=>e=="true",toAttribute:e=>e},qt,ft=(qt=class extends P{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return X(Qr)}set checked(e){let t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",i=>{i.stopPropagation(),i.getModifierState("Control")?this.checked=!this.checked:(this.checked=!0,this._tokenClickHandler&&this._tokenClickHandler(this.index))});let t=this.shadowRoot.querySelector(".delete-button-wrapper");t&&t.addEventListener("click",i=>{i.stopPropagation(),this._tokenDeleteHandler&&this._tokenDeleteHandler(this.index)})}render(){return A`
|
|
118
118
|
<div class="container">
|
|
119
119
|
<slot name="before-icon"></slot>
|
|
120
120
|
${this.renderIcon()}
|
|
121
121
|
<slot name="after-icon"></slot>
|
|
122
122
|
<div class="value">${this.value}</div>
|
|
123
|
-
${this.disabled?b:
|
|
123
|
+
${this.disabled?b:A` <div class="delete-button-wrapper">${Lo(ts)}</div> `}
|
|
124
124
|
</div>
|
|
125
|
-
`}renderIcon(){if(this.icon||this.iconPlaceholder){let e=this.iconBackgroundColor!=null?`--token-icon-background-color: ${this.iconBackgroundColor}`:void 0;return
|
|
125
|
+
`}renderIcon(){if(this.icon||this.iconPlaceholder){let e=this.iconBackgroundColor!=null?`--token-icon-background-color: ${this.iconBackgroundColor}`:void 0;return A`
|
|
126
126
|
<div class="icon-wrapper" style="${V(e)}" role="img">
|
|
127
127
|
<div part="icon" class="icon"></div>
|
|
128
128
|
</div>
|
|
129
|
-
`}return b}updated(e){super.updated(e),(e.has("icon")||e.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Xt.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),e.has("disabled")&&!this.disabled&&this.checked&&(this.checked=!1)}setClickHandler(e){this._tokenClickHandler=e}setDeleteHandler(e){this._tokenDeleteHandler=e}},qt.ID="sd-token",qt.ensureDefined=()=>{customElements.get(qt.ID)||customElements.define(qt.ID,qt)},qt);_t([h({type:String,attribute:!0,reflect:!0})],ft.prototype,"value",2);_t([h({type:String,attribute:!0,reflect:!0})],ft.prototype,"type",2);_t([h({type:String})],ft.prototype,"icon",2);_t([h({type:String})],ft.prototype,"iconPlaceholder",2);_t([h({type:String})],ft.prototype,"iconBackgroundColor",2);_t([h({converter:$i,reflect:!0,attribute:"aria-disabled"})],ft.prototype,"disabled",2);_t([h({converter:$i,reflect:!0,attribute:"aria-current"})],ft.prototype,"current",2);_t([h({converter:$i,reflect:!0,attribute:"aria-checked"})],ft.prototype,"checked",1);var Be=ft,Oo=(e,t)=>{let i=document.createElement(Be.ID);return e&&(i.value=e.caption,i.type=e.type,i.icon=e.icon,i.iconPlaceholder=e.iconPlaceholder,i.iconBackgroundColor=e.iconBackgroundColor,i.disabled=e.disabled,i.index=t),i};Be.ensureDefined();var ze="web application/json",Ii=class{constructor(t,i,o){navigator.clipboard&&(t.addEventListener("copy",()=>{i()||this.writeToClipboard(t)}),t.addEventListener("cut",()=>{i()||(t.removeSelectionOrActiveToken(),this.writeToClipboard(t))}),t.addEventListener("paste",()=>{t.disabled||this.readFromClipboard(o)}))}writeToClipboard(t){let i=t.querySelectorAll("[slot='items'][aria-checked='true']"),o=[];if(i.length>0)i.forEach(r=>o.push(r.index));else if(t.activeTokenIndex!=-1){let r=t.activeTokenElement;r&&o.push(r.index)}if(o.length>0){let r=JSON.stringify(o.map(n=>t.items[n])),s=new Blob([r],{type:ze});navigator.clipboard.write([new ClipboardItem({[ze]:s})])}}async readFromClipboard(t){let i=await navigator.clipboard.read();for(let o of i)if(o.types.includes(ze)){let r=await(await o.getType(ze)).text(),s=JSON.parse(r);Array.isArray(s)&&t(s)}}},os=":host{display:flex;contain:layout style}:host .additonal-content::slotted(*){align-self:end;flex-shrink:0}:host([drop]) ::slotted(*){pointer-events:none}:host(:not([readonly])) ::slotted(sd-token:last-of-type){max-width:calc(100% - 24px);margin-right:24px;margin-bottom:4px}.container{display:flex;flex-wrap:wrap;gap:8px;flex-grow:1;min-width:0;margin-top:auto}.container .placeholder{color:#767676;line-height:24px;align-self:flex-end}.input{flex-grow:1;min-width:0;width:100%;margin-top:auto}.input .token-wrapper{display:flex;flex-wrap:wrap;flex:1 0 auto;width:100%;gap:8px}",Ci=class{constructor(t,i){this.tokenSelector=t;let o=new Map,r=s=>{let n=s.target;if(t.removeAttribute("drag-source"),!t.contains(n)){let a=s.addedIndexes;a&&t.removeTokens(a.map(l=>o.get(l)))}o.clear()};t.addEventListener("dragstart",s=>{let n=s.target;if(n instanceof Be){if(n.disabled){s.preventDefault();return}t.setAttribute("drag-source",""),n.setAttribute("aria-checked","true");let a=t.querySelectorAll("[slot='items'][aria-checked='true']");if(a.length>0){let l=Array.from(a).filter(c=>!c.disabled).map((c,d)=>(o.set(d,c.index),t.items[c.index]));if(s.dataTransfer.setData("text/sd-token-selector",JSON.stringify(l)),s.dataTransfer.dropEffect="move",s.dataTransfer.effectAllowed="move",a.length>1){let c=this.createCustomDragImage(n,l.length);s.dataTransfer.setDragImage(c,-14,-14)}window.addEventListener("drop",r,{once:!0})}}}),t.addEventListener("dragenter",s=>{t.setAttribute("drop",""),s.preventDefault()}),t.addEventListener("dragover",s=>s.preventDefault()),t.addEventListener("dragleave",s=>{s.target==t&&t.removeAttribute("drop")}),t.addEventListener("drop",s=>{t.removeAttribute("drop");let n=s.dataTransfer.getData("text/sd-token-selector");if(n)try{let a=JSON.parse(n);Array.isArray(a)&&(s.addedIndexes=i(a),s.preventDefault())}catch{}}),t.addEventListener("dragend",()=>{window.removeEventListener("drop",r),o.clear()})}createCustomDragImage(t,i){let o=t.cloneNode(!0);if(o.setAttribute("aria-disabled","true"),this.tokenSelector.tokenType)o.value=i+" "+this.tokenSelector.tokenType;else{let r=document.createElement("div");r.innerText="+"+(i-1),Object.assign(r.style,{position:"absolute",left:"90%",top:"75%"});let s=document.createElement("div");s.appendChild(o),s.appendChild(r),o=s}return Object.assign(o.style,{height:t.offsetHeight,outline:"none",maxWidth:"500px",position:"absolute",display:"block",left:"-99999px",overflow:"visible",margin:"1px"}),o.slot="items",this.tokenSelector.appendChild(o),requestAnimationFrame(()=>o.remove()),o}},rs=Object.defineProperty,ss=Object.getOwnPropertyDescriptor,tt=(e,t,i,o)=>{for(var r=o>1?void 0:o?ss(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&rs(t,i,r),r};function ns(e,t){let i;return function(...o){i!=null&&clearTimeout(i),i=window.setTimeout(()=>e(...o),t)}}var Po=(e=>(e.RemoveOnly="remove-only",e.Multi="multi",e))(Po||{}),wt,Y=(wt=class extends P{constructor(){super(...arguments),this.selectionMode="multi",this.items=[],this.selectedIndexes=[],this._tokenGenerator=Oo,this._autoSuggestItemGenerator=Le,this.additionalTokenCommittingKeys=[],this._activeTokenIndex=-1,this.handleInputKeyDown=(e,t)=>{if((e.key==="Enter"||this.additionalTokenCommittingKeys.includes(e.key))&&t.value){e.preventDefault(),e.stopPropagation(),this.commitTokenValue(t.value);return}switch(e.key){case"Escape":{e.preventDefault(),e.stopPropagation(),this.tokenSuggestPopover.hide();break}case"Tab":{this.commitTokenValue(t.value),this.tokenSuggestPopover.hide();break}default:this.handleKeyDown(e)}},this.handleKeyDown=e=>{switch(e.key){case"ArrowLeft":{this.hasInputValue||this.updateActiveToken(-1);break}case"ArrowRight":{this.hasInputValue||this.updateActiveToken(1);break}case"Enter":{if(!this.hasInputValue&&this.activeTokenIndex!=-1){let t=this.activeTokenElement;e.getModifierState("Control")?t.checked=!t.checked:(t.checked=!0,this.onTokenClick(t,!1)),document.activeElement!=this&&this.focus()}break}case"Backspace":{this.hasInputValue||(this.activeTokenIndex==-1?this.updateActiveToken(-1):this.removeSelectionOrActiveToken());break}case"Clear":case"Delete":{this.removeSelectionOrActiveToken();break}case"a":{!this.hasInputValue&&e.getModifierState("Control")&&(this.querySelectorAll("[slot='items']").forEach(t=>t.checked=!0),e.preventDefault(),e.stopPropagation());break}}},this.selectOrAddItems=e=>{let t=[],i=e.map((o,r)=>{let s=o.caption==null?-1:this.findIndex(o);return s!=-1&&!this.items[s].disabled&&!this.selectedIndexes.includes(s)?(t.push(r),s):-1}).filter(o=>o!=-1);return i.length>0&&this.handleTokenSelection(i),t},this.handleWindowPointerDown=e=>{let t=this.inputElement;!t||!t.value||e.composedPath().some(i=>{if(i instanceof HTMLElement&&(e.composedPath().indexOf(t)>-1||i.getAttribute("popover-for")==="token-autosuggest-popover"))return!0})||this.commitTokenValue(t.value)},this.debouncedShowTokenSuggestPopover=ns(this.showFilteredTokenSuggestions.bind(this),200)}static get styles(){return X(os)}get tokenGenerator(){return this._tokenGenerator}set tokenGenerator(e){this._tokenGenerator=e,this.render()}get autoSuggestItemGenerator(){return this._autoSuggestItemGenerator}set autoSuggestItemGenerator(e){this._autoSuggestItemGenerator=e,this._tokenSuggestPopover&&(this._tokenSuggestPopover.list.itemGenerator=e)}setAdditionalTokenCommittingKeys(e){this.additionalTokenCommittingKeys=e}openSuggestions(){this.inputElement&&(this.focus(),this.tokenSuggestPopover.show())}focus(){this.inputElement?this.inputElement.focus():this.shadowRoot.querySelector(".container").focus()}render(){return this.selectionMode=="remove-only"?
|
|
129
|
+
`}return b}updated(e){super.updated(e),(e.has("icon")||e.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Xt.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),e.has("disabled")&&!this.disabled&&this.checked&&(this.checked=!1)}setClickHandler(e){this._tokenClickHandler=e}setDeleteHandler(e){this._tokenDeleteHandler=e}},qt.ID="sd-token",qt.ensureDefined=()=>{customElements.get(qt.ID)||customElements.define(qt.ID,qt)},qt);_t([h({type:String,attribute:!0,reflect:!0})],ft.prototype,"value",2);_t([h({type:String,attribute:!0,reflect:!0})],ft.prototype,"type",2);_t([h({type:String})],ft.prototype,"icon",2);_t([h({type:String})],ft.prototype,"iconPlaceholder",2);_t([h({type:String})],ft.prototype,"iconBackgroundColor",2);_t([h({converter:$i,reflect:!0,attribute:"aria-disabled"})],ft.prototype,"disabled",2);_t([h({converter:$i,reflect:!0,attribute:"aria-current"})],ft.prototype,"current",2);_t([h({converter:$i,reflect:!0,attribute:"aria-checked"})],ft.prototype,"checked",1);var Be=ft,Oo=(e,t)=>{let i=document.createElement(Be.ID);return e&&(i.value=e.caption,i.type=e.type,i.icon=e.icon,i.iconPlaceholder=e.iconPlaceholder,i.iconBackgroundColor=e.iconBackgroundColor,i.disabled=e.disabled,i.index=t),i};Be.ensureDefined();var ze="web application/json",Ii=class{constructor(t,i,o){navigator.clipboard&&(t.addEventListener("copy",()=>{i()||this.writeToClipboard(t)}),t.addEventListener("cut",()=>{i()||(t.removeSelectionOrActiveToken(),this.writeToClipboard(t))}),t.addEventListener("paste",()=>{t.disabled||this.readFromClipboard(o)}))}writeToClipboard(t){let i=t.querySelectorAll("[slot='items'][aria-checked='true']"),o=[];if(i.length>0)i.forEach(r=>o.push(r.index));else if(t.activeTokenIndex!=-1){let r=t.activeTokenElement;r&&o.push(r.index)}if(o.length>0){let r=JSON.stringify(o.map(n=>t.items[n])),s=new Blob([r],{type:ze});navigator.clipboard.write([new ClipboardItem({[ze]:s})])}}async readFromClipboard(t){let i=await navigator.clipboard.read();for(let o of i)if(o.types.includes(ze)){let r=await(await o.getType(ze)).text(),s=JSON.parse(r);Array.isArray(s)&&t(s)}}},os=":host{display:flex;contain:layout style}:host .additonal-content::slotted(*){align-self:end;flex-shrink:0}:host([drop]) ::slotted(*){pointer-events:none}:host(:not([readonly])) ::slotted(sd-token:last-of-type){max-width:calc(100% - 24px);margin-right:24px;margin-bottom:4px}.container{display:flex;flex-wrap:wrap;gap:8px;flex-grow:1;min-width:0;margin-top:auto}.container .placeholder{color:#767676;line-height:24px;align-self:flex-end}.input{flex-grow:1;min-width:0;width:100%;margin-top:auto}.input .token-wrapper{display:flex;flex-wrap:wrap;flex:1 0 auto;width:100%;gap:8px}",Ci=class{constructor(t,i){this.tokenSelector=t;let o=new Map,r=s=>{let n=s.target;if(t.removeAttribute("drag-source"),!t.contains(n)){let a=s.addedIndexes;a&&t.removeTokens(a.map(l=>o.get(l)))}o.clear()};t.addEventListener("dragstart",s=>{let n=s.target;if(n instanceof Be){if(n.disabled){s.preventDefault();return}t.setAttribute("drag-source",""),n.setAttribute("aria-checked","true");let a=t.querySelectorAll("[slot='items'][aria-checked='true']");if(a.length>0){let l=Array.from(a).filter(c=>!c.disabled).map((c,d)=>(o.set(d,c.index),t.items[c.index]));if(s.dataTransfer.setData("text/sd-token-selector",JSON.stringify(l)),s.dataTransfer.dropEffect="move",s.dataTransfer.effectAllowed="move",a.length>1){let c=this.createCustomDragImage(n,l.length);s.dataTransfer.setDragImage(c,-14,-14)}window.addEventListener("drop",r,{once:!0})}}}),t.addEventListener("dragenter",s=>{t.setAttribute("drop",""),s.preventDefault()}),t.addEventListener("dragover",s=>s.preventDefault()),t.addEventListener("dragleave",s=>{s.target==t&&t.removeAttribute("drop")}),t.addEventListener("drop",s=>{t.removeAttribute("drop");let n=s.dataTransfer.getData("text/sd-token-selector");if(n)try{let a=JSON.parse(n);Array.isArray(a)&&(s.addedIndexes=i(a),s.preventDefault())}catch{}}),t.addEventListener("dragend",()=>{window.removeEventListener("drop",r),t.removeAttribute("drag-source"),o.clear()})}createCustomDragImage(t,i){let o=t.cloneNode(!0);if(o.setAttribute("aria-disabled","true"),this.tokenSelector.tokenType)o.value=i+" "+this.tokenSelector.tokenType;else{let r=document.createElement("div");r.innerText="+"+(i-1),Object.assign(r.style,{position:"absolute",left:"90%",top:"75%"});let s=document.createElement("div");s.appendChild(o),s.appendChild(r),o=s}return Object.assign(o.style,{height:t.offsetHeight,outline:"none",maxWidth:"500px",position:"absolute",display:"block",left:"-99999px",overflow:"visible",margin:"1px"}),o.slot="items",this.tokenSelector.appendChild(o),requestAnimationFrame(()=>o.remove()),o}},rs=Object.defineProperty,ss=Object.getOwnPropertyDescriptor,tt=(e,t,i,o)=>{for(var r=o>1?void 0:o?ss(t,i):t,s=e.length-1,n;s>=0;s--)(n=e[s])&&(r=(o?n(t,i,r):n(r))||r);return o&&r&&rs(t,i,r),r};function ns(e,t){let i;return function(...o){i!=null&&clearTimeout(i),i=window.setTimeout(()=>e(...o),t)}}var Po=(e=>(e.RemoveOnly="remove-only",e.Multi="multi",e))(Po||{}),wt,Y=(wt=class extends P{constructor(){super(...arguments),this.selectionMode="multi",this.items=[],this.selectedIndexes=[],this._tokenGenerator=Oo,this._autoSuggestItemGenerator=Le,this.additionalTokenCommittingKeys=[],this._activeTokenIndex=-1,this.handleInputKeyDown=(e,t)=>{if((e.key==="Enter"||this.additionalTokenCommittingKeys.includes(e.key))&&t.value){e.preventDefault(),e.stopPropagation(),this.commitTokenValue(t.value);return}switch(e.key){case"Escape":{e.preventDefault(),e.stopPropagation(),this.tokenSuggestPopover.hide();break}case"Tab":{this.commitTokenValue(t.value),this.tokenSuggestPopover.hide();break}default:this.handleKeyDown(e)}},this.handleKeyDown=e=>{switch(e.key){case"ArrowLeft":{this.hasInputValue||this.updateActiveToken(-1);break}case"ArrowRight":{this.hasInputValue||this.updateActiveToken(1);break}case"Enter":{if(!this.hasInputValue&&this.activeTokenIndex!=-1){let t=this.activeTokenElement;e.getModifierState("Control")?t.checked=!t.checked:(t.checked=!0,this.onTokenClick(t,!1)),document.activeElement!=this&&this.focus()}break}case"Backspace":{this.hasInputValue||(this.activeTokenIndex==-1?this.updateActiveToken(-1):this.removeSelectionOrActiveToken());break}case"Clear":case"Delete":{this.removeSelectionOrActiveToken();break}case"a":{!this.hasInputValue&&e.getModifierState("Control")&&(this.querySelectorAll("[slot='items']").forEach(t=>t.checked=!0),e.preventDefault(),e.stopPropagation());break}}},this.selectOrAddItems=e=>{let t=[],i=e.map((o,r)=>{let s=o.caption==null?-1:this.findIndex(o);return s!=-1&&!this.items[s].disabled&&!this.selectedIndexes.includes(s)?(t.push(r),s):-1}).filter(o=>o!=-1);return i.length>0&&this.handleTokenSelection(i),t},this.handleWindowPointerDown=e=>{let t=this.inputElement;!t||!t.value||e.composedPath().some(i=>{if(i instanceof HTMLElement&&(e.composedPath().indexOf(t)>-1||i.getAttribute("popover-for")==="token-autosuggest-popover"))return!0})||this.commitTokenValue(t.value)},this.debouncedShowTokenSuggestPopover=ns(this.showFilteredTokenSuggestions.bind(this),200)}static get styles(){return X(os)}get tokenGenerator(){return this._tokenGenerator}set tokenGenerator(e){this._tokenGenerator=e,this.render()}get autoSuggestItemGenerator(){return this._autoSuggestItemGenerator}set autoSuggestItemGenerator(e){this._autoSuggestItemGenerator=e,this._tokenSuggestPopover&&(this._tokenSuggestPopover.list.itemGenerator=e)}setAdditionalTokenCommittingKeys(e){this.additionalTokenCommittingKeys=e}openSuggestions(){this.inputElement&&(this.focus(),this.tokenSuggestPopover.show())}focus(){this.inputElement?this.inputElement.focus():this.shadowRoot.querySelector(".container").focus()}render(){return this.selectionMode=="remove-only"?A`<div class="container" tabindex="0">
|
|
130
130
|
<slot name="items"
|
|
131
|
-
>${this.placeholder?
|
|
131
|
+
>${this.placeholder?A`<span part="remove-only-placeholder" class="placeholder"
|
|
132
132
|
>${this.placeholder}</span
|
|
133
133
|
>`:b}</slot
|
|
134
134
|
>
|
|
135
135
|
</div>
|
|
136
|
-
<slot class="additonal-content" name="additional-content"></slot>`:
|
|
136
|
+
<slot class="additonal-content" name="additional-content"></slot>`:A`
|
|
137
137
|
<sd-lit-input
|
|
138
138
|
class="input"
|
|
139
139
|
.extendedPrefix=${!0}
|