@pure-ds/core 0.5.39 → 0.5.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/public/assets/pds/components/pds-fab.d.ts.map +1 -1
- package/dist/types/src/js/lit.d.ts +19 -0
- package/dist/types/src/js/lit.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/assets/js/app.js +19 -14
- package/public/assets/js/lit.js +3 -3
- package/public/assets/pds/components/pds-fab.js +4 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-fab.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-fab.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAkBE,0CAEC;IAUD,cANU,OAAO,EAsBhB;IAxBD;;;;OAIG;IACH,YAHU,OAAO,CAKhB;IA4BD,gBAPU,MAAM,EAef;IAjBD;;;;;OAKG;IACH,cAJU,MAAM,CAMf;IAoBD,gBAPU,MAAM,EAef;IAjBD;;;;;OAKG;IACH,cAJU,MAAM,CAMf;IAyBD,oBAPU,MAAM,EAef;IAtBD;;;;;;;;;;OAUG;IACH,kBAJU,MAAM,CAMf;IAkBD,oBALU,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,EAa7E;IAfD;;;OAGG;IACH,kBAFU,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAI7E;IAWD,oEAsCC;IAED,0BAKC;IAED,6BAEC;;
|
|
1
|
+
{"version":3,"file":"pds-fab.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-fab.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAkBE,0CAEC;IAUD,cANU,OAAO,EAsBhB;IAxBD;;;;OAIG;IACH,YAHU,OAAO,CAKhB;IA4BD,gBAPU,MAAM,EAef;IAjBD;;;;;OAKG;IACH,cAJU,MAAM,CAMf;IAoBD,gBAPU,MAAM,EAef;IAjBD;;;;;OAKG;IACH,cAJU,MAAM,CAMf;IAyBD,oBAPU,MAAM,EAef;IAtBD;;;;;;;;;;OAUG;IACH,kBAJU,MAAM,CAMf;IAkBD,oBALU,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,EAa7E;IAfD;;;OAGG;IACH,kBAFU,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAI7E;IAWD,oEAsCC;IAED,0BAKC;IAED,6BAEC;;CA2YF"}
|
|
@@ -15,10 +15,29 @@ export { until } from "lit/directives/until.js";
|
|
|
15
15
|
export { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
16
16
|
export { unsafeSVG } from "lit/directives/unsafe-svg.js";
|
|
17
17
|
export { msg } from "./common/msg.js";
|
|
18
|
+
/**
|
|
19
|
+
* Applies properties to an element after it's defined (for lazy-loaded components)
|
|
20
|
+
* @param {Object} props - Properties to set on the element
|
|
21
|
+
* @returns {import('lit/directive.js').DirectiveResult}
|
|
22
|
+
*/
|
|
23
|
+
export const lazyProps: (_props?: any) => import("lit-html/directive.js").DirectiveResult<typeof LazyPropsDirective>;
|
|
18
24
|
import { LitElement } from "lit";
|
|
19
25
|
import { nothing } from "lit";
|
|
20
26
|
import { svg } from "lit";
|
|
21
27
|
import { render } from "lit";
|
|
28
|
+
/**
|
|
29
|
+
* Directive that waits for a custom element to be defined before setting properties
|
|
30
|
+
* Useful for lazy-loaded web components
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* html`<pds-fab ${lazyProps({ satellites: [...], open: true })}></pds-fab>`
|
|
34
|
+
*/
|
|
35
|
+
declare class LazyPropsDirective extends Directive {
|
|
36
|
+
render(_props: any): symbol;
|
|
37
|
+
update(part: any, [props]: [any]): symbol;
|
|
38
|
+
#private;
|
|
39
|
+
}
|
|
40
|
+
import { Directive } from "lit/directive.js";
|
|
22
41
|
export { LitElement, nothing, svg, render };
|
|
23
42
|
export { ref, createRef } from "lit/directives/ref.js";
|
|
24
43
|
export { html as staticHtml, unsafeStatic } from "lit/static-html.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit.d.ts","sourceRoot":"","sources":["../../../../src/js/lit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lit.d.ts","sourceRoot":"","sources":["../../../../src/js/lit.js"],"names":[],"mappings":"AAiFA;;;GAGG;AACH,0DAMC;AAtFD,0CAA0C;AAC1C,mBADW,cAAc,OAAO,EAAE,IAAI,CACV;AAE5B,yCAAyC;AACzC,kBADW,cAAc,OAAO,EAAE,GAAG,CACX;;;;;;;;;AAiE1B;;;;GAIG;AACH,qHAAuD;2BA9E0B,KAAK;wBAAL,KAAK;oBAAL,KAAK;uBAAL,KAAK;AA4BtF;;;;;;GAMG;AACH;IAIE,4BAEC;IAED,0CAaC;;CAeF;0BA7CoC,kBAAkB"}
|
package/package.json
CHANGED
package/public/assets/js/app.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)!==-1||r.indexOf(" ")!==-1||r.startsWith("#/"))return!1;let e=new URL(r,window.location.origin);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function
|
|
1
|
+
var Er=Object.defineProperty;var Ve=(r,e)=>()=>(r&&(e=r(r=0)),e);var Je=(r,e)=>{for(var t in e)Er(r,t,{get:e[t],enumerable:!0})};var Dt={};Je(Dt,{AutoDefiner:()=>tt});async function qr(...r){let e={};r.length&&typeof r[r.length-1]=="object"&&(e=r.pop()||{});let t=r,{baseURL:o,mapper:a=d=>`${d}.js`,onError:i=(d,p)=>console.error(`[defineWebComponents] ${d}:`,p)}=e,s=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),n=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(p,c,u)=>u.toUpperCase()),l=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let p=a(d),u=await import(p instanceof URL?p.href:new URL(p,s).href),g=u?.default??u?.[n(d)];if(!g){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${n(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,g),{tag:d,status:"defined"})}catch(p){throw i(d,p),p}};return Promise.all(t.map(l))}var tt,Pt=Ve(()=>{tt=class{constructor(e={}){let{baseURL:t,mapper:o,onError:a,predicate:i=()=>!0,attributeModule:s="data-module",root:n=document,scanExisting:l=!0,debounceMs:d=16,observeShadows:p=!0,enhancers:c=[],patchAttachShadow:u=!0}=e,g=new Set,b=new Set,y=new Set,f=new Map,$=new WeakMap,Q=new WeakMap,z=0,O=!1,D=null,ne=v=>{if(!v||!c.length)return;let x=Q.get(v);x||(x=new Set,Q.set(v,x));for(let w of c)if(!(!w.selector||!w.run)&&!x.has(w.selector))try{v.matches&&v.matches(w.selector)&&(w.run(v),x.add(w.selector))}catch(M){console.warn(`[AutoDefiner] Error applying enhancer for selector "${w.selector}":`,M)}},X=(v,x)=>{if(!O&&!(!v||!v.includes("-"))&&!customElements.get(v)&&!b.has(v)&&!y.has(v)){if(x&&x.getAttribute){let w=x.getAttribute(s);w&&!f.has(v)&&f.set(v,w)}g.add(v),ve()}},ve=()=>{z||(z=setTimeout(ce,d))},L=v=>{if(v){if(v.nodeType===1){let x=v,w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&X(w,x),ne(x),p&&x.shadowRoot&&j(x.shadowRoot)}v.querySelectorAll&&v.querySelectorAll("*").forEach(x=>{let w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&X(w,x),ne(x),p&&x.shadowRoot&&j(x.shadowRoot)})}},j=v=>{if(!v||$.has(v))return;L(v);let x=new MutationObserver(w=>{for(let M of w)M.addedNodes?.forEach(te=>{L(te)}),M.type==="attributes"&&M.target&&L(M.target)});x.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[s,...c.map(w=>w.selector).filter(w=>w.startsWith("data-"))]}),$.set(v,x)};async function ce(){if(clearTimeout(z),z=0,!g.size)return;let v=Array.from(g);g.clear(),v.forEach(x=>b.add(x));try{let x=w=>f.get(w)??(o?o(w):`${w}.js`);await qr(...v,{baseURL:t,mapper:x,onError:(w,M)=>{y.add(w),a?.(w,M)}})}catch{}finally{v.forEach(x=>b.delete(x))}}let E=n===document?document.documentElement:n,ee=new MutationObserver(v=>{for(let x of v)x.addedNodes?.forEach(w=>{L(w)}),x.type==="attributes"&&x.target&&L(x.target)});if(ee.observe(E,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[s,...c.map(v=>v.selector).filter(v=>v.startsWith("data-"))]}),p&&u&&Element.prototype.attachShadow){let v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(w){let M=v.call(this,w);if(w&&w.mode==="open"){j(M);let te=this.tagName?.toLowerCase();te&&te.includes("-")&&!customElements.get(te)&&X(te,this)}return M},D=()=>Element.prototype.attachShadow=v}return l&&L(E),{stop(){O=!0,ee.disconnect(),D&&D(),z&&(clearTimeout(z),z=0),$.forEach(v=>v.disconnect())},flush:ce}}static async define(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let o=e,{baseURL:a,mapper:i=p=>`${p}.js`,onError:s=(p,c)=>console.error(`[defineWebComponents] ${p}:`,c)}=t,n=a?new URL(a,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),l=p=>p.toLowerCase().replace(/(^|-)([a-z])/g,(c,u,g)=>g.toUpperCase()),d=async p=>{try{if(customElements.get(p))return{tag:p,status:"already-defined"};let c=i(p),g=await import(c instanceof URL?c.href:new URL(c,n).href),b=g?.default??g?.[l(p)];if(!b){if(customElements.get(p))return{tag:p,status:"self-defined"};throw new Error(`No export found for ${p}. Expected default export or named export "${l(p)}".`)}return customElements.get(p)?{tag:p,status:"race-already-defined"}:(customElements.define(p,b),{tag:p,status:"defined"})}catch(c){throw s(p,c),c}};return Promise.all(o.map(d))}}});function jt(r){return new DOMParser().parseFromString(r,"text/html").body.childNodes}function Ht(r,e=100){let t;return function(...a){let i=()=>{clearTimeout(t),r(...a)};clearTimeout(t),t=setTimeout(i,e)}}function $e(r){setTimeout(r,0)}function Wt(r){try{if(typeof r!="string"||r.indexOf(`
|
|
2
|
+
`)!==-1||r.indexOf(" ")!==-1||r.startsWith("#/"))return!1;let e=new URL(r,window.location.origin);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function Ut(r,e,t){let o=window.screen.width/2-e/2,a=window.screen.height/2-t/2;return window.open(r,"",`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=${e}, height=${t}, top=${a}, left=${o}`)}var qt=Ve(()=>{});var Gt={};Je(Gt,{AutoComplete:()=>U});var it,U,Ce=Ve(()=>{qt();it={result:"ac-suggestion",item:"ac-itm"},U=class r extends EventTarget{constructor(e,t,o){super(),this.settings={emptyResultsText:"",...o},this.container=e,this.input=t,this.input.setAttribute("autocomplete","off"),this.categories=o.categories||{},this.caches=new Map,$e(this.attach.bind(this))}static connect(e,t){let o=e.target;if(!o._autoComplete){if(!t?.categories)throw Error("Missing autocomplete settings");o._autoComplete=new r(o.parentNode,o,t),e.type==="focus"&&setTimeout(()=>{o._autoComplete.focusHandler(e)},100)}return o._autoComplete}on(e,t){return this.input.addEventListener(e,t),this}attach(){this.resultsDiv=document.createElement("div"),this.resultsDiv.title="",this.resultsDiv.classList.add(it.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 e=getComputedStyle(this.input);this.container.style.setProperty("--ac-bg-default",e.backgroundColor),this.container.style.setProperty("--ac-color-default",e.color);let t=getComputedStyle(this.input).accentColor;t!=="auto"&&this.container.style.setProperty("--ac-accent-color",t),(this.container?.shadowRoot??this.container).appendChild(this.resultsDiv),this.controller().clear("attach"),this.on("input",Ht(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 e=this.internalController();return typeof this.settings.controller=="function"&&(e=this.settings.controller(this)??e),e}internalController(){return{show:this.show.bind(this),hide:this.hide.bind(this),clear:this.clear.bind(this),empty:()=>{}}}moveResult(e){this.controller().show();let t=this.acItems.length;this.rowIndex=this.rowIndex+e,this.rowIndex<=0?this.rowIndex=0:this.rowIndex>t-1&&(this.rowIndex=0);for(let a of this.acItems)a.classList.remove("selected");let o=this.getSelectedDiv();o?(o.classList.add("selected"),o.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):this.focusHandler({target:this.input})}getSelectedDiv(){return this.resultsDiv.querySelector(`div:nth-child(${this.rowIndex+1})`)}selectResult(e){if(e=e||this.getSelectedDiv(),e){let t=parseInt(e.getAttribute("data-index"));this.resultClicked=!0;let o=this.results[t],a=this.categories[o.category]??{};a.action=a.action??this.setText.bind(this),a.newTab&&(this.tabWindow=Ut("about:blank"));let i={...o,search:this.input.value};e.classList.add("ac-active"),setTimeout(()=>{this.controller().hide("result-selected"),i.action?i.action(i):(a.action(i),a.newTab&&(i.url?this.tabWindow.location.href=i.url:this.tabWindow.close()));var s=new Event("change",{bubbles:!0});this.input.dispatchEvent(s),this.controller().clear("result-selected");let n=new Event("result-selected");n.detail=i,this.input.dispatchEvent(n)},0)}}setText(e){this.container.autoCompleteInput||(this.container.value=e.text),this.controller().hide("settext")}resultClick(e){this.selectResult(e.target.closest(`.${it.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 e=this.getViewBounds();this.resultsDiv.style.position="absolute",e.rect.width>100&&(this.resultsDiv.style.width=`${e.rect.width}px`),this.settings.direction=this.settings.direction??e.suggestedDirection,this.resultsDiv.setAttribute("data-direction",this.settings.direction),this.settings.direction==="up"?(this.resultsDiv.style.top="unset",this.resultsDiv.style.bottom=`${e.rect.height+20}px`,this.rowIndex=this.acItems.length):(this.resultsDiv.style.bottom="unset",this.resultsDiv.style.top=`${e.rect.height}px`,this.rowIndex=-1),this.resultsDiv.style.maxWidth="unset",this.resultsDiv.classList.toggle("ac-active",!0)}}getViewBounds(){let e=this.input.getBoundingClientRect();return{rect:e,suggestedDirection:e.top+e.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(e){this.cacheTmr&&clearTimeout(this.cacheTmr);let t={search:e.target.value,categories:this.categories};this.container.classList.add("search-running"),this.getItems(t,e).then(o=>{this.controller().clear("new-results"),this.resultsHandler(o,t),this.container.classList.remove("search-running")})}keyDownHandler(e){switch(e.key){case"Enter":e.stopPropagation(),e.preventDefault();break;case"ArrowDown":$e(this.moveResult(1));break;case"ArrowUp":$e(this.moveResult(-1));break}}keyUpHandler(e){switch(e.key){case"Escape":this.controller().hide("escape");break;case"Enter":this.getSelectedDiv()&&(this.container.preventEnter=!0,e.stopPropagation(),e.preventDefault(),this.selectResult(),setTimeout(()=>{this.container.preventEnter=!1},10));break;default:break}}focusHandler(e){this.controller().clear("focus");let t=e.target.value;this.suggest(t,e)}suggest(e,t){this.input.focus();let o={suggest:!0,search:e||"",categories:this.categories};this.getItems(o,t).then(a=>{this.input.dispatchEvent(new CustomEvent("show-results",{detail:{results:a}})),this.resultsHandler(a,o)})}sort(e,t){return e.sort((o,a)=>{let i=t.categories[o.category],s=t.categories[a.category],n=typeof i.sortIndex=="function"?i.sortIndex(t):i.sortIndex??0;return(typeof s.sortIndex=="function"?s.sortIndex(t):s.sortIndex??0)>n?1:-1})}resultsHandler(e,t){this.results=e,this.rowIndex=-1;let o=0,a=(i,s)=>`
|
|
3
3
|
<div title="${s.tooltip||""}" data-index="${o}" class="${`${it.item} cat-${s.category} ${s.class??""}`.trim()}">
|
|
4
4
|
${this.handleImageOrIcon(s)}
|
|
5
5
|
<span class="text">${this.formatResultItem(s,t,i)}</span>
|
|
6
6
|
${this.settings.hideCategory?"":`<span class="category">${s.category||""}</span>`}
|
|
7
|
-
</div>`;e.forEach(i=>{let s=t.categories[i.category]||{};i.element?this.resultsDiv.appendChild(i.element):(i=typeof i=="string"?{text:i}:i,this.resultsDiv.appendChild(
|
|
7
|
+
</div>`;e.forEach(i=>{let s=t.categories[i.category]||{};i.element?this.resultsDiv.appendChild(i.element):(i=typeof i=="string"?{text:i}:i,this.resultsDiv.appendChild(jt(a(s,i))[0])),o++}),e.length?(this.acItems=this.resultsDiv.querySelectorAll(".ac-itm"),this.controller().show()):t.search.length&&this.controller().empty()}handleImageOrIcon(e){return e.image?`<img src="${e.image}"/>`:typeof this.settings.iconHandler=="function"?this.settings.iconHandler(e):`<svg-icon icon="${e.icon}"></svg-icon>`}formatResultItem(e,t,o){let a=typeof e=="string"?{text:e}:e,i=a.text;return t.search&&(i=i.replace("%search%",t.search),a.description=a.description?.replace("%search%",t.search)),i=this.highlight(i,t.search),a.description&&(i=`<div>${i}</div><small>${a.description}</small>`),o.format&&(i=o.format({item:a,result:i,options:t})),i}highlight(e,t){var o=new RegExp("("+t+")","gi");return e.replace(o,'<span class="txt-hl">$1</span>')}async getItems(e,t){this.aborter&&this.aborter.abort();let o=this.caches.get(e.search);if(o)return o;let a=this.settings.map,i=l=>(typeof l=="string"&&(l={text:l}),l),s=l=>a?l.map(d=>({text:d[a]})):l.map(d=>i(d)),n=l=>(this.settings.max&&this.settings.max>0&&(l.length=this.settings.max),l);return this.aborter=new AbortController,this.aborterSignal=this.aborter.signal,new Promise(l=>{let d=p=>{p=this.sort(p,e),this.settings.cache!==!1&&this.caches.set(e.search,p),l(p)};if(Wt(this.items)){if(this.settings.minlength>0&&(!e.search||e.search.length<this.settings.minlength)){d([]);return}let p=this.formatSearch(this.items,e);fetch(p).then(c=>{if(c.status===200){c.json().then(u=>{u=s(u),d(n(u.filter(g=>this.isMatch(e,g))))});return}throw Error(`HTTP error ${c.status} - ${p}`)})}else if(Array.isArray(this.items)){let p=!0;this.items=this.items.map(c=>typeof c=="string"?{text:c}:(p=!1,c)),p&&this.container.classList.add("simple"),d(n(s(this.items)))}else if(typeof this.items=="function")e.control=this.container,Promise.resolve(this.items(e,t)).then(c=>{c=c.map(u=>i(u)),c=s(c),d(c)});else return d(Promise.resolve(this.items.apply(this,e)))})}async items(e){let t=[];e.results=[],e.signal=this.aborterSignal;for(var o in e.categories){let a=e.categories[o];if(a.trigger=a.trigger??(()=>!0),e.results=t,a.trigger(e)){let i=[];try{i=await a.getItems(e)}catch(s){console.warn(`Error loading items for omniBox category '${o}'.`,s)}t=t.concat(i.map(s=>(s.category=o,s)))}}return t}formatSearch(e,t){return e.indexOf("%search%")?e.replace("%search%",t.search||""):e+"?"+this.createQueryParam(t)}createQueryParam(e){let t=e.suggest?"&suggest=true":"";return`q=${e.text}${t}`}isMatch(e,t){return t.text?.indexOf("%search%")>=0?!0:e.search?t.text?.toLowerCase().indexOf(e.search.toLowerCase())>=0:e.suggest}static textFilter(e,t){return function(o){if(!e.search)return!0;if(o.hidden)return!1;let i=(t?o[t]:o).match(new RegExp(e.search,"gi"));if(i)return i;if(o.config?.tags)return o.config.tags.some(s=>s.match(new RegExp(e.search,"gi")))}}}});var Ke=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(e={}){this._mode="static",this._staticPaths={...this._staticPaths,...e}}async getStylesheet(e){if(this._mode==="live")return null;try{return(await import(this._staticPaths[e]))[e]}catch(t){console.error(`[PDS Registry] Failed to load static ${e}:`,t),console.error(`[PDS Registry] Looking for: ${this._staticPaths[e]}`),console.error("[PDS Registry] Make sure you've run 'npm run pds:build' and configured PDS.start() with the correct static.root path");let o=new CSSStyleSheet;return o.replaceSync("/* Failed to load "+e+" */"),o}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},re=new Ke;function Tr(r){try{if(typeof document>"u")return;if(typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype){let o=new CSSStyleSheet;o.replaceSync(r),o._pds=!0;let a=(document.adoptedStyleSheets||[]).filter(i=>i._pds!==!0);document.adoptedStyleSheets=[...a,o];return}let e="pds-runtime-stylesheet",t=document.getElementById(e);if(!t){t=document.createElement("style"),t.id=e,t.type="text/css";let o=document.head||document.getElementsByTagName("head")[0];o?o.appendChild(t):document.documentElement.appendChild(t)}t.textContent=r}catch(e){console.warn("installRuntimeStyles failed:",e)}}function At(r){let e=r;if(!e||typeof e!="object"){console.error("[Runtime] applyStyles requires an explicit generator instance in live mode");return}let t=e.layeredCSS||e.css||"";if(!t){e.options?.log?.("warn","[Runtime] No CSS available on generator to apply");return}Tr(t)}async function Et(r,e=[],t=null){try{let o=t?.primitivesStylesheet?t.primitivesStylesheet:await re.getStylesheet("primitives");r.adoptedStyleSheets=[o,...e]}catch(o){let a=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${a}> failed to adopt primitives:`,o),r.adoptedStyleSheets=e}}async function Tt(r,e=["primitives"],t=[],o=null){try{let i=(await Promise.all(e.map(async s=>{if(o)switch(s){case"tokens":return o.tokensStylesheet;case"primitives":return o.primitivesStylesheet;case"components":return o.componentsStylesheet;case"utilities":return o.utilitiesStylesheet;default:break}return re.getStylesheet(s)}))).filter(s=>s!==null);r.adoptedStyleSheets=[...i,...t]}catch(a){let i=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${i}> failed to adopt layers:`,a),r.adoptedStyleSheets=t}}function zt(r){let e=new CSSStyleSheet;return e.replaceSync(r),e}var h={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 we={mode:"live",preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(r,e,...t){console[r](e,...t)}};var Ze={};Je(Ze,{deepMerge:()=>H,fragmentFromTemplateLike:()=>Ye,isObject:()=>xe});function xe(r){return r&&typeof r=="object"&&!Array.isArray(r)}function H(r,e){let t={...r};return xe(r)&&xe(e)&&Object.keys(e).forEach(o=>{xe(e[o])?o in r?t[o]=H(r[o],e[o]):Object.assign(t,{[o]:e[o]}):Object.assign(t,{[o]:e[o]})}),t}function Ye(r){let e=Array.isArray(r?.strings)?r.strings:[],t=Array.isArray(r?.values)?r.values:[],o=new Set,a=[],i=/(\s)(\.[\w-]+)=\s*$/;for(let c=0;c<e.length;c+=1){let u=e[c]??"",g=u.match(i);if(g&&c<t.length){let y=g[2].slice(1),f=`pds-val-${c}`;u=u.replace(i,`$1data-pds-prop="${y}:${f}"`),o.add(c)}a.push(u),c<t.length&&!o.has(c)&&a.push(`<!--pds-val-${c}-->`)}let s=document.createElement("template");s.innerHTML=a.join("");let n=(c,u)=>{let g=c.parentNode;if(!g)return;if(u==null){g.removeChild(c);return}let b=y=>{if(y!=null){if(y instanceof Node){g.insertBefore(y,c);return}if(Array.isArray(y)){y.forEach(f=>b(f));return}g.insertBefore(document.createTextNode(String(y)),c)}};b(u),g.removeChild(c)},l=document.createTreeWalker(s.content,NodeFilter.SHOW_COMMENT),d=[];for(;l.nextNode();){let c=l.currentNode;c?.nodeValue?.startsWith("pds-val-")&&d.push(c)}return d.forEach(c=>{let u=Number(c.nodeValue.replace("pds-val-",""));n(c,t[u])}),s.content.querySelectorAll("*").forEach(c=>{let u=c.getAttribute("data-pds-prop");if(!u)return;let[g,b]=u.split(":"),y=Number(String(b).replace("pds-val-",""));g&&Number.isInteger(y)&&(c[g]=t[y]),c.removeAttribute("data-pds-prop")}),s.content}function Qe(r,e){if(e==null)return;if(typeof e=="object"&&Array.isArray(e.strings)&&Array.isArray(e.values)){r.appendChild(Ye(e));return}if(e instanceof Node){r.appendChild(e);return}if(Array.isArray(e)){e.forEach(o=>Qe(r,o));return}let t=typeof e=="string"?e:String(e);r.appendChild(document.createTextNode(t))}async function Lt(r,e={}){return e={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...e},new Promise(o=>{let a=document.createElement("dialog");we.options?.liquidGlassEffects&&a.classList.add("liquid-glass"),e.size&&a.classList.add(`dialog-${e.size}`),e.type&&a.classList.add(`dialog-${e.type}`),e.class&&(Array.isArray(e.class)?a.classList.add(...e.class):a.classList.add(e.class)),e.maxHeight&&a.style.setProperty("--dialog-max-height",e.maxHeight);let i=Object.entries(e.buttons).map(([n,l])=>{let d=l.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${l.cancel?"button":"submit"}" class="${d}" value="${n}">${l.name}</button>`});if(e.useForm){let n=document.createElement("div");Qe(n,r);let l=n.querySelector("form");if(l){a.innerHTML=`
|
|
8
8
|
<header>
|
|
9
9
|
<h2>${e.title}</h2>
|
|
10
10
|
</header>
|
|
@@ -28,10 +28,10 @@ var Ar=Object.defineProperty;var Ve=(r,e)=>()=>(r&&(e=r(r=0)),e);var Je=(r,e)=>{
|
|
|
28
28
|
${i.join("")}
|
|
29
29
|
</footer>
|
|
30
30
|
</form>
|
|
31
|
-
`;let n=a.querySelector("#msg-container");Qe(n,r)}a.addEventListener("click",n=>{n.target.closest('button[value="cancel"]')&&(a.close(),o(!1))});let s=()=>{let n=a.querySelector("form");n?n.addEventListener("submit",l=>{l.preventDefault();let d;e.useForm&&l.submitter.value==="ok"?(console.log("Found form:",n),console.log("Form elements:",n?Array.from(n.elements):"no form"),d=new FormData(n),console.log("FormData entries:",Array.from(d.entries()))):d=l.submitter.value==="ok",a.close(),o(d)}):requestAnimationFrame(s)};s(),a.addEventListener("close",()=>{setTimeout(()=>a.remove(),200)}),document.body.appendChild(a),typeof e.rendered=="function"&&e.rendered(a),a.showModal()})}async function Tr(){let r=document.querySelector("pds-toaster");return r||(r=document.createElement("pds-toaster"),document.body.appendChild(r),await customElements.whenDefined("pds-toaster")),r}async function P(r,e={}){return(await Tr()).toast(r,e)}P.success=async function(r,e={}){return P(r,{...e,type:"success"})};P.error=async function(r,e={}){return P(r,{...e,type:"error"})};P.warning=async function(r,e={}){return P(r,{...e,type:"warning"})};P.info=async function(r,e={}){return P(r,{...e,type:"information"})};var zr=[{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 Lr(r){r.dataset.enhancedAccordion||(r.dataset.enhancedAccordion="true",r.addEventListener("toggle",e=>{e.target.open&&e.target.parentElement===r&&r.querySelectorAll(":scope > details[open]").forEach(t=>{t!==e.target&&(t.open=!1)})},!0))}function Mr(r){if(r.dataset.enhancedDropdown)return;r.dataset.enhancedDropdown="true";let e=r.lastElementChild;if(!e)return;let t=r.querySelector("[data-dropdown-toggle]")||r.querySelector("button");t&&!t.hasAttribute("type")&&t.setAttribute("type","button"),e.id||(e.id=`dropdown-${Math.random().toString(36).slice(2,9)}`),e.tagName?.toLowerCase()==="menu"&&!e.hasAttribute("role")&&e.setAttribute("role","menu"),e.hasAttribute("aria-hidden")||e.setAttribute("aria-hidden","true"),t&&(t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"));let a=()=>{let l=(r.getAttribute("data-mode")||"auto").toLowerCase();if(l==="up"||l==="down")return l;let d=r.getBoundingClientRect(),p=Math.max(0,window.innerHeight-d.bottom);return Math.max(0,d.top)>p?"up":"down"},i=()=>{r.dataset.dropdownDirection=a(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},s=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},n=()=>{e.getAttribute("aria-hidden")==="false"?s():i()};t?.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),n()}),document.addEventListener("click",l=>{r.contains(l.target)||s()}),r.addEventListener("keydown",l=>{l.key==="Escape"&&(s(),t?.focus())}),r.addEventListener("focusout",l=>{(!l.relatedTarget||!r.contains(l.relatedTarget))&&s()})}function _r(r){if(r.dataset.enhancedToggle)return;r.dataset.enhancedToggle="true";let e=r.querySelector('input[type="checkbox"]');if(!e)return;r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.setAttribute("role","switch"),r.setAttribute("aria-checked",e.checked?"true":"false");let t=document.createElement("span");t.className="toggle-switch",t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");let o=document.createElement("span");o.className="toggle-knob",t.appendChild(o),r.insertBefore(t,e.nextSibling);let a=()=>{r.setAttribute("aria-checked",e.checked?"true":"false")},i=()=>{e.disabled||(e.checked=!e.checked,a(),e.dispatchEvent(new Event("change",{bubbles:!0})))};r.addEventListener("click",s=>{s.preventDefault(),i()}),r.addEventListener("keydown",s=>{(s.key===" "||s.key==="Enter")&&(s.preventDefault(),i())}),e.addEventListener("change",a)}function Dr(r){if(r.dataset.enhancedRange)return;let e=r.closest("label"),t=e?.classList.contains("range-output"),o=r.id||`range-${Math.random().toString(36).substring(2,11)}`,a=`${o}-output`;if(r.id=o,t){let i=e.querySelector("span");if(i&&!i.classList.contains("range-output-wrapper")){let s=document.createElement("span");s.className="range-output-wrapper",s.style.display="flex",s.style.justifyContent="space-between",s.style.alignItems="center";let n=document.createElement("span");n.textContent=i.textContent,s.appendChild(n);let l=document.createElement("output");l.id=a,l.setAttribute("for",o),l.style.color="var(--surface-text-secondary, var(--color-text-secondary))",l.style.fontSize="0.875rem",l.textContent=r.value,s.appendChild(l),i.textContent="",i.appendChild(s);let d=()=>{l.textContent=r.value};r.addEventListener("input",d)}}else{let i=r.closest(".range-container");i||(i=document.createElement("div"),i.className="range-container",r.parentNode?.insertBefore(i,r),i.appendChild(r)),i.style.position="relative";let s=document.createElement("output");s.id=a,s.setAttribute("for",o),s.className="range-bubble",s.setAttribute("aria-live","polite"),i.appendChild(s);let n=()=>{let p=parseFloat(r.min)||0,c=parseFloat(r.max)||100,u=parseFloat(r.value),g=(u-p)/(c-p);s.style.left=`calc(${g*100}% )`,s.textContent=String(u)},l=()=>s.classList.add("visible"),d=()=>s.classList.remove("visible");r.addEventListener("input",n),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",d),r.addEventListener("pointerleave",d),r.addEventListener("focus",l),r.addEventListener("blur",d),n()}r.dataset.enhancedRange="1"}function Pr(r){if(r.dataset.enhancedRequired)return;r.dataset.enhancedRequired="true";let e=t=>{let o=t.closest("label");if(!o||o.querySelector(".required-asterisk"))return;let a=document.createElement("span");a.classList.add("required-asterisk"),a.textContent="*",a.style.marginLeft="4px",o.querySelector("span").appendChild(a);let i=t.closest("form");if(i&&!i.querySelector(".required-legend")){let s=document.createElement("small");s.classList.add("required-legend"),s.textContent="* Required fields",i.insertBefore(s,i.querySelector(".form-actions")||i.lastElementChild)}};r.querySelectorAll("[required]").forEach(t=>{e(t)})}function Rr(r){if(r.dataset.enhancedOpenGroup)return;r.dataset.enhancedOpenGroup="true",r.classList.add("flex","flex-wrap","buttons");let e=document.createElement("input");e.type="text",e.placeholder="Add item...",e.classList.add("input-text","input-sm"),e.style.width="auto";let t=r.querySelector('input[type="radio"], input[type="checkbox"]');r.appendChild(e),e.addEventListener("keydown",o=>{if(o.key==="Enter"||o.key==="Tab"){let a=e.value.trim();if(a){o.preventDefault();let i=t.type==="radio"?"radio":"checkbox",s=`open-group-${Math.random().toString(36).substring(2,11)}`,n=document.createElement("label"),l=document.createElement("span");l.setAttribute("data-label",""),l.textContent=a;let d=document.createElement("input");d.type=i,d.name=t.name||r.getAttribute("data-name")||"open-group",d.value=a,d.id=s,n.appendChild(l),n.appendChild(d),r.insertBefore(n,e),e.value=""}}else if(o.key==="Backspace"&&e.value===""){o.preventDefault();let a=r.querySelectorAll("label");a.length>0&&a[a.length-1].remove()}})}function Fr(r){if(r.dataset.enhancedClip)return;r.dataset.enhancedClip="true",r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.hasAttribute("role")||r.setAttribute("role","button");let e=()=>{let o=r.getAttribute("data-clip-open")==="true";r.setAttribute("aria-expanded",o?"true":"false")},t=()=>{let o=r.getAttribute("data-clip-open")==="true";r.setAttribute("data-clip-open",o?"false":"true"),e()};r.addEventListener("click",o=>{o.defaultPrevented||t()}),r.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),t())}),e()}function Ir(r){if(r.dataset.enhancedBtnWorking)return;r.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(a=>{a.forEach(i=>{if(i.attributeName==="class"){let s=r.classList.contains("btn-working"),n=r.querySelector("pds-icon");if(s)if(n)e||(e=n.getAttribute("icon")),n.setAttribute("icon","circle-notch");else{let l=document.createElement("pds-icon");l.setAttribute("icon","circle-notch"),l.setAttribute("size","sm"),r.insertBefore(l,r.firstChild),t=!0}else i.oldValue?.includes("btn-working")&&n&&(t?(n.remove(),t=!1):e&&(n.setAttribute("icon",e),e=null))}})}).observe(r,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Nr=new Map([[".accordion",Lr],["nav[data-dropdown]",Mr],["label[data-toggle]",_r],['input[type="range"]',Dr],["form[data-required]",Pr],["fieldset[role=group][data-open]",Rr],["[data-clip]",Fr],["button, a[class*='btn-']",Ir]]),Xe=zr.map(r=>({...r,run:Nr.get(r.selector)||(()=>{})}));var Mt="pds",Br=/^([a-z][a-z0-9+\-.]*:)?\/\//i,Lt=/^[a-z]:/i;function le(r=""){return r.endsWith("/")?r:`${r}/`}function Or(r="",e=Mt){let t=r.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function jr(r){return r.replace(/^\.\/+/,"")}function Hr(r){return Lt.test(r)?r.replace(Lt,"").replace(/^\/+/,""):r}function Wr(r){return r.startsWith("public/")?r.substring(7):r}function et(r,e={}){let t=e.segment||Mt,o=e.defaultRoot||`/assets/${t}/`,a=r?.public&&r.public?.root||r?.static&&r.static?.root||null;if(!a||typeof a!="string")return le(o);let i=a.trim();return i?(i=i.replace(/\\/g,"/"),i=Or(i,t),i=le(i),Br.test(i)?i:(i=jr(i),i=Hr(i),i.startsWith("/")||(i=Wr(i),i.startsWith("/")||(i=`/${i}`),i=i.replace(/\/+/g,(s,n)=>n===0?s:"/")),le(i))):le(o)}var qr=/^[a-z][a-z0-9+\-.]*:\/\//i,de=(()=>{try{return import.meta.url}catch{return}})(),ke=r=>typeof r=="string"&&r.length&&!r.endsWith("/")?`${r}/`:r;function Se(r,e={}){if(!r||qr.test(r))return r;let{preferModule:t=!0}=e,o=()=>{if(!de)return null;try{return new URL(r,de).href}catch{return null}},a=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(r,window.location.origin).href}catch{return null}};return(t?o()||a():a()||o())||r}var Pt=(()=>{if(de)try{let r=new URL(de);if(/\/public\/assets\/js\//.test(r.pathname))return new URL("../pds/",de).href}catch{return}})(),Rt=!1;function Ft(r){Rt||typeof document>"u"||(Rt=!0,r.addEventListener("pds:ready",e=>{let t=e.detail?.mode;t&&document.documentElement.classList.add(`pds-${t}`,"pds-ready")}))}function ot(r={},e={}){if(!e||typeof e!="object")return r;let t=Array.isArray(r)?[...r]:{...r};for(let[o,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?t[o]=ot(t[o]&&typeof t[o]=="object"?t[o]:{},a):t[o]=a;return t}function rt(r=""){return String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function W(r){if(r==null)return r;if(typeof r=="function")return;if(typeof r!="object")return r;if(Array.isArray(r))return r.map(t=>W(t)).filter(t=>t!==void 0);let e={};for(let t in r)if(r.hasOwnProperty(t)){let o=r[t];if(typeof o!="function"){let a=W(o);a!==void 0&&(e[t]=a)}}return e}function It(r={},e={},{presets:t,defaultLog:o}){let a=typeof r=="object"&&("colors"in r||"typography"in r||"spatialRhythm"in r||"shape"in r||"behavior"in r||"layout"in r||"advanced"in r||"a11y"in r||"components"in r||"icons"in r),i=r&&r.enhancers;i&&!Array.isArray(i)&&(i=Object.values(i));let s=i??e.enhancers??[],n=r&&r.preset,l=r&&r.design,d=r&&r.icons&&typeof r.icons=="object"?r.icons:null,p="preset"in(r||{})||"design"in(r||{})||"enhancers"in(r||{}),c,u=null;if(p){let g=String(n||"default").toLowerCase(),b=t?.[g]||Object.values(t||{}).find(v=>rt(v.name)===g||String(v.name||"").toLowerCase()===g);if(!b)throw new Error(`PDS preset not found: "${n||"default"}"`);u={id:b.id||rt(b.name),name:b.name||b.id||String(g)};let y=structuredClone(b);if(l&&typeof l=="object"||d){let v=l?W(l):{},x=d?W(d):null,w=x?ot(v,{icons:x}):v;y=ot(y,structuredClone(w))}let{mode:f,autoDefine:$,applyGlobalStyles:Q,manageTheme:T,themeStorageKey:O,preloadStyles:D,criticalLayers:ne,managerURL:X,manager:ve,preset:L,design:j,enhancers:ce,log:A,...ee}=r;c={...ee,design:y,preset:u.name,log:A||o}}else if(a){let{log:g,...b}=r;c={design:structuredClone(b),log:g||o}}else{let g=t?.default||Object.values(t||{}).find(b=>rt(b.name)==="default");if(!g)throw new Error("PDS default preset not available");u={id:g.id||"default",name:g.name||"Default"},c={design:structuredClone(g),preset:u.name,log:o}}return{generatorConfig:c,enhancers:s,presetInfo:u}}function Nt({manageTheme:r,themeStorageKey:e,applyResolvedTheme:t,setupSystemListenerIfNeeded:o}){let a="light",i=null;if(r&&typeof window<"u"){try{i=localStorage.getItem(e)||null}catch{i=null}try{t?.(i),o?.(i)}catch{}i?i==="system"?a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a=i:a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:a,storedTheme:i}}function at(r,{resolvePublicAssetURL:e}){let t=!!(r?.public?.root||r?.static?.root),o=e(r);return!t&&Pt&&(o=Pt),ke(Se(o))}async function Bt(r,{baseEnhancers:e=[]}={}){let{autoDefineBaseURL:t="/auto-define/",autoDefinePreload:o=[],autoDefineMapper:a=null,enhancers:i=[],autoDefineOverrides:s=null,autoDefinePreferModule:n=!0}=r,l=(()=>{let p=new Map;return(e||[]).forEach(c=>p.set(c.selector,c)),(i||[]).forEach(c=>p.set(c.selector,c)),Array.from(p.values())})(),d=null;if(typeof window<"u"&&typeof document<"u"){let p=null;try{let f=await Promise.resolve().then(()=>(Dt(),_t));p=f?.AutoDefiner||f?.default?.AutoDefiner||f?.default||null}catch(f){console.warn("AutoDefiner not available:",f?.message||f)}let c=f=>{switch(f){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${f}.js`}},{mapper:u,...g}=s&&typeof s=="object"?s:{},y={baseURL:t&&ke(Se(t,{preferModule:n})),predefine:o,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:l,onError:(f,$)=>{if(typeof f=="string"&&f.startsWith("pds-")){let T=["pds-form","pds-drawer"].includes(f),O=$?.message?.includes("#pds/lit")||$?.message?.includes("Failed to resolve module specifier");T&&O?console.error(`\u274C PDS component <${f}> 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 <${f}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${f}>:`,$)},...g,mapper:f=>{if(customElements.get(f))return null;if(typeof a=="function")try{let $=a(f);return $===void 0?c(f):$}catch($){return console.warn("Custom autoDefine.mapper error; falling back to default:",$?.message||$),c(f)}return c(f)}};p&&(d=new p(y),o.length>0&&typeof p.define=="function"&&await p.define(...o,{baseURL:t,mapper:y.mapper,onError:y.onError}))}return{autoDefiner:d,mergedEnhancers:l}}var nt=class extends EventTarget{},m=new nt;m.initializing=!1;m.currentPreset=null;m.debug=!1;var Gt=(r="")=>String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Ae=function(r="log",e,...t){let o=!!(m.registry&&!m.registry.isLive),a=(this?.debug||this?.design?.debug||m.debug||!1)===!0;if(o){if(!m.debug)return}else if(!a&&r!=="error"&&r!=="warn")return;let i=console[r]||console.log;t.length>0?i(e,...t):i(e)};async function Gr(r,e={}){if(e?.runtimeConfig===!1||typeof fetch!="function")return null;let t=e?.runtimeConfigURL||`${r}pds-runtime-config.json`;try{let o=await fetch(t,{cache:"no-store"});return o.ok?await o.json():null}catch{return null}}m.registry=re;m.enums=h;m.adoptLayers=Et;m.adoptPrimitives=At;m.createStylesheet=Tt;m.isLiveMode=()=>re.isLive;m.ask=zt;m.toast=P;m.common=Ze;m.AutoComplete=null;m.loadAutoComplete=async()=>{if(m.AutoComplete)return m.AutoComplete;try{let r=await Promise.resolve().then(()=>(Ce(),qt)),e=r?.AutoComplete||r?.default||r;if(e)return m.AutoComplete=e,e}catch(r){Ae("warn","PDS.loadAutoComplete failed",r)}return null};function Vt(r){let e=typeof CustomEvent=="function";try{let t=e?new CustomEvent("pds:ready",{detail:r}):new Event("pds:ready");m.dispatchEvent(t)}catch{}if(typeof document<"u")if(e){let t={detail:r,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",t))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",t))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}typeof window<"u"&&(window.PDS=m);var st="pure-ds-theme",q=null,pe=null;function Ee(r){try{if(typeof document>"u")return;let e="light";r?r==="system"?e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e=r:e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e)}catch{}}function Te(r){try{if(q&&pe){try{typeof q.removeEventListener=="function"?q.removeEventListener("change",pe):typeof q.removeListener=="function"&&q.removeListener(pe)}catch{}q=null,pe=null}if(r==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=o=>{let a=o?.matches===void 0?e.matches:o.matches;try{let i=a?"dark":"light";document.documentElement.setAttribute("data-theme",i),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:i,source:"system"}}))}catch{}};q=e,pe=t,typeof e.addEventListener=="function"?e.addEventListener("change",t):typeof e.addListener=="function"&&e.addListener(t)}}catch{}}Object.defineProperty(m,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(st)||null}catch{return null}},set(r){try{if(typeof window>"u")return;r==null?localStorage.removeItem(st):localStorage.setItem(st,r),Ee(r),Te(r),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"api"}}))}catch{}}});m.defaultEnhancers=Xe;async function Vr(r){let e=r&&r.mode||"live",{mode:t,...o}=r||{};if(e==="static")return Jr(o);let a=at(o,{resolvePublicAssetURL:et}),i=o?.managerURL||o?.public?.managerURL||o?.manager?.url||new URL("core/pds-manager.js",a).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:s}=await import(i);return s(m,o,{emitReady:Vt,applyResolvedTheme:Ee,setupSystemListenerIfNeeded:Te})}m.start=Vr;async function Jr(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,o=r.themeStorageKey??"pure-ds-theme",a=r.staticPaths??{},i=at(r,{resolvePublicAssetURL:et}),s=r&&r.autoDefine||null,n;s&&s.baseURL?n=ke(Se(s.baseURL,{preferModule:!1})):n=`${i}components/`;let l=s&&Array.isArray(s.predefine)&&s.predefine||[],d=s&&typeof s.mapper=="function"&&s.mapper||null;try{Ft(m);let{resolvedTheme:p}=Nt({manageTheme:t,themeStorageKey:o,applyResolvedTheme:Ee,setupSystemListenerIfNeeded:Te}),c=await Gr(i,r),u=c?.config?.design||c?.design||null,g=c?.config?.preset||c?.preset||"default",b=c?.presetId||Gt(g)||"default",y=u?{[String(b).toLowerCase()]:u,...String(b).toLowerCase()!=="default"?{default:u}:{}}:null,f=r?.design&&typeof r.design=="object"?W(r.design):null,$=Gt(r?.preset||"default")||"default",Q=f?{[String($).toLowerCase()]:f,...String($).toLowerCase()!=="default"?{default:f}:{}}:null,T=y||r?.presets||Q||{};if(!Object.keys(T||{}).length)throw new Error("PDS static mode requires preset data. Run pds:build or provide config.presets/config.design.");let O=c?.config?{...c.config,...r,preset:r?.preset||b,design:f||u||c?.config?.design}:r,D=It(O,{},{presets:T,defaultLog:Ae}),ne=D.enhancers,X={tokens:`${i}styles/pds-tokens.css.js`,primitives:`${i}styles/pds-primitives.css.js`,components:`${i}styles/pds-components.css.js`,utilities:`${i}styles/pds-utilities.css.js`,styles:`${i}styles/pds-styles.css.js`},ve=c?.paths||{};if(a={...X,...ve,...a},m.registry.setStaticMode(a),e&&typeof document<"u")try{let A=await m.registry.getStylesheet("styles");if(A){A._pds=!0;let ee=(document.adoptedStyleSheets||[]).filter(v=>v._pds!==!0);document.adoptedStyleSheets=[...ee,A]}}catch(A){Ae.call(m,"warn","Failed to apply static styles:",A)}let L=null,j=[];try{let A=await Bt({autoDefineBaseURL:n,autoDefinePreload:l,autoDefineMapper:d,enhancers:ne,autoDefineOverrides:s||null,autoDefinePreferModule:!(s&&s.baseURL)},{baseEnhancers:Xe});L=A.autoDefiner,j=A.mergedEnhancers||[]}catch(A){Ae.call(m,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",A)}let ce=W(r);return m.currentConfig=Object.freeze({mode:"static",...structuredClone(ce),design:structuredClone(D.generatorConfig.design),preset:D.generatorConfig.preset,theme:p,enhancers:j}),Vt({mode:"static",config:D.generatorConfig,theme:p,autoDefiner:L}),{config:D.generatorConfig,theme:p,autoDefiner:L}}catch(p){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:p}})),p}}var ct=Ee,lt=Te;var ze=globalThis,Me=ze.ShadowRoot&&(ze.ShadyCSS===void 0||ze.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Kt=Symbol(),Jt=new WeakMap,Le=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==Kt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Me&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=Jt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&Jt.set(t,e))}return e}toString(){return this.cssText}},Yt=r=>new Le(typeof r=="string"?r:r+"",void 0,Kt);var Zt=(r,e)=>{if(Me)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),a=ze.litNonce;a!==void 0&&o.setAttribute("nonce",a),o.textContent=t.cssText,r.appendChild(o)}},dt=Me?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return Yt(t)})(r):r;var{is:Yr,defineProperty:Zr,getOwnPropertyDescriptor:Qr,getOwnPropertyNames:Xr,getOwnPropertySymbols:eo,getPrototypeOf:to}=Object,_e=globalThis,Qt=_e.trustedTypes,ro=Qt?Qt.emptyScript:"",oo=_e.reactiveElementPolyfillSupport,ue=(r,e)=>r,pt={toAttribute(r,e){switch(e){case Boolean:r=r?ro:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},er=(r,e)=>!Yr(r,e),Xt={attribute:!0,type:String,converter:pt,reflect:!1,useDefault:!1,hasChanged:er};Symbol.metadata??=Symbol("metadata"),_e.litPropertyMetadata??=new WeakMap;var R=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Xt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),a=this.getPropertyDescriptor(e,o,t);a!==void 0&&Zr(this.prototype,e,a)}}static getPropertyDescriptor(e,t,o){let{get:a,set:i}=Qr(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:a,set(s){let n=a?.call(this);i?.call(this,s),this.requestUpdate(e,n,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Xt}static _$Ei(){if(this.hasOwnProperty(ue("elementProperties")))return;let e=to(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ue("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ue("properties"))){let t=this.properties,o=[...Xr(t),...eo(t)];for(let a of o)this.createProperty(a,t[a])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,a]of t)this.elementProperties.set(o,a)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let a=this._$Eu(t,o);a!==void 0&&this._$Eh.set(a,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let a of o)t.unshift(dt(a))}else e!==void 0&&t.push(dt(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Zt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){let o=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,o);if(a!==void 0&&o.reflect===!0){let i=(o.converter?.toAttribute!==void 0?o.converter:pt).toAttribute(t,o.type);this._$Em=e,i==null?this.removeAttribute(a):this.setAttribute(a,i),this._$Em=null}}_$AK(e,t){let o=this.constructor,a=o._$Eh.get(e);if(a!==void 0&&this._$Em!==a){let i=o.getPropertyOptions(a),s=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:pt;this._$Em=a;let n=s.fromAttribute(t,i.type);this[a]=n??this._$Ej?.get(a)??n,this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){let a=this.constructor,i=this[e];if(o??=a.getPropertyOptions(e),!((o.hasChanged??er)(i,t)||o.useDefault&&o.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,o))))return;this.C(e,t,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:a,wrapped:i},s){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),i!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),a===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[a,i]of this._$Ep)this[a]=i;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[a,i]of o){let{wrapped:s}=i,n=this[a];s!==!0||this._$AL.has(a)||n===void 0||this.C(a,void 0,i,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};R.elementStyles=[],R.shadowRootOptions={mode:"open"},R[ue("elementProperties")]=new Map,R[ue("finalized")]=new Map,oo?.({ReactiveElement:R}),(_e.reactiveElementVersions??=[]).push("2.1.1");var ht=globalThis,De=ht.trustedTypes,tr=De?De.createPolicy("lit-html",{createHTML:r=>r}):void 0,gt="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+F,ao=`<${mt}>`,J=document,ge=()=>J.createComment(""),me=r=>r===null||typeof r!="object"&&typeof r!="function",ft=Array.isArray,nr=r=>ft(r)||typeof r?.[Symbol.iterator]=="function",ut=`[
|
|
33
|
-
\f\r]`,he=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
34
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ar=/'/g,ir=/"/g,cr=/^(?:script|style|textarea|title)$/i,bt=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Be=bt(1),yt=bt(2),lr=bt(3),C=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),sr=new WeakMap,V=J.createTreeWalker(J,129);function dr(r,e){if(!ft(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return tr!==void 0?tr.createHTML(e):e}var pr=(r,e)=>{let t=r.length-1,o=[],a,i=e===2?"<svg>":e===3?"<math>":"",s=he;for(let n=0;n<t;n++){let l=r[n],d,p,c=-1,u=0;for(;u<l.length&&(s.lastIndex=u,p=s.exec(l),p!==null);)u=s.lastIndex,s===he?p[1]==="!--"?s=rr:p[1]!==void 0?s=or:p[2]!==void 0?(cr.test(p[2])&&(a=RegExp("</"+p[2],"g")),s=G):p[3]!==void 0&&(s=G):s===G?p[0]===">"?(s=a??he,c=-1):p[1]===void 0?c=-2:(c=s.lastIndex-p[2].length,d=p[1],s=p[3]===void 0?G:p[3]==='"'?ir:ar):s===ir||s===ar?s=G:s===rr||s===or?s=he:(s=G,a=void 0);let g=s===G&&r[n+1].startsWith("/>")?" ":"";i+=s===he?l+ao:c>=0?(o.push(d),l.slice(0,c)+gt+l.slice(c)+F+g):l+F+(c===-2?n:g)}return[dr(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),o]},fe=class r{constructor({strings:e,_$litType$:t},o){let a;this.parts=[];let i=0,s=0,n=e.length-1,l=this.parts,[d,p]=pr(e,t);if(this.el=r.createElement(d,o),V.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(a=V.nextNode())!==null&&l.length<n;){if(a.nodeType===1){if(a.hasAttributes())for(let c of a.getAttributeNames())if(c.endsWith(gt)){let u=p[s++],g=a.getAttribute(c).split(F),b=/([.?@])?(.*)/.exec(u);l.push({type:1,index:i,name:b[2],strings:g,ctor:b[1]==="."?Re:b[1]==="?"?Fe:b[1]==="@"?Ie:Y}),a.removeAttribute(c)}else c.startsWith(F)&&(l.push({type:6,index:i}),a.removeAttribute(c));if(cr.test(a.tagName)){let c=a.textContent.split(F),u=c.length-1;if(u>0){a.textContent=De?De.emptyScript:"";for(let g=0;g<u;g++)a.append(c[g],ge()),V.nextNode(),l.push({type:2,index:++i});a.append(c[u],ge())}}}else if(a.nodeType===8)if(a.data===mt)l.push({type:2,index:i});else{let c=-1;for(;(c=a.data.indexOf(F,c+1))!==-1;)l.push({type:7,index:i}),c+=F.length-1}i++}}static createElement(e,t){let o=J.createElement("template");return o.innerHTML=e,o}};function K(r,e,t=r,o){if(e===C)return e;let a=o!==void 0?t._$Co?.[o]:t._$Cl,i=me(e)?void 0:e._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),i===void 0?a=void 0:(a=new i(r),a._$AT(r,t,o)),o!==void 0?(t._$Co??=[])[o]=a:t._$Cl=a),a!==void 0&&(e=K(r,a._$AS(r,e.values),a,o)),e}var Pe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:o}=this._$AD,a=(e?.creationScope??J).importNode(t,!0);V.currentNode=a;let i=V.nextNode(),s=0,n=0,l=o[0];for(;l!==void 0;){if(s===l.index){let d;l.type===2?d=new oe(i,i.nextSibling,this,e):l.type===1?d=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(d=new Ne(i,this,e)),this._$AV.push(d),l=o[++n]}s!==l?.index&&(i=V.nextNode(),s++)}return V.currentNode=J,a}p(e){let t=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}},oe=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,a){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=K(this,e,t),me(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==C&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):nr(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==k&&me(this._$AH)?this._$AA.nextSibling.data=e:this.T(J.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:o}=e,a=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=fe.createElement(dr(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===a)this._$AH.p(t);else{let i=new Pe(a,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=sr.get(e.strings);return t===void 0&&sr.set(e.strings,t=new fe(e)),t}k(e){ft(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,o,a=0;for(let i of e)a===t.length?t.push(o=new r(this.O(ge()),this.O(ge()),this,this.options)):o=t[a],o._$AI(i),a++;a<t.length&&(this._$AR(o&&o._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Y=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,a,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=a,this.options=i,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=k}_$AI(e,t=this,o,a){let i=this.strings,s=!1;if(i===void 0)e=K(this,e,t,0),s=!me(e)||e!==this._$AH&&e!==C,s&&(this._$AH=e);else{let n=e,l,d;for(e=i[0],l=0;l<i.length-1;l++)d=K(this,n[o+l],t,l),d===C&&(d=this._$AH[l]),s||=!me(d)||d!==this._$AH[l],d===k?e=k:e!==k&&(e+=(d??"")+i[l+1]),this._$AH[l]=d}s&&!a&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Re=class extends Y{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Fe=class extends Y{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Ie=class extends Y{constructor(e,t,o,a,i){super(e,t,o,a,i),this.type=5}_$AI(e,t=this){if((e=K(this,e,t,0)??k)===C)return;let o=this._$AH,a=e===k&&o!==k||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,i=e!==k&&(o===k||a);a&&this.element.removeEventListener(this.name,this,o),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ne=class{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}},ur={M:gt,P:F,A:mt,C:1,L:pr,R:Pe,D:nr,V:K,I:oe,H:Y,N:Fe,U:Ie,B:Re,F:Ne},io=ht.litHtmlPolyfillSupport;io?.(fe,oe),(ht.litHtmlVersions??=[]).push("3.3.1");var vt=(r,e,t)=>{let o=t?.renderBefore??e,a=o._$litPart$;if(a===void 0){let i=t?.renderBefore??null;o._$litPart$=a=new oe(e.insertBefore(ge(),i),i,void 0,t??{})}return a._$AI(r),a};var wt=globalThis,_=class extends R{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=vt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return C}};_._$litElement$=!0,_.finalized=!0,wt.litElementHydrateSupport?.({LitElement:_});var so=wt.litElementPolyfillSupport;so?.({LitElement:_});(wt.litElementVersions??=[]).push("4.2.1");var I={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},E=r=>(...e)=>({_$litDirective$:r,values:e}),z=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,o){this._$Ct=e,this._$AM=t,this._$Ci=o}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:no}=ur,gr=r=>r===null||typeof r!="object"&&typeof r!="function";var mr=r=>r.strings===void 0,hr=()=>document.createComment(""),ae=(r,e,t)=>{let o=r._$AA.parentNode,a=e===void 0?r._$AB:e._$AA;if(t===void 0){let i=o.insertBefore(hr(),a),s=o.insertBefore(hr(),a);t=new no(i,s,r,r.options)}else{let i=t._$AB.nextSibling,s=t._$AM,n=s!==r;if(n){let l;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(l=r._$AU)!==s._$AU&&t._$AP(l)}if(i!==a||n){let l=t._$AA;for(;l!==i;){let d=l.nextSibling;o.insertBefore(l,a),l=d}}}return t},N=(r,e,t=r)=>(r._$AI(e,t),r),co={},Oe=(r,e=co)=>r._$AH=e,fr=r=>r._$AH,je=r=>{r._$AR(),r._$AA.remove()};var br=(r,e,t)=>{let o=new Map;for(let a=e;a<=t;a++)o.set(r[a],a);return o},ha=E(class extends z{constructor(r){if(super(r),r.type!==I.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let o;t===void 0?t=e:e!==void 0&&(o=e);let a=[],i=[],s=0;for(let n of r)a[s]=o?o(n,s):s,i[s]=t(n,s),s++;return{values:i,keys:a}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,o]){let a=fr(r),{values:i,keys:s}=this.dt(e,t,o);if(!Array.isArray(a))return this.ut=s,i;let n=this.ut??=[],l=[],d,p,c=0,u=a.length-1,g=0,b=i.length-1;for(;c<=u&&g<=b;)if(a[c]===null)c++;else if(a[u]===null)u--;else if(n[c]===s[g])l[g]=N(a[c],i[g]),c++,g++;else if(n[u]===s[b])l[b]=N(a[u],i[b]),u--,b--;else if(n[c]===s[b])l[b]=N(a[c],i[b]),ae(r,l[b+1],a[c]),c++,b--;else if(n[u]===s[g])l[g]=N(a[u],i[g]),ae(r,a[c],a[u]),u--,g++;else if(d===void 0&&(d=br(s,g,b),p=br(n,c,u)),d.has(n[c]))if(d.has(n[u])){let y=p.get(s[g]),f=y!==void 0?a[y]:null;if(f===null){let $=ae(r,a[c]);N($,i[g]),l[g]=$}else l[g]=N(f,i[g]),ae(r,a[c],f),a[y]=null;g++}else je(a[u]),u--;else je(a[c]),c++;for(;g<=b;){let y=ae(r,l[b+1]);N(y,i[g]),l[g++]=y}for(;c<=u;){let y=a[c++];y!==null&&je(y)}return this.ut=s,Oe(r,l),C}});var xa=E(class extends z{constructor(){super(...arguments),this.key=k}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(Oe(r),this.key=e),t}});var Ta=E(class extends z{constructor(r){if(super(r),r.type!==I.ATTRIBUTE||r.name!=="class"||r.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(let o in e)e[o]&&!this.nt?.has(o)&&this.st.add(o);return this.render(e)}let t=r.element.classList;for(let o of this.st)o in e||(t.remove(o),this.st.delete(o));for(let o in e){let a=!!e[o];a===this.st.has(o)||this.nt?.has(o)||(a?(t.add(o),this.st.add(o)):(t.remove(o),this.st.delete(o)))}return C}});var be=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let o of t)o._$AO?.(e,!1),be(o,e);return!0},He=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},yr=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),uo(e)}};function lo(r){this._$AN!==void 0?(He(this),this._$AM=r,yr(this)):this._$AM=r}function po(r,e=!1,t=0){let o=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(o))for(let i=t;i<o.length;i++)be(o[i],!1),He(o[i]);else o!=null&&(be(o,!1),He(o));else be(this,r)}var uo=r=>{r.type==I.CHILD&&(r._$AP??=po,r._$AQ??=lo)},ie=class extends z{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,o){super._$AT(e,t,o),yr(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(be(this,e),He(this))}setValue(e){if(mr(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var xt=new WeakMap,ho=E(class extends ie{render(r){return k}update(r,[e]){let t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=r.options?.host,this.rt(this.ct=r.element)),k}rt(r){if(this.isConnected||(r=void 0),typeof this.G=="function"){let e=this.ht??globalThis,t=xt.get(e);t===void 0&&(t=new WeakMap,xt.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){return typeof this.G=="function"?xt.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 We=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Ue=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}};var vr=r=>!gr(r)&&typeof r.then=="function",wr=1073741823,kt=class extends ie{constructor(){super(...arguments),this._$Cwt=wr,this._$Cbt=[],this._$CK=new We(this),this._$CX=new Ue}render(...e){return e.find(t=>!vr(t))??C}update(e,t){let o=this._$Cbt,a=o.length;this._$Cbt=t;let i=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let n=0;n<t.length&&!(n>this._$Cwt);n++){let l=t[n];if(!vr(l))return this._$Cwt=n,l;n<a&&l===o[n]||(this._$Cwt=wr,a=0,Promise.resolve(l).then(async d=>{for(;s.get();)await s.get();let p=i.deref();if(p!==void 0){let c=p._$Cbt.indexOf(l);c>-1&&c<p._$Cwt&&(p._$Cwt=c,p.setValue(d))}}))}return C}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},go=E(kt);var Z=class extends z{constructor(e){if(super(e),this.it=k,e.type!==I.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===C)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Z.directiveName="unsafeHTML",Z.resultType=1;var qe=E(Z);var ye=class extends Z{};ye.directiveName="unsafeSVG",ye.resultType=2;var mo=E(ye);var hi=["127.0.0.1","localhost"].includes(window.location.hostname);var fo=Symbol.for(""),bo=r=>{if(r?.r===fo)return r?._$litStatic$};var xr=new Map,St=r=>(e,...t)=>{let o=t.length,a,i,s=[],n=[],l,d=0,p=!1;for(;d<o;){for(l=e[d];d<o&&(i=t[d],(a=bo(i))!==void 0);)l+=a+e[++d],p=!0;d!==o&&n.push(i),s.push(l),d++}if(d===o&&s.push(e[o]),p){let c=s.join("$$lit$$");(e=xr.get(c))===void 0&&(s.raw=s,xr.set(c,e=s)),t=n}return r(e,...t)},yo=St(Be),fi=St(yt),bi=St(lr);var S=Be;var B={"ocean-breeze":{id:"ocean-breeze",name:"Ocean Breeze",tags:["playful"],description:"Fresh and calming ocean-inspired palette with professional undertones",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#0891b2",secondary:"#64748b",accent:"#06b6d4",background:"#f0f9ff",darkMode:{background:"#0c1821",secondary:"#94a3b8",primary:"#0891b2"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'},spatialRhythm:{baseUnit:6,scaleRatio:1.2},shape:{radiusSize:h.RadiusSizes.xxlarge}},"midnight-steel":{id:"midnight-steel",name:"Midnight Steel",description:"Bold industrial aesthetic with sharp contrasts and urban edge",colors:{primary:"#3b82f6",secondary:"#52525b",accent:"#f59e0b",background:"#fafaf9",darkMode:{background:"#18181b",secondary:"#71717a",primary:"#3b82f6"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'IBM Plex Sans', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thin}},"neural-glow":{id:"neural-glow",name:"Neural Glow",description:"AI-inspired with vibrant purple-blue gradients and futuristic vibes",colors:{primary:"#8b5cf6",secondary:"#6366f1",accent:"#ec4899",background:"#faf5ff",darkMode:{background:"#0f0a1a",secondary:"#818cf8",primary:"#8b5cf6"}},typography:{baseFontSize:16,fontScale:1.618,fontFamilyHeadings:"'Space Grotesk', system-ui, sans-serif",fontFamilyBody:"'Space Grotesk', system-ui, sans-serif"},spatialRhythm:{baseUnit:4,scaleRatio:1.5},shape:{radiusSize:h.RadiusSizes.xlarge,borderWidth:h.BorderWidths.medium},behavior:{transitionSpeed:h.TransitionSpeeds.fast}},"paper-and-ink":{id:"paper-and-ink",name:"Paper & Ink",tags:["app","featured"],description:"Ultra-minimal design with focus on typography and whitespace",colors:{primary:"#171717",secondary:"#737373",accent:"#525252",background:"#ffffff",darkMode:{background:"#0a0a0a",secondary:"#a3a3a3",primary:"#737373"}},typography:{baseFontSize:18,fontScale:1.333,fontFamilyHeadings:"'Helvetica Neue', 'Arial', sans-serif",fontFamilyBody:"'Georgia', 'Times New Roman', serif",fontWeightNormal:400,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.2},shape:{radiusSize:h.RadiusSizes.none,borderWidth:h.BorderWidths.thin}},"sunset-paradise":{id:"sunset-paradise",name:"Sunset Paradise",description:"Warm tropical colors evoking golden hour by the beach",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#ea580c",secondary:"#d4a373",accent:"#fb923c",background:"#fffbeb",darkMode:{background:"#1a0f0a",secondary:"#c9a482",primary:"#f97316"}},typography:{baseFontSize:16,fontScale:1.5,fontFamilyHeadings:"'Quicksand', 'Comfortaa', sans-serif",fontFamilyBody:"'Quicksand', 'Comfortaa', sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.5},shape:{radiusSize:h.RadiusSizes.xxlarge,borderWidth:h.BorderWidths.medium}},"retro-wave":{id:"retro-wave",name:"Retro Wave",description:"Nostalgic 80s-inspired palette with neon undertones",colors:{primary:"#c026d3",secondary:"#a78bfa",accent:"#22d3ee",background:"#fef3ff",darkMode:{background:"#1a0a1f",secondary:"#c4b5fd",primary:"#d946ef"}},typography:{baseFontSize:15,fontScale:1.5,fontFamilyHeadings:"'Orbitron', 'Impact', monospace",fontFamilyBody:"'Courier New', 'Courier', monospace",fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:h.RadiusSizes.none,borderWidth:h.BorderWidths.thick},behavior:{transitionSpeed:h.TransitionSpeeds.instant}},"forest-canopy":{id:"forest-canopy",name:"Forest Canopy",description:"Natural earth tones with organic, calming green hues",colors:{primary:"#059669",secondary:"#78716c",accent:"#84cc16",background:"#f0fdf4",darkMode:{background:"#0a1410",secondary:"#a8a29e",primary:"#10b981"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Merriweather Sans', 'Arial', sans-serif",fontFamilyBody:"'Merriweather', 'Georgia', serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin}},"ruby-elegance":{id:"ruby-elegance",name:"Ruby Elegance",description:"Sophisticated palette with rich ruby reds and warm accents",colors:{primary:"#dc2626",secondary:"#9ca3af",accent:"#be123c",background:"#fef2f2",darkMode:{background:"#1b0808",secondary:"#d1d5db",primary:"#ef4444"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:"'Playfair Display', 'Georgia', serif",fontFamilyBody:"'Crimson Text', 'Garamond', serif",fontWeightNormal:400,fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.333},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thin}},"desert-dawn":{id:"desert-dawn",name:"Desert Dawn",description:"Sun-baked neutrals with grounded terracotta and cool oasis accents",colors:{primary:"#b45309",secondary:"#a8a29e",accent:"#0ea5a8",background:"#fcf6ef",darkMode:{background:"#12100e",secondary:"#d1d5db",primary:"#f59e0b"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Source Sans Pro', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Source Serif Pro', Georgia, serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.medium}},"contrast-pro":{id:"contrast-pro",name:"Contrast Pro",description:"Accessibility-first, high-contrast UI with assertive clarity",colors:{primary:"#1f2937",secondary:"#111827",accent:"#eab308",background:"#ffffff",darkMode:{background:"#0b0f14",secondary:"#9ca3af",primary:"#9ca3af"}},typography:{baseFontSize:17,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightBold:700},spatialRhythm:{baseUnit:3,scaleRatio:1.2},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thick},behavior:{transitionSpeed:h.TransitionSpeeds.fast,focusRingWidth:4}},"pastel-play":{id:"pastel-play",name:"Pastel Play",description:"Playful pastels with soft surfaces and friendly rounded shapes",colors:{primary:"#db2777",secondary:"#a78bfa",accent:"#34d399",background:"#fff7fa",darkMode:{background:"#1a1016",secondary:"#c4b5fd",primary:"#ec4899"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'Nunito', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Nunito', system-ui, -apple-system, sans-serif",lineHeightRelaxed:h.LineHeights.relaxed},spatialRhythm:{baseUnit:6,scaleRatio:1.4},shape:{radiusSize:h.RadiusSizes.xxlarge,borderWidth:h.BorderWidths.thin},behavior:{transitionSpeed:h.TransitionSpeeds.slow,animationEasing:h.AnimationEasings["ease-out"]}},"brutalist-tech":{id:"brutalist-tech",name:"Brutalist Tech",description:"Stark grayscale with engineered accents and unapologetically bold structure",colors:{primary:"#111111",secondary:"#4b5563",accent:"#06b6d4",background:"#f8fafc",darkMode:{background:"#0b0b0b",secondary:"#9ca3af",primary:"#06b6d4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",letterSpacingTight:-.02},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:h.RadiusSizes.none,borderWidth:h.BorderWidths.thick},behavior:{transitionSpeed:h.TransitionSpeeds.instant}},"zen-garden":{id:"zen-garden",name:"Zen Garden",description:"Soft botanicals with contemplative spacing and balanced motion",colors:{primary:"#3f6212",secondary:"#6b7280",accent:"#7c3aed",background:"#f7fbef",darkMode:{background:"#0d130a",secondary:"#a3a3a3",primary:"#84cc16"}},typography:{baseFontSize:17,fontScale:1.414,fontFamilyHeadings:"'Merriweather', Georgia, serif",fontFamilyBody:"'Noto Sans', system-ui, -apple-system, sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.35},shape:{radiusSize:h.RadiusSizes.large,borderWidth:h.BorderWidths.medium},behavior:{transitionSpeed:h.TransitionSpeeds.normal,animationEasing:h.AnimationEasings.ease}},"fitness-pro":{id:"fitness-pro",name:"Fitness Pro",tags:["app","featured"],description:"Health and fitness tracking aesthetic with data-driven dark surfaces and vibrant accent rings",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#e91e63",secondary:"#78909c",accent:"#ab47bc",background:"#fafafa",darkMode:{background:"#1a1d21",secondary:"#78909c",primary:"#0a4ca4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:h.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerPadding:1.25,sectionSpacing:2.5},shape:{radiusSize:h.RadiusSizes.large,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"medium",blurMedium:12},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-out"],focusRingWidth:2}},"travel-market":{id:"travel-market",name:"Travel Market",description:"Hospitality marketplace design with clean cards, subtle shadows, and trust-building neutrals",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#d93251",secondary:"#717171",accent:"#144990",background:"#ffffff",darkMode:{background:"#222222",secondary:"#b0b0b0",primary:"#ff5a7a"}},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightRelaxed:h.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1440,containerPadding:1.5,sectionSpacing:3},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:8},behavior:{transitionSpeed:h.TransitionSpeeds.normal,animationEasing:h.AnimationEasings["ease-in-out"],hoverOpacity:.9}},"mobility-app":{id:"mobility-app",name:"Mobility App",tags:["app","featured"],description:"On-demand service platform with bold typography, map-ready colors, and action-driven UI",options:{liquidGlassEffects:!0,backgroundMesh:0},colors:{primary:"#000000",secondary:"#545454",accent:"#06c167",background:"#f6f6f6",darkMode:{background:"#0f0f0f",secondary:"#8a8a8a",primary:"#06c167"}},typography:{baseFontSize:16,fontScale:1.3,fontFamilyHeadings:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,buttonPadding:1.25,inputPadding:1},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.medium},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-out"],focusRingWidth:3},a11y:{minTouchTarget:h.TouchTargetSizes.comfortable,focusStyle:h.FocusStyles.ring}},"fintech-secure":{id:"fintech-secure",name:"Fintech Secure",description:"Financial services app UI with trust-building blues, precise spacing, and security-first design",options:{liquidGlassEffects:!1,backgroundMesh:0},colors:{primary:"#0a2540",secondary:"#425466",accent:"#00d4ff",background:"#f7fafc",darkMode:{background:"#0a1929",secondary:"#8796a5",primary:"#00d4ff"}},typography:{baseFontSize:16,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1280,sectionSpacing:2.5},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:6},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-in-out"],focusRingWidth:3,focusRingOpacity:.4},a11y:{minTouchTarget:h.TouchTargetSizes.standard,focusStyle:h.FocusStyles.ring}},"social-feed":{id:"social-feed",name:"Social Feed",tags:["app","featured"],description:"Content-first social platform with minimal chrome, bold actions, and vibrant media presentation",options:{liquidGlassEffects:!0,backgroundMesh:4},colors:{primary:"#1877f2",secondary:"#65676b",accent:"#fe2c55",background:"#ffffff",darkMode:{background:"#18191a",secondary:"#b0b3b8",primary:"#2d88ff"}},typography:{baseFontSize:15,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:h.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:680,sectionSpacing:1.5},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-out"],hoverOpacity:.85}},"enterprise-dash":{id:"enterprise-dash",tags:["app","featured"],name:"Enterprise Dashboard",description:"Data-dense business intelligence app interface with organized hierarchy and professional polish",options:{liquidGlassEffects:!1},colors:{primary:"#0066cc",secondary:"#5f6368",accent:"#1a73e8",background:"#ffffff",success:"#34a853",warning:"#fbbc04",danger:"#ea4335",darkMode:{background:"#202124",secondary:"#9aa0a6",primary:"#8ab4f8"}},typography:{baseFontSize:14,fontScale:1.2,fontFamilyHeadings:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'Roboto Mono', ui-monospace, Consolas, monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:h.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.2,containerMaxWidth:1600,containerPadding:1.5,sectionSpacing:2},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:4},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-in-out"],focusRingWidth:2},layout:{densityCompact:.85,gridColumns:12}}};B.default={id:"default",name:"Default",tags:["app","featured"],description:"Fresh and modern design system with balanced aesthetics and usability",options:{liquidGlassEffects:!0,backgroundMesh:4},form:{options:{widgets:{booleans:"toggle",numbers:"input",selects:"standard"},layouts:{fieldsets:"default",arrays:"default"},enhancements:{icons:!0,datalists:!0,rangeOutput:!0},validation:{showErrors:!0,validateOnChange:!1}}},colors:{primary:"#0e7490",secondary:"#a99b95",accent:"#e54271",background:"#e7e6de",darkMode:{background:"#16171a",secondary:"#8b9199",primary:"#06b6d4"},success:null,warning:"#B38600",danger:null,info:null,gradientStops:3,elevationOpacity:.05},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyMono:'ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',fontWeightLight:h.FontWeights.light,fontWeightNormal:h.FontWeights.normal,fontWeightMedium:h.FontWeights.medium,fontWeightSemibold:h.FontWeights.semibold,fontWeightBold:h.FontWeights.bold,lineHeightTight:h.LineHeights.tight,lineHeightNormal:h.LineHeights.normal,lineHeightRelaxed:h.LineHeights.relaxed,letterSpacingTight:-.025,letterSpacingNormal:0,letterSpacingWide:.025},spatialRhythm:{baseUnit:4,scaleRatio:1.25,maxSpacingSteps:32,containerMaxWidth:1200,containerPadding:1,inputPadding:.75,buttonPadding:1,sectionSpacing:2},layers:{shadowDepth:"medium",blurLight:4,blurMedium:8,blurHeavy:16,zIndexBase:0,zIndexDropdown:1e3,zIndexSticky:1020,zIndexFixed:1030,zIndexModal:1040,zIndexPopover:1050,zIndexTooltip:1060,zIndexNotification:1070},shape:{radiusSize:h.RadiusSizes.large,borderWidth:h.BorderWidths.medium,customRadius:null},behavior:{transitionSpeed:h.TransitionSpeeds.normal,animationEasing:h.AnimationEasings["ease-out"],customTransitionSpeed:null,customEasing:null,focusRingWidth:3,focusRingOpacity:.3,hoverOpacity:.8},layout:{gridColumns:12,gridGutter:1,breakpoints:{sm:640,md:768,lg:1024,xl:1280},densityCompact:.8,densityNormal:1,densityComfortable:1.2,buttonMinHeight:h.TouchTargetSizes.standard,inputMinHeight:40,utilities:{grid:!0,flex:!0,spacing:!0,container:!0},gridSystem:{columns:[1,2,3,4,6],autoFitBreakpoints:{sm:"150px",md:"250px",lg:"350px",xl:"450px"},enableGapUtilities:!0},containerMaxWidth:"1400px",containerPadding:"var(--spacing-6)"},advanced:{linkStyle:h.LinkStyles.inline,colorDerivation:"hsl"},a11y:{minTouchTarget:h.TouchTargetSizes.standard,prefersReducedMotion:!0,focusStyle:h.FocusStyles.ring},icons:{set:"phosphor",weight:"regular",defaultSize:24,externalPath:"/assets/img/icons/",sizes:h.IconSizes,include:{navigation:["arrow-left","arrow-right","arrow-up","arrow-down","arrow-counter-clockwise","caret-left","caret-right","caret-down","caret-up","x","list","list-dashes","dots-three-vertical","dots-three","house","gear","magnifying-glass","funnel","tabs","sidebar"],actions:["plus","minus","check","trash","pencil","floppy-disk","copy","download","upload","share","link","eye","eye-slash","heart","star","bookmark","note-pencil","cursor-click","clipboard","magic-wand","sparkle"],communication:["envelope","bell","bell-ringing","bell-simple","chat-circle","phone","paper-plane-tilt","user","users","user-gear","at"],content:["image","file","file-text","file-css","file-js","folder","folder-open","book-open","camera","video-camera","play","pause","microphone","brackets-curly","code","folder-simple","grid-four","briefcase","chart-line","chart-bar","database","map-pin"],status:["info","warning","check-circle","x-circle","question","shield","shield-check","shield-warning","lock","lock-open","fingerprint","circle-notch"],time:["calendar","clock","timer","hourglass"],commerce:["shopping-cart","credit-card","currency-dollar","tag","receipt","storefront"],formatting:["text-align-left","text-align-center","text-align-right","text-b","text-italic","text-underline","list-bullets","list-numbers","text-aa"],system:["cloud","cloud-arrow-up","cloud-arrow-down","desktop","device-mobile","globe","wifi-high","battery-charging","sun","moon","moon-stars","palette","rocket","feather","square","circle","squares-four","lightning","wrench"]},spritePath:"public/assets/pds/icons/pds-icons.svg"},gap:4,debug:!1};var $t={meta:{name:"Pure Design System Ontology",version:"1.0.0",description:"Complete metadata registry for PDS primitives, components, utilities, and tokens"},tokens:{colors:{semantic:["primary","secondary","accent","success","warning","danger","info"],neutral:["gray"],shades:[50,100,200,300,400,500,600,700,800,900,950],surface:["base","subtle","elevated","sunken","overlay","inverse","translucent"],text:["default","muted","subtle","inverse","primary","success","warning","danger","info"]},spacing:{scale:["1","2","3","4","5","6","8","10","12","16","20","24"],semantic:["xs","sm","md","lg","xl"]},typography:{families:["heading","body","mono"],sizes:["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl"],weights:["light","normal","medium","semibold","bold"]},radius:{scale:["none","sm","base","md","lg","xl","2xl","full"]},shadows:{scale:["none","sm","base","md","lg","xl","inner"]},themes:["light","dark"],breakpoints:{sm:640,md:768,lg:1024,xl:1280}},primitives:[{id:"badge",name:"Badge / Pill",description:"Inline status indicators and labels",selectors:[".badge",".badge-primary",".badge-secondary",".badge-success",".badge-info",".badge-warning",".badge-danger",".badge-outline",".badge-sm",".badge-lg",".pill",".tag",".chip"],tags:["status","label","indicator","inline"],category:"feedback"},{id:"card",name:"Card",description:"Content container with padding, border-radius, and optional shadow",selectors:[".card",".card-basic",".card-elevated",".card-outlined",".card-interactive"],tags:["container","content","grouping"],category:"container"},{id:"surface",name:"Surface",description:"Smart surface classes with automatic text/background color handling",selectors:[".surface-base",".surface-subtle",".surface-elevated",".surface-sunken",".surface-overlay",".surface-inverse",".surface-translucent",".surface-translucent-25",".surface-translucent-50",".surface-translucent-75",".surface-primary",".surface-secondary",".surface-success",".surface-warning",".surface-danger",".surface-info"],tags:["background","theming","color","container"],category:"theming"},{id:"callout",name:"Callout",description:"Contextual information and notification messages",selectors:[".callout",".callout-info",".callout-success",".callout-warning",".callout-danger",".callout-error",".callout-dismissible"],tags:["feedback","message","notification","status","information"],category:"feedback"},{id:"empty-state",name:"Empty State",description:"Empty state layout for missing data or onboarding",selectors:[".empty-state"],tags:["empty","no-data","zero","placeholder","onboarding","state"],category:"feedback"},{id:"dialog",name:"Dialog",description:"Modal dialog element",selectors:["dialog",".dialog"],tags:["modal","overlay","popup","modal"],category:"overlay"},{id:"divider",name:"Divider",description:"Horizontal rule with optional label",selectors:["hr","hr[data-content]"],tags:["separator","line","content-divider"],category:"layout"},{id:"table",name:"Table",description:"Data tables with responsive and styling variants",selectors:["table",".table-responsive",".table-striped",".table-bordered",".table-compact",".data-table"],tags:["data","grid","tabular","responsive"],category:"data"},{id:"button",name:"Button",description:"Interactive button element with variants",selectors:["button",".btn-primary",".btn-secondary",".btn-outline",".btn-sm",".btn-xs",".btn-lg",".btn-working",".icon-only"],tags:["interactive","action","cta","form"],category:"action"},{id:"fieldset",name:"Fieldset Group",description:"Form field grouping for radio/checkbox groups",selectors:["fieldset[role='group']","fieldset[role='radiogroup']","fieldset.buttons"],tags:["form","grouping","radio","checkbox"],category:"form"},{id:"label-field",name:"Label+Input",description:"Semantic label wrapping form input",selectors:["label","label:has(input)","label:has(select)","label:has(textarea)"],tags:["form","input","accessibility"],category:"form"},{id:"accordion",name:"Accordion",description:"Collapsible content sections",selectors:[".accordion",".accordion-item","details","details > summary"],tags:["expandable","collapsible","disclosure"],category:"disclosure"},{id:"icon",name:"Icon",description:"SVG icon element with size and color variants",selectors:["pds-icon",".icon-xs",".icon-sm",".icon-md",".icon-lg",".icon-xl",".icon-primary",".icon-secondary",".icon-accent",".icon-success",".icon-warning",".icon-danger",".icon-info",".icon-muted",".icon-subtle",".icon-text",".icon-text-start",".icon-text-end"],tags:["graphic","symbol","visual"],category:"media"},{id:"figure",name:"Figure/Media",description:"Figure element for images with captions",selectors:["figure","figure.media","figcaption"],tags:["image","media","caption"],category:"media"},{id:"gallery",name:"Gallery",description:"Image gallery grid",selectors:[".gallery",".gallery-grid",".img-gallery"],tags:["images","grid","collection"],category:"media"},{id:"form",name:"Form Container",description:"Form styling and layout",selectors:["form",".form-container",".form-actions",".field-description"],tags:["form","input","submission"],category:"form"},{id:"navigation",name:"Navigation",description:"Navigation elements and menus",selectors:["nav","nav[data-dropdown]","menu","nav menu li"],tags:["menu","links","routing"],category:"navigation"}],components:[{id:"pds-tabstrip",name:"Tab Strip",description:"Tabbed interface component",selectors:["pds-tabstrip"],tags:["tabs","navigation","panels"],category:"navigation"},{id:"pds-drawer",name:"Drawer",description:"Slide-out panel overlay",selectors:["pds-drawer"],tags:["panel","overlay","sidebar"],category:"overlay"},{id:"pds-fab",name:"FAB",description:"Floating Action Button with expandable satellite actions",selectors:["pds-fab"],tags:["button","action","floating","interactive"],category:"action"},{id:"pds-upload",name:"Upload",description:"File upload component with drag-and-drop",selectors:["pds-upload"],tags:["file","upload","drag-drop","form"],category:"form"},{id:"pds-icon",name:"Icon",description:"SVG icon web component",selectors:["pds-icon"],tags:["icon","graphic","svg"],category:"media"},{id:"pds-toaster",name:"Toaster",description:"Toast notification container",selectors:["pds-toaster"],tags:["notification","toast","feedback"],category:"feedback"},{id:"pds-form",name:"JSON Form",description:"Auto-generated form from JSON Schema",selectors:["pds-form"],tags:["form","schema","auto-generate"],category:"form"},{id:"pds-splitpanel",name:"Split Panel",description:"Resizable split pane layout",selectors:["pds-splitpanel"],tags:["layout","resize","panels"],category:"layout"},{id:"pds-scrollrow",name:"Scroll Row",description:"Horizontal scrolling row with snap points",selectors:["pds-scrollrow"],tags:["scroll","horizontal","carousel"],category:"layout"},{id:"pds-richtext",name:"Rich Text",description:"Rich text editor component",selectors:["pds-richtext"],tags:["editor","wysiwyg","text"],category:"form"},{id:"pds-calendar",name:"Calendar",description:"Date picker calendar component",selectors:["pds-calendar"],tags:["date","picker","calendar"],category:"form"}],layoutPatterns:[{id:"container",name:"Container",description:"Centered max-width wrapper with padding",selectors:[".container"],tags:["wrapper","centered","max-width","page"],category:"structure"},{id:"grid",name:"Grid",description:"CSS Grid layout container",selectors:[".grid"],tags:["layout","columns","css-grid"],category:"layout"},{id:"grid-cols",name:"Grid Columns",description:"Fixed column count grids",selectors:[".grid-cols-1",".grid-cols-2",".grid-cols-3",".grid-cols-4",".grid-cols-6"],tags:["columns","fixed","grid"],category:"layout"},{id:"grid-auto",name:"Auto-fit Grid",description:"Responsive auto-fit grid with minimum widths",selectors:[".grid-auto-sm",".grid-auto-md",".grid-auto-lg",".grid-auto-xl"],tags:["responsive","auto-fit","fluid"],category:"layout"},{id:"flex",name:"Flex Container",description:"Flexbox layout with direction and wrap modifiers",selectors:[".flex",".flex-wrap",".flex-col",".flex-row"],tags:["flexbox","layout","alignment"],category:"layout"},{id:"grow",name:"Flex Grow",description:"Fill remaining flex space",selectors:[".grow"],tags:["flex","expand","fill"],category:"layout"},{id:"stack",name:"Stack",description:"Vertical flex layout with predefined gaps",selectors:[".stack-sm",".stack-md",".stack-lg",".stack-xl"],tags:["vertical","spacing","column"],category:"layout"},{id:"gap",name:"Gap",description:"Spacing between flex/grid children",selectors:[".gap-0",".gap-xs",".gap-sm",".gap-md",".gap-lg",".gap-xl"],tags:["spacing","margin","gutters"],category:"spacing"},{id:"items",name:"Items Alignment",description:"Cross-axis alignment for flex/grid",selectors:[".items-start",".items-center",".items-end",".items-stretch",".items-baseline"],tags:["alignment","vertical","cross-axis"],category:"alignment"},{id:"justify",name:"Justify Content",description:"Main-axis alignment for flex/grid",selectors:[".justify-start",".justify-center",".justify-end",".justify-between",".justify-around",".justify-evenly"],tags:["alignment","horizontal","main-axis"],category:"alignment"},{id:"max-width",name:"Max-Width",description:"Content width constraints",selectors:[".max-w-sm",".max-w-md",".max-w-lg",".max-w-xl"],tags:["width","constraint","readable"],category:"sizing"},{id:"section",name:"Section Spacing",description:"Vertical padding for content sections",selectors:[".section",".section-lg"],tags:["spacing","vertical","padding"],category:"spacing"},{id:"mobile-stack",name:"Mobile Stack",description:"Stack on mobile, row on desktop",selectors:[".mobile-stack"],tags:["responsive","mobile","breakpoint"],category:"responsive"}],utilities:{text:{alignment:[".text-left",".text-center",".text-right"],color:[".text-muted"],overflow:[".truncate"]},backdrop:{base:[".backdrop"],variants:[".backdrop-light",".backdrop-dark"],blur:[".backdrop-blur-sm",".backdrop-blur-md",".backdrop-blur-lg"]},shadow:{scale:[".shadow-sm",".shadow-base",".shadow-md",".shadow-lg",".shadow-xl",".shadow-inner",".shadow-none"]},border:{gradient:[".border-gradient",".border-gradient-primary",".border-gradient-accent",".border-gradient-secondary",".border-gradient-soft",".border-gradient-medium",".border-gradient-strong"],glow:[".border-glow",".border-glow-sm",".border-glow-lg",".border-glow-primary",".border-glow-accent",".border-glow-success",".border-glow-warning",".border-glow-danger"],combined:[".border-gradient-glow"]},media:{image:[".img-gallery",".img-rounded-sm",".img-rounded-md",".img-rounded-lg",".img-rounded-xl",".img-rounded-full",".img-inline"],video:[".video-responsive"],figure:[".figure-responsive"]},effects:{glass:[".liquid-glass"]}},responsive:{prefixes:["sm","md","lg"],utilities:{grid:[":grid-cols-2",":grid-cols-3",":grid-cols-4"],flex:[":flex-row"],text:[":text-sm",":text-lg",":text-xl"],spacing:[":p-6",":p-8",":p-12",":gap-6",":gap-8",":gap-12"],width:[":w-1/2",":w-1/3",":w-1/4"],display:[":hidden",":block"]}},enhancements:[{id:"dropdown",selector:"nav[data-dropdown]",description:"Dropdown menu from nav element",tags:["menu","interactive","navigation"]},{id:"toggle",selector:"label[data-toggle]",description:"Toggle switch from checkbox",tags:["switch","boolean","form"]},{id:"range",selector:'input[type="range"]',description:"Enhanced range slider with output",tags:["slider","input","form"]},{id:"required",selector:"form [required]",description:"Required field asterisk indicator",tags:["validation","form","accessibility"]},{id:"open-group",selector:"fieldset[role=group][data-open]",description:"Editable checkbox/radio group",tags:["form","dynamic","editable"]},{id:"working-button",selector:"button.btn-working, a.btn-working",description:"Button with loading spinner",tags:["loading","async","feedback"]},{id:"labeled-divider",selector:"hr[data-content]",description:"Horizontal rule with centered label",tags:["divider","separator","text"]}],categories:{feedback:{description:"User feedback and status indicators",primitives:["callout","badge","empty-state"],components:["pds-toaster"]},form:{description:"Form inputs and controls",primitives:["button","fieldset","label-field","form"],components:["pds-upload","pds-form","pds-richtext","pds-calendar"]},layout:{description:"Page structure and content arrangement",patterns:["container","grid","flex","stack","section"],components:["pds-splitpanel","pds-scrollrow"]},navigation:{description:"Navigation and routing",primitives:["navigation"],components:["pds-tabstrip","pds-drawer"]},media:{description:"Images, icons, and visual content",primitives:["icon","figure","gallery"],components:["pds-icon"]},overlay:{description:"Modal and overlay content",primitives:["dialog"],components:["pds-drawer"]},data:{description:"Data display and tables",primitives:["table"]},theming:{description:"Colors, surfaces, and visual theming",primitives:["surface"]},action:{description:"Interactive actions and buttons",primitives:["button"],components:["pds-fab"]}},styles:{typography:["headings","body","code","links"],icons:{source:"svg",sets:["core","brand"]},interactive:["focus","hover","active","disabled"],states:["success","warning","danger","info","muted"]},searchRelations:{text:["typography","truncate","text-muted","text-primary","text-left","text-center","text-right","pds-richtext","heading","font","label","paragraph","content","ellipsis","overflow","input"],font:["typography","text","heading","font-size","font-weight","font-family"],type:["typography","text","font"],typography:["text","font","heading","truncate","text-muted"],heading:["typography","text","font-size","h1","h2","h3"],truncate:["text","overflow","ellipsis","clamp","nowrap","typography"],ellipsis:["truncate","text","overflow","clamp"],overflow:["truncate","scroll","hidden","text"],paragraph:["text","typography","content","body"],content:["text","typography","body","article"],empty:["empty-state","placeholder","zero","no-data","onboarding","callout","card","icon","button"],"empty state":["empty-state","empty","no-data","zero","onboarding"],"no data":["empty-state","empty","zero","placeholder"],form:["input","field","label","button","fieldset","pds-form","pds-upload","pds-richtext","pds-calendar","required","validation","submit"],input:["form","field","text","label","required","validation"],field:["form","input","label","required"],button:["btn","interactive","action","submit","form","btn-primary","btn-secondary","btn-working","pds-fab","floating"],btn:["button","interactive","action","pds-fab"],fab:["pds-fab","floating","button","action","menu"],floating:["fab","pds-fab","button","action"],toggle:["switch","checkbox","boolean","form","interactive"],switch:["toggle","checkbox","boolean"],slider:["range","input","form"],range:["slider","input","form"],checkbox:["toggle","form","fieldset","boolean"],radio:["fieldset","form","group"],select:["dropdown","form","input","menu"],upload:["file","pds-upload","form","drag-drop"],file:["upload","pds-upload","form"],modal:["dialog","pds-ask","overlay","popup","backdrop","pds-drawer","alert","confirm","prompt","lightbox"],dialog:["modal","pds-ask","overlay","popup","backdrop","alert","confirm","prompt"],popup:["modal","dialog","dropdown","popover","overlay","tooltip"],popover:["popup","tooltip","overlay"],overlay:["modal","dialog","backdrop","drawer","popup"],drawer:["pds-drawer","sidebar","panel","overlay","modal"],backdrop:["overlay","modal","dialog","blur"],confirm:["pds-ask","dialog","modal"],prompt:["pds-ask","dialog","modal","input"],ask:["pds-ask","dialog","confirm","prompt","modal"],dropdown:["menu","nav-dropdown","select","popover"],menu:["dropdown","navigation","nav","list"],nav:["navigation","menu","dropdown","tabs","links"],navigation:["nav","menu","tabs","pds-tabstrip","links","routing"],tabs:["pds-tabstrip","navigation","panels"],tab:["tabs","pds-tabstrip","panel"],link:["navigation","anchor","href","routing"],callout:["notification","feedback","message","status","toast","information","alert","warning","error","info","success","danger"],alert:["callout","notification","feedback","message","status","toast","modal","dialog","pds-ask","confirm","warning","error","info","success","danger"],notification:["callout","toast","pds-toaster","feedback","message","popup","alert"],toast:["pds-toaster","notification","callout","feedback","popup","snackbar","alert"],feedback:["callout","notification","toast","status","badge","validation","error","success","alert"],message:["callout","notification","feedback","dialog","toast","alert"],status:["badge","callout","indicator","feedback","state","alert"],error:["callout","danger","validation","feedback","warning","alert"],success:["callout","feedback","badge","status","check","alert"],warning:["callout","caution","feedback","status","alert"],info:["callout","information","feedback","status","alert"],danger:["callout","error","feedback","destructive","delete","alert"],badge:["status","pill","tag","chip","indicator","label"],pill:["badge","tag","chip"],tag:["badge","pill","chip","label"],chip:["badge","pill","tag"],layout:["grid","flex","stack","container","gap","spacing","pds-splitpanel","section"],grid:["layout","columns","css-grid","table","gallery"],flex:["layout","flexbox","alignment","row","column"],stack:["layout","vertical","spacing","column","gap"],container:["wrapper","layout","max-width","centered"],gap:["spacing","margin","padding","layout"],spacing:["gap","margin","padding","section"],section:["spacing","layout","container","page"],split:["pds-splitpanel","resizable","panels","layout"],panel:["pds-splitpanel","drawer","sidebar","section"],card:["surface","container","elevated","content"],surface:["card","background","elevated","theming","color"],box:["card","container","surface"],elevated:["surface","shadow","card"],color:["palette","theme","surface","primary","secondary","accent"],colours:["color","palette","theme"],palette:["color","theme","tokens"],theme:["color","palette","dark","light","surface"],primary:["color","button","badge","surface"],secondary:["color","button","badge","surface"],accent:["color","highlight","surface"],border:["border-gradient","border-glow","outline","radius"],effect:["border-gradient","border-glow","shadow","glass","animation"],gradient:["border-gradient","color","background"],glow:["border-glow","effect","shadow"],shadow:["elevated","effect","depth","card"],radius:["rounded","border","corner"],rounded:["radius","border","corner"],glass:["liquid-glass","backdrop","blur","effect"],icon:["pds-icon","graphic","symbol","svg","phosphor"],image:["img","figure","gallery","media","picture"],img:["image","figure","gallery","media"],figure:["image","media","caption"],gallery:["images","grid","collection","media"],media:["image","icon","figure","gallery","video"],table:["data","grid","tabular","rows","columns"],data:["table","json","form","display"],editor:["pds-richtext","wysiwyg","text","content"],wysiwyg:["editor","pds-richtext","richtext"],richtext:["pds-richtext","editor","wysiwyg","text"],calendar:["pds-calendar","date","picker","datepicker"],date:["calendar","pds-calendar","picker","input"],datepicker:["calendar","date","pds-calendar"],scroll:["pds-scrollrow","carousel","horizontal","overflow"],carousel:["scroll","pds-scrollrow","slider","gallery"],accordion:["details","collapsible","expandable","disclosure"],collapsible:["accordion","details","expandable"],expandable:["accordion","collapsible","disclosure"],details:["accordion","summary","disclosure"],divider:["hr","separator","line","rule"],separator:["divider","hr","line"],hr:["divider","separator","horizontal-rule"],interactive:["hover","focus","active","disabled","button","link"],hover:["interactive","effect","state"],focus:["interactive","accessibility","state","outline"],disabled:["interactive","state","muted"],loading:["btn-working","spinner","async","progress"],spinner:["loading","btn-working","progress"],accessibility:["a11y","aria","focus","label","required"],a11y:["accessibility","aria","semantic"],aria:["accessibility","a11y","role"],required:["form","validation","asterisk","input"],validation:["form","required","error","feedback"],start:["getting-started","intro","overview","whatispds"],intro:["getting-started","overview","start","docs"],getting:["getting-started","start","intro"],overview:["intro","start","summary","layout-overview"],docs:["documentation","reference","guide"],primitive:["primitives"],component:["components"],enhancement:["enhancements"],foundation:["foundations","color","icon","typography","spacing","tokens"],utility:["utilities","text","backdrop","shadow","border","helper"],pattern:["patterns","layout","responsive","mobile-stack"]}};var se=class r{static#i;static get instance(){return this.#i}#e;#r;constructor(e={}){this.options={debug:!1,...e},this.options.design||(this.options.design={}),this.options.debug&&this.options.log?.("debug","Generator options:",this.options),r.#i=this,this.tokens=this.generateTokens(),this.options.debug&&this.options.log?.("debug","Generated tokens:",this.tokens),this.#ve(),typeof CSSStyleSheet<"u"?this.#$e():this.options.debug&&this.options.log?.("debug","[Generator] Skipping browser features (CSSStyleSheet not available)")}generateTokens(){let e=this.options.design||{};return{colors:this.#n(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#D(e.shape||{}),borderWidths:this.#P(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#R(e.layers||{}),layout:this.#F(e.layout||{}),transitions:this.#I(e.behavior||{}),zIndex:this.#N(e.layers||{}),icons:this.#B(e.icons||{})}}#n(e){let{primary:t="#3b82f6",secondary:o="#64748b",accent:a="#ec4899",background:i="#ffffff",success:s=null,warning:n="#FFBF00",danger:l=null,info:d=null,darkMode:p={}}=e,c={primary:this.#o(t),secondary:this.#o(o),accent:this.#o(a),success:this.#o(s||this.#S(t)),warning:this.#o(n||a),danger:this.#o(l||this.#$(t)),info:this.#o(d||t),gray:this.#g(o),surface:this.#m(i)};return c.surface.fieldset=this.#C(c.surface),c.surfaceSmart=this.#w(c.surface),c.dark=this.#E(c,i,p),c.dark&&c.dark.surface&&(c.dark.surfaceSmart=this.#w(c.dark.surface)),c.interactive={light:{fill:this.#v(c.primary,4.5),text:c.primary[600]},dark:{fill:this.#v(c.dark.primary,4.5),text:this.#M(c.dark.primary,c.dark.surface.base,4.5)}},c}#o(e){let t=this.#s(e);return{50:this.#t(t.h,Math.max(t.s-10,10),Math.min(t.l+45,95)),100:this.#t(t.h,Math.max(t.s-5,15),Math.min(t.l+35,90)),200:this.#t(t.h,t.s,Math.min(t.l+25,85)),300:this.#t(t.h,t.s,Math.min(t.l+15,75)),400:this.#t(t.h,t.s,Math.min(t.l+5,65)),500:e,600:this.#t(t.h,t.s,Math.max(t.l-10,25)),700:this.#t(t.h,t.s,Math.max(t.l-20,20)),800:this.#t(t.h,t.s,Math.max(t.l-30,15)),900:this.#t(t.h,t.s,Math.max(t.l-40,10))}}#S(e){let t=this.#s(e);return this.#t(120,Math.max(t.s,60),45)}#$(e){let t=this.#s(e);return this.#t(0,Math.max(t.s,70),50)}#g(e){let t=this.#s(e),o=t.h,a=Math.min(t.s,10);return{50:this.#t(o,a,98),100:this.#t(o,a,95),200:this.#t(o,a,88),300:this.#t(o,a,78),400:this.#t(o,a,60),500:e,600:this.#t(o,Math.min(a+5,15),45),700:this.#t(o,Math.min(a+8,18),35),800:this.#t(o,Math.min(a+10,20),20),900:this.#t(o,Math.min(a+12,22),10)}}#m(e){let t=this.#s(e);return{base:e,subtle:this.#t(t.h,Math.max(t.s,2),Math.max(t.l-2,2)),elevated:this.#t(t.h,Math.max(t.s,3),Math.max(t.l-4,5)),sunken:this.#t(t.h,Math.max(t.s,4),Math.max(t.l-6,8)),overlay:this.#t(t.h,Math.max(t.s,2),Math.min(t.l+2,98)),inverse:this.#f(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#C(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#A(e.sunken,.05),overlay:e.elevated}}#A(e,t=.05){let o=this.#s(e),a=Math.max(o.l-o.l*t,5);return this.#t(o.h,o.s,a)}#f(e){let t=this.#s(e);if(t.l>50){let o=Math.min(t.s+5,25),a=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,o,a)}else{let o=Math.max(t.s-10,5),a=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,o,a)}}#E(e,t="#ffffff",o={}){let a=o.background?o.background:this.#f(t),i=this.#m(a),s=o.primary?this.#o(o.primary):this.#c(e.primary);return{surface:{...i,fieldset:this.#L(i)},primary:s,secondary:o.secondary?this.#o(o.secondary):this.#c(e.secondary),accent:o.accent?this.#o(o.accent):this.#c(e.accent),gray:o.secondary?this.#g(o.secondary):e.gray,success:this.#c(e.success),info:this.#c(e.info),warning:this.#c(e.warning),danger:this.#c(e.danger)}}#p(e){let t=String(e||"").replace("#",""),o=t.length===3?t.split("").map(i=>i+i).join(""):t,a=parseInt(o,16);return{r:a>>16&255,g:a>>8&255,b:a&255}}#h(e){let{r:t,g:o,b:a}=this.#p(e),i=[t/255,o/255,a/255].map(s=>s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}#u(e,t){let o=this.#h(e),a=this.#h(t),i=Math.max(o,a),s=Math.min(o,a);return(i+.05)/(s+.05)}#b(e,t=4.5){if(!e)return"#000000";let o="#ffffff",a="#000000",i=this.#u(e,o);if(i>=t)return o;let s=this.#u(e,a);return s>=t||s>i?a:o}#y(e,t=1){let{r:o,g:a,b:i}=this.#p(e);return`rgba(${o}, ${a}, ${i}, ${t})`}#T(e,t,o=.5){let a=this.#p(e),i=this.#p(t),s=Math.round(a.r+(i.r-a.r)*o),n=Math.round(a.g+(i.g-a.g)*o),l=Math.round(a.b+(i.b-a.b)*o);return this.#z(s,n,l)}#z(e,t,o){let a=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${a(e)}${a(t)}${a(o)}`}#L(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#x(e.elevated,.08),sunken:e.elevated,overlay:this.#x(e.overlay,.05)}}#M(e={},t="#000000",o=4.5){let a=["600","700","800","500","400","900","300","200"],i={shade:null,color:null,ratio:0};for(let s of a){let n=e?.[s];if(!n||typeof n!="string")continue;let l=this.#u(n,t);if(l>i.ratio&&(i={shade:s,color:n,ratio:l}),l>=o)return n}return i.color||e?.["600"]||e?.["500"]}#v(e={},t=4.5){let o=["600","700","800","500","400","900"],a={shade:null,color:null,ratio:0};for(let i of o){let s=e?.[i];if(!s||typeof s!="string")continue;let n=this.#u(s,"#ffffff");if(n>a.ratio&&(a={shade:i,color:s,ratio:n}),n>=t)return s}return a.color||e?.["600"]||e?.["500"]}#w(e){let t={};return Object.entries(e).forEach(([o,a])=>{if(!a||typeof a!="string"||!a.startsWith("#"))return;let i=this.#h(a)<.5,s=this.#b(a,4.5),n=this.#b(a,3),l=this.#T(s,a,.4),d=s,p=l,c=i?"#ffffff":"#000000",u=i?.25:.1,g=this.#y(c,u),b=i?"#ffffff":"#000000",y=i?.15:.1,f=this.#y(b,y);t[o]={bg:a,text:s,textSecondary:n,textMuted:l,icon:d,iconSubtle:p,shadow:g,border:f,scheme:i?"dark":"light"}}),t}#x(e,t=.05){let o=this.#s(e),a=Math.min(o.l+(100-o.l)*t,95);return this.#t(o.h,o.s,a)}#c(e){let t={};return Object.entries({50:{source:"900",dimFactor:.8},100:{source:"800",dimFactor:.8},200:{source:"700",dimFactor:.8},300:{source:"600",dimFactor:.8},400:{source:"500",dimFactor:.85},500:{source:"400",dimFactor:.85},600:{source:"300",dimFactor:.85},700:{source:"200",dimFactor:.85},800:{source:"100",dimFactor:.95},900:{source:"50",dimFactor:.95}}).forEach(([a,i])=>{let s=e[i.source];t[a]=this.#_(s,i.dimFactor)}),t}#_(e,t=.8){let o=this.#s(e),a=Math.max(o.s*t,5),i=Math.max(o.l*t,5);return this.#t(o.h,a,i)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:o=1.25,maxSpacingSteps:a=12}=e,i=Number.isFinite(Number(t))?Number(t):4,s=Math.min(Number.isFinite(Number(a))?Number(a):12,12),n={0:"0"};for(let l=1;l<=s;l++)n[l]=`${i*l}px`;return n}#D(e){let{radiusSize:t="medium",customRadius:o=null}=e,a;o!=null?a=o:typeof t=="number"?a=t:typeof t=="string"?a=h.RadiusSizes[t]??h.RadiusSizes.medium:a=h.RadiusSizes.medium;let i=Number.isFinite(Number(a))?Number(a):h.RadiusSizes.medium;return{none:"0",xs:`${Number.isFinite(i*.25)?Math.round(i*.25):0}px`,sm:`${Number.isFinite(i*.5)?Math.round(i*.5):0}px`,md:`${i}px`,lg:`${Number.isFinite(i*1.5)?Math.round(i*1.5):0}px`,xl:`${Number.isFinite(i*2)?Math.round(i*2):0}px`,full:"9999px"}}#P(e){let{borderWidth:t="medium"}=e,o;return typeof t=="number"?o=t:typeof t=="string"?o=h.BorderWidths[t]??h.BorderWidths.medium:o=h.BorderWidths.medium,{hairline:`${h.BorderWidths.hairline}px`,thin:`${h.BorderWidths.thin}px`,medium:`${h.BorderWidths.medium}px`,thick:`${h.BorderWidths.thick}px`}}generateTypographyTokens(e){let{fontFamilyHeadings:t="system-ui, -apple-system, sans-serif",fontFamilyBody:o="system-ui, -apple-system, sans-serif",fontFamilyMono:a='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:i=16,fontScale:s=1.25,fontWeightLight:n=h.FontWeights.light,fontWeightNormal:l=h.FontWeights.normal,fontWeightMedium:d=h.FontWeights.medium,fontWeightSemibold:p=h.FontWeights.semibold,fontWeightBold:c=h.FontWeights.bold,lineHeightTight:u=h.LineHeights.tight,lineHeightNormal:g=h.LineHeights.normal,lineHeightRelaxed:b=h.LineHeights.relaxed}=e,y=Number.isFinite(Number(i))?Number(i):16,f=Number.isFinite(Number(s))?Number(s):1.25;return{fontFamily:{headings:t,body:o,mono:a},fontSize:{xs:`${Math.round(y/Math.pow(f,2))}px`,sm:`${Math.round(y/f)}px`,base:`${y}px`,lg:`${Math.round(y*f)}px`,xl:`${Math.round(y*Math.pow(f,2))}px`,"2xl":`${Math.round(y*Math.pow(f,3))}px`,"3xl":`${Math.round(y*Math.pow(f,4))}px`,"4xl":`${Math.round(y*Math.pow(f,5))}px`},fontWeight:{light:n?.toString()||"300",normal:l?.toString()||"400",medium:d?.toString()||"500",semibold:p?.toString()||"600",bold:c?.toString()||"700"},lineHeight:{tight:u?.toString()||"1.25",normal:g?.toString()||"1.5",relaxed:b?.toString()||"1.75"}}}#R(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:o=1,shadowOffsetMultiplier:a=1}=e,i=`rgba(0, 0, 0, ${t})`,s=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*a}px ${2*o}px 0 ${s}`,base:`0 ${1*a}px ${3*o}px 0 ${i}, 0 ${1*a}px ${2*o}px 0 ${s}`,md:`0 ${4*a}px ${6*o}px ${-1*a}px ${i}, 0 ${2*a}px ${4*o}px ${-1*a}px ${s}`,lg:`0 ${10*a}px ${15*o}px ${-3*a}px ${i}, 0 ${4*a}px ${6*o}px ${-2*a}px ${s}`,xl:`0 ${20*a}px ${25*o}px ${-5*a}px ${i}, 0 ${10*a}px ${10*o}px ${-5*a}px ${s}`,inner:`inset 0 ${2*a}px ${4*o}px 0 ${s}`}}#F(e){let{maxWidth:t=1200,containerPadding:o=16,breakpoints:a={sm:640,md:768,lg:1024,xl:1280}}=e,i=this.#k(e);return{maxWidth:this.#a(t,"1200px"),maxWidthSm:i.sm,maxWidthMd:i.md,maxWidthLg:i.lg,maxWidthXl:i.xl,minHeight:"100vh",containerPadding:this.#a(o,"16px"),breakpoints:{sm:this.#a(a.sm,"640px"),md:this.#a(a.md,"768px"),lg:this.#a(a.lg,"1024px"),xl:this.#a(a.xl,"1280px")},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#k(e={}){let t={sm:640,md:768,lg:1024,xl:1280},{maxWidths:o={},maxWidth:a=1200,containerPadding:i=16,breakpoints:s=t}=e||{},n=this.#l(i,16),l=this.#l(a,t.xl),d={sm:this.#l(s.sm,t.sm),md:this.#l(s.md,t.md),lg:this.#l(s.lg,t.lg),xl:this.#l(s.xl,t.xl)},p=u=>u?Math.max(320,u-n*2):l,c={sm:Math.min(l,p(d.sm)),md:Math.min(l,p(d.md)),lg:Math.min(l,p(d.lg)),xl:Math.max(320,l)};return{sm:this.#a(o.sm,`${c.sm}px`),md:this.#a(o.md,`${c.md}px`),lg:this.#a(o.lg,`${c.lg}px`),xl:this.#a(o.xl,`${c.xl}px`)}}#a(e,t){return typeof e=="number"&&Number.isFinite(e)?`${e}px`:typeof e=="string"&&e.trim().length>0?e:t}#l(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let o=parseFloat(e);if(Number.isFinite(o))return o}return t}#I(e){let{transitionSpeed:t=h.TransitionSpeeds.normal,animationEasing:o=h.AnimationEasings["ease-out"]}=e,a;return typeof t=="number"?a=t:typeof t=="string"&&h.TransitionSpeeds[t]?a=h.TransitionSpeeds[t]:a=h.TransitionSpeeds.normal,{fast:`${Math.round(a*.6)}ms`,normal:`${a}ms`,slow:`${Math.round(a*1.4)}ms`}}#N(e){let{baseZIndex:t=1e3,zIndexStep:o=10}=e;return{dropdown:t.toString(),sticky:(t+o*2).toString(),fixed:(t+o*3).toString(),modal:(t+o*4).toString(),drawer:(t+o*5).toString(),popover:(t+o*6).toString(),tooltip:(t+o*7).toString(),notification:(t+o*8).toString()}}#B(e){let{set:t="phosphor",weight:o="regular",defaultSize:a=24,sizes:i={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:s="/assets/pds/icons/pds-icons.svg",externalPath:n="/assets/img/icons/"}=e;return{set:t,weight:o,defaultSize:`${a}px`,sizes:Object.fromEntries(Object.entries(i).map(([l,d])=>[l,`${d}px`])),spritePath:s,externalPath:n}}#O(e){let t=[];t.push(` /* Colors */
|
|
31
|
+
`;let n=a.querySelector("#msg-container");Qe(n,r)}a.addEventListener("click",n=>{n.target.closest('button[value="cancel"]')&&(a.close(),o(!1))});let s=()=>{let n=a.querySelector("form");n?n.addEventListener("submit",l=>{l.preventDefault();let d;e.useForm&&l.submitter.value==="ok"?(console.log("Found form:",n),console.log("Form elements:",n?Array.from(n.elements):"no form"),d=new FormData(n),console.log("FormData entries:",Array.from(d.entries()))):d=l.submitter.value==="ok",a.close(),o(d)}):requestAnimationFrame(s)};s(),a.addEventListener("close",()=>{setTimeout(()=>a.remove(),200)}),document.body.appendChild(a),typeof e.rendered=="function"&&e.rendered(a),a.showModal()})}async function zr(){let r=document.querySelector("pds-toaster");return r||(r=document.createElement("pds-toaster"),document.body.appendChild(r),await customElements.whenDefined("pds-toaster")),r}async function P(r,e={}){return(await zr()).toast(r,e)}P.success=async function(r,e={}){return P(r,{...e,type:"success"})};P.error=async function(r,e={}){return P(r,{...e,type:"error"})};P.warning=async function(r,e={}){return P(r,{...e,type:"warning"})};P.info=async function(r,e={}){return P(r,{...e,type:"information"})};var Lr=[{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 Mr(r){r.dataset.enhancedAccordion||(r.dataset.enhancedAccordion="true",r.addEventListener("toggle",e=>{e.target.open&&e.target.parentElement===r&&r.querySelectorAll(":scope > details[open]").forEach(t=>{t!==e.target&&(t.open=!1)})},!0))}function _r(r){if(r.dataset.enhancedDropdown)return;r.dataset.enhancedDropdown="true";let e=r.lastElementChild;if(!e)return;let t=r.querySelector("[data-dropdown-toggle]")||r.querySelector("button");t&&!t.hasAttribute("type")&&t.setAttribute("type","button"),e.id||(e.id=`dropdown-${Math.random().toString(36).slice(2,9)}`),e.tagName?.toLowerCase()==="menu"&&!e.hasAttribute("role")&&e.setAttribute("role","menu"),e.hasAttribute("aria-hidden")||e.setAttribute("aria-hidden","true"),t&&(t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"));let a=()=>{let l=(r.getAttribute("data-mode")||"auto").toLowerCase();if(l==="up"||l==="down")return l;let d=r.getBoundingClientRect(),p=Math.max(0,window.innerHeight-d.bottom);return Math.max(0,d.top)>p?"up":"down"},i=()=>{r.dataset.dropdownDirection=a(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},s=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},n=()=>{e.getAttribute("aria-hidden")==="false"?s():i()};t?.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),n()}),document.addEventListener("click",l=>{r.contains(l.target)||s()}),r.addEventListener("keydown",l=>{l.key==="Escape"&&(s(),t?.focus())}),r.addEventListener("focusout",l=>{(!l.relatedTarget||!r.contains(l.relatedTarget))&&s()})}function Dr(r){if(r.dataset.enhancedToggle)return;r.dataset.enhancedToggle="true";let e=r.querySelector('input[type="checkbox"]');if(!e)return;r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.setAttribute("role","switch"),r.setAttribute("aria-checked",e.checked?"true":"false");let t=document.createElement("span");t.className="toggle-switch",t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");let o=document.createElement("span");o.className="toggle-knob",t.appendChild(o),r.insertBefore(t,e.nextSibling);let a=()=>{r.setAttribute("aria-checked",e.checked?"true":"false")},i=()=>{e.disabled||(e.checked=!e.checked,a(),e.dispatchEvent(new Event("change",{bubbles:!0})))};r.addEventListener("click",s=>{s.preventDefault(),i()}),r.addEventListener("keydown",s=>{(s.key===" "||s.key==="Enter")&&(s.preventDefault(),i())}),e.addEventListener("change",a)}function Pr(r){if(r.dataset.enhancedRange)return;let e=r.closest("label"),t=e?.classList.contains("range-output"),o=r.id||`range-${Math.random().toString(36).substring(2,11)}`,a=`${o}-output`;if(r.id=o,t){let i=e.querySelector("span");if(i&&!i.classList.contains("range-output-wrapper")){let s=document.createElement("span");s.className="range-output-wrapper",s.style.display="flex",s.style.justifyContent="space-between",s.style.alignItems="center";let n=document.createElement("span");n.textContent=i.textContent,s.appendChild(n);let l=document.createElement("output");l.id=a,l.setAttribute("for",o),l.style.color="var(--surface-text-secondary, var(--color-text-secondary))",l.style.fontSize="0.875rem",l.textContent=r.value,s.appendChild(l),i.textContent="",i.appendChild(s);let d=()=>{l.textContent=r.value};r.addEventListener("input",d)}}else{let i=r.closest(".range-container");i||(i=document.createElement("div"),i.className="range-container",r.parentNode?.insertBefore(i,r),i.appendChild(r)),i.style.position="relative";let s=document.createElement("output");s.id=a,s.setAttribute("for",o),s.className="range-bubble",s.setAttribute("aria-live","polite"),i.appendChild(s);let n=()=>{let p=parseFloat(r.min)||0,c=parseFloat(r.max)||100,u=parseFloat(r.value),g=(u-p)/(c-p);s.style.left=`calc(${g*100}% )`,s.textContent=String(u)},l=()=>s.classList.add("visible"),d=()=>s.classList.remove("visible");r.addEventListener("input",n),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",d),r.addEventListener("pointerleave",d),r.addEventListener("focus",l),r.addEventListener("blur",d),n()}r.dataset.enhancedRange="1"}function Rr(r){if(r.dataset.enhancedRequired)return;r.dataset.enhancedRequired="true";let e=t=>{let o=t.closest("label");if(!o||o.querySelector(".required-asterisk"))return;let a=document.createElement("span");a.classList.add("required-asterisk"),a.textContent="*",a.style.marginLeft="4px",o.querySelector("span").appendChild(a);let i=t.closest("form");if(i&&!i.querySelector(".required-legend")){let s=document.createElement("small");s.classList.add("required-legend"),s.textContent="* Required fields",i.insertBefore(s,i.querySelector(".form-actions")||i.lastElementChild)}};r.querySelectorAll("[required]").forEach(t=>{e(t)})}function Fr(r){if(r.dataset.enhancedOpenGroup)return;r.dataset.enhancedOpenGroup="true",r.classList.add("flex","flex-wrap","buttons");let e=document.createElement("input");e.type="text",e.placeholder="Add item...",e.classList.add("input-text","input-sm"),e.style.width="auto";let t=r.querySelector('input[type="radio"], input[type="checkbox"]');r.appendChild(e),e.addEventListener("keydown",o=>{if(o.key==="Enter"||o.key==="Tab"){let a=e.value.trim();if(a){o.preventDefault();let i=t.type==="radio"?"radio":"checkbox",s=`open-group-${Math.random().toString(36).substring(2,11)}`,n=document.createElement("label"),l=document.createElement("span");l.setAttribute("data-label",""),l.textContent=a;let d=document.createElement("input");d.type=i,d.name=t.name||r.getAttribute("data-name")||"open-group",d.value=a,d.id=s,n.appendChild(l),n.appendChild(d),r.insertBefore(n,e),e.value=""}}else if(o.key==="Backspace"&&e.value===""){o.preventDefault();let a=r.querySelectorAll("label");a.length>0&&a[a.length-1].remove()}})}function Ir(r){if(r.dataset.enhancedClip)return;r.dataset.enhancedClip="true",r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.hasAttribute("role")||r.setAttribute("role","button");let e=()=>{let o=r.getAttribute("data-clip-open")==="true";r.setAttribute("aria-expanded",o?"true":"false")},t=()=>{let o=r.getAttribute("data-clip-open")==="true";r.setAttribute("data-clip-open",o?"false":"true"),e()};r.addEventListener("click",o=>{o.defaultPrevented||t()}),r.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),t())}),e()}function Nr(r){if(r.dataset.enhancedBtnWorking)return;r.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(a=>{a.forEach(i=>{if(i.attributeName==="class"){let s=r.classList.contains("btn-working"),n=r.querySelector("pds-icon");if(s)if(n)e||(e=n.getAttribute("icon")),n.setAttribute("icon","circle-notch");else{let l=document.createElement("pds-icon");l.setAttribute("icon","circle-notch"),l.setAttribute("size","sm"),r.insertBefore(l,r.firstChild),t=!0}else i.oldValue?.includes("btn-working")&&n&&(t?(n.remove(),t=!1):e&&(n.setAttribute("icon",e),e=null))}})}).observe(r,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Br=new Map([[".accordion",Mr],["nav[data-dropdown]",_r],["label[data-toggle]",Dr],['input[type="range"]',Pr],["form[data-required]",Rr],["fieldset[role=group][data-open]",Fr],["[data-clip]",Ir],["button, a[class*='btn-']",Nr]]),Xe=Lr.map(r=>({...r,run:Br.get(r.selector)||(()=>{})}));var _t="pds",Or=/^([a-z][a-z0-9+\-.]*:)?\/\//i,Mt=/^[a-z]:/i;function le(r=""){return r.endsWith("/")?r:`${r}/`}function jr(r="",e=_t){let t=r.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function Hr(r){return r.replace(/^\.\/+/,"")}function Wr(r){return Mt.test(r)?r.replace(Mt,"").replace(/^\/+/,""):r}function Ur(r){return r.startsWith("public/")?r.substring(7):r}function et(r,e={}){let t=e.segment||_t,o=e.defaultRoot||`/assets/${t}/`,a=r?.public&&r.public?.root||r?.static&&r.static?.root||null;if(!a||typeof a!="string")return le(o);let i=a.trim();return i?(i=i.replace(/\\/g,"/"),i=jr(i,t),i=le(i),Or.test(i)?i:(i=Hr(i),i=Wr(i),i.startsWith("/")||(i=Ur(i),i.startsWith("/")||(i=`/${i}`),i=i.replace(/\/+/g,(s,n)=>n===0?s:"/")),le(i))):le(o)}var Gr=/^[a-z][a-z0-9+\-.]*:\/\//i,de=(()=>{try{return import.meta.url}catch{return}})(),ke=r=>typeof r=="string"&&r.length&&!r.endsWith("/")?`${r}/`:r;function Se(r,e={}){if(!r||Gr.test(r))return r;let{preferModule:t=!0}=e,o=()=>{if(!de)return null;try{return new URL(r,de).href}catch{return null}},a=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(r,window.location.origin).href}catch{return null}};return(t?o()||a():a()||o())||r}var Rt=(()=>{if(de)try{let r=new URL(de);if(/\/public\/assets\/js\//.test(r.pathname))return new URL("../pds/",de).href}catch{return}})(),Ft=!1;function It(r){Ft||typeof document>"u"||(Ft=!0,r.addEventListener("pds:ready",e=>{let t=e.detail?.mode;t&&document.documentElement.classList.add(`pds-${t}`,"pds-ready")}))}function ot(r={},e={}){if(!e||typeof e!="object")return r;let t=Array.isArray(r)?[...r]:{...r};for(let[o,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?t[o]=ot(t[o]&&typeof t[o]=="object"?t[o]:{},a):t[o]=a;return t}function rt(r=""){return String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function W(r){if(r==null)return r;if(typeof r=="function")return;if(typeof r!="object")return r;if(Array.isArray(r))return r.map(t=>W(t)).filter(t=>t!==void 0);let e={};for(let t in r)if(r.hasOwnProperty(t)){let o=r[t];if(typeof o!="function"){let a=W(o);a!==void 0&&(e[t]=a)}}return e}function Nt(r={},e={},{presets:t,defaultLog:o}){let a=typeof r=="object"&&("colors"in r||"typography"in r||"spatialRhythm"in r||"shape"in r||"behavior"in r||"layout"in r||"advanced"in r||"a11y"in r||"components"in r||"icons"in r),i=r&&r.enhancers;i&&!Array.isArray(i)&&(i=Object.values(i));let s=i??e.enhancers??[],n=r&&r.preset,l=r&&r.design,d=r&&r.icons&&typeof r.icons=="object"?r.icons:null,p="preset"in(r||{})||"design"in(r||{})||"enhancers"in(r||{}),c,u=null;if(p){let g=String(n||"default").toLowerCase(),b=t?.[g]||Object.values(t||{}).find(v=>rt(v.name)===g||String(v.name||"").toLowerCase()===g);if(!b)throw new Error(`PDS preset not found: "${n||"default"}"`);u={id:b.id||rt(b.name),name:b.name||b.id||String(g)};let y=structuredClone(b);if(l&&typeof l=="object"||d){let v=l?W(l):{},x=d?W(d):null,w=x?ot(v,{icons:x}):v;y=ot(y,structuredClone(w))}let{mode:f,autoDefine:$,applyGlobalStyles:Q,manageTheme:z,themeStorageKey:O,preloadStyles:D,criticalLayers:ne,managerURL:X,manager:ve,preset:L,design:j,enhancers:ce,log:E,...ee}=r;c={...ee,design:y,preset:u.name,log:E||o}}else if(a){let{log:g,...b}=r;c={design:structuredClone(b),log:g||o}}else{let g=t?.default||Object.values(t||{}).find(b=>rt(b.name)==="default");if(!g)throw new Error("PDS default preset not available");u={id:g.id||"default",name:g.name||"Default"},c={design:structuredClone(g),preset:u.name,log:o}}return{generatorConfig:c,enhancers:s,presetInfo:u}}function Bt({manageTheme:r,themeStorageKey:e,applyResolvedTheme:t,setupSystemListenerIfNeeded:o}){let a="light",i=null;if(r&&typeof window<"u"){try{i=localStorage.getItem(e)||null}catch{i=null}try{t?.(i),o?.(i)}catch{}i?i==="system"?a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a=i:a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:a,storedTheme:i}}function at(r,{resolvePublicAssetURL:e}){let t=!!(r?.public?.root||r?.static?.root),o=e(r);return!t&&Rt&&(o=Rt),ke(Se(o))}async function Ot(r,{baseEnhancers:e=[]}={}){let{autoDefineBaseURL:t="/auto-define/",autoDefinePreload:o=[],autoDefineMapper:a=null,enhancers:i=[],autoDefineOverrides:s=null,autoDefinePreferModule:n=!0}=r,l=(()=>{let p=new Map;return(e||[]).forEach(c=>p.set(c.selector,c)),(i||[]).forEach(c=>p.set(c.selector,c)),Array.from(p.values())})(),d=null;if(typeof window<"u"&&typeof document<"u"){let p=null;try{let f=await Promise.resolve().then(()=>(Pt(),Dt));p=f?.AutoDefiner||f?.default?.AutoDefiner||f?.default||null}catch(f){console.warn("AutoDefiner not available:",f?.message||f)}let c=f=>{switch(f){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${f}.js`}},{mapper:u,...g}=s&&typeof s=="object"?s:{},y={baseURL:t&&ke(Se(t,{preferModule:n})),predefine:o,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:l,onError:(f,$)=>{if(typeof f=="string"&&f.startsWith("pds-")){let z=["pds-form","pds-drawer"].includes(f),O=$?.message?.includes("#pds/lit")||$?.message?.includes("Failed to resolve module specifier");z&&O?console.error(`\u274C PDS component <${f}> 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 <${f}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${f}>:`,$)},...g,mapper:f=>{if(customElements.get(f))return null;if(typeof a=="function")try{let $=a(f);return $===void 0?c(f):$}catch($){return console.warn("Custom autoDefine.mapper error; falling back to default:",$?.message||$),c(f)}return c(f)}};p&&(d=new p(y),o.length>0&&typeof p.define=="function"&&await p.define(...o,{baseURL:t,mapper:y.mapper,onError:y.onError}))}return{autoDefiner:d,mergedEnhancers:l}}var nt=class extends EventTarget{},m=new nt;m.initializing=!1;m.currentPreset=null;m.debug=!1;var Vt=(r="")=>String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Ae=function(r="log",e,...t){let o=!!(m.registry&&!m.registry.isLive),a=(this?.debug||this?.design?.debug||m.debug||!1)===!0;if(o){if(!m.debug)return}else if(!a&&r!=="error"&&r!=="warn")return;let i=console[r]||console.log;t.length>0?i(e,...t):i(e)};async function Vr(r,e={}){if(e?.runtimeConfig===!1||typeof fetch!="function")return null;let t=e?.runtimeConfigURL||`${r}pds-runtime-config.json`;try{let o=await fetch(t,{cache:"no-store"});return o.ok?await o.json():null}catch{return null}}m.registry=re;m.enums=h;m.adoptLayers=Tt;m.adoptPrimitives=Et;m.createStylesheet=zt;m.isLiveMode=()=>re.isLive;m.ask=Lt;m.toast=P;m.common=Ze;m.AutoComplete=null;m.loadAutoComplete=async()=>{if(m.AutoComplete)return m.AutoComplete;try{let r=await Promise.resolve().then(()=>(Ce(),Gt)),e=r?.AutoComplete||r?.default||r;if(e)return m.AutoComplete=e,e}catch(r){Ae("warn","PDS.loadAutoComplete failed",r)}return null};function Jt(r){let e=typeof CustomEvent=="function";try{let t=e?new CustomEvent("pds:ready",{detail:r}):new Event("pds:ready");m.dispatchEvent(t)}catch{}if(typeof document<"u")if(e){let t={detail:r,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",t))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",t))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}typeof window<"u"&&(window.PDS=m);var st="pure-ds-theme",q=null,pe=null;function Ee(r){try{if(typeof document>"u")return;let e="light";r?r==="system"?e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e=r:e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e)}catch{}}function Te(r){try{if(q&&pe){try{typeof q.removeEventListener=="function"?q.removeEventListener("change",pe):typeof q.removeListener=="function"&&q.removeListener(pe)}catch{}q=null,pe=null}if(r==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=o=>{let a=o?.matches===void 0?e.matches:o.matches;try{let i=a?"dark":"light";document.documentElement.setAttribute("data-theme",i),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:i,source:"system"}}))}catch{}};q=e,pe=t,typeof e.addEventListener=="function"?e.addEventListener("change",t):typeof e.addListener=="function"&&e.addListener(t)}}catch{}}Object.defineProperty(m,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(st)||null}catch{return null}},set(r){try{if(typeof window>"u")return;r==null?localStorage.removeItem(st):localStorage.setItem(st,r),Ee(r),Te(r),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"api"}}))}catch{}}});m.defaultEnhancers=Xe;async function Jr(r){let e=r&&r.mode||"live",{mode:t,...o}=r||{};if(e==="static")return Kr(o);let a=at(o,{resolvePublicAssetURL:et}),i=o?.managerURL||o?.public?.managerURL||o?.manager?.url||new URL("core/pds-manager.js",a).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:s}=await import(i);return s(m,o,{emitReady:Jt,applyResolvedTheme:Ee,setupSystemListenerIfNeeded:Te})}m.start=Jr;async function Kr(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,o=r.themeStorageKey??"pure-ds-theme",a=r.staticPaths??{},i=at(r,{resolvePublicAssetURL:et}),s=r&&r.autoDefine||null,n;s&&s.baseURL?n=ke(Se(s.baseURL,{preferModule:!1})):n=`${i}components/`;let l=s&&Array.isArray(s.predefine)&&s.predefine||[],d=s&&typeof s.mapper=="function"&&s.mapper||null;try{It(m);let{resolvedTheme:p}=Bt({manageTheme:t,themeStorageKey:o,applyResolvedTheme:Ee,setupSystemListenerIfNeeded:Te}),c=await Vr(i,r),u=c?.config?.design||c?.design||null,g=c?.config?.preset||c?.preset||"default",b=c?.presetId||Vt(g)||"default",y=u?{[String(b).toLowerCase()]:u,...String(b).toLowerCase()!=="default"?{default:u}:{}}:null,f=r?.design&&typeof r.design=="object"?W(r.design):null,$=Vt(r?.preset||"default")||"default",Q=f?{[String($).toLowerCase()]:f,...String($).toLowerCase()!=="default"?{default:f}:{}}:null,z=y||r?.presets||Q||{};if(!Object.keys(z||{}).length)throw new Error("PDS static mode requires preset data. Run pds:build or provide config.presets/config.design.");let O=c?.config?{...c.config,...r,preset:r?.preset||b,design:f||u||c?.config?.design}:r,D=Nt(O,{},{presets:z,defaultLog:Ae}),ne=D.enhancers,X={tokens:`${i}styles/pds-tokens.css.js`,primitives:`${i}styles/pds-primitives.css.js`,components:`${i}styles/pds-components.css.js`,utilities:`${i}styles/pds-utilities.css.js`,styles:`${i}styles/pds-styles.css.js`},ve=c?.paths||{};if(a={...X,...ve,...a},m.registry.setStaticMode(a),e&&typeof document<"u")try{let E=await m.registry.getStylesheet("styles");if(E){E._pds=!0;let ee=(document.adoptedStyleSheets||[]).filter(v=>v._pds!==!0);document.adoptedStyleSheets=[...ee,E]}}catch(E){Ae.call(m,"warn","Failed to apply static styles:",E)}let L=null,j=[];try{let E=await Ot({autoDefineBaseURL:n,autoDefinePreload:l,autoDefineMapper:d,enhancers:ne,autoDefineOverrides:s||null,autoDefinePreferModule:!(s&&s.baseURL)},{baseEnhancers:Xe});L=E.autoDefiner,j=E.mergedEnhancers||[]}catch(E){Ae.call(m,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",E)}let ce=W(r);return m.currentConfig=Object.freeze({mode:"static",...structuredClone(ce),design:structuredClone(D.generatorConfig.design),preset:D.generatorConfig.preset,theme:p,enhancers:j}),Jt({mode:"static",config:D.generatorConfig,theme:p,autoDefiner:L}),{config:D.generatorConfig,theme:p,autoDefiner:L}}catch(p){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:p}})),p}}var ct=Ee,lt=Te;var ze=globalThis,Me=ze.ShadowRoot&&(ze.ShadyCSS===void 0||ze.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yt=Symbol(),Kt=new WeakMap,Le=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==Yt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Me&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=Kt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&Kt.set(t,e))}return e}toString(){return this.cssText}},Zt=r=>new Le(typeof r=="string"?r:r+"",void 0,Yt);var Qt=(r,e)=>{if(Me)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),a=ze.litNonce;a!==void 0&&o.setAttribute("nonce",a),o.textContent=t.cssText,r.appendChild(o)}},dt=Me?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return Zt(t)})(r):r;var{is:Zr,defineProperty:Qr,getOwnPropertyDescriptor:Xr,getOwnPropertyNames:eo,getOwnPropertySymbols:to,getPrototypeOf:ro}=Object,_e=globalThis,Xt=_e.trustedTypes,oo=Xt?Xt.emptyScript:"",ao=_e.reactiveElementPolyfillSupport,ue=(r,e)=>r,pt={toAttribute(r,e){switch(e){case Boolean:r=r?oo:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},tr=(r,e)=>!Zr(r,e),er={attribute:!0,type:String,converter:pt,reflect:!1,useDefault:!1,hasChanged:tr};Symbol.metadata??=Symbol("metadata"),_e.litPropertyMetadata??=new WeakMap;var R=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=er){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),a=this.getPropertyDescriptor(e,o,t);a!==void 0&&Qr(this.prototype,e,a)}}static getPropertyDescriptor(e,t,o){let{get:a,set:i}=Xr(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:a,set(s){let n=a?.call(this);i?.call(this,s),this.requestUpdate(e,n,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??er}static _$Ei(){if(this.hasOwnProperty(ue("elementProperties")))return;let e=ro(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ue("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ue("properties"))){let t=this.properties,o=[...eo(t),...to(t)];for(let a of o)this.createProperty(a,t[a])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,a]of t)this.elementProperties.set(o,a)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let a=this._$Eu(t,o);a!==void 0&&this._$Eh.set(a,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let a of o)t.unshift(dt(a))}else e!==void 0&&t.push(dt(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Qt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){let o=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,o);if(a!==void 0&&o.reflect===!0){let i=(o.converter?.toAttribute!==void 0?o.converter:pt).toAttribute(t,o.type);this._$Em=e,i==null?this.removeAttribute(a):this.setAttribute(a,i),this._$Em=null}}_$AK(e,t){let o=this.constructor,a=o._$Eh.get(e);if(a!==void 0&&this._$Em!==a){let i=o.getPropertyOptions(a),s=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:pt;this._$Em=a;let n=s.fromAttribute(t,i.type);this[a]=n??this._$Ej?.get(a)??n,this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){let a=this.constructor,i=this[e];if(o??=a.getPropertyOptions(e),!((o.hasChanged??tr)(i,t)||o.useDefault&&o.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,o))))return;this.C(e,t,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:a,wrapped:i},s){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),i!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),a===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[a,i]of this._$Ep)this[a]=i;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[a,i]of o){let{wrapped:s}=i,n=this[a];s!==!0||this._$AL.has(a)||n===void 0||this.C(a,void 0,i,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};R.elementStyles=[],R.shadowRootOptions={mode:"open"},R[ue("elementProperties")]=new Map,R[ue("finalized")]=new Map,ao?.({ReactiveElement:R}),(_e.reactiveElementVersions??=[]).push("2.1.1");var ht=globalThis,De=ht.trustedTypes,rr=De?De.createPolicy("lit-html",{createHTML:r=>r}):void 0,gt="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+F,io=`<${mt}>`,J=document,ge=()=>J.createComment(""),me=r=>r===null||typeof r!="object"&&typeof r!="function",ft=Array.isArray,cr=r=>ft(r)||typeof r?.[Symbol.iterator]=="function",ut=`[
|
|
33
|
+
\f\r]`,he=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,or=/-->/g,ar=/>/g,G=RegExp(`>|${ut}(?:([^\\s"'>=/]+)(${ut}*=${ut}*(?:[^
|
|
34
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ir=/'/g,sr=/"/g,lr=/^(?:script|style|textarea|title)$/i,bt=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Be=bt(1),yt=bt(2),dr=bt(3),A=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),nr=new WeakMap,V=J.createTreeWalker(J,129);function pr(r,e){if(!ft(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return rr!==void 0?rr.createHTML(e):e}var ur=(r,e)=>{let t=r.length-1,o=[],a,i=e===2?"<svg>":e===3?"<math>":"",s=he;for(let n=0;n<t;n++){let l=r[n],d,p,c=-1,u=0;for(;u<l.length&&(s.lastIndex=u,p=s.exec(l),p!==null);)u=s.lastIndex,s===he?p[1]==="!--"?s=or:p[1]!==void 0?s=ar:p[2]!==void 0?(lr.test(p[2])&&(a=RegExp("</"+p[2],"g")),s=G):p[3]!==void 0&&(s=G):s===G?p[0]===">"?(s=a??he,c=-1):p[1]===void 0?c=-2:(c=s.lastIndex-p[2].length,d=p[1],s=p[3]===void 0?G:p[3]==='"'?sr:ir):s===sr||s===ir?s=G:s===or||s===ar?s=he:(s=G,a=void 0);let g=s===G&&r[n+1].startsWith("/>")?" ":"";i+=s===he?l+io:c>=0?(o.push(d),l.slice(0,c)+gt+l.slice(c)+F+g):l+F+(c===-2?n:g)}return[pr(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),o]},fe=class r{constructor({strings:e,_$litType$:t},o){let a;this.parts=[];let i=0,s=0,n=e.length-1,l=this.parts,[d,p]=ur(e,t);if(this.el=r.createElement(d,o),V.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(a=V.nextNode())!==null&&l.length<n;){if(a.nodeType===1){if(a.hasAttributes())for(let c of a.getAttributeNames())if(c.endsWith(gt)){let u=p[s++],g=a.getAttribute(c).split(F),b=/([.?@])?(.*)/.exec(u);l.push({type:1,index:i,name:b[2],strings:g,ctor:b[1]==="."?Re:b[1]==="?"?Fe:b[1]==="@"?Ie:Y}),a.removeAttribute(c)}else c.startsWith(F)&&(l.push({type:6,index:i}),a.removeAttribute(c));if(lr.test(a.tagName)){let c=a.textContent.split(F),u=c.length-1;if(u>0){a.textContent=De?De.emptyScript:"";for(let g=0;g<u;g++)a.append(c[g],ge()),V.nextNode(),l.push({type:2,index:++i});a.append(c[u],ge())}}}else if(a.nodeType===8)if(a.data===mt)l.push({type:2,index:i});else{let c=-1;for(;(c=a.data.indexOf(F,c+1))!==-1;)l.push({type:7,index:i}),c+=F.length-1}i++}}static createElement(e,t){let o=J.createElement("template");return o.innerHTML=e,o}};function K(r,e,t=r,o){if(e===A)return e;let a=o!==void 0?t._$Co?.[o]:t._$Cl,i=me(e)?void 0:e._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),i===void 0?a=void 0:(a=new i(r),a._$AT(r,t,o)),o!==void 0?(t._$Co??=[])[o]=a:t._$Cl=a),a!==void 0&&(e=K(r,a._$AS(r,e.values),a,o)),e}var Pe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:o}=this._$AD,a=(e?.creationScope??J).importNode(t,!0);V.currentNode=a;let i=V.nextNode(),s=0,n=0,l=o[0];for(;l!==void 0;){if(s===l.index){let d;l.type===2?d=new oe(i,i.nextSibling,this,e):l.type===1?d=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(d=new Ne(i,this,e)),this._$AV.push(d),l=o[++n]}s!==l?.index&&(i=V.nextNode(),s++)}return V.currentNode=J,a}p(e){let t=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}},oe=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,a){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=K(this,e,t),me(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==A&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):cr(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==k&&me(this._$AH)?this._$AA.nextSibling.data=e:this.T(J.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:o}=e,a=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=fe.createElement(pr(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===a)this._$AH.p(t);else{let i=new Pe(a,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=nr.get(e.strings);return t===void 0&&nr.set(e.strings,t=new fe(e)),t}k(e){ft(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,o,a=0;for(let i of e)a===t.length?t.push(o=new r(this.O(ge()),this.O(ge()),this,this.options)):o=t[a],o._$AI(i),a++;a<t.length&&(this._$AR(o&&o._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Y=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,a,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=a,this.options=i,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=k}_$AI(e,t=this,o,a){let i=this.strings,s=!1;if(i===void 0)e=K(this,e,t,0),s=!me(e)||e!==this._$AH&&e!==A,s&&(this._$AH=e);else{let n=e,l,d;for(e=i[0],l=0;l<i.length-1;l++)d=K(this,n[o+l],t,l),d===A&&(d=this._$AH[l]),s||=!me(d)||d!==this._$AH[l],d===k?e=k:e!==k&&(e+=(d??"")+i[l+1]),this._$AH[l]=d}s&&!a&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Re=class extends Y{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Fe=class extends Y{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Ie=class extends Y{constructor(e,t,o,a,i){super(e,t,o,a,i),this.type=5}_$AI(e,t=this){if((e=K(this,e,t,0)??k)===A)return;let o=this._$AH,a=e===k&&o!==k||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,i=e!==k&&(o===k||a);a&&this.element.removeEventListener(this.name,this,o),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ne=class{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}},hr={M:gt,P:F,A:mt,C:1,L:ur,R:Pe,D:cr,V:K,I:oe,H:Y,N:Fe,U:Ie,B:Re,F:Ne},so=ht.litHtmlPolyfillSupport;so?.(fe,oe),(ht.litHtmlVersions??=[]).push("3.3.1");var vt=(r,e,t)=>{let o=t?.renderBefore??e,a=o._$litPart$;if(a===void 0){let i=t?.renderBefore??null;o._$litPart$=a=new oe(e.insertBefore(ge(),i),i,void 0,t??{})}return a._$AI(r),a};var wt=globalThis,_=class extends R{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=vt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return A}};_._$litElement$=!0,_.finalized=!0,wt.litElementHydrateSupport?.({LitElement:_});var no=wt.litElementPolyfillSupport;no?.({LitElement:_});(wt.litElementVersions??=[]).push("4.2.1");var I={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},C=r=>(...e)=>({_$litDirective$:r,values:e}),T=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,o){this._$Ct=e,this._$AM=t,this._$Ci=o}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:co}=hr,mr=r=>r===null||typeof r!="object"&&typeof r!="function";var fr=r=>r.strings===void 0,gr=()=>document.createComment(""),ae=(r,e,t)=>{let o=r._$AA.parentNode,a=e===void 0?r._$AB:e._$AA;if(t===void 0){let i=o.insertBefore(gr(),a),s=o.insertBefore(gr(),a);t=new co(i,s,r,r.options)}else{let i=t._$AB.nextSibling,s=t._$AM,n=s!==r;if(n){let l;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(l=r._$AU)!==s._$AU&&t._$AP(l)}if(i!==a||n){let l=t._$AA;for(;l!==i;){let d=l.nextSibling;o.insertBefore(l,a),l=d}}}return t},N=(r,e,t=r)=>(r._$AI(e,t),r),lo={},Oe=(r,e=lo)=>r._$AH=e,br=r=>r._$AH,je=r=>{r._$AR(),r._$AA.remove()};var yr=(r,e,t)=>{let o=new Map;for(let a=e;a<=t;a++)o.set(r[a],a);return o},ga=C(class extends T{constructor(r){if(super(r),r.type!==I.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let o;t===void 0?t=e:e!==void 0&&(o=e);let a=[],i=[],s=0;for(let n of r)a[s]=o?o(n,s):s,i[s]=t(n,s),s++;return{values:i,keys:a}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,o]){let a=br(r),{values:i,keys:s}=this.dt(e,t,o);if(!Array.isArray(a))return this.ut=s,i;let n=this.ut??=[],l=[],d,p,c=0,u=a.length-1,g=0,b=i.length-1;for(;c<=u&&g<=b;)if(a[c]===null)c++;else if(a[u]===null)u--;else if(n[c]===s[g])l[g]=N(a[c],i[g]),c++,g++;else if(n[u]===s[b])l[b]=N(a[u],i[b]),u--,b--;else if(n[c]===s[b])l[b]=N(a[c],i[b]),ae(r,l[b+1],a[c]),c++,b--;else if(n[u]===s[g])l[g]=N(a[u],i[g]),ae(r,a[c],a[u]),u--,g++;else if(d===void 0&&(d=yr(s,g,b),p=yr(n,c,u)),d.has(n[c]))if(d.has(n[u])){let y=p.get(s[g]),f=y!==void 0?a[y]:null;if(f===null){let $=ae(r,a[c]);N($,i[g]),l[g]=$}else l[g]=N(f,i[g]),ae(r,a[c],f),a[y]=null;g++}else je(a[u]),u--;else je(a[c]),c++;for(;g<=b;){let y=ae(r,l[b+1]);N(y,i[g]),l[g++]=y}for(;c<=u;){let y=a[c++];y!==null&&je(y)}return this.ut=s,Oe(r,l),A}});var ka=C(class extends T{constructor(){super(...arguments),this.key=k}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(Oe(r),this.key=e),t}});var za=C(class extends T{constructor(r){if(super(r),r.type!==I.ATTRIBUTE||r.name!=="class"||r.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(let o in e)e[o]&&!this.nt?.has(o)&&this.st.add(o);return this.render(e)}let t=r.element.classList;for(let o of this.st)o in e||(t.remove(o),this.st.delete(o));for(let o in e){let a=!!e[o];a===this.st.has(o)||this.nt?.has(o)||(a?(t.add(o),this.st.add(o)):(t.remove(o),this.st.delete(o)))}return A}});var be=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let o of t)o._$AO?.(e,!1),be(o,e);return!0},He=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},vr=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),ho(e)}};function po(r){this._$AN!==void 0?(He(this),this._$AM=r,vr(this)):this._$AM=r}function uo(r,e=!1,t=0){let o=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(o))for(let i=t;i<o.length;i++)be(o[i],!1),He(o[i]);else o!=null&&(be(o,!1),He(o));else be(this,r)}var ho=r=>{r.type==I.CHILD&&(r._$AP??=uo,r._$AQ??=po)},ie=class extends T{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,o){super._$AT(e,t,o),vr(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(be(this,e),He(this))}setValue(e){if(fr(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var xt=new WeakMap,go=C(class extends ie{render(r){return k}update(r,[e]){let t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=r.options?.host,this.rt(this.ct=r.element)),k}rt(r){if(this.isConnected||(r=void 0),typeof this.G=="function"){let e=this.ht??globalThis,t=xt.get(e);t===void 0&&(t=new WeakMap,xt.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){return typeof this.G=="function"?xt.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 We=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Ue=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}};var wr=r=>!mr(r)&&typeof r.then=="function",xr=1073741823,kt=class extends ie{constructor(){super(...arguments),this._$Cwt=xr,this._$Cbt=[],this._$CK=new We(this),this._$CX=new Ue}render(...e){return e.find(t=>!wr(t))??A}update(e,t){let o=this._$Cbt,a=o.length;this._$Cbt=t;let i=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let n=0;n<t.length&&!(n>this._$Cwt);n++){let l=t[n];if(!wr(l))return this._$Cwt=n,l;n<a&&l===o[n]||(this._$Cwt=xr,a=0,Promise.resolve(l).then(async d=>{for(;s.get();)await s.get();let p=i.deref();if(p!==void 0){let c=p._$Cbt.indexOf(l);c>-1&&c<p._$Cwt&&(p._$Cwt=c,p.setValue(d))}}))}return A}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},mo=C(kt);var Z=class extends T{constructor(e){if(super(e),this.it=k,e.type!==I.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===A)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Z.directiveName="unsafeHTML",Z.resultType=1;var qe=C(Z);var ye=class extends Z{};ye.directiveName="unsafeSVG",ye.resultType=2;var fo=C(ye);var gi=["127.0.0.1","localhost"].includes(window.location.hostname);var bo=Symbol.for(""),yo=r=>{if(r?.r===bo)return r?._$litStatic$};var kr=new Map,St=r=>(e,...t)=>{let o=t.length,a,i,s=[],n=[],l,d=0,p=!1;for(;d<o;){for(l=e[d];d<o&&(i=t[d],(a=yo(i))!==void 0);)l+=a+e[++d],p=!0;d!==o&&n.push(i),s.push(l),d++}if(d===o&&s.push(e[o]),p){let c=s.join("$$lit$$");(e=kr.get(c))===void 0&&(s.raw=s,kr.set(c,e=s)),t=n}return r(e,...t)},vo=St(Be),vi=St(yt),wi=St(dr);var S=Be;var $t=class extends T{#o=null;#e=null;render(e){return k}update(e,[t]){let o=e.element;return this.#e!==o?(this.#e=o,this.#o=t,this.#r()):JSON.stringify(this.#o)!==JSON.stringify(t)&&(this.#o=t,this.#r()),k}async#r(){if(!this.#e||!this.#o)return;let e=this.#e.tagName.toLowerCase();await customElements.whenDefined(e);for(let[t,o]of Object.entries(this.#o))this.#e[t]=o}},Li=C($t);var B={"ocean-breeze":{id:"ocean-breeze",name:"Ocean Breeze",tags:["playful"],description:"Fresh and calming ocean-inspired palette with professional undertones",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#0891b2",secondary:"#64748b",accent:"#06b6d4",background:"#f0f9ff",darkMode:{background:"#0c1821",secondary:"#94a3b8",primary:"#0891b2"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'},spatialRhythm:{baseUnit:6,scaleRatio:1.2},shape:{radiusSize:h.RadiusSizes.xxlarge}},"midnight-steel":{id:"midnight-steel",name:"Midnight Steel",description:"Bold industrial aesthetic with sharp contrasts and urban edge",colors:{primary:"#3b82f6",secondary:"#52525b",accent:"#f59e0b",background:"#fafaf9",darkMode:{background:"#18181b",secondary:"#71717a",primary:"#3b82f6"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'IBM Plex Sans', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thin}},"neural-glow":{id:"neural-glow",name:"Neural Glow",description:"AI-inspired with vibrant purple-blue gradients and futuristic vibes",colors:{primary:"#8b5cf6",secondary:"#6366f1",accent:"#ec4899",background:"#faf5ff",darkMode:{background:"#0f0a1a",secondary:"#818cf8",primary:"#8b5cf6"}},typography:{baseFontSize:16,fontScale:1.618,fontFamilyHeadings:"'Space Grotesk', system-ui, sans-serif",fontFamilyBody:"'Space Grotesk', system-ui, sans-serif"},spatialRhythm:{baseUnit:4,scaleRatio:1.5},shape:{radiusSize:h.RadiusSizes.xlarge,borderWidth:h.BorderWidths.medium},behavior:{transitionSpeed:h.TransitionSpeeds.fast}},"paper-and-ink":{id:"paper-and-ink",name:"Paper & Ink",tags:["app","featured"],description:"Ultra-minimal design with focus on typography and whitespace",colors:{primary:"#171717",secondary:"#737373",accent:"#525252",background:"#ffffff",darkMode:{background:"#0a0a0a",secondary:"#a3a3a3",primary:"#737373"}},typography:{baseFontSize:18,fontScale:1.333,fontFamilyHeadings:"'Helvetica Neue', 'Arial', sans-serif",fontFamilyBody:"'Georgia', 'Times New Roman', serif",fontWeightNormal:400,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.2},shape:{radiusSize:h.RadiusSizes.none,borderWidth:h.BorderWidths.thin}},"sunset-paradise":{id:"sunset-paradise",name:"Sunset Paradise",description:"Warm tropical colors evoking golden hour by the beach",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#ea580c",secondary:"#d4a373",accent:"#fb923c",background:"#fffbeb",darkMode:{background:"#1a0f0a",secondary:"#c9a482",primary:"#f97316"}},typography:{baseFontSize:16,fontScale:1.5,fontFamilyHeadings:"'Quicksand', 'Comfortaa', sans-serif",fontFamilyBody:"'Quicksand', 'Comfortaa', sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.5},shape:{radiusSize:h.RadiusSizes.xxlarge,borderWidth:h.BorderWidths.medium}},"retro-wave":{id:"retro-wave",name:"Retro Wave",description:"Nostalgic 80s-inspired palette with neon undertones",colors:{primary:"#c026d3",secondary:"#a78bfa",accent:"#22d3ee",background:"#fef3ff",darkMode:{background:"#1a0a1f",secondary:"#c4b5fd",primary:"#d946ef"}},typography:{baseFontSize:15,fontScale:1.5,fontFamilyHeadings:"'Orbitron', 'Impact', monospace",fontFamilyBody:"'Courier New', 'Courier', monospace",fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:h.RadiusSizes.none,borderWidth:h.BorderWidths.thick},behavior:{transitionSpeed:h.TransitionSpeeds.instant}},"forest-canopy":{id:"forest-canopy",name:"Forest Canopy",description:"Natural earth tones with organic, calming green hues",colors:{primary:"#059669",secondary:"#78716c",accent:"#84cc16",background:"#f0fdf4",darkMode:{background:"#0a1410",secondary:"#a8a29e",primary:"#10b981"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Merriweather Sans', 'Arial', sans-serif",fontFamilyBody:"'Merriweather', 'Georgia', serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin}},"ruby-elegance":{id:"ruby-elegance",name:"Ruby Elegance",description:"Sophisticated palette with rich ruby reds and warm accents",colors:{primary:"#dc2626",secondary:"#9ca3af",accent:"#be123c",background:"#fef2f2",darkMode:{background:"#1b0808",secondary:"#d1d5db",primary:"#ef4444"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:"'Playfair Display', 'Georgia', serif",fontFamilyBody:"'Crimson Text', 'Garamond', serif",fontWeightNormal:400,fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.333},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thin}},"desert-dawn":{id:"desert-dawn",name:"Desert Dawn",description:"Sun-baked neutrals with grounded terracotta and cool oasis accents",colors:{primary:"#b45309",secondary:"#a8a29e",accent:"#0ea5a8",background:"#fcf6ef",darkMode:{background:"#12100e",secondary:"#d1d5db",primary:"#f59e0b"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Source Sans Pro', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Source Serif Pro', Georgia, serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.medium}},"contrast-pro":{id:"contrast-pro",name:"Contrast Pro",description:"Accessibility-first, high-contrast UI with assertive clarity",colors:{primary:"#1f2937",secondary:"#111827",accent:"#eab308",background:"#ffffff",darkMode:{background:"#0b0f14",secondary:"#9ca3af",primary:"#9ca3af"}},typography:{baseFontSize:17,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightBold:700},spatialRhythm:{baseUnit:3,scaleRatio:1.2},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thick},behavior:{transitionSpeed:h.TransitionSpeeds.fast,focusRingWidth:4}},"pastel-play":{id:"pastel-play",name:"Pastel Play",description:"Playful pastels with soft surfaces and friendly rounded shapes",colors:{primary:"#db2777",secondary:"#a78bfa",accent:"#34d399",background:"#fff7fa",darkMode:{background:"#1a1016",secondary:"#c4b5fd",primary:"#ec4899"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'Nunito', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Nunito', system-ui, -apple-system, sans-serif",lineHeightRelaxed:h.LineHeights.relaxed},spatialRhythm:{baseUnit:6,scaleRatio:1.4},shape:{radiusSize:h.RadiusSizes.xxlarge,borderWidth:h.BorderWidths.thin},behavior:{transitionSpeed:h.TransitionSpeeds.slow,animationEasing:h.AnimationEasings["ease-out"]}},"brutalist-tech":{id:"brutalist-tech",name:"Brutalist Tech",description:"Stark grayscale with engineered accents and unapologetically bold structure",colors:{primary:"#111111",secondary:"#4b5563",accent:"#06b6d4",background:"#f8fafc",darkMode:{background:"#0b0b0b",secondary:"#9ca3af",primary:"#06b6d4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",letterSpacingTight:-.02},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:h.RadiusSizes.none,borderWidth:h.BorderWidths.thick},behavior:{transitionSpeed:h.TransitionSpeeds.instant}},"zen-garden":{id:"zen-garden",name:"Zen Garden",description:"Soft botanicals with contemplative spacing and balanced motion",colors:{primary:"#3f6212",secondary:"#6b7280",accent:"#7c3aed",background:"#f7fbef",darkMode:{background:"#0d130a",secondary:"#a3a3a3",primary:"#84cc16"}},typography:{baseFontSize:17,fontScale:1.414,fontFamilyHeadings:"'Merriweather', Georgia, serif",fontFamilyBody:"'Noto Sans', system-ui, -apple-system, sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.35},shape:{radiusSize:h.RadiusSizes.large,borderWidth:h.BorderWidths.medium},behavior:{transitionSpeed:h.TransitionSpeeds.normal,animationEasing:h.AnimationEasings.ease}},"fitness-pro":{id:"fitness-pro",name:"Fitness Pro",tags:["app","featured"],description:"Health and fitness tracking aesthetic with data-driven dark surfaces and vibrant accent rings",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#e91e63",secondary:"#78909c",accent:"#ab47bc",background:"#fafafa",darkMode:{background:"#1a1d21",secondary:"#78909c",primary:"#0a4ca4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:h.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerPadding:1.25,sectionSpacing:2.5},shape:{radiusSize:h.RadiusSizes.large,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"medium",blurMedium:12},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-out"],focusRingWidth:2}},"travel-market":{id:"travel-market",name:"Travel Market",description:"Hospitality marketplace design with clean cards, subtle shadows, and trust-building neutrals",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#d93251",secondary:"#717171",accent:"#144990",background:"#ffffff",darkMode:{background:"#222222",secondary:"#b0b0b0",primary:"#ff5a7a"}},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightRelaxed:h.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1440,containerPadding:1.5,sectionSpacing:3},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:8},behavior:{transitionSpeed:h.TransitionSpeeds.normal,animationEasing:h.AnimationEasings["ease-in-out"],hoverOpacity:.9}},"mobility-app":{id:"mobility-app",name:"Mobility App",tags:["app","featured"],description:"On-demand service platform with bold typography, map-ready colors, and action-driven UI",options:{liquidGlassEffects:!0,backgroundMesh:0},colors:{primary:"#000000",secondary:"#545454",accent:"#06c167",background:"#f6f6f6",darkMode:{background:"#0f0f0f",secondary:"#8a8a8a",primary:"#06c167"}},typography:{baseFontSize:16,fontScale:1.3,fontFamilyHeadings:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,buttonPadding:1.25,inputPadding:1},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.medium},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-out"],focusRingWidth:3},a11y:{minTouchTarget:h.TouchTargetSizes.comfortable,focusStyle:h.FocusStyles.ring}},"fintech-secure":{id:"fintech-secure",name:"Fintech Secure",description:"Financial services app UI with trust-building blues, precise spacing, and security-first design",options:{liquidGlassEffects:!1,backgroundMesh:0},colors:{primary:"#0a2540",secondary:"#425466",accent:"#00d4ff",background:"#f7fafc",darkMode:{background:"#0a1929",secondary:"#8796a5",primary:"#00d4ff"}},typography:{baseFontSize:16,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1280,sectionSpacing:2.5},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:6},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-in-out"],focusRingWidth:3,focusRingOpacity:.4},a11y:{minTouchTarget:h.TouchTargetSizes.standard,focusStyle:h.FocusStyles.ring}},"social-feed":{id:"social-feed",name:"Social Feed",tags:["app","featured"],description:"Content-first social platform with minimal chrome, bold actions, and vibrant media presentation",options:{liquidGlassEffects:!0,backgroundMesh:4},colors:{primary:"#1877f2",secondary:"#65676b",accent:"#fe2c55",background:"#ffffff",darkMode:{background:"#18191a",secondary:"#b0b3b8",primary:"#2d88ff"}},typography:{baseFontSize:15,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:h.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:680,sectionSpacing:1.5},shape:{radiusSize:h.RadiusSizes.medium,borderWidth:h.BorderWidths.thin},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-out"],hoverOpacity:.85}},"enterprise-dash":{id:"enterprise-dash",tags:["app","featured"],name:"Enterprise Dashboard",description:"Data-dense business intelligence app interface with organized hierarchy and professional polish",options:{liquidGlassEffects:!1},colors:{primary:"#0066cc",secondary:"#5f6368",accent:"#1a73e8",background:"#ffffff",success:"#34a853",warning:"#fbbc04",danger:"#ea4335",darkMode:{background:"#202124",secondary:"#9aa0a6",primary:"#8ab4f8"}},typography:{baseFontSize:14,fontScale:1.2,fontFamilyHeadings:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'Roboto Mono', ui-monospace, Consolas, monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:h.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.2,containerMaxWidth:1600,containerPadding:1.5,sectionSpacing:2},shape:{radiusSize:h.RadiusSizes.small,borderWidth:h.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:4},behavior:{transitionSpeed:h.TransitionSpeeds.fast,animationEasing:h.AnimationEasings["ease-in-out"],focusRingWidth:2},layout:{densityCompact:.85,gridColumns:12}}};B.default={id:"default",name:"Default",tags:["app","featured"],description:"Fresh and modern design system with balanced aesthetics and usability",options:{liquidGlassEffects:!0,backgroundMesh:4},form:{options:{widgets:{booleans:"toggle",numbers:"input",selects:"standard"},layouts:{fieldsets:"default",arrays:"default"},enhancements:{icons:!0,datalists:!0,rangeOutput:!0},validation:{showErrors:!0,validateOnChange:!1}}},colors:{primary:"#0e7490",secondary:"#a99b95",accent:"#e54271",background:"#e7e6de",darkMode:{background:"#16171a",secondary:"#8b9199",primary:"#06b6d4"},success:null,warning:"#B38600",danger:null,info:null,gradientStops:3,elevationOpacity:.05},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyMono:'ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',fontWeightLight:h.FontWeights.light,fontWeightNormal:h.FontWeights.normal,fontWeightMedium:h.FontWeights.medium,fontWeightSemibold:h.FontWeights.semibold,fontWeightBold:h.FontWeights.bold,lineHeightTight:h.LineHeights.tight,lineHeightNormal:h.LineHeights.normal,lineHeightRelaxed:h.LineHeights.relaxed,letterSpacingTight:-.025,letterSpacingNormal:0,letterSpacingWide:.025},spatialRhythm:{baseUnit:4,scaleRatio:1.25,maxSpacingSteps:32,containerMaxWidth:1200,containerPadding:1,inputPadding:.75,buttonPadding:1,sectionSpacing:2},layers:{shadowDepth:"medium",blurLight:4,blurMedium:8,blurHeavy:16,zIndexBase:0,zIndexDropdown:1e3,zIndexSticky:1020,zIndexFixed:1030,zIndexModal:1040,zIndexPopover:1050,zIndexTooltip:1060,zIndexNotification:1070},shape:{radiusSize:h.RadiusSizes.large,borderWidth:h.BorderWidths.medium,customRadius:null},behavior:{transitionSpeed:h.TransitionSpeeds.normal,animationEasing:h.AnimationEasings["ease-out"],customTransitionSpeed:null,customEasing:null,focusRingWidth:3,focusRingOpacity:.3,hoverOpacity:.8},layout:{gridColumns:12,gridGutter:1,breakpoints:{sm:640,md:768,lg:1024,xl:1280},densityCompact:.8,densityNormal:1,densityComfortable:1.2,buttonMinHeight:h.TouchTargetSizes.standard,inputMinHeight:40,utilities:{grid:!0,flex:!0,spacing:!0,container:!0},gridSystem:{columns:[1,2,3,4,6],autoFitBreakpoints:{sm:"150px",md:"250px",lg:"350px",xl:"450px"},enableGapUtilities:!0},containerMaxWidth:"1400px",containerPadding:"var(--spacing-6)"},advanced:{linkStyle:h.LinkStyles.inline,colorDerivation:"hsl"},a11y:{minTouchTarget:h.TouchTargetSizes.standard,prefersReducedMotion:!0,focusStyle:h.FocusStyles.ring},icons:{set:"phosphor",weight:"regular",defaultSize:24,externalPath:"/assets/img/icons/",sizes:h.IconSizes,include:{navigation:["arrow-left","arrow-right","arrow-up","arrow-down","arrow-counter-clockwise","caret-left","caret-right","caret-down","caret-up","x","list","list-dashes","dots-three-vertical","dots-three","house","gear","magnifying-glass","funnel","tabs","sidebar"],actions:["plus","minus","check","trash","pencil","floppy-disk","copy","download","upload","share","link","eye","eye-slash","heart","star","bookmark","note-pencil","cursor-click","clipboard","magic-wand","sparkle"],communication:["envelope","bell","bell-ringing","bell-simple","chat-circle","phone","paper-plane-tilt","user","users","user-gear","at"],content:["image","file","file-text","file-css","file-js","folder","folder-open","book-open","camera","video-camera","play","pause","microphone","brackets-curly","code","folder-simple","grid-four","briefcase","chart-line","chart-bar","database","map-pin"],status:["info","warning","check-circle","x-circle","question","shield","shield-check","shield-warning","lock","lock-open","fingerprint","circle-notch"],time:["calendar","clock","timer","hourglass"],commerce:["shopping-cart","credit-card","currency-dollar","tag","receipt","storefront"],formatting:["text-align-left","text-align-center","text-align-right","text-b","text-italic","text-underline","list-bullets","list-numbers","text-aa"],system:["cloud","cloud-arrow-up","cloud-arrow-down","desktop","device-mobile","globe","wifi-high","battery-charging","sun","moon","moon-stars","palette","rocket","feather","square","circle","squares-four","lightning","wrench"]},spritePath:"public/assets/pds/icons/pds-icons.svg"},gap:4,debug:!1};var Ct={meta:{name:"Pure Design System Ontology",version:"1.0.0",description:"Complete metadata registry for PDS primitives, components, utilities, and tokens"},tokens:{colors:{semantic:["primary","secondary","accent","success","warning","danger","info"],neutral:["gray"],shades:[50,100,200,300,400,500,600,700,800,900,950],surface:["base","subtle","elevated","sunken","overlay","inverse","translucent"],text:["default","muted","subtle","inverse","primary","success","warning","danger","info"]},spacing:{scale:["1","2","3","4","5","6","8","10","12","16","20","24"],semantic:["xs","sm","md","lg","xl"]},typography:{families:["heading","body","mono"],sizes:["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl"],weights:["light","normal","medium","semibold","bold"]},radius:{scale:["none","sm","base","md","lg","xl","2xl","full"]},shadows:{scale:["none","sm","base","md","lg","xl","inner"]},themes:["light","dark"],breakpoints:{sm:640,md:768,lg:1024,xl:1280}},primitives:[{id:"badge",name:"Badge / Pill",description:"Inline status indicators and labels",selectors:[".badge",".badge-primary",".badge-secondary",".badge-success",".badge-info",".badge-warning",".badge-danger",".badge-outline",".badge-sm",".badge-lg",".pill",".tag",".chip"],tags:["status","label","indicator","inline"],category:"feedback"},{id:"card",name:"Card",description:"Content container with padding, border-radius, and optional shadow",selectors:[".card",".card-basic",".card-elevated",".card-outlined",".card-interactive"],tags:["container","content","grouping"],category:"container"},{id:"surface",name:"Surface",description:"Smart surface classes with automatic text/background color handling",selectors:[".surface-base",".surface-subtle",".surface-elevated",".surface-sunken",".surface-overlay",".surface-inverse",".surface-translucent",".surface-translucent-25",".surface-translucent-50",".surface-translucent-75",".surface-primary",".surface-secondary",".surface-success",".surface-warning",".surface-danger",".surface-info"],tags:["background","theming","color","container"],category:"theming"},{id:"callout",name:"Callout",description:"Contextual information and notification messages",selectors:[".callout",".callout-info",".callout-success",".callout-warning",".callout-danger",".callout-error",".callout-dismissible"],tags:["feedback","message","notification","status","information"],category:"feedback"},{id:"empty-state",name:"Empty State",description:"Empty state layout for missing data or onboarding",selectors:[".empty-state"],tags:["empty","no-data","zero","placeholder","onboarding","state"],category:"feedback"},{id:"dialog",name:"Dialog",description:"Modal dialog element",selectors:["dialog",".dialog"],tags:["modal","overlay","popup","modal"],category:"overlay"},{id:"divider",name:"Divider",description:"Horizontal rule with optional label",selectors:["hr","hr[data-content]"],tags:["separator","line","content-divider"],category:"layout"},{id:"table",name:"Table",description:"Data tables with responsive and styling variants",selectors:["table",".table-responsive",".table-striped",".table-bordered",".table-compact",".data-table"],tags:["data","grid","tabular","responsive"],category:"data"},{id:"button",name:"Button",description:"Interactive button element with variants",selectors:["button",".btn-primary",".btn-secondary",".btn-outline",".btn-sm",".btn-xs",".btn-lg",".btn-working",".icon-only"],tags:["interactive","action","cta","form"],category:"action"},{id:"fieldset",name:"Fieldset Group",description:"Form field grouping for radio/checkbox groups",selectors:["fieldset[role='group']","fieldset[role='radiogroup']","fieldset.buttons"],tags:["form","grouping","radio","checkbox"],category:"form"},{id:"label-field",name:"Label+Input",description:"Semantic label wrapping form input",selectors:["label","label:has(input)","label:has(select)","label:has(textarea)"],tags:["form","input","accessibility"],category:"form"},{id:"accordion",name:"Accordion",description:"Collapsible content sections",selectors:[".accordion",".accordion-item","details","details > summary"],tags:["expandable","collapsible","disclosure"],category:"disclosure"},{id:"icon",name:"Icon",description:"SVG icon element with size and color variants",selectors:["pds-icon",".icon-xs",".icon-sm",".icon-md",".icon-lg",".icon-xl",".icon-primary",".icon-secondary",".icon-accent",".icon-success",".icon-warning",".icon-danger",".icon-info",".icon-muted",".icon-subtle",".icon-text",".icon-text-start",".icon-text-end"],tags:["graphic","symbol","visual"],category:"media"},{id:"figure",name:"Figure/Media",description:"Figure element for images with captions",selectors:["figure","figure.media","figcaption"],tags:["image","media","caption"],category:"media"},{id:"gallery",name:"Gallery",description:"Image gallery grid",selectors:[".gallery",".gallery-grid",".img-gallery"],tags:["images","grid","collection"],category:"media"},{id:"form",name:"Form Container",description:"Form styling and layout",selectors:["form",".form-container",".form-actions",".field-description"],tags:["form","input","submission"],category:"form"},{id:"navigation",name:"Navigation",description:"Navigation elements and menus",selectors:["nav","nav[data-dropdown]","menu","nav menu li"],tags:["menu","links","routing"],category:"navigation"}],components:[{id:"pds-tabstrip",name:"Tab Strip",description:"Tabbed interface component",selectors:["pds-tabstrip"],tags:["tabs","navigation","panels"],category:"navigation"},{id:"pds-drawer",name:"Drawer",description:"Slide-out panel overlay",selectors:["pds-drawer"],tags:["panel","overlay","sidebar"],category:"overlay"},{id:"pds-fab",name:"FAB",description:"Floating Action Button with expandable satellite actions",selectors:["pds-fab"],tags:["button","action","floating","interactive"],category:"action"},{id:"pds-upload",name:"Upload",description:"File upload component with drag-and-drop",selectors:["pds-upload"],tags:["file","upload","drag-drop","form"],category:"form"},{id:"pds-icon",name:"Icon",description:"SVG icon web component",selectors:["pds-icon"],tags:["icon","graphic","svg"],category:"media"},{id:"pds-toaster",name:"Toaster",description:"Toast notification container",selectors:["pds-toaster"],tags:["notification","toast","feedback"],category:"feedback"},{id:"pds-form",name:"JSON Form",description:"Auto-generated form from JSON Schema",selectors:["pds-form"],tags:["form","schema","auto-generate"],category:"form"},{id:"pds-splitpanel",name:"Split Panel",description:"Resizable split pane layout",selectors:["pds-splitpanel"],tags:["layout","resize","panels"],category:"layout"},{id:"pds-scrollrow",name:"Scroll Row",description:"Horizontal scrolling row with snap points",selectors:["pds-scrollrow"],tags:["scroll","horizontal","carousel"],category:"layout"},{id:"pds-richtext",name:"Rich Text",description:"Rich text editor component",selectors:["pds-richtext"],tags:["editor","wysiwyg","text"],category:"form"},{id:"pds-calendar",name:"Calendar",description:"Date picker calendar component",selectors:["pds-calendar"],tags:["date","picker","calendar"],category:"form"}],layoutPatterns:[{id:"container",name:"Container",description:"Centered max-width wrapper with padding",selectors:[".container"],tags:["wrapper","centered","max-width","page"],category:"structure"},{id:"grid",name:"Grid",description:"CSS Grid layout container",selectors:[".grid"],tags:["layout","columns","css-grid"],category:"layout"},{id:"grid-cols",name:"Grid Columns",description:"Fixed column count grids",selectors:[".grid-cols-1",".grid-cols-2",".grid-cols-3",".grid-cols-4",".grid-cols-6"],tags:["columns","fixed","grid"],category:"layout"},{id:"grid-auto",name:"Auto-fit Grid",description:"Responsive auto-fit grid with minimum widths",selectors:[".grid-auto-sm",".grid-auto-md",".grid-auto-lg",".grid-auto-xl"],tags:["responsive","auto-fit","fluid"],category:"layout"},{id:"flex",name:"Flex Container",description:"Flexbox layout with direction and wrap modifiers",selectors:[".flex",".flex-wrap",".flex-col",".flex-row"],tags:["flexbox","layout","alignment"],category:"layout"},{id:"grow",name:"Flex Grow",description:"Fill remaining flex space",selectors:[".grow"],tags:["flex","expand","fill"],category:"layout"},{id:"stack",name:"Stack",description:"Vertical flex layout with predefined gaps",selectors:[".stack-sm",".stack-md",".stack-lg",".stack-xl"],tags:["vertical","spacing","column"],category:"layout"},{id:"gap",name:"Gap",description:"Spacing between flex/grid children",selectors:[".gap-0",".gap-xs",".gap-sm",".gap-md",".gap-lg",".gap-xl"],tags:["spacing","margin","gutters"],category:"spacing"},{id:"items",name:"Items Alignment",description:"Cross-axis alignment for flex/grid",selectors:[".items-start",".items-center",".items-end",".items-stretch",".items-baseline"],tags:["alignment","vertical","cross-axis"],category:"alignment"},{id:"justify",name:"Justify Content",description:"Main-axis alignment for flex/grid",selectors:[".justify-start",".justify-center",".justify-end",".justify-between",".justify-around",".justify-evenly"],tags:["alignment","horizontal","main-axis"],category:"alignment"},{id:"max-width",name:"Max-Width",description:"Content width constraints",selectors:[".max-w-sm",".max-w-md",".max-w-lg",".max-w-xl"],tags:["width","constraint","readable"],category:"sizing"},{id:"section",name:"Section Spacing",description:"Vertical padding for content sections",selectors:[".section",".section-lg"],tags:["spacing","vertical","padding"],category:"spacing"},{id:"mobile-stack",name:"Mobile Stack",description:"Stack on mobile, row on desktop",selectors:[".mobile-stack"],tags:["responsive","mobile","breakpoint"],category:"responsive"}],utilities:{text:{alignment:[".text-left",".text-center",".text-right"],color:[".text-muted"],overflow:[".truncate"]},backdrop:{base:[".backdrop"],variants:[".backdrop-light",".backdrop-dark"],blur:[".backdrop-blur-sm",".backdrop-blur-md",".backdrop-blur-lg"]},shadow:{scale:[".shadow-sm",".shadow-base",".shadow-md",".shadow-lg",".shadow-xl",".shadow-inner",".shadow-none"]},border:{gradient:[".border-gradient",".border-gradient-primary",".border-gradient-accent",".border-gradient-secondary",".border-gradient-soft",".border-gradient-medium",".border-gradient-strong"],glow:[".border-glow",".border-glow-sm",".border-glow-lg",".border-glow-primary",".border-glow-accent",".border-glow-success",".border-glow-warning",".border-glow-danger"],combined:[".border-gradient-glow"]},media:{image:[".img-gallery",".img-rounded-sm",".img-rounded-md",".img-rounded-lg",".img-rounded-xl",".img-rounded-full",".img-inline"],video:[".video-responsive"],figure:[".figure-responsive"]},effects:{glass:[".liquid-glass"]}},responsive:{prefixes:["sm","md","lg"],utilities:{grid:[":grid-cols-2",":grid-cols-3",":grid-cols-4"],flex:[":flex-row"],text:[":text-sm",":text-lg",":text-xl"],spacing:[":p-6",":p-8",":p-12",":gap-6",":gap-8",":gap-12"],width:[":w-1/2",":w-1/3",":w-1/4"],display:[":hidden",":block"]}},enhancements:[{id:"dropdown",selector:"nav[data-dropdown]",description:"Dropdown menu from nav element",tags:["menu","interactive","navigation"]},{id:"toggle",selector:"label[data-toggle]",description:"Toggle switch from checkbox",tags:["switch","boolean","form"]},{id:"range",selector:'input[type="range"]',description:"Enhanced range slider with output",tags:["slider","input","form"]},{id:"required",selector:"form [required]",description:"Required field asterisk indicator",tags:["validation","form","accessibility"]},{id:"open-group",selector:"fieldset[role=group][data-open]",description:"Editable checkbox/radio group",tags:["form","dynamic","editable"]},{id:"working-button",selector:"button.btn-working, a.btn-working",description:"Button with loading spinner",tags:["loading","async","feedback"]},{id:"labeled-divider",selector:"hr[data-content]",description:"Horizontal rule with centered label",tags:["divider","separator","text"]}],categories:{feedback:{description:"User feedback and status indicators",primitives:["callout","badge","empty-state"],components:["pds-toaster"]},form:{description:"Form inputs and controls",primitives:["button","fieldset","label-field","form"],components:["pds-upload","pds-form","pds-richtext","pds-calendar"]},layout:{description:"Page structure and content arrangement",patterns:["container","grid","flex","stack","section"],components:["pds-splitpanel","pds-scrollrow"]},navigation:{description:"Navigation and routing",primitives:["navigation"],components:["pds-tabstrip","pds-drawer"]},media:{description:"Images, icons, and visual content",primitives:["icon","figure","gallery"],components:["pds-icon"]},overlay:{description:"Modal and overlay content",primitives:["dialog"],components:["pds-drawer"]},data:{description:"Data display and tables",primitives:["table"]},theming:{description:"Colors, surfaces, and visual theming",primitives:["surface"]},action:{description:"Interactive actions and buttons",primitives:["button"],components:["pds-fab"]}},styles:{typography:["headings","body","code","links"],icons:{source:"svg",sets:["core","brand"]},interactive:["focus","hover","active","disabled"],states:["success","warning","danger","info","muted"]},searchRelations:{text:["typography","truncate","text-muted","text-primary","text-left","text-center","text-right","pds-richtext","heading","font","label","paragraph","content","ellipsis","overflow","input"],font:["typography","text","heading","font-size","font-weight","font-family"],type:["typography","text","font"],typography:["text","font","heading","truncate","text-muted"],heading:["typography","text","font-size","h1","h2","h3"],truncate:["text","overflow","ellipsis","clamp","nowrap","typography"],ellipsis:["truncate","text","overflow","clamp"],overflow:["truncate","scroll","hidden","text"],paragraph:["text","typography","content","body"],content:["text","typography","body","article"],empty:["empty-state","placeholder","zero","no-data","onboarding","callout","card","icon","button"],"empty state":["empty-state","empty","no-data","zero","onboarding"],"no data":["empty-state","empty","zero","placeholder"],form:["input","field","label","button","fieldset","pds-form","pds-upload","pds-richtext","pds-calendar","required","validation","submit"],input:["form","field","text","label","required","validation"],field:["form","input","label","required"],button:["btn","interactive","action","submit","form","btn-primary","btn-secondary","btn-working","pds-fab","floating"],btn:["button","interactive","action","pds-fab"],fab:["pds-fab","floating","button","action","menu"],floating:["fab","pds-fab","button","action"],toggle:["switch","checkbox","boolean","form","interactive"],switch:["toggle","checkbox","boolean"],slider:["range","input","form"],range:["slider","input","form"],checkbox:["toggle","form","fieldset","boolean"],radio:["fieldset","form","group"],select:["dropdown","form","input","menu"],upload:["file","pds-upload","form","drag-drop"],file:["upload","pds-upload","form"],modal:["dialog","pds-ask","overlay","popup","backdrop","pds-drawer","alert","confirm","prompt","lightbox"],dialog:["modal","pds-ask","overlay","popup","backdrop","alert","confirm","prompt"],popup:["modal","dialog","dropdown","popover","overlay","tooltip"],popover:["popup","tooltip","overlay"],overlay:["modal","dialog","backdrop","drawer","popup"],drawer:["pds-drawer","sidebar","panel","overlay","modal"],backdrop:["overlay","modal","dialog","blur"],confirm:["pds-ask","dialog","modal"],prompt:["pds-ask","dialog","modal","input"],ask:["pds-ask","dialog","confirm","prompt","modal"],dropdown:["menu","nav-dropdown","select","popover"],menu:["dropdown","navigation","nav","list"],nav:["navigation","menu","dropdown","tabs","links"],navigation:["nav","menu","tabs","pds-tabstrip","links","routing"],tabs:["pds-tabstrip","navigation","panels"],tab:["tabs","pds-tabstrip","panel"],link:["navigation","anchor","href","routing"],callout:["notification","feedback","message","status","toast","information","alert","warning","error","info","success","danger"],alert:["callout","notification","feedback","message","status","toast","modal","dialog","pds-ask","confirm","warning","error","info","success","danger"],notification:["callout","toast","pds-toaster","feedback","message","popup","alert"],toast:["pds-toaster","notification","callout","feedback","popup","snackbar","alert"],feedback:["callout","notification","toast","status","badge","validation","error","success","alert"],message:["callout","notification","feedback","dialog","toast","alert"],status:["badge","callout","indicator","feedback","state","alert"],error:["callout","danger","validation","feedback","warning","alert"],success:["callout","feedback","badge","status","check","alert"],warning:["callout","caution","feedback","status","alert"],info:["callout","information","feedback","status","alert"],danger:["callout","error","feedback","destructive","delete","alert"],badge:["status","pill","tag","chip","indicator","label"],pill:["badge","tag","chip"],tag:["badge","pill","chip","label"],chip:["badge","pill","tag"],layout:["grid","flex","stack","container","gap","spacing","pds-splitpanel","section"],grid:["layout","columns","css-grid","table","gallery"],flex:["layout","flexbox","alignment","row","column"],stack:["layout","vertical","spacing","column","gap"],container:["wrapper","layout","max-width","centered"],gap:["spacing","margin","padding","layout"],spacing:["gap","margin","padding","section"],section:["spacing","layout","container","page"],split:["pds-splitpanel","resizable","panels","layout"],panel:["pds-splitpanel","drawer","sidebar","section"],card:["surface","container","elevated","content"],surface:["card","background","elevated","theming","color"],box:["card","container","surface"],elevated:["surface","shadow","card"],color:["palette","theme","surface","primary","secondary","accent"],colours:["color","palette","theme"],palette:["color","theme","tokens"],theme:["color","palette","dark","light","surface"],primary:["color","button","badge","surface"],secondary:["color","button","badge","surface"],accent:["color","highlight","surface"],border:["border-gradient","border-glow","outline","radius"],effect:["border-gradient","border-glow","shadow","glass","animation"],gradient:["border-gradient","color","background"],glow:["border-glow","effect","shadow"],shadow:["elevated","effect","depth","card"],radius:["rounded","border","corner"],rounded:["radius","border","corner"],glass:["liquid-glass","backdrop","blur","effect"],icon:["pds-icon","graphic","symbol","svg","phosphor"],image:["img","figure","gallery","media","picture"],img:["image","figure","gallery","media"],figure:["image","media","caption"],gallery:["images","grid","collection","media"],media:["image","icon","figure","gallery","video"],table:["data","grid","tabular","rows","columns"],data:["table","json","form","display"],editor:["pds-richtext","wysiwyg","text","content"],wysiwyg:["editor","pds-richtext","richtext"],richtext:["pds-richtext","editor","wysiwyg","text"],calendar:["pds-calendar","date","picker","datepicker"],date:["calendar","pds-calendar","picker","input"],datepicker:["calendar","date","pds-calendar"],scroll:["pds-scrollrow","carousel","horizontal","overflow"],carousel:["scroll","pds-scrollrow","slider","gallery"],accordion:["details","collapsible","expandable","disclosure"],collapsible:["accordion","details","expandable"],expandable:["accordion","collapsible","disclosure"],details:["accordion","summary","disclosure"],divider:["hr","separator","line","rule"],separator:["divider","hr","line"],hr:["divider","separator","horizontal-rule"],interactive:["hover","focus","active","disabled","button","link"],hover:["interactive","effect","state"],focus:["interactive","accessibility","state","outline"],disabled:["interactive","state","muted"],loading:["btn-working","spinner","async","progress"],spinner:["loading","btn-working","progress"],accessibility:["a11y","aria","focus","label","required"],a11y:["accessibility","aria","semantic"],aria:["accessibility","a11y","role"],required:["form","validation","asterisk","input"],validation:["form","required","error","feedback"],start:["getting-started","intro","overview","whatispds"],intro:["getting-started","overview","start","docs"],getting:["getting-started","start","intro"],overview:["intro","start","summary","layout-overview"],docs:["documentation","reference","guide"],primitive:["primitives"],component:["components"],enhancement:["enhancements"],foundation:["foundations","color","icon","typography","spacing","tokens"],utility:["utilities","text","backdrop","shadow","border","helper"],pattern:["patterns","layout","responsive","mobile-stack"]}};var se=class r{static#o;static get instance(){return this.#o}#e;#r;constructor(e={}){this.options={debug:!1,...e},this.options.design||(this.options.design={}),this.options.debug&&this.options.log?.("debug","Generator options:",this.options),r.#o=this,this.tokens=this.generateTokens(),this.options.debug&&this.options.log?.("debug","Generated tokens:",this.tokens),this.#ve(),typeof CSSStyleSheet<"u"?this.#$e():this.options.debug&&this.options.log?.("debug","[Generator] Skipping browser features (CSSStyleSheet not available)")}generateTokens(){let e=this.options.design||{};return{colors:this.#n(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#D(e.shape||{}),borderWidths:this.#P(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#R(e.layers||{}),layout:this.#F(e.layout||{}),transitions:this.#I(e.behavior||{}),zIndex:this.#N(e.layers||{}),icons:this.#B(e.icons||{})}}#n(e){let{primary:t="#3b82f6",secondary:o="#64748b",accent:a="#ec4899",background:i="#ffffff",success:s=null,warning:n="#FFBF00",danger:l=null,info:d=null,darkMode:p={}}=e,c={primary:this.#a(t),secondary:this.#a(o),accent:this.#a(a),success:this.#a(s||this.#S(t)),warning:this.#a(n||a),danger:this.#a(l||this.#$(t)),info:this.#a(d||t),gray:this.#g(o),surface:this.#m(i)};return c.surface.fieldset=this.#C(c.surface),c.surfaceSmart=this.#w(c.surface),c.dark=this.#E(c,i,p),c.dark&&c.dark.surface&&(c.dark.surfaceSmart=this.#w(c.dark.surface)),c.interactive={light:{fill:this.#v(c.primary,4.5),text:c.primary[600]},dark:{fill:this.#v(c.dark.primary,4.5),text:this.#M(c.dark.primary,c.dark.surface.base,4.5)}},c}#a(e){let t=this.#s(e);return{50:this.#t(t.h,Math.max(t.s-10,10),Math.min(t.l+45,95)),100:this.#t(t.h,Math.max(t.s-5,15),Math.min(t.l+35,90)),200:this.#t(t.h,t.s,Math.min(t.l+25,85)),300:this.#t(t.h,t.s,Math.min(t.l+15,75)),400:this.#t(t.h,t.s,Math.min(t.l+5,65)),500:e,600:this.#t(t.h,t.s,Math.max(t.l-10,25)),700:this.#t(t.h,t.s,Math.max(t.l-20,20)),800:this.#t(t.h,t.s,Math.max(t.l-30,15)),900:this.#t(t.h,t.s,Math.max(t.l-40,10))}}#S(e){let t=this.#s(e);return this.#t(120,Math.max(t.s,60),45)}#$(e){let t=this.#s(e);return this.#t(0,Math.max(t.s,70),50)}#g(e){let t=this.#s(e),o=t.h,a=Math.min(t.s,10);return{50:this.#t(o,a,98),100:this.#t(o,a,95),200:this.#t(o,a,88),300:this.#t(o,a,78),400:this.#t(o,a,60),500:e,600:this.#t(o,Math.min(a+5,15),45),700:this.#t(o,Math.min(a+8,18),35),800:this.#t(o,Math.min(a+10,20),20),900:this.#t(o,Math.min(a+12,22),10)}}#m(e){let t=this.#s(e);return{base:e,subtle:this.#t(t.h,Math.max(t.s,2),Math.max(t.l-2,2)),elevated:this.#t(t.h,Math.max(t.s,3),Math.max(t.l-4,5)),sunken:this.#t(t.h,Math.max(t.s,4),Math.max(t.l-6,8)),overlay:this.#t(t.h,Math.max(t.s,2),Math.min(t.l+2,98)),inverse:this.#f(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#C(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#A(e.sunken,.05),overlay:e.elevated}}#A(e,t=.05){let o=this.#s(e),a=Math.max(o.l-o.l*t,5);return this.#t(o.h,o.s,a)}#f(e){let t=this.#s(e);if(t.l>50){let o=Math.min(t.s+5,25),a=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,o,a)}else{let o=Math.max(t.s-10,5),a=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,o,a)}}#E(e,t="#ffffff",o={}){let a=o.background?o.background:this.#f(t),i=this.#m(a),s=o.primary?this.#a(o.primary):this.#c(e.primary);return{surface:{...i,fieldset:this.#L(i)},primary:s,secondary:o.secondary?this.#a(o.secondary):this.#c(e.secondary),accent:o.accent?this.#a(o.accent):this.#c(e.accent),gray:o.secondary?this.#g(o.secondary):e.gray,success:this.#c(e.success),info:this.#c(e.info),warning:this.#c(e.warning),danger:this.#c(e.danger)}}#p(e){let t=String(e||"").replace("#",""),o=t.length===3?t.split("").map(i=>i+i).join(""):t,a=parseInt(o,16);return{r:a>>16&255,g:a>>8&255,b:a&255}}#h(e){let{r:t,g:o,b:a}=this.#p(e),i=[t/255,o/255,a/255].map(s=>s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}#u(e,t){let o=this.#h(e),a=this.#h(t),i=Math.max(o,a),s=Math.min(o,a);return(i+.05)/(s+.05)}#b(e,t=4.5){if(!e)return"#000000";let o="#ffffff",a="#000000",i=this.#u(e,o);if(i>=t)return o;let s=this.#u(e,a);return s>=t||s>i?a:o}#y(e,t=1){let{r:o,g:a,b:i}=this.#p(e);return`rgba(${o}, ${a}, ${i}, ${t})`}#T(e,t,o=.5){let a=this.#p(e),i=this.#p(t),s=Math.round(a.r+(i.r-a.r)*o),n=Math.round(a.g+(i.g-a.g)*o),l=Math.round(a.b+(i.b-a.b)*o);return this.#z(s,n,l)}#z(e,t,o){let a=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${a(e)}${a(t)}${a(o)}`}#L(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#x(e.elevated,.08),sunken:e.elevated,overlay:this.#x(e.overlay,.05)}}#M(e={},t="#000000",o=4.5){let a=["600","700","800","500","400","900","300","200"],i={shade:null,color:null,ratio:0};for(let s of a){let n=e?.[s];if(!n||typeof n!="string")continue;let l=this.#u(n,t);if(l>i.ratio&&(i={shade:s,color:n,ratio:l}),l>=o)return n}return i.color||e?.["600"]||e?.["500"]}#v(e={},t=4.5){let o=["600","700","800","500","400","900"],a={shade:null,color:null,ratio:0};for(let i of o){let s=e?.[i];if(!s||typeof s!="string")continue;let n=this.#u(s,"#ffffff");if(n>a.ratio&&(a={shade:i,color:s,ratio:n}),n>=t)return s}return a.color||e?.["600"]||e?.["500"]}#w(e){let t={};return Object.entries(e).forEach(([o,a])=>{if(!a||typeof a!="string"||!a.startsWith("#"))return;let i=this.#h(a)<.5,s=this.#b(a,4.5),n=this.#b(a,3),l=this.#T(s,a,.4),d=s,p=l,c=i?"#ffffff":"#000000",u=i?.25:.1,g=this.#y(c,u),b=i?"#ffffff":"#000000",y=i?.15:.1,f=this.#y(b,y);t[o]={bg:a,text:s,textSecondary:n,textMuted:l,icon:d,iconSubtle:p,shadow:g,border:f,scheme:i?"dark":"light"}}),t}#x(e,t=.05){let o=this.#s(e),a=Math.min(o.l+(100-o.l)*t,95);return this.#t(o.h,o.s,a)}#c(e){let t={};return Object.entries({50:{source:"900",dimFactor:.8},100:{source:"800",dimFactor:.8},200:{source:"700",dimFactor:.8},300:{source:"600",dimFactor:.8},400:{source:"500",dimFactor:.85},500:{source:"400",dimFactor:.85},600:{source:"300",dimFactor:.85},700:{source:"200",dimFactor:.85},800:{source:"100",dimFactor:.95},900:{source:"50",dimFactor:.95}}).forEach(([a,i])=>{let s=e[i.source];t[a]=this.#_(s,i.dimFactor)}),t}#_(e,t=.8){let o=this.#s(e),a=Math.max(o.s*t,5),i=Math.max(o.l*t,5);return this.#t(o.h,a,i)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:o=1.25,maxSpacingSteps:a=12}=e,i=Number.isFinite(Number(t))?Number(t):4,s=Math.min(Number.isFinite(Number(a))?Number(a):12,12),n={0:"0"};for(let l=1;l<=s;l++)n[l]=`${i*l}px`;return n}#D(e){let{radiusSize:t="medium",customRadius:o=null}=e,a;o!=null?a=o:typeof t=="number"?a=t:typeof t=="string"?a=h.RadiusSizes[t]??h.RadiusSizes.medium:a=h.RadiusSizes.medium;let i=Number.isFinite(Number(a))?Number(a):h.RadiusSizes.medium;return{none:"0",xs:`${Number.isFinite(i*.25)?Math.round(i*.25):0}px`,sm:`${Number.isFinite(i*.5)?Math.round(i*.5):0}px`,md:`${i}px`,lg:`${Number.isFinite(i*1.5)?Math.round(i*1.5):0}px`,xl:`${Number.isFinite(i*2)?Math.round(i*2):0}px`,full:"9999px"}}#P(e){let{borderWidth:t="medium"}=e,o;return typeof t=="number"?o=t:typeof t=="string"?o=h.BorderWidths[t]??h.BorderWidths.medium:o=h.BorderWidths.medium,{hairline:`${h.BorderWidths.hairline}px`,thin:`${h.BorderWidths.thin}px`,medium:`${h.BorderWidths.medium}px`,thick:`${h.BorderWidths.thick}px`}}generateTypographyTokens(e){let{fontFamilyHeadings:t="system-ui, -apple-system, sans-serif",fontFamilyBody:o="system-ui, -apple-system, sans-serif",fontFamilyMono:a='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:i=16,fontScale:s=1.25,fontWeightLight:n=h.FontWeights.light,fontWeightNormal:l=h.FontWeights.normal,fontWeightMedium:d=h.FontWeights.medium,fontWeightSemibold:p=h.FontWeights.semibold,fontWeightBold:c=h.FontWeights.bold,lineHeightTight:u=h.LineHeights.tight,lineHeightNormal:g=h.LineHeights.normal,lineHeightRelaxed:b=h.LineHeights.relaxed}=e,y=Number.isFinite(Number(i))?Number(i):16,f=Number.isFinite(Number(s))?Number(s):1.25;return{fontFamily:{headings:t,body:o,mono:a},fontSize:{xs:`${Math.round(y/Math.pow(f,2))}px`,sm:`${Math.round(y/f)}px`,base:`${y}px`,lg:`${Math.round(y*f)}px`,xl:`${Math.round(y*Math.pow(f,2))}px`,"2xl":`${Math.round(y*Math.pow(f,3))}px`,"3xl":`${Math.round(y*Math.pow(f,4))}px`,"4xl":`${Math.round(y*Math.pow(f,5))}px`},fontWeight:{light:n?.toString()||"300",normal:l?.toString()||"400",medium:d?.toString()||"500",semibold:p?.toString()||"600",bold:c?.toString()||"700"},lineHeight:{tight:u?.toString()||"1.25",normal:g?.toString()||"1.5",relaxed:b?.toString()||"1.75"}}}#R(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:o=1,shadowOffsetMultiplier:a=1}=e,i=`rgba(0, 0, 0, ${t})`,s=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*a}px ${2*o}px 0 ${s}`,base:`0 ${1*a}px ${3*o}px 0 ${i}, 0 ${1*a}px ${2*o}px 0 ${s}`,md:`0 ${4*a}px ${6*o}px ${-1*a}px ${i}, 0 ${2*a}px ${4*o}px ${-1*a}px ${s}`,lg:`0 ${10*a}px ${15*o}px ${-3*a}px ${i}, 0 ${4*a}px ${6*o}px ${-2*a}px ${s}`,xl:`0 ${20*a}px ${25*o}px ${-5*a}px ${i}, 0 ${10*a}px ${10*o}px ${-5*a}px ${s}`,inner:`inset 0 ${2*a}px ${4*o}px 0 ${s}`}}#F(e){let{maxWidth:t=1200,containerPadding:o=16,breakpoints:a={sm:640,md:768,lg:1024,xl:1280}}=e,i=this.#k(e);return{maxWidth:this.#i(t,"1200px"),maxWidthSm:i.sm,maxWidthMd:i.md,maxWidthLg:i.lg,maxWidthXl:i.xl,minHeight:"100vh",containerPadding:this.#i(o,"16px"),breakpoints:{sm:this.#i(a.sm,"640px"),md:this.#i(a.md,"768px"),lg:this.#i(a.lg,"1024px"),xl:this.#i(a.xl,"1280px")},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#k(e={}){let t={sm:640,md:768,lg:1024,xl:1280},{maxWidths:o={},maxWidth:a=1200,containerPadding:i=16,breakpoints:s=t}=e||{},n=this.#l(i,16),l=this.#l(a,t.xl),d={sm:this.#l(s.sm,t.sm),md:this.#l(s.md,t.md),lg:this.#l(s.lg,t.lg),xl:this.#l(s.xl,t.xl)},p=u=>u?Math.max(320,u-n*2):l,c={sm:Math.min(l,p(d.sm)),md:Math.min(l,p(d.md)),lg:Math.min(l,p(d.lg)),xl:Math.max(320,l)};return{sm:this.#i(o.sm,`${c.sm}px`),md:this.#i(o.md,`${c.md}px`),lg:this.#i(o.lg,`${c.lg}px`),xl:this.#i(o.xl,`${c.xl}px`)}}#i(e,t){return typeof e=="number"&&Number.isFinite(e)?`${e}px`:typeof e=="string"&&e.trim().length>0?e:t}#l(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let o=parseFloat(e);if(Number.isFinite(o))return o}return t}#I(e){let{transitionSpeed:t=h.TransitionSpeeds.normal,animationEasing:o=h.AnimationEasings["ease-out"]}=e,a;return typeof t=="number"?a=t:typeof t=="string"&&h.TransitionSpeeds[t]?a=h.TransitionSpeeds[t]:a=h.TransitionSpeeds.normal,{fast:`${Math.round(a*.6)}ms`,normal:`${a}ms`,slow:`${Math.round(a*1.4)}ms`}}#N(e){let{baseZIndex:t=1e3,zIndexStep:o=10}=e;return{dropdown:t.toString(),sticky:(t+o*2).toString(),fixed:(t+o*3).toString(),modal:(t+o*4).toString(),drawer:(t+o*5).toString(),popover:(t+o*6).toString(),tooltip:(t+o*7).toString(),notification:(t+o*8).toString()}}#B(e){let{set:t="phosphor",weight:o="regular",defaultSize:a=24,sizes:i={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:s="/assets/pds/icons/pds-icons.svg",externalPath:n="/assets/img/icons/"}=e;return{set:t,weight:o,defaultSize:`${a}px`,sizes:Object.fromEntries(Object.entries(i).map(([l,d])=>[l,`${d}px`])),spritePath:s,externalPath:n}}#O(e){let t=[];t.push(` /* Colors */
|
|
35
35
|
`);let o=(a,i="")=>{Object.entries(a).forEach(([s,n])=>{typeof n=="object"&&n!==null?o(n,`${i}${s}-`):typeof n=="string"&&t.push(` --color-${i}${s}: ${n};
|
|
36
36
|
`)})};return Object.entries(e).forEach(([a,i])=>{a!=="dark"&&a!=="surfaceSmart"&&a!=="interactive"&&typeof i=="object"&&i!==null&&o(i,`${a}-`)}),e.surfaceSmart&&(t.push(` /* Smart Surface Tokens (context-aware) */
|
|
37
37
|
`),Object.entries(e.surfaceSmart).forEach(([a,i])=>{t.push(` --surface-${a}-bg: ${i.bg};
|
|
@@ -3290,18 +3290,18 @@ ${this.#ye()}
|
|
|
3290
3290
|
`}#$e(){this.#r={tokens:new CSSStyleSheet,primitives:new CSSStyleSheet,components:new CSSStyleSheet,utilities:new CSSStyleSheet},this.#Ce()}#Ce(){this.#r.tokens.replaceSync(this.#e.tokens),this.#r.primitives.replaceSync(this.#e.primitives),this.#r.components.replaceSync(this.#e.components),this.#r.utilities.replaceSync(this.#e.utilities)}get tokensCSS(){return this.#e?.tokens||""}get primitivesCSS(){return this.#e?.primitives||""}get componentsCSS(){return this.#e?.components||""}get utilitiesCSS(){return this.#e?.utilities||""}get layeredCSS(){return this.#e?`${this.#e.tokens}
|
|
3291
3291
|
${this.#e.primitives}
|
|
3292
3292
|
${this.#e.components}
|
|
3293
|
-
${this.#e.utilities}`:""}get compiled(){return{tokens:{colors:this.tokens.colors,spacing:this.tokens.spacing,radius:this.tokens.radius,borderWidths:this.tokens.borderWidths,typography:this.tokens.typography,shadows:this.tokens.shadows,layout:this.tokens.layout,transitions:this.tokens.transitions,zIndex:this.tokens.zIndex,icons:this.tokens.icons},layers:{tokens:{css:this.#e?.tokens||"",size:this.#e?.tokens?.length||0,sizeKB:((this.#e?.tokens?.length||0)/1024).toFixed(2)},primitives:{css:this.#e?.primitives||"",size:this.#e?.primitives?.length||0,sizeKB:((this.#e?.primitives?.length||0)/1024).toFixed(2)},components:{css:this.#e?.components||"",size:this.#e?.components?.length||0,sizeKB:((this.#e?.components?.length||0)/1024).toFixed(2)},utilities:{css:this.#e?.utilities||"",size:this.#e?.utilities?.length||0,sizeKB:((this.#e?.utilities?.length||0)/1024).toFixed(2)},combined:{css:this.layeredCSS,size:this.layeredCSS?.length||0,sizeKB:((this.layeredCSS?.length||0)/1024).toFixed(2)}},config:{design:this.options.design||{},preset:this.options.preset||null,debug:this.options.debug||!1},capabilities:{constructableStylesheets:typeof CSSStyleSheet<"u",blobURLs:typeof Blob<"u"&&typeof URL<"u",shadowDOM:typeof ShadowRoot<"u"},references:{ontology:typeof
|
|
3293
|
+
${this.#e.utilities}`:""}get compiled(){return{tokens:{colors:this.tokens.colors,spacing:this.tokens.spacing,radius:this.tokens.radius,borderWidths:this.tokens.borderWidths,typography:this.tokens.typography,shadows:this.tokens.shadows,layout:this.tokens.layout,transitions:this.tokens.transitions,zIndex:this.tokens.zIndex,icons:this.tokens.icons},layers:{tokens:{css:this.#e?.tokens||"",size:this.#e?.tokens?.length||0,sizeKB:((this.#e?.tokens?.length||0)/1024).toFixed(2)},primitives:{css:this.#e?.primitives||"",size:this.#e?.primitives?.length||0,sizeKB:((this.#e?.primitives?.length||0)/1024).toFixed(2)},components:{css:this.#e?.components||"",size:this.#e?.components?.length||0,sizeKB:((this.#e?.components?.length||0)/1024).toFixed(2)},utilities:{css:this.#e?.utilities||"",size:this.#e?.utilities?.length||0,sizeKB:((this.#e?.utilities?.length||0)/1024).toFixed(2)},combined:{css:this.layeredCSS,size:this.layeredCSS?.length||0,sizeKB:((this.layeredCSS?.length||0)/1024).toFixed(2)}},config:{design:this.options.design||{},preset:this.options.preset||null,debug:this.options.debug||!1},capabilities:{constructableStylesheets:typeof CSSStyleSheet<"u",blobURLs:typeof Blob<"u"&&typeof URL<"u",shadowDOM:typeof ShadowRoot<"u"},references:{ontology:typeof Ct<"u"?Ct:null,enums:typeof h<"u"?h:null},meta:{generatedAt:new Date().toISOString(),totalSize:(this.#e?.tokens?.length||0)+(this.#e?.primitives?.length||0)+(this.#e?.components?.length||0)+(this.#e?.utilities?.length||0),totalSizeKB:(((this.#e?.tokens?.length||0)+(this.#e?.primitives?.length||0)+(this.#e?.components?.length||0)+(this.#e?.utilities?.length||0))/1024).toFixed(2),layerCount:4,tokenGroups:Object.keys(this.tokens).length},helpers:{getColorScales:()=>{let e=[],t=this.tokens.colors;for(let[o,a]of Object.entries(t))typeof a=="object"&&a!==null&&e.push({name:o,scale:a});return e},getColorScale:e=>this.tokens.colors[e]||null,getSpacingValues:()=>Object.entries(this.tokens.spacing).map(([e,t])=>({key:e,value:t})),getTypography:()=>this.tokens.typography,getLayerCSS:e=>{let t=["tokens","primitives","components","utilities"];if(!t.includes(e))throw new Error(`Invalid layer: ${e}. Must be one of ${t.join(", ")}`);return this.#e?.[e]||""},usesEnumValue:(e,t)=>{let o=this.options.design||{};return JSON.stringify(o).includes(t)}}}}get tokensStylesheet(){return this.#r?.tokens}get primitivesStylesheet(){return this.#r?.primitives}get componentsStylesheet(){return this.#r?.components}get utilitiesStylesheet(){return this.#r?.utilities}getCSSModules(){return{"pds-tokens.css.js":this.#d("tokens",this.#e.tokens),"pds-primitives.css.js":this.#d("primitives",this.#e.primitives),"pds-components.css.js":this.#d("components",this.#e.components),"pds-utilities.css.js":this.#d("utilities",this.#e.utilities),"pds-styles.css.js":this.#d("styles",this.layeredCSS)}}#d(e,t){let o=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$");return`// Pure Design System - ${e}
|
|
3294
3294
|
// Auto-generated - do not edit directly
|
|
3295
3295
|
|
|
3296
3296
|
export const ${e} = new CSSStyleSheet();
|
|
3297
3297
|
${e}.replaceSync(\`${o}\`);
|
|
3298
3298
|
|
|
3299
3299
|
export const ${e}CSS = \`${o}\`;
|
|
3300
|
-
`}};function Ge(r={},e={}){let t=Number(e.minContrast||4.5),o=n=>{let l=String(n||"").replace("#",""),d=l.length===3?l.split("").map(c=>c+c).join(""):l,p=parseInt(d||"0",16);return{r:p>>16&255,g:p>>8&255,b:p&255}},a=n=>{let{r:l,g:d,b:p}=o(n),c=[l/255,d/255,p/255].map(u=>u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4));return .2126*c[0]+.7152*c[1]+.0722*c[2]},i=(n,l)=>{if(!n||!l)return 0;let d=a(n),p=a(l),c=Math.max(d,p),u=Math.min(d,p);return(c+.05)/(u+.05)},s=[];try{let l=new se({design:structuredClone(r)}).tokens.colors,d={surfaceBg:l.surface?.base,surfaceText:l.gray?.[900]||"#000000",primaryFill:l.interactive?.light?.fill||l.primary?.[600],primaryText:l.interactive?.light?.text||l.primary?.[600]},p=i(d.primaryFill,"#ffffff");p<t&&s.push({path:"/colors/primary",message:`Primary button contrast too low in light theme (${p.toFixed(2)} < ${t}). Choose a darker primary.`,ratio:p,min:t,context:"light/btn-primary"});let c=i(d.surfaceBg,d.surfaceText);c<t&&s.push({path:"/colors/background",message:`Base text contrast on surface (light) is too low (${c.toFixed(2)} < ${t}). Adjust background or secondary (gray).`,ratio:c,min:t,context:"light/surface-text"});let u=i(d.primaryText,d.surfaceBg);u<t&&s.push({path:"/colors/primary",message:`Primary text on surface is too low for outline/link styles (light) (${u.toFixed(2)} < ${t}). Choose a darker primary or lighter surface.`,ratio:u,min:t,context:"light/outline"});let g=l.dark;if(g){let b={surfaceBg:g.surface?.base||l.surface?.inverse,primaryFill:l.interactive?.dark?.fill||g.primary?.[600],primaryText:l.interactive?.dark?.text||g.primary?.[600]},y=i(b.primaryFill,"#ffffff");y<t&&s.push({path:"/colors/darkMode/primary",message:`Primary button contrast too low in dark theme (${y.toFixed(2)} < ${t}). Override darkMode.primary or pick a brighter hue.`,ratio:y,min:t,context:"dark/btn-primary"});let f=i(b.primaryText,b.surfaceBg);f<t&&s.push({path:"/colors/darkMode/primary",message:`Primary text on surface is too low for outline/link styles (dark) (${f.toFixed(2)} < ${t}). Override darkMode.primary/background.`,ratio:f,min:t,context:"dark/outline"})}}catch(n){s.push({path:"/",message:`Validation failed: ${String(n?.message||n)}`,ratio:0,min:0})}return{ok:s.length===0,issues:s}}function kr(r){let e=r.replace(/['"]/g,"").trim();if(["system-ui","-apple-system","sans-serif","serif","monospace","cursive","fantasy","ui-sans-serif","ui-serif","ui-monospace","ui-rounded"].includes(e.toLowerCase()))return!0;let a=document.createElement("canvas").getContext("2d");if(!a)return!1;let i="mmmmmmmmmmlli",s="72px",n="monospace";a.font=`${s} ${n}`;let l=a.measureText(i).width;a.font=`${s} "${e}", ${n}`;let d=a.measureText(i).width;return l!==d}function vo(r){return r?r.split(",").map(o=>o.trim())[0].replace(/['"]/g,"").trim():null}async function wo(r,e={}){if(!r)return Promise.resolve();let{weights:t=[400,500,600,700],italic:o=!1}=e,a=vo(r);if(!a||kr(a))return Promise.resolve();let i=encodeURIComponent(a);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${i}"]`)?(console.log(`Font "${a}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${a}" from Google Fonts...`),new Promise((n,l)=>{let d=document.createElement("link");d.rel="stylesheet";let p=o?`ital,wght@0,${t.join(";0,")};1,${t.join(";1,")}`:`wght@${t.join(";")}`;d.href=`https://fonts.googleapis.com/css2?family=${i}:${p}&display=swap`,d.setAttribute("data-font-loader",a),d.onload=()=>{console.log(`Successfully loaded font "${a}"`),n()},d.onerror=()=>{console.warn(`Failed to load font "${a}" from Google Fonts`),l(new Error(`Failed to load font: ${a}`))},document.head.appendChild(d),setTimeout(()=>{kr(a)||console.warn(`Font "${a}" did not load within timeout`),n()},5e3)}))}async function Sr(r){if(!r)return Promise.resolve();let e=new Set;r.fontFamilyHeadings&&e.add(r.fontFamilyHeadings),r.fontFamilyBody&&e.add(r.fontFamilyBody),r.fontFamilyMono&&e.add(r.fontFamilyMono);let t=Array.from(e).map(o=>wo(o).catch(a=>{console.warn(`Could not load font: ${o}`,a)}));await Promise.all(t)}Ce();function $r(r){function e(a,i,s){let n=a[0];if(n==="colors")return i==="scheme"?"string":"color";if(n==="spacing"||n==="radius"||n==="borderWidths")return"dimension";if(n==="typography"){let l=a[1];return l==="fontFamily"?"fontFamily":l==="fontSize"?"fontSize":l==="fontWeight"?"fontWeight":l==="lineHeight"?"lineHeight":"string"}if(n==="shadows")return"shadow";if(n==="layout")return"dimension";if(n==="transitions")return"duration";if(n==="zIndex")return"number";if(n==="icons")return i==="defaultSize"||a.includes("sizes")?"dimension":"string";if(typeof s=="number")return"number";if(typeof s=="string"){if(/^\d+(\.\d+)?ms$/.test(s))return"duration";if(/^\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(s))return"dimension";if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(s)||/^(rgb|rgba|hsl|hsla|oklab|lab)\(/.test(s))return"color"}}function t(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function o(a,i=[]){if(a==null)return a;if(Array.isArray(a))return a.map((d,p)=>o(d,i.concat(String(p))));if(t(a)){if(Object.prototype.hasOwnProperty.call(a,"value")&&(Object.prototype.hasOwnProperty.call(a,"type")||Object.keys(a).length===1))return a;let d={};for(let[p,c]of Object.entries(a))d[p]=o(c,i.concat(p));return d}let s=i[i.length-1]??"",n=e(i,s,a),l=a;if(n==="number"&&typeof l=="string"){let d=Number(l);Number.isNaN(d)||(l=d)}return n?{value:l,type:n}:{value:l}}return o(r,[])}var Cr="pure-ds-config";customElements.define("pds-config-form",class extends _{#i;#e=0;#r=null;#n=null;#o=500;static properties={config:{type:Object,state:!0},schema:{type:Object,state:!0},mode:{type:String},inspectorMode:{type:Boolean,state:!0},formValues:{type:Object,state:!0},validationIssues:{type:Array,state:!0},formKey:{type:Number,state:!0},showInspector:{type:Boolean,attribute:"show-inspector"},showPresetSelector:{type:Boolean,attribute:"show-preset-selector"},showThemeSelector:{type:Boolean,attribute:"show-theme-selector"}};createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.formKey=0,this._validationToastId=null,this.mode="simple",this.inspectorMode=!1,this.config=this.loadConfig(),this._inspectorDeactivateHandler=()=>{this.inspectorMode&&(this.inspectorMode=!1,this.dispatchInspectorModeChange())},m.addEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler);try{ct(m.theme),lt(m.theme)}catch{}this.updateForm(),this.applyDefaultHostVariables(),this._initialValidationScheduled=!1,this._loadingToastShown=!1}disconnectedCallback(){super.disconnectedCallback(),this._inspectorDeactivateHandler&&(m.removeEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler),this._inspectorDeactivateHandler=null)}applyDefaultHostVariables(){try{let r=structuredClone(B.default),e=new se({design:r}),t=e.generateSpacingTokens(r.spatialRhythm||{});Object.entries(t).forEach(([s,n])=>{try{this.style.setProperty(`--spacing-${s}`,n)}catch{}});let o=r.spatialRhythm&&r.spatialRhythm.baseUnit||16;this.style.setProperty("--base-unit",`${o}px`);let a=e.generateTypographyTokens(r.typography||{});a.fontSize&&Object.entries(a.fontSize).forEach(([s,n])=>{this.style.setProperty(`--font-size-${s}`,n)});let i=r.typography&&r.typography.baseFontSize||16;this.style.setProperty("--base-font-size",`${i}px`),a.fontFamily&&Object.entries(a.fontFamily).forEach(([s,n])=>{this.style.setProperty(`--font-family-${s}`,n)}),a.lineHeight&&Object.entries(a.lineHeight).forEach(([s,n])=>{this.style.setProperty(`--font-lineHeight-${s}`,n)}),console.debug("pds-config-form: applied default host CSS variables")}catch(r){console.warn("pds-config-form: failed to apply default host variables",r)}}updateForm(){this.schema=null,fetch(`/assets/data/auto-design-${this.mode}.json`).then(r=>r.json()).then(r=>{this.schema=r,this.formValues=this.filterConfigForSchema(this.config),this.formKey=(this.formKey||0)+1}).catch(r=>{console.warn("Failed to load schema:",r)})}_isEqual(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(r&&e&&typeof r=="object"){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let a=0;a<r.length;a++)if(!this._isEqual(r[a],e[a]))return!1;return!0}let t=Object.keys(r),o=Object.keys(e);t.length,o.length;for(let a of new Set([...t,...o]))if(!this._isEqual(r[a],e[a]))return!1;return!0}return!1}_deepDiff(r,e){if(!this._isEqual(r,e)){if(r&&e&&typeof r=="object"&&typeof e=="object"&&!Array.isArray(r)&&!Array.isArray(e)){let t={},o=new Set([...Object.keys(e)]);for(let a of o){let i=this._deepDiff(r[a],e[a]);i!==void 0&&(t[a]=i)}return Object.keys(t).length?t:void 0}return this._isEqual(r,e)?void 0:e}}_resolvePresetBase(r){let e=String(r||"default").toLowerCase(),t=B?.[e]||B?.default;return JSON.parse(JSON.stringify(t||B.default))}loadConfig(){let r=localStorage.getItem(Cr);if(r)try{let e=JSON.parse(r);if(e&&("preset"in e||"design"in e)){let o=e.preset||"default",a=this._resolvePresetBase(o),i=H(a,e.design||{});return this._stored={preset:o,design:e.design||{}},this._legacy=!1,i}let t=H(config.design,e);return this._stored=null,this._legacy=!0,t}catch(e){console.warn("Failed to parse stored config, using defaults",e)}return this._stored={preset:"default",design:{}},this._legacy=!1,JSON.parse(JSON.stringify(this._resolvePresetBase("default")))}saveConfig(){try{let r=this._stored&&this._stored.preset||"default",e=this._resolvePresetBase(r),t=this._deepDiff(e,this.config)||{},o={preset:r,design:t};localStorage.setItem(Cr,JSON.stringify(o)),this._stored=o,this._legacy=!1}catch(r){console.warn("Failed to save config: ",r)}}updated(r){if(r.has("schema")){this.formValues=this.filterConfigForSchema(this.config);let e=this._initialValidationScheduled?50:150;this._initialValidationScheduled=!0,setTimeout(()=>{try{this.applyStyles(!0)}catch(t){console.warn("Delayed applyStyles failed:",t)}},e)}}async applyStyles(r=!1){let e=structuredClone(B.default);if(r&&this.config){let a=this._stored&&this._stored.preset||"default",i=this._resolvePresetBase(a);e=H(i,this.config)}if(e.typography)try{await Sr(e.typography)}catch(a){console.warn("Failed to load some fonts from Google Fonts:",a)}try{let a=Ge(e);if(!a.ok){if(this.validationIssues=a.issues,!this._validationToastId){let i=a.issues.slice(0,3).map(s=>`\u2022 ${s.message}`).join(`
|
|
3300
|
+
`}};function Ge(r={},e={}){let t=Number(e.minContrast||4.5),o=n=>{let l=String(n||"").replace("#",""),d=l.length===3?l.split("").map(c=>c+c).join(""):l,p=parseInt(d||"0",16);return{r:p>>16&255,g:p>>8&255,b:p&255}},a=n=>{let{r:l,g:d,b:p}=o(n),c=[l/255,d/255,p/255].map(u=>u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4));return .2126*c[0]+.7152*c[1]+.0722*c[2]},i=(n,l)=>{if(!n||!l)return 0;let d=a(n),p=a(l),c=Math.max(d,p),u=Math.min(d,p);return(c+.05)/(u+.05)},s=[];try{let l=new se({design:structuredClone(r)}).tokens.colors,d={surfaceBg:l.surface?.base,surfaceText:l.gray?.[900]||"#000000",primaryFill:l.interactive?.light?.fill||l.primary?.[600],primaryText:l.interactive?.light?.text||l.primary?.[600]},p=i(d.primaryFill,"#ffffff");p<t&&s.push({path:"/colors/primary",message:`Primary button contrast too low in light theme (${p.toFixed(2)} < ${t}). Choose a darker primary.`,ratio:p,min:t,context:"light/btn-primary"});let c=i(d.surfaceBg,d.surfaceText);c<t&&s.push({path:"/colors/background",message:`Base text contrast on surface (light) is too low (${c.toFixed(2)} < ${t}). Adjust background or secondary (gray).`,ratio:c,min:t,context:"light/surface-text"});let u=i(d.primaryText,d.surfaceBg);u<t&&s.push({path:"/colors/primary",message:`Primary text on surface is too low for outline/link styles (light) (${u.toFixed(2)} < ${t}). Choose a darker primary or lighter surface.`,ratio:u,min:t,context:"light/outline"});let g=l.dark;if(g){let b={surfaceBg:g.surface?.base||l.surface?.inverse,primaryFill:l.interactive?.dark?.fill||g.primary?.[600],primaryText:l.interactive?.dark?.text||g.primary?.[600]},y=i(b.primaryFill,"#ffffff");y<t&&s.push({path:"/colors/darkMode/primary",message:`Primary button contrast too low in dark theme (${y.toFixed(2)} < ${t}). Override darkMode.primary or pick a brighter hue.`,ratio:y,min:t,context:"dark/btn-primary"});let f=i(b.primaryText,b.surfaceBg);f<t&&s.push({path:"/colors/darkMode/primary",message:`Primary text on surface is too low for outline/link styles (dark) (${f.toFixed(2)} < ${t}). Override darkMode.primary/background.`,ratio:f,min:t,context:"dark/outline"})}}catch(n){s.push({path:"/",message:`Validation failed: ${String(n?.message||n)}`,ratio:0,min:0})}return{ok:s.length===0,issues:s}}function Sr(r){let e=r.replace(/['"]/g,"").trim();if(["system-ui","-apple-system","sans-serif","serif","monospace","cursive","fantasy","ui-sans-serif","ui-serif","ui-monospace","ui-rounded"].includes(e.toLowerCase()))return!0;let a=document.createElement("canvas").getContext("2d");if(!a)return!1;let i="mmmmmmmmmmlli",s="72px",n="monospace";a.font=`${s} ${n}`;let l=a.measureText(i).width;a.font=`${s} "${e}", ${n}`;let d=a.measureText(i).width;return l!==d}function wo(r){return r?r.split(",").map(o=>o.trim())[0].replace(/['"]/g,"").trim():null}async function xo(r,e={}){if(!r)return Promise.resolve();let{weights:t=[400,500,600,700],italic:o=!1}=e,a=wo(r);if(!a||Sr(a))return Promise.resolve();let i=encodeURIComponent(a);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${i}"]`)?(console.log(`Font "${a}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${a}" from Google Fonts...`),new Promise((n,l)=>{let d=document.createElement("link");d.rel="stylesheet";let p=o?`ital,wght@0,${t.join(";0,")};1,${t.join(";1,")}`:`wght@${t.join(";")}`;d.href=`https://fonts.googleapis.com/css2?family=${i}:${p}&display=swap`,d.setAttribute("data-font-loader",a),d.onload=()=>{console.log(`Successfully loaded font "${a}"`),n()},d.onerror=()=>{console.warn(`Failed to load font "${a}" from Google Fonts`),l(new Error(`Failed to load font: ${a}`))},document.head.appendChild(d),setTimeout(()=>{Sr(a)||console.warn(`Font "${a}" did not load within timeout`),n()},5e3)}))}async function $r(r){if(!r)return Promise.resolve();let e=new Set;r.fontFamilyHeadings&&e.add(r.fontFamilyHeadings),r.fontFamilyBody&&e.add(r.fontFamilyBody),r.fontFamilyMono&&e.add(r.fontFamilyMono);let t=Array.from(e).map(o=>xo(o).catch(a=>{console.warn(`Could not load font: ${o}`,a)}));await Promise.all(t)}Ce();function Cr(r){function e(a,i,s){let n=a[0];if(n==="colors")return i==="scheme"?"string":"color";if(n==="spacing"||n==="radius"||n==="borderWidths")return"dimension";if(n==="typography"){let l=a[1];return l==="fontFamily"?"fontFamily":l==="fontSize"?"fontSize":l==="fontWeight"?"fontWeight":l==="lineHeight"?"lineHeight":"string"}if(n==="shadows")return"shadow";if(n==="layout")return"dimension";if(n==="transitions")return"duration";if(n==="zIndex")return"number";if(n==="icons")return i==="defaultSize"||a.includes("sizes")?"dimension":"string";if(typeof s=="number")return"number";if(typeof s=="string"){if(/^\d+(\.\d+)?ms$/.test(s))return"duration";if(/^\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(s))return"dimension";if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(s)||/^(rgb|rgba|hsl|hsla|oklab|lab)\(/.test(s))return"color"}}function t(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function o(a,i=[]){if(a==null)return a;if(Array.isArray(a))return a.map((d,p)=>o(d,i.concat(String(p))));if(t(a)){if(Object.prototype.hasOwnProperty.call(a,"value")&&(Object.prototype.hasOwnProperty.call(a,"type")||Object.keys(a).length===1))return a;let d={};for(let[p,c]of Object.entries(a))d[p]=o(c,i.concat(p));return d}let s=i[i.length-1]??"",n=e(i,s,a),l=a;if(n==="number"&&typeof l=="string"){let d=Number(l);Number.isNaN(d)||(l=d)}return n?{value:l,type:n}:{value:l}}return o(r,[])}var Ar="pure-ds-config";customElements.define("pds-config-form",class extends _{#o;#e=0;#r=null;#n=null;#a=500;static properties={config:{type:Object,state:!0},schema:{type:Object,state:!0},mode:{type:String},inspectorMode:{type:Boolean,state:!0},formValues:{type:Object,state:!0},validationIssues:{type:Array,state:!0},formKey:{type:Number,state:!0},showInspector:{type:Boolean,attribute:"show-inspector"},showPresetSelector:{type:Boolean,attribute:"show-preset-selector"},showThemeSelector:{type:Boolean,attribute:"show-theme-selector"}};createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.formKey=0,this._validationToastId=null,this.mode="simple",this.inspectorMode=!1,this.config=this.loadConfig(),this._inspectorDeactivateHandler=()=>{this.inspectorMode&&(this.inspectorMode=!1,this.dispatchInspectorModeChange())},m.addEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler);try{ct(m.theme),lt(m.theme)}catch{}this.updateForm(),this.applyDefaultHostVariables(),this._initialValidationScheduled=!1,this._loadingToastShown=!1}disconnectedCallback(){super.disconnectedCallback(),this._inspectorDeactivateHandler&&(m.removeEventListener("pds:inspector:deactivate",this._inspectorDeactivateHandler),this._inspectorDeactivateHandler=null)}applyDefaultHostVariables(){try{let r=structuredClone(B.default),e=new se({design:r}),t=e.generateSpacingTokens(r.spatialRhythm||{});Object.entries(t).forEach(([s,n])=>{try{this.style.setProperty(`--spacing-${s}`,n)}catch{}});let o=r.spatialRhythm&&r.spatialRhythm.baseUnit||16;this.style.setProperty("--base-unit",`${o}px`);let a=e.generateTypographyTokens(r.typography||{});a.fontSize&&Object.entries(a.fontSize).forEach(([s,n])=>{this.style.setProperty(`--font-size-${s}`,n)});let i=r.typography&&r.typography.baseFontSize||16;this.style.setProperty("--base-font-size",`${i}px`),a.fontFamily&&Object.entries(a.fontFamily).forEach(([s,n])=>{this.style.setProperty(`--font-family-${s}`,n)}),a.lineHeight&&Object.entries(a.lineHeight).forEach(([s,n])=>{this.style.setProperty(`--font-lineHeight-${s}`,n)}),console.debug("pds-config-form: applied default host CSS variables")}catch(r){console.warn("pds-config-form: failed to apply default host variables",r)}}updateForm(){this.schema=null,fetch(`/assets/data/auto-design-${this.mode}.json`).then(r=>r.json()).then(r=>{this.schema=r,this.formValues=this.filterConfigForSchema(this.config),this.formKey=(this.formKey||0)+1}).catch(r=>{console.warn("Failed to load schema:",r)})}_isEqual(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(r&&e&&typeof r=="object"){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let a=0;a<r.length;a++)if(!this._isEqual(r[a],e[a]))return!1;return!0}let t=Object.keys(r),o=Object.keys(e);t.length,o.length;for(let a of new Set([...t,...o]))if(!this._isEqual(r[a],e[a]))return!1;return!0}return!1}_deepDiff(r,e){if(!this._isEqual(r,e)){if(r&&e&&typeof r=="object"&&typeof e=="object"&&!Array.isArray(r)&&!Array.isArray(e)){let t={},o=new Set([...Object.keys(e)]);for(let a of o){let i=this._deepDiff(r[a],e[a]);i!==void 0&&(t[a]=i)}return Object.keys(t).length?t:void 0}return this._isEqual(r,e)?void 0:e}}_resolvePresetBase(r){let e=String(r||"default").toLowerCase(),t=B?.[e]||B?.default;return JSON.parse(JSON.stringify(t||B.default))}loadConfig(){let r=localStorage.getItem(Ar);if(r)try{let e=JSON.parse(r);if(e&&("preset"in e||"design"in e)){let o=e.preset||"default",a=this._resolvePresetBase(o),i=H(a,e.design||{});return this._stored={preset:o,design:e.design||{}},this._legacy=!1,i}let t=H(config.design,e);return this._stored=null,this._legacy=!0,t}catch(e){console.warn("Failed to parse stored config, using defaults",e)}return this._stored={preset:"default",design:{}},this._legacy=!1,JSON.parse(JSON.stringify(this._resolvePresetBase("default")))}saveConfig(){try{let r=this._stored&&this._stored.preset||"default",e=this._resolvePresetBase(r),t=this._deepDiff(e,this.config)||{},o={preset:r,design:t};localStorage.setItem(Ar,JSON.stringify(o)),this._stored=o,this._legacy=!1}catch(r){console.warn("Failed to save config: ",r)}}updated(r){if(r.has("schema")){this.formValues=this.filterConfigForSchema(this.config);let e=this._initialValidationScheduled?50:150;this._initialValidationScheduled=!0,setTimeout(()=>{try{this.applyStyles(!0)}catch(t){console.warn("Delayed applyStyles failed:",t)}},e)}}async applyStyles(r=!1){let e=structuredClone(B.default);if(r&&this.config){let a=this._stored&&this._stored.preset||"default",i=this._resolvePresetBase(a);e=H(i,this.config)}if(e.typography)try{await $r(e.typography)}catch(a){console.warn("Failed to load some fonts from Google Fonts:",a)}try{let a=Ge(e);if(!a.ok){if(this.validationIssues=a.issues,!this._validationToastId){let i=a.issues.slice(0,3).map(s=>`\u2022 ${s.message}`).join(`
|
|
3301
3301
|
`);this._validationToastId=await m.toast(`Design has accessibility issues. Fix before applying.
|
|
3302
|
-
${i}`,{type:"error",persistent:!0})}return}this.validationIssues=[],this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch(a){console.warn("Validation failed unexpectedly:",a)}let t=m.theme||null,o={design:structuredClone(e)};t&&(o.theme=t),this.generator=new se(o),
|
|
3302
|
+
${i}`,{type:"error",persistent:!0})}return}this.validationIssues=[],this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch(a){console.warn("Validation failed unexpectedly:",a)}let t=m.theme||null,o={design:structuredClone(e)};t&&(o.theme=t),this.generator=new se(o),At(this.generator);try{ct(m.theme),lt(m.theme)}catch{}this.scheduleDesignUpdatedEmit({config:e,designer:this.generator})}scheduleDesignUpdatedEmit(r){let e=Date.now(),t=()=>{this.#e=Date.now(),this.#r&&(clearTimeout(this.#r),this.#r=null),m.dispatchEvent(new CustomEvent("pds:design:updated",{detail:r}))};if(e-this.#e>=this.#a){t();return}if(!this.#r){let o=this.#a-(e-this.#e);this.#r=setTimeout(()=>{this.#r=null,t()},o)}}async toggleInspectorMode(){this.inspectorMode=!this.inspectorMode,this.dispatchInspectorModeChange(),await m.toast(this.inspectorMode?"Code Inspector active - click any element in the showcase to view its code":"Code Inspector deactivated",{type:"info",duration:3e3})}dispatchInspectorModeChange(){m.dispatchEvent(new CustomEvent("pds:inspector:mode:changed",{detail:{active:this.inspectorMode}}))}flattenConfig(r,e=""){let t={};for(let[o,a]of Object.entries(r)){let i=e?`${e}/${o}`:`/${o}`;a&&typeof a=="object"&&!Array.isArray(a)?Object.assign(t,this.flattenConfig(a,i)):t[i]=a}return t}getSchemaProperties(r,e=""){let t=new Set;if(!r||!r.properties)return t;for(let[o,a]of Object.entries(r.properties)){let i=e?`${e}/${o}`:`/${o}`;t.add(i),a.type==="object"&&a.properties&&this.getSchemaProperties(a,i).forEach(n=>t.add(n))}return t}filterConfigForSchema(r){if(!r)return{};if(!this.schema)return this.flattenConfig(r);let e=this.getSchemaProperties(this.schema),t=this.flattenConfig(r),o={};for(let[a,i]of Object.entries(t))e.has(a)&&i!==null&&i!==void 0&&(o[a]=i);return o}handleFormChange=async r=>{let e,t=null;if(r.type==="pw:value-change"&&r.detail&&(t=r.detail.name),r.detail&&r.detail.json)e=r.detail.json;else{let n=r.currentTarget?.tagName?.toUpperCase()==="pds-form"?r.currentTarget:this.querySelector("pds-form");if(n)e=n.getValuesFlat?.()||n.values||{};else{console.warn("No form element found in form change event",r);return}}console.log("Form values received:",e);let o={},a=n=>n.replace(/~1/g,"/").replace(/~0/g,"~");for(let[n,l]of Object.entries(e))if(n)if(n.startsWith("/")){let p=n.replace(/^\//,"").split("/").map(a),c=o;for(let u=0;u<p.length-1;u++){let g=p[u];(!c[g]||typeof c[g]!="object")&&(c[g]={}),c=c[g]}c[p[p.length-1]]=l}else if(n.includes(".")){let d=n.split("."),p=o;for(let c=0;c<d.length-1;c++)(!p[d[c]]||typeof p[d[c]]!="object")&&(p[d[c]]={}),p=p[d[c]];p[d[d.length-1]]=l}else o[n]=l;console.log("Nested values:",o);let i=H(structuredClone(this.config),o),s=Ge(i);if(!s.ok){if(this.validationIssues=s.issues,!this._validationToastId){let n=s.issues.slice(0,3).map(l=>`\u2022 ${l.message}`).join(`
|
|
3303
3303
|
`);this._validationToastId=await m.toast(`Design has accessibility issues. Fix before saving.
|
|
3304
|
-
${n}`,{type:"error"})}return}this.validationIssues=[];try{this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch{}this.config=i,console.log("Updated (persisted) config (not applied):",this.config),this.saveConfig(),t&&(console.log("\u{1F514} Emitting design-field-changed event for field:",t),m.dispatchEvent(new CustomEvent("pds:design:field:changed",{detail:{field:t,config:this.config}})));try{this.#n&&(clearTimeout(this.#n),this.#n=null),this.#n=setTimeout(()=>{this.#n=null,this.applyStyles(!0)},this.#
|
|
3304
|
+
${n}`,{type:"error"})}return}this.validationIssues=[];try{this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch{}this.config=i,console.log("Updated (persisted) config (not applied):",this.config),this.saveConfig(),t&&(console.log("\u{1F514} Emitting design-field-changed event for field:",t),m.dispatchEvent(new CustomEvent("pds:design:field:changed",{detail:{field:t,config:this.config}})));try{this.#n&&(clearTimeout(this.#n),this.#n=null),this.#n=setTimeout(()=>{this.#n=null,this.applyStyles(!0)},this.#a)}catch(n){console.warn("Failed to schedule applyStyles with user config:",n)}};handleReset=async()=>{if(await m.ask("Reset to default configuration? This will clear your saved settings.")){this._stored={preset:"default",design:{}};let e=this._resolvePresetBase("default");this.config=JSON.parse(JSON.stringify(e)),this.formValues=this.filterConfigForSchema(this.config),this.formKey=(this.formKey||0)+1,this.saveConfig(),this.applyStyles(!0),await m.toast("Configuration reset to defaults",{type:"info",duration:2e3})}};applyPreset=async r=>{if(await m.ask(`Load "${r.name}" preset? This will replace your current settings.`)){let t=JSON.parse(JSON.stringify(r)),o=Ge(t);if(!o.ok){if(this.validationIssues=o.issues,!this._validationToastId){let a=o.issues.slice(0,3).map(i=>`\u2022 ${i.message}`).join(`
|
|
3305
3305
|
`);this._validationToastId=await m.toast(`Preset "${r.name}" has accessibility issues \u2014 not applied.
|
|
3306
3306
|
${a}`,{type:"error",persistent:!0})}return}this.validationIssues=[];try{this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch{}this.config=t,this._stored={preset:(r.id||r.name||"").toLowerCase(),design:{}},this.formValues=this.filterConfigForSchema(this.config),this.saveConfig(),this.applyStyles(!0),await m.toast(`"${r.name}" preset loaded successfully!`,{type:"success",duration:3e3})}};async handleThemeChange(r){try{let e=r.target.value;m.theme=e,this.applyStyles(!0),await m.toast(`Theme set to ${e}`,{type:"info",duration:1200})}catch(e){console.warn("Failed to change theme:",e)}}handleDownload=r=>{let e,t,o;switch(r){case"css":e=this.generator.layeredCSS,t="pure-ds.css",o="text/css";break;case"config":e=`// Pure Design System Configuration
|
|
3307
3307
|
// Generated: ${new Date().toISOString()}
|
|
@@ -3309,7 +3309,7 @@ ${a}`,{type:"error",persistent:!0})}return}this.validationIssues=[];try{this._va
|
|
|
3309
3309
|
import { PDS } from 'pure-ds';
|
|
3310
3310
|
|
|
3311
3311
|
export const pdsConfig = ${JSON.stringify(this.config,null,2)};
|
|
3312
|
-
`,t="pds.config.js",o="text/javascript";break;case"tokens":let n
|
|
3312
|
+
`,t="pds.config.js",o="text/javascript";break;case"tokens":let n=Cr(this.generator.generateTokens());e=JSON.stringify(n,null,2),t="design-tokens.json",o="application/json";break}let a=new Blob([e],{type:o}),i=URL.createObjectURL(a),s=document.createElement("a");s.href=i,s.download=t,s.click(),URL.revokeObjectURL(i)};render(){return this.schema?S`
|
|
3313
3313
|
<div class="designer-container">
|
|
3314
3314
|
<div class="designer-toolbar">
|
|
3315
3315
|
<label data-toggle id="mode-toggle">
|
|
@@ -3457,7 +3457,7 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
|
|
|
3457
3457
|
<span style="background-color: ${e.colors.primary}"></span>
|
|
3458
3458
|
<span style="background-color: ${e.colors.secondary}"></span>
|
|
3459
3459
|
<span style="background-color: ${e.colors.accent}"></span>
|
|
3460
|
-
</span>`},categories:{Presets:{action:r=>{let e=m.presets[r.id];this.applyPreset(e)},getItems:r=>{let t=Object.values(m.presets),o=[];if(r.search.length>0){let a=0;o=t.filter(i=>(a++,a<=10&&i.name.toLowerCase().includes(r.search.toLowerCase())||i.description&&i.description.toLowerCase().includes(r.search.toLowerCase())))}else o=t.filter(a=>a.tags?.includes("featured")).slice(0,10);return o.map(a=>({id:a.id,text:a.name,description:a.description,icon:"palette"}))}}}}}_designerUiSchema(){let r=["system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial","'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif","Roboto, 'Helvetica Neue', Arial, sans-serif","Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif","ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"],e={};return e["/typography/fontFamilyHeadings"]={"ui:datalist":r},e["/typography/fontFamilyBody"]={"ui:datalist":r},e["/typography/fontFamilyMono"]={"ui:datalist":["ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace","Consolas, 'Liberation Mono', Menlo, monospace","'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace"]},e["/typography/baseFontSize"]={"ui:widget":"input-range","ui:min":12,"ui:max":24},e["/typography/fontScale"]={"ui:widget":"input-range","ui:min":1.1,"ui:max":1.618,"ui:step":.01},e["/spatialRhythm/baseUnit"]={"ui:widget":"input-range","ui:min":4,"ui:max":32},e["/colors/darkMode/background"]={"ui:widget":"input-color"},e["/colors/darkMode/secondary"]={"ui:widget":"input-color"},e["/spatialRhythm/containerPadding"]={"ui:widget":"input-range","ui:min":0,"ui:max":4},e}});Ce();customElements.define("pds-demo",class extends _{#
|
|
3460
|
+
</span>`},categories:{Presets:{action:r=>{let e=m.presets[r.id];this.applyPreset(e)},getItems:r=>{let t=Object.values(m.presets),o=[];if(r.search.length>0){let a=0;o=t.filter(i=>(a++,a<=10&&i.name.toLowerCase().includes(r.search.toLowerCase())||i.description&&i.description.toLowerCase().includes(r.search.toLowerCase())))}else o=t.filter(a=>a.tags?.includes("featured")).slice(0,10);return o.map(a=>({id:a.id,text:a.name,description:a.description,icon:"palette"}))}}}}}_designerUiSchema(){let r=["system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial","'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif","Roboto, 'Helvetica Neue', Arial, sans-serif","Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif","ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"],e={};return e["/typography/fontFamilyHeadings"]={"ui:datalist":r},e["/typography/fontFamilyBody"]={"ui:datalist":r},e["/typography/fontFamilyMono"]={"ui:datalist":["ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace","Consolas, 'Liberation Mono', Menlo, monospace","'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace"]},e["/typography/baseFontSize"]={"ui:widget":"input-range","ui:min":12,"ui:max":24},e["/typography/fontScale"]={"ui:widget":"input-range","ui:min":1.1,"ui:max":1.618,"ui:step":.01},e["/spatialRhythm/baseUnit"]={"ui:widget":"input-range","ui:min":4,"ui:max":32},e["/colors/darkMode/background"]={"ui:widget":"input-color"},e["/colors/darkMode/secondary"]={"ui:widget":"input-color"},e["/spatialRhythm/containerPadding"]={"ui:widget":"input-range","ui:min":0,"ui:max":4},e}});Ce();customElements.define("pds-demo",class extends _{#o=null;#e=!1;static properties={config:{type:Object},designer:{type:Object},sections:{type:Array,state:!0},inspectorActive:{type:Boolean,state:!0}};constructor(){super(),this.config=null,this.designer=null,this.sections=[],this.inspectorActive=!1,this._docsBase="/pds",this._showdown=null,this._showdownLoading=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),m.addEventListener("pds:design:updated",r=>{this.config=r.detail.config,this.designer=r.detail.designer,this.config&&this.config.staticBase&&(this._docsBase="/"+String(this.config.staticBase).replace(/^\/+|\/+$/g,""))}),m.addEventListener("pds:design:field:changed",r=>{setTimeout(()=>{this.scrollToRelevantSection(r.detail.field)},1e3)}),m.addEventListener("pds:inspector:mode:changed",r=>{this.inspectorActive=r.detail.active}),setTimeout(()=>{this.extractSections(),this.handleInitialHash()},100),this._inspectorCaptureHandler=r=>{if(!this.inspectorActive)return;let e=r.target;if(e.closest&&e.closest("a[href]")){r.preventDefault();return}if(e.closest&&e.closest("button")){r.preventDefault();return}},this.addEventListener("click",this._inspectorCaptureHandler,!0);try{let r=window.PDS_DOCS_BASE;typeof r=="string"&&r.trim()&&(this._docsBase=r.replace(/\/+$/,""))}catch{}this.config&&this.config.staticBase&&(this._docsBase="/"+String(this.config.staticBase).replace(/^\/+|\/+$/g,"")),m.addEventListener("pds:docs:view",async r=>{let e=r.detail&&r.detail.file||"README.md";await this._renderDocToDialog(e)})}disconnectedCallback(){super.disconnectedCallback(),this._inspectorCaptureHandler&&(this.removeEventListener("click",this._inspectorCaptureHandler,!0),this._inspectorCaptureHandler=null)}async fetchDocHTML(r="README.md"){let e=this._docsBase||"/pds",t=`${e.replace(/\/+$/,"")}/${r}`;try{let o=await fetch(t,{cache:"no-cache"});if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);let a=await o.text(),i=await this.getShowdownConverter();return i?i.makeHtml(a):`<pre>${this.escapeHTML(a)}</pre>`}catch(o){return`<p>Failed to load ${r} from ${e}: ${String(o.message||o)}</p>`}}async _renderDocToDialog(r){let e=await this.fetchDocHTML(r),t=document.getElementById("pds-docs-dialog");t||(t=document.createElement("dialog"),t.id="pds-docs-dialog",t.style.width="min(900px, 90vw)",t.style.maxHeight="85vh",t.style.padding="0",t.innerHTML=`<div style="padding:16px 20px; overflow:auto; max-height:85vh">
|
|
3461
3461
|
<div class="markdown-body"></div>
|
|
3462
3462
|
</div>`,document.body.appendChild(t));let o=t.querySelector(".markdown-body");o&&(o.innerHTML=e),t.open||t.showModal()}deactivateInspector(){m.dispatchEvent(new CustomEvent("pds:inspector:deactivate",{detail:{}}))}extractSections(){let r=this.querySelectorAll("[data-section]");this.sections=Array.from(r).map(e=>{let t=e.getAttribute("data-section"),a=e.querySelector("h2")?.textContent?.trim()||t;return{id:t,title:a}})}handleInitialHash(){let r=window.location.hash.slice(1);if(r){let e=this.querySelector(`[data-section="${r}"]`);e&&setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"start"})},300)}}detectComponentElement(r){let e=r,t="element",o=e.tagName.toLowerCase();if(e.closest(".showcase-toc")||e.tagName==="DS-SHOWCASE"||e.classList.contains("showcase-section")||e.closest(".showcase-section")===e)return null;let a=this.findEnhancedElement(e);if(a)return{element:a,componentType:"enhanced-component",displayName:this.getEnhancedElementName(a)};let i=["FIGURE","TABLE","DETAILS","VIDEO","AUDIO","PICTURE","BLOCKQUOTE","PRE","CODE"];if(i.includes(e.tagName))return{element:e,componentType:"html-primitive",displayName:e.tagName.toLowerCase()};for(let c of i){let u=e.closest(c.toLowerCase());if(u)return{element:u,componentType:"html-primitive",displayName:c.toLowerCase()}}let s=this.findPDSStyledElement(e);if(s)return s;if(e.tagName==="FIELDSET"){let c=e.getAttribute("role");if(c==="group"||c==="radiogroup")return t="form-group",o=c==="radiogroup"?"radio group":"form group",{element:e,componentType:t,displayName:o}}let n=e.closest('fieldset[role="group"], fieldset[role="radiogroup"]');if(n){let c=n.getAttribute("role");return{element:n,componentType:"form-group",displayName:c==="radiogroup"?"radio group":"form group"}}if(e.tagName==="LABEL"||e.closest("label")){let c=e.tagName==="LABEL"?e:e.closest("label"),u=c.querySelector("input, select, textarea");if(u)return t="form-control",o=`${u.tagName.toLowerCase()} field`,{element:c,componentType:t,displayName:o}}if(["INPUT","SELECT","TEXTAREA"].includes(e.tagName)){let c=e.closest("label");return c?(e=c,t="form-control",o=`${r.tagName.toLowerCase()} field`,{element:e,componentType:t,displayName:o}):(t="form-control",o=`${e.tagName.toLowerCase()}`,{element:e,componentType:t,displayName:o})}if(e.tagName.includes("-"))return t="web-component",o=e.tagName.toLowerCase(),{element:e,componentType:t,displayName:o};let l=e.closest("[tagName*='-']");if(l&&l.tagName.includes("-"))return{element:l,componentType:"web-component",displayName:l.tagName.toLowerCase()};if(e.tagName==="BUTTON"||e.closest("button"))return e=e.tagName==="BUTTON"?e:e.closest("button"),t="button",o=e.querySelector("pds-icon")?"button with icon":"button",{element:e,componentType:t,displayName:o};if(e.tagName==="pds-icon"||e.closest("pds-icon"))return e=e.tagName==="pds-icon"?e:e.closest("pds-icon"),t="icon",o=`pds-icon (${e.getAttribute("icon")||"unknown"})`,{element:e,componentType:t,displayName:o};if(e.tagName==="NAV"||e.closest("nav[data-dropdown]"))return e=e.closest("nav[data-dropdown]")||e,t="navigation",o="dropdown menu",{element:e,componentType:t,displayName:o};let d=["color-card","color-scale","grid","flex-wrap","btn-group"];for(let c of d){if(e.classList.contains(c))return t="container",o=c.replace(/-/g," "),{element:e,componentType:t,displayName:o};let u=e.closest(`.${c}`);if(u)return e=u,t="container",o=c.replace(/-/g," "),{element:e,componentType:t,displayName:o}}let p=this.findNearestComponent(e);return p&&p!==e?this.detectComponentElement(p):{element:e,componentType:t,displayName:o}}findPDSStyledElement(r){let e=m.findComponentForElement(r,{maxDepth:5});return!e||e.element&&e.element.tagName==="DS-SHOWCASE"?null:{element:e.element,componentType:e.componentType||"pds-primitive",displayName:e.displayName||(e.element?.tagName||"element").toLowerCase()}}findEnhancedElement(r){let e=["nav[data-dropdown]","label[data-toggle]","[data-tabs]","[data-modal]","[data-tooltip]"];for(let t of e){if(r.matches&&r.matches(t))return r;let o=r.closest(t);if(o)return o}return null}getEnhancedElementName(r){if(r.matches("nav[data-dropdown]"))return"dropdown menu";if(r.matches("label[data-toggle]"))return"toggle switch";if(r.matches("[data-tabs]"))return"tab component";if(r.matches("[data-modal]"))return"modal dialog";if(r.matches("[data-tooltip]"))return"tooltip";let e=Array.from(r.attributes).filter(t=>t.name.startsWith("data-")).map(t=>t.name.replace("data-",""));return e[0]?`${e[0]} component`:r.tagName.toLowerCase()}findNearestComponent(r){let e=r.parentElement,t=0,o=5;for(;e&&t<o;){if(t++,e.tagName==="DS-SHOWCASE")return null;if(e.classList.contains("showcase-section")){e=e.parentElement;continue}if(e.tagName.includes("-")||e.tagName==="BUTTON"||e.tagName==="NAV"||e.tagName==="FIELDSET"||e.tagName==="LABEL"||e.tagName==="TABLE"||e.tagName==="FIGURE"||e.tagName==="BLOCKQUOTE"||e.tagName==="ARTICLE"||e.hasAttribute("role")||e.hasAttribute("data-dropdown")||e.hasAttribute("data-toggle")||this.hasPDSClass(e))return e;e=e.parentElement}return null}hasPDSClass(r){let e=["card","surface","tag","badge","pill","chip","callout","toast","notification","message","accordion","collapse","expandable","list-group","menu-list","nav-list","breadcrumb","pagination","tabs","tab","progress","spinner","loader","skeleton","divider","separator","avatar","thumbnail","form-group","input-group","checkbox-group","radio-group","btn-","icon-only","dropdown","popover","tooltip","modal","dialog","table-responsive","data-table","card-grid","media-object","status","indicator","dot-indicator","pulse"];return Array.from(r.classList).some(t=>e.some(o=>t.startsWith(o)))}extractHTML(r){let e=r.cloneNode(!0);[e,...e.querySelectorAll("*")].forEach(i=>{i.removeAttribute&&(i.removeAttribute("_$litPart$"),i.removeAttribute("_$litElement$"))});let o=this.formatHTMLElement(e),a=this.extractLitProperties(r);return{html:o,litProps:a}}extractLitProperties(r){let e=[];if(r.checked!==void 0&&r.type==="checkbox"&&e.push({name:".checked",value:r.checked}),r.value!==void 0&&["INPUT","SELECT","TEXTAREA"].includes(r.tagName)&&e.push({name:".value",value:r.value}),r.tagName.includes("-")){let t=customElements.get(r.tagName.toLowerCase());t&&t.properties&&Object.keys(t.properties).forEach(o=>{r[o]!==void 0&&typeof r[o]!="function"&&e.push({name:`.${o}`,value:r[o]})})}return e}formatHTMLElement(r,e=0){let t=s=>" ".repeat(s),o="",a=s=>s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),i=s=>["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"].includes(s);if(r.nodeType===Node.TEXT_NODE){let s=r.textContent.replace(/\s+/g," ").trim();return s.length===0?"":t(e)+a(s)+`
|
|
3463
3463
|
`}if(r.nodeType===Node.COMMENT_NODE){let s=r.textContent||"";return s===""||s.startsWith("?lit$")||s.startsWith("lit-part")||s==="/lit-part"?"":t(e)+`<!-- ${a(s)} -->
|
|
@@ -3512,7 +3512,7 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
|
|
|
3512
3512
|
`,setTimeout(()=>{c.innerHTML=`
|
|
3513
3513
|
<pds-icon icon="clipboard" size="sm"></pds-icon>
|
|
3514
3514
|
Copy HTML
|
|
3515
|
-
`},2e3)})})},100)}async loadShiki(){if(this.#
|
|
3515
|
+
`},2e3)})})},100)}async loadShiki(){if(this.#o)return this.#o;if(this.#e){for(;this.#e;)await new Promise(r=>setTimeout(r,50));return this.#o}this.#e=!0;try{let r=await import("https://esm.sh/shiki@1.0.0");return this.#o=await r.getHighlighter({themes:["github-dark","github-light"],langs:["html","css","javascript","json"]}),this.#o}catch(r){return console.error("Failed to load Shiki:",r),null}finally{this.#e=!1}}async highlightWithShiki(r,e="html"){let t=await this.loadShiki();if(!t)return this.escapeHTML(r);try{let a=document.documentElement.getAttribute("data-theme")==="dark"?"github-dark":"github-light",s=t.codeToHtml(r,{lang:e,theme:a}).match(/<code[^>]*>([\s\S]*)<\/code>/);return s?s[1]:this.escapeHTML(r)}catch(o){return console.error("Shiki highlighting failed:",o),this.escapeHTML(r)}}escapeHTML(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async getShowdownConverter(){if(this._showdown)return this._showdown;let r=await this.loadShowdownFromCDN();return!r||!r.Converter?null:(this._showdown=new r.Converter({ghCompatibleHeaderId:!0,tables:!0,strikethrough:!0,tasklists:!0}),this._showdown)}async loadShowdownFromCDN(){if(typeof window<"u"&&window.showdown)return window.showdown;if(this._showdownLoading){for(;this._showdownLoading;)await new Promise(e=>setTimeout(e,50));return window.showdown||null}this._showdownLoading=!0;let r=["https://cdn.jsdelivr.net/npm/showdown@2.1.0/dist/showdown.min.js","https://unpkg.com/showdown@2.1.0/dist/showdown.min.js"];for(let e of r)try{if(await this._injectScript(e,"showdown"),window.showdown)return this._showdownLoading=!1,window.showdown}catch{}return this._showdownLoading=!1,null}_injectScript(r,e){return new Promise((t,o)=>{if(document.querySelector(`script[data-lib="${e}"][src="${r}"]`)){setTimeout(t,0);return}let a=document.createElement("script");a.src=r,a.async=!0,a.defer=!0,a.dataset.lib=e||"lib",a.onload=()=>t(),a.onerror=()=>{a.remove(),o(new Error(`Failed to load script: ${r}`))},document.head.appendChild(a)})}scrollToRelevantSection(r){console.log("?? Scrolling to section for field:",r);let e=r.startsWith("/")?r.slice(1):r;console.log(" Normalized path:",e);let t={"colors/primary":"color-system","colors/secondary":"color-system","colors/accent":"color-system","colors/background":"color-system","colors/success":"color-system","colors/warning":"color-system","colors/danger":"color-system","colors/info":"color-system","typography/":"typography","spatialRhythm/":"spacing","layers/":"surfaces-shadows","shape/":"buttons","behavior/transitionSpeed":"interactive-states","behavior/":"interactive-states","components/forms":"forms","components/alerts":"callouts","components/badges":"badges","components/tables":"tables","components/toasts":"toasts","components/modals":"modals","components/tabStrip":"tabs","icons/":"icons"},o=null;for(let[a,i]of Object.entries(t))if(e.startsWith(a)){o=i,console.log(` ? Matched pattern "${a}" ? section "${i}"`);break}if(o){let a=this.querySelector(`[data-section="${o}"]`);console.log(` Searching for section: [data-section="${o}"]`,a?"? Found":"? Not found"),a?(a.scrollIntoView({behavior:"smooth",block:"start"}),a.style.transition="background-color 0.3s ease",a.style.backgroundColor="var(--color-primary-50)",setTimeout(()=>{a.style.backgroundColor=""},1500),console.log(" ? Scrolled and highlighted section")):console.warn(` ? Section [data-section="${o}"] not found in DOM`)}else console.warn(` ? No section mapping found for field: ${r}`)}renderDisabledSection(r,e){return S`
|
|
3516
3516
|
<section class="showcase-section disabled">
|
|
3517
3517
|
<h2>${r}</h2>
|
|
3518
3518
|
<p class="disabled-message">${e}</p>
|
|
@@ -3532,6 +3532,11 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
|
|
|
3532
3532
|
</div>
|
|
3533
3533
|
</nav>
|
|
3534
3534
|
`}get autoCompleteSettings(){return{iconHandler:r=>r.icon?`<pds-icon icon="${r.icon}"></pds-icon>`:null,categories:{Sections:{action:r=>{document.querySelector(`[data-section="${r.id}"]`).scrollIntoView({behavior:"smooth",block:"start"})},trigger:r=>r.search.length===0,getItems:r=>this.sections.map(e=>({text:e.title,id:e.id,icon:"folder-simple"}))},Query:{action:r=>{r.code&&navigator.clipboard&&navigator.clipboard.writeText(r.code).then(()=>{m.dispatchEvent(new CustomEvent("pds:toast",{detail:{message:"Code copied to clipboard",type:"success",duration:2e3}}))});let e=r.category?.toLowerCase()||"",t=null;if(e.includes("color")||e.includes("surface")?t="color-system":e.includes("utility")||e.includes("layout")?t="utilities":e.includes("component")?t="components":e.includes("typography")?t="typography":e.includes("spacing")&&(t="spacing"),t){let o=document.querySelector(`[data-section="${t}"]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})}},trigger:r=>r.search.length>=2,getItems:async r=>{let e=(r.search||"").trim();if(!e)return[];try{return(await m.query(e)).map(o=>({text:o.text,id:o.value,icon:o.icon||"magnifying-glass",category:o.category,code:o.code,cssVar:o.cssVar,description:o.description}))}catch(t){return console.error("Query error:",t),[]}}},Search:{action:r=>{let e=r.id||"",t=(r.search||"").toLowerCase(),[o,a]=e.split("|"),i=this.sections.find(s=>s.id===a);if(i||(i=this.sections.find(s=>s.title?.toLowerCase().includes(a?.toLowerCase?.()||"")||s.id?.toLowerCase().includes(a?.toLowerCase?.()||"")||s.title?.toLowerCase().includes(t)||s.id?.toLowerCase().includes(t))),!i&&t)for(let s of this.sections){let n=this.querySelector(`[data-section="${s.id}"]`);if(!n)continue;if((n.innerText||"").toLowerCase().includes(t)||s.title.toLowerCase().includes(t)){i=s;break}}if(i){let s=this.querySelector(`[data-section="${i.id}"]`);s&&s.scrollIntoView({behavior:"smooth",block:"start"})}else if((this.innerText||"").toLowerCase().indexOf(t)!==-1)for(let l of this.sections){let d=this.querySelector(`[data-section="${l.id}"]`);if(d&&(d.innerText||"").toLowerCase().includes(t)){d.scrollIntoView({behavior:"smooth",block:"start"});break}}},trigger:r=>r.search.length>1,getItems:r=>{let e=(r.search||"").trim().toLowerCase();if(!e)return[];let t=[];for(let a of m.ontology.primitives||[]){let i=(a.name||a.id||"").toString(),s=a.id||i.replace(/\s+/g,"-").toLowerCase(),n=(i.toLowerCase().includes(e)?30:0)+(s.includes(e)?20:0),l=(a.selectors||[]).some(p=>String(p).toLowerCase().includes(e)),d=n+(l?10:0);t.push({type:"primitive",key:s,name:i,score:d})}for(let a of m.ontology.components||[]){let i=(a.name||a.id||"").toString(),s=a.id||i.replace(/\s+/g,"-").toLowerCase(),n=(i.toLowerCase().includes(e)?40:0)+(s.includes(e)?25:0),l=(a.selectors||[]).some(p=>String(p).toLowerCase().includes(e)),d=n+(l?10:0);t.push({type:"component",key:s,name:i,score:d})}if(m.ontology.tokens){for(let[a,i]of Object.entries(m.ontology.tokens))if(Array.isArray(i))for(let s of i){let n=`${a}/${s}`,l=`${a}-${s}`,d=n.toLowerCase().includes(e)?35:0;t.push({type:"token",key:l,name:n,score:d})}}for(let a of m.ontology.enhancements||[]){let i=String(a),s=`enh-${i.replace(/[^a-z0-9]+/gi,"-")}`.toLowerCase(),n=i.toLowerCase().includes(e)?25:0;t.push({type:"enhancement",key:s,name:i,score:n})}for(let a of m.ontology.utilities||[]){let i=String(a),s=`util-${i.replace(/[^a-z0-9]+/gi,"-")}`.toLowerCase(),n=i.toLowerCase().includes(e)?20:0;t.push({type:"utility",key:s,name:i,score:n})}if(m.ontology.styles)for(let[a,i]of Object.entries(m.ontology.styles)){let s=a,n=`style-${a}`,l=s.toLowerCase().includes(e)?10:0;t.push({type:"style",key:n,name:s,score:l})}for(let a of t){let i=(a.name||"").toLowerCase(),s=(a.key||"").toLowerCase();i.includes(e)&&(a.score+=50),s.includes(e)&&(a.score+=20)}return t.filter(a=>a.score>0).sort((a,i)=>i.score-a.score).slice(0,30).map(a=>({text:a.name,id:`${a.type}|${a.key}`,icon:a.type==="component"?"brackets-curly":a.type==="primitive"?"tag":a.type==="token"?"palette":"folder-simple"}))}}}}}render(){let r=this.config?.components||{},e=typeof document<"u"&&document.documentElement?.getAttribute("data-theme")||"light",t=e==="dark"?"Light Surfaces in Dark Mode":"Dark Surfaces in Light Mode",o=e==="dark"?"light surface in dark mode":"dark surface in light mode";return S`
|
|
3535
|
+
|
|
3536
|
+
<pds-fab>
|
|
3537
|
+
<pds-icon icon="plus" .satellites=${[{key:"test",icon:"code",label:"Code"}]}></pds-icon>
|
|
3538
|
+
</pds-fab>
|
|
3539
|
+
|
|
3535
3540
|
<div
|
|
3536
3541
|
class="showcase-container ${this.inspectorActive?"inspector-active":""}"
|
|
3537
3542
|
@click=${this.handleInspectorClick}
|
package/public/assets/js/lit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var I=globalThis,G=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rt=Symbol(),
|
|
2
|
-
\f\r]`,D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ut=/'/g,Ht=/"/g,Ot=/^(?:script|style|textarea|title)$/i,ut=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),F=ut(1),ft=ut(2),Dt=ut(3),_=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Rt=new WeakMap,x=w.createTreeWalker(w,129);function Lt(s,t){if(!pt(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Tt!==void 0?Tt.createHTML(t):t}var kt=(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=Pt:p[1]!==void 0?n=Mt:p[2]!==void 0?(Ot.test(p[2])&&(r=RegExp("</"+p[2],"g")),n=E):p[3]!==void 0&&(n=E):n===E?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?E:p[3]==='"'?Ht:Ut):n===Ht||n===Ut?n=E:n===Pt||n===Mt?n=D:(n=E,r=void 0);let u=n===E&&s[c+1].startsWith("/>")?" ":"";o+=n===D?a+oe:h>=0?(i.push(l),a.slice(0,h)+lt+a.slice(h)+y+u):a+y+(h===-2?c:u)}return[Lt(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},V=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]=kt(t,e);if(this.el=s.createElement(l,i),x.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=x.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:T}),r.removeAttribute(h)}else h.startsWith(y)&&(a.push({type:6,index:o}),r.removeAttribute(h));if(Ot.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()),x.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===_)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);x.currentNode=r;let o=x.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 X(o,this,t)),this._$AV.push(l),a=i[++c]}n!==a?.index&&(o=x.nextNode(),n++)}return x.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!==_&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Nt(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=V.createElement(Lt(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 V(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))}},T=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!==_,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===_&&(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 T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},Z=class extends T{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},Y=class extends T{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)===_)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)}},X=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:kt,R:K,D:Nt,V:b,I:U,H:T,N:Z,U:Y,B:q,F:X},ne=ct.litHtmlPolyfillSupport;ne?.(V,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,P=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 _}};P._$litElement$=!0,P.finalized=!0,_t.litElementHydrateSupport?.({LitElement:P});var ae=_t.litElementPolyfillSupport;ae?.({LitElement:P});(_t.litElementVersions??=[]).push("4.2.1");var S={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},m=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:he}=Vt,Bt=s=>s===null||typeof s!="object"&&typeof s!="function";var It=s=>s.strings===void 0,jt=()=>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(jt(),r),n=i.insertBefore(jt(),r);e=new he(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),ce={},J=(s,t=ce)=>s._$AH=t,Gt=s=>s._$AH,Q=s=>{s._$AR(),s._$AA.remove()};var zt=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},Xe=m(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=Gt(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=zt(n,u,$),p=zt(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 yt=H(s,r[h]);C(yt,o[u]),a[u]=yt}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,J(s,a),_}});var rs=m(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&&(J(s),this.key=t),e}});var ds=m(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 _}});var j=(s,t)=>{let e=s._$AN;if(e===void 0)return!1;for(let i of e)i._$AO?.(t,!1),j(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)},Wt=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),pe(t)}};function le(s){this._$AN!==void 0?(tt(this),this._$AM=s,Wt(this)):this._$AM=s}function de(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++)j(i[o],!1),tt(i[o]);else i!=null&&(j(i,!1),tt(i));else j(this,s)}var pe=s=>{s.type==S.CHILD&&(s._$AP??=de,s._$AQ??=le)},R=class extends A{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Wt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(j(this,t),tt(this))}setValue(t){if(It(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 ue=()=>new At,At=class{},mt=new WeakMap,fe=m(class extends R{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 $e=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 Kt=s=>!Bt(s)&&typeof s.then=="function",qt=1073741823,gt=class extends R{constructor(){super(...arguments),this._$Cwt=qt,this._$Cbt=[],this._$CK=new et(this),this._$CX=new st}render(...t){return t.find(e=>!Kt(e))??_}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(!Kt(a))return this._$Cwt=c,a;c<r&&a===i[c]||(this._$Cwt=qt,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 _}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},_e=m(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===_)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 me=m(M);var B=class extends M{};B.directiveName="unsafeSVG",B.resultType=2;var Ae=m(B);var ge=["127.0.0.1","localhost"].includes(window.location.hostname),ve=s=>typeof s!="string"&&"strTag"in s;function ye(s){let t="";for(let e=0;e<=s.length-1;e++)t+=s[e],e<s.length-1&&(t+=`{${e}}`);return t}function Se(s,t){return s.replace(/\{(\d+)\}/g,(e,i)=>t(i))}var Ce=(s,t,e)=>{let i=ye(s),r=Zt(i,e);return Se(r,o=>t[o])};function Zt(s,t={}){window.__strings=window.__strings??{};let e=window.__strings[s]?.content;return!e&&ge&&console.log("\u{1F310}",s,t.desc?`(${t.desc})`:""),window.env?.DEBUG_TRANSLATIONS?`__${e??s}`:e??s}var Ee=(s,t={})=>s?ve(s)?Ce(s.strings,s.values,t):Zt(s,t):"";var Xt=Symbol.for(""),xe=s=>{if(s?.r===Xt)return s?._$litStatic$},we=s=>({_$litStatic$:s,r:Xt});var Yt=new Map,vt=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=xe(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=Yt.get(h))===void 0&&(n.raw=n,Yt.set(h,t=n)),e=c}return s(t,...e)},be=vt(F),Js=vt(ft),Qs=vt(Dt);var ri=F,oi=ot;async function ni(s){try{window.__strings=await fetch(`/assets/locales/${s}.json`).then(t=>t.json())}catch{window.__strings={}}}export{P as LitElement,ds as classMap,ue as createRef,oi as css,ri as html,$e as ifDefined,rs as keyed,ni as loadLocale,Ee as msg,d as nothing,fe as ref,$t as render,Xe as repeat,be as staticHtml,ft as svg,me as unsafeHTML,Ae as unsafeSVG,we as unsafeStatic,_e as until};
|
|
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}},Et=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)},xt=(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 Et(e)})(s):s;var{is:Ft,defineProperty:Qt,getOwnPropertyDescriptor:te,getOwnPropertyNames:ee,getOwnPropertySymbols:se,getPrototypeOf:ie}=Object,z=globalThis,wt=z.trustedTypes,re=wt?wt.emptyScript:"",oe=z.reactiveElementPolyfillSupport,O=(s,t)=>s,at={toAttribute(s,t){switch(t){case Boolean:s=s?re: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)=>!Ft(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&&Qt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=te(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=ie(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=[...ee(e),...se(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 xt(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,oe?.({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,ne=`<${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,E=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,x=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=E):p[3]!==void 0&&(n=E):n===E?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?E:p[3]==='"'?Nt:Ht):n===Nt||n===Ht?n=E:n===Mt||n===Ut?n=D:(n=E,r=void 0);let u=n===E&&s[c+1].startsWith("/>")?" ":"";o+=n===D?a+ne: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),x.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=x.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()),x.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);x.currentNode=r;let o=x.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=x.nextNode(),n++)}return x.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},ae=ct.litHtmlPolyfillSupport;ae?.(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 he=_t.litElementPolyfillSupport;he?.({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:ce}=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 ce(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),le={},F=(s,t=le)=>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},Xe=_(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 os=_(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 ps=_(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),ue(t)}};function de(s){this._$AN!==void 0?(tt(this),this._$AM=s,Kt(this)):this._$AM=s}function pe(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 ue=s=>{s.type==S.CHILD&&(s._$AP??=pe,s._$AQ??=de)},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 fe=()=>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 _e=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()}},me=_(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 Ae=_(M);var B=class extends M{};B.directiveName="unsafeSVG",B.resultType=2;var ge=_(B);var ve=["127.0.0.1","localhost"].includes(window.location.hostname),ye=s=>typeof s!="string"&&"strTag"in s;function Se(s){let t="";for(let e=0;e<=s.length-1;e++)t+=s[e],e<s.length-1&&(t+=`{${e}}`);return t}function Ce(s,t){return s.replace(/\{(\d+)\}/g,(e,i)=>t(i))}var Ee=(s,t,e)=>{let i=Se(s),r=Yt(i,e);return Ce(r,o=>t[o])};function Yt(s,t={}){window.__strings=window.__strings??{};let e=window.__strings[s]?.content;return!e&&ve&&console.log("\u{1F310}",s,t.desc?`(${t.desc})`:""),window.env?.DEBUG_TRANSLATIONS?`__${e??s}`:e??s}var xe=(s,t={})=>s?ye(s)?Ee(s.strings,s.values,t):Yt(s,t):"";var Xt=Symbol.for(""),we=s=>{if(s?.r===Xt)return s?._$litStatic$},be=s=>({_$litStatic$:s,r:Xt});var Jt=new Map,vt=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=we(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=Jt.get(h))===void 0&&(n.raw=n,Jt.set(h,t=n)),e=c}return s(t,...e)},Pe=vt(X),ei=vt(ft),si=vt(Lt);var ai=X,hi=ot;var yt=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}},li=_(yt);async function di(s){try{window.__strings=await fetch(`/assets/locales/${s}.json`).then(t=>t.json())}catch{window.__strings={}}}export{T as LitElement,ps as classMap,fe as createRef,hi as css,ai as html,_e as ifDefined,os as keyed,li as lazyProps,di as loadLocale,xe as msg,d as nothing,$e as ref,$t as render,Xe as repeat,Pe as staticHtml,ft as svg,Ae as unsafeHTML,ge as unsafeSVG,be as unsafeStatic,me as until};
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
@lit/reactive-element/css-tag.js:
|
|
@@ -270,7 +270,7 @@ export class PdsFab extends HTMLElement {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
#render() {
|
|
273
|
-
const count = this
|
|
273
|
+
const count = this.satellites.length;
|
|
274
274
|
|
|
275
275
|
// Auto-adjust spread and radius if not explicitly set by user
|
|
276
276
|
const hasCustomRadius = this.#hasCustomRadius;
|
|
@@ -415,8 +415,6 @@ export class PdsFab extends HTMLElement {
|
|
|
415
415
|
|
|
416
416
|
.sat pds-icon,
|
|
417
417
|
.sat ::slotted(pds-icon) {
|
|
418
|
-
width: 60%;
|
|
419
|
-
height: 60%;
|
|
420
418
|
pointer-events: none;
|
|
421
419
|
}
|
|
422
420
|
|
|
@@ -429,7 +427,7 @@ export class PdsFab extends HTMLElement {
|
|
|
429
427
|
</style>
|
|
430
428
|
|
|
431
429
|
<div class="wrap" role="group" aria-label="Floating actions">
|
|
432
|
-
${this
|
|
430
|
+
${this.satellites.map((sat, i) => {
|
|
433
431
|
const angleDeg = startAngle + step * i;
|
|
434
432
|
const rad = (angleDeg * Math.PI) / 180;
|
|
435
433
|
const tx = Math.cos(rad) * activeRadius;
|
|
@@ -497,7 +495,7 @@ export class PdsFab extends HTMLElement {
|
|
|
497
495
|
}
|
|
498
496
|
|
|
499
497
|
#updateIconState() {
|
|
500
|
-
const count = this
|
|
498
|
+
const count = this.satellites.length;
|
|
501
499
|
const slot = this.shadowRoot?.querySelector('.fab slot');
|
|
502
500
|
const fab = this.shadowRoot?.querySelector('.fab');
|
|
503
501
|
|
|
@@ -563,7 +561,7 @@ export class PdsFab extends HTMLElement {
|
|
|
563
561
|
#onSatelliteClick(e) {
|
|
564
562
|
const button = e.currentTarget;
|
|
565
563
|
const key = button.dataset.key;
|
|
566
|
-
const sat = this
|
|
564
|
+
const sat = this.satellites.find(s => s.key === key);
|
|
567
565
|
|
|
568
566
|
if (sat) {
|
|
569
567
|
this.dispatchEvent(new CustomEvent('satellite-click', {
|