@cas-smartdesign/virtual-list 7.0.1 → 7.1.0
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.
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import"./doc.mjs";import{I as
|
|
2
|
-
Modifier pressed: ${e.detail.hasModifier}`})});
|
|
1
|
+
import"./doc.mjs";import{I as l}from"./item-provider.mjs";const r=document.querySelector("#selection-example"),t=r.querySelector("#notification"),n=Array.from(r.querySelectorAll("sd-virtual-list"));n.forEach(i=>{new l().connectList(i),i.addEventListener("selection",e=>{const o=n.indexOf(e.currentTarget);t.style.visibility="visible",t.style.gridColumnStart=`${o+1}`,t.innerText=`Item at index ${e.detail.index} has been ${e.detail.selected?"selected":"deselected"}`})});
|
package/dist/docs/doc.mjs
CHANGED
|
@@ -55,7 +55,7 @@ lists.forEach((list: VirtualList) => {
|
|
|
55
55
|
notification.style.gridColumnStart = \`\${listIndex + 1}\`;
|
|
56
56
|
notification.innerText = \`Item at index \${event.detail.index} has been \${
|
|
57
57
|
event.detail.selected ? "selected" : "deselected"
|
|
58
|
-
}
|
|
58
|
+
}\`;
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
`,gi=`import { ItemData } from "@cas-smartdesign/list-item";
|
|
@@ -360,7 +360,7 @@ list.addEventListener("selection", (event: CustomEvent) => {
|
|
|
360
360
|
});
|
|
361
361
|
`,or={mainContent:ir,description:nr,css:sr,initializer:{content:rr,type:"typescript",initialize:()=>mi(()=>import("./3_duplicate_items.js"),__vite__mapDeps([3,1]),import.meta.url)},additionalSources:[{type:"source",label:"item-provider",language:"typescript",content:gi},{type:"source",label:"sample-data",language:"typescript",content:bi}]},ar=Object.freeze(Object.defineProperty({__proto__:null,default:or},Symbol.toStringTag,{value:"Module"}));const gt=globalThis,yi=gt.ShadowRoot&&(gt.ShadyCSS===void 0||gt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wi=Symbol(),Ji=new WeakMap;let Dn=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==wi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(yi&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Ji.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ji.set(t,e))}return e}toString(){return this.cssText}};const vi=s=>new Dn(typeof s=="string"?s:s+"",void 0,wi),zn=(s,...e)=>{const t=s.length===1?s[0]:e.reduce(((n,i,o)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[o+1]),s[0]);return new Dn(t,s,wi)},lr=(s,e)=>{if(yi)s.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const n=document.createElement("style"),i=gt.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,s.appendChild(n)}},Xi=yi?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return vi(t)})(s):s;const{is:cr,defineProperty:ur,getOwnPropertyDescriptor:hr,getOwnPropertyNames:dr,getOwnPropertySymbols:fr,getPrototypeOf:pr}=Object,xt=globalThis,Qi=xt.trustedTypes,mr=Qi?Qi.emptyScript:"",gr=xt.reactiveElementPolyfillSupport,Xe=(s,e)=>s,bt={toAttribute(s,e){switch(e){case Boolean:s=s?mr:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},xi=(s,e)=>!cr(s,e),Yi={attribute:!0,type:String,converter:bt,reflect:!1,useDefault:!1,hasChanged:xi};Symbol.metadata??=Symbol("metadata"),xt.litPropertyMetadata??=new WeakMap;let Ue=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Yi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&ur(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:o}=hr(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const p=i?.call(this);o?.call(this,a),this.requestUpdate(e,p,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Yi}static _$Ei(){if(this.hasOwnProperty(Xe("elementProperties")))return;const e=pr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Xe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Xe("properties"))){const t=this.properties,n=[...dr(t),...fr(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(Xi(i))}else e!==void 0&&t.push(Xi(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return lr(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(n.converter?.toAttribute!==void 0?n.converter:bt).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=n.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:bt;this._$Em=i;const p=a.fromAttribute(t,o.type);this[i]=p??this._$Ej?.get(i)??p,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){const i=this.constructor,o=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??xi)(o,t)||n.useDefault&&n.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:o},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),o!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[i,o]of n){const{wrapped:a}=o,p=this[i];a!==!0||this._$AL.has(i)||p===void 0||this.C(i,void 0,o,p)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ue.elementStyles=[],Ue.shadowRootOptions={mode:"open"},Ue[Xe("elementProperties")]=new Map,Ue[Xe("finalized")]=new Map,gr?.({ReactiveElement:Ue}),(xt.reactiveElementVersions??=[]).push("2.1.1");const _i=globalThis,yt=_i.trustedTypes,en=yt?yt.createPolicy("lit-html",{createHTML:s=>s}):void 0,Un="$lit$",Ee=`lit$${Math.random().toFixed(9).slice(2)}$`,Bn="?"+Ee,br=`<${Bn}>`,Ne=document,et=()=>Ne.createComment(""),tt=s=>s===null||typeof s!="object"&&typeof s!="function",Ei=Array.isArray,yr=s=>Ei(s)||typeof s?.[Symbol.iterator]=="function",zt=`[
|
|
362
362
|
\f\r]`,Ze=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tn=/-->/g,nn=/>/g,$e=RegExp(`>|${zt}(?:([^\\s"'>=/]+)(${zt}*=${zt}*(?:[^
|
|
363
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),sn=/'/g,rn=/"/g,qn=/^(?:script|style|textarea|title)$/i,wr=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),Be=wr(1),Me=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),on=new WeakMap,Re=Ne.createTreeWalker(Ne,129);function Hn(s,e){if(!Ei(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return en!==void 0?en.createHTML(e):e}const vr=(s,e)=>{const t=s.length-1,n=[];let i,o=e===2?"<svg>":e===3?"<math>":"",a=Ze;for(let p=0;p<t;p++){const b=s[p];let h,r,u=-1,l=0;for(;l<b.length&&(a.lastIndex=l,r=a.exec(b),r!==null);)l=a.lastIndex,a===Ze?r[1]==="!--"?a=tn:r[1]!==void 0?a=nn:r[2]!==void 0?(qn.test(r[2])&&(i=RegExp("</"+r[2],"g")),a=$e):r[3]!==void 0&&(a=$e):a===$e?r[0]===">"?(a=i??Ze,u=-1):r[1]===void 0?u=-2:(u=a.lastIndex-r[2].length,h=r[1],a=r[3]===void 0?$e:r[3]==='"'?rn:sn):a===rn||a===sn?a=$e:a===tn||a===nn?a=Ze:(a=$e,i=void 0);const c=a===$e&&s[p+1].startsWith("/>")?" ":"";o+=a===Ze?b+br:u>=0?(n.push(h),b.slice(0,u)+Un+b.slice(u)+Ee+c):b+Ee+(u===-2?p:c)}return[Hn(s,o+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class it{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let o=0,a=0;const p=e.length-1,b=this.parts,[h,r]=vr(e,t);if(this.el=it.createElement(h,n),Re.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=Re.nextNode())!==null&&b.length<p;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(Un)){const l=r[a++],c=i.getAttribute(u).split(Ee),f=/([.?@])?(.*)/.exec(l);b.push({type:1,index:o,name:f[2],strings:c,ctor:f[1]==="."?_r:f[1]==="?"?Er:f[1]==="@"?Ar:_t}),i.removeAttribute(u)}else u.startsWith(Ee)&&(b.push({type:6,index:o}),i.removeAttribute(u));if(qn.test(i.tagName)){const u=i.textContent.split(Ee),l=u.length-1;if(l>0){i.textContent=yt?yt.emptyScript:"";for(let c=0;c<l;c++)i.append(u[c],et()),Re.nextNode(),b.push({type:2,index:++o});i.append(u[l],et())}}}else if(i.nodeType===8)if(i.data===Bn)b.push({type:2,index:o});else{let u=-1;for(;(u=i.data.indexOf(Ee,u+1))!==-1;)b.push({type:7,index:o}),u+=Ee.length-1}o++}}static createElement(e,t){const n=Ne.createElement("template");return n.innerHTML=e,n}}function Fe(s,e,t=s,n){if(e===Me)return e;let i=n!==void 0?t._$Co?.[n]:t._$Cl;const o=tt(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(s),i._$AT(s,t,n)),n!==void 0?(t._$Co??=[])[n]=i:t._$Cl=i),i!==void 0&&(e=Fe(s,i._$AS(s,e.values),i,n)),e}class xr{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,i=(e?.creationScope??Ne).importNode(t,!0);Re.currentNode=i;let o=Re.nextNode(),a=0,p=0,b=n[0];for(;b!==void 0;){if(a===b.index){let h;b.type===2?h=new nt(o,o.nextSibling,this,e):b.type===1?h=new b.ctor(o,b.name,b.strings,this,e):b.type===6&&(h=new Sr(o,this,e)),this._$AV.push(h),b=n[++p]}a!==b?.index&&(o=Re.nextNode(),a++)}return Re.currentNode=Ne,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class nt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Fe(this,e,t),tt(e)?e===Z||e==null||e===""?(this._$AH!==Z&&this._$AR(),this._$AH=Z):e!==this._$AH&&e!==Me&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yr(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Z&&tt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ne.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=it.createElement(Hn(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{const o=new xr(i,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=on.get(e.strings);return t===void 0&&on.set(e.strings,t=new it(e)),t}k(e){Ei(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const o of e)i===t.length?t.push(n=new nt(this.O(et()),this.O(et()),this,this.options)):n=t[i],n._$AI(o),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class _t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,o){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Z}_$AI(e,t=this,n,i){const o=this.strings;let a=!1;if(o===void 0)e=Fe(this,e,t,0),a=!tt(e)||e!==this._$AH&&e!==Me,a&&(this._$AH=e);else{const p=e;let b,h;for(e=o[0],b=0;b<o.length-1;b++)h=Fe(this,p[n+b],t,b),h===Me&&(h=this._$AH[b]),a||=!tt(h)||h!==this._$AH[b],h===Z?e=Z:e!==Z&&(e+=(h??"")+o[b+1]),this._$AH[b]=h}a&&!i&&this.j(e)}j(e){e===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class _r extends _t{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Z?void 0:e}}let Er=class extends _t{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Z)}};class Ar extends _t{constructor(e,t,n,i,o){super(e,t,n,i,o),this.type=5}_$AI(e,t=this){if((e=Fe(this,e,t,0)??Z)===Me)return;const n=this._$AH,i=e===Z&&n!==Z||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==Z&&(n===Z||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Sr{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Fe(this,e)}}const Cr=_i.litHtmlPolyfillSupport;Cr?.(it,nt),(_i.litHtmlVersions??=[]).push("3.3.1");const kr=(s,e,t)=>{const n=t?.renderBefore??e;let i=n._$litPart$;if(i===void 0){const o=t?.renderBefore??null;n._$litPart$=i=new nt(e.insertBefore(et(),o),o,void 0,t??{})}return i._$AI(s),i};const Ai=globalThis;let He=class extends Ue{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=kr(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Me}};He._$litElement$=!0,He.finalized=!0,Ai.litElementHydrateSupport?.({LitElement:He});const Ir=Ai.litElementPolyfillSupport;Ir?.({LitElement:He});(Ai.litElementVersions??=[]).push("4.2.1");const $r={attribute:!0,type:String,converter:bt,reflect:!1,hasChanged:xi},Or=(s=$r,e,t)=>{const{kind:n,metadata:i}=t;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),n==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(t.name,s),n==="accessor"){const{name:a}=t;return{set(p){const b=e.get.call(this);e.set.call(this,p),this.requestUpdate(a,b,s)},init(p){return p!==void 0&&this.C(a,void 0,s,p),p}}}if(n==="setter"){const{name:a}=t;return function(p){const b=this[a];e.call(this,p),this.requestUpdate(a,b,s)}}throw Error("Unsupported decorator location: "+n)};function J(s){return(e,t)=>typeof t=="object"?Or(s,e,t):((n,i,o)=>{const a=i.hasOwnProperty(o);return i.constructor.createProperty(o,n),a?Object.getOwnPropertyDescriptor(i,o):void 0})(s,e,t)}class Rr{getOffsetForIndexAndAlignment(e,t,n,i,o,a){const p=Math.max(0,a*i),b=Math.min(p,e*i),h=Math.max(0,e*i-o+i);switch(t){case"start":return b;case"end":return h;case"center":{const r=Math.round(h+(b-h)/2);return r<Math.ceil(o/2)?0:r>p+Math.floor(o/2)?p:r}case"auto":default:return n>=h&&n<=b?n:n<h?h:b}}debounce(e){let t;return(...n)=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{e(...n),t=null})}}}const Nr=new Rr;const Si={ATTRIBUTE:1,CHILD:2},Fn=s=>(...e)=>({_$litDirective$:s,values:e});let Wn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};class pi extends Wn{constructor(e){if(super(e),this.it=Z,e.type!==Si.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Z||e==null)return this._t=void 0,this.it=e;if(e===Me)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}pi.directiveName="unsafeHTML",pi.resultType=1;const Mr=Fn(pi);const dt=s=>s??Z;const Tr=s=>s.strings===void 0;const Qe=(s,e)=>{const t=s._$AN;if(t===void 0)return!1;for(const n of t)n._$AO?.(e,!1),Qe(n,e);return!0},wt=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while(t?.size===0)},Vn=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),jr(e)}};function Pr(s){this._$AN!==void 0?(wt(this),this._$AM=s,Vn(this)):this._$AM=s}function Lr(s,e=!1,t=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let o=t;o<n.length;o++)Qe(n[o],!1),wt(n[o]);else n!=null&&(Qe(n,!1),wt(n));else Qe(this,s)}const jr=s=>{s.type==Si.CHILD&&(s._$AP??=Lr,s._$AQ??=Pr)};class Dr extends Wn{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Vn(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Qe(this,e),wt(this))}setValue(e){if(Tr(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}const an=s=>s?s.startsWith("url")?s:`url("${s}")`:null,zr=(s,e)=>{if(s){const t=new Image;t.addEventListener("load",e),t.src=s,t.complete&&(t.removeEventListener("load",e),window.queueMicrotask(()=>e()))}};class Ur extends Dr{constructor(e){if(super(e),e.type!==Si.ATTRIBUTE||e.name!=="src"&&e.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(e,[t,n]){return this.useCssBackground=e.name=="style",this.render(t,n)}render(e,t){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);const n={cancelled:!1};return this.loadingToken=n,typeof e=="string"?this.preload(e,n):e?.then(i=>{this.preload(i,n)}),this.useCssBackground?an(t):t}preload(e,t){e!=null&&!t.cancelled&&zr(e,()=>{t.cancelled||this.setValue(this.useCssBackground?an(e):e)})}}const Br=Fn(Ur),qr=':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;overflow-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)}.description.with-icon{display:flex;align-items:center;gap:4px}.description.with-icon .description-icon{width:var(--sd-list-item-description-font-size, 13px);height:var(--sd-list-item-description-font-size, 13px);background-repeat:no-repeat;background-position:bottom;background-size:90%}.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}';var Hr=Object.defineProperty,ae=(s,e,t,n)=>{for(var i=void 0,o=s.length-1,a;o>=0;o--)(a=s[o])&&(i=a(e,t,i)||i);return i&&Hr(e,t,i),i},Oe;const re=(Oe=class extends He{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[zn`
|
|
363
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),sn=/'/g,rn=/"/g,qn=/^(?:script|style|textarea|title)$/i,wr=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),Be=wr(1),Me=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),on=new WeakMap,Re=Ne.createTreeWalker(Ne,129);function Hn(s,e){if(!Ei(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return en!==void 0?en.createHTML(e):e}const vr=(s,e)=>{const t=s.length-1,n=[];let i,o=e===2?"<svg>":e===3?"<math>":"",a=Ze;for(let p=0;p<t;p++){const b=s[p];let h,r,u=-1,l=0;for(;l<b.length&&(a.lastIndex=l,r=a.exec(b),r!==null);)l=a.lastIndex,a===Ze?r[1]==="!--"?a=tn:r[1]!==void 0?a=nn:r[2]!==void 0?(qn.test(r[2])&&(i=RegExp("</"+r[2],"g")),a=$e):r[3]!==void 0&&(a=$e):a===$e?r[0]===">"?(a=i??Ze,u=-1):r[1]===void 0?u=-2:(u=a.lastIndex-r[2].length,h=r[1],a=r[3]===void 0?$e:r[3]==='"'?rn:sn):a===rn||a===sn?a=$e:a===tn||a===nn?a=Ze:(a=$e,i=void 0);const c=a===$e&&s[p+1].startsWith("/>")?" ":"";o+=a===Ze?b+br:u>=0?(n.push(h),b.slice(0,u)+Un+b.slice(u)+Ee+c):b+Ee+(u===-2?p:c)}return[Hn(s,o+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class it{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let o=0,a=0;const p=e.length-1,b=this.parts,[h,r]=vr(e,t);if(this.el=it.createElement(h,n),Re.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=Re.nextNode())!==null&&b.length<p;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(Un)){const l=r[a++],c=i.getAttribute(u).split(Ee),f=/([.?@])?(.*)/.exec(l);b.push({type:1,index:o,name:f[2],strings:c,ctor:f[1]==="."?_r:f[1]==="?"?Er:f[1]==="@"?Ar:_t}),i.removeAttribute(u)}else u.startsWith(Ee)&&(b.push({type:6,index:o}),i.removeAttribute(u));if(qn.test(i.tagName)){const u=i.textContent.split(Ee),l=u.length-1;if(l>0){i.textContent=yt?yt.emptyScript:"";for(let c=0;c<l;c++)i.append(u[c],et()),Re.nextNode(),b.push({type:2,index:++o});i.append(u[l],et())}}}else if(i.nodeType===8)if(i.data===Bn)b.push({type:2,index:o});else{let u=-1;for(;(u=i.data.indexOf(Ee,u+1))!==-1;)b.push({type:7,index:o}),u+=Ee.length-1}o++}}static createElement(e,t){const n=Ne.createElement("template");return n.innerHTML=e,n}}function Fe(s,e,t=s,n){if(e===Me)return e;let i=n!==void 0?t._$Co?.[n]:t._$Cl;const o=tt(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(s),i._$AT(s,t,n)),n!==void 0?(t._$Co??=[])[n]=i:t._$Cl=i),i!==void 0&&(e=Fe(s,i._$AS(s,e.values),i,n)),e}class xr{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,i=(e?.creationScope??Ne).importNode(t,!0);Re.currentNode=i;let o=Re.nextNode(),a=0,p=0,b=n[0];for(;b!==void 0;){if(a===b.index){let h;b.type===2?h=new nt(o,o.nextSibling,this,e):b.type===1?h=new b.ctor(o,b.name,b.strings,this,e):b.type===6&&(h=new Sr(o,this,e)),this._$AV.push(h),b=n[++p]}a!==b?.index&&(o=Re.nextNode(),a++)}return Re.currentNode=Ne,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class nt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Fe(this,e,t),tt(e)?e===Z||e==null||e===""?(this._$AH!==Z&&this._$AR(),this._$AH=Z):e!==this._$AH&&e!==Me&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yr(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Z&&tt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ne.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=it.createElement(Hn(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{const o=new xr(i,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=on.get(e.strings);return t===void 0&&on.set(e.strings,t=new it(e)),t}k(e){Ei(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const o of e)i===t.length?t.push(n=new nt(this.O(et()),this.O(et()),this,this.options)):n=t[i],n._$AI(o),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class _t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,o){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Z}_$AI(e,t=this,n,i){const o=this.strings;let a=!1;if(o===void 0)e=Fe(this,e,t,0),a=!tt(e)||e!==this._$AH&&e!==Me,a&&(this._$AH=e);else{const p=e;let b,h;for(e=o[0],b=0;b<o.length-1;b++)h=Fe(this,p[n+b],t,b),h===Me&&(h=this._$AH[b]),a||=!tt(h)||h!==this._$AH[b],h===Z?e=Z:e!==Z&&(e+=(h??"")+o[b+1]),this._$AH[b]=h}a&&!i&&this.j(e)}j(e){e===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class _r extends _t{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Z?void 0:e}}let Er=class extends _t{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Z)}};class Ar extends _t{constructor(e,t,n,i,o){super(e,t,n,i,o),this.type=5}_$AI(e,t=this){if((e=Fe(this,e,t,0)??Z)===Me)return;const n=this._$AH,i=e===Z&&n!==Z||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==Z&&(n===Z||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Sr{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Fe(this,e)}}const Cr=_i.litHtmlPolyfillSupport;Cr?.(it,nt),(_i.litHtmlVersions??=[]).push("3.3.1");const kr=(s,e,t)=>{const n=t?.renderBefore??e;let i=n._$litPart$;if(i===void 0){const o=t?.renderBefore??null;n._$litPart$=i=new nt(e.insertBefore(et(),o),o,void 0,t??{})}return i._$AI(s),i};const Ai=globalThis;let He=class extends Ue{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=kr(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Me}};He._$litElement$=!0,He.finalized=!0,Ai.litElementHydrateSupport?.({LitElement:He});const Ir=Ai.litElementPolyfillSupport;Ir?.({LitElement:He});(Ai.litElementVersions??=[]).push("4.2.1");const $r={attribute:!0,type:String,converter:bt,reflect:!1,hasChanged:xi},Or=(s=$r,e,t)=>{const{kind:n,metadata:i}=t;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),n==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(t.name,s),n==="accessor"){const{name:a}=t;return{set(p){const b=e.get.call(this);e.set.call(this,p),this.requestUpdate(a,b,s)},init(p){return p!==void 0&&this.C(a,void 0,s,p),p}}}if(n==="setter"){const{name:a}=t;return function(p){const b=this[a];e.call(this,p),this.requestUpdate(a,b,s)}}throw Error("Unsupported decorator location: "+n)};function J(s){return(e,t)=>typeof t=="object"?Or(s,e,t):((n,i,o)=>{const a=i.hasOwnProperty(o);return i.constructor.createProperty(o,n),a?Object.getOwnPropertyDescriptor(i,o):void 0})(s,e,t)}class Rr{getOffsetForIndexAndAlignment(e,t,n,i,o,a){const p=Math.max(0,a*i),b=Math.min(p,e*i),h=Math.max(0,e*i-o+i);switch(t){case"start":return b;case"end":return h;case"center":{const r=Math.round(h+(b-h)/2);return r<Math.ceil(o/2)?0:r>p+Math.floor(o/2)?p:r}case"auto":default:return n>=h&&n<=b?n:n<h?h:b}}debounce(e){let t;return(...n)=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{e(...n),t=null})}}}const Nr=new Rr;const Si={ATTRIBUTE:1,CHILD:2},Fn=s=>(...e)=>({_$litDirective$:s,values:e});let Wn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};class pi extends Wn{constructor(e){if(super(e),this.it=Z,e.type!==Si.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Z||e==null)return this._t=void 0,this.it=e;if(e===Me)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}pi.directiveName="unsafeHTML",pi.resultType=1;const Mr=Fn(pi);const dt=s=>s??Z;const Tr=s=>s.strings===void 0;const Qe=(s,e)=>{const t=s._$AN;if(t===void 0)return!1;for(const n of t)n._$AO?.(e,!1),Qe(n,e);return!0},wt=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while(t?.size===0)},Vn=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),jr(e)}};function Pr(s){this._$AN!==void 0?(wt(this),this._$AM=s,Vn(this)):this._$AM=s}function Lr(s,e=!1,t=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let o=t;o<n.length;o++)Qe(n[o],!1),wt(n[o]);else n!=null&&(Qe(n,!1),wt(n));else Qe(this,s)}const jr=s=>{s.type==Si.CHILD&&(s._$AP??=Lr,s._$AQ??=Pr)};let Dr=class extends Wn{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Vn(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Qe(this,e),wt(this))}setValue(e){if(Tr(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};const an=s=>s?s.startsWith("url")?s:`url("${s}")`:null,zr=(s,e)=>{if(s){const t=new Image;t.addEventListener("load",e),t.src=s,t.complete&&(t.removeEventListener("load",e),window.queueMicrotask(()=>e()))}};class Ur extends Dr{constructor(e){if(super(e),e.type!==Si.ATTRIBUTE||e.name!=="src"&&e.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(e,[t,n]){return this.useCssBackground=e.name=="style",this.render(t,n)}render(e,t){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);const n={cancelled:!1};return this.loadingToken=n,typeof e=="string"?this.preload(e,n):e?.then(i=>{this.preload(i,n)}),this.useCssBackground?an(t):t}preload(e,t){e!=null&&!t.cancelled&&zr(e,()=>{t.cancelled||this.setValue(this.useCssBackground?an(e):e)})}}const Br=Fn(Ur),qr=':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;overflow-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)}.description.with-icon{display:flex;align-items:center;gap:4px}.description.with-icon .description-icon{width:var(--sd-list-item-description-font-size, 13px);height:var(--sd-list-item-description-font-size, 13px);background-repeat:no-repeat;background-position:bottom;background-size:90%}.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:var(--sd-list-item-icon-background-size, cover)}';var Hr=Object.defineProperty,ae=(s,e,t,n)=>{for(var i=void 0,o=s.length-1,a;o>=0;o--)(a=s[o])&&(i=a(e,t,i)||i);return i&&Hr(e,t,i),i},Oe;const re=(Oe=class extends He{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[zn`
|
|
364
364
|
${vi(qr)}
|
|
365
365
|
`]}render(){return Be`
|
|
366
366
|
<div class="container">
|
|
@@ -391,7 +391,7 @@ list.addEventListener("selection", (event: CustomEvent) => {
|
|
|
391
391
|
${n?Be` <div class="${s}-icon" style="background-image:url('${n}')" aria-hidden="true"></div> `:Z}
|
|
392
392
|
${this.contentMode==="html"?Mr(e):e}
|
|
393
393
|
</div>
|
|
394
|
-
`:Z}updated(s){super.updated(s),s.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){const s=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let e=0;const t=this.shadowRoot.querySelector(".caption");t&&(e+=t.scrollWidth-t.clientWidth);const n=this.shadowRoot.querySelector(".description");return n&&(e=Math.max(e,n.scrollWidth-n.clientWidth)),e>0&&e++,s&&this.setAttribute("enable-line-clamp",""),e}handleIconClick(s){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",s))&&s.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Oe.ID="sd-list-item",Oe.ensureDefined=()=>{customElements.get(Oe.ID)||customElements.define(Oe.ID,Oe)},Oe);ae([J({type:String})],re.prototype,"caption");ae([J({type:String})],re.prototype,"description");ae([J({type:String})],re.prototype,"descriptionIcon");ae([J({type:Boolean})],re.prototype,"selected");ae([J({type:String})],re.prototype,"icon");ae([J({type:String})],re.prototype,"iconBackgroundColor");ae([J({type:String})],re.prototype,"iconPlaceholder");ae([J({type:Number})],re.prototype,"level");ae([J()],re.prototype,"contentMode");ae([J({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],re.prototype,"enableLineClamp");ae([J({converter:{fromAttribute:s=>s=="true",toAttribute:s=>s},reflect:!0,attribute:"aria-disabled"})],re.prototype,"disabled");ae([J({type:String,attribute:"icon-attr-aria-label"})],re.prototype,"iconAttrAriaLabel");ae([J({type:String,reflect:!0})],re.prototype,"role");ae([J({type:String,attribute:"caption-attr-title"})],re.prototype,"captionAttrTitle");ae([J({type:String,attribute:"description-attr-title"})],re.prototype,"descriptionAttrTitle");ae([J({type:String,attribute:"icon-attr-title"})],re.prototype,"iconAttrTitle");let qe=re;const Fr=(s,e)=>{const t=document.createElement(qe.ID);if(s){if(t.caption=s.caption,t.description=s.description,t.descriptionIcon=s.descriptionIcon,t.icon=s.icon,t.iconBackgroundColor=s.iconBackgroundColor,t.iconPlaceholder=s.iconPlaceholder,t.level=s.level,t.disabled=s.disabled,s.contentMode&&(t.contentMode=s.contentMode),s.leftContentGenerator){const n=s.leftContentGenerator(s,t);n&&(n.slot="left-content",t.appendChild(n))}if(s.rightContentGenerator){const n=s.rightContentGenerator(s,t);n&&(n.slot="right-content",t.appendChild(n))}}return t};qe.ensureDefined();const Wr=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px
|
|
394
|
+
`:Z}updated(s){super.updated(s),s.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){const s=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let e=0;const t=this.shadowRoot.querySelector(".caption");t&&(e+=t.scrollWidth-t.clientWidth);const n=this.shadowRoot.querySelector(".description");return n&&(e=Math.max(e,n.scrollWidth-n.clientWidth)),e>0&&e++,s&&this.setAttribute("enable-line-clamp",""),e}handleIconClick(s){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",s))&&s.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Oe.ID="sd-list-item",Oe.ensureDefined=()=>{customElements.get(Oe.ID)||customElements.define(Oe.ID,Oe)},Oe);ae([J({type:String})],re.prototype,"caption");ae([J({type:String})],re.prototype,"description");ae([J({type:String})],re.prototype,"descriptionIcon");ae([J({type:Boolean})],re.prototype,"selected");ae([J({type:String})],re.prototype,"icon");ae([J({type:String})],re.prototype,"iconBackgroundColor");ae([J({type:String})],re.prototype,"iconPlaceholder");ae([J({type:Number})],re.prototype,"level");ae([J()],re.prototype,"contentMode");ae([J({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],re.prototype,"enableLineClamp");ae([J({converter:{fromAttribute:s=>s=="true",toAttribute:s=>s},reflect:!0,attribute:"aria-disabled"})],re.prototype,"disabled");ae([J({type:String,attribute:"icon-attr-aria-label"})],re.prototype,"iconAttrAriaLabel");ae([J({type:String,reflect:!0})],re.prototype,"role");ae([J({type:String,attribute:"caption-attr-title"})],re.prototype,"captionAttrTitle");ae([J({type:String,attribute:"description-attr-title"})],re.prototype,"descriptionAttrTitle");ae([J({type:String,attribute:"icon-attr-title"})],re.prototype,"iconAttrTitle");let qe=re;const Fr=(s,e)=>{const t=document.createElement(qe.ID);if(s){if(t.caption=s.caption,t.description=s.description,t.descriptionIcon=s.descriptionIcon,t.icon=s.icon,t.iconBackgroundColor=s.iconBackgroundColor,t.iconPlaceholder=s.iconPlaceholder,t.level=s.level,t.disabled=s.disabled,s.contentMode&&(t.contentMode=s.contentMode),s.leftContentGenerator){const n=s.leftContentGenerator(s,t);n&&(n.slot="left-content",t.appendChild(n))}if(s.rightContentGenerator){const n=s.rightContentGenerator(s,t);n&&(n.slot="right-content",t.appendChild(n))}}return t};qe.ensureDefined();const Wr=":host{display:block;position:relative;contain:layout;--sd-virtual-list-focus-highlight-color: #1467ba;--sd-virtual-list-item-separator-color: #d9d9d9}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px var(--sd-virtual-list-focus-highlight-color) inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid var(--sd-virtual-list-item-separator-color)}";var Vr=Object.defineProperty,Gr=Object.getOwnPropertyDescriptor,Ae=(s,e,t,n)=>{for(var i=n>1?void 0:n?Gr(e,t):e,o=s.length-1,a;o>=0;o--)(a=s[o])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Vr(e,t,i),i};let Kr=0;var de;const ye=(de=class extends He{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=de.ID+"_"+Kr++,this.role="listbox",this.itemGenerator=Fr,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;const 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.focusIndex+1)%this.itemCount;break;case"Up":case"ArrowUp":this.focusIndex>0?this.focusIndex--:this.finalSizeIsKnown&&(this.focusIndex=this.itemCount-1);break;case"Enter":this.handleSelection(this.focusIndex,e);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){const 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=Nr.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(){const 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[zn`
|
|
395
395
|
${vi(Wr)}
|
|
396
396
|
`]}render(){return this.updateItemsRenderData(),Be`
|
|
397
397
|
<div class="container" style="height: ${this.itemCount*this.itemHeight}px">
|
|
@@ -486,6 +486,17 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ie=S,V=T),q===void 0&&
|
|
|
486
486
|
</ul>
|
|
487
487
|
</li>
|
|
488
488
|
</ul>
|
|
489
|
+
<h2 id="css-custom-properties">CSS Custom Properties</h2>
|
|
490
|
+
<ul>
|
|
491
|
+
<li><code>--sd-virtual-list-focus-highlight-color</code><ul>
|
|
492
|
+
<li>Defines the focus highlight color for list items, defaults to #1467ba</li>
|
|
493
|
+
</ul>
|
|
494
|
+
</li>
|
|
495
|
+
<li><code>--sd-virtual-list-item-separator-color</code><ul>
|
|
496
|
+
<li>Defines the separator color for list items, defaults to #d9d9d9</li>
|
|
497
|
+
</ul>
|
|
498
|
+
</li>
|
|
499
|
+
</ul>
|
|
489
500
|
<h2 id="custom-events">Custom events</h2>
|
|
490
501
|
<ul>
|
|
491
502
|
<li><code>data-request</code><ul>
|
|
@@ -496,7 +507,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ie=S,V=T),q===void 0&&
|
|
|
496
507
|
<li><code>selection</code><ul>
|
|
497
508
|
<li>Dispatched when one of the items is selected/deselected</li>
|
|
498
509
|
<li>Contains the index of the item and a <code>selected</code> flag which is when false indicates that the item is deselected</li>
|
|
499
|
-
<li>The <code>
|
|
510
|
+
<li>The <code>originalEvent</code> a mouse or keyboard event that triggered the selection event.</li>
|
|
500
511
|
</ul>
|
|
501
512
|
</li>
|
|
502
513
|
</ul>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var lt=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Ft=Object.prototype.hasOwnProperty;var Gt=(i,t)=>{for(var e in t)lt(i,e,{get:t[e],enumerable:!0})},Jt=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of jt(t))!Ft.call(i,n)&&n!==e&<(i,n,{get:()=>t[n],enumerable:!(s=Vt(t,n))||s.enumerable});return i};var Zt=i=>Jt(lt({},"__esModule",{value:!0}),i);var Ae={};Gt(Ae,{ListDataProvider:()=>bt,SelectionType:()=>Wt,default:()=>Kt});var Z=globalThis,Q=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),At=new WeakMap,O=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Q&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=At.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&At.set(e,t))}return t}toString(){return this.cssText}},N=i=>new O(typeof i=="string"?i:i+"",void 0,ht),H=(i,...t)=>{let e=i.length===1?i[0]:t.reduce(((s,n,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1]),i[0]);return new O(e,i,ht)},yt=(i,t)=>{if(Q)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),n=Z.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},ct=Q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return N(e)})(i):i;var{is:Qt,defineProperty:Yt,getOwnPropertyDescriptor:Xt,getOwnPropertyNames:te,getOwnPropertySymbols:ee,getPrototypeOf:ie}=Object,Y=globalThis,xt=Y.trustedTypes,se=xt?xt.emptyScript:"",ne=Y.reactiveElementPolyfillSupport,U=(i,t)=>i,z={toAttribute(i,t){switch(t){case Boolean:i=i?se:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},X=(i,t)=>!Qt(i,t),It={attribute:!0,type:String,converter:z,reflect:!1,useDefault:!1,hasChanged:X};Symbol.metadata??=Symbol("metadata"),Y.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=It){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Yt(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){let{get:n,set:o}=Xt(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:n,set(r){let l=n?.call(this);o?.call(this,r),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??It}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;let t=ie(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){let e=this.properties,s=[...te(e),...ee(e)];for(let n of s)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(ct(n))}else t!==void 0&&e.push(ct(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return yt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:z).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let o=s.getPropertyOptions(n),r=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:z;this._$Em=n;let l=r.fromAttribute(e,o.type);this[n]=l??this._$Ej?.get(n)??l,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let n=this.constructor,o=this[t];if(s??=n.getPropertyOptions(t),!((s.hasChanged??X)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:o},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),o!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,o]of s){let{wrapped:r}=o,l=this[n];r!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[U("elementProperties")]=new Map,$[U("finalized")]=new Map,ne?.({ReactiveElement:$}),(Y.reactiveElementVersions??=[]).push("2.1.1");var pt=globalThis,tt=pt.trustedTypes,St=tt?tt.createPolicy("lit-html",{createHTML:i=>i}):void 0,ut="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+v,oe=`<${mt}>`,E=document,B=()=>E.createComment(""),W=i=>i===null||typeof i!="object"&&typeof i!="function",ft=Array.isArray,Lt=i=>ft(i)||typeof i?.[Symbol.iterator]=="function",dt=`[
|
|
2
2
|
\f\r]`,q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wt=/-->/g,Ct=/>/g,w=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Mt=/^(?:script|style|textarea|title)$/i,_t=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),x=_t(1),Ce=_t(2),Ee=_t(3),b=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Pt=new WeakMap,C=E.createTreeWalker(E,129);function Nt(i,t){if(!ft(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return St!==void 0?St.createHTML(t):t}var Dt=(i,t)=>{let e=i.length-1,s=[],n,o=t===2?"<svg>":t===3?"<math>":"",r=q;for(let l=0;l<e;l++){let a=i[l],d,u,p=-1,g=0;for(;g<a.length&&(r.lastIndex=g,u=r.exec(a),u!==null);)g=r.lastIndex,r===q?u[1]==="!--"?r=wt:u[1]!==void 0?r=Ct:u[2]!==void 0?(Mt.test(u[2])&&(n=RegExp("</"+u[2],"g")),r=w):u[3]!==void 0&&(r=w):r===w?u[0]===">"?(r=n??q,p=-1):u[1]===void 0?p=-2:(p=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?w:u[3]==='"'?Tt:Et):r===Tt||r===Et?r=w:r===wt||r===Ct?r=q:(r=w,n=void 0);let y=r===w&&i[l+1].startsWith("/>")?" ":"";o+=r===q?a+oe:p>=0?(s.push(d),a.slice(0,p)+ut+a.slice(p)+v+y):a+v+(p===-2?l:y)}return[Nt(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},K=class i{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,r=0,l=t.length-1,a=this.parts,[d,u]=Dt(t,e);if(this.el=i.createElement(d,s),C.currentNode=this.el.content,e===2||e===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=C.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(ut)){let g=u[r++],y=n.getAttribute(p).split(v),J=/([.?@])?(.*)/.exec(g);a.push({type:1,index:o,name:J[2],strings:y,ctor:J[1]==="."?it:J[1]==="?"?st:J[1]==="@"?nt:P}),n.removeAttribute(p)}else p.startsWith(v)&&(a.push({type:6,index:o}),n.removeAttribute(p));if(Mt.test(n.tagName)){let p=n.textContent.split(v),g=p.length-1;if(g>0){n.textContent=tt?tt.emptyScript:"";for(let y=0;y<g;y++)n.append(p[y],B()),C.nextNode(),a.push({type:2,index:++o});n.append(p[g],B())}}}else if(n.nodeType===8)if(n.data===mt)a.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(v,p+1))!==-1;)a.push({type:7,index:o}),p+=v.length-1}o++}}static createElement(t,e){let s=E.createElement("template");return s.innerHTML=t,s}};function T(i,t,e=i,s){if(t===b)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl,o=W(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=T(i,n._$AS(i,t.values),n,s)),t}var et=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??E).importNode(e,!0);C.currentNode=n;let o=C.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let d;a.type===2?d=new D(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new ot(o,this,t)),this._$AV.push(d),a=s[++l]}r!==a?.index&&(o=C.nextNode(),r++)}return C.currentNode=E,n}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},D=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=T(this,t,e),W(t)?t===h||t==null||t===""?(this._$AH!==h&&this._$AR(),this._$AH=h):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Lt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==h&&W(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=K.createElement(Nt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{let o=new et(n,this),r=o.u(this.options);o.p(e),this.T(r),this._$AH=o}}_$AC(t){let e=Pt.get(t.strings);return e===void 0&&Pt.set(t.strings,e=new K(t)),e}k(t){ft(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let o of t)n===e.length?e.push(s=new i(this.O(B()),this.O(B()),this,this.options)):s=e[n],s._$AI(o),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,o){this.type=1,this._$AH=h,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=h}_$AI(t,e=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=T(this,t,e,0),r=!W(t)||t!==this._$AH&&t!==b,r&&(this._$AH=t);else{let l=t,a,d;for(t=o[0],a=0;a<o.length-1;a++)d=T(this,l[s+a],e,a),d===b&&(d=this._$AH[a]),r||=!W(d)||d!==this._$AH[a],d===h?t=h:t!==h&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}r&&!n&&this.j(t)}j(t){t===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},it=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===h?void 0:t}},st=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==h)}},nt=class extends P{constructor(t,e,s,n,o){super(t,e,s,n,o),this.type=5}_$AI(t,e=this){if((t=T(this,t,e,0)??h)===b)return;let s=this._$AH,n=t===h&&s!==h||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==h&&(s===h||n);n&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ot=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}},kt={M:ut,P:v,A:mt,C:1,L:Dt,R:et,D:Lt,V:T,I:D,H:P,N:st,U:nt,B:it,F:ot},re=pt.litHtmlPolyfillSupport;re?.(K,D),(pt.litHtmlVersions??=[]).push("3.3.1");var Rt=(i,t,e)=>{let s=e?.renderBefore??t,n=s._$litPart$;if(n===void 0){let o=e?.renderBefore??null;s._$litPart$=n=new D(t.insertBefore(B(),o),o,void 0,e??{})}return n._$AI(i),n};var gt=globalThis,_=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return b}};_._$litElement$=!0,_.finalized=!0,gt.litElementHydrateSupport?.({LitElement:_});var ae=gt.litElementPolyfillSupport;ae?.({LitElement:_});(gt.litElementVersions??=[]).push("4.2.1");var le={attribute:!0,type:String,converter:z,reflect:!1,hasChanged:X},he=(i=le,t,e)=>{let{kind:s,metadata:n}=e,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(e.name,i),s==="accessor"){let{name:r}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,i)},init(l){return l!==void 0&&this.C(r,void 0,i,l),l}}}if(s==="setter"){let{name:r}=e;return function(l){let a=this[r];t.call(this,l),this.requestUpdate(r,a,i)}}throw Error("Unsupported decorator location: "+s)};function c(i){return(t,e)=>typeof e=="object"?he(i,t,e):((s,n,o)=>{let r=n.hasOwnProperty(o);return n.constructor.createProperty(o,s),r?Object.getOwnPropertyDescriptor(n,o):void 0})(i,t,e)}var R={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},V=i=>(...t)=>({_$litDirective$:i,values:t}),k=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var j=class extends k{constructor(t){if(super(t),this.it=h,t.type!==R.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===h||t==null)return this._t=void 0,this.it=t;if(t===b)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};j.directiveName="unsafeHTML",j.resultType=1;var Ot=V(j);var F=i=>i??h;var{I:ii}=kt;var Ht=i=>i.strings===void 0;var G=(i,t)=>{let e=i._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),G(s,t);return!0},rt=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while(e?.size===0)},Ut=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),pe(t)}};function ce(i){this._$AN!==void 0?(rt(this),this._$AM=i,Ut(this)):this._$AM=i}function de(i,t=!1,e=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=e;o<s.length;o++)G(s[o],!1),rt(s[o]);else s!=null&&(G(s,!1),rt(s));else G(this,i)}var pe=i=>{i.type==R.CHILD&&(i._$AP??=de,i._$AQ??=ce)},at=class extends k{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Ut(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(G(this,t),rt(this))}setValue(t){if(Ht(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var zt=i=>i?i.startsWith("url")?i:`url("${i}")`:null,ue=(i,t)=>{if(i){let e=new Image;e.addEventListener("load",t),e.src=i,e.complete&&(e.removeEventListener("load",t),window.queueMicrotask(()=>t()))}};var $t=class extends at{constructor(t){if(super(t),t.type!==R.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[e,s]){return this.useCssBackground=t.name=="style",this.render(e,s)}render(t,e){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(n=>{this.preload(n,s)}),this.useCssBackground?zt(e):e}preload(t,e){t!=null&&!e.cancelled&&ue(t,()=>{e.cancelled||this.setValue(this.useCssBackground?zt(t):t)})}},qt=V($t);var me=':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;overflow-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)}.description.with-icon{display:flex;align-items:center;gap:4px}.description.with-icon .description-icon{width:var(--sd-list-item-description-font-size, 13px);height:var(--sd-list-item-description-font-size, 13px);background-repeat:no-repeat;background-position:bottom;background-size:90%}.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}',fe=Object.defineProperty,f=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&fe(t,e,n),n},L,m=(L=class extends _{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[H`
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Mt=/^(?:script|style|textarea|title)$/i,_t=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),x=_t(1),Ce=_t(2),Ee=_t(3),b=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Pt=new WeakMap,C=E.createTreeWalker(E,129);function Nt(i,t){if(!ft(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return St!==void 0?St.createHTML(t):t}var kt=(i,t)=>{let e=i.length-1,s=[],n,o=t===2?"<svg>":t===3?"<math>":"",r=q;for(let l=0;l<e;l++){let a=i[l],d,u,p=-1,g=0;for(;g<a.length&&(r.lastIndex=g,u=r.exec(a),u!==null);)g=r.lastIndex,r===q?u[1]==="!--"?r=wt:u[1]!==void 0?r=Ct:u[2]!==void 0?(Mt.test(u[2])&&(n=RegExp("</"+u[2],"g")),r=w):u[3]!==void 0&&(r=w):r===w?u[0]===">"?(r=n??q,p=-1):u[1]===void 0?p=-2:(p=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?w:u[3]==='"'?Tt:Et):r===Tt||r===Et?r=w:r===wt||r===Ct?r=q:(r=w,n=void 0);let y=r===w&&i[l+1].startsWith("/>")?" ":"";o+=r===q?a+oe:p>=0?(s.push(d),a.slice(0,p)+ut+a.slice(p)+v+y):a+v+(p===-2?l:y)}return[Nt(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},K=class i{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,r=0,l=t.length-1,a=this.parts,[d,u]=kt(t,e);if(this.el=i.createElement(d,s),C.currentNode=this.el.content,e===2||e===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=C.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(ut)){let g=u[r++],y=n.getAttribute(p).split(v),J=/([.?@])?(.*)/.exec(g);a.push({type:1,index:o,name:J[2],strings:y,ctor:J[1]==="."?it:J[1]==="?"?st:J[1]==="@"?nt:P}),n.removeAttribute(p)}else p.startsWith(v)&&(a.push({type:6,index:o}),n.removeAttribute(p));if(Mt.test(n.tagName)){let p=n.textContent.split(v),g=p.length-1;if(g>0){n.textContent=tt?tt.emptyScript:"";for(let y=0;y<g;y++)n.append(p[y],B()),C.nextNode(),a.push({type:2,index:++o});n.append(p[g],B())}}}else if(n.nodeType===8)if(n.data===mt)a.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(v,p+1))!==-1;)a.push({type:7,index:o}),p+=v.length-1}o++}}static createElement(t,e){let s=E.createElement("template");return s.innerHTML=t,s}};function T(i,t,e=i,s){if(t===b)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl,o=W(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=T(i,n._$AS(i,t.values),n,s)),t}var et=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??E).importNode(e,!0);C.currentNode=n;let o=C.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let d;a.type===2?d=new k(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new ot(o,this,t)),this._$AV.push(d),a=s[++l]}r!==a?.index&&(o=C.nextNode(),r++)}return C.currentNode=E,n}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},k=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=T(this,t,e),W(t)?t===h||t==null||t===""?(this._$AH!==h&&this._$AR(),this._$AH=h):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Lt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==h&&W(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=K.createElement(Nt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{let o=new et(n,this),r=o.u(this.options);o.p(e),this.T(r),this._$AH=o}}_$AC(t){let e=Pt.get(t.strings);return e===void 0&&Pt.set(t.strings,e=new K(t)),e}k(t){ft(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let o of t)n===e.length?e.push(s=new i(this.O(B()),this.O(B()),this,this.options)):s=e[n],s._$AI(o),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,o){this.type=1,this._$AH=h,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=h}_$AI(t,e=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=T(this,t,e,0),r=!W(t)||t!==this._$AH&&t!==b,r&&(this._$AH=t);else{let l=t,a,d;for(t=o[0],a=0;a<o.length-1;a++)d=T(this,l[s+a],e,a),d===b&&(d=this._$AH[a]),r||=!W(d)||d!==this._$AH[a],d===h?t=h:t!==h&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}r&&!n&&this.j(t)}j(t){t===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},it=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===h?void 0:t}},st=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==h)}},nt=class extends P{constructor(t,e,s,n,o){super(t,e,s,n,o),this.type=5}_$AI(t,e=this){if((t=T(this,t,e,0)??h)===b)return;let s=this._$AH,n=t===h&&s!==h||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==h&&(s===h||n);n&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ot=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}},Dt={M:ut,P:v,A:mt,C:1,L:kt,R:et,D:Lt,V:T,I:k,H:P,N:st,U:nt,B:it,F:ot},re=pt.litHtmlPolyfillSupport;re?.(K,k),(pt.litHtmlVersions??=[]).push("3.3.1");var Rt=(i,t,e)=>{let s=e?.renderBefore??t,n=s._$litPart$;if(n===void 0){let o=e?.renderBefore??null;s._$litPart$=n=new k(t.insertBefore(B(),o),o,void 0,e??{})}return n._$AI(i),n};var gt=globalThis,_=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return b}};_._$litElement$=!0,_.finalized=!0,gt.litElementHydrateSupport?.({LitElement:_});var ae=gt.litElementPolyfillSupport;ae?.({LitElement:_});(gt.litElementVersions??=[]).push("4.2.1");var le={attribute:!0,type:String,converter:z,reflect:!1,hasChanged:X},he=(i=le,t,e)=>{let{kind:s,metadata:n}=e,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(e.name,i),s==="accessor"){let{name:r}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,i)},init(l){return l!==void 0&&this.C(r,void 0,i,l),l}}}if(s==="setter"){let{name:r}=e;return function(l){let a=this[r];t.call(this,l),this.requestUpdate(r,a,i)}}throw Error("Unsupported decorator location: "+s)};function c(i){return(t,e)=>typeof e=="object"?he(i,t,e):((s,n,o)=>{let r=n.hasOwnProperty(o);return n.constructor.createProperty(o,s),r?Object.getOwnPropertyDescriptor(n,o):void 0})(i,t,e)}var R={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},V=i=>(...t)=>({_$litDirective$:i,values:t}),D=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var j=class extends D{constructor(t){if(super(t),this.it=h,t.type!==R.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===h||t==null)return this._t=void 0,this.it=t;if(t===b)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};j.directiveName="unsafeHTML",j.resultType=1;var Ot=V(j);var F=i=>i??h;var{I:ii}=Dt;var Ht=i=>i.strings===void 0;var G=(i,t)=>{let e=i._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),G(s,t);return!0},rt=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while(e?.size===0)},Ut=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),pe(t)}};function ce(i){this._$AN!==void 0?(rt(this),this._$AM=i,Ut(this)):this._$AM=i}function de(i,t=!1,e=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=e;o<s.length;o++)G(s[o],!1),rt(s[o]);else s!=null&&(G(s,!1),rt(s));else G(this,i)}var pe=i=>{i.type==R.CHILD&&(i._$AP??=de,i._$AQ??=ce)},at=class extends D{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Ut(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(G(this,t),rt(this))}setValue(t){if(Ht(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var zt=i=>i?i.startsWith("url")?i:`url("${i}")`:null,ue=(i,t)=>{if(i){let e=new Image;e.addEventListener("load",t),e.src=i,e.complete&&(e.removeEventListener("load",t),window.queueMicrotask(()=>t()))}};var $t=class extends at{constructor(t){if(super(t),t.type!==R.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[e,s]){return this.useCssBackground=t.name=="style",this.render(e,s)}render(t,e){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(n=>{this.preload(n,s)}),this.useCssBackground?zt(e):e}preload(t,e){t!=null&&!e.cancelled&&ue(t,()=>{e.cancelled||this.setValue(this.useCssBackground?zt(t):t)})}},qt=V($t);var me=':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;overflow-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)}.description.with-icon{display:flex;align-items:center;gap:4px}.description.with-icon .description-icon{width:var(--sd-list-item-description-font-size, 13px);height:var(--sd-list-item-description-font-size, 13px);background-repeat:no-repeat;background-position:bottom;background-size:90%}.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:var(--sd-list-item-icon-background-size, cover)}',fe=Object.defineProperty,f=(i,t,e,s)=>{for(var n=void 0,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=r(t,e,n)||n);return n&&fe(t,e,n),n},L,m=(L=class extends _{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[H`
|
|
4
4
|
${N(me)}
|
|
5
5
|
`]}render(){return x`
|
|
6
6
|
<div class="container">
|
|
@@ -31,7 +31,7 @@ var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var lt=Object.de
|
|
|
31
31
|
${s?x` <div class="${i}-icon" style="background-image:url('${s}')" aria-hidden="true"></div> `:h}
|
|
32
32
|
${this.contentMode==="html"?Ot(t):t}
|
|
33
33
|
</div>
|
|
34
|
-
`:h}updated(i){super.updated(i),i.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let i=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,e=this.shadowRoot.querySelector(".caption");e&&(t+=e.scrollWidth-e.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,i&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(i){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",i))&&i.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},L.ID="sd-list-item",L.ensureDefined=()=>{customElements.get(L.ID)||customElements.define(L.ID,L)},L);f([c({type:String})],m.prototype,"caption");f([c({type:String})],m.prototype,"description");f([c({type:String})],m.prototype,"descriptionIcon");f([c({type:Boolean})],m.prototype,"selected");f([c({type:String})],m.prototype,"icon");f([c({type:String})],m.prototype,"iconBackgroundColor");f([c({type:String})],m.prototype,"iconPlaceholder");f([c({type:Number})],m.prototype,"level");f([c()],m.prototype,"contentMode");f([c({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],m.prototype,"enableLineClamp");f([c({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],m.prototype,"disabled");f([c({type:String,attribute:"icon-attr-aria-label"})],m.prototype,"iconAttrAriaLabel");f([c({type:String,reflect:!0})],m.prototype,"role");f([c({type:String,attribute:"caption-attr-title"})],m.prototype,"captionAttrTitle");f([c({type:String,attribute:"description-attr-title"})],m.prototype,"descriptionAttrTitle");f([c({type:String,attribute:"icon-attr-title"})],m.prototype,"iconAttrTitle");var M=m,Bt=(i,t)=>{let e=document.createElement(M.ID);if(i){if(e.caption=i.caption,e.description=i.description,e.descriptionIcon=i.descriptionIcon,e.icon=i.icon,e.iconBackgroundColor=i.iconBackgroundColor,e.iconPlaceholder=i.iconPlaceholder,e.level=i.level,e.disabled=i.disabled,i.contentMode&&(e.contentMode=i.contentMode),i.leftContentGenerator){let s=i.leftContentGenerator(i,e);s&&(s.slot="left-content",e.appendChild(s))}if(i.rightContentGenerator){let s=i.rightContentGenerator(i,e);s&&(s.slot="right-content",e.appendChild(s))}}return e};M.ensureDefined();var vt=class{getOffsetForIndexAndAlignment(t,e,s,n,o,r){let l=Math.max(0,r*n),a=Math.min(l,t*n),d=Math.max(0,t*n-o+n);switch(e){case"start":return a;case"end":return d;case"center":{let u=Math.round(d+(a-d)/2);return u<Math.ceil(o/2)?0:u>l+Math.floor(o/2)?l:u}case"auto":default:return s>=d&&s<=a?s:s<d?d:a}}debounce(t){let e;return(...s)=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{t(...s),e=null})}}},_e=new vt,bt=class{constructor(t=100,e=5){this.pageSize=t,this.preloadedItemsCount=e,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this.handleListDataRequest=s=>{let{startIndex:n,stopIndex:o}=s.detail;this._lastRequestedFirstIndex=n,this._lastRequestedLastIndex=o,this._list.items=this._itemCache.slice(n,o+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<o+this.preloadedItemsCount&&this.requestData()},this.itemCount=t}get currentPage(){return this.items.length==0&&this.finalSizeIsKnown?0:Math.floor((this.items.length-1)/this.pageSize)}get finalSizeIsKnown(){return this._finalSizeIsKnown}set finalSizeIsKnown(t){this._finalSizeIsKnown=t,t&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=t)}get itemCount(){return this._itemCount}set itemCount(t){this._itemCount=t,this._list&&(this._list.itemCount=t)}get items(){return this._itemCache}set items(t){this._itemCache=t,this.onItemsChange()}addItems(t){this._itemCache=this._itemCache.concat(t),this.onItemsChange()}connectList(t){this._list&&this._list.removeEventListener("data-request",this.handleListDataRequest),this._list=t,t.itemCount=this.itemCount,t.addEventListener("data-request",this.handleListDataRequest),t.finalSizeIsKnown=this._finalSizeIsKnown}onItemsChange(){this._pendingDataRequest=!1,this._lastLoadedIndex=this._itemCache.length-1,this.finalSizeIsKnown?this.itemCount=this._itemCache.length:this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex),this._list&&(this._list.items=this._itemCache.slice(this._lastRequestedFirstIndex,this._lastRequestedLastIndex+1))}requestData(){if(!this._pendingDataRequest)if(this.onDataRequest)this._pendingDataRequest=!0,this.onDataRequest(this.currentPage+1),this._lastLoadedIndex+=this.pageSize-1,this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex);else throw Error("The final size is not yet known and the list would require item data from index "+this._lastRequestedFirstIndex+". to "+this._lastRequestedLastIndex+". which is not possible to load without a configured onDataRequest")}},ge=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px
|
|
34
|
+
`:h}updated(i){super.updated(i),i.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let i=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,e=this.shadowRoot.querySelector(".caption");e&&(t+=e.scrollWidth-e.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,i&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(i){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",i))&&i.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},L.ID="sd-list-item",L.ensureDefined=()=>{customElements.get(L.ID)||customElements.define(L.ID,L)},L);f([c({type:String})],m.prototype,"caption");f([c({type:String})],m.prototype,"description");f([c({type:String})],m.prototype,"descriptionIcon");f([c({type:Boolean})],m.prototype,"selected");f([c({type:String})],m.prototype,"icon");f([c({type:String})],m.prototype,"iconBackgroundColor");f([c({type:String})],m.prototype,"iconPlaceholder");f([c({type:Number})],m.prototype,"level");f([c()],m.prototype,"contentMode");f([c({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],m.prototype,"enableLineClamp");f([c({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],m.prototype,"disabled");f([c({type:String,attribute:"icon-attr-aria-label"})],m.prototype,"iconAttrAriaLabel");f([c({type:String,reflect:!0})],m.prototype,"role");f([c({type:String,attribute:"caption-attr-title"})],m.prototype,"captionAttrTitle");f([c({type:String,attribute:"description-attr-title"})],m.prototype,"descriptionAttrTitle");f([c({type:String,attribute:"icon-attr-title"})],m.prototype,"iconAttrTitle");var M=m,Bt=(i,t)=>{let e=document.createElement(M.ID);if(i){if(e.caption=i.caption,e.description=i.description,e.descriptionIcon=i.descriptionIcon,e.icon=i.icon,e.iconBackgroundColor=i.iconBackgroundColor,e.iconPlaceholder=i.iconPlaceholder,e.level=i.level,e.disabled=i.disabled,i.contentMode&&(e.contentMode=i.contentMode),i.leftContentGenerator){let s=i.leftContentGenerator(i,e);s&&(s.slot="left-content",e.appendChild(s))}if(i.rightContentGenerator){let s=i.rightContentGenerator(i,e);s&&(s.slot="right-content",e.appendChild(s))}}return e};M.ensureDefined();var vt=class{getOffsetForIndexAndAlignment(t,e,s,n,o,r){let l=Math.max(0,r*n),a=Math.min(l,t*n),d=Math.max(0,t*n-o+n);switch(e){case"start":return a;case"end":return d;case"center":{let u=Math.round(d+(a-d)/2);return u<Math.ceil(o/2)?0:u>l+Math.floor(o/2)?l:u}case"auto":default:return s>=d&&s<=a?s:s<d?d:a}}debounce(t){let e;return(...s)=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{t(...s),e=null})}}},_e=new vt,bt=class{constructor(t=100,e=5){this.pageSize=t,this.preloadedItemsCount=e,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this.handleListDataRequest=s=>{let{startIndex:n,stopIndex:o}=s.detail;this._lastRequestedFirstIndex=n,this._lastRequestedLastIndex=o,this._list.items=this._itemCache.slice(n,o+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<o+this.preloadedItemsCount&&this.requestData()},this.itemCount=t}get currentPage(){return this.items.length==0&&this.finalSizeIsKnown?0:Math.floor((this.items.length-1)/this.pageSize)}get finalSizeIsKnown(){return this._finalSizeIsKnown}set finalSizeIsKnown(t){this._finalSizeIsKnown=t,t&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=t)}get itemCount(){return this._itemCount}set itemCount(t){this._itemCount=t,this._list&&(this._list.itemCount=t)}get items(){return this._itemCache}set items(t){this._itemCache=t,this.onItemsChange()}addItems(t){this._itemCache=this._itemCache.concat(t),this.onItemsChange()}connectList(t){this._list&&this._list.removeEventListener("data-request",this.handleListDataRequest),this._list=t,t.itemCount=this.itemCount,t.addEventListener("data-request",this.handleListDataRequest),t.finalSizeIsKnown=this._finalSizeIsKnown}onItemsChange(){this._pendingDataRequest=!1,this._lastLoadedIndex=this._itemCache.length-1,this.finalSizeIsKnown?this.itemCount=this._itemCache.length:this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex),this._list&&(this._list.items=this._itemCache.slice(this._lastRequestedFirstIndex,this._lastRequestedLastIndex+1))}requestData(){if(!this._pendingDataRequest)if(this.onDataRequest)this._pendingDataRequest=!0,this.onDataRequest(this.currentPage+1),this._lastLoadedIndex+=this.pageSize-1,this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex);else throw Error("The final size is not yet known and the list would require item data from index "+this._lastRequestedFirstIndex+". to "+this._lastRequestedLastIndex+". which is not possible to load without a configured onDataRequest")}},ge=":host{display:block;position:relative;contain:layout;--sd-virtual-list-focus-highlight-color: #1467ba;--sd-virtual-list-item-separator-color: #d9d9d9}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px var(--sd-virtual-list-focus-highlight-color) inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid var(--sd-virtual-list-item-separator-color)}",$e=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(i,t,e,s)=>{for(var n=s>1?void 0:s?ve(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&$e(t,e,n),n},Wt=(i=>(i.TriggerOnly="trigger-only",i.Single="single",i.Multi="multi",i))(Wt||{}),be=0,I,A=(I=class extends _{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=I.ID+"_"+be++,this.role="listbox",this.itemGenerator=Bt,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 i=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(i)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=i=>{let t=!0;switch(i.key){case"Down":case"ArrowDown":this.focusIndex=(this.focusIndex+1)%this.itemCount;break;case"Up":case"ArrowUp":this.focusIndex>0?this.focusIndex--:this.finalSizeIsKnown&&(this.focusIndex=this.itemCount-1);break;case"Enter":this.handleSelection(this.focusIndex,i);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&&(i.preventDefault(),i.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(i){this.toggleAttribute("focus-target",i)}get focusIndex(){return this._focusIndex}set focusIndex(i){if(i>=-1&&i<this.itemCount){let t=this._focusIndex;this._focusIndex=i,(i<=this._firstVisibleIndex||this._lastVisibleIndex<=i)&&this.scrollToItem(i),t!=i&&(i==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(i){i?this._selectedIndices=i.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(i,t="auto"){this.scrollTop=_e.getOffsetForIndexAndAlignment(this.normalizeIndex(i),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(i){return!this.shadowRoot||i<this._firstVisibleIndex||this._lastVisibleIndex<i?null:this.querySelector(`[item-index="${i}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(i){super.firstUpdated(i),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 i=this.getListItem(this.focusIndex);i&&(this.focusTarget||document.activeElement==this?(i.setAttribute("focused",""),this.setAttribute("aria-activedescendant",i.id)):(i.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[H`
|
|
35
35
|
${N(ge)}
|
|
36
36
|
`]}render(){return this.updateItemsRenderData(),x`
|
|
37
37
|
<div class="container" style="height: ${this.itemCount*this.itemHeight}px">
|