@pure-ds/core 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- var xr=Object.defineProperty;var kr=(r,e)=>()=>(r&&(e=r(r=0)),e);var bt=(r,e)=>{for(var t in e)xr(r,t,{get:e[t],enumerable:!0})};var ar={};bt(ar,{AutoDefiner:()=>lt});async function so(...r){let e={};r.length&&typeof r[r.length-1]=="object"&&(e=r.pop()||{});let t=r,{baseURL:i,mapper:o=l=>`${l}.js`,onError:a=(l,d)=>console.error(`[defineWebComponents] ${l}:`,d)}=e,s=i?new URL(i,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),n=l=>l.toLowerCase().replace(/(^|-)([a-z])/g,(d,p,h)=>h.toUpperCase()),c=async l=>{try{if(customElements.get(l))return{tag:l,status:"already-defined"};let d=o(l),h=await import(d instanceof URL?d.href:new URL(d,s).href),g=h?.default??h?.[n(l)];if(!g){if(customElements.get(l))return{tag:l,status:"self-defined"};throw new Error(`No export found for ${l}. Expected default export or named export "${n(l)}".`)}return customElements.get(l)?{tag:l,status:"race-already-defined"}:(customElements.define(l,g),{tag:l,status:"defined"})}catch(d){throw a(l,d),d}};return Promise.all(t.map(c))}var lt,sr=kr(()=>{lt=class{constructor(e={}){let{baseURL:t,mapper:i,onError:o,predicate:a=()=>!0,attributeModule:s="data-module",root:n=document,scanExisting:c=!0,debounceMs:l=16,observeShadows:d=!0,enhancers:p=[],patchAttachShadow:h=!0}=e,g=new Set,y=new Set,f=new Set,b=new Map,_=new WeakMap,O=new WeakMap,R=0,E=!1,A=null,M=v=>{if(!v||!p.length)return;let x=O.get(v);x||(x=new Set,O.set(v,x));for(let w of p)if(!(!w.selector||!w.run)&&!x.has(w.selector))try{v.matches&&v.matches(w.selector)&&(w.run(v),x.add(w.selector))}catch(P){console.warn(`[AutoDefiner] Error applying enhancer for selector "${w.selector}":`,P)}},I=(v,x)=>{if(!E&&!(!v||!v.includes("-"))&&!customElements.get(v)&&!y.has(v)&&!f.has(v)){if(x&&x.getAttribute){let w=x.getAttribute(s);w&&!b.has(v)&&b.set(v,w)}g.add(v),Ge()}},Ge=()=>{R||(R=setTimeout(gt,l))},D=v=>{if(v){if(v.nodeType===1){let x=v,w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&a(w,x)&&I(w,x),M(x),d&&x.shadowRoot&&Ve(x.shadowRoot)}v.querySelectorAll&&v.querySelectorAll("*").forEach(x=>{let w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&a(w,x)&&I(w,x),M(x),d&&x.shadowRoot&&Ve(x.shadowRoot)})}},Ve=v=>{if(!v||_.has(v))return;D(v);let x=new MutationObserver(w=>{for(let P of w)P.addedNodes?.forEach(te=>{D(te)}),P.type==="attributes"&&P.target&&D(P.target)});x.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[s,...p.map(w=>w.selector).filter(w=>w.startsWith("data-"))]}),_.set(v,x)};async function gt(){if(clearTimeout(R),R=0,!g.size)return;let v=Array.from(g);g.clear(),v.forEach(x=>y.add(x));try{let x=w=>b.get(w)??(i?i(w):`${w}.js`);await so(...v,{baseURL:t,mapper:x,onError:(w,P)=>{f.add(w),o?.(w,P)}})}catch{}finally{v.forEach(x=>y.delete(x))}}let mt=n===document?document.documentElement:n,ft=new MutationObserver(v=>{for(let x of v)x.addedNodes?.forEach(w=>{D(w)}),x.type==="attributes"&&x.target&&D(x.target)});if(ft.observe(mt,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[s,...p.map(v=>v.selector).filter(v=>v.startsWith("data-"))]}),d&&h&&Element.prototype.attachShadow){let v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(w){let P=v.call(this,w);if(w&&w.mode==="open"){Ve(P);let te=this.tagName?.toLowerCase();te&&te.includes("-")&&!customElements.get(te)&&I(te,this)}return P},A=()=>Element.prototype.attachShadow=v}return c&&D(mt),{stop(){E=!0,ft.disconnect(),A&&A(),R&&(clearTimeout(R),R=0),_.forEach(v=>v.disconnect())},flush:gt}}static async define(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let i=e,{baseURL:o,mapper:a=d=>`${d}.js`,onError:s=(d,p)=>console.error(`[defineWebComponents] ${d}:`,p)}=t,n=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),c=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(p,h,g)=>g.toUpperCase()),l=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let p=a(d),g=await import(p instanceof URL?p.href:new URL(p,n).href),y=g?.default??g?.[c(d)];if(!y){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${c(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,y),{tag:d,status:"defined"})}catch(p){throw s(d,p),p}};return Promise.all(i.map(l))}}});var ve=globalThis,xe=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vt=Symbol(),yt=new WeakMap,we=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==vt)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(xe&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=yt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&yt.set(t,e))}return e}toString(){return this.cssText}},wt=r=>new we(typeof r=="string"?r:r+"",void 0,vt);var xt=(r,e)=>{if(xe)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),o=ve.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=t.cssText,r.appendChild(i)}},Je=xe?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return wt(t)})(r):r;var{is:$r,defineProperty:Cr,getOwnPropertyDescriptor:Er,getOwnPropertyNames:Tr,getOwnPropertySymbols:Ar,getPrototypeOf:zr}=Object,ke=globalThis,kt=ke.trustedTypes,_r=kt?kt.emptyScript:"",Mr=ke.reactiveElementPolyfillSupport,se=(r,e)=>r,Ke={toAttribute(r,e){switch(e){case Boolean:r=r?_r: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}},$t=(r,e)=>!$r(r,e),St={attribute:!0,type:String,converter:Ke,reflect:!1,useDefault:!1,hasChanged:$t};Symbol.metadata??=Symbol("metadata"),ke.litPropertyMetadata??=new WeakMap;var B=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=St){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 i=Symbol(),o=this.getPropertyDescriptor(e,i,t);o!==void 0&&Cr(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){let{get:o,set:a}=Er(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:o,set(s){let n=o?.call(this);a?.call(this,s),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??St}static _$Ei(){if(this.hasOwnProperty(se("elementProperties")))return;let e=zr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(se("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(se("properties"))){let t=this.properties,i=[...Tr(t),...Ar(t)];for(let o of i)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,o]of t)this.elementProperties.set(i,o)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let o=this._$Eu(t,i);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let o of i)t.unshift(Je(o))}else e!==void 0&&t.push(Je(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xt(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,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(o!==void 0&&i.reflect===!0){let a=(i.converter?.toAttribute!==void 0?i.converter:Ke).toAttribute(t,i.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){let i=this.constructor,o=i._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let a=i.getPropertyOptions(o),s=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Ke;this._$Em=o;let n=s.fromAttribute(t,a.type);this[o]=n??this._$Ej?.get(o)??n,this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){let o=this.constructor,a=this[e];if(i??=o.getPropertyOptions(e),!((i.hasChanged??$t)(a,t)||i.useDefault&&i.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:a},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),a!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),o===!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[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[o,a]of i){let{wrapped:s}=a,n=this[o];s!==!0||this._$AL.has(o)||n===void 0||this.C(o,void 0,a,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}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){}};B.elementStyles=[],B.shadowRootOptions={mode:"open"},B[se("elementProperties")]=new Map,B[se("finalized")]=new Map,Mr?.({ReactiveElement:B}),(ke.reactiveElementVersions??=[]).push("2.1.1");var Ye=globalThis,Se=Ye.trustedTypes,Ct=Se?Se.createPolicy("lit-html",{createHTML:r=>r}):void 0,Ze="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,Xe="?"+N,Lr=`<${Xe}>`,V=document,ce=()=>V.createComment(""),le=r=>r===null||typeof r!="object"&&typeof r!="function",et=Array.isArray,Mt=r=>et(r)||typeof r?.[Symbol.iterator]=="function",Qe=`[
1
+ var xr=Object.defineProperty;var kr=(r,e)=>()=>(r&&(e=r(r=0)),e);var bt=(r,e)=>{for(var t in e)xr(r,t,{get:e[t],enumerable:!0})};var ir={};bt(ir,{AutoDefiner:()=>lt});async function so(...r){let e={};r.length&&typeof r[r.length-1]=="object"&&(e=r.pop()||{});let t=r,{baseURL:a,mapper:o=l=>`${l}.js`,onError:i=(l,d)=>console.error(`[defineWebComponents] ${l}:`,d)}=e,s=a?new URL(a,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),n=l=>l.toLowerCase().replace(/(^|-)([a-z])/g,(d,p,h)=>h.toUpperCase()),c=async l=>{try{if(customElements.get(l))return{tag:l,status:"already-defined"};let d=o(l),h=await import(d instanceof URL?d.href:new URL(d,s).href),g=h?.default??h?.[n(l)];if(!g){if(customElements.get(l))return{tag:l,status:"self-defined"};throw new Error(`No export found for ${l}. Expected default export or named export "${n(l)}".`)}return customElements.get(l)?{tag:l,status:"race-already-defined"}:(customElements.define(l,g),{tag:l,status:"defined"})}catch(d){throw i(l,d),d}};return Promise.all(t.map(c))}var lt,sr=kr(()=>{lt=class{constructor(e={}){let{baseURL:t,mapper:a,onError:o,predicate:i=()=>!0,attributeModule:s="data-module",root:n=document,scanExisting:c=!0,debounceMs:l=16,observeShadows:d=!0,enhancers:p=[],patchAttachShadow:h=!0}=e,g=new Set,y=new Set,f=new Set,b=new Map,_=new WeakMap,O=new WeakMap,F=0,E=!1,A=null,M=v=>{if(!v||!p.length)return;let x=O.get(v);x||(x=new Set,O.set(v,x));for(let w of p)if(!(!w.selector||!w.run)&&!x.has(w.selector))try{v.matches&&v.matches(w.selector)&&(w.run(v),x.add(w.selector))}catch(P){console.warn(`[AutoDefiner] Error applying enhancer for selector "${w.selector}":`,P)}},I=(v,x)=>{if(!E&&!(!v||!v.includes("-"))&&!customElements.get(v)&&!y.has(v)&&!f.has(v)){if(x&&x.getAttribute){let w=x.getAttribute(s);w&&!b.has(v)&&b.set(v,w)}g.add(v),Ge()}},Ge=()=>{F||(F=setTimeout(gt,l))},D=v=>{if(v){if(v.nodeType===1){let x=v,w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&I(w,x),M(x),d&&x.shadowRoot&&Ve(x.shadowRoot)}v.querySelectorAll&&v.querySelectorAll("*").forEach(x=>{let w=x.tagName?.toLowerCase();w&&w.includes("-")&&!customElements.get(w)&&i(w,x)&&I(w,x),M(x),d&&x.shadowRoot&&Ve(x.shadowRoot)})}},Ve=v=>{if(!v||_.has(v))return;D(v);let x=new MutationObserver(w=>{for(let P of w)P.addedNodes?.forEach(te=>{D(te)}),P.type==="attributes"&&P.target&&D(P.target)});x.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[s,...p.map(w=>w.selector).filter(w=>w.startsWith("data-"))]}),_.set(v,x)};async function gt(){if(clearTimeout(F),F=0,!g.size)return;let v=Array.from(g);g.clear(),v.forEach(x=>y.add(x));try{let x=w=>b.get(w)??(a?a(w):`${w}.js`);await so(...v,{baseURL:t,mapper:x,onError:(w,P)=>{f.add(w),o?.(w,P)}})}catch{}finally{v.forEach(x=>y.delete(x))}}let mt=n===document?document.documentElement:n,ft=new MutationObserver(v=>{for(let x of v)x.addedNodes?.forEach(w=>{D(w)}),x.type==="attributes"&&x.target&&D(x.target)});if(ft.observe(mt,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[s,...p.map(v=>v.selector).filter(v=>v.startsWith("data-"))]}),d&&h&&Element.prototype.attachShadow){let v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(w){let P=v.call(this,w);if(w&&w.mode==="open"){Ve(P);let te=this.tagName?.toLowerCase();te&&te.includes("-")&&!customElements.get(te)&&I(te,this)}return P},A=()=>Element.prototype.attachShadow=v}return c&&D(mt),{stop(){E=!0,ft.disconnect(),A&&A(),F&&(clearTimeout(F),F=0),_.forEach(v=>v.disconnect())},flush:gt}}static async define(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let a=e,{baseURL:o,mapper:i=d=>`${d}.js`,onError:s=(d,p)=>console.error(`[defineWebComponents] ${d}:`,p)}=t,n=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),c=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(p,h,g)=>g.toUpperCase()),l=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let p=i(d),g=await import(p instanceof URL?p.href:new URL(p,n).href),y=g?.default??g?.[c(d)];if(!y){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${c(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,y),{tag:d,status:"defined"})}catch(p){throw s(d,p),p}};return Promise.all(a.map(l))}}});var ve=globalThis,xe=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vt=Symbol(),yt=new WeakMap,we=class{constructor(e,t,a){if(this._$cssResult$=!0,a!==vt)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(xe&&e===void 0){let a=t!==void 0&&t.length===1;a&&(e=yt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),a&&yt.set(t,e))}return e}toString(){return this.cssText}},wt=r=>new we(typeof r=="string"?r:r+"",void 0,vt);var xt=(r,e)=>{if(xe)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let a=document.createElement("style"),o=ve.litNonce;o!==void 0&&a.setAttribute("nonce",o),a.textContent=t.cssText,r.appendChild(a)}},Je=xe?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let a of e.cssRules)t+=a.cssText;return wt(t)})(r):r;var{is:$r,defineProperty:Cr,getOwnPropertyDescriptor:Er,getOwnPropertyNames:Tr,getOwnPropertySymbols:Ar,getPrototypeOf:zr}=Object,ke=globalThis,kt=ke.trustedTypes,_r=kt?kt.emptyScript:"",Mr=ke.reactiveElementPolyfillSupport,se=(r,e)=>r,Ke={toAttribute(r,e){switch(e){case Boolean:r=r?_r: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}},$t=(r,e)=>!$r(r,e),St={attribute:!0,type:String,converter:Ke,reflect:!1,useDefault:!1,hasChanged:$t};Symbol.metadata??=Symbol("metadata"),ke.litPropertyMetadata??=new WeakMap;var B=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=St){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 a=Symbol(),o=this.getPropertyDescriptor(e,a,t);o!==void 0&&Cr(this.prototype,e,o)}}static getPropertyDescriptor(e,t,a){let{get:o,set:i}=Er(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:o,set(s){let n=o?.call(this);i?.call(this,s),this.requestUpdate(e,n,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??St}static _$Ei(){if(this.hasOwnProperty(se("elementProperties")))return;let e=zr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(se("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(se("properties"))){let t=this.properties,a=[...Tr(t),...Ar(t)];for(let o of a)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[a,o]of t)this.elementProperties.set(a,o)}this._$Eh=new Map;for(let[t,a]of this.elementProperties){let o=this._$Eu(t,a);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let a=new Set(e.flat(1/0).reverse());for(let o of a)t.unshift(Je(o))}else e!==void 0&&t.push(Je(e));return t}static _$Eu(e,t){let a=t.attribute;return a===!1?void 0:typeof a=="string"?a: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 a of t.keys())this.hasOwnProperty(a)&&(e.set(a,this[a]),delete this[a]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xt(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,a){this._$AK(e,a)}_$ET(e,t){let a=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,a);if(o!==void 0&&a.reflect===!0){let i=(a.converter?.toAttribute!==void 0?a.converter:Ke).toAttribute(t,a.type);this._$Em=e,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(e,t){let a=this.constructor,o=a._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let i=a.getPropertyOptions(o),s=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Ke;this._$Em=o;let n=s.fromAttribute(t,i.type);this[o]=n??this._$Ej?.get(o)??n,this._$Em=null}}requestUpdate(e,t,a){if(e!==void 0){let o=this.constructor,i=this[e];if(a??=o.getPropertyOptions(e),!((a.hasChanged??$t)(i,t)||a.useDefault&&a.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,a))))return;this.C(e,t,a)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:a,reflect:o,wrapped:i},s){a&&!(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||a||(t=void 0),this._$AL.set(e,t)),o===!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[o,i]of this._$Ep)this[o]=i;this._$Ep=void 0}let a=this.constructor.elementProperties;if(a.size>0)for(let[o,i]of a){let{wrapped:s}=i,n=this[o];s!==!0||this._$AL.has(o)||n===void 0||this.C(o,void 0,i,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(a=>a.hostUpdate?.()),this.update(t)):this._$EM()}catch(a){throw e=!1,this._$EM(),a}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){}};B.elementStyles=[],B.shadowRootOptions={mode:"open"},B[se("elementProperties")]=new Map,B[se("finalized")]=new Map,Mr?.({ReactiveElement:B}),(ke.reactiveElementVersions??=[]).push("2.1.1");var Ye=globalThis,Se=Ye.trustedTypes,Ct=Se?Se.createPolicy("lit-html",{createHTML:r=>r}):void 0,Ze="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,Xe="?"+N,Lr=`<${Xe}>`,V=document,ce=()=>V.createComment(""),le=r=>r===null||typeof r!="object"&&typeof r!="function",et=Array.isArray,Mt=r=>et(r)||typeof r?.[Symbol.iterator]=="function",Qe=`[
2
2
  \f\r]`,ne=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Et=/-->/g,Tt=/>/g,q=RegExp(`>|${Qe}(?:([^\\s"'>=/]+)(${Qe}*=${Qe}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),At=/'/g,zt=/"/g,Lt=/^(?:script|style|textarea|title)$/i,tt=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),ze=tt(1),rt=tt(2),Dt=tt(3),T=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),_t=new WeakMap,G=V.createTreeWalker(V,129);function Pt(r,e){if(!et(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ct!==void 0?Ct.createHTML(e):e}var Ft=(r,e)=>{let t=r.length-1,i=[],o,a=e===2?"<svg>":e===3?"<math>":"",s=ne;for(let n=0;n<t;n++){let c=r[n],l,d,p=-1,h=0;for(;h<c.length&&(s.lastIndex=h,d=s.exec(c),d!==null);)h=s.lastIndex,s===ne?d[1]==="!--"?s=Et:d[1]!==void 0?s=Tt:d[2]!==void 0?(Lt.test(d[2])&&(o=RegExp("</"+d[2],"g")),s=q):d[3]!==void 0&&(s=q):s===q?d[0]===">"?(s=o??ne,p=-1):d[1]===void 0?p=-2:(p=s.lastIndex-d[2].length,l=d[1],s=d[3]===void 0?q:d[3]==='"'?zt:At):s===zt||s===At?s=q:s===Et||s===Tt?s=ne:(s=q,o=void 0);let g=s===q&&r[n+1].startsWith("/>")?" ":"";a+=s===ne?c+Lr:p>=0?(i.push(l),c.slice(0,p)+Ze+c.slice(p)+N+g):c+N+(p===-2?n:g)}return[Pt(r,a+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},de=class r{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let a=0,s=0,n=e.length-1,c=this.parts,[l,d]=Ft(e,t);if(this.el=r.createElement(l,i),G.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=G.nextNode())!==null&&c.length<n;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ze)){let h=d[s++],g=o.getAttribute(p).split(N),y=/([.?@])?(.*)/.exec(h);c.push({type:1,index:a,name:y[2],strings:g,ctor:y[1]==="."?Ce:y[1]==="?"?Ee:y[1]==="@"?Te:K}),o.removeAttribute(p)}else p.startsWith(N)&&(c.push({type:6,index:a}),o.removeAttribute(p));if(Lt.test(o.tagName)){let p=o.textContent.split(N),h=p.length-1;if(h>0){o.textContent=Se?Se.emptyScript:"";for(let g=0;g<h;g++)o.append(p[g],ce()),G.nextNode(),c.push({type:2,index:++a});o.append(p[h],ce())}}}else if(o.nodeType===8)if(o.data===Xe)c.push({type:2,index:a});else{let p=-1;for(;(p=o.data.indexOf(N,p+1))!==-1;)c.push({type:7,index:a}),p+=N.length-1}a++}}static createElement(e,t){let i=V.createElement("template");return i.innerHTML=e,i}};function J(r,e,t=r,i){if(e===T)return e;let o=i!==void 0?t._$Co?.[i]:t._$Cl,a=le(e)?void 0:e._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),a===void 0?o=void 0:(o=new a(r),o._$AT(r,t,i)),i!==void 0?(t._$Co??=[])[i]=o:t._$Cl=o),o!==void 0&&(e=J(r,o._$AS(r,e.values),o,i)),e}var $e=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:i}=this._$AD,o=(e?.creationScope??V).importNode(t,!0);G.currentNode=o;let a=G.nextNode(),s=0,n=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new re(a,a.nextSibling,this,e):c.type===1?l=new c.ctor(a,c.name,c.strings,this,e):c.type===6&&(l=new Ae(a,this,e)),this._$AV.push(l),c=i[++n]}s!==c?.index&&(a=G.nextNode(),s++)}return G.currentNode=V,o}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},re=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=o?.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=J(this,e,t),le(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==T&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mt(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&&le(this._$AH)?this._$AA.nextSibling.data=e:this.T(V.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=de.createElement(Pt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{let a=new $e(o,this),s=a.u(this.options);a.p(t),this.T(s),this._$AH=a}}_$AC(e){let t=_t.get(e.strings);return t===void 0&&_t.set(e.strings,t=new de(e)),t}k(e){et(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,o=0;for(let a of e)o===t.length?t.push(i=new r(this.O(ce()),this.O(ce()),this,this.options)):i=t[o],i._$AI(a),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},K=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,a){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=k}_$AI(e,t=this,i,o){let a=this.strings,s=!1;if(a===void 0)e=J(this,e,t,0),s=!le(e)||e!==this._$AH&&e!==T,s&&(this._$AH=e);else{let n=e,c,l;for(e=a[0],c=0;c<a.length-1;c++)l=J(this,n[i+c],t,c),l===T&&(l=this._$AH[c]),s||=!le(l)||l!==this._$AH[c],l===k?e=k:e!==k&&(e+=(l??"")+a[c+1]),this._$AH[c]=l}s&&!o&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ce=class extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Ee=class extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Te=class extends K{constructor(e,t,i,o,a){super(e,t,i,o,a),this.type=5}_$AI(e,t=this){if((e=J(this,e,t,0)??k)===T)return;let i=this._$AH,o=e===k&&i!==k||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,a=e!==k&&(i===k||o);o&&this.element.removeEventListener(this.name,this,i),a&&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)}},Ae=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){J(this,e)}},Rt={M:Ze,P:N,A:Xe,C:1,L:Ft,R:$e,D:Mt,V:J,I:re,H:K,N:Ee,U:Te,B:Ce,F:Ae},Dr=Ye.litHtmlPolyfillSupport;Dr?.(de,re),(Ye.litHtmlVersions??=[]).push("3.3.1");var j=(r,e,t)=>{let i=t?.renderBefore??e,o=i._$litPart$;if(o===void 0){let a=t?.renderBefore??null;i._$litPart$=o=new re(e.insertBefore(ce(),a),a,void 0,t??{})}return o._$AI(r),o};var ot=globalThis,F=class extends B{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=j(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T}};F._$litElement$=!0,F.finalized=!0,ot.litElementHydrateSupport?.({LitElement:F});var Pr=ot.litElementPolyfillSupport;Pr?.({LitElement:F});(ot.litElementVersions??=[]).push("4.2.1");var H={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},z=r=>(...e)=>({_$litDirective$:r,values:e}),L=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Fr}=Rt,Bt=r=>r===null||typeof r!="object"&&typeof r!="function";var Nt=r=>r.strings===void 0,It=()=>document.createComment(""),oe=(r,e,t)=>{let i=r._$AA.parentNode,o=e===void 0?r._$AB:e._$AA;if(t===void 0){let a=i.insertBefore(It(),o),s=i.insertBefore(It(),o);t=new Fr(a,s,r,r.options)}else{let a=t._$AB.nextSibling,s=t._$AM,n=s!==r;if(n){let c;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(c=r._$AU)!==s._$AU&&t._$AP(c)}if(a!==o||n){let c=t._$AA;for(;c!==a;){let l=c.nextSibling;i.insertBefore(c,o),c=l}}}return t},U=(r,e,t=r)=>(r._$AI(e,t),r),Rr={},_e=(r,e=Rr)=>r._$AH=e,Ot=r=>r._$AH,Me=r=>{r._$AR(),r._$AA.remove()};var jt=(r,e,t)=>{let i=new Map;for(let o=e;o<=t;o++)i.set(r[o],o);return i},Bo=z(class extends L{constructor(r){if(super(r),r.type!==H.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let o=[],a=[],s=0;for(let n of r)o[s]=i?i(n,s):s,a[s]=t(n,s),s++;return{values:a,keys:o}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){let o=Ot(r),{values:a,keys:s}=this.dt(e,t,i);if(!Array.isArray(o))return this.ut=s,a;let n=this.ut??=[],c=[],l,d,p=0,h=o.length-1,g=0,y=a.length-1;for(;p<=h&&g<=y;)if(o[p]===null)p++;else if(o[h]===null)h--;else if(n[p]===s[g])c[g]=U(o[p],a[g]),p++,g++;else if(n[h]===s[y])c[y]=U(o[h],a[y]),h--,y--;else if(n[p]===s[y])c[y]=U(o[p],a[y]),oe(r,c[y+1],o[p]),p++,y--;else if(n[h]===s[g])c[g]=U(o[h],a[g]),oe(r,o[p],o[h]),h--,g++;else if(l===void 0&&(l=jt(s,g,y),d=jt(n,p,h)),l.has(n[p]))if(l.has(n[h])){let f=d.get(s[g]),b=f!==void 0?o[f]:null;if(b===null){let _=oe(r,o[p]);U(_,a[g]),c[g]=_}else c[g]=U(b,a[g]),oe(r,o[p],b),o[f]=null;g++}else Me(o[h]),h--;else Me(o[p]),p++;for(;g<=y;){let f=oe(r,c[y+1]);U(f,a[g]),c[g++]=f}for(;p<=h;){let f=o[p++];f!==null&&Me(f)}return this.ut=s,_e(r,c),T}});var Go=z(class extends L{constructor(){super(...arguments),this.key=k}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(_e(r),this.key=e),t}});var Xo=z(class extends L{constructor(r){if(super(r),r.type!==H.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(i=>i!=="")));for(let i in e)e[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(e)}let t=r.element.classList;for(let i of this.st)i in e||(t.remove(i),this.st.delete(i));for(let i in e){let o=!!e[i];o===this.st.has(i)||this.nt?.has(i)||(o?(t.add(i),this.st.add(i)):(t.remove(i),this.st.delete(i)))}return T}});var pe=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let i of t)i._$AO?.(e,!1),pe(i,e);return!0},Le=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},Ht=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),Nr(e)}};function Ir(r){this._$AN!==void 0?(Le(this),this._$AM=r,Ht(this)):this._$AM=r}function Br(r,e=!1,t=0){let i=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(i))for(let a=t;a<i.length;a++)pe(i[a],!1),Le(i[a]);else i!=null&&(pe(i,!1),Le(i));else pe(this,r)}var Nr=r=>{r.type==H.CHILD&&(r._$AP??=Br,r._$AQ??=Ir)},ie=class extends L{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),Ht(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(pe(this,e),Le(this))}setValue(e){if(Nt(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 it=new WeakMap,Or=z(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=it.get(e);t===void 0&&(t=new WeakMap,it.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"?it.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 De=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Pe=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 Ut=r=>!Bt(r)&&typeof r.then=="function",Wt=1073741823,at=class extends ie{constructor(){super(...arguments),this._$Cwt=Wt,this._$Cbt=[],this._$CK=new De(this),this._$CX=new Pe}render(...e){return e.find(t=>!Ut(t))??T}update(e,t){let i=this._$Cbt,o=i.length;this._$Cbt=t;let a=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let n=0;n<t.length&&!(n>this._$Cwt);n++){let c=t[n];if(!Ut(c))return this._$Cwt=n,c;n<o&&c===i[n]||(this._$Cwt=Wt,o=0,Promise.resolve(c).then(async l=>{for(;s.get();)await s.get();let d=a.deref();if(d!==void 0){let p=d._$Cbt.indexOf(c);p>-1&&p<d._$Cwt&&(d._$Cwt=p,d.setValue(l))}}))}return T}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},jr=z(at);var Q=class extends L{constructor(e){if(super(e),this.it=k,e.type!==H.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===T)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:[]}}};Q.directiveName="unsafeHTML",Q.resultType=1;var Fe=z(Q);var ue=class extends Q{};ue.directiveName="unsafeSVG",ue.resultType=2;var Hr=z(ue);var Bi=["127.0.0.1","localhost"].includes(window.location.hostname);var Ur=Symbol.for(""),Wr=r=>{if(r?.r===Ur)return r?._$litStatic$};var qt=new Map,st=r=>(e,...t)=>{let i=t.length,o,a,s=[],n=[],c,l=0,d=!1;for(;l<i;){for(c=e[l];l<i&&(a=t[l],(o=Wr(a))!==void 0);)c+=o+e[++l],d=!0;l!==i&&n.push(a),s.push(c),l++}if(l===i&&s.push(e[i]),d){let p=s.join("$$lit$$");(e=qt.get(p))===void 0&&(s.raw=s,qt.set(p,e=s)),t=n}return r(e,...t)},qr=st(ze),ji=st(rt),Hi=st(Dt);var S=ze;var nt=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},console.log("[PDS Registry] Switched to STATIC mode",this._staticPaths)}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:export' and configured PDS.start() with the correct static.root path");let i=new CSSStyleSheet;return i.replaceSync("/* Failed to load "+e+" */"),i}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},he=new nt;var u={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"}};var Re={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:"alert",name:"Alert",description:"Contextual feedback messages",selectors:[".alert",".alert-info",".alert-success",".alert-warning",".alert-danger",".alert-error",".alert-dismissible",".semantic-message"],tags:["feedback","message","notification","status"],category:"feedback"},{id:"dialog",name:"Dialog",description:"Modal dialog element",selectors:["dialog",".dialog"],tags:["modal","overlay","popup"],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-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-jsonform",name:"JSON Form",description:"Auto-generated form from JSON Schema",selectors:["pds-jsonform"],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",".text-primary",".text-success",".text-warning",".text-danger",".text-info"],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:["alert","badge"],components:["pds-toaster"]},form:{description:"Form inputs and controls",primitives:["button","fieldset","label-field","form"],components:["pds-upload","pds-jsonform","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"]}},styles:{typography:["headings","body","code","links"],icons:{source:"svg",sets:["core","brand"]},interactive:["focus","hover","active","disabled"],states:["success","warning","danger","info","muted"]}};function Y(r,e){if(!r||!e)return!1;try{return r.matches(e)}catch{return!1}}function Gt(r,e){if(!r||!e||!r.closest)return null;try{return r.closest(e)}catch{return null}}function Vt(r,{maxDepth:e=5}={}){if(!r||r.closest&&r.closest(".showcase-toc"))return null;let t=r,i=0;for(;t&&i<e;){if(i++,t.tagName==="DS-SHOWCASE")return null;if(t.classList&&t.classList.contains("showcase-section")){t=t.parentElement;continue}for(let a of PDS.ontology.enhancements){let s=a.selector||a;if(Y(t,s))return{element:t,componentType:"enhanced-component",displayName:a.description||s,id:a.id}}if(t.tagName==="FIELDSET"){let a=t.getAttribute("role");if(a==="group"||a==="radiogroup")return{element:t,componentType:"form-group",displayName:a==="radiogroup"?"radio group":"form group"}}if(t.tagName==="LABEL"&&t.querySelector&&t.querySelector("input,select,textarea"))return{element:t,componentType:"form-control",displayName:"label with input"};let o=t.closest?t.closest("label"):null;if(o&&o.querySelector&&o.querySelector("input,select,textarea"))return{element:o,componentType:"form-control",displayName:"label with input"};for(let a of PDS.ontology.primitives){for(let s of a.selectors||[]){let n=String(s||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(h=>h.startsWith(l)))return{element:t,componentType:"pds-primitive",displayName:a.name||a.id,id:a.id,tags:a.tags};let d=t.parentElement,p=0;for(;d&&p<e;){if(d.classList&&Array.from(d.classList).some(h=>h.startsWith(l))&&d.tagName!=="DS-SHOWCASE")return{element:d,componentType:"pds-primitive",displayName:a.name||a.id,id:a.id,tags:a.tags};d=d.parentElement,p++}continue}continue}if(Y(t,n))return{element:t,componentType:"pds-primitive",displayName:a.name||a.id,id:a.id,tags:a.tags};let c=Gt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"pds-primitive",displayName:a.name||a.id,id:a.id,tags:a.tags}}if(t.classList){let s=Array.from(t.classList);for(let n of a.selectors||[])if(typeof n=="string"&&n.includes("*")&&n.startsWith(".")){let c=n.slice(1).replace(/\*/g,"");if(s.some(l=>l.startsWith(c)))return{element:t,componentType:"pds-primitive",displayName:a.name||a.id,id:a.id,tags:a.tags}}}}for(let a of PDS.ontology.layoutPatterns||[])for(let s of a.selectors||[]){let n=String(s||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(d=>d.startsWith(l)))return{element:t,componentType:"layout-pattern",displayName:a.name||a.id,id:a.id,tags:a.tags}}continue}if(Y(t,n))return{element:t,componentType:"layout-pattern",displayName:a.name||a.id,id:a.id,tags:a.tags};let c=Gt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"layout-pattern",displayName:a.name||a.id,id:a.id,tags:a.tags}}if(t.tagName&&t.tagName.includes("-")){let a=t.tagName.toLowerCase(),s=PDS.ontology.components.find(n=>n.selectors.includes(a));return{element:t,componentType:"web-component",displayName:s?.name||a,id:s?.id||a,tags:s?.tags}}if(t.tagName==="BUTTON"){let a=t.querySelector&&t.querySelector("pds-icon");return{element:t,componentType:"button",displayName:a?"button with icon":"button",id:"button"}}if(Y(t,"pds-icon")||t.closest&&t.closest("pds-icon")){let a=Y(t,"pds-icon")?t:t.closest("pds-icon");return{element:a,componentType:"icon",displayName:`pds-icon (${a.getAttribute&&a.getAttribute("icon")||"unknown"})`,id:"pds-icon"}}if(Y(t,"nav[data-dropdown]")||t.closest&&t.closest("nav[data-dropdown]"))return{element:Y(t,"nav[data-dropdown]")?t:t.closest("nav[data-dropdown]"),componentType:"navigation",displayName:"dropdown menu",id:"dropdown"};t=t.parentElement}return null}var Jt=Re;var $=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.#fe(),typeof CSSStyleSheet<"u"?this.#xe():this.options.debug&&this.options.log?.("debug","[Generator] Skipping browser features (CSSStyleSheet not available)")}generateTokens(){let e=this.options.design||{};return{colors:this.#s(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#_(e.shape||{}),borderWidths:this.#M(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#L(e.layers||{}),layout:this.#D(e.layout||{}),transitions:this.#P(e.behavior||{}),zIndex:this.#F(e.layers||{}),icons:this.#R(e.icons||{})}}#s(e){let{primary:t="#3b82f6",secondary:i="#64748b",accent:o="#ec4899",background:a="#ffffff",success:s=null,warning:n="#FFBF00",danger:c=null,info:l=null,darkMode:d={}}=e,p={primary:this.#o(t),secondary:this.#o(i),accent:this.#o(o),success:this.#o(s||this.#w(t)),warning:this.#o(n||o),danger:this.#o(c||this.#x(t)),info:this.#o(l||t),gray:this.#u(i),surface:this.#h(a)};return p.surface.fieldset=this.#k(p.surface),p.surfaceSmart=this.#y(p.surface),p.dark=this.#$(p,a,d),p.dark&&p.dark.surface&&(p.dark.surfaceSmart=this.#y(p.dark.surface)),p.interactive={light:{fill:this.#b(p.primary,4.5),text:p.primary[600]},dark:{fill:this.#b(p.dark.primary,4.5),text:this.#A(p.dark.primary,p.dark.surface.base,4.5)}},p}#o(e){let t=this.#a(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))}}#w(e){let t=this.#a(e);return this.#t(120,Math.max(t.s,60),45)}#x(e){let t=this.#a(e);return this.#t(0,Math.max(t.s,70),50)}#u(e){let t=this.#a(e),i=t.h,o=Math.min(t.s,10);return{50:this.#t(i,o,98),100:this.#t(i,o,95),200:this.#t(i,o,88),300:this.#t(i,o,78),400:this.#t(i,o,60),500:e,600:this.#t(i,Math.min(o+5,15),45),700:this.#t(i,Math.min(o+8,18),35),800:this.#t(i,Math.min(o+10,20),20),900:this.#t(i,Math.min(o+12,22),10)}}#h(e){let t=this.#a(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.#g(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#k(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#S(e.sunken,.05),overlay:e.elevated}}#S(e,t=.05){let i=this.#a(e),o=Math.max(i.l-i.l*t,5);return this.#t(i.h,i.s,o)}#g(e){let t=this.#a(e);if(t.l>50){let i=Math.min(t.s+5,25),o=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,i,o)}else{let i=Math.max(t.s-10,5),o=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,i,o)}}#$(e,t="#ffffff",i={}){let o=i.background?i.background:this.#g(t),a=this.#h(o),s=i.primary?this.#o(i.primary):this.#n(e.primary);return{surface:{...a,fieldset:this.#T(a)},primary:s,secondary:i.secondary?this.#o(i.secondary):this.#n(e.secondary),accent:i.accent?this.#o(i.accent):this.#n(e.accent),gray:i.secondary?this.#u(i.secondary):e.gray,success:this.#n(e.success),info:this.#n(e.info),warning:this.#n(e.warning),danger:this.#n(e.danger)}}#l(e){let t=String(e||"").replace("#",""),i=t.length===3?t.split("").map(a=>a+a).join(""):t,o=parseInt(i,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}#p(e){let{r:t,g:i,b:o}=this.#l(e),a=[t/255,i/255,o/255].map(s=>s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4));return .2126*a[0]+.7152*a[1]+.0722*a[2]}#d(e,t){let i=this.#p(e),o=this.#p(t),a=Math.max(i,o),s=Math.min(i,o);return(a+.05)/(s+.05)}#m(e,t=4.5){if(!e)return"#000000";let i="#ffffff",o="#000000",a=this.#d(e,i);if(a>=t)return i;let s=this.#d(e,o);return s>=t||s>a?o:i}#f(e,t=1){let{r:i,g:o,b:a}=this.#l(e);return`rgba(${i}, ${o}, ${a}, ${t})`}#C(e,t,i=.5){let o=this.#l(e),a=this.#l(t),s=Math.round(o.r+(a.r-o.r)*i),n=Math.round(o.g+(a.g-o.g)*i),c=Math.round(o.b+(a.b-o.b)*i);return this.#E(s,n,c)}#E(e,t,i){let o=a=>{let s=Math.max(0,Math.min(255,Math.round(a))).toString(16);return s.length===1?"0"+s:s};return`#${o(e)}${o(t)}${o(i)}`}#T(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#v(e.elevated,.08),sunken:e.elevated,overlay:this.#v(e.overlay,.05)}}#A(e={},t="#000000",i=4.5){let o=["600","700","800","500","400","900","300","200"],a={shade:null,color:null,ratio:0};for(let s of o){let n=e?.[s];if(!n||typeof n!="string")continue;let c=this.#d(n,t);if(c>a.ratio&&(a={shade:s,color:n,ratio:c}),c>=i)return n}return a.color||e?.["600"]||e?.["500"]}#b(e={},t=4.5){let i=["600","700","800","500","400","900"],o={shade:null,color:null,ratio:0};for(let a of i){let s=e?.[a];if(!s||typeof s!="string")continue;let n=this.#d(s,"#ffffff");if(n>o.ratio&&(o={shade:a,color:s,ratio:n}),n>=t)return s}return o.color||e?.["600"]||e?.["500"]}#y(e){let t={};return Object.entries(e).forEach(([i,o])=>{if(!o||typeof o!="string"||!o.startsWith("#"))return;let a=this.#p(o)<.5,s=this.#m(o,4.5),n=this.#m(o,3),c=this.#C(s,o,.4),l=s,d=c,p=a?"#ffffff":"#000000",h=a?.25:.1,g=this.#f(p,h),y=a?"#ffffff":"#000000",f=a?.15:.1,b=this.#f(y,f);t[i]={bg:o,text:s,textSecondary:n,textMuted:c,icon:l,iconSubtle:d,shadow:g,border:b,scheme:a?"dark":"light"}}),t}#v(e,t=.05){let i=this.#a(e),o=Math.min(i.l+(100-i.l)*t,95);return this.#t(i.h,i.s,o)}#n(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(([o,a])=>{let s=e[a.source];t[o]=this.#z(s,a.dimFactor)}),t}#z(e,t=.8){let i=this.#a(e),o=Math.max(i.s*t,5),a=Math.max(i.l*t,5);return this.#t(i.h,o,a)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:i=1.25,maxSpacingSteps:o=12}=e,a=Number.isFinite(Number(t))?Number(t):4,s=Math.min(Number.isFinite(Number(o))?Number(o):12,12),n={0:"0"};for(let c=1;c<=s;c++)n[c]=`${a*c}px`;return n}#_(e){let{radiusSize:t="medium",customRadius:i=null}=e,o;i!=null?o=i:typeof t=="number"?o=t:typeof t=="string"?o=u.RadiusSizes[t]??u.RadiusSizes.medium:o=u.RadiusSizes.medium;let a=Number.isFinite(Number(o))?Number(o):u.RadiusSizes.medium;return{none:"0",xs:`${Number.isFinite(a*.25)?Math.round(a*.25):0}px`,sm:`${Number.isFinite(a*.5)?Math.round(a*.5):0}px`,md:`${a}px`,lg:`${Number.isFinite(a*1.5)?Math.round(a*1.5):0}px`,xl:`${Number.isFinite(a*2)?Math.round(a*2):0}px`,full:"9999px"}}#M(e){let{borderWidth:t="medium"}=e,i;return typeof t=="number"?i=t:typeof t=="string"?i=u.BorderWidths[t]??u.BorderWidths.medium:i=u.BorderWidths.medium,{hairline:`${u.BorderWidths.hairline}px`,thin:`${u.BorderWidths.thin}px`,medium:`${u.BorderWidths.medium}px`,thick:`${u.BorderWidths.thick}px`}}generateTypographyTokens(e){let{fontFamilyHeadings:t="system-ui, -apple-system, sans-serif",fontFamilyBody:i="system-ui, -apple-system, sans-serif",fontFamilyMono:o='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:a=16,fontScale:s=1.25,fontWeightLight:n=u.FontWeights.light,fontWeightNormal:c=u.FontWeights.normal,fontWeightMedium:l=u.FontWeights.medium,fontWeightSemibold:d=u.FontWeights.semibold,fontWeightBold:p=u.FontWeights.bold,lineHeightTight:h=u.LineHeights.tight,lineHeightNormal:g=u.LineHeights.normal,lineHeightRelaxed:y=u.LineHeights.relaxed}=e,f=Number.isFinite(Number(a))?Number(a):16,b=Number.isFinite(Number(s))?Number(s):1.25;return{fontFamily:{headings:t,body:i,mono:o},fontSize:{xs:`${Math.round(f/Math.pow(b,2))}px`,sm:`${Math.round(f/b)}px`,base:`${f}px`,lg:`${Math.round(f*b)}px`,xl:`${Math.round(f*Math.pow(b,2))}px`,"2xl":`${Math.round(f*Math.pow(b,3))}px`,"3xl":`${Math.round(f*Math.pow(b,4))}px`,"4xl":`${Math.round(f*Math.pow(b,5))}px`},fontWeight:{light:n?.toString()||"300",normal:c?.toString()||"400",medium:l?.toString()||"500",semibold:d?.toString()||"600",bold:p?.toString()||"700"},lineHeight:{tight:h?.toString()||"1.25",normal:g?.toString()||"1.5",relaxed:y?.toString()||"1.75"}}}#L(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:i=1,shadowOffsetMultiplier:o=1}=e,a=`rgba(0, 0, 0, ${t})`,s=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*o}px ${2*i}px 0 ${s}`,base:`0 ${1*o}px ${3*i}px 0 ${a}, 0 ${1*o}px ${2*i}px 0 ${s}`,md:`0 ${4*o}px ${6*i}px ${-1*o}px ${a}, 0 ${2*o}px ${4*i}px ${-1*o}px ${s}`,lg:`0 ${10*o}px ${15*i}px ${-3*o}px ${a}, 0 ${4*o}px ${6*i}px ${-2*o}px ${s}`,xl:`0 ${20*o}px ${25*i}px ${-5*o}px ${a}, 0 ${10*o}px ${10*i}px ${-5*o}px ${s}`,inner:`inset 0 ${2*o}px ${4*i}px 0 ${s}`}}#D(e){let{maxWidth:t=1200,containerPadding:i=16,breakpoints:o={sm:640,md:768,lg:1024,xl:1280}}=e;return{maxWidth:`${t}px`,minHeight:"100vh",containerPadding:`${i}px`,breakpoints:{sm:`${o.sm}px`,md:`${o.md}px`,lg:`${o.lg}px`,xl:`${o.xl}px`},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#P(e){let{transitionSpeed:t=u.TransitionSpeeds.normal,animationEasing:i=u.AnimationEasings["ease-out"]}=e,o;return typeof t=="number"?o=t:typeof t=="string"&&u.TransitionSpeeds[t]?o=u.TransitionSpeeds[t]:o=u.TransitionSpeeds.normal,{fast:`${Math.round(o*.6)}ms`,normal:`${o}ms`,slow:`${Math.round(o*1.4)}ms`}}#F(e){let{baseZIndex:t=1e3,zIndexStep:i=10}=e;return{dropdown:t.toString(),sticky:(t+i*2).toString(),fixed:(t+i*3).toString(),modal:(t+i*4).toString(),drawer:(t+i*5).toString(),popover:(t+i*6).toString(),tooltip:(t+i*7).toString(),notification:(t+i*8).toString()}}#R(e){let{set:t="phosphor",weight:i="regular",defaultSize:o=24,sizes:a={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:s="/assets/pds/icons/pds-icons.svg"}=e;return{set:t,weight:i,defaultSize:`${o}px`,sizes:Object.fromEntries(Object.entries(a).map(([n,c])=>[n,`${c}px`])),spritePath:s}}#I(e){let t=[];t.push(` /* Colors */
4
- `);let i=(o,a="")=>{Object.entries(o).forEach(([s,n])=>{typeof n=="object"&&n!==null?i(n,`${a}${s}-`):typeof n=="string"&&t.push(` --color-${a}${s}: ${n};
5
- `)})};return Object.entries(e).forEach(([o,a])=>{o!=="dark"&&o!=="surfaceSmart"&&o!=="interactive"&&typeof a=="object"&&a!==null&&i(a,`${o}-`)}),e.surfaceSmart&&(t.push(` /* Smart Surface Tokens (context-aware) */
6
- `),Object.entries(e.surfaceSmart).forEach(([o,a])=>{t.push(` --surface-${o}-bg: ${a.bg};
7
- `),t.push(` --surface-${o}-text: ${a.text};
8
- `),t.push(` --surface-${o}-text-secondary: ${a.textSecondary};
9
- `),t.push(` --surface-${o}-text-muted: ${a.textMuted};
10
- `),t.push(` --surface-${o}-icon: ${a.icon};
11
- `),t.push(` --surface-${o}-icon-subtle: ${a.iconSubtle};
12
- `),t.push(` --surface-${o}-shadow: ${a.shadow};
13
- `),t.push(` --surface-${o}-border: ${a.border};
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),At=/'/g,zt=/"/g,Lt=/^(?:script|style|textarea|title)$/i,tt=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),ze=tt(1),rt=tt(2),Dt=tt(3),T=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),_t=new WeakMap,G=V.createTreeWalker(V,129);function Pt(r,e){if(!et(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ct!==void 0?Ct.createHTML(e):e}var Rt=(r,e)=>{let t=r.length-1,a=[],o,i=e===2?"<svg>":e===3?"<math>":"",s=ne;for(let n=0;n<t;n++){let c=r[n],l,d,p=-1,h=0;for(;h<c.length&&(s.lastIndex=h,d=s.exec(c),d!==null);)h=s.lastIndex,s===ne?d[1]==="!--"?s=Et:d[1]!==void 0?s=Tt:d[2]!==void 0?(Lt.test(d[2])&&(o=RegExp("</"+d[2],"g")),s=q):d[3]!==void 0&&(s=q):s===q?d[0]===">"?(s=o??ne,p=-1):d[1]===void 0?p=-2:(p=s.lastIndex-d[2].length,l=d[1],s=d[3]===void 0?q:d[3]==='"'?zt:At):s===zt||s===At?s=q:s===Et||s===Tt?s=ne:(s=q,o=void 0);let g=s===q&&r[n+1].startsWith("/>")?" ":"";i+=s===ne?c+Lr:p>=0?(a.push(l),c.slice(0,p)+Ze+c.slice(p)+N+g):c+N+(p===-2?n:g)}return[Pt(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),a]},de=class r{constructor({strings:e,_$litType$:t},a){let o;this.parts=[];let i=0,s=0,n=e.length-1,c=this.parts,[l,d]=Rt(e,t);if(this.el=r.createElement(l,a),G.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=G.nextNode())!==null&&c.length<n;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ze)){let h=d[s++],g=o.getAttribute(p).split(N),y=/([.?@])?(.*)/.exec(h);c.push({type:1,index:i,name:y[2],strings:g,ctor:y[1]==="."?Ce:y[1]==="?"?Ee:y[1]==="@"?Te:K}),o.removeAttribute(p)}else p.startsWith(N)&&(c.push({type:6,index:i}),o.removeAttribute(p));if(Lt.test(o.tagName)){let p=o.textContent.split(N),h=p.length-1;if(h>0){o.textContent=Se?Se.emptyScript:"";for(let g=0;g<h;g++)o.append(p[g],ce()),G.nextNode(),c.push({type:2,index:++i});o.append(p[h],ce())}}}else if(o.nodeType===8)if(o.data===Xe)c.push({type:2,index:i});else{let p=-1;for(;(p=o.data.indexOf(N,p+1))!==-1;)c.push({type:7,index:i}),p+=N.length-1}i++}}static createElement(e,t){let a=V.createElement("template");return a.innerHTML=e,a}};function J(r,e,t=r,a){if(e===T)return e;let o=a!==void 0?t._$Co?.[a]:t._$Cl,i=le(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(r),o._$AT(r,t,a)),a!==void 0?(t._$Co??=[])[a]=o:t._$Cl=o),o!==void 0&&(e=J(r,o._$AS(r,e.values),o,a)),e}var $e=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:a}=this._$AD,o=(e?.creationScope??V).importNode(t,!0);G.currentNode=o;let i=G.nextNode(),s=0,n=0,c=a[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new re(i,i.nextSibling,this,e):c.type===1?l=new c.ctor(i,c.name,c.strings,this,e):c.type===6&&(l=new Ae(i,this,e)),this._$AV.push(l),c=a[++n]}s!==c?.index&&(i=G.nextNode(),s++)}return G.currentNode=V,o}p(e){let t=0;for(let a of this._$AV)a!==void 0&&(a.strings!==void 0?(a._$AI(e,a,t),t+=a.strings.length-2):a._$AI(e[t])),t++}},re=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,a,o){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=a,this.options=o,this._$Cv=o?.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=J(this,e,t),le(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==T&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mt(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&&le(this._$AH)?this._$AA.nextSibling.data=e:this.T(V.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:a}=e,o=typeof a=="number"?this._$AC(e):(a.el===void 0&&(a.el=de.createElement(Pt(a.h,a.h[0]),this.options)),a);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new $e(o,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=_t.get(e.strings);return t===void 0&&_t.set(e.strings,t=new de(e)),t}k(e){et(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,a,o=0;for(let i of e)o===t.length?t.push(a=new r(this.O(ce()),this.O(ce()),this,this.options)):a=t[o],a._$AI(i),o++;o<t.length&&(this._$AR(a&&a._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let a=e.nextSibling;e.remove(),e=a}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},K=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,a,o,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,a.length>2||a[0]!==""||a[1]!==""?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=k}_$AI(e,t=this,a,o){let i=this.strings,s=!1;if(i===void 0)e=J(this,e,t,0),s=!le(e)||e!==this._$AH&&e!==T,s&&(this._$AH=e);else{let n=e,c,l;for(e=i[0],c=0;c<i.length-1;c++)l=J(this,n[a+c],t,c),l===T&&(l=this._$AH[c]),s||=!le(l)||l!==this._$AH[c],l===k?e=k:e!==k&&(e+=(l??"")+i[c+1]),this._$AH[c]=l}s&&!o&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ce=class extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Ee=class extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Te=class extends K{constructor(e,t,a,o,i){super(e,t,a,o,i),this.type=5}_$AI(e,t=this){if((e=J(this,e,t,0)??k)===T)return;let a=this._$AH,o=e===k&&a!==k||e.capture!==a.capture||e.once!==a.once||e.passive!==a.passive,i=e!==k&&(a===k||o);o&&this.element.removeEventListener(this.name,this,a),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)}},Ae=class{constructor(e,t,a){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(e){J(this,e)}},Ft={M:Ze,P:N,A:Xe,C:1,L:Rt,R:$e,D:Mt,V:J,I:re,H:K,N:Ee,U:Te,B:Ce,F:Ae},Dr=Ye.litHtmlPolyfillSupport;Dr?.(de,re),(Ye.litHtmlVersions??=[]).push("3.3.1");var j=(r,e,t)=>{let a=t?.renderBefore??e,o=a._$litPart$;if(o===void 0){let i=t?.renderBefore??null;a._$litPart$=o=new re(e.insertBefore(ce(),i),i,void 0,t??{})}return o._$AI(r),o};var ot=globalThis,R=class extends B{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=j(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T}};R._$litElement$=!0,R.finalized=!0,ot.litElementHydrateSupport?.({LitElement:R});var Pr=ot.litElementPolyfillSupport;Pr?.({LitElement:R});(ot.litElementVersions??=[]).push("4.2.1");var H={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},z=r=>(...e)=>({_$litDirective$:r,values:e}),L=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,a){this._$Ct=e,this._$AM=t,this._$Ci=a}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Rr}=Ft,Bt=r=>r===null||typeof r!="object"&&typeof r!="function";var Nt=r=>r.strings===void 0,It=()=>document.createComment(""),oe=(r,e,t)=>{let a=r._$AA.parentNode,o=e===void 0?r._$AB:e._$AA;if(t===void 0){let i=a.insertBefore(It(),o),s=a.insertBefore(It(),o);t=new Rr(i,s,r,r.options)}else{let i=t._$AB.nextSibling,s=t._$AM,n=s!==r;if(n){let c;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(c=r._$AU)!==s._$AU&&t._$AP(c)}if(i!==o||n){let c=t._$AA;for(;c!==i;){let l=c.nextSibling;a.insertBefore(c,o),c=l}}}return t},U=(r,e,t=r)=>(r._$AI(e,t),r),Fr={},_e=(r,e=Fr)=>r._$AH=e,Ot=r=>r._$AH,Me=r=>{r._$AR(),r._$AA.remove()};var jt=(r,e,t)=>{let a=new Map;for(let o=e;o<=t;o++)a.set(r[o],o);return a},Bo=z(class extends L{constructor(r){if(super(r),r.type!==H.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let a;t===void 0?t=e:e!==void 0&&(a=e);let o=[],i=[],s=0;for(let n of r)o[s]=a?a(n,s):s,i[s]=t(n,s),s++;return{values:i,keys:o}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,a]){let o=Ot(r),{values:i,keys:s}=this.dt(e,t,a);if(!Array.isArray(o))return this.ut=s,i;let n=this.ut??=[],c=[],l,d,p=0,h=o.length-1,g=0,y=i.length-1;for(;p<=h&&g<=y;)if(o[p]===null)p++;else if(o[h]===null)h--;else if(n[p]===s[g])c[g]=U(o[p],i[g]),p++,g++;else if(n[h]===s[y])c[y]=U(o[h],i[y]),h--,y--;else if(n[p]===s[y])c[y]=U(o[p],i[y]),oe(r,c[y+1],o[p]),p++,y--;else if(n[h]===s[g])c[g]=U(o[h],i[g]),oe(r,o[p],o[h]),h--,g++;else if(l===void 0&&(l=jt(s,g,y),d=jt(n,p,h)),l.has(n[p]))if(l.has(n[h])){let f=d.get(s[g]),b=f!==void 0?o[f]:null;if(b===null){let _=oe(r,o[p]);U(_,i[g]),c[g]=_}else c[g]=U(b,i[g]),oe(r,o[p],b),o[f]=null;g++}else Me(o[h]),h--;else Me(o[p]),p++;for(;g<=y;){let f=oe(r,c[y+1]);U(f,i[g]),c[g++]=f}for(;p<=h;){let f=o[p++];f!==null&&Me(f)}return this.ut=s,_e(r,c),T}});var Go=z(class extends L{constructor(){super(...arguments),this.key=k}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(_e(r),this.key=e),t}});var Xo=z(class extends L{constructor(r){if(super(r),r.type!==H.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(a=>a!=="")));for(let a in e)e[a]&&!this.nt?.has(a)&&this.st.add(a);return this.render(e)}let t=r.element.classList;for(let a of this.st)a in e||(t.remove(a),this.st.delete(a));for(let a in e){let o=!!e[a];o===this.st.has(a)||this.nt?.has(a)||(o?(t.add(a),this.st.add(a)):(t.remove(a),this.st.delete(a)))}return T}});var pe=(r,e)=>{let t=r._$AN;if(t===void 0)return!1;for(let a of t)a._$AO?.(e,!1),pe(a,e);return!0},Le=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},Ht=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),Nr(e)}};function Ir(r){this._$AN!==void 0?(Le(this),this._$AM=r,Ht(this)):this._$AM=r}function Br(r,e=!1,t=0){let a=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(a))for(let i=t;i<a.length;i++)pe(a[i],!1),Le(a[i]);else a!=null&&(pe(a,!1),Le(a));else pe(this,r)}var Nr=r=>{r.type==H.CHILD&&(r._$AP??=Br,r._$AQ??=Ir)},ae=class extends L{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,a){super._$AT(e,t,a),Ht(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(pe(this,e),Le(this))}setValue(e){if(Nt(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 at=new WeakMap,Or=z(class extends ae{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=at.get(e);t===void 0&&(t=new WeakMap,at.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"?at.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 De=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Pe=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 Ut=r=>!Bt(r)&&typeof r.then=="function",Wt=1073741823,it=class extends ae{constructor(){super(...arguments),this._$Cwt=Wt,this._$Cbt=[],this._$CK=new De(this),this._$CX=new Pe}render(...e){return e.find(t=>!Ut(t))??T}update(e,t){let a=this._$Cbt,o=a.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 c=t[n];if(!Ut(c))return this._$Cwt=n,c;n<o&&c===a[n]||(this._$Cwt=Wt,o=0,Promise.resolve(c).then(async l=>{for(;s.get();)await s.get();let d=i.deref();if(d!==void 0){let p=d._$Cbt.indexOf(c);p>-1&&p<d._$Cwt&&(d._$Cwt=p,d.setValue(l))}}))}return T}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},jr=z(it);var Q=class extends L{constructor(e){if(super(e),this.it=k,e.type!==H.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===T)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:[]}}};Q.directiveName="unsafeHTML",Q.resultType=1;var Re=z(Q);var ue=class extends Q{};ue.directiveName="unsafeSVG",ue.resultType=2;var Hr=z(ue);var Ba=["127.0.0.1","localhost"].includes(window.location.hostname);var Ur=Symbol.for(""),Wr=r=>{if(r?.r===Ur)return r?._$litStatic$};var qt=new Map,st=r=>(e,...t)=>{let a=t.length,o,i,s=[],n=[],c,l=0,d=!1;for(;l<a;){for(c=e[l];l<a&&(i=t[l],(o=Wr(i))!==void 0);)c+=o+e[++l],d=!0;l!==a&&n.push(i),s.push(c),l++}if(l===a&&s.push(e[a]),d){let p=s.join("$$lit$$");(e=qt.get(p))===void 0&&(s.raw=s,qt.set(p,e=s)),t=n}return r(e,...t)},qr=st(ze),ja=st(rt),Ha=st(Dt);var S=ze;var nt=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},console.log("[PDS Registry] Switched to STATIC mode",this._staticPaths)}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:export' and configured PDS.start() with the correct static.root path");let a=new CSSStyleSheet;return a.replaceSync("/* Failed to load "+e+" */"),a}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},he=new nt;var u={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"}};var Fe={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:"alert",name:"Alert",description:"Contextual feedback messages",selectors:[".alert",".alert-info",".alert-success",".alert-warning",".alert-danger",".alert-error",".alert-dismissible",".semantic-message"],tags:["feedback","message","notification","status"],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-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-jsonform",name:"JSON Form",description:"Auto-generated form from JSON Schema",selectors:["pds-jsonform"],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",".text-primary",".text-success",".text-warning",".text-danger",".text-info"],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:["alert","badge"],components:["pds-toaster"]},form:{description:"Form inputs and controls",primitives:["button","fieldset","label-field","form"],components:["pds-upload","pds-jsonform","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"]}},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"],form:["input","field","label","button","fieldset","pds-jsonform","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"],btn:["button","interactive","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"],alert:["notification","feedback","message","status","toast","modal","dialog","pds-ask","confirm","warning","error","info","success","danger"],notification:["alert","toast","pds-toaster","feedback","message","popup"],toast:["pds-toaster","notification","alert","feedback","popup","snackbar"],feedback:["alert","notification","toast","status","badge","validation","error","success"],message:["alert","notification","feedback","dialog","toast"],status:["badge","alert","indicator","feedback","state"],error:["alert","danger","validation","feedback","warning"],success:["alert","feedback","badge","status","check"],warning:["alert","caution","feedback","status"],info:["alert","information","feedback","status"],danger:["alert","error","feedback","destructive","delete"],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"]}};function Y(r,e){if(!r||!e)return!1;try{return r.matches(e)}catch{return!1}}function Gt(r,e){if(!r||!e||!r.closest)return null;try{return r.closest(e)}catch{return null}}function Vt(r,{maxDepth:e=5}={}){if(!r||r.closest&&r.closest(".showcase-toc"))return null;let t=r,a=0;for(;t&&a<e;){if(a++,t.tagName==="DS-SHOWCASE")return null;if(t.classList&&t.classList.contains("showcase-section")){t=t.parentElement;continue}for(let i of PDS.ontology.enhancements){let s=i.selector||i;if(Y(t,s))return{element:t,componentType:"enhanced-component",displayName:i.description||s,id:i.id}}if(t.tagName==="FIELDSET"){let i=t.getAttribute("role");if(i==="group"||i==="radiogroup")return{element:t,componentType:"form-group",displayName:i==="radiogroup"?"radio group":"form group"}}if(t.tagName==="LABEL"&&t.querySelector&&t.querySelector("input,select,textarea"))return{element:t,componentType:"form-control",displayName:"label with input"};let o=t.closest?t.closest("label"):null;if(o&&o.querySelector&&o.querySelector("input,select,textarea"))return{element:o,componentType:"form-control",displayName:"label with input"};for(let i of PDS.ontology.primitives){for(let s of i.selectors||[]){let n=String(s||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(h=>h.startsWith(l)))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id,id:i.id,tags:i.tags};let d=t.parentElement,p=0;for(;d&&p<e;){if(d.classList&&Array.from(d.classList).some(h=>h.startsWith(l))&&d.tagName!=="DS-SHOWCASE")return{element:d,componentType:"pds-primitive",displayName:i.name||i.id,id:i.id,tags:i.tags};d=d.parentElement,p++}continue}continue}if(Y(t,n))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id,id:i.id,tags:i.tags};let c=Gt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"pds-primitive",displayName:i.name||i.id,id:i.id,tags:i.tags}}if(t.classList){let s=Array.from(t.classList);for(let n of i.selectors||[])if(typeof n=="string"&&n.includes("*")&&n.startsWith(".")){let c=n.slice(1).replace(/\*/g,"");if(s.some(l=>l.startsWith(c)))return{element:t,componentType:"pds-primitive",displayName:i.name||i.id,id:i.id,tags:i.tags}}}}for(let i of PDS.ontology.layoutPatterns||[])for(let s of i.selectors||[]){let n=String(s||"").trim();if(n.includes("*")){if(n.startsWith(".")){let l=n.slice(1).replace(/\*/g,"");if(t.classList&&Array.from(t.classList).some(d=>d.startsWith(l)))return{element:t,componentType:"layout-pattern",displayName:i.name||i.id,id:i.id,tags:i.tags}}continue}if(Y(t,n))return{element:t,componentType:"layout-pattern",displayName:i.name||i.id,id:i.id,tags:i.tags};let c=Gt(t,n);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"layout-pattern",displayName:i.name||i.id,id:i.id,tags:i.tags}}if(t.tagName&&t.tagName.includes("-")){let i=t.tagName.toLowerCase(),s=PDS.ontology.components.find(n=>n.selectors.includes(i));return{element:t,componentType:"web-component",displayName:s?.name||i,id:s?.id||i,tags:s?.tags}}if(t.tagName==="BUTTON"){let i=t.querySelector&&t.querySelector("pds-icon");return{element:t,componentType:"button",displayName:i?"button with icon":"button",id:"button"}}if(Y(t,"pds-icon")||t.closest&&t.closest("pds-icon")){let i=Y(t,"pds-icon")?t:t.closest("pds-icon");return{element:i,componentType:"icon",displayName:`pds-icon (${i.getAttribute&&i.getAttribute("icon")||"unknown"})`,id:"pds-icon"}}if(Y(t,"nav[data-dropdown]")||t.closest&&t.closest("nav[data-dropdown]"))return{element:Y(t,"nav[data-dropdown]")?t:t.closest("nav[data-dropdown]"),componentType:"navigation",displayName:"dropdown menu",id:"dropdown"};t=t.parentElement}return null}var Jt=Fe;var $=class r{static#a;static get instance(){return this.#a}#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.#a=this,this.tokens=this.generateTokens(),this.options.debug&&this.options.log?.("debug","Generated tokens:",this.tokens),this.#fe(),typeof CSSStyleSheet<"u"?this.#xe():this.options.debug&&this.options.log?.("debug","[Generator] Skipping browser features (CSSStyleSheet not available)")}generateTokens(){let e=this.options.design||{};return{colors:this.#s(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#_(e.shape||{}),borderWidths:this.#M(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#L(e.layers||{}),layout:this.#D(e.layout||{}),transitions:this.#P(e.behavior||{}),zIndex:this.#R(e.layers||{}),icons:this.#F(e.icons||{})}}#s(e){let{primary:t="#3b82f6",secondary:a="#64748b",accent:o="#ec4899",background:i="#ffffff",success:s=null,warning:n="#FFBF00",danger:c=null,info:l=null,darkMode:d={}}=e,p={primary:this.#o(t),secondary:this.#o(a),accent:this.#o(o),success:this.#o(s||this.#w(t)),warning:this.#o(n||o),danger:this.#o(c||this.#x(t)),info:this.#o(l||t),gray:this.#u(a),surface:this.#h(i)};return p.surface.fieldset=this.#k(p.surface),p.surfaceSmart=this.#y(p.surface),p.dark=this.#$(p,i,d),p.dark&&p.dark.surface&&(p.dark.surfaceSmart=this.#y(p.dark.surface)),p.interactive={light:{fill:this.#b(p.primary,4.5),text:p.primary[600]},dark:{fill:this.#b(p.dark.primary,4.5),text:this.#A(p.dark.primary,p.dark.surface.base,4.5)}},p}#o(e){let t=this.#i(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))}}#w(e){let t=this.#i(e);return this.#t(120,Math.max(t.s,60),45)}#x(e){let t=this.#i(e);return this.#t(0,Math.max(t.s,70),50)}#u(e){let t=this.#i(e),a=t.h,o=Math.min(t.s,10);return{50:this.#t(a,o,98),100:this.#t(a,o,95),200:this.#t(a,o,88),300:this.#t(a,o,78),400:this.#t(a,o,60),500:e,600:this.#t(a,Math.min(o+5,15),45),700:this.#t(a,Math.min(o+8,18),35),800:this.#t(a,Math.min(o+10,20),20),900:this.#t(a,Math.min(o+12,22),10)}}#h(e){let t=this.#i(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.#g(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#k(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#S(e.sunken,.05),overlay:e.elevated}}#S(e,t=.05){let a=this.#i(e),o=Math.max(a.l-a.l*t,5);return this.#t(a.h,a.s,o)}#g(e){let t=this.#i(e);if(t.l>50){let a=Math.min(t.s+5,25),o=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,a,o)}else{let a=Math.max(t.s-10,5),o=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,a,o)}}#$(e,t="#ffffff",a={}){let o=a.background?a.background:this.#g(t),i=this.#h(o),s=a.primary?this.#o(a.primary):this.#n(e.primary);return{surface:{...i,fieldset:this.#T(i)},primary:s,secondary:a.secondary?this.#o(a.secondary):this.#n(e.secondary),accent:a.accent?this.#o(a.accent):this.#n(e.accent),gray:a.secondary?this.#u(a.secondary):e.gray,success:this.#n(e.success),info:this.#n(e.info),warning:this.#n(e.warning),danger:this.#n(e.danger)}}#l(e){let t=String(e||"").replace("#",""),a=t.length===3?t.split("").map(i=>i+i).join(""):t,o=parseInt(a,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}#p(e){let{r:t,g:a,b:o}=this.#l(e),i=[t/255,a/255,o/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]}#d(e,t){let a=this.#p(e),o=this.#p(t),i=Math.max(a,o),s=Math.min(a,o);return(i+.05)/(s+.05)}#m(e,t=4.5){if(!e)return"#000000";let a="#ffffff",o="#000000",i=this.#d(e,a);if(i>=t)return a;let s=this.#d(e,o);return s>=t||s>i?o:a}#f(e,t=1){let{r:a,g:o,b:i}=this.#l(e);return`rgba(${a}, ${o}, ${i}, ${t})`}#C(e,t,a=.5){let o=this.#l(e),i=this.#l(t),s=Math.round(o.r+(i.r-o.r)*a),n=Math.round(o.g+(i.g-o.g)*a),c=Math.round(o.b+(i.b-o.b)*a);return this.#E(s,n,c)}#E(e,t,a){let o=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${o(e)}${o(t)}${o(a)}`}#T(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#v(e.elevated,.08),sunken:e.elevated,overlay:this.#v(e.overlay,.05)}}#A(e={},t="#000000",a=4.5){let o=["600","700","800","500","400","900","300","200"],i={shade:null,color:null,ratio:0};for(let s of o){let n=e?.[s];if(!n||typeof n!="string")continue;let c=this.#d(n,t);if(c>i.ratio&&(i={shade:s,color:n,ratio:c}),c>=a)return n}return i.color||e?.["600"]||e?.["500"]}#b(e={},t=4.5){let a=["600","700","800","500","400","900"],o={shade:null,color:null,ratio:0};for(let i of a){let s=e?.[i];if(!s||typeof s!="string")continue;let n=this.#d(s,"#ffffff");if(n>o.ratio&&(o={shade:i,color:s,ratio:n}),n>=t)return s}return o.color||e?.["600"]||e?.["500"]}#y(e){let t={};return Object.entries(e).forEach(([a,o])=>{if(!o||typeof o!="string"||!o.startsWith("#"))return;let i=this.#p(o)<.5,s=this.#m(o,4.5),n=this.#m(o,3),c=this.#C(s,o,.4),l=s,d=c,p=i?"#ffffff":"#000000",h=i?.25:.1,g=this.#f(p,h),y=i?"#ffffff":"#000000",f=i?.15:.1,b=this.#f(y,f);t[a]={bg:o,text:s,textSecondary:n,textMuted:c,icon:l,iconSubtle:d,shadow:g,border:b,scheme:i?"dark":"light"}}),t}#v(e,t=.05){let a=this.#i(e),o=Math.min(a.l+(100-a.l)*t,95);return this.#t(a.h,a.s,o)}#n(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(([o,i])=>{let s=e[i.source];t[o]=this.#z(s,i.dimFactor)}),t}#z(e,t=.8){let a=this.#i(e),o=Math.max(a.s*t,5),i=Math.max(a.l*t,5);return this.#t(a.h,o,i)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:a=1.25,maxSpacingSteps:o=12}=e,i=Number.isFinite(Number(t))?Number(t):4,s=Math.min(Number.isFinite(Number(o))?Number(o):12,12),n={0:"0"};for(let c=1;c<=s;c++)n[c]=`${i*c}px`;return n}#_(e){let{radiusSize:t="medium",customRadius:a=null}=e,o;a!=null?o=a:typeof t=="number"?o=t:typeof t=="string"?o=u.RadiusSizes[t]??u.RadiusSizes.medium:o=u.RadiusSizes.medium;let i=Number.isFinite(Number(o))?Number(o):u.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"}}#M(e){let{borderWidth:t="medium"}=e,a;return typeof t=="number"?a=t:typeof t=="string"?a=u.BorderWidths[t]??u.BorderWidths.medium:a=u.BorderWidths.medium,{hairline:`${u.BorderWidths.hairline}px`,thin:`${u.BorderWidths.thin}px`,medium:`${u.BorderWidths.medium}px`,thick:`${u.BorderWidths.thick}px`}}generateTypographyTokens(e){let{fontFamilyHeadings:t="system-ui, -apple-system, sans-serif",fontFamilyBody:a="system-ui, -apple-system, sans-serif",fontFamilyMono:o='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:i=16,fontScale:s=1.25,fontWeightLight:n=u.FontWeights.light,fontWeightNormal:c=u.FontWeights.normal,fontWeightMedium:l=u.FontWeights.medium,fontWeightSemibold:d=u.FontWeights.semibold,fontWeightBold:p=u.FontWeights.bold,lineHeightTight:h=u.LineHeights.tight,lineHeightNormal:g=u.LineHeights.normal,lineHeightRelaxed:y=u.LineHeights.relaxed}=e,f=Number.isFinite(Number(i))?Number(i):16,b=Number.isFinite(Number(s))?Number(s):1.25;return{fontFamily:{headings:t,body:a,mono:o},fontSize:{xs:`${Math.round(f/Math.pow(b,2))}px`,sm:`${Math.round(f/b)}px`,base:`${f}px`,lg:`${Math.round(f*b)}px`,xl:`${Math.round(f*Math.pow(b,2))}px`,"2xl":`${Math.round(f*Math.pow(b,3))}px`,"3xl":`${Math.round(f*Math.pow(b,4))}px`,"4xl":`${Math.round(f*Math.pow(b,5))}px`},fontWeight:{light:n?.toString()||"300",normal:c?.toString()||"400",medium:l?.toString()||"500",semibold:d?.toString()||"600",bold:p?.toString()||"700"},lineHeight:{tight:h?.toString()||"1.25",normal:g?.toString()||"1.5",relaxed:y?.toString()||"1.75"}}}#L(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:a=1,shadowOffsetMultiplier:o=1}=e,i=`rgba(0, 0, 0, ${t})`,s=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*o}px ${2*a}px 0 ${s}`,base:`0 ${1*o}px ${3*a}px 0 ${i}, 0 ${1*o}px ${2*a}px 0 ${s}`,md:`0 ${4*o}px ${6*a}px ${-1*o}px ${i}, 0 ${2*o}px ${4*a}px ${-1*o}px ${s}`,lg:`0 ${10*o}px ${15*a}px ${-3*o}px ${i}, 0 ${4*o}px ${6*a}px ${-2*o}px ${s}`,xl:`0 ${20*o}px ${25*a}px ${-5*o}px ${i}, 0 ${10*o}px ${10*a}px ${-5*o}px ${s}`,inner:`inset 0 ${2*o}px ${4*a}px 0 ${s}`}}#D(e){let{maxWidth:t=1200,containerPadding:a=16,breakpoints:o={sm:640,md:768,lg:1024,xl:1280}}=e;return{maxWidth:`${t}px`,minHeight:"100vh",containerPadding:`${a}px`,breakpoints:{sm:`${o.sm}px`,md:`${o.md}px`,lg:`${o.lg}px`,xl:`${o.xl}px`},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#P(e){let{transitionSpeed:t=u.TransitionSpeeds.normal,animationEasing:a=u.AnimationEasings["ease-out"]}=e,o;return typeof t=="number"?o=t:typeof t=="string"&&u.TransitionSpeeds[t]?o=u.TransitionSpeeds[t]:o=u.TransitionSpeeds.normal,{fast:`${Math.round(o*.6)}ms`,normal:`${o}ms`,slow:`${Math.round(o*1.4)}ms`}}#R(e){let{baseZIndex:t=1e3,zIndexStep:a=10}=e;return{dropdown:t.toString(),sticky:(t+a*2).toString(),fixed:(t+a*3).toString(),modal:(t+a*4).toString(),drawer:(t+a*5).toString(),popover:(t+a*6).toString(),tooltip:(t+a*7).toString(),notification:(t+a*8).toString()}}#F(e){let{set:t="phosphor",weight:a="regular",defaultSize:o=24,sizes:i={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:s="/assets/pds/icons/pds-icons.svg"}=e;return{set:t,weight:a,defaultSize:`${o}px`,sizes:Object.fromEntries(Object.entries(i).map(([n,c])=>[n,`${c}px`])),spritePath:s}}#I(e){let t=[];t.push(` /* Colors */
4
+ `);let a=(o,i="")=>{Object.entries(o).forEach(([s,n])=>{typeof n=="object"&&n!==null?a(n,`${i}${s}-`):typeof n=="string"&&t.push(` --color-${i}${s}: ${n};
5
+ `)})};return Object.entries(e).forEach(([o,i])=>{o!=="dark"&&o!=="surfaceSmart"&&o!=="interactive"&&typeof i=="object"&&i!==null&&a(i,`${o}-`)}),e.surfaceSmart&&(t.push(` /* Smart Surface Tokens (context-aware) */
6
+ `),Object.entries(e.surfaceSmart).forEach(([o,i])=>{t.push(` --surface-${o}-bg: ${i.bg};
7
+ `),t.push(` --surface-${o}-text: ${i.text};
8
+ `),t.push(` --surface-${o}-text-secondary: ${i.textSecondary};
9
+ `),t.push(` --surface-${o}-text-muted: ${i.textMuted};
10
+ `),t.push(` --surface-${o}-icon: ${i.icon};
11
+ `),t.push(` --surface-${o}-icon-subtle: ${i.iconSubtle};
12
+ `),t.push(` --surface-${o}-shadow: ${i.shadow};
13
+ `),t.push(` --surface-${o}-border: ${i.border};
14
14
  `)}),t.push(`
15
15
  `)),t.push(` /* Semantic Text Colors */
16
16
  `),t.push(` --color-text-primary: var(--color-gray-900);
@@ -44,64 +44,64 @@ var xr=Object.defineProperty;var kr=(r,e)=>()=>(r&&(e=r(r=0)),e);var bt=(r,e)=>{
44
44
  /* Legacy alias for backwards compatibility */
45
45
  --backdrop-background: var(--backdrop-bg);
46
46
  `),t.push(this.#B(e)),`${t.join("")}
47
- `}#B(e){let t=e.primary?.[500]||"#3b82f6",i=e.secondary?.[500]||"#8b5cf6",o=e.accent?.[500]||"#f59e0b";return`
47
+ `}#B(e){let t=e.primary?.[500]||"#3b82f6",a=e.secondary?.[500]||"#8b5cf6",o=e.accent?.[500]||"#f59e0b";return`
48
48
  /* Mesh Gradient Backgrounds */
49
49
  --background-mesh-01: radial-gradient(at 27% 37%, color-mix(in oklab, ${t} 25%, transparent) 0px, transparent 50%),
50
- radial-gradient(at 97% 21%, color-mix(in oklab, ${i} 22%, transparent) 0px, transparent 50%),
50
+ radial-gradient(at 97% 21%, color-mix(in oklab, ${a} 22%, transparent) 0px, transparent 50%),
51
51
  radial-gradient(at 52% 99%, color-mix(in oklab, ${o} 18%, transparent) 0px, transparent 50%),
52
52
  radial-gradient(at 10% 29%, color-mix(in oklab, ${t} 15%, transparent) 0px, transparent 50%);
53
53
 
54
- --background-mesh-02: radial-gradient(at 40% 20%, color-mix(in oklab, ${i} 24%, transparent) 0px, transparent 50%),
54
+ --background-mesh-02: radial-gradient(at 40% 20%, color-mix(in oklab, ${a} 24%, transparent) 0px, transparent 50%),
55
55
  radial-gradient(at 80% 0%, color-mix(in oklab, ${t} 20%, transparent) 0px, transparent 50%),
56
56
  radial-gradient(at 0% 50%, color-mix(in oklab, ${o} 17%, transparent) 0px, transparent 50%),
57
- radial-gradient(at 80% 100%, color-mix(in oklab, ${i} 15%, transparent) 0px, transparent 50%);
57
+ radial-gradient(at 80% 100%, color-mix(in oklab, ${a} 15%, transparent) 0px, transparent 50%);
58
58
 
59
59
  --background-mesh-03: radial-gradient(at 15% 50%, color-mix(in oklab, ${o} 21%, transparent) 0px, transparent 50%),
60
60
  radial-gradient(at 85% 30%, color-mix(in oklab, ${t} 23%, transparent) 0px, transparent 50%),
61
- radial-gradient(at 50% 80%, color-mix(in oklab, ${i} 18%, transparent) 0px, transparent 50%),
61
+ radial-gradient(at 50% 80%, color-mix(in oklab, ${a} 18%, transparent) 0px, transparent 50%),
62
62
  radial-gradient(at 90% 90%, color-mix(in oklab, ${o} 16%, transparent) 0px, transparent 50%);
63
63
 
64
64
  --background-mesh-04: radial-gradient(at 70% 15%, color-mix(in oklab, ${t} 19%, transparent) 0px, transparent 50%),
65
- radial-gradient(at 20% 80%, color-mix(in oklab, ${i} 22%, transparent) 0px, transparent 50%),
65
+ radial-gradient(at 20% 80%, color-mix(in oklab, ${a} 22%, transparent) 0px, transparent 50%),
66
66
  radial-gradient(at 90% 60%, color-mix(in oklab, ${o} 17%, transparent) 0px, transparent 50%),
67
67
  radial-gradient(at 30% 40%, color-mix(in oklab, ${t} 16%, transparent) 0px, transparent 50%);
68
68
 
69
69
  --background-mesh-05: radial-gradient(at 50% 50%, color-mix(in oklab, ${t} 23%, transparent) 0px, transparent 50%),
70
70
  radial-gradient(at 10% 10%, color-mix(in oklab, ${o} 20%, transparent) 0px, transparent 50%),
71
- radial-gradient(at 90% 10%, color-mix(in oklab, ${i} 18%, transparent) 0px, transparent 50%),
71
+ radial-gradient(at 90% 10%, color-mix(in oklab, ${a} 18%, transparent) 0px, transparent 50%),
72
72
  radial-gradient(at 50% 90%, color-mix(in oklab, ${o} 15%, transparent) 0px, transparent 50%);
73
73
  `}#N(e){let t=[` /* Spacing */
74
- `];return Object.entries(e).forEach(([i,o])=>{i!=null&&i!=="NaN"&&o!==void 0&&!o.includes("NaN")&&t.push(` --spacing-${i}: ${o};
74
+ `];return Object.entries(e).forEach(([a,o])=>{a!=null&&a!=="NaN"&&o!==void 0&&!o.includes("NaN")&&t.push(` --spacing-${a}: ${o};
75
75
  `)}),`${t.join("")}
76
76
  `}#O(e){let t=[` /* Border Radius */
77
- `];return Object.entries(e).forEach(([i,o])=>{t.push(` --radius-${i}: ${o};
77
+ `];return Object.entries(e).forEach(([a,o])=>{t.push(` --radius-${a}: ${o};
78
78
  `)}),`${t.join("")}
79
79
  `}#j(e){let t=[` /* Border Widths */
80
- `];return Object.entries(e).forEach(([i,o])=>{t.push(` --border-width-${i}: ${o};
80
+ `];return Object.entries(e).forEach(([a,o])=>{t.push(` --border-width-${a}: ${o};
81
81
  `)}),`${t.join("")}
82
82
  `}#H(e){let t=[` /* Typography */
83
- `];return Object.entries(e).forEach(([i,o])=>{let a=i.replace(/^font/,"").replace(/^(.)/,s=>s.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase();Object.entries(o).forEach(([s,n])=>{let c=s.replace(/([A-Z])/g,"-$1").toLowerCase();t.push(` --font-${a}-${c}: ${n};
83
+ `];return Object.entries(e).forEach(([a,o])=>{let i=a.replace(/^font/,"").replace(/^(.)/,s=>s.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase();Object.entries(o).forEach(([s,n])=>{let c=s.replace(/([A-Z])/g,"-$1").toLowerCase();t.push(` --font-${i}-${c}: ${n};
84
84
  `)})}),`${t.join("")}
85
85
  `}#U(e){let t=[` /* Shadows */
86
- `];return Object.entries(e).forEach(([i,o])=>{t.push(` --shadow-${i}: ${o};
86
+ `];return Object.entries(e).forEach(([a,o])=>{t.push(` --shadow-${a}: ${o};
87
87
  `)}),`${t.join("")}
88
88
  `}#W(e){let t=[` /* Layout */
89
- `];return Object.entries(e).forEach(([i,o])=>{let a=i.replace(/([A-Z])/g,"-$1").toLowerCase();i!=="breakpoints"&&t.push(` --layout-${a}: ${o};
89
+ `];return Object.entries(e).forEach(([a,o])=>{let i=a.replace(/([A-Z])/g,"-$1").toLowerCase();a!=="breakpoints"&&t.push(` --layout-${i}: ${o};
90
90
  `)}),`${t.join("")}
91
91
  `}#q(e){let t=[` /* Transitions */
92
- `];return Object.entries(e).forEach(([i,o])=>{t.push(` --transition-${i}: ${o};
92
+ `];return Object.entries(e).forEach(([a,o])=>{t.push(` --transition-${a}: ${o};
93
93
  `)}),`${t.join("")}
94
94
  `}#G(e){let t=[` /* Z-Index */
95
- `];return Object.entries(e).forEach(([i,o])=>{t.push(` --z-${i}: ${o};
95
+ `];return Object.entries(e).forEach(([a,o])=>{t.push(` --z-${a}: ${o};
96
96
  `)}),`${t.join("")}
97
97
  `}#V(e){let t=[` /* Icon System */
98
98
  `];return t.push(` --icon-set: ${e.set};
99
99
  `),t.push(` --icon-weight: ${e.weight};
100
100
  `),t.push(` --icon-size: ${e.defaultSize};
101
- `),Object.entries(e.sizes).forEach(([i,o])=>{t.push(` --icon-size-${i}: ${o};
101
+ `),Object.entries(e.sizes).forEach(([a,o])=>{t.push(` --icon-size-${a}: ${o};
102
102
  `)}),`${t.join("")}
103
- `}#J(e){if(!e?.dark)return"";let t=[],i=(l,d="")=>{Object.entries(l).forEach(([p,h])=>{typeof h=="object"&&h!==null?i(h,`${d}${p}-`):typeof h=="string"&&t.push(` --color-${d}${p}: ${h};
104
- `)})};Object.entries(e.dark).forEach(([l,d])=>{l!=="surfaceSmart"&&typeof d=="object"&&d!==null&&i(d,`${l}-`)});let o=[];e.dark.surfaceSmart&&(o.push(` /* Smart Surface Tokens (dark mode, context-aware) */
103
+ `}#J(e){if(!e?.dark)return"";let t=[],a=(l,d="")=>{Object.entries(l).forEach(([p,h])=>{typeof h=="object"&&h!==null?a(h,`${d}${p}-`):typeof h=="string"&&t.push(` --color-${d}${p}: ${h};
104
+ `)})};Object.entries(e.dark).forEach(([l,d])=>{l!=="surfaceSmart"&&typeof d=="object"&&d!==null&&a(d,`${l}-`)});let o=[];e.dark.surfaceSmart&&(o.push(` /* Smart Surface Tokens (dark mode, context-aware) */
105
105
  `),Object.entries(e.dark.surfaceSmart).forEach(([l,d])=>{o.push(` --surface-${l}-bg: ${d.bg};
106
106
  `),o.push(` --surface-${l}-text: ${d.text};
107
107
  `),o.push(` --surface-${l}-text-secondary: ${d.textSecondary};
@@ -111,7 +111,7 @@ var xr=Object.defineProperty;var kr=(r,e)=>()=>(r&&(e=r(r=0)),e);var bt=(r,e)=>{
111
111
  `),o.push(` --surface-${l}-shadow: ${d.shadow};
112
112
  `),o.push(` --surface-${l}-border: ${d.border};
113
113
  `)}),o.push(`
114
- `));let a=` --color-text-primary: var(--color-gray-100);
114
+ `));let i=` --color-text-primary: var(--color-gray-100);
115
115
  --color-text-secondary: var(--color-gray-300);
116
116
  --color-text-muted: var(--color-gray-400);
117
117
  --color-border: var(--color-gray-700);
@@ -134,9 +134,9 @@ var xr=Object.defineProperty;var kr=(r,e)=>()=>(r&&(e=r(r=0)),e);var bt=(r,e)=>{
134
134
  /* Legacy alias for backwards compatibility */
135
135
  --backdrop-background: var(--backdrop-bg);
136
136
  `,n=this.#Y(e);return`html[data-theme="dark"] {
137
- ${[...t,...o,a,s,n].join("")}}
138
- `}#K(e){if(!e?.dark)return"";let t=[],i=(d,p="")=>{Object.entries(d).forEach(([h,g])=>{typeof g=="object"&&g!==null?i(g,`${p}${h}-`):typeof g=="string"&&t.push(` --color-${p}${h}: ${g};
139
- `)})};Object.entries(e.dark).forEach(([d,p])=>{d!=="surfaceSmart"&&typeof p=="object"&&p!==null&&i(p,`${d}-`)});let o=[];e.dark.surfaceSmart&&(o.push(` /* Smart Surface Tokens (dark mode, context-aware) */
137
+ ${[...t,...o,i,s,n].join("")}}
138
+ `}#K(e){if(!e?.dark)return"";let t=[],a=(d,p="")=>{Object.entries(d).forEach(([h,g])=>{typeof g=="object"&&g!==null?a(g,`${p}${h}-`):typeof g=="string"&&t.push(` --color-${p}${h}: ${g};
139
+ `)})};Object.entries(e.dark).forEach(([d,p])=>{d!=="surfaceSmart"&&typeof p=="object"&&p!==null&&a(p,`${d}-`)});let o=[];e.dark.surfaceSmart&&(o.push(` /* Smart Surface Tokens (dark mode, context-aware) */
140
140
  `),Object.entries(e.dark.surfaceSmart).forEach(([d,p])=>{o.push(` --surface-${d}-bg: ${p.bg};
141
141
  `),o.push(` --surface-${d}-text: ${p.text};
142
142
  `),o.push(` --surface-${d}-text-secondary: ${p.textSecondary};
@@ -146,9 +146,9 @@ ${[...t,...o,a,s,n].join("")}}
146
146
  `),o.push(` --surface-${d}-shadow: ${p.shadow};
147
147
  `),o.push(` --surface-${d}-border: ${p.border};
148
148
  `)}),o.push(`
149
- `));let a=[];e.interactive&&e.interactive.dark&&(a.push(` /* Interactive Colors - optimized for specific use cases (dark mode) */
150
- `),a.push(` --color-primary-fill: ${e.interactive.dark.fill}; /* For button backgrounds with white text */
151
- `),a.push(` --color-primary-text: ${e.interactive.dark.text}; /* For links and outline buttons on dark surfaces */
149
+ `));let i=[];e.interactive&&e.interactive.dark&&(i.push(` /* Interactive Colors - optimized for specific use cases (dark mode) */
150
+ `),i.push(` --color-primary-fill: ${e.interactive.dark.fill}; /* For button backgrounds with white text */
151
+ `),i.push(` --color-primary-text: ${e.interactive.dark.text}; /* For links and outline buttons on dark surfaces */
152
152
  `));let s=[` --color-text-primary: var(--color-gray-100);
153
153
  `,` --color-text-secondary: var(--color-gray-300);
154
154
  `,` --color-text-muted: var(--color-gray-400);
@@ -157,7 +157,7 @@ ${[...t,...o,a,s,n].join("")}}
157
157
  `,` --color-input-disabled-bg: var(--color-gray-900);
158
158
  `,` --color-input-disabled-text: var(--color-gray-600);
159
159
  `,` --color-code-bg: var(--color-gray-800);
160
- `,...a].join(""),n=` /* Backdrop tokens - dark mode */
160
+ `,...i].join(""),n=` /* Backdrop tokens - dark mode */
161
161
  --backdrop-bg: linear-gradient(
162
162
  135deg,
163
163
  rgba(0, 0, 0, 0.6),
@@ -174,57 +174,57 @@ ${[...t,...o,a,s,n].join("")}}
174
174
  `,c=this.#Q(e);return`
175
175
  html[data-theme="dark"] {
176
176
  ${[...t,...o,s,n,c].join("")} }
177
- `}#Q(e){let t=e.dark||e,i=t.primary?.[400]||"#60a5fa",o=t.secondary?.[400]||"#a78bfa",a=t.accent?.[400]||"#fbbf24";return` /* Mesh Gradient Variables (Dark Mode) */
178
- --background-mesh-01: radial-gradient(at 27% 37%, color-mix(in oklab, ${i} 20%, transparent) 0px, transparent 50%),
177
+ `}#Q(e){let t=e.dark||e,a=t.primary?.[400]||"#60a5fa",o=t.secondary?.[400]||"#a78bfa",i=t.accent?.[400]||"#fbbf24";return` /* Mesh Gradient Variables (Dark Mode) */
178
+ --background-mesh-01: radial-gradient(at 27% 37%, color-mix(in oklab, ${a} 20%, transparent) 0px, transparent 50%),
179
179
  radial-gradient(at 97% 21%, color-mix(in oklab, ${o} 16%, transparent) 0px, transparent 50%),
180
- radial-gradient(at 52% 99%, color-mix(in oklab, ${a} 13%, transparent) 0px, transparent 50%),
181
- radial-gradient(at 10% 29%, color-mix(in oklab, ${i} 10%, transparent) 0px, transparent 50%);
180
+ radial-gradient(at 52% 99%, color-mix(in oklab, ${i} 13%, transparent) 0px, transparent 50%),
181
+ radial-gradient(at 10% 29%, color-mix(in oklab, ${a} 10%, transparent) 0px, transparent 50%);
182
182
 
183
183
  --background-mesh-02: radial-gradient(at 40% 20%, color-mix(in oklab, ${o} 18%, transparent) 0px, transparent 50%),
184
- radial-gradient(at 80% 0%, color-mix(in oklab, ${i} 14%, transparent) 0px, transparent 50%),
185
- radial-gradient(at 0% 50%, color-mix(in oklab, ${a} 12%, transparent) 0px, transparent 50%),
184
+ radial-gradient(at 80% 0%, color-mix(in oklab, ${a} 14%, transparent) 0px, transparent 50%),
185
+ radial-gradient(at 0% 50%, color-mix(in oklab, ${i} 12%, transparent) 0px, transparent 50%),
186
186
  radial-gradient(at 80% 100%, color-mix(in oklab, ${o} 10%, transparent) 0px, transparent 50%);
187
187
 
188
- --background-mesh-03: radial-gradient(at 15% 50%, color-mix(in oklab, ${a} 15%, transparent) 0px, transparent 50%),
189
- radial-gradient(at 85% 30%, color-mix(in oklab, ${i} 17%, transparent) 0px, transparent 50%),
188
+ --background-mesh-03: radial-gradient(at 15% 50%, color-mix(in oklab, ${i} 15%, transparent) 0px, transparent 50%),
189
+ radial-gradient(at 85% 30%, color-mix(in oklab, ${a} 17%, transparent) 0px, transparent 50%),
190
190
  radial-gradient(at 50% 80%, color-mix(in oklab, ${o} 13%, transparent) 0px, transparent 50%),
191
- radial-gradient(at 90% 90%, color-mix(in oklab, ${a} 11%, transparent) 0px, transparent 50%);
191
+ radial-gradient(at 90% 90%, color-mix(in oklab, ${i} 11%, transparent) 0px, transparent 50%);
192
192
 
193
- --background-mesh-04: radial-gradient(at 70% 15%, color-mix(in oklab, ${i} 14%, transparent) 0px, transparent 50%),
193
+ --background-mesh-04: radial-gradient(at 70% 15%, color-mix(in oklab, ${a} 14%, transparent) 0px, transparent 50%),
194
194
  radial-gradient(at 20% 80%, color-mix(in oklab, ${o} 16%, transparent) 0px, transparent 50%),
195
- radial-gradient(at 90% 60%, color-mix(in oklab, ${a} 12%, transparent) 0px, transparent 50%),
196
- radial-gradient(at 30% 40%, color-mix(in oklab, ${i} 11%, transparent) 0px, transparent 50%);
195
+ radial-gradient(at 90% 60%, color-mix(in oklab, ${i} 12%, transparent) 0px, transparent 50%),
196
+ radial-gradient(at 30% 40%, color-mix(in oklab, ${a} 11%, transparent) 0px, transparent 50%);
197
197
 
198
- --background-mesh-05: radial-gradient(at 50% 50%, color-mix(in oklab, ${i} 17%, transparent) 0px, transparent 50%),
199
- radial-gradient(at 10% 10%, color-mix(in oklab, ${a} 14%, transparent) 0px, transparent 50%),
198
+ --background-mesh-05: radial-gradient(at 50% 50%, color-mix(in oklab, ${a} 17%, transparent) 0px, transparent 50%),
199
+ radial-gradient(at 10% 10%, color-mix(in oklab, ${i} 14%, transparent) 0px, transparent 50%),
200
200
  radial-gradient(at 90% 10%, color-mix(in oklab, ${o} 13%, transparent) 0px, transparent 50%),
201
- radial-gradient(at 50% 90%, color-mix(in oklab, ${a} 10%, transparent) 0px, transparent 50%);
202
- `}#Y(e){let t=e.dark||e,i=t.primary?.[400]||"#60a5fa",o=t.secondary?.[400]||"#a78bfa",a=t.accent?.[400]||"#fbbf24";return`
201
+ radial-gradient(at 50% 90%, color-mix(in oklab, ${i} 10%, transparent) 0px, transparent 50%);
202
+ `}#Y(e){let t=e.dark||e,a=t.primary?.[400]||"#60a5fa",o=t.secondary?.[400]||"#a78bfa",i=t.accent?.[400]||"#fbbf24";return`
203
203
  /* Mesh Gradient Backgrounds (Dark Mode) */
204
- --background-mesh-01: radial-gradient(at 27% 37%, color-mix(in oklab, ${i} 20%, transparent) 0px, transparent 50%),
204
+ --background-mesh-01: radial-gradient(at 27% 37%, color-mix(in oklab, ${a} 20%, transparent) 0px, transparent 50%),
205
205
  radial-gradient(at 97% 21%, color-mix(in oklab, ${o} 16%, transparent) 0px, transparent 50%),
206
- radial-gradient(at 52% 99%, color-mix(in oklab, ${a} 13%, transparent) 0px, transparent 50%),
207
- radial-gradient(at 10% 29%, color-mix(in oklab, ${i} 10%, transparent) 0px, transparent 50%);
206
+ radial-gradient(at 52% 99%, color-mix(in oklab, ${i} 13%, transparent) 0px, transparent 50%),
207
+ radial-gradient(at 10% 29%, color-mix(in oklab, ${a} 10%, transparent) 0px, transparent 50%);
208
208
 
209
209
  --background-mesh-02: radial-gradient(at 40% 20%, color-mix(in oklab, ${o} 18%, transparent) 0px, transparent 50%),
210
- radial-gradient(at 80% 0%, color-mix(in oklab, ${i} 14%, transparent) 0px, transparent 50%),
211
- radial-gradient(at 0% 50%, color-mix(in oklab, ${a} 12%, transparent) 0px, transparent 50%),
210
+ radial-gradient(at 80% 0%, color-mix(in oklab, ${a} 14%, transparent) 0px, transparent 50%),
211
+ radial-gradient(at 0% 50%, color-mix(in oklab, ${i} 12%, transparent) 0px, transparent 50%),
212
212
  radial-gradient(at 80% 100%, color-mix(in oklab, ${o} 10%, transparent) 0px, transparent 50%);
213
213
 
214
- --background-mesh-03: radial-gradient(at 15% 50%, color-mix(in oklab, ${a} 15%, transparent) 0px, transparent 50%),
215
- radial-gradient(at 85% 30%, color-mix(in oklab, ${i} 17%, transparent) 0px, transparent 50%),
214
+ --background-mesh-03: radial-gradient(at 15% 50%, color-mix(in oklab, ${i} 15%, transparent) 0px, transparent 50%),
215
+ radial-gradient(at 85% 30%, color-mix(in oklab, ${a} 17%, transparent) 0px, transparent 50%),
216
216
  radial-gradient(at 50% 80%, color-mix(in oklab, ${o} 13%, transparent) 0px, transparent 50%),
217
- radial-gradient(at 90% 90%, color-mix(in oklab, ${a} 11%, transparent) 0px, transparent 50%);
217
+ radial-gradient(at 90% 90%, color-mix(in oklab, ${i} 11%, transparent) 0px, transparent 50%);
218
218
 
219
- --background-mesh-04: radial-gradient(at 70% 15%, color-mix(in oklab, ${i} 14%, transparent) 0px, transparent 50%),
219
+ --background-mesh-04: radial-gradient(at 70% 15%, color-mix(in oklab, ${a} 14%, transparent) 0px, transparent 50%),
220
220
  radial-gradient(at 20% 80%, color-mix(in oklab, ${o} 16%, transparent) 0px, transparent 50%),
221
- radial-gradient(at 90% 60%, color-mix(in oklab, ${a} 12%, transparent) 0px, transparent 50%),
222
- radial-gradient(at 30% 40%, color-mix(in oklab, ${i} 11%, transparent) 0px, transparent 50%);
221
+ radial-gradient(at 90% 60%, color-mix(in oklab, ${i} 12%, transparent) 0px, transparent 50%),
222
+ radial-gradient(at 30% 40%, color-mix(in oklab, ${a} 11%, transparent) 0px, transparent 50%);
223
223
 
224
- --background-mesh-05: radial-gradient(at 50% 50%, color-mix(in oklab, ${i} 17%, transparent) 0px, transparent 50%),
225
- radial-gradient(at 10% 10%, color-mix(in oklab, ${a} 14%, transparent) 0px, transparent 50%),
224
+ --background-mesh-05: radial-gradient(at 50% 50%, color-mix(in oklab, ${a} 17%, transparent) 0px, transparent 50%),
225
+ radial-gradient(at 10% 10%, color-mix(in oklab, ${i} 14%, transparent) 0px, transparent 50%),
226
226
  radial-gradient(at 90% 10%, color-mix(in oklab, ${o} 13%, transparent) 0px, transparent 50%),
227
- radial-gradient(at 50% 90%, color-mix(in oklab, ${a} 10%, transparent) 0px, transparent 50%);
227
+ radial-gradient(at 50% 90%, color-mix(in oklab, ${i} 10%, transparent) 0px, transparent 50%);
228
228
  `}#Z(){return`/* Alert dark mode adjustments */
229
229
  html[data-theme="dark"] .alert-success {
230
230
  background-color: var(--color-success-50);
@@ -636,7 +636,7 @@ html[data-theme="dark"] .liquid-glass {
636
636
 
637
637
  /* Dialog styles moved to #generateDialogStyles() */
638
638
 
639
- `}#oe(){let{gap:e,inputPadding:t,buttonPadding:i,focusRingWidth:o,focusRingOpacity:a,borderWidthThin:s,sectionSpacing:n,buttonMinHeight:c,inputMinHeight:l}=this.options.design,d=t||.75,p=i||1,h=o||3,g=s||1,y=e||1,f=n||2,b=c||44;return`/* Mobile-First Form Styles - Generated from Design Config */
639
+ `}#oe(){let{gap:e,inputPadding:t,buttonPadding:a,focusRingWidth:o,focusRingOpacity:i,borderWidthThin:s,sectionSpacing:n,buttonMinHeight:c,inputMinHeight:l}=this.options.design,d=t||.75,p=a||1,h=o||3,g=s||1,y=e||1,f=n||2,b=c||44;return`/* Mobile-First Form Styles - Generated from Design Config */
640
640
  form {
641
641
  margin: 0;
642
642
  width: 100%;
@@ -764,7 +764,7 @@ input, textarea, select {
764
764
  &:focus {
765
765
  outline: none;
766
766
  border-color: var(--color-primary-500);
767
- box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((a||.3)*100)}%, transparent);
767
+ box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((i||.3)*100)}%, transparent);
768
768
  background-color: var(--color-surface-base);
769
769
  }
770
770
 
@@ -780,7 +780,7 @@ input, textarea, select {
780
780
  border-color: var(--color-danger-500);
781
781
 
782
782
  &:focus {
783
- box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-danger-500) ${Math.round((a||.3)*100)}%, transparent);
783
+ box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-danger-500) ${Math.round((i||.3)*100)}%, transparent);
784
784
  }
785
785
  }
786
786
  }
@@ -962,7 +962,7 @@ input[type="checkbox"]:checked + label:not(fieldset label):not(label[data-toggle
962
962
  label:has(input[type="checkbox"]:focus):not(fieldset label):not(label[data-toggle]),
963
963
  input[type="checkbox"]:focus + label:not(fieldset label):not(label[data-toggle]) {
964
964
  outline: none;
965
- box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((a||.3)*100)}%, transparent);
965
+ box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((i||.3)*100)}%, transparent);
966
966
  }
967
967
 
968
968
  label:has(input[type="checkbox"]:disabled):not(fieldset label):not(label[data-toggle]),
@@ -1070,7 +1070,7 @@ fieldset[role="group"].buttons {
1070
1070
  label:has(input[type="radio"]:focus),
1071
1071
  label:has(input[type="checkbox"]:focus) {
1072
1072
  outline: none;
1073
- box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((a||.3)*100)}%, transparent);
1073
+ box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((i||.3)*100)}%, transparent);
1074
1074
  }
1075
1075
 
1076
1076
  label:has(input[type="radio"]:disabled),
@@ -1227,7 +1227,7 @@ button, .btn, input[type="submit"], input[type="button"], input[type="reset"] {
1227
1227
 
1228
1228
  &:focus {
1229
1229
  outline: none;
1230
- box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((a||.3)*100)}%, transparent);
1230
+ box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((i||.3)*100)}%, transparent);
1231
1231
  }
1232
1232
 
1233
1233
  &:disabled {
@@ -1257,7 +1257,7 @@ button, .btn, input[type="submit"], input[type="button"], input[type="reset"] {
1257
1257
  }
1258
1258
 
1259
1259
  &:focus {
1260
- box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((a||.3)*100)}%, transparent);
1260
+ box-shadow: 0 0 0 ${h}px color-mix(in oklab, var(--color-primary-500) ${Math.round((i||.3)*100)}%, transparent);
1261
1261
  }
1262
1262
 
1263
1263
  &:disabled {
@@ -1464,7 +1464,7 @@ a.btn-working {
1464
1464
  }
1465
1465
  }
1466
1466
 
1467
- `}#ie(){let{layout:e={}}=this.options.design,t=e.breakpoints||{sm:640,md:768,lg:1024,xl:1280};return`/* Table Styles - Mobile First */
1467
+ `}#ae(){let{layout:e={}}=this.options.design,t=e.breakpoints||{sm:640,md:768,lg:1024,xl:1280};return`/* Table Styles - Mobile First */
1468
1468
 
1469
1469
  table {
1470
1470
  width: 100%;
@@ -1545,7 +1545,7 @@ tbody {
1545
1545
  }
1546
1546
  }
1547
1547
 
1548
- `}#ae(){return`/* Alert/Notification Styles */
1548
+ `}#ie(){return`/* Alert/Notification Styles */
1549
1549
 
1550
1550
  /* Alias: .semantic-message shares alert base styles */
1551
1551
  .alert, .semantic-message {
@@ -2493,7 +2493,7 @@ nav[data-dropdown] {
2493
2493
  scale: 0.95;
2494
2494
  }
2495
2495
  }
2496
- `}#he(){let{layout:e={}}=this.options.design,t=e.breakpoints||{sm:640,md:768,lg:1024,xl:1280},i=e.gridSystem||{},o=i.columns||[1,2,3,4,6],a=i.autoFitBreakpoints||{sm:"150px",md:"250px",lg:"350px",xl:"450px"},s=[`
2496
+ `}#he(){let{layout:e={}}=this.options.design,t=e.breakpoints||{sm:640,md:768,lg:1024,xl:1280},a=e.gridSystem||{},o=a.columns||[1,2,3,4,6],i=a.autoFitBreakpoints||{sm:"150px",md:"250px",lg:"350px",xl:"450px"},s=[`
2497
2497
  /* ============================================================================
2498
2498
  Layout Utilities
2499
2499
  Modern grid and flex system for building responsive layouts
@@ -2517,7 +2517,7 @@ nav[data-dropdown] {
2517
2517
  `];for(let n of o)s.push(`.grid-cols-${n} { grid-template-columns: repeat(${n}, 1fr); }
2518
2518
  `);s.push(`
2519
2519
  /* Auto-fit grids (responsive) */
2520
- `);for(let[n,c]of Object.entries(a))s.push(`.grid-auto-${n} { grid-template-columns: repeat(auto-fit, minmax(${c}, 1fr)); }
2520
+ `);for(let[n,c]of Object.entries(i))s.push(`.grid-auto-${n} { grid-template-columns: repeat(auto-fit, minmax(${c}, 1fr)); }
2521
2521
  `);return s.push(`
2522
2522
  /* Gap utilities */
2523
2523
  .gap-0 { gap: 0; }
@@ -2684,10 +2684,10 @@ nav[data-dropdown] {
2684
2684
  height: auto;
2685
2685
  }
2686
2686
 
2687
- `}#me(){let{layout:e={},a11y:t={}}=this.options.design,i=e.breakpoints||{sm:640,md:768,lg:1024,xl:1280},o=t.minTouchTarget||u.TouchTargetSizes.standard;return`/* Mobile-First Responsive Design */
2687
+ `}#me(){let{layout:e={},a11y:t={}}=this.options.design,a=e.breakpoints||{sm:640,md:768,lg:1024,xl:1280},o=t.minTouchTarget||u.TouchTargetSizes.standard;return`/* Mobile-First Responsive Design */
2688
2688
 
2689
- /* Small devices (${i.sm}px and up) */
2690
- @media (min-width: ${i.sm}px) {
2689
+ /* Small devices (${a.sm}px and up) */
2690
+ @media (min-width: ${a.sm}px) {
2691
2691
  .sm\\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
2692
2692
  .sm\\:flex-row { flex-direction: row; }
2693
2693
  .sm\\:text-sm { font-size: var(--font-size-sm); }
@@ -2697,8 +2697,8 @@ nav[data-dropdown] {
2697
2697
  .sm\\:block { display: block; }
2698
2698
  }
2699
2699
 
2700
- /* Medium devices (${i.md}px and up) */
2701
- @media (min-width: ${i.md}px) {
2700
+ /* Medium devices (${a.md}px and up) */
2701
+ @media (min-width: ${a.md}px) {
2702
2702
  .md\\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
2703
2703
  .md\\:text-lg { font-size: var(--font-size-lg); }
2704
2704
  .md\\:p-8 { padding: var(--spacing-8); }
@@ -2710,8 +2710,8 @@ nav[data-dropdown] {
2710
2710
  .md\\:block { display: block; }
2711
2711
  }
2712
2712
 
2713
- /* Large devices (${i.lg}px and up) */
2714
- @media (min-width: ${i.lg}px) {
2713
+ /* Large devices (${a.lg}px and up) */
2714
+ @media (min-width: ${a.lg}px) {
2715
2715
  .lg\\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
2716
2716
  .lg\\:text-xl { font-size: var(--font-size-xl); }
2717
2717
  .lg\\:p-12 { padding: var(--spacing-12); }
@@ -2808,13 +2808,13 @@ nav[data-dropdown] {
2808
2808
  }
2809
2809
  }
2810
2810
 
2811
- `}#a(e){let t=parseInt(e.slice(1,3),16)/255,i=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,a=Math.max(t,i,o),s=Math.min(t,i,o),n,c,l=(a+s)/2;if(a===s)n=c=0;else{let d=a-s;switch(c=l>.5?d/(2-a-s):d/(a+s),a){case t:n=(i-o)/d+(i<o?6:0);break;case i:n=(o-t)/d+2;break;case o:n=(t-i)/d+4;break}n/=6}return{h:n*360,s:c*100,l:l*100}}#t(e,t,i){e=e/360,t=t/100,i=i/100;let o=(l,d,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<1/6?l+(d-l)*6*p:p<1/2?d:p<2/3?l+(d-l)*(2/3-p)*6:l),a,s,n;if(t===0)a=s=n=i;else{let l=i<.5?i*(1+t):i+t-i*t,d=2*i-l;a=o(d,l,e+1/3),s=o(d,l,e),n=o(d,l,e-1/3)}let c=l=>{let d=Math.round(l*255).toString(16);return d.length===1?"0"+d:d};return`#${c(a)}${c(s)}${c(n)}`}getTokens(){return this.tokens}exportCSS(){return this.layeredCSS}#fe(){this.#e={tokens:this.#be(),primitives:this.#ye(),components:this.#ve(),utilities:this.#we()},this.options.debug&&this.options.log?.("debug","[Generator] Layer sizes:",{tokens:`${(this.#e.tokens.length/1024).toFixed(2)} KB`,primitives:`${(this.#e.primitives.length/1024).toFixed(2)} KB`,components:`${(this.#e.components.length/1024).toFixed(2)} KB`,utilities:`${(this.#e.utilities.length/1024).toFixed(2)} KB`})}#be(){let{colors:e,spacing:t,radius:i,borderWidths:o,typography:a,shadows:s,layout:n,transitions:c,zIndex:l,icons:d}=this.tokens,p=[`@layer tokens {
2811
+ `}#i(e){let t=parseInt(e.slice(1,3),16)/255,a=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,i=Math.max(t,a,o),s=Math.min(t,a,o),n,c,l=(i+s)/2;if(i===s)n=c=0;else{let d=i-s;switch(c=l>.5?d/(2-i-s):d/(i+s),i){case t:n=(a-o)/d+(a<o?6:0);break;case a:n=(o-t)/d+2;break;case o:n=(t-a)/d+4;break}n/=6}return{h:n*360,s:c*100,l:l*100}}#t(e,t,a){e=e/360,t=t/100,a=a/100;let o=(l,d,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<1/6?l+(d-l)*6*p:p<1/2?d:p<2/3?l+(d-l)*(2/3-p)*6:l),i,s,n;if(t===0)i=s=n=a;else{let l=a<.5?a*(1+t):a+t-a*t,d=2*a-l;i=o(d,l,e+1/3),s=o(d,l,e),n=o(d,l,e-1/3)}let c=l=>{let d=Math.round(l*255).toString(16);return d.length===1?"0"+d:d};return`#${c(i)}${c(s)}${c(n)}`}getTokens(){return this.tokens}exportCSS(){return this.layeredCSS}#fe(){this.#e={tokens:this.#be(),primitives:this.#ye(),components:this.#ve(),utilities:this.#we()},this.options.debug&&this.options.log?.("debug","[Generator] Layer sizes:",{tokens:`${(this.#e.tokens.length/1024).toFixed(2)} KB`,primitives:`${(this.#e.primitives.length/1024).toFixed(2)} KB`,components:`${(this.#e.components.length/1024).toFixed(2)} KB`,utilities:`${(this.#e.utilities.length/1024).toFixed(2)} KB`})}#be(){let{colors:e,spacing:t,radius:a,borderWidths:o,typography:i,shadows:s,layout:n,transitions:c,zIndex:l,icons:d}=this.tokens,p=[`@layer tokens {
2812
2812
  :root {
2813
2813
  ${this.#I(e)}
2814
2814
  ${this.#N(t)}
2815
- ${this.#O(i)}
2815
+ ${this.#O(a)}
2816
2816
  ${this.#j(o)}
2817
- ${this.#H(a)}
2817
+ ${this.#H(i)}
2818
2818
  ${this.#U(s)}
2819
2819
  ${this.#W(n)}
2820
2820
  ${this.#q(c)}
@@ -2824,7 +2824,7 @@ nav[data-dropdown] {
2824
2824
  ${this.#K(e)}
2825
2825
  }`];return p.push(`
2826
2826
  /* Non-layered dark variables fallback (ensures attribute wins) */
2827
- `),p.push(this.#J(e)),p.join("")}#ye(){let{advanced:e={},a11y:t={},layout:i={}}=this.options.design,o=e.tabSize||u.TabSizes.standard,a=t.minTouchTarget||u.TouchTargetSizes.standard,s=i.breakpoints||{sm:640,md:768,lg:1024,xl:1280};return`@layer primitives {
2827
+ `),p.push(this.#J(e)),p.join("")}#ye(){let{advanced:e={},a11y:t={},layout:a={}}=this.options.design,o=e.tabSize||u.TabSizes.standard,i=t.minTouchTarget||u.TouchTargetSizes.standard,s=a.breakpoints||{sm:640,md:768,lg:1024,xl:1280};return`@layer primitives {
2828
2828
  /* Base HTML reset */
2829
2829
  *, *::before, *::after {
2830
2830
  box-sizing: border-box;
@@ -2883,7 +2883,7 @@ nav[data-dropdown] {
2883
2883
  gap: var(--spacing-2);
2884
2884
  font-weight: var(--font-weight-medium);
2885
2885
  line-height: 1.5;
2886
- min-height: ${a}px;
2886
+ min-height: ${i}px;
2887
2887
  touch-action: manipulation;
2888
2888
  user-select: none;
2889
2889
  }
@@ -3182,7 +3182,7 @@ ${this.#re()}
3182
3182
 
3183
3183
  ${this.#oe()}
3184
3184
 
3185
- ${this.#ae()}
3185
+ ${this.#ie()}
3186
3186
 
3187
3187
  ${this.#ne()}
3188
3188
 
@@ -3194,7 +3194,7 @@ ${this.#ue()}
3194
3194
 
3195
3195
  ${this.#le()}
3196
3196
 
3197
- ${this.#ie()}
3197
+ ${this.#ae()}
3198
3198
 
3199
3199
  /* Card component */
3200
3200
 
@@ -3376,20 +3376,20 @@ ${this.#me()}
3376
3376
  `}#xe(){this.#r={tokens:new CSSStyleSheet,primitives:new CSSStyleSheet,components:new CSSStyleSheet,utilities:new CSSStyleSheet},this.#ke()}#ke(){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}
3377
3377
  ${this.#e.primitives}
3378
3378
  ${this.#e.components}
3379
- ${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 Re<"u"?Re:null,enums:typeof u<"u"?u: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[i,o]of Object.entries(t))typeof o=="object"&&o!==null&&e.push({name:i,scale:o});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 i=this.options.design||{};return JSON.stringify(i).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.#c("tokens",this.#e.tokens),"pds-primitives.css.js":this.#c("primitives",this.#e.primitives),"pds-components.css.js":this.#c("components",this.#e.components),"pds-utilities.css.js":this.#c("utilities",this.#e.utilities),"pds-styles.css.js":this.#c("styles",this.layeredCSS)}}#c(e,t){let i=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$");return`// Pure Design System - ${e}
3379
+ ${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 Fe<"u"?Fe:null,enums:typeof u<"u"?u: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[a,o]of Object.entries(t))typeof o=="object"&&o!==null&&e.push({name:a,scale:o});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 a=this.options.design||{};return JSON.stringify(a).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.#c("tokens",this.#e.tokens),"pds-primitives.css.js":this.#c("primitives",this.#e.primitives),"pds-components.css.js":this.#c("components",this.#e.components),"pds-utilities.css.js":this.#c("utilities",this.#e.utilities),"pds-styles.css.js":this.#c("styles",this.layeredCSS)}}#c(e,t){let a=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$");return`// Pure Design System - ${e}
3380
3380
  // Auto-generated - do not edit directly
3381
3381
 
3382
3382
  export const ${e} = new CSSStyleSheet();
3383
- ${e}.replaceSync(\`${i}\`);
3383
+ ${e}.replaceSync(\`${a}\`);
3384
3384
 
3385
- export const ${e}CSS = \`${i}\`;
3386
- `}static applyStyles(e){let t=e||r.instance;if(!t||typeof t!="object"){console.error("[Generator] applyStyles requires a generator object or active singleton");return}let i=t.layeredCSS||t.css||"";if(!i){t.options?.log?.("warn","[Generator] No CSS available on designer to apply");return}r.installRuntimeStyles(i)}static installRuntimeStyles(e){try{if(typeof document>"u")return;if(typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype){let o=new CSSStyleSheet;o.replaceSync(e),o._pds=!0;let a=(document.adoptedStyleSheets||[]).filter(s=>s._pds!==!0);document.adoptedStyleSheets=[...a,o],r.__pdsRuntimeSheet=o;return}let t="pds-runtime-stylesheet",i=document.getElementById(t);if(!i){i=document.createElement("style"),i.id=t,i.type="text/css";let o=document.head||document.getElementsByTagName("head")[0];o?o.appendChild(i):document.documentElement.appendChild(i)}i.textContent=e}catch(t){console.warn("Generator.installRuntimeStyles failed:",t)}}};async function Kt(r,e=[]){try{let t=await PDS.registry.getStylesheet("primitives");if(r.adoptedStyleSheets=[t,...e],PDS.registry.isLive){let i=r.host?.tagName?.toLowerCase()||"unknown"}}catch(t){let i=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${i}> failed to adopt primitives:`,t),r.adoptedStyleSheets=e}}async function Qt(r,e=["primitives"],t=[]){try{let o=(await Promise.all(e.map(async a=>{if($.instance)switch(a){case"tokens":return $.instance.tokensStylesheet;case"primitives":return $.instance.primitivesStylesheet;case"components":return $.instance.componentsStylesheet;case"utilities":return $.instance.utilitiesStylesheet;default:break}return he.getStylesheet(a)}))).filter(a=>a!==null);if(r.adoptedStyleSheets=[...o,...t],PDS.registry.isLive){let a=r.host?.tagName?.toLowerCase()||"unknown"}}catch(i){let o=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${o}> failed to adopt layers:`,i),r.adoptedStyleSheets=t}}function Yt(r){let e=new CSSStyleSheet;return e.replaceSync(r),e}var C={"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:u.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:u.RadiusSizes.small,borderWidth:u.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:u.RadiusSizes.xlarge,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.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:u.RadiusSizes.none,borderWidth:u.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:u.RadiusSizes.xxlarge,borderWidth:u.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:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.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:u.RadiusSizes.medium,borderWidth:u.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:u.RadiusSizes.small,borderWidth:u.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:u.RadiusSizes.medium,borderWidth:u.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:u.RadiusSizes.small,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.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:u.LineHeights.relaxed},spatialRhythm:{baseUnit:6,scaleRatio:1.4},shape:{radiusSize:u.RadiusSizes.xxlarge,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.slow,animationEasing:u.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:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.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:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.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:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerPadding:1.25,sectionSpacing:2.5},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"medium",blurMedium:12},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.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:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1440,containerPadding:1.5,sectionSpacing:3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:8},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.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:u.RadiusSizes.small,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],focusRingWidth:3},a11y:{minTouchTarget:u.TouchTargetSizes.comfortable,focusStyle:u.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:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:6},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:3,focusRingOpacity:.4},a11y:{minTouchTarget:u.TouchTargetSizes.standard,focusStyle:u.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:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:680,sectionSpacing:1.5},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.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,backgroundMesh:2},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:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.2,containerMaxWidth:1600,containerPadding:1.5,sectionSpacing:2},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:4},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:2},layout:{densityCompact:.85,gridColumns:12}}};C.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:u.FontWeights.light,fontWeightNormal:u.FontWeights.normal,fontWeightMedium:u.FontWeights.medium,fontWeightSemibold:u.FontWeights.semibold,fontWeightBold:u.FontWeights.bold,lineHeightTight:u.LineHeights.tight,lineHeightNormal:u.LineHeights.normal,lineHeightRelaxed:u.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:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium,customRadius:null},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.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:u.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:u.LinkStyles.inline,colorDerivation:"hsl"},a11y:{minTouchTarget:u.TouchTargetSizes.standard,prefersReducedMotion:!0,focusStyle:u.FocusStyles.ring},icons:{set:"phosphor",weight:"regular",defaultSize:24,sizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},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};function Ie(r="log",e,...t){if(this?.debug||this?.design?.debug||!1||r==="error"||r==="warn"){let o=console[r]||console.log;t.length>0?o(e,...t):o(e)}}var Be={mode:"live",preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(r,e,...t){console[r](e,...t)}};async function Zt(r,e={}){return e={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...e},new Promise(i=>{let o=document.createElement("dialog");Be.options?.liquidGlassEffects&&o.classList.add("liquid-glass"),e.size&&o.classList.add(`dialog-${e.size}`),e.type&&o.classList.add(`dialog-${e.type}`),e.class&&(Array.isArray(e.class)?o.classList.add(...e.class):o.classList.add(e.class));let a=Object.entries(e.buttons).map(([n,c])=>{let l=c.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${c.cancel?"button":"submit"}" class="${l}" value="${n}">${c.name}</button>`});if(e.useForm){o.innerHTML=`
3385
+ export const ${e}CSS = \`${a}\`;
3386
+ `}static applyStyles(e){let t=e||r.instance;if(!t||typeof t!="object"){console.error("[Generator] applyStyles requires a generator object or active singleton");return}let a=t.layeredCSS||t.css||"";if(!a){t.options?.log?.("warn","[Generator] No CSS available on designer to apply");return}r.installRuntimeStyles(a)}static installRuntimeStyles(e){try{if(typeof document>"u")return;if(typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype){let o=new CSSStyleSheet;o.replaceSync(e),o._pds=!0;let i=(document.adoptedStyleSheets||[]).filter(s=>s._pds!==!0);document.adoptedStyleSheets=[...i,o],r.__pdsRuntimeSheet=o;return}let t="pds-runtime-stylesheet",a=document.getElementById(t);if(!a){a=document.createElement("style"),a.id=t,a.type="text/css";let o=document.head||document.getElementsByTagName("head")[0];o?o.appendChild(a):document.documentElement.appendChild(a)}a.textContent=e}catch(t){console.warn("Generator.installRuntimeStyles failed:",t)}}};async function Kt(r,e=[]){try{let t=await PDS.registry.getStylesheet("primitives");if(r.adoptedStyleSheets=[t,...e],PDS.registry.isLive){let a=r.host?.tagName?.toLowerCase()||"unknown"}}catch(t){let a=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${a}> failed to adopt primitives:`,t),r.adoptedStyleSheets=e}}async function Qt(r,e=["primitives"],t=[]){try{let o=(await Promise.all(e.map(async i=>{if($.instance)switch(i){case"tokens":return $.instance.tokensStylesheet;case"primitives":return $.instance.primitivesStylesheet;case"components":return $.instance.componentsStylesheet;case"utilities":return $.instance.utilitiesStylesheet;default:break}return he.getStylesheet(i)}))).filter(i=>i!==null);if(r.adoptedStyleSheets=[...o,...t],PDS.registry.isLive){let i=r.host?.tagName?.toLowerCase()||"unknown"}}catch(a){let o=r.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${o}> failed to adopt layers:`,a),r.adoptedStyleSheets=t}}function Yt(r){let e=new CSSStyleSheet;return e.replaceSync(r),e}var C={"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:u.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:u.RadiusSizes.small,borderWidth:u.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:u.RadiusSizes.xlarge,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.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:u.RadiusSizes.none,borderWidth:u.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:u.RadiusSizes.xxlarge,borderWidth:u.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:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.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:u.RadiusSizes.medium,borderWidth:u.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:u.RadiusSizes.small,borderWidth:u.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:u.RadiusSizes.medium,borderWidth:u.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:u.RadiusSizes.small,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.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:u.LineHeights.relaxed},spatialRhythm:{baseUnit:6,scaleRatio:1.4},shape:{radiusSize:u.RadiusSizes.xxlarge,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.slow,animationEasing:u.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:u.RadiusSizes.none,borderWidth:u.BorderWidths.thick},behavior:{transitionSpeed:u.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:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.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:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerPadding:1.25,sectionSpacing:2.5},shape:{radiusSize:u.RadiusSizes.large,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"medium",blurMedium:12},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.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:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1440,containerPadding:1.5,sectionSpacing:3},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:8},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.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:u.RadiusSizes.small,borderWidth:u.BorderWidths.medium},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-out"],focusRingWidth:3},a11y:{minTouchTarget:u.TouchTargetSizes.comfortable,focusStyle:u.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:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:6},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:3,focusRingOpacity:.4},a11y:{minTouchTarget:u.TouchTargetSizes.standard,focusStyle:u.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:u.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:680,sectionSpacing:1.5},shape:{radiusSize:u.RadiusSizes.medium,borderWidth:u.BorderWidths.thin},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.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,backgroundMesh:2},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:u.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.2,containerMaxWidth:1600,containerPadding:1.5,sectionSpacing:2},shape:{radiusSize:u.RadiusSizes.small,borderWidth:u.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:4},behavior:{transitionSpeed:u.TransitionSpeeds.fast,animationEasing:u.AnimationEasings["ease-in-out"],focusRingWidth:2},layout:{densityCompact:.85,gridColumns:12}}};C.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:u.FontWeights.light,fontWeightNormal:u.FontWeights.normal,fontWeightMedium:u.FontWeights.medium,fontWeightSemibold:u.FontWeights.semibold,fontWeightBold:u.FontWeights.bold,lineHeightTight:u.LineHeights.tight,lineHeightNormal:u.LineHeights.normal,lineHeightRelaxed:u.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:u.RadiusSizes.large,borderWidth:u.BorderWidths.medium,customRadius:null},behavior:{transitionSpeed:u.TransitionSpeeds.normal,animationEasing:u.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:u.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:u.LinkStyles.inline,colorDerivation:"hsl"},a11y:{minTouchTarget:u.TouchTargetSizes.standard,prefersReducedMotion:!0,focusStyle:u.FocusStyles.ring},icons:{set:"phosphor",weight:"regular",defaultSize:24,sizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},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};function Ie(r="log",e,...t){if(this?.debug||this?.design?.debug||!1||r==="error"||r==="warn"){let o=console[r]||console.log;t.length>0?o(e,...t):o(e)}}var Be={mode:"live",preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(r,e,...t){console[r](e,...t)}};async function Zt(r,e={}){return e={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...e},new Promise(a=>{let o=document.createElement("dialog");Be.options?.liquidGlassEffects&&o.classList.add("liquid-glass"),e.size&&o.classList.add(`dialog-${e.size}`),e.type&&o.classList.add(`dialog-${e.type}`),e.class&&(Array.isArray(e.class)?o.classList.add(...e.class):o.classList.add(e.class));let i=Object.entries(e.buttons).map(([n,c])=>{let l=c.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${c.cancel?"button":"submit"}" class="${l}" value="${n}">${c.name}</button>`});if(e.useForm){o.innerHTML=`
3387
3387
  <header>
3388
3388
  <h2>${e.title}</h2>
3389
3389
  </header>
3390
3390
 
3391
3391
  <article id="msg-container"></article>
3392
- `;let n=o.querySelector("#msg-container");typeof r=="object"&&r._$litType$?j(r,n):typeof r=="string"?n.textContent=r:j(r,n),requestAnimationFrame(()=>{let c=o.querySelector("form");if(c){let l=document.createElement("footer");l.innerHTML=a.join(""),c.appendChild(l)}})}else{o.innerHTML=`
3392
+ `;let n=o.querySelector("#msg-container");typeof r=="object"&&r._$litType$?j(r,n):typeof r=="string"?n.textContent=r:j(r,n),requestAnimationFrame(()=>{let c=o.querySelector("form");if(c){let l=document.createElement("footer");l.innerHTML=i.join(""),c.appendChild(l)}})}else{o.innerHTML=`
3393
3393
  <form method="dialog">
3394
3394
  <header>
3395
3395
  <h2>${e.title}</h2>
@@ -3398,28 +3398,28 @@ export const ${e}CSS = \`${i}\`;
3398
3398
  <article id="msg-container"></article>
3399
3399
 
3400
3400
  <footer>
3401
- ${a.join("")}
3401
+ ${i.join("")}
3402
3402
  </footer>
3403
3403
  </form>
3404
- `;let n=o.querySelector("#msg-container");typeof r=="object"&&r._$litType$?j(r,n):typeof r=="string"?n.textContent=r:j(r,n)}o.addEventListener("click",n=>{n.target.closest('button[value="cancel"]')&&(o.close(),i(!1))});let s=()=>{let n=o.querySelector("form");n?n.addEventListener("submit",c=>{c.preventDefault();let l;e.useForm&&c.submitter.value==="ok"?(console.log("Found form:",n),console.log("Form elements:",n?Array.from(n.elements):"no form"),l=new FormData(n),console.log("FormData entries:",Array.from(l.entries()))):l=c.submitter.value==="ok",o.close(),i(l)}):requestAnimationFrame(s)};s(),o.addEventListener("close",()=>{setTimeout(()=>o.remove(),200)}),document.body.appendChild(o),typeof e.rendered=="function"&&e.rendered(o),o.showModal()})}var Ne=class{constructor(e){this.pds=e,this.intents={color:["color","colours","shade","tint","hue","foreground","background","text","fill","bg","fg"],spacing:["spacing","space","gap","padding","margin","distance","rhythm"],typography:["font","text","type","typography","heading","body","size","weight","family"],border:["border","outline","stroke","edge","frame"],radius:["radius","rounded","corner","curve","round"],shadow:["shadow","elevation","depth","glow","drop-shadow"],component:["component","element","widget"],utility:["utility","class","helper","css"],layout:["layout","container","grid","flex","group","arrange","organize"],pattern:["pattern","example","template","structure"],interaction:["hover","focus","active","disabled","pressed","selected","checked"]},this.entities={button:["button","btn","cta"],input:["input","field","textbox","text-field","form-control"],card:["card","panel"],badge:["badge","pill","tag","chip"],surface:["surface","background","layer","container"],icon:["icon","svg","glyph","symbol"],link:["link","anchor","hyperlink"],nav:["nav","navigation","menu"],modal:["modal","dialog","popup","overlay"],drawer:["drawer","sidebar","panel"],tab:["tab","tabstrip"],toast:["toast","notification","alert","message"]},this.questionWords=["what","which","how","where","when","show","find","get","give","tell"]}async search(e){if(!e||e.length<2)return[];let t=e.toLowerCase().trim(),i=this.tokenize(t),o=this.analyzeQuery(i,t),a=[];o.intents.has("color")&&a.push(...this.queryColors(o,t)),(o.intents.has("utility")||o.intents.has("border")||o.intents.has("layout")||t.includes("class"))&&a.push(...this.queryUtilities(o,t)),(o.intents.has("component")||o.entities.size>0)&&a.push(...this.queryComponents(o,t)),(o.intents.has("layout")||o.intents.has("pattern"))&&a.push(...this.queryPatterns(o,t)),o.intents.has("typography")&&a.push(...this.queryTypography(o,t)),o.intents.has("spacing")&&a.push(...this.querySpacing(o,t));let s=new Map;for(let n of a){let c=n.value;(!s.has(c)||s.get(c).score<n.score)&&s.set(c,n)}return Array.from(s.values()).sort((n,c)=>c.score-n.score).slice(0,10)}tokenize(e){return e.toLowerCase().replace(/[?!.]/g,"").split(/\s+/).filter(t=>t.length>0)}analyzeQuery(e,t){let i={intents:new Set,entities:new Set,modifiers:new Set,isQuestion:!1,tokens:e,fullText:t};i.isQuestion=this.questionWords.some(o=>e.includes(o));for(let[o,a]of Object.entries(this.intents))a.some(s=>e.includes(s)||t.includes(s))&&i.intents.add(o);for(let[o,a]of Object.entries(this.entities))a.some(s=>e.includes(s)||t.includes(s))&&i.entities.add(o);return(e.includes("hover")||t.includes("hover"))&&i.modifiers.add("hover"),(e.includes("focus")||t.includes("focus"))&&i.modifiers.add("focus"),(e.includes("active")||t.includes("active"))&&i.modifiers.add("active"),(e.includes("disabled")||t.includes("disabled"))&&i.modifiers.add("disabled"),i}queryColors(e,t){let i=[],o=this.pds.compiled;if(!o?.tokens?.colors)return i;let a=o.tokens.colors,s=Array.from(e.entities),n=Array.from(e.modifiers);if(n.includes("focus")&&e.intents.has("border")&&s.includes("input")&&i.push({text:"Focus border color: var(--color-primary-500)",value:"--color-primary-500",icon:"palette",category:"Color Token",score:100,cssVar:"var(--color-primary-500)",description:"Primary color used for focus states on form inputs"}),(t.includes("foreground")||t.includes("text"))&&(t.includes("surface")||e.entities.has("surface"))&&(i.push({text:"Text on surface: var(--surface-text)",value:"--surface-text",icon:"palette",category:"Surface Token",score:95,cssVar:"var(--surface-text)",description:"Default text color for current surface"}),i.push({text:"Secondary text: var(--surface-text-secondary)",value:"--surface-text-secondary",icon:"palette",category:"Surface Token",score:90,cssVar:"var(--surface-text-secondary)",description:"Secondary/muted text on surface"})),t.includes("primary")||t.includes("accent")||t.includes("secondary")){let c=t.includes("primary")?"primary":t.includes("accent")?"accent":"secondary";for(let l of[500,600,700]){let d=`--color-${c}-${l}`;i.push({text:`${c.charAt(0).toUpperCase()+c.slice(1)} ${l}: var(${d})`,value:d,icon:"palette",category:"Color Scale",score:80-(l-500)/100,cssVar:`var(${d})`,description:`${c} color scale shade ${l}`})}}if(s.includes("button")&&e.intents.has("color")){let c=n[0];c?i.push({text:`Button ${c} fill: var(--primary-fill-${c})`,value:`--primary-fill-${c}`,icon:"palette",category:"Interactive Token",score:92,description:`Button background color in ${c} state`}):i.push({text:"Button fill: var(--primary-fill)",value:"--primary-fill",icon:"palette",category:"Interactive Token",score:88,description:"Default button background color"})}return i}queryUtilities(e,t){let i=[],o=this.pds.ontology;if(!o?.utilities)return i;let a=o.utilities,s=[];for(let n of Object.values(a))if(typeof n=="object")for(let c of Object.values(n))Array.isArray(c)&&s.push(...c);return e.intents.has("border")&&s.filter(c=>c.includes("border")||c.includes("outline")).forEach(c=>{let l=80;t.includes("gradient")&&c.includes("gradient")&&(l=95),t.includes("glow")&&c.includes("glow")&&(l=95),i.push({text:`${c} - Border utility class`,value:c,icon:"code",category:"Utility Class",score:l,code:`<div class="${c}">...</div>`,description:this.describeUtility(c)})}),e.intents.has("layout")&&s.filter(c=>c.includes("flex")||c.includes("grid")||c.includes("items-")||c.includes("justify-")||c.includes("gap-")).forEach(c=>{i.push({text:`${c} - Layout utility`,value:c,icon:"layout",category:"Utility Class",score:85,code:`<div class="${c}">...</div>`,description:this.describeUtility(c)})}),t.includes("group")&&e.entities.has("button")&&i.push({text:".btn-group - Group buttons together",value:".btn-group",icon:"code",category:"Utility Class",score:90,code:`<div class="btn-group">
3404
+ `;let n=o.querySelector("#msg-container");typeof r=="object"&&r._$litType$?j(r,n):typeof r=="string"?n.textContent=r:j(r,n)}o.addEventListener("click",n=>{n.target.closest('button[value="cancel"]')&&(o.close(),a(!1))});let s=()=>{let n=o.querySelector("form");n?n.addEventListener("submit",c=>{c.preventDefault();let l;e.useForm&&c.submitter.value==="ok"?(console.log("Found form:",n),console.log("Form elements:",n?Array.from(n.elements):"no form"),l=new FormData(n),console.log("FormData entries:",Array.from(l.entries()))):l=c.submitter.value==="ok",o.close(),a(l)}):requestAnimationFrame(s)};s(),o.addEventListener("close",()=>{setTimeout(()=>o.remove(),200)}),document.body.appendChild(o),typeof e.rendered=="function"&&e.rendered(o),o.showModal()})}var Ne=class{constructor(e){this.pds=e,this.intents={color:["color","colours","shade","tint","hue","foreground","background","text","fill","bg","fg"],spacing:["spacing","space","gap","padding","margin","distance","rhythm"],typography:["font","text","type","typography","heading","body","size","weight","family"],border:["border","outline","stroke","edge","frame"],radius:["radius","rounded","corner","curve","round"],shadow:["shadow","elevation","depth","glow","drop-shadow"],component:["component","element","widget"],utility:["utility","class","helper","css"],layout:["layout","container","grid","flex","group","arrange","organize"],pattern:["pattern","example","template","structure"],interaction:["hover","focus","active","disabled","pressed","selected","checked"]},this.entities={button:["button","btn","cta"],input:["input","field","textbox","text-field","form-control"],card:["card","panel"],badge:["badge","pill","tag","chip"],surface:["surface","background","layer","container"],icon:["icon","svg","glyph","symbol"],link:["link","anchor","hyperlink"],nav:["nav","navigation","menu"],modal:["modal","dialog","popup","overlay"],drawer:["drawer","sidebar","panel"],tab:["tab","tabstrip"],toast:["toast","notification","alert","message"]},this.questionWords=["what","which","how","where","when","show","find","get","give","tell"]}async search(e){if(!e||e.length<2)return[];let t=e.toLowerCase().trim(),a=this.tokenize(t),o=this.analyzeQuery(a,t),i=[];o.intents.has("color")&&i.push(...this.queryColors(o,t)),(o.intents.has("utility")||o.intents.has("border")||o.intents.has("layout")||t.includes("class"))&&i.push(...this.queryUtilities(o,t)),(o.intents.has("component")||o.entities.size>0)&&i.push(...this.queryComponents(o,t)),(o.intents.has("layout")||o.intents.has("pattern"))&&i.push(...this.queryPatterns(o,t)),o.intents.has("typography")&&i.push(...this.queryTypography(o,t)),o.intents.has("spacing")&&i.push(...this.querySpacing(o,t));let s=new Map;for(let n of i){let c=n.value;(!s.has(c)||s.get(c).score<n.score)&&s.set(c,n)}return Array.from(s.values()).sort((n,c)=>c.score-n.score).slice(0,10)}tokenize(e){return e.toLowerCase().replace(/[?!.]/g,"").split(/\s+/).filter(t=>t.length>0)}analyzeQuery(e,t){let a={intents:new Set,entities:new Set,modifiers:new Set,isQuestion:!1,tokens:e,fullText:t};a.isQuestion=this.questionWords.some(o=>e.includes(o));for(let[o,i]of Object.entries(this.intents))i.some(s=>e.includes(s)||t.includes(s))&&a.intents.add(o);for(let[o,i]of Object.entries(this.entities))i.some(s=>e.includes(s)||t.includes(s))&&a.entities.add(o);return(e.includes("hover")||t.includes("hover"))&&a.modifiers.add("hover"),(e.includes("focus")||t.includes("focus"))&&a.modifiers.add("focus"),(e.includes("active")||t.includes("active"))&&a.modifiers.add("active"),(e.includes("disabled")||t.includes("disabled"))&&a.modifiers.add("disabled"),a}queryColors(e,t){let a=[],o=this.pds.compiled;if(!o?.tokens?.colors)return a;let i=o.tokens.colors,s=Array.from(e.entities),n=Array.from(e.modifiers);if(n.includes("focus")&&e.intents.has("border")&&s.includes("input")&&a.push({text:"Focus border color: var(--color-primary-500)",value:"--color-primary-500",icon:"palette",category:"Color Token",score:100,cssVar:"var(--color-primary-500)",description:"Primary color used for focus states on form inputs"}),(t.includes("foreground")||t.includes("text"))&&(t.includes("surface")||e.entities.has("surface"))&&(a.push({text:"Text on surface: var(--surface-text)",value:"--surface-text",icon:"palette",category:"Surface Token",score:95,cssVar:"var(--surface-text)",description:"Default text color for current surface"}),a.push({text:"Secondary text: var(--surface-text-secondary)",value:"--surface-text-secondary",icon:"palette",category:"Surface Token",score:90,cssVar:"var(--surface-text-secondary)",description:"Secondary/muted text on surface"})),t.includes("primary")||t.includes("accent")||t.includes("secondary")){let c=t.includes("primary")?"primary":t.includes("accent")?"accent":"secondary";for(let l of[500,600,700]){let d=`--color-${c}-${l}`;a.push({text:`${c.charAt(0).toUpperCase()+c.slice(1)} ${l}: var(${d})`,value:d,icon:"palette",category:"Color Scale",score:80-(l-500)/100,cssVar:`var(${d})`,description:`${c} color scale shade ${l}`})}}if(s.includes("button")&&e.intents.has("color")){let c=n[0];c?a.push({text:`Button ${c} fill: var(--primary-fill-${c})`,value:`--primary-fill-${c}`,icon:"palette",category:"Interactive Token",score:92,description:`Button background color in ${c} state`}):a.push({text:"Button fill: var(--primary-fill)",value:"--primary-fill",icon:"palette",category:"Interactive Token",score:88,description:"Default button background color"})}return a}queryUtilities(e,t){let a=[],o=this.pds.ontology;if(!o?.utilities)return a;let i=o.utilities,s=[];for(let n of Object.values(i))if(typeof n=="object")for(let c of Object.values(n))Array.isArray(c)&&s.push(...c);return e.intents.has("border")&&s.filter(c=>c.includes("border")||c.includes("outline")).forEach(c=>{let l=80;t.includes("gradient")&&c.includes("gradient")&&(l=95),t.includes("glow")&&c.includes("glow")&&(l=95),a.push({text:`${c} - Border utility class`,value:c,icon:"code",category:"Utility Class",score:l,code:`<div class="${c}">...</div>`,description:this.describeUtility(c)})}),e.intents.has("layout")&&s.filter(c=>c.includes("flex")||c.includes("grid")||c.includes("items-")||c.includes("justify-")||c.includes("gap-")).forEach(c=>{a.push({text:`${c} - Layout utility`,value:c,icon:"layout",category:"Utility Class",score:85,code:`<div class="${c}">...</div>`,description:this.describeUtility(c)})}),t.includes("group")&&e.entities.has("button")&&a.push({text:".btn-group - Group buttons together",value:".btn-group",icon:"code",category:"Utility Class",score:90,code:`<div class="btn-group">
3405
3405
  <button class="btn-primary">One</button>
3406
3406
  <button class="btn-primary">Two</button>
3407
- </div>`,description:"Container for grouped buttons with connected styling"}),i}queryComponents(e,t){let i=[],o=this.pds.ontology;return!o?.components&&!o?.primitives||(o.components&&o.components.forEach(a=>{let s=this.scoreMatch(t,a.name+" "+a.id);s>50&&i.push({text:`<${a.id}> - ${a.name}`,value:a.id,icon:"brackets-curly",category:"Web Component",score:s,code:`<${a.id}></${a.id}>`,description:a.description||`${a.name} web component`})}),o.primitives&&o.primitives.forEach(a=>{let s=this.scoreMatch(t,a.name+" "+a.id);if(s>50){let n=a.selectors?.[0]||a.id;i.push({text:`${n} - ${a.name}`,value:a.id,icon:"tag",category:"Primitive",score:s-5,code:this.generatePrimitiveExample(a),description:a.description||`${a.name} primitive element`})}}),t.includes("icon")&&(t.includes("only")||t.includes("button"))&&i.push({text:'Icon-only button: <button class="btn-icon">',value:"btn-icon",icon:"star",category:"Pattern",score:95,code:`<button class="btn-icon btn-primary">
3407
+ </div>`,description:"Container for grouped buttons with connected styling"}),a}queryComponents(e,t){let a=[],o=this.pds.ontology;return!o?.components&&!o?.primitives||(o.components&&o.components.forEach(i=>{let s=this.scoreMatch(t,i.name+" "+i.id);s>50&&a.push({text:`<${i.id}> - ${i.name}`,value:i.id,icon:"brackets-curly",category:"Web Component",score:s,code:`<${i.id}></${i.id}>`,description:i.description||`${i.name} web component`})}),o.primitives&&o.primitives.forEach(i=>{let s=this.scoreMatch(t,i.name+" "+i.id);if(s>50){let n=i.selectors?.[0]||i.id;a.push({text:`${n} - ${i.name}`,value:i.id,icon:"tag",category:"Primitive",score:s-5,code:this.generatePrimitiveExample(i),description:i.description||`${i.name} primitive element`})}}),t.includes("icon")&&(t.includes("only")||t.includes("button"))&&a.push({text:'Icon-only button: <button class="btn-icon">',value:"btn-icon",icon:"star",category:"Pattern",score:95,code:`<button class="btn-icon btn-primary">
3408
3408
  <pds-icon icon="heart"></pds-icon>
3409
- </button>`,description:"Button with only an icon, no text label"})),i}queryPatterns(e,t){let i=[],o=this.pds.ontology;return o?.layoutPatterns&&(o.layoutPatterns.forEach(a=>{let s=this.scoreMatch(t,a.name+" "+a.id+" "+(a.description||""));if(s>50){let n=a.selectors?.[0]||`.${a.id}`;i.push({text:`${a.name} - ${a.description||"Layout pattern"}`,value:a.id,icon:"layout",category:"Layout Pattern",score:s,code:`<div class="${n.replace(".","")}">
3409
+ </button>`,description:"Button with only an icon, no text label"})),a}queryPatterns(e,t){let a=[],o=this.pds.ontology;return o?.layoutPatterns&&(o.layoutPatterns.forEach(i=>{let s=this.scoreMatch(t,i.name+" "+i.id+" "+(i.description||""));if(s>50){let n=i.selectors?.[0]||`.${i.id}`;a.push({text:`${i.name} - ${i.description||"Layout pattern"}`,value:i.id,icon:"layout",category:"Layout Pattern",score:s,code:`<div class="${n.replace(".","")}">
3410
3410
  <!-- content -->
3411
- </div>`,description:a.description||a.name})}}),(t.includes("container")||t.includes("group"))&&(i.push({text:"Card - Container for grouping content",value:"card",icon:"layout",category:"Primitive",score:88,code:`<article class="card">
3411
+ </div>`,description:i.description||i.name})}}),(t.includes("container")||t.includes("group"))&&(a.push({text:"Card - Container for grouping content",value:"card",icon:"layout",category:"Primitive",score:88,code:`<article class="card">
3412
3412
  <header>
3413
3413
  <h3>Title</h3>
3414
3414
  </header>
3415
3415
  <p>Content...</p>
3416
- </article>`,description:"Card container with optional header, body, and footer"}),i.push({text:"Section - Semantic container for grouping",value:"section",icon:"layout",category:"Pattern",score:85,code:`<section>
3416
+ </article>`,description:"Card container with optional header, body, and footer"}),a.push({text:"Section - Semantic container for grouping",value:"section",icon:"layout",category:"Pattern",score:85,code:`<section>
3417
3417
  <h2>Section Title</h2>
3418
3418
  <!-- content -->
3419
- </section>`,description:"Semantic section element for content grouping"}))),i}queryTypography(e,t){let i=[],o=this.pds.compiled;if(!o?.tokens?.typography)return i;let a=o.tokens.typography;return(t.includes("heading")||t.includes("title"))&&i.push({text:"Heading font: var(--font-family-heading)",value:"--font-family-heading",icon:"text-aa",category:"Typography Token",score:85,cssVar:"var(--font-family-heading)",description:"Font family for headings"}),(t.includes("body")||t.includes("text"))&&i.push({text:"Body font: var(--font-family-body)",value:"--font-family-body",icon:"text-aa",category:"Typography Token",score:85,cssVar:"var(--font-family-body)",description:"Font family for body text"}),i}querySpacing(e,t){let i=[],o=this.pds.compiled;if(!o?.tokens?.spacing)return i;let a=o.tokens.spacing;for(let[s,n]of Object.entries(a))["2","4","6","8"].includes(s)&&i.push({text:`Spacing ${s}: var(--spacing-${s})`,value:`--spacing-${s}`,icon:"ruler",category:"Spacing Token",score:75,cssVar:`var(--spacing-${s})`,description:`Spacing value: ${n}`});return i}scoreMatch(e,t){let i=e.toLowerCase(),o=t.toLowerCase(),a=0;if(i===o)return 100;o.includes(i)&&(a+=80);let s=this.tokenize(i),n=this.tokenize(o),c=s.filter(l=>n.includes(l)).length;return a+=c/s.length*40,o.startsWith(i)&&(a+=20),Math.min(100,a)}generatePrimitiveExample(e){let t=e.selectors?.[0]||e.id;return t.includes("button")||e.id==="button"?'<button class="btn-primary">Click me</button>':t.includes("card")||e.id==="card"?`<article class="card">
3419
+ </section>`,description:"Semantic section element for content grouping"}))),a}queryTypography(e,t){let a=[],o=this.pds.compiled;if(!o?.tokens?.typography)return a;let i=o.tokens.typography;return(t.includes("heading")||t.includes("title"))&&a.push({text:"Heading font: var(--font-family-heading)",value:"--font-family-heading",icon:"text-aa",category:"Typography Token",score:85,cssVar:"var(--font-family-heading)",description:"Font family for headings"}),(t.includes("body")||t.includes("text"))&&a.push({text:"Body font: var(--font-family-body)",value:"--font-family-body",icon:"text-aa",category:"Typography Token",score:85,cssVar:"var(--font-family-body)",description:"Font family for body text"}),a}querySpacing(e,t){let a=[],o=this.pds.compiled;if(!o?.tokens?.spacing)return a;let i=o.tokens.spacing;for(let[s,n]of Object.entries(i))["2","4","6","8"].includes(s)&&a.push({text:`Spacing ${s}: var(--spacing-${s})`,value:`--spacing-${s}`,icon:"ruler",category:"Spacing Token",score:75,cssVar:`var(--spacing-${s})`,description:`Spacing value: ${n}`});return a}scoreMatch(e,t){let a=e.toLowerCase(),o=t.toLowerCase(),i=0;if(a===o)return 100;o.includes(a)&&(i+=80);let s=this.tokenize(a),n=this.tokenize(o),c=s.filter(l=>n.includes(l)).length;return i+=c/s.length*40,o.startsWith(a)&&(i+=20),Math.min(100,i)}generatePrimitiveExample(e){let t=e.selectors?.[0]||e.id;return t.includes("button")||e.id==="button"?'<button class="btn-primary">Click me</button>':t.includes("card")||e.id==="card"?`<article class="card">
3420
3420
  <h3>Title</h3>
3421
3421
  <p>Content</p>
3422
- </article>`:t.includes("badge")||e.id==="badge"?'<span class="badge">New</span>':`<${t}>Content</${t}>`}describeUtility(e){return e.includes("border-gradient")?"Apply animated gradient border effect":e.includes("border-glow")?"Apply glowing border effect":e.includes("flex")?"Flexbox container utility":e.includes("grid")?"Grid container utility":e.includes("gap-")?"Set gap between flex/grid children":e.includes("items-")?"Align items in flex container":e.includes("justify-")?"Justify content in flex container":e===".btn-group"?"Group buttons with connected styling":"Utility class for styling"}};var ct={};bt(ct,{deepMerge:()=>Z,isObject:()=>Oe});function Oe(r){return r&&typeof r=="object"&&!Array.isArray(r)}function Z(r,e){let t={...r};return Oe(r)&&Oe(e)&&Object.keys(e).forEach(i=>{Oe(e[i])?i in r?t[i]=Z(r[i],e[i]):Object.assign(t,{[i]:e[i]}):Object.assign(t,{[i]:e[i]})}),t}var Xt=[{selector:"nav[data-dropdown]",description:"Enhances a nav element with data-dropdown to function as a dropdown menu.",demoHtml:`
3422
+ </article>`:t.includes("badge")||e.id==="badge"?'<span class="badge">New</span>':`<${t}>Content</${t}>`}describeUtility(e){return e.includes("border-gradient")?"Apply animated gradient border effect":e.includes("border-glow")?"Apply glowing border effect":e.includes("flex")?"Flexbox container utility":e.includes("grid")?"Grid container utility":e.includes("gap-")?"Set gap between flex/grid children":e.includes("items-")?"Align items in flex container":e.includes("justify-")?"Justify content in flex container":e===".btn-group"?"Group buttons with connected styling":"Utility class for styling"}};var ct={};bt(ct,{deepMerge:()=>Z,isObject:()=>Oe});function Oe(r){return r&&typeof r=="object"&&!Array.isArray(r)}function Z(r,e){let t={...r};return Oe(r)&&Oe(e)&&Object.keys(e).forEach(a=>{Oe(e[a])?a in r?t[a]=Z(r[a],e[a]):Object.assign(t,{[a]:e[a]}):Object.assign(t,{[a]:e[a]})}),t}var Xt=[{selector:"nav[data-dropdown]",description:"Enhances a nav element with data-dropdown to function as a dropdown menu.",demoHtml:`
3423
3423
  <nav data-dropdown>
3424
3424
  <button class="btn-primary">Menu</button>
3425
3425
  <menu>
@@ -3458,30 +3458,30 @@ export const ${e}CSS = \`${i}\`;
3458
3458
  <button class="btn-primary btn-working">
3459
3459
  <span>Saving</span>
3460
3460
  </button>
3461
- `.trim()}];function Gr(r){if(r.dataset.enhancedDropdown)return;r.dataset.enhancedDropdown="true";let e=r.querySelector("menu");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.setAttribute("role",e.getAttribute("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 i=()=>{let n=(r.getAttribute("data-mode")||"auto").toLowerCase();if(n==="up"||n==="down")return n;let c=r.getBoundingClientRect(),l=Math.max(0,window.innerHeight-c.bottom);return Math.max(0,c.top)>l?"up":"down"},o=()=>{r.dataset.dropdownDirection=i(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},a=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},s=()=>{e.getAttribute("aria-hidden")==="false"?a():o()};t?.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),s()}),document.addEventListener("click",n=>{r.contains(n.target)||a()}),r.addEventListener("keydown",n=>{n.key==="Escape"&&(a(),t?.focus())}),r.addEventListener("focusout",n=>{(!n.relatedTarget||!r.contains(n.relatedTarget))&&a()})}function Vr(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 i=document.createElement("span");i.className="toggle-knob",t.appendChild(i),r.insertBefore(t,e.nextSibling);let o=()=>{r.setAttribute("aria-checked",e.checked?"true":"false")},a=()=>{e.disabled||(e.checked=!e.checked,o(),e.dispatchEvent(new Event("change",{bubbles:!0})))};r.addEventListener("click",s=>{s.preventDefault(),a()}),r.addEventListener("keydown",s=>{(s.key===" "||s.key==="Enter")&&(s.preventDefault(),a())}),e.addEventListener("change",o)}function Jr(r){if(r.dataset.enhancedRange)return;let e=r.closest("label"),t=e?.classList.contains("range-output"),i=r.id||`range-${Math.random().toString(36).substring(2,11)}`,o=`${i}-output`;if(r.id=i,t){let a=e.querySelector("span");if(a&&!a.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=a.textContent,s.appendChild(n);let c=document.createElement("output");c.id=o,c.setAttribute("for",i),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=r.value,s.appendChild(c),a.textContent="",a.appendChild(s);let l=()=>{c.textContent=r.value};r.addEventListener("input",l)}}else{let a=r.closest(".range-container");a||(a=document.createElement("div"),a.className="range-container",r.parentNode?.insertBefore(a,r),a.appendChild(r)),a.style.position="relative";let s=document.createElement("output");s.id=o,s.setAttribute("for",i),s.className="range-bubble",s.setAttribute("aria-live","polite"),a.appendChild(s);let n=()=>{let d=parseFloat(r.min)||0,p=parseFloat(r.max)||100,h=parseFloat(r.value),g=(h-d)/(p-d);s.style.left=`calc(${g*100}% )`,s.textContent=String(h)},c=()=>s.classList.add("visible"),l=()=>s.classList.remove("visible");r.addEventListener("input",n),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerleave",l),r.addEventListener("focus",c),r.addEventListener("blur",l),n()}r.dataset.enhancedRange="1"}function Kr(r){if(r.dataset.enhancedRequired)return;r.dataset.enhancedRequired="true";let e=t=>{let i=t.closest("label");if(!i||i.querySelector(".required-asterisk"))return;let o=document.createElement("span");o.classList.add("required-asterisk"),o.textContent="*",o.style.marginLeft="4px",i.querySelector("span").appendChild(o);let a=t.closest("form");if(a&&!a.querySelector(".required-legend")){let s=document.createElement("small");s.classList.add("required-legend"),s.textContent="* Required fields",a.insertBefore(s,a.querySelector(".form-actions")||a.lastElementChild)}};r.querySelectorAll("[required]").forEach(t=>{e(t)})}function Qr(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",i=>{if(i.key==="Enter"||i.key==="Tab"){let o=e.value.trim();if(o){i.preventDefault();let a=t.type==="radio"?"radio":"checkbox",s=`open-group-${Math.random().toString(36).substring(2,11)}`,n=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=o;let l=document.createElement("input");l.type=a,l.name=t.name||r.getAttribute("data-name")||"open-group",l.value=o,l.id=s,n.appendChild(c),n.appendChild(l),r.insertBefore(n,e),e.value=""}}else if(i.key==="Backspace"&&e.value===""){i.preventDefault();let o=r.querySelectorAll("label");o.length>0&&o[o.length-1].remove()}})}function Yr(r){if(r.dataset.enhancedBtnWorking)return;r.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(o=>{o.forEach(a=>{if(a.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 c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),r.insertBefore(c,r.firstChild),t=!0}else a.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 Zr=new Map([["nav[data-dropdown]",Gr],["label[data-toggle]",Vr],['input[type="range"]',Jr],["form[data-required]",Kr],["fieldset[role=group][data-open]",Qr],["button, a[class*='btn-']",Yr]]),er=Xt.map(r=>({...r,run:Zr.get(r.selector)||(()=>{})}));var rr="pds",Xr=/^([a-z][a-z0-9+\-.]*:)?\/\//i,tr=/^[a-z]:/i;function ge(r=""){return r.endsWith("/")?r:`${r}/`}function eo(r="",e=rr){let t=r.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function to(r){return r.replace(/^\.\/+/,"")}function ro(r){return tr.test(r)?r.replace(tr,"").replace(/^\/+/,""):r}function oo(r){return r.startsWith("public/")?r.substring(7):r}function or(r,e={}){let t=e.segment||rr,i=e.defaultRoot||`/assets/${t}/`,o=r?.public&&r.public?.root||r?.static&&r.static?.root||null;if(!o||typeof o!="string")return ge(i);let a=o.trim();return a?(a=a.replace(/\\/g,"/"),a=eo(a,t),a=ge(a),Xr.test(a)?a:(a=to(a),a=ro(a),a.startsWith("/")||(a=oo(a),a.startsWith("/")||(a=`/${a}`),a=a.replace(/\/+/g,(s,n)=>n===0?s:"/")),ge(a))):ge(i)}function ir(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 o=document.createElement("canvas").getContext("2d");if(!o)return!1;let a="mmmmmmmmmmlli",s="72px",n="monospace";o.font=`${s} ${n}`;let c=o.measureText(a).width;o.font=`${s} "${e}", ${n}`;let l=o.measureText(a).width;return c!==l}function io(r){return r?r.split(",").map(i=>i.trim())[0].replace(/['"]/g,"").trim():null}async function ao(r,e={}){if(!r)return Promise.resolve();let{weights:t=[400,500,600,700],italic:i=!1}=e,o=io(r);if(!o||ir(o))return Promise.resolve();let a=encodeURIComponent(o);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${a}"]`)?(console.log(`Font "${o}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${o}" from Google Fonts...`),new Promise((n,c)=>{let l=document.createElement("link");l.rel="stylesheet";let d=i?`ital,wght@0,${t.join(";0,")};1,${t.join(";1,")}`:`wght@${t.join(";")}`;l.href=`https://fonts.googleapis.com/css2?family=${a}:${d}&display=swap`,l.setAttribute("data-font-loader",o),l.onload=()=>{console.log(`Successfully loaded font "${o}"`),n()},l.onerror=()=>{console.warn(`Failed to load font "${o}" from Google Fonts`),c(new Error(`Failed to load font: ${o}`))},document.head.appendChild(l),setTimeout(()=>{ir(o)||console.warn(`Font "${o}" did not load within timeout`),n()},5e3)}))}async function je(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(i=>ao(i).catch(o=>{console.warn(`Could not load font: ${i}`,o)}));await Promise.all(t)}var pt=class extends EventTarget{},m=new pt;m.initializing=!1;m.currentPreset=null;m.Generator=$;m.registry=he;m.ontology=Jt;m.adoptLayers=Qt;m.adoptPrimitives=Kt;m.createStylesheet=Yt;m.isLiveMode=()=>he.isLive;m.enums=u;m.ask=Zt;m.common=ct;m.presets=C;m.findComponentForElement=Vt;m.query=async function(r){return await new Ne(m).search(r)};function cr(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{}}}Object.defineProperty(m,"currentConfig",{value:null,writable:!0,enumerable:!0,configurable:!1});Object.defineProperty(m,"compiled",{get(){return m.registry?.isLive&&$.instance?$.instance.compiled:null},enumerable:!0,configurable:!1});typeof window<"u"&&(window.PDS=m);typeof document<"u"&&m.addEventListener("pds:ready",r=>{let e=r.detail?.mode;e&&(document.documentElement.classList.add(`pds-${e}`),e==="live"&&document.documentElement.classList.add("pds-ready"))});var dt="pure-ds-theme",X=null,me=null;function lr(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 dr(r){try{if(X&&me){try{typeof X.removeEventListener=="function"?X.removeEventListener("change",me):typeof X.removeListener=="function"&&X.removeListener(me)}catch{}X=null,me=null}if(r==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=i=>{let o=i?.matches===void 0?e.matches:i.matches;try{let a=o?"dark":"light";document.documentElement.setAttribute("data-theme",a),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:a,source:"system"}}))}catch{}};X=e,me=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(dt)||null}catch{return null}},set(r){try{if(typeof window>"u")return;r==null?localStorage.removeItem(dt):localStorage.setItem(dt,r),lr(r),dr(r),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"api"}}))}catch{}}});m.defaultEnhancers=er;function He(r={},e={}){let t=Number(e.minContrast||4.5),i=n=>{let c=String(n||"").replace("#",""),l=c.length===3?c.split("").map(p=>p+p).join(""):c,d=parseInt(l||"0",16);return{r:d>>16&255,g:d>>8&255,b:d&255}},o=n=>{let{r:c,g:l,b:d}=i(n),p=[c/255,l/255,d/255].map(h=>h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4));return .2126*p[0]+.7152*p[1]+.0722*p[2]},a=(n,c)=>{if(!n||!c)return 0;let l=o(n),d=o(c),p=Math.max(l,d),h=Math.min(l,d);return(p+.05)/(h+.05)},s=[];try{let c=new m.Generator({design:structuredClone(r)}).tokens.colors,l={surfaceBg:c.surface?.base,surfaceText:c.gray?.[900]||"#000000",primaryFill:c.interactive?.light?.fill||c.primary?.[600],primaryText:c.interactive?.light?.text||c.primary?.[600]},d=a(l.primaryFill,"#ffffff");d<t&&s.push({path:"/colors/primary",message:`Primary button contrast too low in light theme (${d.toFixed(2)} < ${t}). Choose a darker primary.`,ratio:d,min:t,context:"light/btn-primary"});let p=a(l.surfaceBg,l.surfaceText);p<t&&s.push({path:"/colors/background",message:`Base text contrast on surface (light) is too low (${p.toFixed(2)} < ${t}). Adjust background or secondary (gray).`,ratio:p,min:t,context:"light/surface-text"});let h=a(l.primaryText,l.surfaceBg);h<t&&s.push({path:"/colors/primary",message:`Primary text on surface is too low for outline/link styles (light) (${h.toFixed(2)} < ${t}). Choose a darker primary or lighter surface.`,ratio:h,min:t,context:"light/outline"});let g=c.dark;if(g){let y={surfaceBg:g.surface?.base||c.surface?.inverse,primaryFill:c.interactive?.dark?.fill||g.primary?.[600],primaryText:c.interactive?.dark?.text||g.primary?.[600]},f=a(y.primaryFill,"#ffffff");f<t&&s.push({path:"/colors/darkMode/primary",message:`Primary button contrast too low in dark theme (${f.toFixed(2)} < ${t}). Override darkMode.primary or pick a brighter hue.`,ratio:f,min:t,context:"dark/btn-primary"});let b=a(y.primaryText,y.surfaceBg);b<t&&s.push({path:"/colors/darkMode/primary",message:`Primary text on surface is too low for outline/link styles (dark) (${b.toFixed(2)} < ${t}). Override darkMode.primary/background.`,ratio:b,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}}m.validateDesign=He;function no(r=[],e={}){let t=[],i=Array.isArray(r)?r:r&&typeof r=="object"?Object.values(r):[];for(let o of i){let a,s=null;if(typeof o=="string"){let l=String(o).toLowerCase(),d=C?.[l]||Object.values(C||{}).find(p=>fe(p.name)===l||String(p.name||"").toLowerCase()===l);if(!d){t.push({name:o,ok:!1,issues:[{path:"/",message:`Preset not found: ${o}`,ratio:0,min:0}]});continue}a=d.name||l,s=structuredClone(d)}else if(o&&typeof o=="object")if(a=o.name||o.preset||void 0,"preset"in o||"design"in o){let l=String(o.preset||"default").toLowerCase(),d=C?.[l]||Object.values(C||{}).find(h=>fe(h.name)===l||String(h.name||"").toLowerCase()===l);if(!d){t.push({name:a,ok:!1,issues:[{path:"/",message:`Preset not found: ${o.preset}`,ratio:0,min:0}]});continue}let p=structuredClone(d);o.design&&typeof o.design=="object"&&(p=ut(p,structuredClone(o.design))),s=p}else s=o;if(!s){t.push({name:a,ok:!1,issues:[{path:"/",message:"Invalid design entry",ratio:0,min:0}]});continue}let{ok:n,issues:c}=He(s,e);t.push({name:a,ok:n,issues:c})}return{ok:t.every(o=>o.ok),results:t}}m.validateDesigns=no;function pr({manageTheme:r,themeStorageKey:e}){let t="light",i=null;if(r&&typeof window<"u"){try{i=localStorage.getItem(e)||null}catch{i=null}try{lr(i),dr(i)}catch{}i?i==="system"?t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=i:t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:t,storedTheme:i}}function ut(r={},e={}){if(!e||typeof e!="object")return r;let t=Array.isArray(r)?[...r]:{...r};for(let[i,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?t[i]=ut(t[i]&&typeof t[i]=="object"?t[i]:{},o):t[i]=o;return t}function fe(r=""){return String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ye(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=>ye(t)).filter(t=>t!==void 0);let e={};for(let t in r)if(r.hasOwnProperty(t)){let i=r[t];if(typeof i!="function"){let o=ye(i);o!==void 0&&(e[t]=o)}}return e}var co=/^[a-z][a-z0-9+\-.]*:\/\//i,be=(()=>{try{return import.meta.url}catch{return}})();function Ue(r,e={}){if(!r||co.test(r))return r;let{preferModule:t=!0}=e,i=()=>{if(!be)return null;try{return new URL(r,be).href}catch{return null}},o=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(r,window.location.origin).href}catch{return null}};return(t?i()||o():o()||i())||r}var We=r=>typeof r=="string"&&r.length&&!r.endsWith("/")?`${r}/`:r,nr=(()=>{if(be)try{let r=new URL(be);if(/\/public\/assets\/js\//.test(r.pathname))return new URL("../pds/",be).href}catch{return}})();function ur(r){let e=!!(r?.public?.root||r?.static?.root),t=or(r);return!e&&nr&&(t=nr),We(Ue(t))}function hr(r={},e={}){let t=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 o=i??e.enhancers??[],a=r&&r.preset,s=r&&r.design,n="preset"in(r||{})||"design"in(r||{})||"enhancers"in(r||{}),c,l=null;if(n){let d=String(a||"default").toLowerCase(),p=C?.[d]||Object.values(C||{}).find(D=>fe(D.name)===d||String(D.name||"").toLowerCase()===d);if(!p)throw new Error(`PDS preset not found: "${a||"default"}"`);l={id:p.id||fe(p.name),name:p.name||p.id||String(d)};let h=structuredClone(p);if(s&&typeof s=="object"){let D=ye(s);h=ut(h,structuredClone(D))}let{mode:g,autoDefine:y,applyGlobalStyles:f,manageTheme:b,themeStorageKey:_,preloadStyles:O,criticalLayers:R,preset:E,design:A,enhancers:M,log:I,...Ge}=r;c={...Ge,design:h,preset:l.name,log:I||Ie}}else if(t){let{log:d,...p}=r;c={design:structuredClone(p),log:d||Ie}}else{let d=C?.default||Object.values(C||{}).find(p=>fe(p.name)==="default");if(!d)throw new Error("PDS default preset not available");l={id:d.id||"default",name:d.name||"Default"},c={design:structuredClone(d),preset:l.name,log:Ie}}return{generatorConfig:c,enhancers:o,presetInfo:l}}async function gr(r){let{autoDefineBaseURL:e="/auto-define/",autoDefinePreload:t=[],autoDefineMapper:i=null,enhancers:o=[],autoDefineOverrides:a=null,autoDefinePreferModule:s=!0}=r,n=(()=>{let l=new Map;return(m.defaultEnhancers||[]).forEach(d=>l.set(d.selector,d)),(o||[]).forEach(d=>l.set(d.selector,d)),Array.from(l.values())})(),c=null;if(typeof window<"u"&&typeof document<"u"){let l=null;try{let f=await Promise.resolve().then(()=>(sr(),ar));l=f?.AutoDefiner||f?.default?.AutoDefiner||f?.default||null}catch(f){console.warn("AutoDefiner not available:",f?.message||f)}let d=f=>{switch(f){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${f}.js`}},{mapper:p,...h}=a&&typeof a=="object"?a:{},y={baseURL:e&&We(Ue(e,{preferModule:s})),predefine:t,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:n,onError:(f,b)=>{typeof f=="string"&&f.startsWith("pds-")?console.warn(`\u26A0\uFE0F PDS component <${f}> not found. Assets may not be installed.`):console.error(`\u274C Auto-define error for <${f}>:`,b)},...h,mapper:f=>{if(customElements.get(f))return null;if(typeof i=="function")try{let b=i(f);return b===void 0?d(f):b}catch(b){return console.warn("Custom autoDefine.mapper error; falling back to default:",b?.message||b),d(f)}return d(f)}};l&&(c=new l(y),t.length>0&&typeof l.define=="function"&&await l.define(...t,{baseURL:e,mapper:y.mapper,onError:y.onError}))}return{autoDefiner:c}}async function lo(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'live', ... }) requires a valid configuration object");if(typeof document<"u"&&document.adoptedStyleSheets){let n=`
3461
+ `.trim()}];function Gr(r){if(r.dataset.enhancedDropdown)return;r.dataset.enhancedDropdown="true";let e=r.querySelector("menu");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.setAttribute("role",e.getAttribute("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 n=(r.getAttribute("data-mode")||"auto").toLowerCase();if(n==="up"||n==="down")return n;let c=r.getBoundingClientRect(),l=Math.max(0,window.innerHeight-c.bottom);return Math.max(0,c.top)>l?"up":"down"},o=()=>{r.dataset.dropdownDirection=a(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},i=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},s=()=>{e.getAttribute("aria-hidden")==="false"?i():o()};t?.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),s()}),document.addEventListener("click",n=>{r.contains(n.target)||i()}),r.addEventListener("keydown",n=>{n.key==="Escape"&&(i(),t?.focus())}),r.addEventListener("focusout",n=>{(!n.relatedTarget||!r.contains(n.relatedTarget))&&i()})}function Vr(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 a=document.createElement("span");a.className="toggle-knob",t.appendChild(a),r.insertBefore(t,e.nextSibling);let o=()=>{r.setAttribute("aria-checked",e.checked?"true":"false")},i=()=>{e.disabled||(e.checked=!e.checked,o(),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",o)}function Jr(r){if(r.dataset.enhancedRange)return;let e=r.closest("label"),t=e?.classList.contains("range-output"),a=r.id||`range-${Math.random().toString(36).substring(2,11)}`,o=`${a}-output`;if(r.id=a,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 c=document.createElement("output");c.id=o,c.setAttribute("for",a),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=r.value,s.appendChild(c),i.textContent="",i.appendChild(s);let l=()=>{c.textContent=r.value};r.addEventListener("input",l)}}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=o,s.setAttribute("for",a),s.className="range-bubble",s.setAttribute("aria-live","polite"),i.appendChild(s);let n=()=>{let d=parseFloat(r.min)||0,p=parseFloat(r.max)||100,h=parseFloat(r.value),g=(h-d)/(p-d);s.style.left=`calc(${g*100}% )`,s.textContent=String(h)},c=()=>s.classList.add("visible"),l=()=>s.classList.remove("visible");r.addEventListener("input",n),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerleave",l),r.addEventListener("focus",c),r.addEventListener("blur",l),n()}r.dataset.enhancedRange="1"}function Kr(r){if(r.dataset.enhancedRequired)return;r.dataset.enhancedRequired="true";let e=t=>{let a=t.closest("label");if(!a||a.querySelector(".required-asterisk"))return;let o=document.createElement("span");o.classList.add("required-asterisk"),o.textContent="*",o.style.marginLeft="4px",a.querySelector("span").appendChild(o);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 Qr(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",a=>{if(a.key==="Enter"||a.key==="Tab"){let o=e.value.trim();if(o){a.preventDefault();let i=t.type==="radio"?"radio":"checkbox",s=`open-group-${Math.random().toString(36).substring(2,11)}`,n=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=o;let l=document.createElement("input");l.type=i,l.name=t.name||r.getAttribute("data-name")||"open-group",l.value=o,l.id=s,n.appendChild(c),n.appendChild(l),r.insertBefore(n,e),e.value=""}}else if(a.key==="Backspace"&&e.value===""){a.preventDefault();let o=r.querySelectorAll("label");o.length>0&&o[o.length-1].remove()}})}function Yr(r){if(r.dataset.enhancedBtnWorking)return;r.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(o=>{o.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 c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),r.insertBefore(c,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 Zr=new Map([["nav[data-dropdown]",Gr],["label[data-toggle]",Vr],['input[type="range"]',Jr],["form[data-required]",Kr],["fieldset[role=group][data-open]",Qr],["button, a[class*='btn-']",Yr]]),er=Xt.map(r=>({...r,run:Zr.get(r.selector)||(()=>{})}));var rr="pds",Xr=/^([a-z][a-z0-9+\-.]*:)?\/\//i,tr=/^[a-z]:/i;function ge(r=""){return r.endsWith("/")?r:`${r}/`}function eo(r="",e=rr){let t=r.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function to(r){return r.replace(/^\.\/+/,"")}function ro(r){return tr.test(r)?r.replace(tr,"").replace(/^\/+/,""):r}function oo(r){return r.startsWith("public/")?r.substring(7):r}function or(r,e={}){let t=e.segment||rr,a=e.defaultRoot||`/assets/${t}/`,o=r?.public&&r.public?.root||r?.static&&r.static?.root||null;if(!o||typeof o!="string")return ge(a);let i=o.trim();return i?(i=i.replace(/\\/g,"/"),i=eo(i,t),i=ge(i),Xr.test(i)?i:(i=to(i),i=ro(i),i.startsWith("/")||(i=oo(i),i.startsWith("/")||(i=`/${i}`),i=i.replace(/\/+/g,(s,n)=>n===0?s:"/")),ge(i))):ge(a)}function ar(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 o=document.createElement("canvas").getContext("2d");if(!o)return!1;let i="mmmmmmmmmmlli",s="72px",n="monospace";o.font=`${s} ${n}`;let c=o.measureText(i).width;o.font=`${s} "${e}", ${n}`;let l=o.measureText(i).width;return c!==l}function ao(r){return r?r.split(",").map(a=>a.trim())[0].replace(/['"]/g,"").trim():null}async function io(r,e={}){if(!r)return Promise.resolve();let{weights:t=[400,500,600,700],italic:a=!1}=e,o=ao(r);if(!o||ar(o))return Promise.resolve();let i=encodeURIComponent(o);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${i}"]`)?(console.log(`Font "${o}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${o}" from Google Fonts...`),new Promise((n,c)=>{let l=document.createElement("link");l.rel="stylesheet";let d=a?`ital,wght@0,${t.join(";0,")};1,${t.join(";1,")}`:`wght@${t.join(";")}`;l.href=`https://fonts.googleapis.com/css2?family=${i}:${d}&display=swap`,l.setAttribute("data-font-loader",o),l.onload=()=>{console.log(`Successfully loaded font "${o}"`),n()},l.onerror=()=>{console.warn(`Failed to load font "${o}" from Google Fonts`),c(new Error(`Failed to load font: ${o}`))},document.head.appendChild(l),setTimeout(()=>{ar(o)||console.warn(`Font "${o}" did not load within timeout`),n()},5e3)}))}async function je(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(a=>io(a).catch(o=>{console.warn(`Could not load font: ${a}`,o)}));await Promise.all(t)}var pt=class extends EventTarget{},m=new pt;m.initializing=!1;m.currentPreset=null;m.Generator=$;m.registry=he;m.ontology=Jt;m.adoptLayers=Qt;m.adoptPrimitives=Kt;m.createStylesheet=Yt;m.isLiveMode=()=>he.isLive;m.enums=u;m.ask=Zt;m.common=ct;m.presets=C;m.findComponentForElement=Vt;m.query=async function(r){return await new Ne(m).search(r)};function cr(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{}}}Object.defineProperty(m,"currentConfig",{value:null,writable:!0,enumerable:!0,configurable:!1});Object.defineProperty(m,"compiled",{get(){return m.registry?.isLive&&$.instance?$.instance.compiled:null},enumerable:!0,configurable:!1});typeof window<"u"&&(window.PDS=m);typeof document<"u"&&m.addEventListener("pds:ready",r=>{let e=r.detail?.mode;e&&(document.documentElement.classList.add(`pds-${e}`),e==="live"&&document.documentElement.classList.add("pds-ready"))});var dt="pure-ds-theme",X=null,me=null;function lr(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 dr(r){try{if(X&&me){try{typeof X.removeEventListener=="function"?X.removeEventListener("change",me):typeof X.removeListener=="function"&&X.removeListener(me)}catch{}X=null,me=null}if(r==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=a=>{let o=a?.matches===void 0?e.matches:a.matches;try{let i=o?"dark":"light";document.documentElement.setAttribute("data-theme",i),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:i,source:"system"}}))}catch{}};X=e,me=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(dt)||null}catch{return null}},set(r){try{if(typeof window>"u")return;r==null?localStorage.removeItem(dt):localStorage.setItem(dt,r),lr(r),dr(r),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"api"}}))}catch{}}});m.defaultEnhancers=er;function He(r={},e={}){let t=Number(e.minContrast||4.5),a=n=>{let c=String(n||"").replace("#",""),l=c.length===3?c.split("").map(p=>p+p).join(""):c,d=parseInt(l||"0",16);return{r:d>>16&255,g:d>>8&255,b:d&255}},o=n=>{let{r:c,g:l,b:d}=a(n),p=[c/255,l/255,d/255].map(h=>h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4));return .2126*p[0]+.7152*p[1]+.0722*p[2]},i=(n,c)=>{if(!n||!c)return 0;let l=o(n),d=o(c),p=Math.max(l,d),h=Math.min(l,d);return(p+.05)/(h+.05)},s=[];try{let c=new m.Generator({design:structuredClone(r)}).tokens.colors,l={surfaceBg:c.surface?.base,surfaceText:c.gray?.[900]||"#000000",primaryFill:c.interactive?.light?.fill||c.primary?.[600],primaryText:c.interactive?.light?.text||c.primary?.[600]},d=i(l.primaryFill,"#ffffff");d<t&&s.push({path:"/colors/primary",message:`Primary button contrast too low in light theme (${d.toFixed(2)} < ${t}). Choose a darker primary.`,ratio:d,min:t,context:"light/btn-primary"});let p=i(l.surfaceBg,l.surfaceText);p<t&&s.push({path:"/colors/background",message:`Base text contrast on surface (light) is too low (${p.toFixed(2)} < ${t}). Adjust background or secondary (gray).`,ratio:p,min:t,context:"light/surface-text"});let h=i(l.primaryText,l.surfaceBg);h<t&&s.push({path:"/colors/primary",message:`Primary text on surface is too low for outline/link styles (light) (${h.toFixed(2)} < ${t}). Choose a darker primary or lighter surface.`,ratio:h,min:t,context:"light/outline"});let g=c.dark;if(g){let y={surfaceBg:g.surface?.base||c.surface?.inverse,primaryFill:c.interactive?.dark?.fill||g.primary?.[600],primaryText:c.interactive?.dark?.text||g.primary?.[600]},f=i(y.primaryFill,"#ffffff");f<t&&s.push({path:"/colors/darkMode/primary",message:`Primary button contrast too low in dark theme (${f.toFixed(2)} < ${t}). Override darkMode.primary or pick a brighter hue.`,ratio:f,min:t,context:"dark/btn-primary"});let b=i(y.primaryText,y.surfaceBg);b<t&&s.push({path:"/colors/darkMode/primary",message:`Primary text on surface is too low for outline/link styles (dark) (${b.toFixed(2)} < ${t}). Override darkMode.primary/background.`,ratio:b,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}}m.validateDesign=He;function no(r=[],e={}){let t=[],a=Array.isArray(r)?r:r&&typeof r=="object"?Object.values(r):[];for(let o of a){let i,s=null;if(typeof o=="string"){let l=String(o).toLowerCase(),d=C?.[l]||Object.values(C||{}).find(p=>fe(p.name)===l||String(p.name||"").toLowerCase()===l);if(!d){t.push({name:o,ok:!1,issues:[{path:"/",message:`Preset not found: ${o}`,ratio:0,min:0}]});continue}i=d.name||l,s=structuredClone(d)}else if(o&&typeof o=="object")if(i=o.name||o.preset||void 0,"preset"in o||"design"in o){let l=String(o.preset||"default").toLowerCase(),d=C?.[l]||Object.values(C||{}).find(h=>fe(h.name)===l||String(h.name||"").toLowerCase()===l);if(!d){t.push({name:i,ok:!1,issues:[{path:"/",message:`Preset not found: ${o.preset}`,ratio:0,min:0}]});continue}let p=structuredClone(d);o.design&&typeof o.design=="object"&&(p=ut(p,structuredClone(o.design))),s=p}else s=o;if(!s){t.push({name:i,ok:!1,issues:[{path:"/",message:"Invalid design entry",ratio:0,min:0}]});continue}let{ok:n,issues:c}=He(s,e);t.push({name:i,ok:n,issues:c})}return{ok:t.every(o=>o.ok),results:t}}m.validateDesigns=no;function pr({manageTheme:r,themeStorageKey:e}){let t="light",a=null;if(r&&typeof window<"u"){try{a=localStorage.getItem(e)||null}catch{a=null}try{lr(a),dr(a)}catch{}a?a==="system"?t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=a:t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:t,storedTheme:a}}function ut(r={},e={}){if(!e||typeof e!="object")return r;let t=Array.isArray(r)?[...r]:{...r};for(let[a,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?t[a]=ut(t[a]&&typeof t[a]=="object"?t[a]:{},o):t[a]=o;return t}function fe(r=""){return String(r).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ye(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=>ye(t)).filter(t=>t!==void 0);let e={};for(let t in r)if(r.hasOwnProperty(t)){let a=r[t];if(typeof a!="function"){let o=ye(a);o!==void 0&&(e[t]=o)}}return e}var co=/^[a-z][a-z0-9+\-.]*:\/\//i,be=(()=>{try{return import.meta.url}catch{return}})();function Ue(r,e={}){if(!r||co.test(r))return r;let{preferModule:t=!0}=e,a=()=>{if(!be)return null;try{return new URL(r,be).href}catch{return null}},o=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(r,window.location.origin).href}catch{return null}};return(t?a()||o():o()||a())||r}var We=r=>typeof r=="string"&&r.length&&!r.endsWith("/")?`${r}/`:r,nr=(()=>{if(be)try{let r=new URL(be);if(/\/public\/assets\/js\//.test(r.pathname))return new URL("../pds/",be).href}catch{return}})();function ur(r){let e=!!(r?.public?.root||r?.static?.root),t=or(r);return!e&&nr&&(t=nr),We(Ue(t))}function hr(r={},e={}){let t=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),a=r&&r.enhancers;a&&!Array.isArray(a)&&(a=Object.values(a));let o=a??e.enhancers??[],i=r&&r.preset,s=r&&r.design,n="preset"in(r||{})||"design"in(r||{})||"enhancers"in(r||{}),c,l=null;if(n){let d=String(i||"default").toLowerCase(),p=C?.[d]||Object.values(C||{}).find(D=>fe(D.name)===d||String(D.name||"").toLowerCase()===d);if(!p)throw new Error(`PDS preset not found: "${i||"default"}"`);l={id:p.id||fe(p.name),name:p.name||p.id||String(d)};let h=structuredClone(p);if(s&&typeof s=="object"){let D=ye(s);h=ut(h,structuredClone(D))}let{mode:g,autoDefine:y,applyGlobalStyles:f,manageTheme:b,themeStorageKey:_,preloadStyles:O,criticalLayers:F,preset:E,design:A,enhancers:M,log:I,...Ge}=r;c={...Ge,design:h,preset:l.name,log:I||Ie}}else if(t){let{log:d,...p}=r;c={design:structuredClone(p),log:d||Ie}}else{let d=C?.default||Object.values(C||{}).find(p=>fe(p.name)==="default");if(!d)throw new Error("PDS default preset not available");l={id:d.id||"default",name:d.name||"Default"},c={design:structuredClone(d),preset:l.name,log:Ie}}return{generatorConfig:c,enhancers:o,presetInfo:l}}async function gr(r){let{autoDefineBaseURL:e="/auto-define/",autoDefinePreload:t=[],autoDefineMapper:a=null,enhancers:o=[],autoDefineOverrides:i=null,autoDefinePreferModule:s=!0}=r,n=(()=>{let l=new Map;return(m.defaultEnhancers||[]).forEach(d=>l.set(d.selector,d)),(o||[]).forEach(d=>l.set(d.selector,d)),Array.from(l.values())})(),c=null;if(typeof window<"u"&&typeof document<"u"){let l=null;try{let f=await Promise.resolve().then(()=>(sr(),ir));l=f?.AutoDefiner||f?.default?.AutoDefiner||f?.default||null}catch(f){console.warn("AutoDefiner not available:",f?.message||f)}let d=f=>{switch(f){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${f}.js`}},{mapper:p,...h}=i&&typeof i=="object"?i:{},y={baseURL:e&&We(Ue(e,{preferModule:s})),predefine:t,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:n,onError:(f,b)=>{typeof f=="string"&&f.startsWith("pds-")?console.warn(`\u26A0\uFE0F PDS component <${f}> not found. Assets may not be installed.`):console.error(`\u274C Auto-define error for <${f}>:`,b)},...h,mapper:f=>{if(customElements.get(f))return null;if(typeof a=="function")try{let b=a(f);return b===void 0?d(f):b}catch(b){return console.warn("Custom autoDefine.mapper error; falling back to default:",b?.message||b),d(f)}return d(f)}};l&&(c=new l(y),t.length>0&&typeof l.define=="function"&&await l.define(...t,{baseURL:e,mapper:y.mapper,onError:y.onError}))}return{autoDefiner:c}}async function lo(r){if(!r||typeof r!="object")throw new Error("PDS.start({ mode: 'live', ... }) requires a valid configuration object");if(typeof document<"u"&&document.adoptedStyleSheets){let n=`
3462
3462
  html { opacity: 0; }
3463
3463
  html.pds-ready { opacity: 1; transition: opacity 0.3s ease-in; }
3464
- `;try{if(!document.adoptedStyleSheets.some(l=>l._pdsFouc)){let l=new CSSStyleSheet;l.replaceSync(n),l._pdsFouc=!0,document.adoptedStyleSheets=[l,...document.adoptedStyleSheets]}}catch(c){if(console.warn("Constructable stylesheets not supported, using <style> tag fallback:",c),!document.head.querySelector("style[data-pds-fouc]")){let d=document.createElement("style");d.setAttribute("data-pds-fouc",""),d.textContent=n,document.head.insertBefore(d,document.head.firstChild)}}}let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,i=r.themeStorageKey??"pure-ds-theme",o=r.preloadStyles??!1,a=r.criticalLayers??["tokens","primitives"],s=r&&r.autoDefine||null;try{let{resolvedTheme:n,storedTheme:c}=pr({manageTheme:t,themeStorageKey:i}),l=hr(r,{}),d=l.enhancers,{log:p,...h}=l.generatorConfig,g=structuredClone(h);g.log=p,t&&(g.theme=n);let y=new m.Generator(g);if(g.design?.typography)try{await je(g.design.typography)}catch(E){g?.log?.("warn","Failed to load some fonts from Google Fonts:",E)}if(o&&typeof window<"u"&&document.head)try{let E=a.map(A=>{try{return y.css?.[A]||""}catch(M){return g?.log?.("warn",`Failed to generate critical CSS for layer "${A}":`,M),""}}).filter(A=>A.trim()).join(`
3465
- `);if(E){let A=document.head.querySelector("style[data-pds-critical]");A&&A.remove();let M=document.createElement("style");M.setAttribute("data-pds-critical",""),M.textContent=E;let I=document.head.querySelector('meta[charset], meta[name="viewport"]');I?I.parentNode.insertBefore(M,I.nextSibling):document.head.insertBefore(M,document.head.firstChild)}}catch(E){g?.log?.("warn","Failed to preload critical styles:",E)}m.registry.setLiveMode(),l.presetInfo?.name?g?.log?.("log",`PDS live with preset "${l.presetInfo.name}"`):g?.log?.("log","PDS live with custom config"),e&&(await m.Generator.applyStyles(),typeof window<"u"&&setTimeout(()=>{let E=document.head.querySelector("style[data-pds-critical]");E&&E.remove();let A=document.head.querySelector("style[data-pds-preload]");A&&A.remove();let M=document.getElementById("pds-runtime-stylesheet");M&&M.remove()},100));let f=ur(r),b;s&&s.baseURL?b=We(Ue(s.baseURL,{preferModule:!1})):b=`${f}components/`;let _=null;try{_=(await gr({autoDefineBaseURL:b,autoDefinePreload:s&&Array.isArray(s.predefine)&&s.predefine||[],autoDefineMapper:s&&typeof s.mapper=="function"&&s.mapper||null,enhancers:d,autoDefineOverrides:s||null,autoDefinePreferModule:!(s&&s.baseURL)})).autoDefiner}catch(E){g?.log?.("error","\u274C Failed to initialize AutoDefiner/Enhancers:",E)}let O=y?.options||g,R=ye(r);return m.currentConfig=Object.freeze({mode:"live",...structuredClone(R),design:structuredClone(l.generatorConfig.design),preset:l.generatorConfig.preset,theme:n}),cr({mode:"live",generator:y,config:O,theme:n,autoDefiner:_}),{generator:y,config:O,theme:n,autoDefiner:_}}catch(n){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:n}})),n}}async function po(r){let e=r&&r.mode||"live",{mode:t,...i}=r||{};return e==="static"?uo(i):lo(i)}m.start=po;async function uo(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,i=r.themeStorageKey??"pure-ds-theme",o=r.staticPaths??{},a=ur(r),s=r&&r.autoDefine||null,n;s&&s.baseURL?n=We(Ue(s.baseURL,{preferModule:!1})):n=`${a}components/`;let c=s&&Array.isArray(s.predefine)&&s.predefine||[],l=s&&typeof s.mapper=="function"&&s.mapper||null;try{let{resolvedTheme:d}=pr({manageTheme:t,themeStorageKey:i}),p=hr(r,{}),h=p.enhancers;if(o={...{tokens:`${a}styles/pds-tokens.css.js`,primitives:`${a}styles/pds-primitives.css.js`,components:`${a}styles/pds-components.css.js`,utilities:`${a}styles/pds-utilities.css.js`,styles:`${a}styles/pds-styles.css.js`},...o},m.registry.setStaticMode(o),e&&typeof document<"u")try{let b=await m.registry.getStylesheet("styles");if(b){b._pds=!0;let _=(document.adoptedStyleSheets||[]).filter(O=>O._pds!==!0);document.adoptedStyleSheets=[..._,b]}}catch(b){console.warn("Failed to apply static styles:",b)}let y=null;try{y=(await gr({autoDefineBaseURL:n,autoDefinePreload:c,autoDefineMapper:l,enhancers:h,autoDefineOverrides:s||null,autoDefinePreferModule:!(s&&s.baseURL)})).autoDefiner}catch(b){console.error("\u274C Failed to initialize AutoDefiner/Enhancers (static):",b)}let f=ye(r);return m.currentConfig=Object.freeze({mode:"static",...structuredClone(f),design:structuredClone(p.generatorConfig.design),preset:p.generatorConfig.preset,theme:d}),cr({mode:"static",config:p.generatorConfig,theme:d,autoDefiner:y}),{config:p.generatorConfig,theme:d,autoDefiner:y}}catch(d){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}async function ho(r,e={}){let{storageKey:t="pure-ds-theme",persist:i=!0}=e;if(!["light","dark","system"].includes(r))throw new Error(`Invalid theme "${r}". Must be "light", "dark", or "system".`);if(typeof window>"u")return r==="system"?"light":r;let o=r;if(r==="system"&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o),i&&localStorage.setItem(t,r),m.registry.isLive&&$.instance)try{let a=$.instance;if(a&&a.configure){let s={...a.config,theme:o};a.configure(s),await m.Generator.applyStyles()}}catch(a){console.warn("Failed to update styles for new theme:",a)}return m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:o,requested:r,source:"programmatic"}})),o}m.setTheme=ho;function go(r,e={}){if(typeof window>"u"||!document.head||!r)return;let{theme:t,layers:i=["tokens"]}=e;try{let o=t||"light";(t==="system"||!t)&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o);let a=r.design?{...r,theme:o}:{design:r,theme:o},s=new m.Generator(a),n=i.map(c=>{try{return s.css?.[c]||""}catch{return""}}).filter(c=>c.trim()).join(`
3466
- `);if(n){let c=document.head.querySelector("style[data-pds-preload]");c&&c.remove();let l=document.createElement("style");l.setAttribute("data-pds-preload",""),l.textContent=n,document.head.insertBefore(l,document.head.firstChild)}}catch(o){console.warn("PDS preload failed:",o)}}m.preloadCritical=go;function mr(r){return new DOMParser().parseFromString(r,"text/html").body.childNodes}function fr(r,e=100){let t;return function(...o){let a=()=>{clearTimeout(t),r(...o)};clearTimeout(t),t=setTimeout(a,e)}}function qe(r){setTimeout(r,0)}function br(r){try{if(typeof r!="string"||r.indexOf(`
3467
- `)!==-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 yr(r,e,t){let i=window.screen.width/2-e/2,o=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=${o}, left=${i}`)}var ht={result:"ac-suggestion",item:"ac-itm"},ae=class r extends EventTarget{constructor(e,t,i){super(),this.settings={emptyResultsText:"",...i},this.container=e,this.input=t,this.input.setAttribute("autocomplete","off"),this.categories=i.categories||{},this.caches=new Map,qe(this.attach.bind(this))}static connect(e,t){let i=e.target;if(!i._autoComplete){if(!t?.categories)throw Error("Missing autocomplete settings");i._autoComplete=new r(i.parentNode,i,t),e.type==="focus"&&setTimeout(()=>{i._autoComplete.focusHandler(e)},100)}return i._autoComplete}on(e,t){return this.input.addEventListener(e,t),this}attach(){this.resultsDiv=document.createElement("div"),this.resultsDiv.title="",this.resultsDiv.classList.add(ht.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",fr(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 o of this.acItems)o.classList.remove("selected");let i=this.getSelectedDiv();i?(i.classList.add("selected"),i.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 i=this.results[t],o=this.categories[i.category]??{};o.action=o.action??this.setText.bind(this),o.newTab&&(this.tabWindow=yr("about:blank"));let a={...i,search:this.input.value};e.classList.add("ac-active"),setTimeout(()=>{this.controller().hide("result-selected"),a.action?a.action(a):(o.action(a),o.newTab&&(a.url?this.tabWindow.location.href=a.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=a,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(`.${ht.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(i=>{this.controller().clear("new-results"),this.resultsHandler(i,t),this.container.classList.remove("search-running")})}keyDownHandler(e){switch(e.key){case"Enter":e.stopPropagation(),e.preventDefault();break;case"ArrowDown":qe(this.moveResult(1));break;case"ArrowUp":qe(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 i={suggest:!0,search:e||"",categories:this.categories};this.getItems(i,t).then(o=>{this.input.dispatchEvent(new CustomEvent("show-results",{detail:{results:o}})),this.resultsHandler(o,i)})}sort(e,t){return e.sort((i,o)=>{let a=t.categories[i.category],s=t.categories[o.category],n=typeof a.sortIndex=="function"?a.sortIndex(t):a.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 i=0,o=(a,s)=>`
3468
- <div title="${s.tooltip||""}" data-index="${i}" class="${`${ht.item} cat-${s.category} ${s.class??""}`.trim()}">
3464
+ `;try{if(!document.adoptedStyleSheets.some(l=>l._pdsFouc)){let l=new CSSStyleSheet;l.replaceSync(n),l._pdsFouc=!0,document.adoptedStyleSheets=[l,...document.adoptedStyleSheets]}}catch(c){if(console.warn("Constructable stylesheets not supported, using <style> tag fallback:",c),!document.head.querySelector("style[data-pds-fouc]")){let d=document.createElement("style");d.setAttribute("data-pds-fouc",""),d.textContent=n,document.head.insertBefore(d,document.head.firstChild)}}}let e=r.applyGlobalStyles??!0,t=r.manageTheme??!0,a=r.themeStorageKey??"pure-ds-theme",o=r.preloadStyles??!1,i=r.criticalLayers??["tokens","primitives"],s=r&&r.autoDefine||null;try{let{resolvedTheme:n,storedTheme:c}=pr({manageTheme:t,themeStorageKey:a}),l=hr(r,{}),d=l.enhancers,{log:p,...h}=l.generatorConfig,g=structuredClone(h);g.log=p,t&&(g.theme=n);let y=new m.Generator(g);if(g.design?.typography)try{await je(g.design.typography)}catch(E){g?.log?.("warn","Failed to load some fonts from Google Fonts:",E)}if(o&&typeof window<"u"&&document.head)try{let E=i.map(A=>{try{return y.css?.[A]||""}catch(M){return g?.log?.("warn",`Failed to generate critical CSS for layer "${A}":`,M),""}}).filter(A=>A.trim()).join(`
3465
+ `);if(E){let A=document.head.querySelector("style[data-pds-critical]");A&&A.remove();let M=document.createElement("style");M.setAttribute("data-pds-critical",""),M.textContent=E;let I=document.head.querySelector('meta[charset], meta[name="viewport"]');I?I.parentNode.insertBefore(M,I.nextSibling):document.head.insertBefore(M,document.head.firstChild)}}catch(E){g?.log?.("warn","Failed to preload critical styles:",E)}m.registry.setLiveMode(),l.presetInfo?.name?g?.log?.("log",`PDS live with preset "${l.presetInfo.name}"`):g?.log?.("log","PDS live with custom config"),e&&(await m.Generator.applyStyles(),typeof window<"u"&&setTimeout(()=>{let E=document.head.querySelector("style[data-pds-critical]");E&&E.remove();let A=document.head.querySelector("style[data-pds-preload]");A&&A.remove();let M=document.getElementById("pds-runtime-stylesheet");M&&M.remove()},100));let f=ur(r),b;s&&s.baseURL?b=We(Ue(s.baseURL,{preferModule:!1})):b=`${f}components/`;let _=null;try{_=(await gr({autoDefineBaseURL:b,autoDefinePreload:s&&Array.isArray(s.predefine)&&s.predefine||[],autoDefineMapper:s&&typeof s.mapper=="function"&&s.mapper||null,enhancers:d,autoDefineOverrides:s||null,autoDefinePreferModule:!(s&&s.baseURL)})).autoDefiner}catch(E){g?.log?.("error","\u274C Failed to initialize AutoDefiner/Enhancers:",E)}let O=y?.options||g,F=ye(r);return m.currentConfig=Object.freeze({mode:"live",...structuredClone(F),design:structuredClone(l.generatorConfig.design),preset:l.generatorConfig.preset,theme:n}),cr({mode:"live",generator:y,config:O,theme:n,autoDefiner:_}),{generator:y,config:O,theme:n,autoDefiner:_}}catch(n){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:n}})),n}}async function po(r){let e=r&&r.mode||"live",{mode:t,...a}=r||{};return e==="static"?uo(a):lo(a)}m.start=po;async function uo(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,a=r.themeStorageKey??"pure-ds-theme",o=r.staticPaths??{},i=ur(r),s=r&&r.autoDefine||null,n;s&&s.baseURL?n=We(Ue(s.baseURL,{preferModule:!1})):n=`${i}components/`;let c=s&&Array.isArray(s.predefine)&&s.predefine||[],l=s&&typeof s.mapper=="function"&&s.mapper||null;try{let{resolvedTheme:d}=pr({manageTheme:t,themeStorageKey:a}),p=hr(r,{}),h=p.enhancers;if(o={...{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`},...o},m.registry.setStaticMode(o),e&&typeof document<"u")try{let b=await m.registry.getStylesheet("styles");if(b){b._pds=!0;let _=(document.adoptedStyleSheets||[]).filter(O=>O._pds!==!0);document.adoptedStyleSheets=[..._,b]}}catch(b){console.warn("Failed to apply static styles:",b)}let y=null;try{y=(await gr({autoDefineBaseURL:n,autoDefinePreload:c,autoDefineMapper:l,enhancers:h,autoDefineOverrides:s||null,autoDefinePreferModule:!(s&&s.baseURL)})).autoDefiner}catch(b){console.error("\u274C Failed to initialize AutoDefiner/Enhancers (static):",b)}let f=ye(r);return m.currentConfig=Object.freeze({mode:"static",...structuredClone(f),design:structuredClone(p.generatorConfig.design),preset:p.generatorConfig.preset,theme:d}),cr({mode:"static",config:p.generatorConfig,theme:d,autoDefiner:y}),{config:p.generatorConfig,theme:d,autoDefiner:y}}catch(d){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}async function ho(r,e={}){let{storageKey:t="pure-ds-theme",persist:a=!0}=e;if(!["light","dark","system"].includes(r))throw new Error(`Invalid theme "${r}". Must be "light", "dark", or "system".`);if(typeof window>"u")return r==="system"?"light":r;let o=r;if(r==="system"&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o),a&&localStorage.setItem(t,r),m.registry.isLive&&$.instance)try{let i=$.instance;if(i&&i.configure){let s={...i.config,theme:o};i.configure(s),await m.Generator.applyStyles()}}catch(i){console.warn("Failed to update styles for new theme:",i)}return m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:o,requested:r,source:"programmatic"}})),o}m.setTheme=ho;function go(r,e={}){if(typeof window>"u"||!document.head||!r)return;let{theme:t,layers:a=["tokens"]}=e;try{let o=t||"light";(t==="system"||!t)&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",o);let i=r.design?{...r,theme:o}:{design:r,theme:o},s=new m.Generator(i),n=a.map(c=>{try{return s.css?.[c]||""}catch{return""}}).filter(c=>c.trim()).join(`
3466
+ `);if(n){let c=document.head.querySelector("style[data-pds-preload]");c&&c.remove();let l=document.createElement("style");l.setAttribute("data-pds-preload",""),l.textContent=n,document.head.insertBefore(l,document.head.firstChild)}}catch(o){console.warn("PDS preload failed:",o)}}m.preloadCritical=go;function mr(r){return new DOMParser().parseFromString(r,"text/html").body.childNodes}function fr(r,e=100){let t;return function(...o){let i=()=>{clearTimeout(t),r(...o)};clearTimeout(t),t=setTimeout(i,e)}}function qe(r){setTimeout(r,0)}function br(r){try{if(typeof r!="string"||r.indexOf(`
3467
+ `)!==-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 yr(r,e,t){let a=window.screen.width/2-e/2,o=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=${o}, left=${a}`)}var ht={result:"ac-suggestion",item:"ac-itm"},ie=class r extends EventTarget{constructor(e,t,a){super(),this.settings={emptyResultsText:"",...a},this.container=e,this.input=t,this.input.setAttribute("autocomplete","off"),this.categories=a.categories||{},this.caches=new Map,qe(this.attach.bind(this))}static connect(e,t){let a=e.target;if(!a._autoComplete){if(!t?.categories)throw Error("Missing autocomplete settings");a._autoComplete=new r(a.parentNode,a,t),e.type==="focus"&&setTimeout(()=>{a._autoComplete.focusHandler(e)},100)}return a._autoComplete}on(e,t){return this.input.addEventListener(e,t),this}attach(){this.resultsDiv=document.createElement("div"),this.resultsDiv.title="",this.resultsDiv.classList.add(ht.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",fr(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 o of this.acItems)o.classList.remove("selected");let a=this.getSelectedDiv();a?(a.classList.add("selected"),a.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 a=this.results[t],o=this.categories[a.category]??{};o.action=o.action??this.setText.bind(this),o.newTab&&(this.tabWindow=yr("about:blank"));let i={...a,search:this.input.value};e.classList.add("ac-active"),setTimeout(()=>{this.controller().hide("result-selected"),i.action?i.action(i):(o.action(i),o.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(`.${ht.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(a=>{this.controller().clear("new-results"),this.resultsHandler(a,t),this.container.classList.remove("search-running")})}keyDownHandler(e){switch(e.key){case"Enter":e.stopPropagation(),e.preventDefault();break;case"ArrowDown":qe(this.moveResult(1));break;case"ArrowUp":qe(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 a={suggest:!0,search:e||"",categories:this.categories};this.getItems(a,t).then(o=>{this.input.dispatchEvent(new CustomEvent("show-results",{detail:{results:o}})),this.resultsHandler(o,a)})}sort(e,t){return e.sort((a,o)=>{let i=t.categories[a.category],s=t.categories[o.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 a=0,o=(i,s)=>`
3468
+ <div title="${s.tooltip||""}" data-index="${a}" class="${`${ht.item} cat-${s.category} ${s.class??""}`.trim()}">
3469
3469
  ${this.handleImageOrIcon(s)}
3470
- <span class="text">${this.formatResultItem(s,t,a)}</span>
3470
+ <span class="text">${this.formatResultItem(s,t,i)}</span>
3471
3471
  ${this.settings.hideCategory?"":`<span class="category">${s.category||""}</span>`}
3472
- </div>`;e.forEach(a=>{let s=t.categories[a.category]||{};a.element?this.resultsDiv.appendChild(a.element):(a=typeof a=="string"?{text:a}:a,this.resultsDiv.appendChild(mr(o(s,a))[0])),i++}),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,i){let o=typeof e=="string"?{text:e}:e,a=o.text;return t.search&&(a=a.replace("%search%",t.search),o.description=o.description?.replace("%search%",t.search)),a=this.highlight(a,t.search),o.description&&(a=`<div>${a}</div><small>${o.description}</small>`),i.format&&(a=i.format({item:o,result:a,options:t})),a}highlight(e,t){var i=new RegExp("("+t+")","gi");return e.replace(i,'<span class="txt-hl">$1</span>')}async getItems(e,t){this.aborter&&this.aborter.abort();let i=this.caches.get(e.search);if(i)return i;let o=this.settings.map,a=c=>(typeof c=="string"&&(c={text:c}),c),s=c=>o?c.map(l=>({text:l[o]})):c.map(l=>a(l)),n=c=>(this.settings.max&&this.settings.max>0&&(c.length=this.settings.max),c);return this.aborter=new AbortController,this.aborterSignal=this.aborter.signal,new Promise(c=>{let l=d=>{d=this.sort(d,e),this.settings.cache!==!1&&this.caches.set(e.search,d),c(d)};if(br(this.items)){if(this.settings.minlength>0&&(!e.search||e.search.length<this.settings.minlength)){l([]);return}let d=this.formatSearch(this.items,e);fetch(d).then(p=>{if(p.status===200){p.json().then(h=>{h=s(h),l(n(h.filter(g=>this.isMatch(e,g))))});return}throw Error(`HTTP error ${p.status} - ${d}`)})}else if(Array.isArray(this.items)){let d=!0;this.items=this.items.map(p=>typeof p=="string"?{text:p}:(d=!1,p)),d&&this.container.classList.add("simple"),l(n(s(this.items)))}else if(typeof this.items=="function")e.control=this.container,Promise.resolve(this.items(e,t)).then(p=>{p=p.map(h=>a(h)),p=s(p),l(p)});else return l(Promise.resolve(this.items.apply(this,e)))})}async items(e){let t=[];e.results=[],e.signal=this.aborterSignal;for(var i in e.categories){let o=e.categories[i];if(o.trigger=o.trigger??(()=>!0),e.results=t,o.trigger(e)){let a=[];try{a=await o.getItems(e)}catch(s){console.warn(`Error loading items for omniBox category '${i}'.`,s)}t=t.concat(a.map(s=>(s.category=i,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(i){if(!e.search)return!0;if(i.hidden)return!1;let a=(t?i[t]:i).match(new RegExp(e.search,"gi"));if(a)return a;if(i.config?.tags)return i.config.tags.some(s=>s.match(new RegExp(e.search,"gi")))}}};function vr(r){function e(o,a,s){let n=o[0];if(n==="colors")return a==="scheme"?"string":"color";if(n==="spacing"||n==="radius"||n==="borderWidths")return"dimension";if(n==="typography"){let c=o[1];return c==="fontFamily"?"fontFamily":c==="fontSize"?"fontSize":c==="fontWeight"?"fontWeight":c==="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 a==="defaultSize"||o.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(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function i(o,a=[]){if(o==null)return o;if(Array.isArray(o))return o.map((l,d)=>i(l,a.concat(String(d))));if(t(o)){if(Object.prototype.hasOwnProperty.call(o,"value")&&(Object.prototype.hasOwnProperty.call(o,"type")||Object.keys(o).length===1))return o;let l={};for(let[d,p]of Object.entries(o))l[d]=i(p,a.concat(d));return l}let s=a[a.length-1]??"",n=e(a,s,o),c=o;if(n==="number"&&typeof c=="string"){let l=Number(c);Number.isNaN(l)||(c=l)}return n?{value:c,type:n}:{value:c}}return i(r,[])}var wr="pure-ds-config";async function W(r,e={}){let t=document.querySelector("#global-toaster");return t||(t=document.createElement("pds-toaster"),t.id="global-toaster",document.body.appendChild(t),await customElements.whenDefined("pds-toaster")),t.toast(r,e)}customElements.define("pds-config-form",class extends F{#i;#e=0;#r=null;#s=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{m._applyResolvedTheme(m.theme),m._setupSystemListenerIfNeeded(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(C.default),e=new $({design:r}),t=e.generateSpacingTokens(r.spatialRhythm||{});Object.entries(t).forEach(([s,n])=>{try{this.style.setProperty(`--spacing-${s}`,n)}catch{}});let i=r.spatialRhythm&&r.spatialRhythm.baseUnit||16;this.style.setProperty("--base-unit",`${i}px`);let o=e.generateTypographyTokens(r.typography||{});o.fontSize&&Object.entries(o.fontSize).forEach(([s,n])=>{this.style.setProperty(`--font-size-${s}`,n)});let a=r.typography&&r.typography.baseFontSize||16;this.style.setProperty("--base-font-size",`${a}px`),o.fontFamily&&Object.entries(o.fontFamily).forEach(([s,n])=>{this.style.setProperty(`--font-family-${s}`,n)}),o.lineHeight&&Object.entries(o.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 o=0;o<r.length;o++)if(!this._isEqual(r[o],e[o]))return!1;return!0}let t=Object.keys(r),i=Object.keys(e);t.length,i.length;for(let o of new Set([...t,...i]))if(!this._isEqual(r[o],e[o]))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={},i=new Set([...Object.keys(e)]);for(let o of i){let a=this._deepDiff(r[o],e[o]);a!==void 0&&(t[o]=a)}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=C?.[e]||C?.default;return JSON.parse(JSON.stringify(t||C.default))}loadConfig(){let r=localStorage.getItem(wr);if(r)try{let e=JSON.parse(r);if(e&&("preset"in e||"design"in e)){let i=e.preset||"default",o=this._resolvePresetBase(i),a=Z(o,e.design||{});return this._stored={preset:i,design:e.design||{}},this._legacy=!1,a}let t=Z(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)||{},i={preset:r,design:t};localStorage.setItem(wr,JSON.stringify(i)),this._stored=i,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(C.default);if(r&&this.config){let o=this._stored&&this._stored.preset||"default",a=this._resolvePresetBase(o);e=Z(a,this.config)}if(e.typography)try{await je(e.typography)}catch(o){console.warn("Failed to load some fonts from Google Fonts:",o)}try{let o=He(e);if(!o.ok){if(this.validationIssues=o.issues,!this._validationToastId){let a=o.issues.slice(0,3).map(s=>`\u2022 ${s.message}`).join(`
3472
+ </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(mr(o(s,i))[0])),a++}),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,a){let o=typeof e=="string"?{text:e}:e,i=o.text;return t.search&&(i=i.replace("%search%",t.search),o.description=o.description?.replace("%search%",t.search)),i=this.highlight(i,t.search),o.description&&(i=`<div>${i}</div><small>${o.description}</small>`),a.format&&(i=a.format({item:o,result:i,options:t})),i}highlight(e,t){var a=new RegExp("("+t+")","gi");return e.replace(a,'<span class="txt-hl">$1</span>')}async getItems(e,t){this.aborter&&this.aborter.abort();let a=this.caches.get(e.search);if(a)return a;let o=this.settings.map,i=c=>(typeof c=="string"&&(c={text:c}),c),s=c=>o?c.map(l=>({text:l[o]})):c.map(l=>i(l)),n=c=>(this.settings.max&&this.settings.max>0&&(c.length=this.settings.max),c);return this.aborter=new AbortController,this.aborterSignal=this.aborter.signal,new Promise(c=>{let l=d=>{d=this.sort(d,e),this.settings.cache!==!1&&this.caches.set(e.search,d),c(d)};if(br(this.items)){if(this.settings.minlength>0&&(!e.search||e.search.length<this.settings.minlength)){l([]);return}let d=this.formatSearch(this.items,e);fetch(d).then(p=>{if(p.status===200){p.json().then(h=>{h=s(h),l(n(h.filter(g=>this.isMatch(e,g))))});return}throw Error(`HTTP error ${p.status} - ${d}`)})}else if(Array.isArray(this.items)){let d=!0;this.items=this.items.map(p=>typeof p=="string"?{text:p}:(d=!1,p)),d&&this.container.classList.add("simple"),l(n(s(this.items)))}else if(typeof this.items=="function")e.control=this.container,Promise.resolve(this.items(e,t)).then(p=>{p=p.map(h=>i(h)),p=s(p),l(p)});else return l(Promise.resolve(this.items.apply(this,e)))})}async items(e){let t=[];e.results=[],e.signal=this.aborterSignal;for(var a in e.categories){let o=e.categories[a];if(o.trigger=o.trigger??(()=>!0),e.results=t,o.trigger(e)){let i=[];try{i=await o.getItems(e)}catch(s){console.warn(`Error loading items for omniBox category '${a}'.`,s)}t=t.concat(i.map(s=>(s.category=a,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(a){if(!e.search)return!0;if(a.hidden)return!1;let i=(t?a[t]:a).match(new RegExp(e.search,"gi"));if(i)return i;if(a.config?.tags)return a.config.tags.some(s=>s.match(new RegExp(e.search,"gi")))}}};function vr(r){function e(o,i,s){let n=o[0];if(n==="colors")return i==="scheme"?"string":"color";if(n==="spacing"||n==="radius"||n==="borderWidths")return"dimension";if(n==="typography"){let c=o[1];return c==="fontFamily"?"fontFamily":c==="fontSize"?"fontSize":c==="fontWeight"?"fontWeight":c==="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"||o.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(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function a(o,i=[]){if(o==null)return o;if(Array.isArray(o))return o.map((l,d)=>a(l,i.concat(String(d))));if(t(o)){if(Object.prototype.hasOwnProperty.call(o,"value")&&(Object.prototype.hasOwnProperty.call(o,"type")||Object.keys(o).length===1))return o;let l={};for(let[d,p]of Object.entries(o))l[d]=a(p,i.concat(d));return l}let s=i[i.length-1]??"",n=e(i,s,o),c=o;if(n==="number"&&typeof c=="string"){let l=Number(c);Number.isNaN(l)||(c=l)}return n?{value:c,type:n}:{value:c}}return a(r,[])}var wr="pure-ds-config";async function W(r,e={}){let t=document.querySelector("#global-toaster");return t||(t=document.createElement("pds-toaster"),t.id="global-toaster",document.body.appendChild(t),await customElements.whenDefined("pds-toaster")),t.toast(r,e)}customElements.define("pds-config-form",class extends R{#a;#e=0;#r=null;#s=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{m._applyResolvedTheme(m.theme),m._setupSystemListenerIfNeeded(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(C.default),e=new $({design:r}),t=e.generateSpacingTokens(r.spatialRhythm||{});Object.entries(t).forEach(([s,n])=>{try{this.style.setProperty(`--spacing-${s}`,n)}catch{}});let a=r.spatialRhythm&&r.spatialRhythm.baseUnit||16;this.style.setProperty("--base-unit",`${a}px`);let o=e.generateTypographyTokens(r.typography||{});o.fontSize&&Object.entries(o.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`),o.fontFamily&&Object.entries(o.fontFamily).forEach(([s,n])=>{this.style.setProperty(`--font-family-${s}`,n)}),o.lineHeight&&Object.entries(o.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 o=0;o<r.length;o++)if(!this._isEqual(r[o],e[o]))return!1;return!0}let t=Object.keys(r),a=Object.keys(e);t.length,a.length;for(let o of new Set([...t,...a]))if(!this._isEqual(r[o],e[o]))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={},a=new Set([...Object.keys(e)]);for(let o of a){let i=this._deepDiff(r[o],e[o]);i!==void 0&&(t[o]=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=C?.[e]||C?.default;return JSON.parse(JSON.stringify(t||C.default))}loadConfig(){let r=localStorage.getItem(wr);if(r)try{let e=JSON.parse(r);if(e&&("preset"in e||"design"in e)){let a=e.preset||"default",o=this._resolvePresetBase(a),i=Z(o,e.design||{});return this._stored={preset:a,design:e.design||{}},this._legacy=!1,i}let t=Z(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)||{},a={preset:r,design:t};localStorage.setItem(wr,JSON.stringify(a)),this._stored=a,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(C.default);if(r&&this.config){let o=this._stored&&this._stored.preset||"default",i=this._resolvePresetBase(o);e=Z(i,this.config)}if(e.typography)try{await je(e.typography)}catch(o){console.warn("Failed to load some fonts from Google Fonts:",o)}try{let o=He(e);if(!o.ok){if(this.validationIssues=o.issues,!this._validationToastId){let i=o.issues.slice(0,3).map(s=>`\u2022 ${s.message}`).join(`
3473
3473
  `);this._validationToastId=W(`Design has accessibility issues. Fix before applying.
3474
- ${a}`,{type:"error",persistent:!0})}return}this.validationIssues=[],this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch(o){console.warn("Validation failed unexpectedly:",o)}let t=m.theme||null,i={design:structuredClone(e)};t&&(i.theme=t),this.generator=new $(i),$.applyStyles();try{m._applyResolvedTheme(m.theme),m._setupSystemListenerIfNeeded(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.#o){t();return}if(!this.#r){let i=this.#o-(e-this.#e);this.#r=setTimeout(()=>{this.#r=null,t()},i)}}toggleInspectorMode(){this.inspectorMode=!this.inspectorMode,this.dispatchInspectorModeChange(),W(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[i,o]of Object.entries(r)){let a=e?`${e}/${i}`:`/${i}`;o&&typeof o=="object"&&!Array.isArray(o)?Object.assign(t,this.flattenConfig(o,a)):t[a]=o}return t}getSchemaProperties(r,e=""){let t=new Set;if(!r||!r.properties)return t;for(let[i,o]of Object.entries(r.properties)){let a=e?`${e}/${i}`:`/${i}`;t.add(a),o.type==="object"&&o.properties&&this.getSchemaProperties(o,a).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),i={};for(let[o,a]of Object.entries(t))e.has(o)&&a!==null&&a!==void 0&&(i[o]=a);return i}handleFormChange=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-JSONFORM"?r.currentTarget:this.querySelector("pds-jsonform");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 i={},o=n=>n.replace(/~1/g,"/").replace(/~0/g,"~");for(let[n,c]of Object.entries(e))if(n)if(n.startsWith("/")){let d=n.replace(/^\//,"").split("/").map(o),p=i;for(let h=0;h<d.length-1;h++){let g=d[h];(!p[g]||typeof p[g]!="object")&&(p[g]={}),p=p[g]}p[d[d.length-1]]=c}else if(n.includes(".")){let l=n.split("."),d=i;for(let p=0;p<l.length-1;p++)(!d[l[p]]||typeof d[l[p]]!="object")&&(d[l[p]]={}),d=d[l[p]];d[l[l.length-1]]=c}else i[n]=c;console.log("Nested values:",i);let a=Z(structuredClone(this.config),i),s=m.validateDesign(a);if(!s.ok){if(this.validationIssues=s.issues,!this._validationToastId){let n=s.issues.slice(0,3).map(c=>`\u2022 ${c.message}`).join(`
3474
+ ${i}`,{type:"error",persistent:!0})}return}this.validationIssues=[],this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch(o){console.warn("Validation failed unexpectedly:",o)}let t=m.theme||null,a={design:structuredClone(e)};t&&(a.theme=t),this.generator=new $(a),$.applyStyles();try{m._applyResolvedTheme(m.theme),m._setupSystemListenerIfNeeded(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.#o){t();return}if(!this.#r){let a=this.#o-(e-this.#e);this.#r=setTimeout(()=>{this.#r=null,t()},a)}}toggleInspectorMode(){this.inspectorMode=!this.inspectorMode,this.dispatchInspectorModeChange(),W(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[a,o]of Object.entries(r)){let i=e?`${e}/${a}`:`/${a}`;o&&typeof o=="object"&&!Array.isArray(o)?Object.assign(t,this.flattenConfig(o,i)):t[i]=o}return t}getSchemaProperties(r,e=""){let t=new Set;if(!r||!r.properties)return t;for(let[a,o]of Object.entries(r.properties)){let i=e?`${e}/${a}`:`/${a}`;t.add(i),o.type==="object"&&o.properties&&this.getSchemaProperties(o,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),a={};for(let[o,i]of Object.entries(t))e.has(o)&&i!==null&&i!==void 0&&(a[o]=i);return a}handleFormChange=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-JSONFORM"?r.currentTarget:this.querySelector("pds-jsonform");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 a={},o=n=>n.replace(/~1/g,"/").replace(/~0/g,"~");for(let[n,c]of Object.entries(e))if(n)if(n.startsWith("/")){let d=n.replace(/^\//,"").split("/").map(o),p=a;for(let h=0;h<d.length-1;h++){let g=d[h];(!p[g]||typeof p[g]!="object")&&(p[g]={}),p=p[g]}p[d[d.length-1]]=c}else if(n.includes(".")){let l=n.split("."),d=a;for(let p=0;p<l.length-1;p++)(!d[l[p]]||typeof d[l[p]]!="object")&&(d[l[p]]={}),d=d[l[p]];d[l[l.length-1]]=c}else a[n]=c;console.log("Nested values:",a);let i=Z(structuredClone(this.config),a),s=m.validateDesign(i);if(!s.ok){if(this.validationIssues=s.issues,!this._validationToastId){let n=s.issues.slice(0,3).map(c=>`\u2022 ${c.message}`).join(`
3475
3475
  `);this._validationToastId=W(`Design has accessibility issues. Fix before saving.
3476
- ${n}`,{type:"error"})}return}this.validationIssues=[];try{this._validationToastId&&(document.querySelector("#global-toaster")?.dismissToast(this._validationToastId),this._validationToastId=null)}catch{}this.config=a,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.#s&&(clearTimeout(this.#s),this.#s=null),this.#s=setTimeout(()=>{this.#s=null,this.applyStyles(!0)},this.#o)}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),W("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)),i=m.validateDesign(t);if(!i.ok){if(this.validationIssues=i.issues,!this._validationToastId){let o=i.issues.slice(0,3).map(a=>`\u2022 ${a.message}`).join(`
3476
+ ${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.#s&&(clearTimeout(this.#s),this.#s=null),this.#s=setTimeout(()=>{this.#s=null,this.applyStyles(!0)},this.#o)}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),W("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)),a=m.validateDesign(t);if(!a.ok){if(this.validationIssues=a.issues,!this._validationToastId){let o=a.issues.slice(0,3).map(i=>`\u2022 ${i.message}`).join(`
3477
3477
  `);this._validationToastId=W(`Preset "${r.name}" has accessibility issues \u2014 not applied.
3478
- ${o}`,{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),W(`"${r.name}" preset loaded successfully!`,{type:"success",duration:3e3})}};handleThemeChange(r){try{let e=r.target.value;m.theme=e,this.applyStyles(!0),W(`Theme set to ${e}`,{type:"info",duration:1200})}catch(e){console.warn("Failed to change theme:",e)}}handleDownload=r=>{let e,t,i;switch(r){case"css":e=this.generator.layeredCSS,t="pure-ds.css",i="text/css";break;case"config":e=`// Pure Design System Configuration
3478
+ ${o}`,{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),W(`"${r.name}" preset loaded successfully!`,{type:"success",duration:3e3})}};handleThemeChange(r){try{let e=r.target.value;m.theme=e,this.applyStyles(!0),W(`Theme set to ${e}`,{type:"info",duration:1200})}catch(e){console.warn("Failed to change theme:",e)}}handleDownload=r=>{let e,t,a;switch(r){case"css":e=this.generator.layeredCSS,t="pure-ds.css",a="text/css";break;case"config":e=`// Pure Design System Configuration
3479
3479
  // Generated: ${new Date().toISOString()}
3480
3480
 
3481
3481
  import { PDS } from 'pure-ds';
3482
3482
 
3483
3483
  export const pdsConfig = ${JSON.stringify(this.config,null,2)};
3484
- `,t="pds.config.js",i="text/javascript";break;case"tokens":let n=vr(this.generator.generateTokens());e=JSON.stringify(n,null,2),t="design-tokens.json",i="application/json";break}let o=new Blob([e],{type:i}),a=URL.createObjectURL(o),s=document.createElement("a");s.href=a,s.download=t,s.click(),URL.revokeObjectURL(a)};render(){return this.schema?S`
3484
+ `,t="pds.config.js",a="text/javascript";break;case"tokens":let n=vr(this.generator.generateTokens());e=JSON.stringify(n,null,2),t="design-tokens.json",a="application/json";break}let o=new Blob([e],{type:a}),i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=t,s.click(),URL.revokeObjectURL(i)};render(){return this.schema?S`
3485
3485
  <div class="designer-container">
3486
3486
  <div class="designer-toolbar">
3487
3487
  <label data-toggle id="mode-toggle">
@@ -3559,7 +3559,7 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
3559
3559
  <div class="input-icon">
3560
3560
  <pds-icon icon="magnifying-glass"></pds-icon>
3561
3561
  <input
3562
- @focus=${r=>ae.connect(r,this.presetAutoCompleteSettings)}
3562
+ @focus=${r=>ie.connect(r,this.presetAutoCompleteSettings)}
3563
3563
  id="preset-search"
3564
3564
  type="search"
3565
3565
  placeholder="Start typing to search all presets..."
@@ -3629,18 +3629,18 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
3629
3629
  <span style="background-color: ${e.colors.primary}"></span>
3630
3630
  <span style="background-color: ${e.colors.secondary}"></span>
3631
3631
  <span style="background-color: ${e.colors.accent}"></span>
3632
- </span>`},categories:{Presets:{action:r=>{let e=m.presets[r.id];this.applyPreset(e)},getItems:r=>{let t=Object.values(m.presets),i=[];if(r.search.length>0){let o=0;i=t.filter(a=>(o++,o<=10&&a.name.toLowerCase().includes(r.search.toLowerCase())||a.description&&a.description.toLowerCase().includes(r.search.toLowerCase())))}else i=t.filter(o=>o.tags?.includes("featured")).slice(0,10);return i.map(o=>({id:o.id,text:o.name,description:o.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}});var ee=(r,e)=>{document.getElementById("global-toaster").toast(r,e)};customElements.define("pds-demo",class extends F{#i=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 i=await fetch(t,{cache:"no-cache"});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);let o=await i.text(),a=await this.getShowdownConverter();return a?a.makeHtml(o):`<pre>${this.escapeHTML(o)}</pre>`}catch(i){return`<p>Failed to load ${r} from ${e}: ${String(i.message||i)}</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">
3632
+ </span>`},categories:{Presets:{action:r=>{let e=m.presets[r.id];this.applyPreset(e)},getItems:r=>{let t=Object.values(m.presets),a=[];if(r.search.length>0){let o=0;a=t.filter(i=>(o++,o<=10&&i.name.toLowerCase().includes(r.search.toLowerCase())||i.description&&i.description.toLowerCase().includes(r.search.toLowerCase())))}else a=t.filter(o=>o.tags?.includes("featured")).slice(0,10);return a.map(o=>({id:o.id,text:o.name,description:o.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}});var ee=(r,e)=>{document.getElementById("global-toaster").toast(r,e)};customElements.define("pds-demo",class extends R{#a=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 a=await fetch(t,{cache:"no-cache"});if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);let o=await a.text(),i=await this.getShowdownConverter();return i?i.makeHtml(o):`<pre>${this.escapeHTML(o)}</pre>`}catch(a){return`<p>Failed to load ${r} from ${e}: ${String(a.message||a)}</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">
3633
3633
  <div class="markdown-body"></div>
3634
- </div>`,document.body.appendChild(t));let i=t.querySelector(".markdown-body");i&&(i.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"),o=e.querySelector("h2")?.textContent?.trim()||t;return{id:t,title:o}})}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",i=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 o=this.findEnhancedElement(e);if(o)return{element:o,componentType:"enhanced-component",displayName:this.getEnhancedElementName(o)};let a=["FIGURE","TABLE","DETAILS","VIDEO","AUDIO","PICTURE","BLOCKQUOTE","PRE","CODE"];if(a.includes(e.tagName))return{element:e,componentType:"html-primitive",displayName:e.tagName.toLowerCase()};for(let p of a){let h=e.closest(p.toLowerCase());if(h)return{element:h,componentType:"html-primitive",displayName:p.toLowerCase()}}let s=this.findPDSStyledElement(e);if(s)return s;if(e.tagName==="FIELDSET"){let p=e.getAttribute("role");if(p==="group"||p==="radiogroup")return t="form-group",i=p==="radiogroup"?"radio group":"form group",{element:e,componentType:t,displayName:i}}let n=e.closest('fieldset[role="group"], fieldset[role="radiogroup"]');if(n){let p=n.getAttribute("role");return{element:n,componentType:"form-group",displayName:p==="radiogroup"?"radio group":"form group"}}if(e.tagName==="LABEL"||e.closest("label")){let p=e.tagName==="LABEL"?e:e.closest("label"),h=p.querySelector("input, select, textarea");if(h)return t="form-control",i=`${h.tagName.toLowerCase()} field`,{element:p,componentType:t,displayName:i}}if(["INPUT","SELECT","TEXTAREA"].includes(e.tagName)){let p=e.closest("label");return p?(e=p,t="form-control",i=`${r.tagName.toLowerCase()} field`,{element:e,componentType:t,displayName:i}):(t="form-control",i=`${e.tagName.toLowerCase()}`,{element:e,componentType:t,displayName:i})}if(e.tagName.includes("-"))return t="web-component",i=e.tagName.toLowerCase(),{element:e,componentType:t,displayName:i};let c=e.closest("[tagName*='-']");if(c&&c.tagName.includes("-"))return{element:c,componentType:"web-component",displayName:c.tagName.toLowerCase()};if(e.tagName==="BUTTON"||e.closest("button"))return e=e.tagName==="BUTTON"?e:e.closest("button"),t="button",i=e.querySelector("pds-icon")?"button with icon":"button",{element:e,componentType:t,displayName:i};if(e.tagName==="pds-icon"||e.closest("pds-icon"))return e=e.tagName==="pds-icon"?e:e.closest("pds-icon"),t="icon",i=`pds-icon (${e.getAttribute("icon")||"unknown"})`,{element:e,componentType:t,displayName:i};if(e.tagName==="NAV"||e.closest("nav[data-dropdown]"))return e=e.closest("nav[data-dropdown]")||e,t="navigation",i="dropdown menu",{element:e,componentType:t,displayName:i};let l=["color-card","color-scale","grid","flex-wrap","btn-group"];for(let p of l){if(e.classList.contains(p))return t="container",i=p.replace(/-/g," "),{element:e,componentType:t,displayName:i};let h=e.closest(`.${p}`);if(h)return e=h,t="container",i=p.replace(/-/g," "),{element:e,componentType:t,displayName:i}}let d=this.findNearestComponent(e);return d&&d!==e?this.detectComponentElement(d):{element:e,componentType:t,displayName:i}}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 i=r.closest(t);if(i)return i}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,i=5;for(;e&&t<i;){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","alert","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(i=>t.startsWith(i)))}extractHTML(r){let e=r.cloneNode(!0);[e,...e.querySelectorAll("*")].forEach(a=>{a.removeAttribute&&(a.removeAttribute("_$litPart$"),a.removeAttribute("_$litElement$"))});let i=this.formatHTMLElement(e),o=this.extractLitProperties(r);return{html:i,litProps:o}}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(i=>{r[i]!==void 0&&typeof r[i]!="function"&&e.push({name:`.${i}`,value:r[i]})})}return e}formatHTMLElement(r,e=0){let t=s=>" ".repeat(s),i="",o=s=>s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),a=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)+o(s)+`
3634
+ </div>`,document.body.appendChild(t));let a=t.querySelector(".markdown-body");a&&(a.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"),o=e.querySelector("h2")?.textContent?.trim()||t;return{id:t,title:o}})}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",a=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 o=this.findEnhancedElement(e);if(o)return{element:o,componentType:"enhanced-component",displayName:this.getEnhancedElementName(o)};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 p of i){let h=e.closest(p.toLowerCase());if(h)return{element:h,componentType:"html-primitive",displayName:p.toLowerCase()}}let s=this.findPDSStyledElement(e);if(s)return s;if(e.tagName==="FIELDSET"){let p=e.getAttribute("role");if(p==="group"||p==="radiogroup")return t="form-group",a=p==="radiogroup"?"radio group":"form group",{element:e,componentType:t,displayName:a}}let n=e.closest('fieldset[role="group"], fieldset[role="radiogroup"]');if(n){let p=n.getAttribute("role");return{element:n,componentType:"form-group",displayName:p==="radiogroup"?"radio group":"form group"}}if(e.tagName==="LABEL"||e.closest("label")){let p=e.tagName==="LABEL"?e:e.closest("label"),h=p.querySelector("input, select, textarea");if(h)return t="form-control",a=`${h.tagName.toLowerCase()} field`,{element:p,componentType:t,displayName:a}}if(["INPUT","SELECT","TEXTAREA"].includes(e.tagName)){let p=e.closest("label");return p?(e=p,t="form-control",a=`${r.tagName.toLowerCase()} field`,{element:e,componentType:t,displayName:a}):(t="form-control",a=`${e.tagName.toLowerCase()}`,{element:e,componentType:t,displayName:a})}if(e.tagName.includes("-"))return t="web-component",a=e.tagName.toLowerCase(),{element:e,componentType:t,displayName:a};let c=e.closest("[tagName*='-']");if(c&&c.tagName.includes("-"))return{element:c,componentType:"web-component",displayName:c.tagName.toLowerCase()};if(e.tagName==="BUTTON"||e.closest("button"))return e=e.tagName==="BUTTON"?e:e.closest("button"),t="button",a=e.querySelector("pds-icon")?"button with icon":"button",{element:e,componentType:t,displayName:a};if(e.tagName==="pds-icon"||e.closest("pds-icon"))return e=e.tagName==="pds-icon"?e:e.closest("pds-icon"),t="icon",a=`pds-icon (${e.getAttribute("icon")||"unknown"})`,{element:e,componentType:t,displayName:a};if(e.tagName==="NAV"||e.closest("nav[data-dropdown]"))return e=e.closest("nav[data-dropdown]")||e,t="navigation",a="dropdown menu",{element:e,componentType:t,displayName:a};let l=["color-card","color-scale","grid","flex-wrap","btn-group"];for(let p of l){if(e.classList.contains(p))return t="container",a=p.replace(/-/g," "),{element:e,componentType:t,displayName:a};let h=e.closest(`.${p}`);if(h)return e=h,t="container",a=p.replace(/-/g," "),{element:e,componentType:t,displayName:a}}let d=this.findNearestComponent(e);return d&&d!==e?this.detectComponentElement(d):{element:e,componentType:t,displayName:a}}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 a=r.closest(t);if(a)return a}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,a=5;for(;e&&t<a;){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","alert","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(a=>t.startsWith(a)))}extractHTML(r){let e=r.cloneNode(!0);[e,...e.querySelectorAll("*")].forEach(i=>{i.removeAttribute&&(i.removeAttribute("_$litPart$"),i.removeAttribute("_$litElement$"))});let a=this.formatHTMLElement(e),o=this.extractLitProperties(r);return{html:a,litProps:o}}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(a=>{r[a]!==void 0&&typeof r[a]!="function"&&e.push({name:`.${a}`,value:r[a]})})}return e}formatHTMLElement(r,e=0){let t=s=>" ".repeat(s),a="",o=s=>s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),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)+o(s)+`
3635
3635
  `}if(r.nodeType===Node.COMMENT_NODE)return t(e)+`<!-- ${o(r.textContent)} -->
3636
- `;if(r.nodeType===Node.ELEMENT_NODE){let s=r.tagName.toLowerCase(),n=[],c=new Set(["data-label","data-toggle"]);for(let d of r.attributes){let p=d.name,h=d.value;if(c.has(p)){n.push(p);continue}h===""?p.startsWith("data-")?n.push(`${p}=""`):n.push(p):n.push(`${p}="${o(h)}"`)}let l=n.length?" "+n.join(" "):"";i+=t(e)+`<${s}${l}>
3637
- `;for(let d of Array.from(r.childNodes))i+=this.formatHTMLElement(d,e+1);return a(s)||(i+=t(e)+`</${s}>
3638
- `),i}return""}handleInspectorClick(r){if(!this.inspectorActive)return;r.preventDefault(),r.stopPropagation();let e=this.detectComponentElement(r.target);if(!e)return;let{element:t,componentType:i,displayName:o}=e;this.deactivateInspector();let a=null,s=null;try{s=(this.config?.autoDefine?.enhancers||(typeof appConfig<"u"?appConfig?.autoDefine?.enhancers:null)||(typeof window<"u"?window?.appConfig?.autoDefine?.enhancers:null)||document.querySelector&&document.querySelector("pure-app")?.config?.autoDefine?.enhancers||[]).find(d=>{try{return t.matches&&t.matches(d.selector)||t.closest&&t.closest(d.selector)}catch{return!1}})}catch{s=null}let n=[],c=null;if(s&&s.demoHtml){if(a=typeof s.demoHtml=="function"?s.demoHtml(t):s.demoHtml,typeof a=="string")try{let l=document.createElement("div");l.innerHTML=a.trim();let d="";for(let p of Array.from(l.childNodes))d+=this.formatHTMLElement(p);c=d}catch{c=a}else a instanceof Node?c=this.formatHTMLElement(a):c=String(a);n=this.extractLitProperties(t)}else{let l=this.extractHTML(t);c=l.html,n=l.litProps}this.showCodeDrawer(c,n,o,i)}async showCodeDrawer(r,e,t,i){let o=document.querySelector("#global-drawer"),a=S`
3636
+ `;if(r.nodeType===Node.ELEMENT_NODE){let s=r.tagName.toLowerCase(),n=[],c=new Set(["data-label","data-toggle"]);for(let d of r.attributes){let p=d.name,h=d.value;if(c.has(p)){n.push(p);continue}h===""?p.startsWith("data-")?n.push(`${p}=""`):n.push(p):n.push(`${p}="${o(h)}"`)}let l=n.length?" "+n.join(" "):"";a+=t(e)+`<${s}${l}>
3637
+ `;for(let d of Array.from(r.childNodes))a+=this.formatHTMLElement(d,e+1);return i(s)||(a+=t(e)+`</${s}>
3638
+ `),a}return""}handleInspectorClick(r){if(!this.inspectorActive)return;r.preventDefault(),r.stopPropagation();let e=this.detectComponentElement(r.target);if(!e)return;let{element:t,componentType:a,displayName:o}=e;this.deactivateInspector();let i=null,s=null;try{s=(this.config?.autoDefine?.enhancers||(typeof appConfig<"u"?appConfig?.autoDefine?.enhancers:null)||(typeof window<"u"?window?.appConfig?.autoDefine?.enhancers:null)||document.querySelector&&document.querySelector("pure-app")?.config?.autoDefine?.enhancers||[]).find(d=>{try{return t.matches&&t.matches(d.selector)||t.closest&&t.closest(d.selector)}catch{return!1}})}catch{s=null}let n=[],c=null;if(s&&s.demoHtml){if(i=typeof s.demoHtml=="function"?s.demoHtml(t):s.demoHtml,typeof i=="string")try{let l=document.createElement("div");l.innerHTML=i.trim();let d="";for(let p of Array.from(l.childNodes))d+=this.formatHTMLElement(p);c=d}catch{c=i}else i instanceof Node?c=this.formatHTMLElement(i):c=String(i);n=this.extractLitProperties(t)}else{let l=this.extractHTML(t);c=l.html,n=l.litProps}this.showCodeDrawer(c,n,o,a)}async showCodeDrawer(r,e,t,a){let o=document.querySelector("#global-drawer"),i=S`
3639
3639
  <div class="code-drawer-header">
3640
3640
  <div class="code-drawer-title">
3641
3641
  <pds-icon icon="code" size="sm"></pds-icon>
3642
3642
  <span>${t}</span>
3643
- <span class="component-type-badge">${i}</span>
3643
+ <span class="component-type-badge">${a}</span>
3644
3644
  </div>
3645
3645
  <button class="copy-code-btn" id="copyCodeBtn">
3646
3646
  <pds-icon icon="clipboard" size="sm"></pds-icon>
@@ -3668,12 +3668,12 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
3668
3668
  class="code-block"
3669
3669
  ><code class="language-html">Loading syntax highlighting...</code></pre>
3670
3670
  </div>
3671
- `;await o.show(n,{header:a});let c=await this.highlightWithShiki(r),l=S`
3671
+ `;await o.show(n,{header:i});let c=await this.highlightWithShiki(r),l=S`
3672
3672
  ${s}
3673
3673
  <div class="code-block-wrapper">
3674
- <pre class="code-block"><code class="language-html">${Fe(c)}</code></pre>
3674
+ <pre class="code-block"><code class="language-html">${Re(c)}</code></pre>
3675
3675
  </div>
3676
- `;await document.getElementById("global-drawer").show(l,{header:a}),setTimeout(()=>{let p=document.getElementById("global-drawer")?.querySelector("#copyCodeBtn");p&&(p.onclick=()=>{let h=r;e.length>0&&(h=`<!-- Lit Properties:
3676
+ `;await document.getElementById("global-drawer").show(l,{header:i}),setTimeout(()=>{let p=document.getElementById("global-drawer")?.querySelector("#copyCodeBtn");p&&(p.onclick=()=>{let h=r;e.length>0&&(h=`<!-- Lit Properties:
3677
3677
  `+e.map(g=>` ${g.name}=${JSON.stringify(g.value)}`).join(`
3678
3678
  `)+`
3679
3679
  -->
@@ -3684,7 +3684,7 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
3684
3684
  `,setTimeout(()=>{p.innerHTML=`
3685
3685
  <pds-icon icon="clipboard" size="sm"></pds-icon>
3686
3686
  Copy HTML
3687
- `},2e3)})})},100)}async loadShiki(){if(this.#i)return this.#i;if(this.#e){for(;this.#e;)await new Promise(r=>setTimeout(r,100));return this.#i}this.#e=!0;try{let r=await import("https://esm.sh/shiki@1.0.0");return this.#i=await r.getHighlighter({themes:["dark-plus"],langs:["html"]}),this.#i}catch(r){return console.error("Failed to load Shiki:",r),null}finally{this.#e=!1}}async highlightWithShiki(r){let e=await this.loadShiki();if(!e)return this.escapeHTML(r);try{let i=e.codeToHtml(r,{lang:"html",theme:"dark-plus"}).match(/<code[^>]*>([\s\S]*)<\/code>/);return i?i[1]:this.escapeHTML(r)}catch(t){return console.error("Shiki highlighting failed:",t),this.escapeHTML(r)}}escapeHTML(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}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,i)=>{if(document.querySelector(`script[data-lib="${e}"][src="${r}"]`)){setTimeout(t,0);return}let o=document.createElement("script");o.src=r,o.async=!0,o.defer=!0,o.dataset.lib=e||"lib",o.onload=()=>t(),o.onerror=()=>{o.remove(),i(new Error(`Failed to load script: ${r}`))},document.head.appendChild(o)})}scrollToRelevantSection(r){console.log("\u{1F3AF} 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":"alerts","components/badges":"badges","components/tables":"tables","components/toasts":"toasts","components/modals":"modals","components/tabStrip":"tabs","icons/":"icons"},i=null;for(let[o,a]of Object.entries(t))if(e.startsWith(o)){i=a,console.log(` \u2713 Matched pattern "${o}" \u2192 section "${a}"`);break}if(i){let o=this.querySelector(`[data-section="${i}"]`);console.log(` Searching for section: [data-section="${i}"]`,o?"\u2713 Found":"\u2717 Not found"),o?(o.scrollIntoView({behavior:"smooth",block:"start"}),o.style.transition="background-color 0.3s ease",o.style.backgroundColor="var(--color-primary-50)",setTimeout(()=>{o.style.backgroundColor=""},1500),console.log(" \u2713 Scrolled and highlighted section")):console.warn(` \u2717 Section [data-section="${i}"] not found in DOM`)}else console.warn(` \u2717 No section mapping found for field: ${r}`)}renderDisabledSection(r,e){return S`
3687
+ `},2e3)})})},100)}async loadShiki(){if(this.#a)return this.#a;if(this.#e){for(;this.#e;)await new Promise(r=>setTimeout(r,100));return this.#a}this.#e=!0;try{let r=await import("https://esm.sh/shiki@1.0.0");return this.#a=await r.getHighlighter({themes:["dark-plus"],langs:["html"]}),this.#a}catch(r){return console.error("Failed to load Shiki:",r),null}finally{this.#e=!1}}async highlightWithShiki(r){let e=await this.loadShiki();if(!e)return this.escapeHTML(r);try{let a=e.codeToHtml(r,{lang:"html",theme:"dark-plus"}).match(/<code[^>]*>([\s\S]*)<\/code>/);return a?a[1]:this.escapeHTML(r)}catch(t){return console.error("Shiki highlighting failed:",t),this.escapeHTML(r)}}escapeHTML(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}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,a)=>{if(document.querySelector(`script[data-lib="${e}"][src="${r}"]`)){setTimeout(t,0);return}let o=document.createElement("script");o.src=r,o.async=!0,o.defer=!0,o.dataset.lib=e||"lib",o.onload=()=>t(),o.onerror=()=>{o.remove(),a(new Error(`Failed to load script: ${r}`))},document.head.appendChild(o)})}scrollToRelevantSection(r){console.log("\u{1F3AF} 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":"alerts","components/badges":"badges","components/tables":"tables","components/toasts":"toasts","components/modals":"modals","components/tabStrip":"tabs","icons/":"icons"},a=null;for(let[o,i]of Object.entries(t))if(e.startsWith(o)){a=i,console.log(` \u2713 Matched pattern "${o}" \u2192 section "${i}"`);break}if(a){let o=this.querySelector(`[data-section="${a}"]`);console.log(` Searching for section: [data-section="${a}"]`,o?"\u2713 Found":"\u2717 Not found"),o?(o.scrollIntoView({behavior:"smooth",block:"start"}),o.style.transition="background-color 0.3s ease",o.style.backgroundColor="var(--color-primary-50)",setTimeout(()=>{o.style.backgroundColor=""},1500),console.log(" \u2713 Scrolled and highlighted section")):console.warn(` \u2717 Section [data-section="${a}"] not found in DOM`)}else console.warn(` \u2717 No section mapping found for field: ${r}`)}renderDisabledSection(r,e){return S`
3688
3688
  <section class="showcase-section disabled">
3689
3689
  <h2>${r}</h2>
3690
3690
  <p class="disabled-message">${e}</p>
@@ -3696,14 +3696,14 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
3696
3696
  <pds-icon icon="magnifying-glass"></pds-icon>
3697
3697
  <input
3698
3698
  id="pds-search"
3699
- @focus=${r=>ae.connect(r,this.autoCompleteSettings)}
3699
+ @focus=${r=>ie.connect(r,this.autoCompleteSettings)}
3700
3700
  type="search"
3701
3701
  placeholder="Search design system..."
3702
3702
  />
3703
3703
  </div>
3704
3704
  </div>
3705
3705
  </nav>
3706
- `}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 i=document.querySelector(`[data-section="${t}"]`);i&&i.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(i=>({text:i.text,id:i.value,icon:i.icon||"magnifying-glass",category:i.category,code:i.code,cssVar:i.cssVar,description:i.description}))}catch(t){return console.error("Query error:",t),[]}}},Search:{action:r=>{let e=r.id||"",t=(r.search||"").toLowerCase(),[i,o]=e.split("|"),a=this.sections.find(s=>s.id===o);if(a||(a=this.sections.find(s=>s.title?.toLowerCase().includes(o?.toLowerCase?.()||"")||s.id?.toLowerCase().includes(o?.toLowerCase?.()||"")||s.title?.toLowerCase().includes(t)||s.id?.toLowerCase().includes(t))),!a&&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)){a=s;break}}if(a){let s=this.querySelector(`[data-section="${a.id}"]`);s&&s.scrollIntoView({behavior:"smooth",block:"start"})}else if((this.innerText||"").toLowerCase().indexOf(t)!==-1)for(let c of this.sections){let l=this.querySelector(`[data-section="${c.id}"]`);if(l&&(l.innerText||"").toLowerCase().includes(t)){l.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 o of m.ontology.primitives||[]){let a=(o.name||o.id||"").toString(),s=o.id||a.replace(/\s+/g,"-").toLowerCase(),n=(a.toLowerCase().includes(e)?30:0)+(s.includes(e)?20:0),c=(o.selectors||[]).some(d=>String(d).toLowerCase().includes(e)),l=n+(c?10:0);t.push({type:"primitive",key:s,name:a,score:l})}for(let o of m.ontology.components||[]){let a=(o.name||o.id||"").toString(),s=o.id||a.replace(/\s+/g,"-").toLowerCase(),n=(a.toLowerCase().includes(e)?40:0)+(s.includes(e)?25:0),c=(o.selectors||[]).some(d=>String(d).toLowerCase().includes(e)),l=n+(c?10:0);t.push({type:"component",key:s,name:a,score:l})}if(m.ontology.tokens){for(let[o,a]of Object.entries(m.ontology.tokens))if(Array.isArray(a))for(let s of a){let n=`${o}/${s}`,c=`${o}-${s}`,l=n.toLowerCase().includes(e)?35:0;t.push({type:"token",key:c,name:n,score:l})}}for(let o of m.ontology.enhancements||[]){let a=String(o),s=`enh-${a.replace(/[^a-z0-9]+/gi,"-")}`.toLowerCase(),n=a.toLowerCase().includes(e)?25:0;t.push({type:"enhancement",key:s,name:a,score:n})}for(let o of m.ontology.utilities||[]){let a=String(o),s=`util-${a.replace(/[^a-z0-9]+/gi,"-")}`.toLowerCase(),n=a.toLowerCase().includes(e)?20:0;t.push({type:"utility",key:s,name:a,score:n})}if(m.ontology.styles)for(let[o,a]of Object.entries(m.ontology.styles)){let s=o,n=`style-${o}`,c=s.toLowerCase().includes(e)?10:0;t.push({type:"style",key:n,name:s,score:c})}for(let o of t){let a=(o.name||"").toLowerCase(),s=(o.key||"").toLowerCase();a.includes(e)&&(o.score+=50),s.includes(e)&&(o.score+=20)}return t.filter(o=>o.score>0).sort((o,a)=>a.score-o.score).slice(0,30).map(o=>({text:o.name,id:`${o.type}|${o.key}`,icon:o.type==="component"?"brackets-curly":o.type==="primitive"?"tag":o.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",i=e==="dark"?"light surface in dark mode":"dark surface in light mode";return S`
3706
+ `}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 a=document.querySelector(`[data-section="${t}"]`);a&&a.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(a=>({text:a.text,id:a.value,icon:a.icon||"magnifying-glass",category:a.category,code:a.code,cssVar:a.cssVar,description:a.description}))}catch(t){return console.error("Query error:",t),[]}}},Search:{action:r=>{let e=r.id||"",t=(r.search||"").toLowerCase(),[a,o]=e.split("|"),i=this.sections.find(s=>s.id===o);if(i||(i=this.sections.find(s=>s.title?.toLowerCase().includes(o?.toLowerCase?.()||"")||s.id?.toLowerCase().includes(o?.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 c of this.sections){let l=this.querySelector(`[data-section="${c.id}"]`);if(l&&(l.innerText||"").toLowerCase().includes(t)){l.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 o of m.ontology.primitives||[]){let i=(o.name||o.id||"").toString(),s=o.id||i.replace(/\s+/g,"-").toLowerCase(),n=(i.toLowerCase().includes(e)?30:0)+(s.includes(e)?20:0),c=(o.selectors||[]).some(d=>String(d).toLowerCase().includes(e)),l=n+(c?10:0);t.push({type:"primitive",key:s,name:i,score:l})}for(let o of m.ontology.components||[]){let i=(o.name||o.id||"").toString(),s=o.id||i.replace(/\s+/g,"-").toLowerCase(),n=(i.toLowerCase().includes(e)?40:0)+(s.includes(e)?25:0),c=(o.selectors||[]).some(d=>String(d).toLowerCase().includes(e)),l=n+(c?10:0);t.push({type:"component",key:s,name:i,score:l})}if(m.ontology.tokens){for(let[o,i]of Object.entries(m.ontology.tokens))if(Array.isArray(i))for(let s of i){let n=`${o}/${s}`,c=`${o}-${s}`,l=n.toLowerCase().includes(e)?35:0;t.push({type:"token",key:c,name:n,score:l})}}for(let o of m.ontology.enhancements||[]){let i=String(o),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 o of m.ontology.utilities||[]){let i=String(o),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[o,i]of Object.entries(m.ontology.styles)){let s=o,n=`style-${o}`,c=s.toLowerCase().includes(e)?10:0;t.push({type:"style",key:n,name:s,score:c})}for(let o of t){let i=(o.name||"").toLowerCase(),s=(o.key||"").toLowerCase();i.includes(e)&&(o.score+=50),s.includes(e)&&(o.score+=20)}return t.filter(o=>o.score>0).sort((o,i)=>i.score-o.score).slice(0,30).map(o=>({text:o.name,id:`${o.type}|${o.key}`,icon:o.type==="component"?"brackets-curly":o.type==="primitive"?"tag":o.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",a=e==="dark"?"light surface in dark mode":"dark surface in light mode";return S`
3707
3707
  <div
3708
3708
  class="showcase-container ${this.inspectorActive?"inspector-active":""}"
3709
3709
  @click=${this.handleInspectorClick}
@@ -4231,11 +4231,11 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
4231
4231
  <h3>Netflix Row</h3>
4232
4232
 
4233
4233
  <pds-scrollrow>
4234
- ${new Array(20).fill(0).map((o,a)=>S`<img
4234
+ ${new Array(20).fill(0).map((o,i)=>S`<img
4235
4235
  loading="lazy"
4236
4236
  class="scroll-row-image"
4237
- src="https://picsum.photos/200/200?random=${a+1}"
4238
- alt="Gallery image ${a+1}"
4237
+ src="https://picsum.photos/200/200?random=${i+1}"
4238
+ alt="Gallery image ${i+1}"
4239
4239
  />`)}
4240
4240
  </pds-scrollrow>
4241
4241
 
@@ -4907,7 +4907,7 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
4907
4907
 
4908
4908
  <p>
4909
4909
  The smart surface system automatically inverts text and icon
4910
- colors when you use a ${i} (or vice versa). Toggle
4910
+ colors when you use a ${a} (or vice versa). Toggle
4911
4911
  dark mode to see the magic!
4912
4912
  </p>
4913
4913
 
@@ -5596,7 +5596,7 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
5596
5596
  handling in the design system.
5597
5597
  </figcaption>
5598
5598
  </figure>
5599
- `}async showDoc(r){let e=`/${r}`;try{let o=(await(await fetch(e,{cache:"no-store"})).text()).trim(),a;if(o.startsWith("<"))a=`<div class="docs-error">Failed to load README at ${e}. Ensure readme.md exists under public/</div>`;else try{let n=await this.getShowdownConverter();a=n?n.makeHtml(o):`<pre>${this.escapeHTML(o)}</pre>`}catch{a=`<pre>${this.escapeHTML(o)}</pre>`}document.getElementById("global-drawer").show(S`${Fe(a)}`,{header:S`<h3>PDS Documentation</h3>`})}catch(t){console.error("Error fetching README:",t),document.getElementById("global-toaster").toast("Error loading docs. See console.",{type:"danger"})}}handleTabChange(r){ee(`Switched to tab: ${r.detail.newTab}`,{type:"info"})}openDrawer(){document.getElementById("global-drawer").show(S`
5599
+ `}async showDoc(r){let e=`/${r}`;try{let o=(await(await fetch(e,{cache:"no-store"})).text()).trim(),i;if(o.startsWith("<"))i=`<div class="docs-error">Failed to load README at ${e}. Ensure readme.md exists under public/</div>`;else try{let n=await this.getShowdownConverter();i=n?n.makeHtml(o):`<pre>${this.escapeHTML(o)}</pre>`}catch{i=`<pre>${this.escapeHTML(o)}</pre>`}document.getElementById("global-drawer").show(S`${Re(i)}`,{header:S`<h3>PDS Documentation</h3>`})}catch(t){console.error("Error fetching README:",t),document.getElementById("global-toaster").toast("Error loading docs. See console.",{type:"danger"})}}handleTabChange(r){ee(`Switched to tab: ${r.detail.newTab}`,{type:"info"})}openDrawer(){document.getElementById("global-drawer").show(S`
5600
5600
  <figure class="media-figure">
5601
5601
  <img
5602
5602
  class="media-image"
@@ -5644,8 +5644,8 @@ export const pdsConfig = ${JSON.stringify(this.config,null,2)};
5644
5644
  background: var(--color-${r}-${e});
5645
5645
  color: ${t};
5646
5646
  "
5647
- @mouseover="${i=>{i.currentTarget.style.transform="translateY(-4px)",i.currentTarget.style.zIndex="10",i.currentTarget.style.boxShadow="var(--shadow-md)"}}"
5648
- @mouseout="${i=>{i.currentTarget.style.transform="translateY(0)",i.currentTarget.style.zIndex="1",i.currentTarget.style.boxShadow="none"}}"
5647
+ @mouseover="${a=>{a.currentTarget.style.transform="translateY(-4px)",a.currentTarget.style.zIndex="10",a.currentTarget.style.boxShadow="var(--shadow-md)"}}"
5648
+ @mouseout="${a=>{a.currentTarget.style.transform="translateY(0)",a.currentTarget.style.zIndex="1",a.currentTarget.style.boxShadow="none"}}"
5649
5649
  title="${r}-${e}"
5650
5650
  >
5651
5651
  ${e}