@pure-ds/core 0.5.40 → 0.5.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursorrules +3 -1
- package/.github/copilot-instructions.md +3 -1
- package/dist/types/pds.d.ts +4 -0
- package/dist/types/public/assets/js/lit-lazy-props.d.ts +6 -0
- package/dist/types/public/assets/js/lit-lazy-props.d.ts.map +1 -0
- package/dist/types/public/assets/js/lit-msg.d.ts +3 -0
- package/dist/types/public/assets/js/lit-msg.d.ts.map +1 -0
- package/dist/types/public/assets/js/pds-manager.d.ts +426 -141
- package/dist/types/public/assets/js/pds-manager.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds.d.ts +4 -3
- package/dist/types/public/assets/js/pds.d.ts.map +1 -1
- package/dist/types/src/js/common/common.d.ts +6 -0
- package/dist/types/src/js/common/common.d.ts.map +1 -1
- package/dist/types/src/js/lit-lazy-props.d.ts +21 -0
- package/dist/types/src/js/lit-lazy-props.d.ts.map +1 -0
- package/dist/types/src/js/lit-msg.d.ts +2 -0
- package/dist/types/src/js/lit-msg.d.ts.map +1 -0
- package/dist/types/src/js/lit.d.ts +2 -20
- package/dist/types/src/js/lit.d.ts.map +1 -1
- package/dist/types/src/js/pds.d.ts +33 -0
- package/dist/types/src/js/pds.d.ts.map +1 -1
- package/package.json +2 -1
- package/packages/pds-cli/bin/pds-static.js +17 -0
- package/packages/pds-cli/bin/templates/bootstrap/esbuild-dev.cjs +9 -0
- package/packages/pds-cli/bin/templates/bootstrap/esbuild-dev.mjs +11 -0
- package/packages/pds-cli/bin/templates/bootstrap/public/index.html +1 -1
- package/public/assets/js/app.js +12 -12
- package/public/assets/js/lit-lazy-props.js +47 -0
- package/public/assets/js/lit-msg.js +1 -0
- package/public/assets/js/lit.js +3 -3
- package/public/assets/js/pds-manager.js +4 -4
- package/public/assets/js/pds.js +6 -6
- package/public/assets/pds/external/lit-lazy-props.js +47 -0
- package/public/assets/pds/external/lit-msg.js +1 -0
- package/public/assets/pds/external/lit.js +131 -0
- package/readme.md +104 -4
- package/src/js/pds.d.ts +4 -0
- package/src/js/pds.js +22 -0
package/public/assets/js/pds.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)!==-1||e.indexOf(" ")!==-1||e.startsWith("#/"))return!1;let t=new URL(e,window.location.origin);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function
|
|
3
|
-
<div title="${i.tooltip||""}" data-index="${r}" class="${`${
|
|
1
|
+
var Ne=Object.defineProperty;var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var J=(e,t)=>{for(var n in t)Ne(e,n,{get:t[n],enumerable:!0})};var Se={};J(Se,{AutoDefiner:()=>oe});async function nt(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let n=e,{baseURL:r,mapper:o=d=>`${d}.js`,onError:s=(d,l)=>console.error(`[defineWebComponents] ${d}:`,l)}=t,i=r?new URL(r,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),u=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(l,a,m)=>m.toUpperCase()),c=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let l=o(d),m=await import(l instanceof URL?l.href:new URL(l,i).href),h=m?.default??m?.[u(d)];if(!h){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${u(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,h),{tag:d,status:"defined"})}catch(l){throw s(d,l),l}};return Promise.all(n.map(c))}var oe,Ee=Z(()=>{oe=class{constructor(t={}){let{baseURL:n,mapper:r,onError:o,predicate:s=()=>!0,attributeModule:i="data-module",root:u=document,scanExisting:c=!0,debounceMs:d=16,observeShadows:l=!0,enhancers:a=[],patchAttachShadow:m=!0}=t,h=new Set,w=new Set,v=new Set,b=new Map,x=new WeakMap,M=new WeakMap,E=0,k=!1,C=null,q=p=>{if(!p||!a.length)return;let y=M.get(p);y||(y=new Set,M.set(p,y));for(let f of a)if(!(!f.selector||!f.run)&&!y.has(f.selector))try{p.matches&&p.matches(f.selector)&&(f.run(p),y.add(f.selector))}catch(L){console.warn(`[AutoDefiner] Error applying enhancer for selector "${f.selector}":`,L)}},I=(p,y)=>{if(!k&&!(!p||!p.includes("-"))&&!customElements.get(p)&&!w.has(p)&&!v.has(p)){if(y&&y.getAttribute){let f=y.getAttribute(i);f&&!b.has(p)&&b.set(p,f)}h.add(p),F()}},F=()=>{E||(E=setTimeout(O,d))},A=p=>{if(p){if(p.nodeType===1){let y=p,f=y.tagName?.toLowerCase();f&&f.includes("-")&&!customElements.get(f)&&s(f,y)&&I(f,y),q(y),l&&y.shadowRoot&&R(y.shadowRoot)}p.querySelectorAll&&p.querySelectorAll("*").forEach(y=>{let f=y.tagName?.toLowerCase();f&&f.includes("-")&&!customElements.get(f)&&s(f,y)&&I(f,y),q(y),l&&y.shadowRoot&&R(y.shadowRoot)})}},R=p=>{if(!p||x.has(p))return;A(p);let y=new MutationObserver(f=>{for(let L of f)L.addedNodes?.forEach(_=>{A(_)}),L.type==="attributes"&&L.target&&A(L.target)});y.observe(p,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[i,...a.map(f=>f.selector).filter(f=>f.startsWith("data-"))]}),x.set(p,y)};async function O(){if(clearTimeout(E),E=0,!h.size)return;let p=Array.from(h);h.clear(),p.forEach(y=>w.add(y));try{let y=f=>b.get(f)??(r?r(f):`${f}.js`);await nt(...p,{baseURL:n,mapper:y,onError:(f,L)=>{v.add(f),o?.(f,L)}})}catch{}finally{p.forEach(y=>w.delete(y))}}let S=u===document?document.documentElement:u,P=new MutationObserver(p=>{for(let y of p)y.addedNodes?.forEach(f=>{A(f)}),y.type==="attributes"&&y.target&&A(y.target)});if(P.observe(S,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[i,...a.map(p=>p.selector).filter(p=>p.startsWith("data-"))]}),l&&m&&Element.prototype.attachShadow){let p=Element.prototype.attachShadow;Element.prototype.attachShadow=function(f){let L=p.call(this,f);if(f&&f.mode==="open"){R(L);let _=this.tagName?.toLowerCase();_&&_.includes("-")&&!customElements.get(_)&&I(_,this)}return L},C=()=>Element.prototype.attachShadow=p}return c&&A(S),{stop(){k=!0,P.disconnect(),C&&C(),E&&(clearTimeout(E),E=0),x.forEach(p=>p.disconnect())},flush:O}}static async define(...t){let n={};t.length&&typeof t[t.length-1]=="object"&&(n=t.pop()||{});let r=t,{baseURL:o,mapper:s=l=>`${l}.js`,onError:i=(l,a)=>console.error(`[defineWebComponents] ${l}:`,a)}=n,u=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),c=l=>l.toLowerCase().replace(/(^|-)([a-z])/g,(a,m,h)=>h.toUpperCase()),d=async l=>{try{if(customElements.get(l))return{tag:l,status:"already-defined"};let a=s(l),h=await import(a instanceof URL?a.href:new URL(a,u).href),w=h?.default??h?.[c(l)];if(!w){if(customElements.get(l))return{tag:l,status:"self-defined"};throw new Error(`No export found for ${l}. Expected default export or named export "${c(l)}".`)}return customElements.get(l)?{tag:l,status:"race-already-defined"}:(customElements.define(l,w),{tag:l,status:"defined"})}catch(a){throw i(l,a),a}};return Promise.all(r.map(d))}}});function $e(e){return new DOMParser().parseFromString(e,"text/html").body.childNodes}function Te(e,t=100){let n;return function(...o){let s=()=>{clearTimeout(n),e(...o)};clearTimeout(n),n=setTimeout(s,t)}}function V(e){setTimeout(e,0)}function Me(e){try{if(typeof e!="string"||e.indexOf(`
|
|
2
|
+
`)!==-1||e.indexOf(" ")!==-1||e.startsWith("#/"))return!1;let t=new URL(e,window.location.origin);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Ie(e,t,n){let r=window.screen.width/2-t/2,o=window.screen.height/2-n/2;return window.open(e,"",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=${t}, height=${n}, top=${o}, left=${r}`)}var Pe=Z(()=>{});var _e={};J(_e,{AutoComplete:()=>de});var le,de,Ue=Z(()=>{Pe();le={result:"ac-suggestion",item:"ac-itm"},de=class e extends EventTarget{constructor(t,n,r){super(),this.settings={emptyResultsText:"",...r},this.container=t,this.input=n,this.input.setAttribute("autocomplete","off"),this.categories=r.categories||{},this.caches=new Map,V(this.attach.bind(this))}static connect(t,n){let r=t.target;if(!r._autoComplete){if(!n?.categories)throw Error("Missing autocomplete settings");r._autoComplete=new e(r.parentNode,r,n),t.type==="focus"&&setTimeout(()=>{r._autoComplete.focusHandler(t)},100)}return r._autoComplete}on(t,n){return this.input.addEventListener(t,n),this}attach(){this.resultsDiv=document.createElement("div"),this.resultsDiv.title="",this.resultsDiv.classList.add(le.result),this.container.offsetWidth>100&&(this.resultsDiv.style.width=this.container.offsetWidth),this.resultsDiv.addEventListener("mousedown",this.resultClick.bind(this)),this.container.classList.add("ac-container"),this.input.classList.add("ac-input");let t=getComputedStyle(this.input);this.container.style.setProperty("--ac-bg-default",t.backgroundColor),this.container.style.setProperty("--ac-color-default",t.color);let n=getComputedStyle(this.input).accentColor;n!=="auto"&&this.container.style.setProperty("--ac-accent-color",n),(this.container?.shadowRoot??this.container).appendChild(this.resultsDiv),this.controller().clear("attach"),this.on("input",Te(this.inputHandler.bind(this),this.settings.throttleInputMs??300)).on("focus",this.focusHandler.bind(this)).on("focusout",this.blurHandler.bind(this)).on("keyup",this.keyUpHandler.bind(this)).on("keydown",this.keyDownHandler.bind(this))}controller(){let t=this.internalController();return typeof this.settings.controller=="function"&&(t=this.settings.controller(this)??t),t}internalController(){return{show:this.show.bind(this),hide:this.hide.bind(this),clear:this.clear.bind(this),empty:()=>{}}}moveResult(t){this.controller().show();let n=this.acItems.length;this.rowIndex=this.rowIndex+t,this.rowIndex<=0?this.rowIndex=0:this.rowIndex>n-1&&(this.rowIndex=0);for(let o of this.acItems)o.classList.remove("selected");let r=this.getSelectedDiv();r?(r.classList.add("selected"),r.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):this.focusHandler({target:this.input})}getSelectedDiv(){return this.resultsDiv.querySelector(`div:nth-child(${this.rowIndex+1})`)}selectResult(t){if(t=t||this.getSelectedDiv(),t){let n=parseInt(t.getAttribute("data-index"));this.resultClicked=!0;let r=this.results[n],o=this.categories[r.category]??{};o.action=o.action??this.setText.bind(this),o.newTab&&(this.tabWindow=Ie("about:blank"));let s={...r,search:this.input.value};t.classList.add("ac-active"),setTimeout(()=>{this.controller().hide("result-selected"),s.action?s.action(s):(o.action(s),o.newTab&&(s.url?this.tabWindow.location.href=s.url:this.tabWindow.close()));var i=new Event("change",{bubbles:!0});this.input.dispatchEvent(i),this.controller().clear("result-selected");let u=new Event("result-selected");u.detail=s,this.input.dispatchEvent(u)},0)}}setText(t){this.container.autoCompleteInput||(this.container.value=t.text),this.controller().hide("settext")}resultClick(t){this.selectResult(t.target.closest(`.${le.item}`))}blurHandler(){setTimeout(()=>{this.resultClicked||this.controller().clear("blurred"),this.resultClicked=!1},100)}clear(){this.settings.debug||this.resultsDiv&&(this.resultsDiv.innerHTML="",this.controller().hide("clear"),this.cacheTmr&&clearTimeout(this.cacheTmr),this.cacheTmr=setTimeout(()=>{this.caches.clear()},60*1e3*5))}show(){if(!this.resultsDiv.classList.contains("ac-active")){let t=this.getViewBounds();this.resultsDiv.style.position="absolute",t.rect.width>100&&(this.resultsDiv.style.width=`${t.rect.width}px`),this.settings.direction=this.settings.direction??t.suggestedDirection,this.resultsDiv.setAttribute("data-direction",this.settings.direction),this.settings.direction==="up"?(this.resultsDiv.style.top="unset",this.resultsDiv.style.bottom=`${t.rect.height+20}px`,this.rowIndex=this.acItems.length):(this.resultsDiv.style.bottom="unset",this.resultsDiv.style.top=`${t.rect.height}px`,this.rowIndex=-1),this.resultsDiv.style.maxWidth="unset",this.resultsDiv.classList.toggle("ac-active",!0)}}getViewBounds(){let t=this.input.getBoundingClientRect();return{rect:t,suggestedDirection:t.top+t.height+500>window.innerHeight?"up":"down"}}hide(){this.resultsDiv.classList.toggle("ac-active",!1)}empty(){this.resultsDiv.innerHTML=`<div class="ac-empty">${this.settings.emptyResultsText}</div>`,this.controller().show()}inputHandler(t){this.cacheTmr&&clearTimeout(this.cacheTmr);let n={search:t.target.value,categories:this.categories};this.container.classList.add("search-running"),this.getItems(n,t).then(r=>{this.controller().clear("new-results"),this.resultsHandler(r,n),this.container.classList.remove("search-running")})}keyDownHandler(t){switch(t.key){case"Enter":t.stopPropagation(),t.preventDefault();break;case"ArrowDown":V(this.moveResult(1));break;case"ArrowUp":V(this.moveResult(-1));break}}keyUpHandler(t){switch(t.key){case"Escape":this.controller().hide("escape");break;case"Enter":this.getSelectedDiv()&&(this.container.preventEnter=!0,t.stopPropagation(),t.preventDefault(),this.selectResult(),setTimeout(()=>{this.container.preventEnter=!1},10));break;default:break}}focusHandler(t){this.controller().clear("focus");let n=t.target.value;this.suggest(n,t)}suggest(t,n){this.input.focus();let r={suggest:!0,search:t||"",categories:this.categories};this.getItems(r,n).then(o=>{this.input.dispatchEvent(new CustomEvent("show-results",{detail:{results:o}})),this.resultsHandler(o,r)})}sort(t,n){return t.sort((r,o)=>{let s=n.categories[r.category],i=n.categories[o.category],u=typeof s.sortIndex=="function"?s.sortIndex(n):s.sortIndex??0;return(typeof i.sortIndex=="function"?i.sortIndex(n):i.sortIndex??0)>u?1:-1})}resultsHandler(t,n){this.results=t,this.rowIndex=-1;let r=0,o=(s,i)=>`
|
|
3
|
+
<div title="${i.tooltip||""}" data-index="${r}" class="${`${le.item} cat-${i.category} ${i.class??""}`.trim()}">
|
|
4
4
|
${this.handleImageOrIcon(i)}
|
|
5
5
|
<span class="text">${this.formatResultItem(i,n,s)}</span>
|
|
6
6
|
${this.settings.hideCategory?"":`<span class="category">${i.category||""}</span>`}
|
|
7
|
-
</div>`;t.forEach(s=>{let i=n.categories[s.category]||{};s.element?this.resultsDiv.appendChild(s.element):(s=typeof s=="string"?{text:s}:s,this.resultsDiv.appendChild(
|
|
7
|
+
</div>`;t.forEach(s=>{let i=n.categories[s.category]||{};s.element?this.resultsDiv.appendChild(s.element):(s=typeof s=="string"?{text:s}:s,this.resultsDiv.appendChild($e(o(i,s))[0])),r++}),t.length?(this.acItems=this.resultsDiv.querySelectorAll(".ac-itm"),this.controller().show()):n.search.length&&this.controller().empty()}handleImageOrIcon(t){return t.image?`<img src="${t.image}"/>`:typeof this.settings.iconHandler=="function"?this.settings.iconHandler(t):`<svg-icon icon="${t.icon}"></svg-icon>`}formatResultItem(t,n,r){let o=typeof t=="string"?{text:t}:t,s=o.text;return n.search&&(s=s.replace("%search%",n.search),o.description=o.description?.replace("%search%",n.search)),s=this.highlight(s,n.search),o.description&&(s=`<div>${s}</div><small>${o.description}</small>`),r.format&&(s=r.format({item:o,result:s,options:n})),s}highlight(t,n){var r=new RegExp("("+n+")","gi");return t.replace(r,'<span class="txt-hl">$1</span>')}async getItems(t,n){this.aborter&&this.aborter.abort();let r=this.caches.get(t.search);if(r)return r;let o=this.settings.map,s=c=>(typeof c=="string"&&(c={text:c}),c),i=c=>o?c.map(d=>({text:d[o]})):c.map(d=>s(d)),u=c=>(this.settings.max&&this.settings.max>0&&(c.length=this.settings.max),c);return this.aborter=new AbortController,this.aborterSignal=this.aborter.signal,new Promise(c=>{let d=l=>{l=this.sort(l,t),this.settings.cache!==!1&&this.caches.set(t.search,l),c(l)};if(Me(this.items)){if(this.settings.minlength>0&&(!t.search||t.search.length<this.settings.minlength)){d([]);return}let l=this.formatSearch(this.items,t);fetch(l).then(a=>{if(a.status===200){a.json().then(m=>{m=i(m),d(u(m.filter(h=>this.isMatch(t,h))))});return}throw Error(`HTTP error ${a.status} - ${l}`)})}else if(Array.isArray(this.items)){let l=!0;this.items=this.items.map(a=>typeof a=="string"?{text:a}:(l=!1,a)),l&&this.container.classList.add("simple"),d(u(i(this.items)))}else if(typeof this.items=="function")t.control=this.container,Promise.resolve(this.items(t,n)).then(a=>{a=a.map(m=>s(m)),a=i(a),d(a)});else return d(Promise.resolve(this.items.apply(this,t)))})}async items(t){let n=[];t.results=[],t.signal=this.aborterSignal;for(var r in t.categories){let o=t.categories[r];if(o.trigger=o.trigger??(()=>!0),t.results=n,o.trigger(t)){let s=[];try{s=await o.getItems(t)}catch(i){console.warn(`Error loading items for omniBox category '${r}'.`,i)}n=n.concat(s.map(i=>(i.category=r,i)))}}return n}formatSearch(t,n){return t.indexOf("%search%")?t.replace("%search%",n.search||""):t+"?"+this.createQueryParam(n)}createQueryParam(t){let n=t.suggest?"&suggest=true":"";return`q=${t.text}${n}`}isMatch(t,n){return n.text?.indexOf("%search%")>=0?!0:t.search?n.text?.toLowerCase().indexOf(t.search.toLowerCase())>=0:t.suggest}static textFilter(t,n){return function(r){if(!t.search)return!0;if(r.hidden)return!1;let s=(n?r[n]:r).match(new RegExp(t.search,"gi"));if(s)return s;if(r.config?.tags)return r.config.tags.some(i=>i.match(new RegExp(t.search,"gi")))}}}});var X=class{constructor(){this._mode="static",this._staticPaths={tokens:"/assets/pds/styles/pds-tokens.css.js",primitives:"/assets/pds/styles/pds-primitives.css.js",components:"/assets/pds/styles/pds-components.css.js",utilities:"/assets/pds/styles/pds-utilities.css.js",styles:"/assets/pds/styles/pds-styles.css.js"}}setLiveMode(){this._mode="live"}setStaticMode(t={}){this._mode="static",this._staticPaths={...this._staticPaths,...t}}async getStylesheet(t){if(this._mode==="live")return null;try{return(await import(this._staticPaths[t]))[t]}catch(n){console.error(`[PDS Registry] Failed to load static ${t}:`,n),console.error(`[PDS Registry] Looking for: ${this._staticPaths[t]}`),console.error("[PDS Registry] Make sure you've run 'npm run pds:build' and configured PDS.start() with the correct static.root path");let r=new CSSStyleSheet;return r.replaceSync("/* Failed to load "+t+" */"),r}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},U=new X;async function he(e,t=[],n=null){try{let r=n?.primitivesStylesheet?n.primitivesStylesheet:await U.getStylesheet("primitives");e.adoptedStyleSheets=[r,...t]}catch(r){let o=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${o}> failed to adopt primitives:`,r),e.adoptedStyleSheets=t}}async function fe(e,t=["primitives"],n=[],r=null){try{let s=(await Promise.all(t.map(async i=>{if(r)switch(i){case"tokens":return r.tokensStylesheet;case"primitives":return r.primitivesStylesheet;case"components":return r.componentsStylesheet;case"utilities":return r.utilitiesStylesheet;default:break}return U.getStylesheet(i)}))).filter(i=>i!==null);e.adoptedStyleSheets=[...s,...n]}catch(o){let s=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${s}> failed to adopt layers:`,o),e.adoptedStyleSheets=n}}function me(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var ye={FontWeights:{light:300,normal:400,medium:500,semibold:600,bold:700},LineHeights:{tight:1.25,normal:1.5,relaxed:1.75},BorderWidths:{hairline:.5,thin:1,medium:2,thick:3},RadiusSizes:{none:0,small:4,medium:8,large:16,xlarge:24,xxlarge:32},ShadowDepths:{none:"none",light:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",medium:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",deep:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",extreme:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},TransitionSpeeds:{fast:150,normal:250,slow:350},AnimationEasings:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},TouchTargetSizes:{compact:36,standard:44,comfortable:48,spacious:56},LinkStyles:{inline:"inline",block:"block",button:"button"},FocusStyles:{ring:"ring",outline:"outline",border:"border",glow:"glow"},TabSizes:{compact:2,standard:4,wide:8},SelectIcons:{chevron:"chevron",arrow:"arrow",caret:"caret",none:"none"},IconSizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64,"3xl":96}};var ge={mode:"live",preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...n){console[e](t,...n)}};var te={};J(te,{deepMerge:()=>be,fragmentFromTemplateLike:()=>ee,isObject:()=>W,parseHTML:()=>Y});function W(e){return e&&typeof e=="object"&&!Array.isArray(e)}function be(e,t){let n={...e};return W(e)&&W(t)&&Object.keys(t).forEach(r=>{W(t[r])?r in e?n[r]=be(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function Y(e){let t=new DOMParser().parseFromString(e,"text/html").body.childNodes;return Array.from(t).filter(n=>n.nodeType===1)}function ee(e){let t=Array.isArray(e?.strings)?e.strings:[],n=Array.isArray(e?.values)?e.values:[],r=new Set,o=[],s=/(\s)(\.[\w-]+)=\s*$/;for(let a=0;a<t.length;a+=1){let m=t[a]??"",h=m.match(s);if(h&&a<n.length){let v=h[2].slice(1),b=`pds-val-${a}`;m=m.replace(s,`$1data-pds-prop="${v}:${b}"`),r.add(a)}o.push(m),a<n.length&&!r.has(a)&&o.push(`<!--pds-val-${a}-->`)}let i=document.createElement("template");i.innerHTML=o.join("");let u=(a,m)=>{let h=a.parentNode;if(!h)return;if(m==null){h.removeChild(a);return}let w=v=>{if(v!=null){if(v instanceof Node){h.insertBefore(v,a);return}if(Array.isArray(v)){v.forEach(b=>w(b));return}h.insertBefore(document.createTextNode(String(v)),a)}};w(m),h.removeChild(a)},c=document.createTreeWalker(i.content,NodeFilter.SHOW_COMMENT),d=[];for(;c.nextNode();){let a=c.currentNode;a?.nodeValue?.startsWith("pds-val-")&&d.push(a)}return d.forEach(a=>{let m=Number(a.nodeValue.replace("pds-val-",""));u(a,n[m])}),i.content.querySelectorAll("*").forEach(a=>{let m=a.getAttribute("data-pds-prop");if(!m)return;let[h,w]=m.split(":"),v=Number(String(w).replace("pds-val-",""));h&&Number.isInteger(v)&&(a[h]=n[v]),a.removeAttribute("data-pds-prop")}),i.content}function ne(e,t){if(t==null)return;if(typeof t=="object"&&Array.isArray(t.strings)&&Array.isArray(t.values)){e.appendChild(ee(t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t)){t.forEach(r=>ne(e,r));return}let n=typeof t=="string"?t:String(t);e.appendChild(document.createTextNode(n))}async function we(e,t={}){return t={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...t},new Promise(r=>{let o=document.createElement("dialog");ge.options?.liquidGlassEffects&&o.classList.add("liquid-glass"),t.size&&o.classList.add(`dialog-${t.size}`),t.type&&o.classList.add(`dialog-${t.type}`),t.class&&(Array.isArray(t.class)?o.classList.add(...t.class):o.classList.add(t.class)),t.maxHeight&&o.style.setProperty("--dialog-max-height",t.maxHeight);let s=Object.entries(t.buttons).map(([u,c])=>{let d=c.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${c.cancel?"button":"submit"}" class="${d}" value="${u}">${c.name}</button>`});if(t.useForm){let u=document.createElement("div");ne(u,e);let c=u.querySelector("form");if(c){o.innerHTML=`
|
|
8
8
|
<header>
|
|
9
9
|
<h2>${t.title}</h2>
|
|
10
10
|
</header>
|
|
@@ -28,5 +28,5 @@ var Oe=Object.defineProperty;var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var J=(e,t)=>{fo
|
|
|
28
28
|
${s.join("")}
|
|
29
29
|
</footer>
|
|
30
30
|
</form>
|
|
31
|
-
`;let u=o.querySelector("#msg-container");te(u,e)}o.addEventListener("click",u=>{u.target.closest('button[value="cancel"]')&&(o.close(),r(!1))});let i=()=>{let u=o.querySelector("form");u?u.addEventListener("submit",c=>{c.preventDefault();let d;t.useForm&&c.submitter.value==="ok"?(console.log("Found form:",u),console.log("Form elements:",u?Array.from(u.elements):"no form"),d=new FormData(u),console.log("FormData entries:",Array.from(d.entries()))):d=c.submitter.value==="ok",o.close(),r(d)}):requestAnimationFrame(i)};i(),o.addEventListener("close",()=>{setTimeout(()=>o.remove(),200)}),document.body.appendChild(o),typeof t.rendered=="function"&&t.rendered(o),o.showModal()})}async function Ne(){let e=document.querySelector("pds-toaster");return e||(e=document.createElement("pds-toaster"),document.body.appendChild(e),await customElements.whenDefined("pds-toaster")),e}async function D(e,t={}){return(await Ne()).toast(e,t)}D.success=async function(e,t={}){return D(e,{...t,type:"success"})};D.error=async function(e,t={}){return D(e,{...t,type:"error"})};D.warning=async function(e,t={}){return D(e,{...t,type:"warning"})};D.info=async function(e,t={}){return D(e,{...t,type:"information"})};var je=[{selector:".accordion"},{selector:"nav[data-dropdown]"},{selector:"label[data-toggle]"},{selector:'input[type="range"]'},{selector:"form[data-required]"},{selector:"fieldset[role=group][data-open]"},{selector:"[data-clip]"},{selector:"button, a[class*='btn-']"}];function Fe(e){e.dataset.enhancedAccordion||(e.dataset.enhancedAccordion="true",e.addEventListener("toggle",t=>{t.target.open&&t.target.parentElement===e&&e.querySelectorAll(":scope > details[open]").forEach(n=>{n!==t.target&&(n.open=!1)})},!0))}function He(e){if(e.dataset.enhancedDropdown)return;e.dataset.enhancedDropdown="true";let t=e.lastElementChild;if(!t)return;let n=e.querySelector("[data-dropdown-toggle]")||e.querySelector("button");n&&!n.hasAttribute("type")&&n.setAttribute("type","button"),t.id||(t.id=`dropdown-${Math.random().toString(36).slice(2,9)}`),t.tagName?.toLowerCase()==="menu"&&!t.hasAttribute("role")&&t.setAttribute("role","menu"),t.hasAttribute("aria-hidden")||t.setAttribute("aria-hidden","true"),n&&(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-controls",t.id),n.setAttribute("aria-expanded","false"));let o=()=>{let c=(e.getAttribute("data-mode")||"auto").toLowerCase();if(c==="up"||c==="down")return c;let d=e.getBoundingClientRect(),l=Math.max(0,window.innerHeight-d.bottom);return Math.max(0,d.top)>l?"up":"down"},s=()=>{e.dataset.dropdownDirection=o(),t.setAttribute("aria-hidden","false"),n?.setAttribute("aria-expanded","true")},i=()=>{t.setAttribute("aria-hidden","true"),n?.setAttribute("aria-expanded","false")},u=()=>{t.getAttribute("aria-hidden")==="false"?i():s()};n?.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),u()}),document.addEventListener("click",c=>{e.contains(c.target)||i()}),e.addEventListener("keydown",c=>{c.key==="Escape"&&(i(),n?.focus())}),e.addEventListener("focusout",c=>{(!c.relatedTarget||!e.contains(c.relatedTarget))&&i()})}function We(e){if(e.dataset.enhancedToggle)return;e.dataset.enhancedToggle="true";let t=e.querySelector('input[type="checkbox"]');if(!t)return;e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.setAttribute("role","switch"),e.setAttribute("aria-checked",t.checked?"true":"false");let n=document.createElement("span");n.className="toggle-switch",n.setAttribute("role","presentation"),n.setAttribute("aria-hidden","true");let r=document.createElement("span");r.className="toggle-knob",n.appendChild(r),e.insertBefore(n,t.nextSibling);let o=()=>{e.setAttribute("aria-checked",t.checked?"true":"false")},s=()=>{t.disabled||(t.checked=!t.checked,o(),t.dispatchEvent(new Event("change",{bubbles:!0})))};e.addEventListener("click",i=>{i.preventDefault(),s()}),e.addEventListener("keydown",i=>{(i.key===" "||i.key==="Enter")&&(i.preventDefault(),s())}),t.addEventListener("change",o)}function ze(e){if(e.dataset.enhancedRange)return;let t=e.closest("label"),n=t?.classList.contains("range-output"),r=e.id||`range-${Math.random().toString(36).substring(2,11)}`,o=`${r}-output`;if(e.id=r,n){let s=t.querySelector("span");if(s&&!s.classList.contains("range-output-wrapper")){let i=document.createElement("span");i.className="range-output-wrapper",i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center";let u=document.createElement("span");u.textContent=s.textContent,i.appendChild(u);let c=document.createElement("output");c.id=o,c.setAttribute("for",r),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=e.value,i.appendChild(c),s.textContent="",s.appendChild(i);let d=()=>{c.textContent=e.value};e.addEventListener("input",d)}}else{let s=e.closest(".range-container");s||(s=document.createElement("div"),s.className="range-container",e.parentNode?.insertBefore(s,e),s.appendChild(e)),s.style.position="relative";let i=document.createElement("output");i.id=o,i.setAttribute("for",r),i.className="range-bubble",i.setAttribute("aria-live","polite"),s.appendChild(i);let u=()=>{let l=parseFloat(e.min)||0,a=parseFloat(e.max)||100,m=parseFloat(e.value),h=(m-l)/(a-l);i.style.left=`calc(${h*100}% )`,i.textContent=String(m)},c=()=>i.classList.add("visible"),d=()=>i.classList.remove("visible");e.addEventListener("input",u),e.addEventListener("pointerdown",c),e.addEventListener("pointerup",d),e.addEventListener("pointerleave",d),e.addEventListener("focus",c),e.addEventListener("blur",d),u()}e.dataset.enhancedRange="1"}function Be(e){if(e.dataset.enhancedRequired)return;e.dataset.enhancedRequired="true";let t=n=>{let r=n.closest("label");if(!r||r.querySelector(".required-asterisk"))return;let o=document.createElement("span");o.classList.add("required-asterisk"),o.textContent="*",o.style.marginLeft="4px",r.querySelector("span").appendChild(o);let s=n.closest("form");if(s&&!s.querySelector(".required-legend")){let i=document.createElement("small");i.classList.add("required-legend"),i.textContent="* Required fields",s.insertBefore(i,s.querySelector(".form-actions")||s.lastElementChild)}};e.querySelectorAll("[required]").forEach(n=>{t(n)})}function Ve(e){if(e.dataset.enhancedOpenGroup)return;e.dataset.enhancedOpenGroup="true",e.classList.add("flex","flex-wrap","buttons");let t=document.createElement("input");t.type="text",t.placeholder="Add item...",t.classList.add("input-text","input-sm"),t.style.width="auto";let n=e.querySelector('input[type="radio"], input[type="checkbox"]');e.appendChild(t),t.addEventListener("keydown",r=>{if(r.key==="Enter"||r.key==="Tab"){let o=t.value.trim();if(o){r.preventDefault();let s=n.type==="radio"?"radio":"checkbox",i=`open-group-${Math.random().toString(36).substring(2,11)}`,u=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=o;let d=document.createElement("input");d.type=s,d.name=n.name||e.getAttribute("data-name")||"open-group",d.value=o,d.id=i,u.appendChild(c),u.appendChild(d),e.insertBefore(u,t),t.value=""}}else if(r.key==="Backspace"&&t.value===""){r.preventDefault();let o=e.querySelectorAll("label");o.length>0&&o[o.length-1].remove()}})}function Ge(e){if(e.dataset.enhancedClip)return;e.dataset.enhancedClip="true",e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.hasAttribute("role")||e.setAttribute("role","button");let t=()=>{let r=e.getAttribute("data-clip-open")==="true";e.setAttribute("aria-expanded",r?"true":"false")},n=()=>{let r=e.getAttribute("data-clip-open")==="true";e.setAttribute("data-clip-open",r?"false":"true"),t()};e.addEventListener("click",r=>{r.defaultPrevented||n()}),e.addEventListener("keydown",r=>{(r.key===" "||r.key==="Enter")&&(r.preventDefault(),n())}),t()}function Ke(e){if(e.dataset.enhancedBtnWorking)return;e.dataset.enhancedBtnWorking="true";let t=null,n=!1;new MutationObserver(o=>{o.forEach(s=>{if(s.attributeName==="class"){let i=e.classList.contains("btn-working"),u=e.querySelector("pds-icon");if(i)if(u)t||(t=u.getAttribute("icon")),u.setAttribute("icon","circle-notch");else{let c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),e.insertBefore(c,e.firstChild),n=!0}else s.oldValue?.includes("btn-working")&&u&&(n?(u.remove(),n=!1):t&&(u.setAttribute("icon",t),t=null))}})}).observe(e,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Qe=new Map([[".accordion",Fe],["nav[data-dropdown]",He],["label[data-toggle]",We],['input[type="range"]',ze],["form[data-required]",Be],["fieldset[role=group][data-open]",Ve],["[data-clip]",Ge],["button, a[class*='btn-']",Ke]]),ne=je.map(e=>({...e,run:Qe.get(e.selector)||(()=>{})}));var ve="pds",Ze=/^([a-z][a-z0-9+\-.]*:)?\/\//i,we=/^[a-z]:/i;function N(e=""){return e.endsWith("/")?e:`${e}/`}function Je(e="",t=ve){let n=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(n)?n:`${n}/${t}`}function Xe(e){return e.replace(/^\.\/+/,"")}function Ye(e){return we.test(e)?e.replace(we,"").replace(/^\/+/,""):e}function et(e){return e.startsWith("public/")?e.substring(7):e}function re(e,t={}){let n=t.segment||ve,r=t.defaultRoot||`/assets/${n}/`,o=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!o||typeof o!="string")return N(r);let s=o.trim();return s?(s=s.replace(/\\/g,"/"),s=Je(s,n),s=N(s),Ze.test(s)?s:(s=Xe(s),s=Ye(s),s.startsWith("/")||(s=et(s),s.startsWith("/")||(s=`/${s}`),s=s.replace(/\/+/g,(i,u)=>u===0?i:"/")),N(s))):N(r)}var nt=/^[a-z][a-z0-9+\-.]*:\/\//i,j=(()=>{try{return import.meta.url}catch{return}})(),z=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function B(e,t={}){if(!e||nt.test(e))return e;let{preferModule:n=!0}=t,r=()=>{if(!j)return null;try{return new URL(e,j).href}catch{return null}},o=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(e,window.location.origin).href}catch{return null}};return(n?r()||o():o()||r())||e}var Ee=(()=>{if(j)try{let e=new URL(j);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",j).href}catch{return}})(),Ae=!1;function Le(e){Ae||typeof document>"u"||(Ae=!0,e.addEventListener("pds:ready",t=>{let n=t.detail?.mode;n&&document.documentElement.classList.add(`pds-${n}`,"pds-ready")}))}function ie(e={},t={}){if(!t||typeof t!="object")return e;let n=Array.isArray(e)?[...e]:{...e};for(let[r,o]of Object.entries(t))o&&typeof o=="object"&&!Array.isArray(o)?n[r]=ie(n[r]&&typeof n[r]=="object"?n[r]:{},o):n[r]=o;return n}function oe(e=""){return String(e).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function $(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>$(n)).filter(n=>n!==void 0);let t={};for(let n in e)if(e.hasOwnProperty(n)){let r=e[n];if(typeof r!="function"){let o=$(r);o!==void 0&&(t[n]=o)}}return t}function Ce(e={},t={},{presets:n,defaultLog:r}){let o=typeof e=="object"&&("colors"in e||"typography"in e||"spatialRhythm"in e||"shape"in e||"behavior"in e||"layout"in e||"advanced"in e||"a11y"in e||"components"in e||"icons"in e),s=e&&e.enhancers;s&&!Array.isArray(s)&&(s=Object.values(s));let i=s??t.enhancers??[],u=e&&e.preset,c=e&&e.design,d=e&&e.icons&&typeof e.icons=="object"?e.icons:null,l="preset"in(e||{})||"design"in(e||{})||"enhancers"in(e||{}),a,m=null;if(l){let h=String(u||"default").toLowerCase(),w=n?.[h]||Object.values(n||{}).find(p=>oe(p.name)===h||String(p.name||"").toLowerCase()===h);if(!w)throw new Error(`PDS preset not found: "${u||"default"}"`);m={id:w.id||oe(w.name),name:w.name||w.id||String(h)};let v=structuredClone(w);if(c&&typeof c=="object"||d){let p=c?$(c):{},y=d?$(d):null,f=y?ie(p,{icons:y}):p;v=ie(v,structuredClone(f))}let{mode:g,autoDefine:x,applyGlobalStyles:M,manageTheme:E,themeStorageKey:k,preloadStyles:C,criticalLayers:q,managerURL:I,manager:H,preset:A,design:R,enhancers:O,log:S,...P}=e;a={...P,design:v,preset:m.name,log:S||r}}else if(o){let{log:h,...w}=e;a={design:structuredClone(w),log:h||r}}else{let h=n?.default||Object.values(n||{}).find(w=>oe(w.name)==="default");if(!h)throw new Error("PDS default preset not available");m={id:h.id||"default",name:h.name||"Default"},a={design:structuredClone(h),preset:m.name,log:r}}return{generatorConfig:a,enhancers:i,presetInfo:m}}function De({manageTheme:e,themeStorageKey:t,applyResolvedTheme:n,setupSystemListenerIfNeeded:r}){let o="light",s=null;if(e&&typeof window<"u"){try{s=localStorage.getItem(t)||null}catch{s=null}try{n?.(s),r?.(s)}catch{}s?s==="system"?o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o=s:o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:o,storedTheme:s}}function ae(e,{resolvePublicAssetURL:t}){let n=!!(e?.public?.root||e?.static?.root),r=t(e);return!n&&Ee&&(r=Ee),z(B(r))}async function ke(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:n="/auto-define/",autoDefinePreload:r=[],autoDefineMapper:o=null,enhancers:s=[],autoDefineOverrides:i=null,autoDefinePreferModule:u=!0}=e,c=(()=>{let l=new Map;return(t||[]).forEach(a=>l.set(a.selector,a)),(s||[]).forEach(a=>l.set(a.selector,a)),Array.from(l.values())})(),d=null;if(typeof window<"u"&&typeof document<"u"){let l=null;try{let g=await Promise.resolve().then(()=>(Se(),xe));l=g?.AutoDefiner||g?.default?.AutoDefiner||g?.default||null}catch(g){console.warn("AutoDefiner not available:",g?.message||g)}let a=g=>{switch(g){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${g}.js`}},{mapper:m,...h}=i&&typeof i=="object"?i:{},v={baseURL:n&&z(B(n,{preferModule:u})),predefine:r,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:c,onError:(g,x)=>{if(typeof g=="string"&&g.startsWith("pds-")){let E=["pds-form","pds-drawer"].includes(g),k=x?.message?.includes("#pds/lit")||x?.message?.includes("Failed to resolve module specifier");E&&k?console.error(`\u274C PDS component <${g}> requires Lit but #pds/lit is not in import map.
|
|
32
|
-
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${
|
|
31
|
+
`;let u=o.querySelector("#msg-container");ne(u,e)}o.addEventListener("click",u=>{u.target.closest('button[value="cancel"]')&&(o.close(),r(!1))});let i=()=>{let u=o.querySelector("form");u?u.addEventListener("submit",c=>{c.preventDefault();let d;t.useForm&&c.submitter.value==="ok"?(console.log("Found form:",u),console.log("Form elements:",u?Array.from(u.elements):"no form"),d=new FormData(u),console.log("FormData entries:",Array.from(d.entries()))):d=c.submitter.value==="ok",o.close(),r(d)}):requestAnimationFrame(i)};i(),o.addEventListener("close",()=>{setTimeout(()=>o.remove(),200)}),document.body.appendChild(o),typeof t.rendered=="function"&&t.rendered(o),o.showModal()})}async function je(){let e=document.querySelector("pds-toaster");return e||(e=document.createElement("pds-toaster"),document.body.appendChild(e),await customElements.whenDefined("pds-toaster")),e}async function D(e,t={}){return(await je()).toast(e,t)}D.success=async function(e,t={}){return D(e,{...t,type:"success"})};D.error=async function(e,t={}){return D(e,{...t,type:"error"})};D.warning=async function(e,t={}){return D(e,{...t,type:"warning"})};D.info=async function(e,t={}){return D(e,{...t,type:"information"})};var He=[{selector:".accordion"},{selector:"nav[data-dropdown]"},{selector:"label[data-toggle]"},{selector:'input[type="range"]'},{selector:"form[data-required]"},{selector:"fieldset[role=group][data-open]"},{selector:"[data-clip]"},{selector:"button, a[class*='btn-']"}];function Fe(e){e.dataset.enhancedAccordion||(e.dataset.enhancedAccordion="true",e.addEventListener("toggle",t=>{t.target.open&&t.target.parentElement===e&&e.querySelectorAll(":scope > details[open]").forEach(n=>{n!==t.target&&(n.open=!1)})},!0))}function We(e){if(e.dataset.enhancedDropdown)return;e.dataset.enhancedDropdown="true";let t=e.lastElementChild;if(!t)return;let n=e.querySelector("[data-dropdown-toggle]")||e.querySelector("button");n&&!n.hasAttribute("type")&&n.setAttribute("type","button"),t.id||(t.id=`dropdown-${Math.random().toString(36).slice(2,9)}`),t.tagName?.toLowerCase()==="menu"&&!t.hasAttribute("role")&&t.setAttribute("role","menu"),t.hasAttribute("aria-hidden")||t.setAttribute("aria-hidden","true"),n&&(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-controls",t.id),n.setAttribute("aria-expanded","false"));let o=()=>{let c=(e.getAttribute("data-mode")||"auto").toLowerCase();if(c==="up"||c==="down")return c;let d=e.getBoundingClientRect(),l=Math.max(0,window.innerHeight-d.bottom);return Math.max(0,d.top)>l?"up":"down"},s=()=>{e.dataset.dropdownDirection=o(),t.setAttribute("aria-hidden","false"),n?.setAttribute("aria-expanded","true")},i=()=>{t.setAttribute("aria-hidden","true"),n?.setAttribute("aria-expanded","false")},u=()=>{t.getAttribute("aria-hidden")==="false"?i():s()};n?.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),u()}),document.addEventListener("click",c=>{e.contains(c.target)||i()}),e.addEventListener("keydown",c=>{c.key==="Escape"&&(i(),n?.focus())}),e.addEventListener("focusout",c=>{(!c.relatedTarget||!e.contains(c.relatedTarget))&&i()})}function ze(e){if(e.dataset.enhancedToggle)return;e.dataset.enhancedToggle="true";let t=e.querySelector('input[type="checkbox"]');if(!t)return;e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.setAttribute("role","switch"),e.setAttribute("aria-checked",t.checked?"true":"false");let n=document.createElement("span");n.className="toggle-switch",n.setAttribute("role","presentation"),n.setAttribute("aria-hidden","true");let r=document.createElement("span");r.className="toggle-knob",n.appendChild(r),e.insertBefore(n,t.nextSibling);let o=()=>{e.setAttribute("aria-checked",t.checked?"true":"false")},s=()=>{t.disabled||(t.checked=!t.checked,o(),t.dispatchEvent(new Event("change",{bubbles:!0})))};e.addEventListener("click",i=>{i.preventDefault(),s()}),e.addEventListener("keydown",i=>{(i.key===" "||i.key==="Enter")&&(i.preventDefault(),s())}),t.addEventListener("change",o)}function Be(e){if(e.dataset.enhancedRange)return;let t=e.closest("label"),n=t?.classList.contains("range-output"),r=e.id||`range-${Math.random().toString(36).substring(2,11)}`,o=`${r}-output`;if(e.id=r,n){let s=t.querySelector("span");if(s&&!s.classList.contains("range-output-wrapper")){let i=document.createElement("span");i.className="range-output-wrapper",i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center";let u=document.createElement("span");u.textContent=s.textContent,i.appendChild(u);let c=document.createElement("output");c.id=o,c.setAttribute("for",r),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=e.value,i.appendChild(c),s.textContent="",s.appendChild(i);let d=()=>{c.textContent=e.value};e.addEventListener("input",d)}}else{let s=e.closest(".range-container");s||(s=document.createElement("div"),s.className="range-container",e.parentNode?.insertBefore(s,e),s.appendChild(e)),s.style.position="relative";let i=document.createElement("output");i.id=o,i.setAttribute("for",r),i.className="range-bubble",i.setAttribute("aria-live","polite"),s.appendChild(i);let u=()=>{let l=parseFloat(e.min)||0,a=parseFloat(e.max)||100,m=parseFloat(e.value),h=(m-l)/(a-l);i.style.left=`calc(${h*100}% )`,i.textContent=String(m)},c=()=>i.classList.add("visible"),d=()=>i.classList.remove("visible");e.addEventListener("input",u),e.addEventListener("pointerdown",c),e.addEventListener("pointerup",d),e.addEventListener("pointerleave",d),e.addEventListener("focus",c),e.addEventListener("blur",d),u()}e.dataset.enhancedRange="1"}function Ve(e){if(e.dataset.enhancedRequired)return;e.dataset.enhancedRequired="true";let t=n=>{let r=n.closest("label");if(!r||r.querySelector(".required-asterisk"))return;let o=document.createElement("span");o.classList.add("required-asterisk"),o.textContent="*",o.style.marginLeft="4px",r.querySelector("span").appendChild(o);let s=n.closest("form");if(s&&!s.querySelector(".required-legend")){let i=document.createElement("small");i.classList.add("required-legend"),i.textContent="* Required fields",s.insertBefore(i,s.querySelector(".form-actions")||s.lastElementChild)}};e.querySelectorAll("[required]").forEach(n=>{t(n)})}function Ge(e){if(e.dataset.enhancedOpenGroup)return;e.dataset.enhancedOpenGroup="true",e.classList.add("flex","flex-wrap","buttons");let t=document.createElement("input");t.type="text",t.placeholder="Add item...",t.classList.add("input-text","input-sm"),t.style.width="auto";let n=e.querySelector('input[type="radio"], input[type="checkbox"]');e.appendChild(t),t.addEventListener("keydown",r=>{if(r.key==="Enter"||r.key==="Tab"){let o=t.value.trim();if(o){r.preventDefault();let s=n.type==="radio"?"radio":"checkbox",i=`open-group-${Math.random().toString(36).substring(2,11)}`,u=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=o;let d=document.createElement("input");d.type=s,d.name=n.name||e.getAttribute("data-name")||"open-group",d.value=o,d.id=i,u.appendChild(c),u.appendChild(d),e.insertBefore(u,t),t.value=""}}else if(r.key==="Backspace"&&t.value===""){r.preventDefault();let o=e.querySelectorAll("label");o.length>0&&o[o.length-1].remove()}})}function Ke(e){if(e.dataset.enhancedClip)return;e.dataset.enhancedClip="true",e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.hasAttribute("role")||e.setAttribute("role","button");let t=()=>{let r=e.getAttribute("data-clip-open")==="true";e.setAttribute("aria-expanded",r?"true":"false")},n=()=>{let r=e.getAttribute("data-clip-open")==="true";e.setAttribute("data-clip-open",r?"false":"true"),t()};e.addEventListener("click",r=>{r.defaultPrevented||n()}),e.addEventListener("keydown",r=>{(r.key===" "||r.key==="Enter")&&(r.preventDefault(),n())}),t()}function Qe(e){if(e.dataset.enhancedBtnWorking)return;e.dataset.enhancedBtnWorking="true";let t=null,n=!1;new MutationObserver(o=>{o.forEach(s=>{if(s.attributeName==="class"){let i=e.classList.contains("btn-working"),u=e.querySelector("pds-icon");if(i)if(u)t||(t=u.getAttribute("icon")),u.setAttribute("icon","circle-notch");else{let c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),e.insertBefore(c,e.firstChild),n=!0}else s.oldValue?.includes("btn-working")&&u&&(n?(u.remove(),n=!1):t&&(u.setAttribute("icon",t),t=null))}})}).observe(e,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Ze=new Map([[".accordion",Fe],["nav[data-dropdown]",We],["label[data-toggle]",ze],['input[type="range"]',Be],["form[data-required]",Ve],["fieldset[role=group][data-open]",Ge],["[data-clip]",Ke],["button, a[class*='btn-']",Qe]]),re=He.map(e=>({...e,run:Ze.get(e.selector)||(()=>{})}));var xe="pds",Je=/^([a-z][a-z0-9+\-.]*:)?\/\//i,ve=/^[a-z]:/i;function N(e=""){return e.endsWith("/")?e:`${e}/`}function Xe(e="",t=xe){let n=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(n)?n:`${n}/${t}`}function Ye(e){return e.replace(/^\.\/+/,"")}function et(e){return ve.test(e)?e.replace(ve,"").replace(/^\/+/,""):e}function tt(e){return e.startsWith("public/")?e.substring(7):e}function se(e,t={}){let n=t.segment||xe,r=t.defaultRoot||`/assets/${n}/`,o=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!o||typeof o!="string")return N(r);let s=o.trim();return s?(s=s.replace(/\\/g,"/"),s=Xe(s,n),s=N(s),Je.test(s)?s:(s=Ye(s),s=et(s),s.startsWith("/")||(s=tt(s),s.startsWith("/")||(s=`/${s}`),s=s.replace(/\/+/g,(i,u)=>u===0?i:"/")),N(s))):N(r)}var rt=/^[a-z][a-z0-9+\-.]*:\/\//i,j=(()=>{try{return import.meta.url}catch{return}})(),z=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function B(e,t={}){if(!e||rt.test(e))return e;let{preferModule:n=!0}=t,r=()=>{if(!j)return null;try{return new URL(e,j).href}catch{return null}},o=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(e,window.location.origin).href}catch{return null}};return(n?r()||o():o()||r())||e}var Ae=(()=>{if(j)try{let e=new URL(j);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",j).href}catch{return}})(),Le=!1;function Ce(e){Le||typeof document>"u"||(Le=!0,e.addEventListener("pds:ready",t=>{let n=t.detail?.mode;n&&document.documentElement.classList.add(`pds-${n}`,"pds-ready")}))}function ae(e={},t={}){if(!t||typeof t!="object")return e;let n=Array.isArray(e)?[...e]:{...e};for(let[r,o]of Object.entries(t))o&&typeof o=="object"&&!Array.isArray(o)?n[r]=ae(n[r]&&typeof n[r]=="object"?n[r]:{},o):n[r]=o;return n}function ie(e=""){return String(e).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function $(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>$(n)).filter(n=>n!==void 0);let t={};for(let n in e)if(e.hasOwnProperty(n)){let r=e[n];if(typeof r!="function"){let o=$(r);o!==void 0&&(t[n]=o)}}return t}function De(e={},t={},{presets:n,defaultLog:r}){let o=typeof e=="object"&&("colors"in e||"typography"in e||"spatialRhythm"in e||"shape"in e||"behavior"in e||"layout"in e||"advanced"in e||"a11y"in e||"components"in e||"icons"in e),s=e&&e.enhancers;s&&!Array.isArray(s)&&(s=Object.values(s));let i=s??t.enhancers??[],u=e&&e.preset,c=e&&e.design,d=e&&e.icons&&typeof e.icons=="object"?e.icons:null,l="preset"in(e||{})||"design"in(e||{})||"enhancers"in(e||{}),a,m=null;if(l){let h=String(u||"default").toLowerCase(),w=n?.[h]||Object.values(n||{}).find(p=>ie(p.name)===h||String(p.name||"").toLowerCase()===h);if(!w)throw new Error(`PDS preset not found: "${u||"default"}"`);m={id:w.id||ie(w.name),name:w.name||w.id||String(h)};let v=structuredClone(w);if(c&&typeof c=="object"||d){let p=c?$(c):{},y=d?$(d):null,f=y?ae(p,{icons:y}):p;v=ae(v,structuredClone(f))}let{mode:b,autoDefine:x,applyGlobalStyles:M,manageTheme:E,themeStorageKey:k,preloadStyles:C,criticalLayers:q,managerURL:I,manager:F,preset:A,design:R,enhancers:O,log:S,...P}=e;a={...P,design:v,preset:m.name,log:S||r}}else if(o){let{log:h,...w}=e;a={design:structuredClone(w),log:h||r}}else{let h=n?.default||Object.values(n||{}).find(w=>ie(w.name)==="default");if(!h)throw new Error("PDS default preset not available");m={id:h.id||"default",name:h.name||"Default"},a={design:structuredClone(h),preset:m.name,log:r}}return{generatorConfig:a,enhancers:i,presetInfo:m}}function ke({manageTheme:e,themeStorageKey:t,applyResolvedTheme:n,setupSystemListenerIfNeeded:r}){let o="light",s=null;if(e&&typeof window<"u"){try{s=localStorage.getItem(t)||null}catch{s=null}try{n?.(s),r?.(s)}catch{}s?s==="system"?o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o=s:o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:o,storedTheme:s}}function ce(e,{resolvePublicAssetURL:t}){let n=!!(e?.public?.root||e?.static?.root),r=t(e);return!n&&Ae&&(r=Ae),z(B(r))}async function Re(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:n="/auto-define/",autoDefinePreload:r=[],autoDefineMapper:o=null,enhancers:s=[],autoDefineOverrides:i=null,autoDefinePreferModule:u=!0}=e,c=(()=>{let l=new Map;return(t||[]).forEach(a=>l.set(a.selector,a)),(s||[]).forEach(a=>l.set(a.selector,a)),Array.from(l.values())})(),d=null;if(typeof window<"u"&&typeof document<"u"){let l=null;try{let b=await Promise.resolve().then(()=>(Ee(),Se));l=b?.AutoDefiner||b?.default?.AutoDefiner||b?.default||null}catch(b){console.warn("AutoDefiner not available:",b?.message||b)}let a=b=>{switch(b){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${b}.js`}},{mapper:m,...h}=i&&typeof i=="object"?i:{},v={baseURL:n&&z(B(n,{preferModule:u})),predefine:r,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:c,onError:(b,x)=>{if(typeof b=="string"&&b.startsWith("pds-")){let E=["pds-form","pds-drawer"].includes(b),k=x?.message?.includes("#pds/lit")||x?.message?.includes("Failed to resolve module specifier");E&&k?console.error(`\u274C PDS component <${b}> requires Lit but #pds/lit is not in import map.
|
|
32
|
+
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${b}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${b}>:`,x)},...h,mapper:b=>{if(customElements.get(b))return null;if(typeof o=="function")try{let x=o(b);return x===void 0?a(b):x}catch(x){return console.warn("Custom autoDefine.mapper error; falling back to default:",x?.message||x),a(b)}return a(b)}};l&&(d=new l(v),r.length>0&&typeof l.define=="function"&&await l.define(...r,{baseURL:n,mapper:v.mapper,onError:v.onError}))}return{autoDefiner:d,mergedEnhancers:c}}var pe=class extends EventTarget{},g=new pe;g.initializing=!1;g.currentPreset=null;g.debug=!1;var qe=(e="")=>String(e).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),G=function(e="log",t,...n){let r=!!(g.registry&&!g.registry.isLive),o=(this?.debug||this?.design?.debug||g.debug||!1)===!0;if(r){if(!g.debug)return}else if(!o&&e!=="error"&&e!=="warn")return;let s=console[e]||console.log;n.length>0?s(t,...n):s(t)};async function st(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let n=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let r=await fetch(n,{cache:"no-store"});return r.ok?await r.json():null}catch{return null}}g.registry=U;g.enums=ye;g.adoptLayers=fe;g.adoptPrimitives=he;g.createStylesheet=me;g.isLiveMode=()=>U.isLive;g.ask=we;g.toast=D;g.common=te;g.parse=Y;g.AutoComplete=null;g.loadAutoComplete=async()=>{if(g.AutoComplete)return g.AutoComplete;try{let e=await Promise.resolve().then(()=>(Ue(),_e)),t=e?.AutoComplete||e?.default||e;if(t)return g.AutoComplete=t,t}catch(e){G("warn","PDS.loadAutoComplete failed",e)}return null};function Oe(e){let t=typeof CustomEvent=="function";try{let n=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");g.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",n))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",n))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}typeof window<"u"&&(window.PDS=g);var ue="pure-ds-theme",T=null,H=null;function K(e){try{if(typeof document>"u")return;let t="light";e?e==="system"?t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=e:t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",t)}catch{}}function Q(e){try{if(T&&H){try{typeof T.removeEventListener=="function"?T.removeEventListener("change",H):typeof T.removeListener=="function"&&T.removeListener(H)}catch{}T=null,H=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=r=>{let o=r?.matches===void 0?t.matches:r.matches;try{let s=o?"dark":"light";document.documentElement.setAttribute("data-theme",s),g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:s,source:"system"}}))}catch{}};T=t,H=n,typeof t.addEventListener=="function"?t.addEventListener("change",n):typeof t.addListener=="function"&&t.addListener(n)}}catch{}}Object.defineProperty(g,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ue)||null}catch{return null}},set(e){try{if(typeof window>"u")return;e==null?localStorage.removeItem(ue):localStorage.setItem(ue,e),K(e),Q(e),g.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});g.defaultEnhancers=re;async function ot(e){let t=e&&e.mode||"live",{mode:n,...r}=e||{};if(t==="static")return it(r);let o=ce(r,{resolvePublicAssetURL:se}),s=r?.managerURL||r?.public?.managerURL||r?.manager?.url||new URL("core/pds-manager.js",o).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:i}=await import(s);return i(g,r,{emitReady:Oe,applyResolvedTheme:K,setupSystemListenerIfNeeded:Q})}g.start=ot;async function it(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,n=e.manageTheme??!0,r=e.themeStorageKey??"pure-ds-theme",o=e.staticPaths??{},s=ce(e,{resolvePublicAssetURL:se}),i=e&&e.autoDefine||null,u;i&&i.baseURL?u=z(B(i.baseURL,{preferModule:!1})):u=`${s}components/`;let c=i&&Array.isArray(i.predefine)&&i.predefine||[],d=i&&typeof i.mapper=="function"&&i.mapper||null;try{Ce(g);let{resolvedTheme:l}=ke({manageTheme:n,themeStorageKey:r,applyResolvedTheme:K,setupSystemListenerIfNeeded:Q}),a=await st(s,e),m=a?.config?.design||a?.design||null,h=a?.config?.preset||a?.preset||"default",w=a?.presetId||qe(h)||"default",v=m?{[String(w).toLowerCase()]:m,...String(w).toLowerCase()!=="default"?{default:m}:{}}:null,b=e?.design&&typeof e.design=="object"?$(e.design):null,x=qe(e?.preset||"default")||"default",M=b?{[String(x).toLowerCase()]:b,...String(x).toLowerCase()!=="default"?{default:b}:{}}:null,E=v||e?.presets||M||{};if(!Object.keys(E||{}).length)throw new Error("PDS static mode requires preset data. Run pds:build or provide config.presets/config.design.");let k=a?.config?{...a.config,...e,preset:e?.preset||w,design:b||m||a?.config?.design}:e,C=De(k,{},{presets:E,defaultLog:G}),q=C.enhancers,I={tokens:`${s}styles/pds-tokens.css.js`,primitives:`${s}styles/pds-primitives.css.js`,components:`${s}styles/pds-components.css.js`,utilities:`${s}styles/pds-utilities.css.js`,styles:`${s}styles/pds-styles.css.js`},F=a?.paths||{};if(o={...I,...F,...o},g.registry.setStaticMode(o),t&&typeof document<"u")try{let S=await g.registry.getStylesheet("styles");if(S){S._pds=!0;let P=(document.adoptedStyleSheets||[]).filter(p=>p._pds!==!0);document.adoptedStyleSheets=[...P,S]}}catch(S){G.call(g,"warn","Failed to apply static styles:",S)}let A=null,R=[];try{let S=await Re({autoDefineBaseURL:u,autoDefinePreload:c,autoDefineMapper:d,enhancers:q,autoDefineOverrides:i||null,autoDefinePreferModule:!(i&&i.baseURL)},{baseEnhancers:re});A=S.autoDefiner,R=S.mergedEnhancers||[]}catch(S){G.call(g,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",S)}let O=$(e);return g.currentConfig=Object.freeze({mode:"static",...structuredClone(O),design:structuredClone(C.generatorConfig.design),preset:C.generatorConfig.preset,theme:l,enhancers:R}),Oe({mode:"static",config:C.generatorConfig,theme:l,autoDefiner:A}),{config:C.generatorConfig,theme:l,autoDefiner:A}}catch(l){throw g.dispatchEvent(new CustomEvent("pds:error",{detail:{error:l}})),l}}var $t=K,Tt=Q;export{g as PDS,$t as applyResolvedTheme,Tt as setupSystemListenerIfNeeded};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var O=globalThis,R=O.ShadowRoot&&(O.ShadyCSS===void 0||O.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol(),Y=new WeakMap,N=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==G)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(R&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Y.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Y.set(e,t))}return t}toString(){return this.cssText}},Q=r=>new N(typeof r=="string"?r:r+"",void 0,G);var X=(r,t)=>{if(R)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=O.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},D=R?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(r):r;var{is:_t,defineProperty:ft,getOwnPropertyDescriptor:mt,getOwnPropertyNames:At,getOwnPropertySymbols:gt,getPrototypeOf:yt}=Object,H=globalThis,tt=H.trustedTypes,vt=tt?tt.emptyScript:"",Et=H.reactiveElementPolyfillSupport,b=(r,t)=>r,k={toAttribute(r,t){switch(t){case Boolean:r=r?vt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},st=(r,t)=>!_t(r,t),et={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:st};Symbol.metadata??=Symbol("metadata"),H.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=et){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(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ft(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=mt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:i,set(n){let c=i?.call(this);o?.call(this,n),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??et}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;let t=yt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){let e=this.properties,s=[...At(e),...gt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,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 i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(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 X(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),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:k).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:k;this._$Em=i;let c=n.fromAttribute(e,o.type);this[i]=c??this._$Ej?.get(i)??c,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let i=this.constructor,o=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??st)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:o},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!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[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s){let{wrapped:n}=o,c=this[i];n!==!0||this._$AL.has(i)||c===void 0||this.C(i,void 0,o,c)}}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"},$[b("elementProperties")]=new Map,$[b("finalized")]=new Map,Et?.({ReactiveElement:$}),(H.reactiveElementVersions??=[]).push("2.1.1");var q=globalThis,M=q.trustedTypes,it=M?M.createPolicy("lit-html",{createHTML:r=>r}):void 0,lt="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,ct="?"+f,St=`<${ct}>`,g=document,w=()=>g.createComment(""),x=r=>r===null||typeof r!="object"&&typeof r!="function",J=Array.isArray,bt=r=>J(r)||typeof r?.[Symbol.iterator]=="function",B=`[
|
|
2
|
+
\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rt=/-->/g,ot=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),nt=/'/g,ht=/"/g,pt=/^(?:script|style|textarea|title)$/i,K=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Rt=K(1),Ht=K(2),Mt=K(3),y=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),at=new WeakMap,A=g.createTreeWalker(g,129);function dt(r,t){if(!J(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return it!==void 0?it.createHTML(t):t}var Ct=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"<svg>":t===3?"<math>":"",n=C;for(let c=0;c<e;c++){let h=r[c],p,d,a=-1,u=0;for(;u<h.length&&(n.lastIndex=u,d=n.exec(h),d!==null);)u=n.lastIndex,n===C?d[1]==="!--"?n=rt:d[1]!==void 0?n=ot:d[2]!==void 0?(pt.test(d[2])&&(i=RegExp("</"+d[2],"g")),n=m):d[3]!==void 0&&(n=m):n===m?d[0]===">"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,p=d[1],n=d[3]===void 0?m:d[3]==='"'?ht:nt):n===ht||n===nt?n=m:n===rt||n===ot?n=C:(n=m,i=void 0);let _=n===m&&r[c+1].startsWith("/>")?" ":"";o+=n===C?h+St:a>=0?(s.push(p),h.slice(0,a)+lt+h.slice(a)+f+_):h+f+(a===-2?c:_)}return[dt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},P=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,c=t.length-1,h=this.parts,[p,d]=Ct(t,e);if(this.el=r.createElement(p,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(let a of i.getAttributeNames())if(a.endsWith(lt)){let u=d[n++],_=i.getAttribute(a).split(f),T=/([.?@])?(.*)/.exec(u);h.push({type:1,index:o,name:T[2],strings:_,ctor:T[1]==="."?I:T[1]==="?"?z:T[1]==="@"?V:E}),i.removeAttribute(a)}else a.startsWith(f)&&(h.push({type:6,index:o}),i.removeAttribute(a));if(pt.test(i.tagName)){let a=i.textContent.split(f),u=a.length-1;if(u>0){i.textContent=M?M.emptyScript:"";for(let _=0;_<u;_++)i.append(a[_],w()),A.nextNode(),h.push({type:2,index:++o});i.append(a[u],w())}}}else if(i.nodeType===8)if(i.data===ct)h.push({type:2,index:o});else{let a=-1;for(;(a=i.data.indexOf(f,a+1))!==-1;)h.push({type:7,index:o}),a+=f.length-1}o++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}};function v(r,t,e=r,s){if(t===y)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl,o=x(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=v(r,i._$AS(r,t.values),i,s)),t}var j=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,i=(t?.creationScope??g).importNode(e,!0);A.currentNode=i;let o=A.nextNode(),n=0,c=0,h=s[0];for(;h!==void 0;){if(n===h.index){let p;h.type===2?p=new U(o,o.nextSibling,this,t):h.type===1?p=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(p=new W(o,this,t)),this._$AV.push(p),h=s[++c]}n!==h?.index&&(o=A.nextNode(),n++)}return A.currentNode=g,i}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++}},U=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.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=v(this,t,e),x(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):bt(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!==l&&x(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=P.createElement(dt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let o=new j(i,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=at.get(t.strings);return e===void 0&&at.set(t.strings,e=new P(t)),e}k(t){J(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let o of t)i===e.length?e.push(s=new r(this.O(w()),this.O(w()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$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))}},E=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=l}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!x(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let c=t,h,p;for(t=o[0],h=0;h<o.length-1;h++)p=v(this,c[s+h],e,h),p===y&&(p=this._$AH[h]),n||=!x(p)||p!==this._$AH[h],p===l?t=l:t!==l&&(t+=(p??"")+o[h+1]),this._$AH[h]=p}n&&!i&&this.j(t)}j(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},I=class extends E{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===l?void 0:t}},z=class extends E{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}},V=class extends E{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=v(this,t,e,0)??l)===y)return;let s=this._$AH,i=t===l&&s!==l||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==l&&(s===l||i);i&&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)}},W=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){v(this,t)}};var wt=q.litHtmlPolyfillSupport;wt?.(P,U),(q.litHtmlVersions??=[]).push("3.3.1");var ut=(r,t,e)=>{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new U(t.insertBefore(w(),o),o,void 0,e??{})}return i._$AI(r),i};var Z=globalThis,S=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=ut(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return y}};S._$litElement$=!0,S.finalized=!0,Z.litElementHydrateSupport?.({LitElement:S});var xt=Z.litElementPolyfillSupport;xt?.({LitElement:S});(Z.litElementVersions??=[]).push("4.2.1");var $t=r=>(...t)=>({_$litDirective$:r,values:t}),L=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 F=class extends L{#t=null;#e=null;render(t){return l}update(t,[e]){let s=t.element;return this.#e!==s?(this.#e=s,this.#t=e,this.#s()):JSON.stringify(this.#t)!==JSON.stringify(e)&&(this.#t=e,this.#s()),l}async#s(){if(!this.#e||!this.#t)return;let t=this.#e.tagName.toLowerCase();await customElements.whenDefined(t);for(let[e,s]of Object.entries(this.#t))this.#e[e]=s}},Xt=$t(F);export{Xt as lazyProps};
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
@lit/reactive-element/css-tag.js:
|
|
7
|
+
(**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2019 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*)
|
|
12
|
+
|
|
13
|
+
@lit/reactive-element/reactive-element.js:
|
|
14
|
+
(**
|
|
15
|
+
* @license
|
|
16
|
+
* Copyright 2017 Google LLC
|
|
17
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
+
*)
|
|
19
|
+
|
|
20
|
+
lit-html/lit-html.js:
|
|
21
|
+
(**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2017 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*)
|
|
26
|
+
|
|
27
|
+
lit-element/lit-element.js:
|
|
28
|
+
(**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2017 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*)
|
|
33
|
+
|
|
34
|
+
lit-html/is-server.js:
|
|
35
|
+
(**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2022 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*)
|
|
40
|
+
|
|
41
|
+
lit-html/directive.js:
|
|
42
|
+
(**
|
|
43
|
+
* @license
|
|
44
|
+
* Copyright 2017 Google LLC
|
|
45
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
46
|
+
*)
|
|
47
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=["127.0.0.1","localhost"].includes(window.location.hostname),g=n=>typeof n!="string"&&"strTag"in n;function l(n){let r="";for(let t=0;t<=n.length-1;t++)r+=n[t],t<n.length-1&&(r+=`{${t}}`);return r}function u(n,r){return n.replace(/\{(\d+)\}/g,(t,o)=>r(o))}var a=(n,r,t)=>{let o=l(n),e=s(o,t);return u(e,c=>r[c])};function s(n,r={}){window.__strings=window.__strings??{};let t=window.__strings[n]?.content;return!t&&i&&console.log("\u{1F310}",n,r.desc?`(${r.desc})`:""),window.env?.DEBUG_TRANSLATIONS?`__${t??n}`:t??n}var d=(n,r={})=>n?g(n)?a(n.strings,n.values,r):s(n,r):"";export{d as msg};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
var I=globalThis,G=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rt=Symbol(),Ct=new WeakMap,R=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==rt)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(G&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=Ct.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ct.set(e,t))}return t}toString(){return this.cssText}},xt=s=>new R(typeof s=="string"?s:s+"",void 0,rt),ot=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new R(e,s,rt)},Et=(s,t)=>{if(G)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=I.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},nt=G?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return xt(e)})(s):s;var{is:Qt,defineProperty:te,getOwnPropertyDescriptor:ee,getOwnPropertyNames:se,getOwnPropertySymbols:ie,getPrototypeOf:re}=Object,z=globalThis,wt=z.trustedTypes,oe=wt?wt.emptyScript:"",ne=z.reactiveElementPolyfillSupport,O=(s,t)=>s,at={toAttribute(s,t){switch(t){case Boolean:s=s?oe:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Pt=(s,t)=>!Qt(s,t),bt={attribute:!0,type:String,converter:at,reflect:!1,useDefault:!1,hasChanged:Pt};Symbol.metadata??=Symbol("metadata"),z.litPropertyMetadata??=new WeakMap;var v=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=bt){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 i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&te(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=ee(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let c=r?.call(this);o?.call(this,n),this.requestUpdate(t,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??bt}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;let t=re(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){let e=this.properties,i=[...se(e),...ie(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(nt(r))}else t!==void 0&&e.push(nt(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Et(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,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:at).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:at;this._$Em=r;let c=n.fromAttribute(e,o.type);this[r]=c??this._$Ej?.get(r)??c,this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){let r=this.constructor,o=this[t];if(i??=r.getPropertyOptions(t),!((i.hasChanged??Pt)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!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[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:n}=o,c=this[r];n!==!0||this._$AL.has(r)||c===void 0||this.C(r,void 0,o,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}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){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[O("elementProperties")]=new Map,v[O("finalized")]=new Map,ne?.({ReactiveElement:v}),(z.reactiveElementVersions??=[]).push("2.1.1");var ct=globalThis,W=ct.trustedTypes,Tt=W?W.createPolicy("lit-html",{createHTML:s=>s}):void 0,lt="$lit$",y=`lit$${Math.random().toFixed(9).slice(2)}$`,dt="?"+y,ae=`<${dt}>`,w=document,L=()=>w.createComment(""),k=s=>s===null||typeof s!="object"&&typeof s!="function",pt=Array.isArray,Ot=s=>pt(s)||typeof s?.[Symbol.iterator]=="function",ht=`[
|
|
2
|
+
\f\r]`,D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mt=/-->/g,Ut=/>/g,x=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Nt=/"/g,Dt=/^(?:script|style|textarea|title)$/i,ut=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),X=ut(1),ft=ut(2),Lt=ut(3),m=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Rt=new WeakMap,E=w.createTreeWalker(w,129);function kt(s,t){if(!pt(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Tt!==void 0?Tt.createHTML(t):t}var jt=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=D;for(let c=0;c<e;c++){let a=s[c],l,p,h=-1,f=0;for(;f<a.length&&(n.lastIndex=f,p=n.exec(a),p!==null);)f=n.lastIndex,n===D?p[1]==="!--"?n=Mt:p[1]!==void 0?n=Ut:p[2]!==void 0?(Dt.test(p[2])&&(r=RegExp("</"+p[2],"g")),n=x):p[3]!==void 0&&(n=x):n===x?p[0]===">"?(n=r??D,h=-1):p[1]===void 0?h=-2:(h=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?x:p[3]==='"'?Nt:Ht):n===Nt||n===Ht?n=x:n===Mt||n===Ut?n=D:(n=x,r=void 0);let u=n===x&&s[c+1].startsWith("/>")?" ":"";o+=n===D?a+ae:h>=0?(i.push(l),a.slice(0,h)+lt+a.slice(h)+y+u):a+y+(h===-2?c:u)}return[kt(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},j=class s{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0,c=t.length-1,a=this.parts,[l,p]=jt(t,e);if(this.el=s.createElement(l,i),E.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=E.nextNode())!==null&&a.length<c;){if(r.nodeType===1){if(r.hasAttributes())for(let h of r.getAttributeNames())if(h.endsWith(lt)){let f=p[n++],u=r.getAttribute(h).split(y),$=/([.?@])?(.*)/.exec(f);a.push({type:1,index:o,name:$[2],strings:u,ctor:$[1]==="."?q:$[1]==="?"?Z:$[1]==="@"?Y:P}),r.removeAttribute(h)}else h.startsWith(y)&&(a.push({type:6,index:o}),r.removeAttribute(h));if(Dt.test(r.tagName)){let h=r.textContent.split(y),f=h.length-1;if(f>0){r.textContent=W?W.emptyScript:"";for(let u=0;u<f;u++)r.append(h[u],L()),E.nextNode(),a.push({type:2,index:++o});r.append(h[f],L())}}}else if(r.nodeType===8)if(r.data===dt)a.push({type:2,index:o});else{let h=-1;for(;(h=r.data.indexOf(y,h+1))!==-1;)a.push({type:7,index:o}),h+=y.length-1}o++}}static createElement(t,e){let i=w.createElement("template");return i.innerHTML=t,i}};function b(s,t,e=s,i){if(t===m)return t;let r=i!==void 0?e._$Co?.[i]:e._$Cl,o=k(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??=[])[i]=r:e._$Cl=r),r!==void 0&&(t=b(s,r._$AS(s,t.values),r,i)),t}var K=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:i}=this._$AD,r=(t?.creationScope??w).importNode(e,!0);E.currentNode=r;let o=E.nextNode(),n=0,c=0,a=i[0];for(;a!==void 0;){if(n===a.index){let l;a.type===2?l=new U(o,o.nextSibling,this,t):a.type===1?l=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(l=new J(o,this,t)),this._$AV.push(l),a=i[++c]}n!==a?.index&&(o=E.nextNode(),n++)}return E.currentNode=w,r}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},U=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.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=b(this,t,e),k(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==m&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ot(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!==d&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=j.createElement(kt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let o=new K(r,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=Rt.get(t.strings);return e===void 0&&Rt.set(t.strings,e=new j(t)),e}k(t){pt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let o of t)r===e.length?e.push(i=new s(this.O(L()),this.O(L()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}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,i,r,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,r){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!k(t)||t!==this._$AH&&t!==m,n&&(this._$AH=t);else{let c=t,a,l;for(t=o[0],a=0;a<o.length-1;a++)l=b(this,c[i+a],e,a),l===m&&(l=this._$AH[a]),n||=!k(l)||l!==this._$AH[a],l===d?t=d:t!==d&&(t+=(l??"")+o[a+1]),this._$AH[a]=l}n&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},q=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},Z=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},Y=class extends P{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){if((t=b(this,t,e,0)??d)===m)return;let i=this._$AH,r=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==d&&(i===d||r);r&&this.element.removeEventListener(this.name,this,i),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)}},J=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){b(this,t)}},Vt={M:lt,P:y,A:dt,C:1,L:jt,R:K,D:Ot,V:b,I:U,H:P,N:Z,U:Y,B:q,F:J},he=ct.litHtmlPolyfillSupport;he?.(j,U),(ct.litHtmlVersions??=[]).push("3.3.1");var $t=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=e?.renderBefore??null;i._$litPart$=r=new U(t.insertBefore(L(),o),o,void 0,e??{})}return r._$AI(s),r};var _t=globalThis,T=class extends v{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=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return m}};T._$litElement$=!0,T.finalized=!0,_t.litElementHydrateSupport?.({LitElement:T});var ce=_t.litElementPolyfillSupport;ce?.({LitElement:T});(_t.litElementVersions??=[]).push("4.2.1");var S={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},_=s=>(...t)=>({_$litDirective$:s,values:t}),A=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{I:le}=Vt,It=s=>s===null||typeof s!="object"&&typeof s!="function";var Gt=s=>s.strings===void 0,Bt=()=>document.createComment(""),H=(s,t,e)=>{let i=s._$AA.parentNode,r=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=i.insertBefore(Bt(),r),n=i.insertBefore(Bt(),r);e=new le(o,n,s,s.options)}else{let o=e._$AB.nextSibling,n=e._$AM,c=n!==s;if(c){let a;e._$AQ?.(s),e._$AM=s,e._$AP!==void 0&&(a=s._$AU)!==n._$AU&&e._$AP(a)}if(o!==r||c){let a=e._$AA;for(;a!==o;){let l=a.nextSibling;i.insertBefore(a,r),a=l}}}return e},C=(s,t,e=s)=>(s._$AI(t,e),s),de={},F=(s,t=de)=>s._$AH=t,zt=s=>s._$AH,Q=s=>{s._$AR(),s._$AA.remove()};var Wt=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},Fe=_(class extends A{constructor(s){if(super(s),s.type!==S.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let r=[],o=[],n=0;for(let c of s)r[n]=i?i(c,n):n,o[n]=e(c,n),n++;return{values:o,keys:r}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){let r=zt(s),{values:o,keys:n}=this.dt(t,e,i);if(!Array.isArray(r))return this.ut=n,o;let c=this.ut??=[],a=[],l,p,h=0,f=r.length-1,u=0,$=o.length-1;for(;h<=f&&u<=$;)if(r[h]===null)h++;else if(r[f]===null)f--;else if(c[h]===n[u])a[u]=C(r[h],o[u]),h++,u++;else if(c[f]===n[$])a[$]=C(r[f],o[$]),f--,$--;else if(c[h]===n[$])a[$]=C(r[h],o[$]),H(s,a[$+1],r[h]),h++,$--;else if(c[f]===n[u])a[u]=C(r[f],o[u]),H(s,r[h],r[f]),f--,u++;else if(l===void 0&&(l=Wt(n,u,$),p=Wt(c,h,f)),l.has(c[h]))if(l.has(c[f])){let g=p.get(n[u]),it=g!==void 0?r[g]:null;if(it===null){let St=H(s,r[h]);C(St,o[u]),a[u]=St}else a[u]=C(it,o[u]),H(s,r[h],it),r[g]=null;u++}else Q(r[f]),f--;else Q(r[h]),h++;for(;u<=$;){let g=H(s,a[$+1]);C(g,o[u]),a[u++]=g}for(;h<=f;){let g=r[h++];g!==null&&Q(g)}return this.ut=n,F(s,a),m}});var ns=_(class extends A{constructor(){super(...arguments),this.key=d}render(s,t){return this.key=s,t}update(s,[t,e]){return t!==this.key&&(F(s),this.key=t),e}});var us=_(class extends A{constructor(s){if(super(s),s.type!==S.ATTRIBUTE||s.name!=="class"||s.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(let i in t)t[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(t)}let e=s.element.classList;for(let i of this.st)i in t||(e.remove(i),this.st.delete(i));for(let i in t){let r=!!t[i];r===this.st.has(i)||this.nt?.has(i)||(r?(e.add(i),this.st.add(i)):(e.remove(i),this.st.delete(i)))}return m}});var V=(s,t)=>{let e=s._$AN;if(e===void 0)return!1;for(let i of e)i._$AO?.(t,!1),V(i,t);return!0},tt=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while(e?.size===0)},Kt=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),fe(t)}};function pe(s){this._$AN!==void 0?(tt(this),this._$AM=s,Kt(this)):this._$AM=s}function ue(s,t=!1,e=0){let i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let o=e;o<i.length;o++)V(i[o],!1),tt(i[o]);else i!=null&&(V(i,!1),tt(i));else V(this,s)}var fe=s=>{s.type==S.CHILD&&(s._$AP??=ue,s._$AQ??=pe)},N=class extends A{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Kt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(V(this,t),tt(this))}setValue(t){if(Gt(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 $e=()=>new At,At=class{},mt=new WeakMap,_e=_(class extends N{render(s){return d}update(s,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=s.options?.host,this.rt(this.ct=s.element)),d}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=mt.get(t);e===void 0&&(e=new WeakMap,mt.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){return typeof this.G=="function"?mt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var me=s=>s??d;var et=class{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}},st=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}};var qt=s=>!It(s)&&typeof s.then=="function",Zt=1073741823,gt=class extends N{constructor(){super(...arguments),this._$Cwt=Zt,this._$Cbt=[],this._$CK=new et(this),this._$CX=new st}render(...t){return t.find(e=>!qt(e))??m}update(t,e){let i=this._$Cbt,r=i.length;this._$Cbt=e;let o=this._$CK,n=this._$CX;this.isConnected||this.disconnected();for(let c=0;c<e.length&&!(c>this._$Cwt);c++){let a=e[c];if(!qt(a))return this._$Cwt=c,a;c<r&&a===i[c]||(this._$Cwt=Zt,r=0,Promise.resolve(a).then(async l=>{for(;n.get();)await n.get();let p=o.deref();if(p!==void 0){let h=p._$Cbt.indexOf(a);h>-1&&h<p._$Cwt&&(p._$Cwt=h,p.setValue(l))}}))}return m}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},Ae=_(gt);var M=class extends A{constructor(t){if(super(t),this.it=d,t.type!==S.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this._t=void 0,this.it=t;if(t===m)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:[]}}};M.directiveName="unsafeHTML",M.resultType=1;var ge=_(M);var B=class extends M{};B.directiveName="unsafeSVG",B.resultType=2;var ve=_(B);var ye=["127.0.0.1","localhost"].includes(window.location.hostname),Se=s=>typeof s!="string"&&"strTag"in s;function Ce(s){let t="";for(let e=0;e<=s.length-1;e++)t+=s[e],e<s.length-1&&(t+=`{${e}}`);return t}function xe(s,t){return s.replace(/\{(\d+)\}/g,(e,i)=>t(i))}var Ee=(s,t,e)=>{let i=Ce(s),r=Yt(i,e);return xe(r,o=>t[o])};function Yt(s,t={}){window.__strings=window.__strings??{};let e=window.__strings[s]?.content;return!e&&ye&&console.log("\u{1F310}",s,t.desc?`(${t.desc})`:""),window.env?.DEBUG_TRANSLATIONS?`__${e??s}`:e??s}var Jt=(s,t={})=>s?Se(s)?Ee(s.strings,s.values,t):Yt(s,t):"";var vt=class extends A{#t=null;#e=null;render(t){return d}update(t,[e]){let i=t.element;return this.#e!==i?(this.#e=i,this.#t=e,this.#s()):JSON.stringify(this.#t)!==JSON.stringify(e)&&(this.#t=e,this.#s()),d}async#s(){if(!this.#e||!this.#t)return;let t=this.#e.tagName.toLowerCase();await customElements.whenDefined(t);for(let[e,i]of Object.entries(this.#t))this.#e[e]=i}},we=_(vt);var Ft=Symbol.for(""),be=s=>{if(s?.r===Ft)return s?._$litStatic$},Pe=s=>({_$litStatic$:s,r:Ft});var Xt=new Map,yt=s=>(t,...e)=>{let i=e.length,r,o,n=[],c=[],a,l=0,p=!1;for(;l<i;){for(a=t[l];l<i&&(o=e[l],(r=be(o))!==void 0);)a+=r+t[++l],p=!0;l!==i&&c.push(o),n.push(a),l++}if(l===i&&n.push(t[i]),p){let h=n.join("$$lit$$");(t=Xt.get(h))===void 0&&(n.raw=n,Xt.set(h,t=n)),e=c}return s(t,...e)},Te=yt(X),ai=yt(ft),hi=yt(Lt);var ui=X,fi=ot;async function $i(s){try{window.__strings=await fetch(`/assets/locales/${s}.json`).then(t=>t.json())}catch{window.__strings={}}}export{T as LitElement,us as classMap,$e as createRef,fi as css,ui as html,me as ifDefined,ns as keyed,we as lazyProps,$i as loadLocale,Jt as msg,d as nothing,_e as ref,$t as render,Fe as repeat,Te as staticHtml,ft as svg,ge as unsafeHTML,ve as unsafeSVG,Pe as unsafeStatic,Ae as until};
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
@lit/reactive-element/css-tag.js:
|
|
7
|
+
(**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2019 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*)
|
|
12
|
+
|
|
13
|
+
@lit/reactive-element/reactive-element.js:
|
|
14
|
+
(**
|
|
15
|
+
* @license
|
|
16
|
+
* Copyright 2017 Google LLC
|
|
17
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
+
*)
|
|
19
|
+
|
|
20
|
+
lit-html/lit-html.js:
|
|
21
|
+
(**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2017 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*)
|
|
26
|
+
|
|
27
|
+
lit-element/lit-element.js:
|
|
28
|
+
(**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2017 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*)
|
|
33
|
+
|
|
34
|
+
lit-html/is-server.js:
|
|
35
|
+
(**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2022 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*)
|
|
40
|
+
|
|
41
|
+
lit-html/directive.js:
|
|
42
|
+
(**
|
|
43
|
+
* @license
|
|
44
|
+
* Copyright 2017 Google LLC
|
|
45
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
46
|
+
*)
|
|
47
|
+
|
|
48
|
+
lit-html/directive-helpers.js:
|
|
49
|
+
(**
|
|
50
|
+
* @license
|
|
51
|
+
* Copyright 2020 Google LLC
|
|
52
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
+
*)
|
|
54
|
+
|
|
55
|
+
lit-html/directives/repeat.js:
|
|
56
|
+
(**
|
|
57
|
+
* @license
|
|
58
|
+
* Copyright 2017 Google LLC
|
|
59
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
60
|
+
*)
|
|
61
|
+
|
|
62
|
+
lit-html/directives/keyed.js:
|
|
63
|
+
(**
|
|
64
|
+
* @license
|
|
65
|
+
* Copyright 2021 Google LLC
|
|
66
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
67
|
+
*)
|
|
68
|
+
|
|
69
|
+
lit-html/directives/class-map.js:
|
|
70
|
+
(**
|
|
71
|
+
* @license
|
|
72
|
+
* Copyright 2018 Google LLC
|
|
73
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
+
*)
|
|
75
|
+
|
|
76
|
+
lit-html/async-directive.js:
|
|
77
|
+
(**
|
|
78
|
+
* @license
|
|
79
|
+
* Copyright 2017 Google LLC
|
|
80
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
+
*)
|
|
82
|
+
|
|
83
|
+
lit-html/directives/ref.js:
|
|
84
|
+
(**
|
|
85
|
+
* @license
|
|
86
|
+
* Copyright 2020 Google LLC
|
|
87
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
|
+
*)
|
|
89
|
+
|
|
90
|
+
lit-html/directives/if-defined.js:
|
|
91
|
+
(**
|
|
92
|
+
* @license
|
|
93
|
+
* Copyright 2018 Google LLC
|
|
94
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
+
*)
|
|
96
|
+
|
|
97
|
+
lit-html/directives/private-async-helpers.js:
|
|
98
|
+
(**
|
|
99
|
+
* @license
|
|
100
|
+
* Copyright 2021 Google LLC
|
|
101
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
+
*)
|
|
103
|
+
|
|
104
|
+
lit-html/directives/until.js:
|
|
105
|
+
(**
|
|
106
|
+
* @license
|
|
107
|
+
* Copyright 2017 Google LLC
|
|
108
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
109
|
+
*)
|
|
110
|
+
|
|
111
|
+
lit-html/directives/unsafe-html.js:
|
|
112
|
+
(**
|
|
113
|
+
* @license
|
|
114
|
+
* Copyright 2017 Google LLC
|
|
115
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
116
|
+
*)
|
|
117
|
+
|
|
118
|
+
lit-html/directives/unsafe-svg.js:
|
|
119
|
+
(**
|
|
120
|
+
* @license
|
|
121
|
+
* Copyright 2017 Google LLC
|
|
122
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
123
|
+
*)
|
|
124
|
+
|
|
125
|
+
lit-html/static.js:
|
|
126
|
+
(**
|
|
127
|
+
* @license
|
|
128
|
+
* Copyright 2020 Google LLC
|
|
129
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
130
|
+
*)
|
|
131
|
+
*/
|