@pure-ds/core 0.3.1 → 0.3.2

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,4 +1,4 @@
1
- var Tt=Object.defineProperty;var Lt=(n,e)=>()=>(n&&(e=n(n=0)),e);var We=(n,e)=>{for(var t in e)Tt(n,t,{get:e[t],enumerable:!0})};var xt={};We(xt,{AutoDefiner:()=>Te});async function ir(...n){let e={};n.length&&typeof n[n.length-1]=="object"&&(e=n.pop()||{});let t=n,{baseURL:o,mapper:r=l=>`${l}.js`,onError:a=(l,d)=>console.error(`[defineWebComponents] ${l}:`,d)}=e,i=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),s=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=r(l),h=await import(d instanceof URL?d.href:new URL(d,i).href),g=h?.default??h?.[s(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 "${s(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 Te,wt=Lt(()=>{Te=class{constructor(e={}){let{baseURL:t,mapper:o,onError:r,predicate:a=()=>!0,attributeModule:i="data-module",root:s=document,scanExisting:c=!0,debounceMs:l=16,observeShadows:d=!0,enhancers:p=[],patchAttachShadow:h=!0}=e,g=new Set,x=new Set,f=new Set,b=new Map,E=new WeakMap,F=new WeakMap,_=0,S=!1,$=null,z=y=>{if(!y||!p.length)return;let w=F.get(y);w||(w=new Set,F.set(y,w));for(let v of p)if(!(!v.selector||!v.run)&&!w.has(v.selector))try{y.matches&&y.matches(v.selector)&&(v.run(y),w.add(v.selector))}catch(A){console.warn(`[AutoDefiner] Error applying enhancer for selector "${v.selector}":`,A)}},T=(y,w)=>{if(!S&&!(!y||!y.includes("-"))&&!customElements.get(y)&&!x.has(y)&&!f.has(y)){if(w&&w.getAttribute){let v=w.getAttribute(i);v&&!b.has(y)&&b.set(y,v)}g.add(y),me()}},me=()=>{_||(_=setTimeout(Pe,l))},M=y=>{if(y){if(y.nodeType===1){let w=y,v=w.tagName?.toLowerCase();v&&v.includes("-")&&!customElements.get(v)&&a(v,w)&&T(v,w),z(w),d&&w.shadowRoot&&fe(w.shadowRoot)}y.querySelectorAll&&y.querySelectorAll("*").forEach(w=>{let v=w.tagName?.toLowerCase();v&&v.includes("-")&&!customElements.get(v)&&a(v,w)&&T(v,w),z(w),d&&w.shadowRoot&&fe(w.shadowRoot)})}},fe=y=>{if(!y||E.has(y))return;M(y);let w=new MutationObserver(v=>{for(let A of v)A.addedNodes?.forEach(O=>{M(O)}),A.type==="attributes"&&A.target&&M(A.target)});w.observe(y,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[i,...p.map(v=>v.selector).filter(v=>v.startsWith("data-"))]}),E.set(y,w)};async function Pe(){if(clearTimeout(_),_=0,!g.size)return;let y=Array.from(g);g.clear(),y.forEach(w=>x.add(w));try{let w=v=>b.get(v)??(o?o(v):`${v}.js`);await ir(...y,{baseURL:t,mapper:w,onError:(v,A)=>{f.add(v),r?.(v,A)}})}catch{}finally{y.forEach(w=>x.delete(w))}}let De=s===document?document.documentElement:s,Be=new MutationObserver(y=>{for(let w of y)w.addedNodes?.forEach(v=>{M(v)}),w.type==="attributes"&&w.target&&M(w.target)});if(Be.observe(De,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[i,...p.map(y=>y.selector).filter(y=>y.startsWith("data-"))]}),d&&h&&Element.prototype.attachShadow){let y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(v){let A=y.call(this,v);if(v&&v.mode==="open"){fe(A);let O=this.tagName?.toLowerCase();O&&O.includes("-")&&!customElements.get(O)&&T(O,this)}return A},$=()=>Element.prototype.attachShadow=y}return c&&M(De),{stop(){S=!0,Be.disconnect(),$&&$(),_&&(clearTimeout(_),_=0),E.forEach(y=>y.disconnect())},flush:Pe}}static async define(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let o=e,{baseURL:r,mapper:a=d=>`${d}.js`,onError:i=(d,p)=>console.error(`[defineWebComponents] ${d}:`,p)}=t,s=r?new URL(r,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,s).href),x=g?.default??g?.[c(d)];if(!x){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,x),{tag:d,status:"defined"})}catch(p){throw i(d,p),p}};return Promise.all(o.map(l))}}});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 oe={meta:{name:"Pure Design System Ontology",version:"0.1"},tokens:{colors:["primary","secondary","accent","success","warning","danger","info"],spacing:["xs","sm","md","lg","xl"],typography:["heading","body","mono"],themes:["light","dark"]},primitives:[{id:"badge",name:"Badge / Pill",selectors:[".badge",".pill",".tag",".chip"]},{id:"card",name:"Card",selectors:[".card",".card-basic",".card-elevated",".card-outlined",".card-interactive"]},{id:"surface",name:"Surface",selectors:[".surface",".surface-base",".surface-raised",".surface-overlay",".surface-subtle",".surface-elevated",".surface-sunken"]},{id:"alert",name:"Alert",selectors:[".alert",".alert-info",".alert-success",".alert-warning",".alert-danger"]},{id:"dialog",name:"Dialog",selectors:["dialog",".dialog"]},{id:"table",name:"Table",selectors:["table",".table-responsive",".data-table"]},{id:"button",name:"Button",selectors:["button","[class^='btn-']",".icon-only"]},{id:"fieldset",name:"Fieldset Group",selectors:["fieldset[role='group']","fieldset[role='radiogroup']"]},{id:"label-field",name:"Label+Input",selectors:["label"]},{id:"accordion",name:"Accordion",selectors:[".accordion",".accordion-item","details"]},{id:"icon",name:"Icon",selectors:["pds-icon",".icon",".icon-*"]},{id:"figure",name:"Figure/Media",selectors:["figure","figure.media"]},{id:"gallery",name:"Gallery",selectors:[".gallery",".gallery-grid"]}],components:[{id:"pds-tabstrip",name:"Tab Strip",selectors:["pds-tabstrip"]},{id:"pds-drawer",name:"Drawer",selectors:["pds-drawer"]},{id:"pds-upload",name:"Upload",selectors:["pds-upload"]}],layoutPatterns:[{id:"grid",name:"Grid Container",selectors:[".grid",".demo-grid"],description:"CSS Grid layout container"},{id:"grid-auto",name:"Auto-fit Grid",selectors:[".grid-auto-sm",".grid-auto-md",".grid-auto-lg",".grid-auto-xl"],description:"Responsive auto-fit grid"},{id:"grid-cols",name:"Grid Columns",selectors:[".grid-cols-1",".grid-cols-2",".grid-cols-3",".grid-cols-4",".grid-cols-6"],description:"Fixed column grid"},{id:"flex",name:"Flex Container",selectors:[".flex",".flex-wrap"],description:"Flexbox layout container"},{id:"container",name:"Container",selectors:[".container"],description:"Centered max-width container"},{id:"media-grid",name:"Media Grid",selectors:[".media-grid"],description:"Grid for media elements"}],utilities:[".btn-group",".demo-grid",".color-scale",".gap-*",".items-*",".justify-*",".border-gradient",".border-gradient-primary",".border-gradient-accent",".border-gradient-secondary",".border-gradient-soft",".border-gradient-medium",".border-gradient-strong",".border-glow",".border-glow-sm",".border-glow-lg",".border-gradient-glow",".border-glow-*"],styles:{typography:["headings","body","code"],icons:{source:"svg",sets:["core","brand"]},interactive:["focus","hover","active"]}};function P(n,e){if(!n||!e)return!1;try{return n.matches(e)}catch{return!1}}function Ue(n,e){if(!n||!e||!n.closest)return null;try{return n.closest(e)}catch{return null}}function je(n,{maxDepth:e=5}={}){if(!n||n.closest&&n.closest(".showcase-toc"))return null;let t=n,o=0;for(;t&&o<e;){if(o++,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)if(P(t,a))return{element:t,componentType:"enhanced-component",displayName:a};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 r=t.closest?t.closest("label"):null;if(r&&r.querySelector&&r.querySelector("input,select,textarea"))return{element:r,componentType:"form-control",displayName:"label with input"};for(let a of PDS.ontology.primitives){for(let i of a.selectors||[]){let s=String(i||"").trim();if(s.includes("*")){if(s.startsWith(".")){let l=s.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};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};d=d.parentElement,p++}continue}continue}if(P(t,s))return{element:t,componentType:"pds-primitive",displayName:a.name||a.id};let c=Ue(t,s);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"pds-primitive",displayName:a.name||a.id}}if(t.classList){let i=Array.from(t.classList);for(let s of a.selectors||[])if(typeof s=="string"&&s.includes("*")&&s.startsWith(".")){let c=s.slice(1).replace(/\*/g,"");if(i.some(l=>l.startsWith(c)))return{element:t,componentType:"pds-primitive",displayName:a.name||a.id}}}}for(let a of PDS.ontology.layoutPatterns||[])for(let i of a.selectors||[]){let s=String(i||"").trim();if(s.includes("*")){if(s.startsWith(".")){let l=s.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}}continue}if(P(t,s))return{element:t,componentType:"layout-pattern",displayName:a.name||a.id};let c=Ue(t,s);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"layout-pattern",displayName:a.name||a.id}}if(t.tagName&&t.tagName.includes("-"))return{element:t,componentType:"web-component",displayName:t.tagName.toLowerCase()};if(t.tagName==="BUTTON"){let a=t.querySelector&&t.querySelector("pds-icon");return{element:t,componentType:"button",displayName:a?"button with icon":"button"}}if(P(t,"pds-icon")||t.closest&&t.closest("pds-icon")){let a=P(t,"pds-icon")?t:t.closest("pds-icon");return{element:a,componentType:"icon",displayName:`pds-icon (${a.getAttribute&&a.getAttribute("icon")||"unknown"})`}}if(P(t,"nav[data-dropdown]")||t.closest&&t.closest("nav[data-dropdown]"))return{element:P(t,"nav[data-dropdown]")?t:t.closest("nav[data-dropdown]"),componentType:"navigation",displayName:"dropdown menu"};t=t.parentElement}return null}var Ne=oe;var ae=class n{#e;#o;constructor(e={}){this.options={debug:!1,...e},this.options.design||(this.options.design={}),this.options.debug&&this.options.log?.("debug","Generator options:",this.options),this.tokens=this.generateTokens(),this.options.debug&&this.options.log?.("debug","Generated tokens:",this.tokens),this.#me(),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.#y(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#C(e.shape||{}),borderWidths:this.#_(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#T(e.layers||{}),layout:this.#L(e.layout||{}),transitions:this.#F(e.behavior||{}),zIndex:this.#R(e.layers||{}),icons:this.#P(e.icons||{})}}#y(e){let{primary:t="#3b82f6",secondary:o="#64748b",accent:r="#ec4899",background:a="#ffffff",success:i=null,warning:s="#FFBF00",danger:c=null,info:l=null,darkMode:d={}}=e,p={primary:this.#r(t),secondary:this.#r(o),accent:this.#r(r),success:this.#r(i||this.#v(t)),warning:this.#r(s||r),danger:this.#r(c||this.#x(t)),info:this.#r(l||t),gray:this.#d(o),surface:this.#p(a)};return p.surface.fieldset=this.#w(p.surface),p.surfaceSmart=this.#f(p.surface),p.dark=this.#S(p,a,d),p.dark&&p.dark.surface&&(p.dark.surfaceSmart=this.#f(p.dark.surface)),p.interactive={light:{fill:this.#m(p.primary,4.5),text:p.primary[600]},dark:{fill:this.#m(p.dark.primary,4.5),text:this.#M(p.dark.primary,p.dark.surface.base,4.5)}},p}#r(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))}}#v(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)}#d(e){let t=this.#a(e),o=t.h,r=Math.min(t.s,10);return{50:this.#t(o,r,98),100:this.#t(o,r,95),200:this.#t(o,r,88),300:this.#t(o,r,78),400:this.#t(o,r,60),500:e,600:this.#t(o,Math.min(r+5,15),45),700:this.#t(o,Math.min(r+8,18),35),800:this.#t(o,Math.min(r+10,20),20),900:this.#t(o,Math.min(r+12,22),10)}}#p(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.#u(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#w(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#k(e.sunken,.05),overlay:e.elevated}}#k(e,t=.05){let o=this.#a(e),r=Math.max(o.l-o.l*t,5);return this.#t(o.h,o.s,r)}#u(e){let t=this.#a(e);if(t.l>50){let o=Math.min(t.s+5,25),r=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,o,r)}else{let o=Math.max(t.s-10,5),r=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,o,r)}}#S(e,t="#ffffff",o={}){let r=o.background?o.background:this.#u(t),a=this.#p(r),i=o.primary?this.#r(o.primary):this.#n(e.primary);return{surface:{...a,fieldset:this.#E(a)},primary:i,secondary:o.secondary?this.#r(o.secondary):this.#n(e.secondary),accent:o.accent?this.#r(o.accent):this.#n(e.accent),gray:o.secondary?this.#d(o.secondary):e.gray,success:this.#n(e.success),info:this.#n(e.info),warning:this.#n(e.warning),danger:this.#n(e.danger)}}#s(e){let t=String(e||"").replace("#",""),o=t.length===3?t.split("").map(a=>a+a).join(""):t,r=parseInt(o,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}#l(e){let{r:t,g:o,b:r}=this.#s(e),a=[t/255,o/255,r/255].map(i=>i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4));return .2126*a[0]+.7152*a[1]+.0722*a[2]}#c(e,t){let o=this.#l(e),r=this.#l(t),a=Math.max(o,r),i=Math.min(o,r);return(a+.05)/(i+.05)}#h(e,t=4.5){if(!e)return"#000000";let o="#ffffff",r="#000000",a=this.#c(e,o);if(a>=t)return o;let i=this.#c(e,r);return i>=t||i>a?r:o}#g(e,t=1){let{r:o,g:r,b:a}=this.#s(e);return`rgba(${o}, ${r}, ${a}, ${t})`}#$(e,t,o=.5){let r=this.#s(e),a=this.#s(t),i=Math.round(r.r+(a.r-r.r)*o),s=Math.round(r.g+(a.g-r.g)*o),c=Math.round(r.b+(a.b-r.b)*o);return this.#z(i,s,c)}#z(e,t,o){let r=a=>{let i=Math.max(0,Math.min(255,Math.round(a))).toString(16);return i.length===1?"0"+i:i};return`#${r(e)}${r(t)}${r(o)}`}#E(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#b(e.elevated,.08),sunken:e.elevated,overlay:this.#b(e.overlay,.05)}}#M(e={},t="#000000",o=4.5){let r=["600","700","800","500","400","900","300","200"],a={shade:null,color:null,ratio:0};for(let i of r){let s=e?.[i];if(!s||typeof s!="string")continue;let c=this.#c(s,t);if(c>a.ratio&&(a={shade:i,color:s,ratio:c}),c>=o)return s}return a.color||e?.["600"]||e?.["500"]}#m(e={},t=4.5){let o=["600","700","800","500","400","900"],r={shade:null,color:null,ratio:0};for(let a of o){let i=e?.[a];if(!i||typeof i!="string")continue;let s=this.#c(i,"#ffffff");if(s>r.ratio&&(r={shade:a,color:i,ratio:s}),s>=t)return i}return r.color||e?.["600"]||e?.["500"]}#f(e){let t={};return Object.entries(e).forEach(([o,r])=>{if(!r||typeof r!="string"||!r.startsWith("#"))return;let a=this.#l(r)<.5,i=this.#h(r,4.5),s=this.#h(r,3),c=this.#$(i,r,.4),l=i,d=c,p=a?"#ffffff":"#000000",h=a?.25:.1,g=this.#g(p,h),x=a?"#ffffff":"#000000",f=a?.15:.1,b=this.#g(x,f);t[o]={bg:r,text:i,textSecondary:s,textMuted:c,icon:l,iconSubtle:d,shadow:g,border:b,scheme:a?"dark":"light"}}),t}#b(e,t=.05){let o=this.#a(e),r=Math.min(o.l+(100-o.l)*t,95);return this.#t(o.h,o.s,r)}#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(([r,a])=>{let i=e[a.source];t[r]=this.#A(i,a.dimFactor)}),t}#A(e,t=.8){let o=this.#a(e),r=Math.max(o.s*t,5),a=Math.max(o.l*t,5);return this.#t(o.h,r,a)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:o=1.25,maxSpacingSteps:r=12}=e,a=Number.isFinite(Number(t))?Number(t):4,i=Math.min(Number.isFinite(Number(r))?Number(r):12,12),s={0:"0"};for(let c=1;c<=i;c++)s[c]=`${a*c}px`;return s}#C(e){let{radiusSize:t="medium",customRadius:o=null}=e,r;o!=null?r=o:typeof t=="number"?r=t:typeof t=="string"?r=u.RadiusSizes[t]??u.RadiusSizes.medium:r=u.RadiusSizes.medium;let a=Number.isFinite(Number(r))?Number(r):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"}}#_(e){let{borderWidth:t="medium"}=e,o;return typeof t=="number"?o=t:typeof t=="string"?o=u.BorderWidths[t]??u.BorderWidths.medium:o=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:o="system-ui, -apple-system, sans-serif",fontFamilyMono:r='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:a=16,fontScale:i=1.25,fontWeightLight:s=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:x=u.LineHeights.relaxed}=e,f=Number.isFinite(Number(a))?Number(a):16,b=Number.isFinite(Number(i))?Number(i):1.25;return{fontFamily:{headings:t,body:o,mono:r},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:s?.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:x?.toString()||"1.75"}}}#T(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:o=1,shadowOffsetMultiplier:r=1}=e,a=`rgba(0, 0, 0, ${t})`,i=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*r}px ${2*o}px 0 ${i}`,base:`0 ${1*r}px ${3*o}px 0 ${a}, 0 ${1*r}px ${2*o}px 0 ${i}`,md:`0 ${4*r}px ${6*o}px ${-1*r}px ${a}, 0 ${2*r}px ${4*o}px ${-1*r}px ${i}`,lg:`0 ${10*r}px ${15*o}px ${-3*r}px ${a}, 0 ${4*r}px ${6*o}px ${-2*r}px ${i}`,xl:`0 ${20*r}px ${25*o}px ${-5*r}px ${a}, 0 ${10*r}px ${10*o}px ${-5*r}px ${i}`,inner:`inset 0 ${2*r}px ${4*o}px 0 ${i}`}}#L(e){let{maxWidth:t=1200,containerPadding:o=16,breakpoints:r={sm:640,md:768,lg:1024,xl:1280}}=e;return{maxWidth:`${t}px`,minHeight:"100vh",containerPadding:`${o}px`,breakpoints:{sm:`${r.sm}px`,md:`${r.md}px`,lg:`${r.lg}px`,xl:`${r.xl}px`},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#F(e){let{transitionSpeed:t=u.TransitionSpeeds.normal,animationEasing:o=u.AnimationEasings["ease-out"]}=e,r;return typeof t=="number"?r=t:typeof t=="string"&&u.TransitionSpeeds[t]?r=u.TransitionSpeeds[t]:r=u.TransitionSpeeds.normal,{fast:`${Math.round(r*.6)}ms`,normal:`${r}ms`,slow:`${Math.round(r*1.4)}ms`}}#R(e){let{baseZIndex:t=1e3,zIndexStep:o=10}=e;return{dropdown:t.toString(),sticky:(t+o*2).toString(),fixed:(t+o*3).toString(),modal:(t+o*4).toString(),drawer:(t+o*5).toString(),popover:(t+o*6).toString(),tooltip:(t+o*7).toString(),notification:(t+o*8).toString()}}#P(e){let{set:t="phosphor",weight:o="regular",defaultSize:r=24,sizes:a={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:i="/assets/pds/icons/pds-icons.svg"}=e;return{set:t,weight:o,defaultSize:`${r}px`,sizes:Object.fromEntries(Object.entries(a).map(([s,c])=>[s,`${c}px`])),spritePath:i}}#D(e){let t=[];t.push(` /* Colors */
1
+ var Tt=Object.defineProperty;var Lt=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{for(var t in e)Tt(n,t,{get:e[t],enumerable:!0})};var xt={};Ue(xt,{AutoDefiner:()=>Le});async function ir(...n){let e={};n.length&&typeof n[n.length-1]=="object"&&(e=n.pop()||{});let t=n,{baseURL:o,mapper:r=l=>`${l}.js`,onError:a=(l,d)=>console.error(`[defineWebComponents] ${l}:`,d)}=e,i=o?new URL(o,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),s=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=r(l),h=await import(d instanceof URL?d.href:new URL(d,i).href),g=h?.default??h?.[s(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 "${s(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 Le,wt=Lt(()=>{Le=class{constructor(e={}){let{baseURL:t,mapper:o,onError:r,predicate:a=()=>!0,attributeModule:i="data-module",root:s=document,scanExisting:c=!0,debounceMs:l=16,observeShadows:d=!0,enhancers:p=[],patchAttachShadow:h=!0}=e,g=new Set,x=new Set,f=new Set,b=new Map,E=new WeakMap,F=new WeakMap,_=0,S=!1,$=null,z=y=>{if(!y||!p.length)return;let w=F.get(y);w||(w=new Set,F.set(y,w));for(let v of p)if(!(!v.selector||!v.run)&&!w.has(v.selector))try{y.matches&&y.matches(v.selector)&&(v.run(y),w.add(v.selector))}catch(A){console.warn(`[AutoDefiner] Error applying enhancer for selector "${v.selector}":`,A)}},T=(y,w)=>{if(!S&&!(!y||!y.includes("-"))&&!customElements.get(y)&&!x.has(y)&&!f.has(y)){if(w&&w.getAttribute){let v=w.getAttribute(i);v&&!b.has(y)&&b.set(y,v)}g.add(y),fe()}},fe=()=>{_||(_=setTimeout(De,l))},M=y=>{if(y){if(y.nodeType===1){let w=y,v=w.tagName?.toLowerCase();v&&v.includes("-")&&!customElements.get(v)&&a(v,w)&&T(v,w),z(w),d&&w.shadowRoot&&be(w.shadowRoot)}y.querySelectorAll&&y.querySelectorAll("*").forEach(w=>{let v=w.tagName?.toLowerCase();v&&v.includes("-")&&!customElements.get(v)&&a(v,w)&&T(v,w),z(w),d&&w.shadowRoot&&be(w.shadowRoot)})}},be=y=>{if(!y||E.has(y))return;M(y);let w=new MutationObserver(v=>{for(let A of v)A.addedNodes?.forEach(O=>{M(O)}),A.type==="attributes"&&A.target&&M(A.target)});w.observe(y,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[i,...p.map(v=>v.selector).filter(v=>v.startsWith("data-"))]}),E.set(y,w)};async function De(){if(clearTimeout(_),_=0,!g.size)return;let y=Array.from(g);g.clear(),y.forEach(w=>x.add(w));try{let w=v=>b.get(v)??(o?o(v):`${v}.js`);await ir(...y,{baseURL:t,mapper:w,onError:(v,A)=>{f.add(v),r?.(v,A)}})}catch{}finally{y.forEach(w=>x.delete(w))}}let Be=s===document?document.documentElement:s,We=new MutationObserver(y=>{for(let w of y)w.addedNodes?.forEach(v=>{M(v)}),w.type==="attributes"&&w.target&&M(w.target)});if(We.observe(Be,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[i,...p.map(y=>y.selector).filter(y=>y.startsWith("data-"))]}),d&&h&&Element.prototype.attachShadow){let y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(v){let A=y.call(this,v);if(v&&v.mode==="open"){be(A);let O=this.tagName?.toLowerCase();O&&O.includes("-")&&!customElements.get(O)&&T(O,this)}return A},$=()=>Element.prototype.attachShadow=y}return c&&M(Be),{stop(){S=!0,We.disconnect(),$&&$(),_&&(clearTimeout(_),_=0),E.forEach(y=>y.disconnect())},flush:De}}static async define(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let o=e,{baseURL:r,mapper:a=d=>`${d}.js`,onError:i=(d,p)=>console.error(`[defineWebComponents] ${d}:`,p)}=t,s=r?new URL(r,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,s).href),x=g?.default??g?.[c(d)];if(!x){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,x),{tag:d,status:"defined"})}catch(p){throw i(d,p),p}};return Promise.all(o.map(l))}}});var ye=class{constructor(){this._mode="static",this._designer=null,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"}}setDesigner(e,t={}){this._designer=e,this._mode="live";let o=t?.presetName;o?e?.options?.log?.("log",`PDS live with preset "${o}"`):e?.options?.log?.("log","PDS live with custom config")}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"&&this._designer)switch(e){case"tokens":return this._designer.tokensStylesheet;case"primitives":return this._designer.primitivesStylesheet;case"components":return this._designer.componentsStylesheet;case"utilities":return this._designer.utilitiesStylesheet;default:return this._designer?.options?.log?.("warn",`[PDS Registry] Unknown layer: ${e}`),null}else 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 o=new CSSStyleSheet;return o.replaceSync("/* Failed to load "+e+" */"),o}}get mode(){return this._mode}get isLive(){return this._mode==="live"&&this._designer!==null}get hasDesigner(){return this._designer!==null}},oe=new ye;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 ae={meta:{name:"Pure Design System Ontology",version:"0.1"},tokens:{colors:["primary","secondary","accent","success","warning","danger","info"],spacing:["xs","sm","md","lg","xl"],typography:["heading","body","mono"],themes:["light","dark"]},primitives:[{id:"badge",name:"Badge / Pill",selectors:[".badge",".pill",".tag",".chip"]},{id:"card",name:"Card",selectors:[".card",".card-basic",".card-elevated",".card-outlined",".card-interactive"]},{id:"surface",name:"Surface",selectors:[".surface",".surface-base",".surface-raised",".surface-overlay",".surface-subtle",".surface-elevated",".surface-sunken"]},{id:"alert",name:"Alert",selectors:[".alert",".alert-info",".alert-success",".alert-warning",".alert-danger"]},{id:"dialog",name:"Dialog",selectors:["dialog",".dialog"]},{id:"table",name:"Table",selectors:["table",".table-responsive",".data-table"]},{id:"button",name:"Button",selectors:["button","[class^='btn-']",".icon-only"]},{id:"fieldset",name:"Fieldset Group",selectors:["fieldset[role='group']","fieldset[role='radiogroup']"]},{id:"label-field",name:"Label+Input",selectors:["label"]},{id:"accordion",name:"Accordion",selectors:[".accordion",".accordion-item","details"]},{id:"icon",name:"Icon",selectors:["pds-icon",".icon",".icon-*"]},{id:"figure",name:"Figure/Media",selectors:["figure","figure.media"]},{id:"gallery",name:"Gallery",selectors:[".gallery",".gallery-grid"]}],components:[{id:"pds-tabstrip",name:"Tab Strip",selectors:["pds-tabstrip"]},{id:"pds-drawer",name:"Drawer",selectors:["pds-drawer"]},{id:"pds-upload",name:"Upload",selectors:["pds-upload"]}],layoutPatterns:[{id:"grid",name:"Grid Container",selectors:[".grid",".demo-grid"],description:"CSS Grid layout container"},{id:"grid-auto",name:"Auto-fit Grid",selectors:[".grid-auto-sm",".grid-auto-md",".grid-auto-lg",".grid-auto-xl"],description:"Responsive auto-fit grid"},{id:"grid-cols",name:"Grid Columns",selectors:[".grid-cols-1",".grid-cols-2",".grid-cols-3",".grid-cols-4",".grid-cols-6"],description:"Fixed column grid"},{id:"flex",name:"Flex Container",selectors:[".flex",".flex-wrap"],description:"Flexbox layout container"},{id:"container",name:"Container",selectors:[".container"],description:"Centered max-width container"},{id:"media-grid",name:"Media Grid",selectors:[".media-grid"],description:"Grid for media elements"}],utilities:[".btn-group",".demo-grid",".color-scale",".gap-*",".items-*",".justify-*",".border-gradient",".border-gradient-primary",".border-gradient-accent",".border-gradient-secondary",".border-gradient-soft",".border-gradient-medium",".border-gradient-strong",".border-glow",".border-glow-sm",".border-glow-lg",".border-gradient-glow",".border-glow-*"],styles:{typography:["headings","body","code"],icons:{source:"svg",sets:["core","brand"]},interactive:["focus","hover","active"]}};function P(n,e){if(!n||!e)return!1;try{return n.matches(e)}catch{return!1}}function je(n,e){if(!n||!e||!n.closest)return null;try{return n.closest(e)}catch{return null}}function Ne(n,{maxDepth:e=5}={}){if(!n||n.closest&&n.closest(".showcase-toc"))return null;let t=n,o=0;for(;t&&o<e;){if(o++,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)if(P(t,a))return{element:t,componentType:"enhanced-component",displayName:a};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 r=t.closest?t.closest("label"):null;if(r&&r.querySelector&&r.querySelector("input,select,textarea"))return{element:r,componentType:"form-control",displayName:"label with input"};for(let a of PDS.ontology.primitives){for(let i of a.selectors||[]){let s=String(i||"").trim();if(s.includes("*")){if(s.startsWith(".")){let l=s.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};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};d=d.parentElement,p++}continue}continue}if(P(t,s))return{element:t,componentType:"pds-primitive",displayName:a.name||a.id};let c=je(t,s);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"pds-primitive",displayName:a.name||a.id}}if(t.classList){let i=Array.from(t.classList);for(let s of a.selectors||[])if(typeof s=="string"&&s.includes("*")&&s.startsWith(".")){let c=s.slice(1).replace(/\*/g,"");if(i.some(l=>l.startsWith(c)))return{element:t,componentType:"pds-primitive",displayName:a.name||a.id}}}}for(let a of PDS.ontology.layoutPatterns||[])for(let i of a.selectors||[]){let s=String(i||"").trim();if(s.includes("*")){if(s.startsWith(".")){let l=s.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}}continue}if(P(t,s))return{element:t,componentType:"layout-pattern",displayName:a.name||a.id};let c=je(t,s);if(c&&c.tagName!=="DS-SHOWCASE")return{element:c,componentType:"layout-pattern",displayName:a.name||a.id}}if(t.tagName&&t.tagName.includes("-"))return{element:t,componentType:"web-component",displayName:t.tagName.toLowerCase()};if(t.tagName==="BUTTON"){let a=t.querySelector&&t.querySelector("pds-icon");return{element:t,componentType:"button",displayName:a?"button with icon":"button"}}if(P(t,"pds-icon")||t.closest&&t.closest("pds-icon")){let a=P(t,"pds-icon")?t:t.closest("pds-icon");return{element:a,componentType:"icon",displayName:`pds-icon (${a.getAttribute&&a.getAttribute("icon")||"unknown"})`}}if(P(t,"nav[data-dropdown]")||t.closest&&t.closest("nav[data-dropdown]"))return{element:P(t,"nav[data-dropdown]")?t:t.closest("nav[data-dropdown]"),componentType:"navigation",displayName:"dropdown menu"};t=t.parentElement}return null}var Oe=ae;var ne=class n{#e;#o;constructor(e={}){this.options={debug:!1,...e},this.options.design||(this.options.design={}),this.options.debug&&this.options.log?.("debug","Generator options:",this.options),this.tokens=this.generateTokens(),this.options.debug&&this.options.log?.("debug","Generated tokens:",this.tokens),this.#me(),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.#y(e.colors||{}),spacing:this.generateSpacingTokens(e.spatialRhythm||{}),radius:this.#C(e.shape||{}),borderWidths:this.#_(e.shape||{}),typography:this.generateTypographyTokens(e.typography||{}),shadows:this.#T(e.layers||{}),layout:this.#L(e.layout||{}),transitions:this.#F(e.behavior||{}),zIndex:this.#R(e.layers||{}),icons:this.#P(e.icons||{})}}#y(e){let{primary:t="#3b82f6",secondary:o="#64748b",accent:r="#ec4899",background:a="#ffffff",success:i=null,warning:s="#FFBF00",danger:c=null,info:l=null,darkMode:d={}}=e,p={primary:this.#r(t),secondary:this.#r(o),accent:this.#r(r),success:this.#r(i||this.#v(t)),warning:this.#r(s||r),danger:this.#r(c||this.#x(t)),info:this.#r(l||t),gray:this.#d(o),surface:this.#p(a)};return p.surface.fieldset=this.#w(p.surface),p.surfaceSmart=this.#f(p.surface),p.dark=this.#S(p,a,d),p.dark&&p.dark.surface&&(p.dark.surfaceSmart=this.#f(p.dark.surface)),p.interactive={light:{fill:this.#m(p.primary,4.5),text:p.primary[600]},dark:{fill:this.#m(p.dark.primary,4.5),text:this.#M(p.dark.primary,p.dark.surface.base,4.5)}},p}#r(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))}}#v(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)}#d(e){let t=this.#a(e),o=t.h,r=Math.min(t.s,10);return{50:this.#t(o,r,98),100:this.#t(o,r,95),200:this.#t(o,r,88),300:this.#t(o,r,78),400:this.#t(o,r,60),500:e,600:this.#t(o,Math.min(r+5,15),45),700:this.#t(o,Math.min(r+8,18),35),800:this.#t(o,Math.min(r+10,20),20),900:this.#t(o,Math.min(r+12,22),10)}}#p(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.#u(e),hover:"color-mix(in oklab, var(--color-surface-base) 92%, var(--color-text-primary) 8%);"}}#w(e){return{base:e.subtle,subtle:e.elevated,elevated:e.sunken,sunken:this.#k(e.sunken,.05),overlay:e.elevated}}#k(e,t=.05){let o=this.#a(e),r=Math.max(o.l-o.l*t,5);return this.#t(o.h,o.s,r)}#u(e){let t=this.#a(e);if(t.l>50){let o=Math.min(t.s+5,25),r=Math.max(12-(t.l-50)*.1,8);return this.#t(t.h,o,r)}else{let o=Math.max(t.s-10,5),r=Math.min(85+(50-t.l)*.3,95);return this.#t(t.h,o,r)}}#S(e,t="#ffffff",o={}){let r=o.background?o.background:this.#u(t),a=this.#p(r),i=o.primary?this.#r(o.primary):this.#n(e.primary);return{surface:{...a,fieldset:this.#E(a)},primary:i,secondary:o.secondary?this.#r(o.secondary):this.#n(e.secondary),accent:o.accent?this.#r(o.accent):this.#n(e.accent),gray:o.secondary?this.#d(o.secondary):e.gray,success:this.#n(e.success),info:this.#n(e.info),warning:this.#n(e.warning),danger:this.#n(e.danger)}}#s(e){let t=String(e||"").replace("#",""),o=t.length===3?t.split("").map(a=>a+a).join(""):t,r=parseInt(o,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}#l(e){let{r:t,g:o,b:r}=this.#s(e),a=[t/255,o/255,r/255].map(i=>i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4));return .2126*a[0]+.7152*a[1]+.0722*a[2]}#c(e,t){let o=this.#l(e),r=this.#l(t),a=Math.max(o,r),i=Math.min(o,r);return(a+.05)/(i+.05)}#h(e,t=4.5){if(!e)return"#000000";let o="#ffffff",r="#000000",a=this.#c(e,o);if(a>=t)return o;let i=this.#c(e,r);return i>=t||i>a?r:o}#g(e,t=1){let{r:o,g:r,b:a}=this.#s(e);return`rgba(${o}, ${r}, ${a}, ${t})`}#$(e,t,o=.5){let r=this.#s(e),a=this.#s(t),i=Math.round(r.r+(a.r-r.r)*o),s=Math.round(r.g+(a.g-r.g)*o),c=Math.round(r.b+(a.b-r.b)*o);return this.#z(i,s,c)}#z(e,t,o){let r=a=>{let i=Math.max(0,Math.min(255,Math.round(a))).toString(16);return i.length===1?"0"+i:i};return`#${r(e)}${r(t)}${r(o)}`}#E(e){return{base:e.elevated,subtle:e.overlay,elevated:this.#b(e.elevated,.08),sunken:e.elevated,overlay:this.#b(e.overlay,.05)}}#M(e={},t="#000000",o=4.5){let r=["600","700","800","500","400","900","300","200"],a={shade:null,color:null,ratio:0};for(let i of r){let s=e?.[i];if(!s||typeof s!="string")continue;let c=this.#c(s,t);if(c>a.ratio&&(a={shade:i,color:s,ratio:c}),c>=o)return s}return a.color||e?.["600"]||e?.["500"]}#m(e={},t=4.5){let o=["600","700","800","500","400","900"],r={shade:null,color:null,ratio:0};for(let a of o){let i=e?.[a];if(!i||typeof i!="string")continue;let s=this.#c(i,"#ffffff");if(s>r.ratio&&(r={shade:a,color:i,ratio:s}),s>=t)return i}return r.color||e?.["600"]||e?.["500"]}#f(e){let t={};return Object.entries(e).forEach(([o,r])=>{if(!r||typeof r!="string"||!r.startsWith("#"))return;let a=this.#l(r)<.5,i=this.#h(r,4.5),s=this.#h(r,3),c=this.#$(i,r,.4),l=i,d=c,p=a?"#ffffff":"#000000",h=a?.25:.1,g=this.#g(p,h),x=a?"#ffffff":"#000000",f=a?.15:.1,b=this.#g(x,f);t[o]={bg:r,text:i,textSecondary:s,textMuted:c,icon:l,iconSubtle:d,shadow:g,border:b,scheme:a?"dark":"light"}}),t}#b(e,t=.05){let o=this.#a(e),r=Math.min(o.l+(100-o.l)*t,95);return this.#t(o.h,o.s,r)}#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(([r,a])=>{let i=e[a.source];t[r]=this.#A(i,a.dimFactor)}),t}#A(e,t=.8){let o=this.#a(e),r=Math.max(o.s*t,5),a=Math.max(o.l*t,5);return this.#t(o.h,r,a)}generateSpacingTokens(e){let{baseUnit:t=4,scaleRatio:o=1.25,maxSpacingSteps:r=12}=e,a=Number.isFinite(Number(t))?Number(t):4,i=Math.min(Number.isFinite(Number(r))?Number(r):12,12),s={0:"0"};for(let c=1;c<=i;c++)s[c]=`${a*c}px`;return s}#C(e){let{radiusSize:t="medium",customRadius:o=null}=e,r;o!=null?r=o:typeof t=="number"?r=t:typeof t=="string"?r=u.RadiusSizes[t]??u.RadiusSizes.medium:r=u.RadiusSizes.medium;let a=Number.isFinite(Number(r))?Number(r):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"}}#_(e){let{borderWidth:t="medium"}=e,o;return typeof t=="number"?o=t:typeof t=="string"?o=u.BorderWidths[t]??u.BorderWidths.medium:o=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:o="system-ui, -apple-system, sans-serif",fontFamilyMono:r='ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',baseFontSize:a=16,fontScale:i=1.25,fontWeightLight:s=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:x=u.LineHeights.relaxed}=e,f=Number.isFinite(Number(a))?Number(a):16,b=Number.isFinite(Number(i))?Number(i):1.25;return{fontFamily:{headings:t,body:o,mono:r},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:s?.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:x?.toString()||"1.75"}}}#T(e){let{baseShadowOpacity:t=.1,shadowBlurMultiplier:o=1,shadowOffsetMultiplier:r=1}=e,a=`rgba(0, 0, 0, ${t})`,i=`rgba(0, 0, 0, ${t*.5})`;return{sm:`0 ${1*r}px ${2*o}px 0 ${i}`,base:`0 ${1*r}px ${3*o}px 0 ${a}, 0 ${1*r}px ${2*o}px 0 ${i}`,md:`0 ${4*r}px ${6*o}px ${-1*r}px ${a}, 0 ${2*r}px ${4*o}px ${-1*r}px ${i}`,lg:`0 ${10*r}px ${15*o}px ${-3*r}px ${a}, 0 ${4*r}px ${6*o}px ${-2*r}px ${i}`,xl:`0 ${20*r}px ${25*o}px ${-5*r}px ${a}, 0 ${10*r}px ${10*o}px ${-5*r}px ${i}`,inner:`inset 0 ${2*r}px ${4*o}px 0 ${i}`}}#L(e){let{maxWidth:t=1200,containerPadding:o=16,breakpoints:r={sm:640,md:768,lg:1024,xl:1280}}=e;return{maxWidth:`${t}px`,minHeight:"100vh",containerPadding:`${o}px`,breakpoints:{sm:`${r.sm}px`,md:`${r.md}px`,lg:`${r.lg}px`,xl:`${r.xl}px`},pageMargin:"120px",sectionGap:"160px",containerGap:"200px",heroSpacing:"240px",footerSpacing:"160px"}}#F(e){let{transitionSpeed:t=u.TransitionSpeeds.normal,animationEasing:o=u.AnimationEasings["ease-out"]}=e,r;return typeof t=="number"?r=t:typeof t=="string"&&u.TransitionSpeeds[t]?r=u.TransitionSpeeds[t]:r=u.TransitionSpeeds.normal,{fast:`${Math.round(r*.6)}ms`,normal:`${r}ms`,slow:`${Math.round(r*1.4)}ms`}}#R(e){let{baseZIndex:t=1e3,zIndexStep:o=10}=e;return{dropdown:t.toString(),sticky:(t+o*2).toString(),fixed:(t+o*3).toString(),modal:(t+o*4).toString(),drawer:(t+o*5).toString(),popover:(t+o*6).toString(),tooltip:(t+o*7).toString(),notification:(t+o*8).toString()}}#P(e){let{set:t="phosphor",weight:o="regular",defaultSize:r=24,sizes:a={xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64},spritePath:i="/assets/pds/icons/pds-icons.svg"}=e;return{set:t,weight:o,defaultSize:`${r}px`,sizes:Object.fromEntries(Object.entries(a).map(([s,c])=>[s,`${c}px`])),spritePath:i}}#D(e){let t=[];t.push(` /* Colors */
2
2
  `);let o=(r,a="")=>{Object.entries(r).forEach(([i,s])=>{typeof s=="object"&&s!==null?o(s,`${a}${i}-`):typeof s=="string"&&t.push(` --color-${a}${i}: ${s};
3
3
  `)})};return Object.entries(e).forEach(([r,a])=>{r!=="dark"&&r!=="surfaceSmart"&&r!=="interactive"&&typeof a=="object"&&a!==null&&o(a,`${r}-`)}),e.surfaceSmart&&(t.push(` /* Smart Surface Tokens (context-aware) */
4
4
  `),Object.entries(e.surfaceSmart).forEach(([r,a])=>{t.push(` --surface-${r}-bg: ${a.bg};
@@ -3294,16 +3294,16 @@ ${this.#ge()}
3294
3294
  `}#xe(){this.#o={tokens:new CSSStyleSheet,primitives:new CSSStyleSheet,components:new CSSStyleSheet,utilities:new CSSStyleSheet},this.#we()}#we(){this.#o.tokens.replaceSync(this.#e.tokens),this.#o.primitives.replaceSync(this.#e.primitives),this.#o.components.replaceSync(this.#e.components),this.#o.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}
3295
3295
  ${this.#e.primitives}
3296
3296
  ${this.#e.components}
3297
- ${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 oe<"u"?oe: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[o,r]of Object.entries(t))typeof r=="object"&&r!==null&&e.push({name:o,scale:r});return e},getColorScale:e=>this.tokens.colors[e]||null,getSpacingValues:()=>Object.entries(this.tokens.spacing).map(([e,t])=>({key:e,value:t})),getTypography:()=>this.tokens.typography,getLayerCSS:e=>{let t=["tokens","primitives","components","utilities"];if(!t.includes(e))throw new Error(`Invalid layer: ${e}. Must be one of ${t.join(", ")}`);return this.#e?.[e]||""},usesEnumValue:(e,t)=>{let o=this.options.design||{};return JSON.stringify(o).includes(t)}}}}get tokensStylesheet(){return this.#o?.tokens}get primitivesStylesheet(){return this.#o?.primitives}get componentsStylesheet(){return this.#o?.components}get utilitiesStylesheet(){return this.#o?.utilities}getCSSModules(){return{"pds-tokens.css.js":this.#i("tokens",this.#e.tokens),"pds-primitives.css.js":this.#i("primitives",this.#e.primitives),"pds-components.css.js":this.#i("components",this.#e.components),"pds-utilities.css.js":this.#i("utilities",this.#e.utilities),"pds-styles.css.js":this.#i("styles",this.layeredCSS)}}#i(e,t){let o=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$");return`// Pure Design System - ${e}
3297
+ ${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 ae<"u"?ae: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[o,r]of Object.entries(t))typeof r=="object"&&r!==null&&e.push({name:o,scale:r});return e},getColorScale:e=>this.tokens.colors[e]||null,getSpacingValues:()=>Object.entries(this.tokens.spacing).map(([e,t])=>({key:e,value:t})),getTypography:()=>this.tokens.typography,getLayerCSS:e=>{let t=["tokens","primitives","components","utilities"];if(!t.includes(e))throw new Error(`Invalid layer: ${e}. Must be one of ${t.join(", ")}`);return this.#e?.[e]||""},usesEnumValue:(e,t)=>{let o=this.options.design||{};return JSON.stringify(o).includes(t)}}}}get tokensStylesheet(){return this.#o?.tokens}get primitivesStylesheet(){return this.#o?.primitives}get componentsStylesheet(){return this.#o?.components}get utilitiesStylesheet(){return this.#o?.utilities}getCSSModules(){return{"pds-tokens.css.js":this.#i("tokens",this.#e.tokens),"pds-primitives.css.js":this.#i("primitives",this.#e.primitives),"pds-components.css.js":this.#i("components",this.#e.components),"pds-utilities.css.js":this.#i("utilities",this.#e.utilities),"pds-styles.css.js":this.#i("styles",this.layeredCSS)}}#i(e,t){let o=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$");return`// Pure Design System - ${e}
3298
3298
  // Auto-generated - do not edit directly
3299
3299
 
3300
3300
  export const ${e} = new CSSStyleSheet();
3301
3301
  ${e}.replaceSync(\`${o}\`);
3302
3302
 
3303
3303
  export const ${e}CSS = \`${o}\`;
3304
- `}static applyStyles(e){if(!e||typeof e!="object"){e?.options?.log?.("error","[Generator] applyStyles requires a generator object");return}let t=e.layeredCSS||e.css||"";if(!t){e?.options?.log?.("warn","[Generator] No CSS available on designer to apply");return}n.installRuntimeStyles(t)}static installRuntimeStyles(e){try{if(typeof document>"u")return;if(typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype){let r=new CSSStyleSheet;r.replaceSync(e),r._pds=!0;let a=(document.adoptedStyleSheets||[]).filter(i=>i._pds!==!0);document.adoptedStyleSheets=[...a,r],n.__pdsRuntimeSheet=r;return}let t="pds-runtime-stylesheet",o=document.getElementById(t);if(!o){o=document.createElement("style"),o.id=t,o.type="text/css";let r=document.head||document.getElementsByTagName("head")[0];r?r.appendChild(o):document.documentElement.appendChild(o)}o.textContent=e}catch(t){console.warn("Generator.installRuntimeStyles failed:",t)}}};async function Oe(n,e=[]){try{let t=await PDS.registry.getStylesheet("primitives");if(n.adoptedStyleSheets=[t,...e],PDS.registry.isLive){let o=n.host?.tagName?.toLowerCase()||"unknown"}}catch(t){let o=n.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${o}> failed to adopt primitives:`,t),n.adoptedStyleSheets=e}}async function Ie(n,e=["primitives"],t=[]){try{let r=(await Promise.all(e.map(a=>PDS.registry.getStylesheet(a)))).filter(a=>a!==null);if(n.adoptedStyleSheets=[...r,...t],PDS.registry.isLive){let a=n.host?.tagName?.toLowerCase()||"unknown"}}catch(o){let r=n.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${r}> failed to adopt layers:`,o),n.adoptedStyleSheets=t}}function He(n){let e=new CSSStyleSheet;return e.replaceSync(n),e}function Ge(){return pdsRegistry.isLive}var be=class{constructor(){this._mode="static",this._designer=null,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"}}setDesigner(e,t={}){this._designer=e,this._mode="live";let o=t?.presetName;o?e?.options?.log?.("log",`PDS live with preset "${o}"`):e?.options?.log?.("log","PDS live with custom config")}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"&&this._designer)switch(e){case"tokens":return this._designer.tokensStylesheet;case"primitives":return this._designer.primitivesStylesheet;case"components":return this._designer.componentsStylesheet;case"utilities":return this._designer.utilitiesStylesheet;default:return this._designer?.options?.log?.("warn",`[PDS Registry] Unknown layer: ${e}`),null}else 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 o=new CSSStyleSheet;return o.replaceSync("/* Failed to load "+e+" */"),o}}get mode(){return this._mode}get isLive(){return this._mode==="live"&&this._designer!==null}get hasDesigner(){return this._designer!==null}},qe=new be;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 ne(n="log",e,...t){if(this?.debug||this?.design?.debug||!1||n==="error"||n==="warn"){let r=console[n]||console.log;t.length>0?r(e,...t):r(e)}}var ie=globalThis,ce=ie.ShadowRoot&&(ie.ShadyCSS===void 0||ie.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ke=Symbol(),Ve=new WeakMap,se=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==Ke)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(ce&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=Ve.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&Ve.set(t,e))}return e}toString(){return this.cssText}},Ze=n=>new se(typeof n=="string"?n:n+"",void 0,Ke);var Qe=(n,e)=>{if(ce)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),r=ie.litNonce;r!==void 0&&o.setAttribute("nonce",r),o.textContent=t.cssText,n.appendChild(o)}},ye=ce?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return Ze(t)})(n):n;var{is:Ft,defineProperty:Rt,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Dt,getOwnPropertySymbols:Bt,getPrototypeOf:Wt}=Object,le=globalThis,Ye=le.trustedTypes,Ut=Ye?Ye.emptyScript:"",jt=le.reactiveElementPolyfillSupport,q=(n,e)=>n,ve={toAttribute(n,e){switch(e){case Boolean:n=n?Ut:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Xe=(n,e)=>!Ft(n,e),Je={attribute:!0,type:String,converter:ve,reflect:!1,useDefault:!1,hasChanged:Xe};Symbol.metadata??=Symbol("metadata"),le.litPropertyMetadata??=new WeakMap;var L=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=Je){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),r=this.getPropertyDescriptor(e,o,t);r!==void 0&&Rt(this.prototype,e,r)}}static getPropertyDescriptor(e,t,o){let{get:r,set:a}=Pt(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get:r,set(i){let s=r?.call(this);a?.call(this,i),this.requestUpdate(e,s,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Je}static _$Ei(){if(this.hasOwnProperty(q("elementProperties")))return;let e=Wt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(q("properties"))){let t=this.properties,o=[...Dt(t),...Bt(t)];for(let r of o)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,r]of t)this.elementProperties.set(o,r)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let r=this._$Eu(t,o);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let r of o)t.unshift(ye(r))}else e!==void 0&&t.push(ye(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Qe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){let o=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,o);if(r!==void 0&&o.reflect===!0){let a=(o.converter?.toAttribute!==void 0?o.converter:ve).toAttribute(t,o.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){let o=this.constructor,r=o._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let a=o.getPropertyOptions(r),i=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:ve;this._$Em=r;let s=i.fromAttribute(t,a.type);this[r]=s??this._$Ej?.get(r)??s,this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){let r=this.constructor,a=this[e];if(o??=r.getPropertyOptions(e),!((o.hasChanged??Xe)(a,t)||o.useDefault&&o.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,o))))return;this.C(e,t,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:r,wrapped:a},i){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),a!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),r===!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[r,a]of this._$Ep)this[r]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[r,a]of o){let{wrapped:i}=a,s=this[r];i!==!0||this._$AL.has(r)||s===void 0||this.C(r,void 0,a,s)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[q("elementProperties")]=new Map,L[q("finalized")]=new Map,jt?.({ReactiveElement:L}),(le.reactiveElementVersions??=[]).push("2.1.1");var Ee=globalThis,de=Ee.trustedTypes,et=de?de.createPolicy("lit-html",{createHTML:n=>n}):void 0,it="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,st="?"+R,Nt=`<${st}>`,W=document,K=()=>W.createComment(""),Z=n=>n===null||typeof n!="object"&&typeof n!="function",Me=Array.isArray,Ot=n=>Me(n)||typeof n?.[Symbol.iterator]=="function",xe=`[
3305
- \f\r]`,V=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,rt=/>/g,D=RegExp(`>|${xe}(?:([^\\s"'>=/]+)(${xe}*=${xe}*(?:[^
3306
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ct=/^(?:script|style|textarea|title)$/i,Ae=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Ar=Ae(1),Cr=Ae(2),_r=Ae(3),U=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),nt=new WeakMap,B=W.createTreeWalker(W,129);function lt(n,e){if(!Me(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(e):e}var It=(n,e)=>{let t=n.length-1,o=[],r,a=e===2?"<svg>":e===3?"<math>":"",i=V;for(let s=0;s<t;s++){let c=n[s],l,d,p=-1,h=0;for(;h<c.length&&(i.lastIndex=h,d=i.exec(c),d!==null);)h=i.lastIndex,i===V?d[1]==="!--"?i=tt:d[1]!==void 0?i=rt:d[2]!==void 0?(ct.test(d[2])&&(r=RegExp("</"+d[2],"g")),i=D):d[3]!==void 0&&(i=D):i===D?d[0]===">"?(i=r??V,p=-1):d[1]===void 0?p=-2:(p=i.lastIndex-d[2].length,l=d[1],i=d[3]===void 0?D:d[3]==='"'?at:ot):i===at||i===ot?i=D:i===tt||i===rt?i=V:(i=D,r=void 0);let g=i===D&&n[s+1].startsWith("/>")?" ":"";a+=i===V?c+Nt:p>=0?(o.push(l),c.slice(0,p)+it+c.slice(p)+R+g):c+R+(p===-2?s:g)}return[lt(n,a+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),o]},Q=class n{constructor({strings:e,_$litType$:t},o){let r;this.parts=[];let a=0,i=0,s=e.length-1,c=this.parts,[l,d]=It(e,t);if(this.el=n.createElement(l,o),B.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=B.nextNode())!==null&&c.length<s;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(it)){let h=d[i++],g=r.getAttribute(p).split(R),x=/([.?@])?(.*)/.exec(h);c.push({type:1,index:a,name:x[2],strings:g,ctor:x[1]==="."?ke:x[1]==="?"?Se:x[1]==="@"?$e:H}),r.removeAttribute(p)}else p.startsWith(R)&&(c.push({type:6,index:a}),r.removeAttribute(p));if(ct.test(r.tagName)){let p=r.textContent.split(R),h=p.length-1;if(h>0){r.textContent=de?de.emptyScript:"";for(let g=0;g<h;g++)r.append(p[g],K()),B.nextNode(),c.push({type:2,index:++a});r.append(p[h],K())}}}else if(r.nodeType===8)if(r.data===st)c.push({type:2,index:a});else{let p=-1;for(;(p=r.data.indexOf(R,p+1))!==-1;)c.push({type:7,index:a}),p+=R.length-1}a++}}static createElement(e,t){let o=W.createElement("template");return o.innerHTML=e,o}};function I(n,e,t=n,o){if(e===U)return e;let r=o!==void 0?t._$Co?.[o]:t._$Cl,a=Z(e)?void 0:e._$litDirective$;return r?.constructor!==a&&(r?._$AO?.(!1),a===void 0?r=void 0:(r=new a(n),r._$AT(n,t,o)),o!==void 0?(t._$Co??=[])[o]=r:t._$Cl=r),r!==void 0&&(e=I(n,r._$AS(n,e.values),r,o)),e}var we=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:o}=this._$AD,r=(e?.creationScope??W).importNode(t,!0);B.currentNode=r;let a=B.nextNode(),i=0,s=0,c=o[0];for(;c!==void 0;){if(i===c.index){let l;c.type===2?l=new Y(a,a.nextSibling,this,e):c.type===1?l=new c.ctor(a,c.name,c.strings,this,e):c.type===6&&(l=new ze(a,this,e)),this._$AV.push(l),c=o[++s]}i!==c?.index&&(a=B.nextNode(),i++)}return B.currentNode=W,r}p(e){let t=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}},Y=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=r,this._$Cv=r?.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=I(this,e,t),Z(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==U&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ot(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&&Z(this._$AH)?this._$AA.nextSibling.data=e:this.T(W.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:o}=e,r=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=Q.createElement(lt(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===r)this._$AH.p(t);else{let a=new we(r,this),i=a.u(this.options);a.p(t),this.T(i),this._$AH=a}}_$AC(e){let t=nt.get(e.strings);return t===void 0&&nt.set(e.strings,t=new Q(e)),t}k(e){Me(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,o,r=0;for(let a of e)r===t.length?t.push(o=new n(this.O(K()),this.O(K()),this,this.options)):o=t[r],o._$AI(a),r++;r<t.length&&(this._$AR(o&&o._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,r,a){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=a,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=k}_$AI(e,t=this,o,r){let a=this.strings,i=!1;if(a===void 0)e=I(this,e,t,0),i=!Z(e)||e!==this._$AH&&e!==U,i&&(this._$AH=e);else{let s=e,c,l;for(e=a[0],c=0;c<a.length-1;c++)l=I(this,s[o+c],t,c),l===U&&(l=this._$AH[c]),i||=!Z(l)||l!==this._$AH[c],l===k?e=k:e!==k&&(e+=(l??"")+a[c+1]),this._$AH[c]=l}i&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ke=class extends H{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Se=class extends H{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},$e=class extends H{constructor(e,t,o,r,a){super(e,t,o,r,a),this.type=5}_$AI(e,t=this){if((e=I(this,e,t,0)??k)===U)return;let o=this._$AH,r=e===k&&o!==k||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,a=e!==k&&(o===k||r);r&&this.element.removeEventListener(this.name,this,o),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)}},ze=class{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){I(this,e)}};var Ht=Ee.litHtmlPolyfillSupport;Ht?.(Q,Y),(Ee.litHtmlVersions??=[]).push("3.3.1");var j=(n,e,t)=>{let o=t?.renderBefore??e,r=o._$litPart$;if(r===void 0){let a=t?.renderBefore??null;o._$litPart$=r=new Y(e.insertBefore(K(),a),a,void 0,t??{})}return r._$AI(n),r};var Ce=globalThis,G=class extends L{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 U}};G._$litElement$=!0,G.finalized=!0,Ce.litElementHydrateSupport?.({LitElement:G});var Gt=Ce.litElementPolyfillSupport;Gt?.({LitElement:G});(Ce.litElementVersions??=[]).push("4.2.1");var dt={mode:"live",preset:"default",static:{root:"public/assets/pds/"},autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(n,e,...t){console[n](e,...t)}};async function pt(n,e={}){return e={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...e},new Promise(o=>{let r=document.createElement("dialog");dt.options?.liquidGlassEffects&&r.classList.add("liquid-glass"),e.size&&r.classList.add(`dialog-${e.size}`),e.type&&r.classList.add(`dialog-${e.type}`),e.class&&(Array.isArray(e.class)?r.classList.add(...e.class):r.classList.add(e.class));let a=Object.entries(e.buttons).map(([s,c])=>{let l=c.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${c.cancel?"button":"submit"}" class="${l}" value="${s}">${c.name}</button>`});if(e.useForm){r.innerHTML=`
3304
+ `}static applyStyles(e){if(!e||typeof e!="object"){e?.options?.log?.("error","[Generator] applyStyles requires a generator object");return}let t=e.layeredCSS||e.css||"";if(!t){e?.options?.log?.("warn","[Generator] No CSS available on designer to apply");return}n.installRuntimeStyles(t)}static installRuntimeStyles(e){try{if(typeof document>"u")return;if(typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype){let r=new CSSStyleSheet;r.replaceSync(e),r._pds=!0;let a=(document.adoptedStyleSheets||[]).filter(i=>i._pds!==!0);document.adoptedStyleSheets=[...a,r],n.__pdsRuntimeSheet=r;return}let t="pds-runtime-stylesheet",o=document.getElementById(t);if(!o){o=document.createElement("style"),o.id=t,o.type="text/css";let r=document.head||document.getElementsByTagName("head")[0];r?r.appendChild(o):document.documentElement.appendChild(o)}o.textContent=e}catch(t){console.warn("Generator.installRuntimeStyles failed:",t)}}};async function Ie(n,e=[]){try{let t=await PDS.registry.getStylesheet("primitives");if(n.adoptedStyleSheets=[t,...e],PDS.registry.isLive){let o=n.host?.tagName?.toLowerCase()||"unknown"}}catch(t){let o=n.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${o}> failed to adopt primitives:`,t),n.adoptedStyleSheets=e}}async function He(n,e=["primitives"],t=[]){try{let r=(await Promise.all(e.map(a=>PDS.registry.getStylesheet(a)))).filter(a=>a!==null);if(n.adoptedStyleSheets=[...r,...t],PDS.registry.isLive){let a=n.host?.tagName?.toLowerCase()||"unknown"}}catch(o){let r=n.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${r}> failed to adopt layers:`,o),n.adoptedStyleSheets=t}}function Ge(n){let e=new CSSStyleSheet;return e.replaceSync(n),e}function qe(){return oe.isLive}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(n="log",e,...t){if(this?.debug||this?.design?.debug||!1||n==="error"||n==="warn"){let r=console[n]||console.log;t.length>0?r(e,...t):r(e)}}var se=globalThis,le=se.ShadowRoot&&(se.ShadyCSS===void 0||se.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ke=Symbol(),Ve=new WeakMap,ce=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==Ke)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(le&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=Ve.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&Ve.set(t,e))}return e}toString(){return this.cssText}},Ze=n=>new ce(typeof n=="string"?n:n+"",void 0,Ke);var Qe=(n,e)=>{if(le)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),r=se.litNonce;r!==void 0&&o.setAttribute("nonce",r),o.textContent=t.cssText,n.appendChild(o)}},ve=le?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return Ze(t)})(n):n;var{is:Ft,defineProperty:Rt,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Dt,getOwnPropertySymbols:Bt,getPrototypeOf:Wt}=Object,de=globalThis,Ye=de.trustedTypes,Ut=Ye?Ye.emptyScript:"",jt=de.reactiveElementPolyfillSupport,q=(n,e)=>n,xe={toAttribute(n,e){switch(e){case Boolean:n=n?Ut:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Xe=(n,e)=>!Ft(n,e),Je={attribute:!0,type:String,converter:xe,reflect:!1,useDefault:!1,hasChanged:Xe};Symbol.metadata??=Symbol("metadata"),de.litPropertyMetadata??=new WeakMap;var L=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=Je){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),r=this.getPropertyDescriptor(e,o,t);r!==void 0&&Rt(this.prototype,e,r)}}static getPropertyDescriptor(e,t,o){let{get:r,set:a}=Pt(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get:r,set(i){let s=r?.call(this);a?.call(this,i),this.requestUpdate(e,s,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Je}static _$Ei(){if(this.hasOwnProperty(q("elementProperties")))return;let e=Wt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(q("properties"))){let t=this.properties,o=[...Dt(t),...Bt(t)];for(let r of o)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,r]of t)this.elementProperties.set(o,r)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let r=this._$Eu(t,o);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let r of o)t.unshift(ve(r))}else e!==void 0&&t.push(ve(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Qe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){let o=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,o);if(r!==void 0&&o.reflect===!0){let a=(o.converter?.toAttribute!==void 0?o.converter:xe).toAttribute(t,o.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){let o=this.constructor,r=o._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let a=o.getPropertyOptions(r),i=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:xe;this._$Em=r;let s=i.fromAttribute(t,a.type);this[r]=s??this._$Ej?.get(r)??s,this._$Em=null}}requestUpdate(e,t,o){if(e!==void 0){let r=this.constructor,a=this[e];if(o??=r.getPropertyOptions(e),!((o.hasChanged??Xe)(a,t)||o.useDefault&&o.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,o))))return;this.C(e,t,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:r,wrapped:a},i){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),a!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),r===!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[r,a]of this._$Ep)this[r]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[r,a]of o){let{wrapped:i}=a,s=this[r];i!==!0||this._$AL.has(r)||s===void 0||this.C(r,void 0,a,s)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[q("elementProperties")]=new Map,L[q("finalized")]=new Map,jt?.({ReactiveElement:L}),(de.reactiveElementVersions??=[]).push("2.1.1");var Me=globalThis,pe=Me.trustedTypes,et=pe?pe.createPolicy("lit-html",{createHTML:n=>n}):void 0,it="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,st="?"+R,Nt=`<${st}>`,W=document,K=()=>W.createComment(""),Z=n=>n===null||typeof n!="object"&&typeof n!="function",Ae=Array.isArray,Ot=n=>Ae(n)||typeof n?.[Symbol.iterator]=="function",we=`[
3305
+ \f\r]`,V=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,rt=/>/g,D=RegExp(`>|${we}(?:([^\\s"'>=/]+)(${we}*=${we}*(?:[^
3306
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ct=/^(?:script|style|textarea|title)$/i,Ce=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Cr=Ce(1),_r=Ce(2),Tr=Ce(3),U=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),nt=new WeakMap,B=W.createTreeWalker(W,129);function lt(n,e){if(!Ae(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(e):e}var It=(n,e)=>{let t=n.length-1,o=[],r,a=e===2?"<svg>":e===3?"<math>":"",i=V;for(let s=0;s<t;s++){let c=n[s],l,d,p=-1,h=0;for(;h<c.length&&(i.lastIndex=h,d=i.exec(c),d!==null);)h=i.lastIndex,i===V?d[1]==="!--"?i=tt:d[1]!==void 0?i=rt:d[2]!==void 0?(ct.test(d[2])&&(r=RegExp("</"+d[2],"g")),i=D):d[3]!==void 0&&(i=D):i===D?d[0]===">"?(i=r??V,p=-1):d[1]===void 0?p=-2:(p=i.lastIndex-d[2].length,l=d[1],i=d[3]===void 0?D:d[3]==='"'?at:ot):i===at||i===ot?i=D:i===tt||i===rt?i=V:(i=D,r=void 0);let g=i===D&&n[s+1].startsWith("/>")?" ":"";a+=i===V?c+Nt:p>=0?(o.push(l),c.slice(0,p)+it+c.slice(p)+R+g):c+R+(p===-2?s:g)}return[lt(n,a+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),o]},Q=class n{constructor({strings:e,_$litType$:t},o){let r;this.parts=[];let a=0,i=0,s=e.length-1,c=this.parts,[l,d]=It(e,t);if(this.el=n.createElement(l,o),B.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=B.nextNode())!==null&&c.length<s;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(it)){let h=d[i++],g=r.getAttribute(p).split(R),x=/([.?@])?(.*)/.exec(h);c.push({type:1,index:a,name:x[2],strings:g,ctor:x[1]==="."?Se:x[1]==="?"?$e:x[1]==="@"?ze:H}),r.removeAttribute(p)}else p.startsWith(R)&&(c.push({type:6,index:a}),r.removeAttribute(p));if(ct.test(r.tagName)){let p=r.textContent.split(R),h=p.length-1;if(h>0){r.textContent=pe?pe.emptyScript:"";for(let g=0;g<h;g++)r.append(p[g],K()),B.nextNode(),c.push({type:2,index:++a});r.append(p[h],K())}}}else if(r.nodeType===8)if(r.data===st)c.push({type:2,index:a});else{let p=-1;for(;(p=r.data.indexOf(R,p+1))!==-1;)c.push({type:7,index:a}),p+=R.length-1}a++}}static createElement(e,t){let o=W.createElement("template");return o.innerHTML=e,o}};function I(n,e,t=n,o){if(e===U)return e;let r=o!==void 0?t._$Co?.[o]:t._$Cl,a=Z(e)?void 0:e._$litDirective$;return r?.constructor!==a&&(r?._$AO?.(!1),a===void 0?r=void 0:(r=new a(n),r._$AT(n,t,o)),o!==void 0?(t._$Co??=[])[o]=r:t._$Cl=r),r!==void 0&&(e=I(n,r._$AS(n,e.values),r,o)),e}var ke=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:o}=this._$AD,r=(e?.creationScope??W).importNode(t,!0);B.currentNode=r;let a=B.nextNode(),i=0,s=0,c=o[0];for(;c!==void 0;){if(i===c.index){let l;c.type===2?l=new Y(a,a.nextSibling,this,e):c.type===1?l=new c.ctor(a,c.name,c.strings,this,e):c.type===6&&(l=new Ee(a,this,e)),this._$AV.push(l),c=o[++s]}i!==c?.index&&(a=B.nextNode(),i++)}return B.currentNode=W,r}p(e){let t=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}},Y=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=r,this._$Cv=r?.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=I(this,e,t),Z(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==U&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ot(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&&Z(this._$AH)?this._$AA.nextSibling.data=e:this.T(W.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:o}=e,r=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=Q.createElement(lt(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===r)this._$AH.p(t);else{let a=new ke(r,this),i=a.u(this.options);a.p(t),this.T(i),this._$AH=a}}_$AC(e){let t=nt.get(e.strings);return t===void 0&&nt.set(e.strings,t=new Q(e)),t}k(e){Ae(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,o,r=0;for(let a of e)r===t.length?t.push(o=new n(this.O(K()),this.O(K()),this,this.options)):o=t[r],o._$AI(a),r++;r<t.length&&(this._$AR(o&&o._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,r,a){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=a,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=k}_$AI(e,t=this,o,r){let a=this.strings,i=!1;if(a===void 0)e=I(this,e,t,0),i=!Z(e)||e!==this._$AH&&e!==U,i&&(this._$AH=e);else{let s=e,c,l;for(e=a[0],c=0;c<a.length-1;c++)l=I(this,s[o+c],t,c),l===U&&(l=this._$AH[c]),i||=!Z(l)||l!==this._$AH[c],l===k?e=k:e!==k&&(e+=(l??"")+a[c+1]),this._$AH[c]=l}i&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Se=class extends H{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},$e=class extends H{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},ze=class extends H{constructor(e,t,o,r,a){super(e,t,o,r,a),this.type=5}_$AI(e,t=this){if((e=I(this,e,t,0)??k)===U)return;let o=this._$AH,r=e===k&&o!==k||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,a=e!==k&&(o===k||r);r&&this.element.removeEventListener(this.name,this,o),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)}},Ee=class{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){I(this,e)}};var Ht=Me.litHtmlPolyfillSupport;Ht?.(Q,Y),(Me.litHtmlVersions??=[]).push("3.3.1");var j=(n,e,t)=>{let o=t?.renderBefore??e,r=o._$litPart$;if(r===void 0){let a=t?.renderBefore??null;o._$litPart$=r=new Y(e.insertBefore(K(),a),a,void 0,t??{})}return r._$AI(n),r};var _e=globalThis,G=class extends L{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 U}};G._$litElement$=!0,G.finalized=!0,_e.litElementHydrateSupport?.({LitElement:G});var Gt=_e.litElementPolyfillSupport;Gt?.({LitElement:G});(_e.litElementVersions??=[]).push("4.2.1");var dt={mode:"live",preset:"default",static:{root:"public/assets/pds/"},autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(n,e,...t){console[n](e,...t)}};async function pt(n,e={}){return e={...{title:"Confirm",type:"confirm",buttons:{ok:{name:"OK",primary:!0},cancel:{name:"Cancel",cancel:!0}}},...e},new Promise(o=>{let r=document.createElement("dialog");dt.options?.liquidGlassEffects&&r.classList.add("liquid-glass"),e.size&&r.classList.add(`dialog-${e.size}`),e.type&&r.classList.add(`dialog-${e.type}`),e.class&&(Array.isArray(e.class)?r.classList.add(...e.class):r.classList.add(e.class));let a=Object.entries(e.buttons).map(([s,c])=>{let l=c.primary?"btn-primary btn-sm":"btn-outline btn-sm";return`<button type="${c.cancel?"button":"submit"}" class="${l}" value="${s}">${c.name}</button>`});if(e.useForm){r.innerHTML=`
3307
3307
  <header>
3308
3308
  <h2>${e.title}</h2>
3309
3309
  </header>
@@ -3321,7 +3321,7 @@ export const ${e}CSS = \`${o}\`;
3321
3321
  ${a.join("")}
3322
3322
  </footer>
3323
3323
  </form>
3324
- `;let s=r.querySelector("#msg-container");typeof n=="object"&&n._$litType$?j(n,s):typeof n=="string"?s.textContent=n:j(n,s)}r.addEventListener("click",s=>{s.target.closest('button[value="cancel"]')&&(r.close(),o(!1))});let i=()=>{let s=r.querySelector("form");s?s.addEventListener("submit",c=>{c.preventDefault();let l;e.useForm&&c.submitter.value==="ok"?(console.log("Found form:",s),console.log("Form elements:",s?Array.from(s.elements):"no form"),l=new FormData(s),console.log("FormData entries:",Array.from(l.entries()))):l=c.submitter.value==="ok",r.close(),o(l)}):requestAnimationFrame(i)};i(),r.addEventListener("close",()=>{setTimeout(()=>r.remove(),200)}),document.body.appendChild(r),typeof e.rendered=="function"&&e.rendered(r),r.showModal()})}var pe=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(),o=this.tokenize(t),r=this.analyzeQuery(o,t),a=[];r.intents.has("color")&&a.push(...this.queryColors(r,t)),(r.intents.has("utility")||r.intents.has("border")||r.intents.has("layout")||t.includes("class"))&&a.push(...this.queryUtilities(r,t)),(r.intents.has("component")||r.entities.size>0)&&a.push(...this.queryComponents(r,t)),(r.intents.has("layout")||r.intents.has("pattern"))&&a.push(...this.queryPatterns(r,t)),r.intents.has("typography")&&a.push(...this.queryTypography(r,t)),r.intents.has("spacing")&&a.push(...this.querySpacing(r,t));let i=new Map;for(let s of a){let c=s.value;(!i.has(c)||i.get(c).score<s.score)&&i.set(c,s)}return Array.from(i.values()).sort((s,c)=>c.score-s.score).slice(0,10)}tokenize(e){return e.toLowerCase().replace(/[?!.]/g,"").split(/\s+/).filter(t=>t.length>0)}analyzeQuery(e,t){let o={intents:new Set,entities:new Set,modifiers:new Set,isQuestion:!1,tokens:e,fullText:t};o.isQuestion=this.questionWords.some(r=>e.includes(r));for(let[r,a]of Object.entries(this.intents))a.some(i=>e.includes(i)||t.includes(i))&&o.intents.add(r);for(let[r,a]of Object.entries(this.entities))a.some(i=>e.includes(i)||t.includes(i))&&o.entities.add(r);return(e.includes("hover")||t.includes("hover"))&&o.modifiers.add("hover"),(e.includes("focus")||t.includes("focus"))&&o.modifiers.add("focus"),(e.includes("active")||t.includes("active"))&&o.modifiers.add("active"),(e.includes("disabled")||t.includes("disabled"))&&o.modifiers.add("disabled"),o}queryColors(e,t){let o=[],r=this.pds.compiled;if(!r?.tokens?.colors)return o;let a=r.tokens.colors,i=Array.from(e.entities),s=Array.from(e.modifiers);if(s.includes("focus")&&e.intents.has("border")&&i.includes("input")&&o.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"))&&(o.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"}),o.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}`;o.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(i.includes("button")&&e.intents.has("color")){let c=s[0];c?o.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`}):o.push({text:"Button fill: var(--primary-fill)",value:"--primary-fill",icon:"palette",category:"Interactive Token",score:88,description:"Default button background color"})}return o}queryUtilities(e,t){let o=[],r=this.pds.ontology;if(!r?.utilities)return o;let a=r.utilities;return e.intents.has("border")&&a.filter(s=>s.includes("border")||s.includes("outline")).forEach(s=>{let c=80;t.includes("gradient")&&s.includes("gradient")&&(c=95),t.includes("glow")&&s.includes("glow")&&(c=95),o.push({text:`${s} - Border utility class`,value:s,icon:"code",category:"Utility Class",score:c,code:`<div class="${s}">...</div>`,description:this.describeUtility(s)})}),e.intents.has("layout")&&a.filter(s=>s.includes("flex")||s.includes("grid")||s.includes("items-")||s.includes("justify-")||s.includes("gap-")).forEach(s=>{o.push({text:`${s} - Layout utility`,value:s,icon:"layout",category:"Utility Class",score:85,code:`<div class="${s}">...</div>`,description:this.describeUtility(s)})}),t.includes("group")&&e.entities.has("button")&&o.push({text:".btn-group - Group buttons together",value:".btn-group",icon:"code",category:"Utility Class",score:90,code:`<div class="btn-group">
3324
+ `;let s=r.querySelector("#msg-container");typeof n=="object"&&n._$litType$?j(n,s):typeof n=="string"?s.textContent=n:j(n,s)}r.addEventListener("click",s=>{s.target.closest('button[value="cancel"]')&&(r.close(),o(!1))});let i=()=>{let s=r.querySelector("form");s?s.addEventListener("submit",c=>{c.preventDefault();let l;e.useForm&&c.submitter.value==="ok"?(console.log("Found form:",s),console.log("Form elements:",s?Array.from(s.elements):"no form"),l=new FormData(s),console.log("FormData entries:",Array.from(l.entries()))):l=c.submitter.value==="ok",r.close(),o(l)}):requestAnimationFrame(i)};i(),r.addEventListener("close",()=>{setTimeout(()=>r.remove(),200)}),document.body.appendChild(r),typeof e.rendered=="function"&&e.rendered(r),r.showModal()})}var ue=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(),o=this.tokenize(t),r=this.analyzeQuery(o,t),a=[];r.intents.has("color")&&a.push(...this.queryColors(r,t)),(r.intents.has("utility")||r.intents.has("border")||r.intents.has("layout")||t.includes("class"))&&a.push(...this.queryUtilities(r,t)),(r.intents.has("component")||r.entities.size>0)&&a.push(...this.queryComponents(r,t)),(r.intents.has("layout")||r.intents.has("pattern"))&&a.push(...this.queryPatterns(r,t)),r.intents.has("typography")&&a.push(...this.queryTypography(r,t)),r.intents.has("spacing")&&a.push(...this.querySpacing(r,t));let i=new Map;for(let s of a){let c=s.value;(!i.has(c)||i.get(c).score<s.score)&&i.set(c,s)}return Array.from(i.values()).sort((s,c)=>c.score-s.score).slice(0,10)}tokenize(e){return e.toLowerCase().replace(/[?!.]/g,"").split(/\s+/).filter(t=>t.length>0)}analyzeQuery(e,t){let o={intents:new Set,entities:new Set,modifiers:new Set,isQuestion:!1,tokens:e,fullText:t};o.isQuestion=this.questionWords.some(r=>e.includes(r));for(let[r,a]of Object.entries(this.intents))a.some(i=>e.includes(i)||t.includes(i))&&o.intents.add(r);for(let[r,a]of Object.entries(this.entities))a.some(i=>e.includes(i)||t.includes(i))&&o.entities.add(r);return(e.includes("hover")||t.includes("hover"))&&o.modifiers.add("hover"),(e.includes("focus")||t.includes("focus"))&&o.modifiers.add("focus"),(e.includes("active")||t.includes("active"))&&o.modifiers.add("active"),(e.includes("disabled")||t.includes("disabled"))&&o.modifiers.add("disabled"),o}queryColors(e,t){let o=[],r=this.pds.compiled;if(!r?.tokens?.colors)return o;let a=r.tokens.colors,i=Array.from(e.entities),s=Array.from(e.modifiers);if(s.includes("focus")&&e.intents.has("border")&&i.includes("input")&&o.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"))&&(o.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"}),o.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}`;o.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(i.includes("button")&&e.intents.has("color")){let c=s[0];c?o.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`}):o.push({text:"Button fill: var(--primary-fill)",value:"--primary-fill",icon:"palette",category:"Interactive Token",score:88,description:"Default button background color"})}return o}queryUtilities(e,t){let o=[],r=this.pds.ontology;if(!r?.utilities)return o;let a=r.utilities;return e.intents.has("border")&&a.filter(s=>s.includes("border")||s.includes("outline")).forEach(s=>{let c=80;t.includes("gradient")&&s.includes("gradient")&&(c=95),t.includes("glow")&&s.includes("glow")&&(c=95),o.push({text:`${s} - Border utility class`,value:s,icon:"code",category:"Utility Class",score:c,code:`<div class="${s}">...</div>`,description:this.describeUtility(s)})}),e.intents.has("layout")&&a.filter(s=>s.includes("flex")||s.includes("grid")||s.includes("items-")||s.includes("justify-")||s.includes("gap-")).forEach(s=>{o.push({text:`${s} - Layout utility`,value:s,icon:"layout",category:"Utility Class",score:85,code:`<div class="${s}">...</div>`,description:this.describeUtility(s)})}),t.includes("group")&&e.entities.has("button")&&o.push({text:".btn-group - Group buttons together",value:".btn-group",icon:"code",category:"Utility Class",score:90,code:`<div class="btn-group">
3325
3325
  <button class="btn-primary">One</button>
3326
3326
  <button class="btn-primary">Two</button>
3327
3327
  </div>`,description:"Container for grouped buttons with connected styling"}),o}queryComponents(e,t){let o=[],r=this.pds.ontology;return!r?.components&&!r?.primitives||(r.components&&r.components.forEach(a=>{let i=this.scoreMatch(t,a.name+" "+a.id);i>50&&o.push({text:`<${a.id}> - ${a.name}`,value:a.id,icon:"brackets-curly",category:"Web Component",score:i,code:`<${a.id}></${a.id}>`,description:a.description||`${a.name} web component`})}),r.primitives&&r.primitives.forEach(a=>{let i=this.scoreMatch(t,a.name+" "+a.id);if(i>50){let s=a.selectors?.[0]||a.id;o.push({text:`${s} - ${a.name}`,value:a.id,icon:"tag",category:"Primitive",score:i-5,code:this.generatePrimitiveExample(a),description:a.description||`${a.name} primitive element`})}}),t.includes("icon")&&(t.includes("only")||t.includes("button"))&&o.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">
@@ -3339,7 +3339,7 @@ export const ${e}CSS = \`${o}\`;
3339
3339
  </section>`,description:"Semantic section element for content grouping"}))),o}queryTypography(e,t){let o=[],r=this.pds.compiled;if(!r?.tokens?.typography)return o;let a=r.tokens.typography;return(t.includes("heading")||t.includes("title"))&&o.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"))&&o.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"}),o}querySpacing(e,t){let o=[],r=this.pds.compiled;if(!r?.tokens?.spacing)return o;let a=r.tokens.spacing;for(let[i,s]of Object.entries(a))["2","4","6","8"].includes(i)&&o.push({text:`Spacing ${i}: var(--spacing-${i})`,value:`--spacing-${i}`,icon:"ruler",category:"Spacing Token",score:75,cssVar:`var(--spacing-${i})`,description:`Spacing value: ${s}`});return o}scoreMatch(e,t){let o=e.toLowerCase(),r=t.toLowerCase(),a=0;if(o===r)return 100;r.includes(o)&&(a+=80);let i=this.tokenize(o),s=this.tokenize(r),c=i.filter(l=>s.includes(l)).length;return a+=c/i.length*40,r.startsWith(o)&&(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">
3340
3340
  <h3>Title</h3>
3341
3341
  <p>Content</p>
3342
- </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 _e={};We(_e,{deepMerge:()=>ut,isObject:()=>ue});function ue(n){return n&&typeof n=="object"&&!Array.isArray(n)}function ut(n,e){let t={...n};return ue(n)&&ue(e)&&Object.keys(e).forEach(o=>{ue(e[o])?o in n?t[o]=ut(n[o],e[o]):Object.assign(t,{[o]:e[o]}):Object.assign(t,{[o]:e[o]})}),t}var ht=[{selector:"nav[data-dropdown]",description:"Enhances a nav element with data-dropdown to function as a dropdown menu.",demoHtml:`
3342
+ </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 Te={};Ue(Te,{deepMerge:()=>ut,isObject:()=>he});function he(n){return n&&typeof n=="object"&&!Array.isArray(n)}function ut(n,e){let t={...n};return he(n)&&he(e)&&Object.keys(e).forEach(o=>{he(e[o])?o in n?t[o]=ut(n[o],e[o]):Object.assign(t,{[o]:e[o]}):Object.assign(t,{[o]:e[o]})}),t}var ht=[{selector:"nav[data-dropdown]",description:"Enhances a nav element with data-dropdown to function as a dropdown menu.",demoHtml:`
3343
3343
  <nav data-dropdown>
3344
3344
  <button class="btn-primary">Menu</button>
3345
3345
  <menu>
@@ -3378,11 +3378,11 @@ export const ${e}CSS = \`${o}\`;
3378
3378
  <button class="btn-primary btn-working">
3379
3379
  <span>Saving</span>
3380
3380
  </button>
3381
- `.trim()}];function qt(n){if(n.dataset.enhancedDropdown)return;n.dataset.enhancedDropdown="true";let e=n.querySelector("menu");if(!e)return;let t=n.querySelector("[data-dropdown-toggle]")||n.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 o=()=>{let s=(n.getAttribute("data-mode")||"auto").toLowerCase();if(s==="up"||s==="down")return s;let c=n.getBoundingClientRect(),l=Math.max(0,window.innerHeight-c.bottom);return Math.max(0,c.top)>l?"up":"down"},r=()=>{n.dataset.dropdownDirection=o(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},a=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},i=()=>{e.getAttribute("aria-hidden")==="false"?a():r()};t?.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),i()}),document.addEventListener("click",s=>{n.contains(s.target)||a()}),n.addEventListener("keydown",s=>{s.key==="Escape"&&(a(),t?.focus())}),n.addEventListener("focusout",s=>{(!s.relatedTarget||!n.contains(s.relatedTarget))&&a()})}function Vt(n){if(n.dataset.enhancedToggle)return;n.dataset.enhancedToggle="true";let e=n.querySelector('input[type="checkbox"]');if(!e)return;n.hasAttribute("tabindex")||n.setAttribute("tabindex","0"),n.setAttribute("role","switch"),n.setAttribute("aria-checked",e.checked?"true":"false");let t=document.createElement("span");t.className="toggle-switch",t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");let o=document.createElement("span");o.className="toggle-knob",t.appendChild(o),n.insertBefore(t,e.nextSibling);let r=()=>{n.setAttribute("aria-checked",e.checked?"true":"false")},a=()=>{e.disabled||(e.checked=!e.checked,r(),e.dispatchEvent(new Event("change",{bubbles:!0})))};n.addEventListener("click",i=>{i.preventDefault(),a()}),n.addEventListener("keydown",i=>{(i.key===" "||i.key==="Enter")&&(i.preventDefault(),a())}),e.addEventListener("change",r)}function Kt(n){if(n.dataset.enhancedRange)return;let e=n.closest("label"),t=e?.classList.contains("range-output"),o=n.id||`range-${Math.random().toString(36).substring(2,11)}`,r=`${o}-output`;if(n.id=o,t){let a=e.querySelector("span");if(a&&!a.classList.contains("range-output-wrapper")){let i=document.createElement("span");i.className="range-output-wrapper",i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center";let s=document.createElement("span");s.textContent=a.textContent,i.appendChild(s);let c=document.createElement("output");c.id=r,c.setAttribute("for",o),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=n.value,i.appendChild(c),a.textContent="",a.appendChild(i);let l=()=>{c.textContent=n.value};n.addEventListener("input",l)}}else{let a=n.closest(".range-container");a||(a=document.createElement("div"),a.className="range-container",n.parentNode?.insertBefore(a,n),a.appendChild(n)),a.style.position="relative";let i=document.createElement("output");i.id=r,i.setAttribute("for",o),i.className="range-bubble",i.setAttribute("aria-live","polite"),a.appendChild(i);let s=()=>{let d=parseFloat(n.min)||0,p=parseFloat(n.max)||100,h=parseFloat(n.value),g=(h-d)/(p-d);i.style.left=`calc(${g*100}% )`,i.textContent=String(h)},c=()=>i.classList.add("visible"),l=()=>i.classList.remove("visible");n.addEventListener("input",s),n.addEventListener("pointerdown",c),n.addEventListener("pointerup",l),n.addEventListener("pointerleave",l),n.addEventListener("focus",c),n.addEventListener("blur",l),s()}n.dataset.enhancedRange="1"}function Zt(n){let e=n.closest("label");if(!e||e.querySelector(".required-asterisk"))return;let t=document.createElement("span");t.classList.add("required-asterisk"),t.textContent="*",t.style.marginLeft="4px",e.querySelector("span").appendChild(t);let o=n.closest("form");if(o&&!o.querySelector(".required-legend")){let r=document.createElement("div");r.classList.add("required-legend","pill","pill-outline"),r.style.fontSize="0.9em",r.style.marginBottom="8px",r.textContent="* Required fields",o.insertBefore(r,o.querySelector(".form-actions")||o.lastElementChild)}}function Qt(n){if(n.dataset.enhancedOpenGroup)return;n.dataset.enhancedOpenGroup="true",n.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=n.querySelector('input[type="radio"], input[type="checkbox"]');n.appendChild(e),e.addEventListener("keydown",o=>{if(o.key==="Enter"||o.key==="Tab"){let r=e.value.trim();if(r){o.preventDefault();let a=t.type==="radio"?"radio":"checkbox",i=`open-group-${Math.random().toString(36).substring(2,11)}`,s=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=r;let l=document.createElement("input");l.type=a,l.name=t.name||n.getAttribute("data-name")||"open-group",l.value=r,l.id=i,s.appendChild(c),s.appendChild(l),n.insertBefore(s,e),e.value=""}}else if(o.key==="Backspace"&&e.value===""){o.preventDefault();let r=n.querySelectorAll("label");r.length>0&&r[r.length-1].remove()}})}function Yt(n){if(n.dataset.enhancedBtnWorking)return;n.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(r=>{r.forEach(a=>{if(a.attributeName==="class"){let i=n.classList.contains("btn-working"),s=n.querySelector("pds-icon");if(i)if(s)e||(e=s.getAttribute("icon")),s.setAttribute("icon","circle-notch");else{let c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),n.insertBefore(c,n.firstChild),t=!0}else a.oldValue?.includes("btn-working")&&s&&(t?(s.remove(),t=!1):e&&(s.setAttribute("icon",e),e=null))}})}).observe(n,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Jt=new Map([["nav[data-dropdown]",qt],["label[data-toggle]",Vt],['input[type="range"]',Kt],["form [required]",Zt],["fieldset[role=group][data-open]",Qt],["button, a[class*='btn-']",Yt]]),gt=ht.map(n=>({...n,run:Jt.get(n.selector)||(()=>{})}));var ft="pds",Xt=/^([a-z][a-z0-9+\-.]*:)?\/\//i,mt=/^[a-z]:/i;function J(n=""){return n.endsWith("/")?n:`${n}/`}function er(n="",e=ft){let t=n.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function tr(n){return n.replace(/^\.\/+/,"")}function rr(n){return mt.test(n)?n.replace(mt,"").replace(/^\/+/,""):n}function or(n){return n.startsWith("public/")?n.substring(7):n}function bt(n,e={}){let t=e.segment||ft,o=e.defaultRoot||`/assets/${t}/`,r=n?.public&&n.public?.root||n?.static&&n.static?.root||null;if(!r||typeof r!="string")return J(o);let a=r.trim();return a?(a=a.replace(/\\/g,"/"),a=er(a,t),a=J(a),Xt.test(a)?a:(a=tr(a),a=rr(a),a.startsWith("/")||(a=or(a),a.startsWith("/")||(a=`/${a}`),a=a.replace(/\/+/g,(i,s)=>s===0?i:"/")),J(a))):J(o)}function yt(n){let e=n.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 r=document.createElement("canvas").getContext("2d");if(!r)return!1;let a="mmmmmmmmmmlli",i="72px",s="monospace";r.font=`${i} ${s}`;let c=r.measureText(a).width;r.font=`${i} "${e}", ${s}`;let l=r.measureText(a).width;return c!==l}function ar(n){return n?n.split(",").map(o=>o.trim())[0].replace(/['"]/g,"").trim():null}async function nr(n,e={}){if(!n)return Promise.resolve();let{weights:t=[400,500,600,700],italic:o=!1}=e,r=ar(n);if(!r||yt(r))return Promise.resolve();let a=encodeURIComponent(r);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${a}"]`)?(console.log(`Font "${r}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${r}" from Google Fonts...`),new Promise((s,c)=>{let l=document.createElement("link");l.rel="stylesheet";let d=o?`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",r),l.onload=()=>{console.log(`Successfully loaded font "${r}"`),s()},l.onerror=()=>{console.warn(`Failed to load font "${r}" from Google Fonts`),c(new Error(`Failed to load font: ${r}`))},document.head.appendChild(l),setTimeout(()=>{yt(r)||console.warn(`Font "${r}" did not load within timeout`),s()},5e3)}))}async function vt(n){if(!n)return Promise.resolve();let e=new Set;n.fontFamilyHeadings&&e.add(n.fontFamilyHeadings),n.fontFamilyBody&&e.add(n.fontFamilyBody),n.fontFamilyMono&&e.add(n.fontFamilyMono);let t=Array.from(e).map(o=>nr(o).catch(r=>{console.warn(`Could not load font: ${o}`,r)}));await Promise.all(t)}var Fe=class extends EventTarget{},m=new Fe;m.Generator=ae;m.registry=qe;m.ontology=Ne;m.adoptLayers=Ie;m.adoptPrimitives=Oe;m.createStylesheet=He;m.isLiveMode=Ge;m.enums=u;m.ask=pt;m.common=_e;m.presets=C;m.findComponentForElement=je;m.query=async function(n){return await new pe(m).search(n)};function St(n){let e=typeof CustomEvent=="function";try{let t=e?new CustomEvent("pds:ready",{detail:n}):new Event("pds:ready");m.dispatchEvent(t)}catch{}if(typeof document<"u")if(e){let t={detail:n,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&&m.registry?._designer?m.registry._designer.compiled:null},enumerable:!0,configurable:!1});typeof window<"u"&&(window.PDS=m);typeof document<"u"&&m.addEventListener("pds:ready",n=>{let e=n.detail?.mode;e&&(document.documentElement.classList.add(`pds-${e}`),e==="live"&&document.documentElement.classList.add("pds-ready"))});var Le="pure-ds-theme",N=null,X=null;function $t(n){try{if(typeof document>"u")return;let e="light";n?n==="system"?e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e=n:e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e)}catch{}}function zt(n){try{if(N&&X){try{typeof N.removeEventListener=="function"?N.removeEventListener("change",X):typeof N.removeListener=="function"&&N.removeListener(X)}catch{}N=null,X=null}if(n==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=o=>{let r=o?.matches===void 0?e.matches:o.matches;try{let a=r?"dark":"light";document.documentElement.setAttribute("data-theme",a),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:a,source:"system"}}))}catch{}};N=e,X=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(Le)||null}catch{return null}},set(n){try{if(typeof window>"u")return;n==null?localStorage.removeItem(Le):localStorage.setItem(Le,n),$t(n),zt(n),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:n,source:"api"}}))}catch{}}});m.defaultEnhancers=gt;function Et(n={},e={}){let t=Number(e.minContrast||4.5),o=s=>{let c=String(s||"").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}},r=s=>{let{r:c,g:l,b:d}=o(s),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=(s,c)=>{if(!s||!c)return 0;let l=r(s),d=r(c),p=Math.max(l,d),h=Math.min(l,d);return(p+.05)/(h+.05)},i=[];try{let c=new m.Generator({design:structuredClone(n)}).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&&i.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&&i.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&&i.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 x={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(x.primaryFill,"#ffffff");f<t&&i.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(x.primaryText,x.surfaceBg);b<t&&i.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(s){i.push({path:"/",message:`Validation failed: ${String(s?.message||s)}`,ratio:0,min:0})}return{ok:i.length===0,issues:i}}m.validateDesign=Et;function sr(n=[],e={}){let t=[],o=Array.isArray(n)?n:n&&typeof n=="object"?Object.values(n):[];for(let r of o){let a,i=null;if(typeof r=="string"){let l=String(r).toLowerCase(),d=C?.[l]||Object.values(C||{}).find(p=>ee(p.name)===l||String(p.name||"").toLowerCase()===l);if(!d){t.push({name:r,ok:!1,issues:[{path:"/",message:`Preset not found: ${r}`,ratio:0,min:0}]});continue}a=d.name||l,i=structuredClone(d)}else if(r&&typeof r=="object")if(a=r.name||r.preset||void 0,"preset"in r||"design"in r){let l=String(r.preset||"default").toLowerCase(),d=C?.[l]||Object.values(C||{}).find(h=>ee(h.name)===l||String(h.name||"").toLowerCase()===l);if(!d){t.push({name:a,ok:!1,issues:[{path:"/",message:`Preset not found: ${r.preset}`,ratio:0,min:0}]});continue}let p=structuredClone(d);r.design&&typeof r.design=="object"&&(p=Re(p,structuredClone(r.design))),i=p}else i=r;if(!i){t.push({name:a,ok:!1,issues:[{path:"/",message:"Invalid design entry",ratio:0,min:0}]});continue}let{ok:s,issues:c}=Et(i,e);t.push({name:a,ok:s,issues:c})}return{ok:t.every(r=>r.ok),results:t}}m.validateDesigns=sr;function Mt({manageTheme:n,themeStorageKey:e}){let t="light",o=null;if(n&&typeof window<"u"){try{o=localStorage.getItem(e)||null}catch{o=null}try{$t(o),zt(o)}catch{}o?o==="system"?t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=o:t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:t,storedTheme:o}}function Re(n={},e={}){if(!e||typeof e!="object")return n;let t=Array.isArray(n)?[...n]:{...n};for(let[o,r]of Object.entries(e))r&&typeof r=="object"&&!Array.isArray(r)?t[o]=Re(t[o]&&typeof t[o]=="object"?t[o]:{},r):t[o]=r;return t}function ee(n=""){return String(n).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function re(n){if(n==null)return n;if(typeof n=="function")return;if(typeof n!="object")return n;if(Array.isArray(n))return n.map(t=>re(t)).filter(t=>t!==void 0);let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t];if(typeof o!="function"){let r=re(o);r!==void 0&&(e[t]=r)}}return e}var cr=/^[a-z][a-z0-9+\-.]*:\/\//i,te=(()=>{try{return import.meta.url}catch{return}})();function he(n,e={}){if(!n||cr.test(n))return n;let{preferModule:t=!0}=e,o=()=>{if(!te)return null;try{return new URL(n,te).href}catch{return null}},r=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(n,window.location.origin).href}catch{return null}};return(t?o()||r():r()||o())||n}var ge=n=>typeof n=="string"&&n.length&&!n.endsWith("/")?`${n}/`:n,kt=(()=>{if(te)try{let n=new URL(te);if(/\/public\/assets\/js\//.test(n.pathname))return new URL("../pds/",te).href}catch{return}})();function At(n){let e=!!(n?.public?.root||n?.static?.root),t=bt(n);return!e&&kt&&(t=kt),ge(he(t))}function Ct(n={},e={}){let t=typeof n=="object"&&("colors"in n||"typography"in n||"spatialRhythm"in n||"shape"in n||"behavior"in n||"layout"in n||"advanced"in n||"a11y"in n||"components"in n||"icons"in n),o=n&&n.enhancers;o&&!Array.isArray(o)&&(o=Object.values(o));let r=o??e.enhancers??[],a=n&&n.preset,i=n&&n.design,s="preset"in(n||{})||"design"in(n||{})||"enhancers"in(n||{}),c,l=null;if(s){let d=String(a||"default").toLowerCase(),p=C?.[d]||Object.values(C||{}).find(M=>ee(M.name)===d||String(M.name||"").toLowerCase()===d);if(!p)throw new Error(`PDS preset not found: "${a||"default"}"`);l={id:p.id||ee(p.name),name:p.name||p.id||String(d)};let h=structuredClone(p);if(i&&typeof i=="object"){let M=re(i);h=Re(h,structuredClone(M))}let{mode:g,autoDefine:x,applyGlobalStyles:f,manageTheme:b,themeStorageKey:E,preloadStyles:F,criticalLayers:_,preset:S,design:$,enhancers:z,log:T,...me}=n;c={...me,design:h,preset:l.name,log:T||ne}}else if(t){let{log:d,...p}=n;c={design:structuredClone(p),log:d||ne}}else{let d=C?.default||Object.values(C||{}).find(p=>ee(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:ne}}return{generatorConfig:c,enhancers:r,presetInfo:l}}async function _t(n){let{autoDefineBaseURL:e="/auto-define/",autoDefinePreload:t=[],autoDefineMapper:o=null,enhancers:r=[],autoDefineOverrides:a=null,autoDefinePreferModule:i=!0}=n,s=(()=>{let l=new Map;return(m.defaultEnhancers||[]).forEach(d=>l.set(d.selector,d)),(r||[]).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(()=>(wt(),xt));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:{},x={baseURL:e&&ge(he(e,{preferModule:i})),predefine:t,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:s,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 o=="function")try{let b=o(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(x),t.length>0&&typeof l.define=="function"&&await l.define(...t,{baseURL:e,mapper:x.mapper,onError:x.onError}))}return{autoDefiner:c}}async function lr(n){if(!n||typeof n!="object")throw new Error("PDS.start({ mode: 'live', ... }) requires a valid configuration object");if(typeof document<"u"&&document.adoptedStyleSheets){let s=`
3381
+ `.trim()}];function qt(n){if(n.dataset.enhancedDropdown)return;n.dataset.enhancedDropdown="true";let e=n.querySelector("menu");if(!e)return;let t=n.querySelector("[data-dropdown-toggle]")||n.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 o=()=>{let s=(n.getAttribute("data-mode")||"auto").toLowerCase();if(s==="up"||s==="down")return s;let c=n.getBoundingClientRect(),l=Math.max(0,window.innerHeight-c.bottom);return Math.max(0,c.top)>l?"up":"down"},r=()=>{n.dataset.dropdownDirection=o(),e.setAttribute("aria-hidden","false"),t?.setAttribute("aria-expanded","true")},a=()=>{e.setAttribute("aria-hidden","true"),t?.setAttribute("aria-expanded","false")},i=()=>{e.getAttribute("aria-hidden")==="false"?a():r()};t?.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),i()}),document.addEventListener("click",s=>{n.contains(s.target)||a()}),n.addEventListener("keydown",s=>{s.key==="Escape"&&(a(),t?.focus())}),n.addEventListener("focusout",s=>{(!s.relatedTarget||!n.contains(s.relatedTarget))&&a()})}function Vt(n){if(n.dataset.enhancedToggle)return;n.dataset.enhancedToggle="true";let e=n.querySelector('input[type="checkbox"]');if(!e)return;n.hasAttribute("tabindex")||n.setAttribute("tabindex","0"),n.setAttribute("role","switch"),n.setAttribute("aria-checked",e.checked?"true":"false");let t=document.createElement("span");t.className="toggle-switch",t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true");let o=document.createElement("span");o.className="toggle-knob",t.appendChild(o),n.insertBefore(t,e.nextSibling);let r=()=>{n.setAttribute("aria-checked",e.checked?"true":"false")},a=()=>{e.disabled||(e.checked=!e.checked,r(),e.dispatchEvent(new Event("change",{bubbles:!0})))};n.addEventListener("click",i=>{i.preventDefault(),a()}),n.addEventListener("keydown",i=>{(i.key===" "||i.key==="Enter")&&(i.preventDefault(),a())}),e.addEventListener("change",r)}function Kt(n){if(n.dataset.enhancedRange)return;let e=n.closest("label"),t=e?.classList.contains("range-output"),o=n.id||`range-${Math.random().toString(36).substring(2,11)}`,r=`${o}-output`;if(n.id=o,t){let a=e.querySelector("span");if(a&&!a.classList.contains("range-output-wrapper")){let i=document.createElement("span");i.className="range-output-wrapper",i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center";let s=document.createElement("span");s.textContent=a.textContent,i.appendChild(s);let c=document.createElement("output");c.id=r,c.setAttribute("for",o),c.style.color="var(--surface-text-secondary, var(--color-text-secondary))",c.style.fontSize="0.875rem",c.textContent=n.value,i.appendChild(c),a.textContent="",a.appendChild(i);let l=()=>{c.textContent=n.value};n.addEventListener("input",l)}}else{let a=n.closest(".range-container");a||(a=document.createElement("div"),a.className="range-container",n.parentNode?.insertBefore(a,n),a.appendChild(n)),a.style.position="relative";let i=document.createElement("output");i.id=r,i.setAttribute("for",o),i.className="range-bubble",i.setAttribute("aria-live","polite"),a.appendChild(i);let s=()=>{let d=parseFloat(n.min)||0,p=parseFloat(n.max)||100,h=parseFloat(n.value),g=(h-d)/(p-d);i.style.left=`calc(${g*100}% )`,i.textContent=String(h)},c=()=>i.classList.add("visible"),l=()=>i.classList.remove("visible");n.addEventListener("input",s),n.addEventListener("pointerdown",c),n.addEventListener("pointerup",l),n.addEventListener("pointerleave",l),n.addEventListener("focus",c),n.addEventListener("blur",l),s()}n.dataset.enhancedRange="1"}function Zt(n){let e=n.closest("label");if(!e||e.querySelector(".required-asterisk"))return;let t=document.createElement("span");t.classList.add("required-asterisk"),t.textContent="*",t.style.marginLeft="4px",e.querySelector("span").appendChild(t);let o=n.closest("form");if(o&&!o.querySelector(".required-legend")){let r=document.createElement("div");r.classList.add("required-legend","pill","pill-outline"),r.style.fontSize="0.9em",r.style.marginBottom="8px",r.textContent="* Required fields",o.insertBefore(r,o.querySelector(".form-actions")||o.lastElementChild)}}function Qt(n){if(n.dataset.enhancedOpenGroup)return;n.dataset.enhancedOpenGroup="true",n.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=n.querySelector('input[type="radio"], input[type="checkbox"]');n.appendChild(e),e.addEventListener("keydown",o=>{if(o.key==="Enter"||o.key==="Tab"){let r=e.value.trim();if(r){o.preventDefault();let a=t.type==="radio"?"radio":"checkbox",i=`open-group-${Math.random().toString(36).substring(2,11)}`,s=document.createElement("label"),c=document.createElement("span");c.setAttribute("data-label",""),c.textContent=r;let l=document.createElement("input");l.type=a,l.name=t.name||n.getAttribute("data-name")||"open-group",l.value=r,l.id=i,s.appendChild(c),s.appendChild(l),n.insertBefore(s,e),e.value=""}}else if(o.key==="Backspace"&&e.value===""){o.preventDefault();let r=n.querySelectorAll("label");r.length>0&&r[r.length-1].remove()}})}function Yt(n){if(n.dataset.enhancedBtnWorking)return;n.dataset.enhancedBtnWorking="true";let e=null,t=!1;new MutationObserver(r=>{r.forEach(a=>{if(a.attributeName==="class"){let i=n.classList.contains("btn-working"),s=n.querySelector("pds-icon");if(i)if(s)e||(e=s.getAttribute("icon")),s.setAttribute("icon","circle-notch");else{let c=document.createElement("pds-icon");c.setAttribute("icon","circle-notch"),c.setAttribute("size","sm"),n.insertBefore(c,n.firstChild),t=!0}else a.oldValue?.includes("btn-working")&&s&&(t?(s.remove(),t=!1):e&&(s.setAttribute("icon",e),e=null))}})}).observe(n,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var Jt=new Map([["nav[data-dropdown]",qt],["label[data-toggle]",Vt],['input[type="range"]',Kt],["form [required]",Zt],["fieldset[role=group][data-open]",Qt],["button, a[class*='btn-']",Yt]]),gt=ht.map(n=>({...n,run:Jt.get(n.selector)||(()=>{})}));var ft="pds",Xt=/^([a-z][a-z0-9+\-.]*:)?\/\//i,mt=/^[a-z]:/i;function J(n=""){return n.endsWith("/")?n:`${n}/`}function er(n="",e=ft){let t=n.replace(/\/+$/,"");return new RegExp(`(?:^|/)${e}$`,"i").test(t)?t:`${t}/${e}`}function tr(n){return n.replace(/^\.\/+/,"")}function rr(n){return mt.test(n)?n.replace(mt,"").replace(/^\/+/,""):n}function or(n){return n.startsWith("public/")?n.substring(7):n}function bt(n,e={}){let t=e.segment||ft,o=e.defaultRoot||`/assets/${t}/`,r=n?.public&&n.public?.root||n?.static&&n.static?.root||null;if(!r||typeof r!="string")return J(o);let a=r.trim();return a?(a=a.replace(/\\/g,"/"),a=er(a,t),a=J(a),Xt.test(a)?a:(a=tr(a),a=rr(a),a.startsWith("/")||(a=or(a),a.startsWith("/")||(a=`/${a}`),a=a.replace(/\/+/g,(i,s)=>s===0?i:"/")),J(a))):J(o)}function yt(n){let e=n.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 r=document.createElement("canvas").getContext("2d");if(!r)return!1;let a="mmmmmmmmmmlli",i="72px",s="monospace";r.font=`${i} ${s}`;let c=r.measureText(a).width;r.font=`${i} "${e}", ${s}`;let l=r.measureText(a).width;return c!==l}function ar(n){return n?n.split(",").map(o=>o.trim())[0].replace(/['"]/g,"").trim():null}async function nr(n,e={}){if(!n)return Promise.resolve();let{weights:t=[400,500,600,700],italic:o=!1}=e,r=ar(n);if(!r||yt(r))return Promise.resolve();let a=encodeURIComponent(r);return document.querySelector(`link[href*="fonts.googleapis.com"][href*="${a}"]`)?(console.log(`Font "${r}" is already loading or loaded`),Promise.resolve()):(console.log(`Loading font "${r}" from Google Fonts...`),new Promise((s,c)=>{let l=document.createElement("link");l.rel="stylesheet";let d=o?`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",r),l.onload=()=>{console.log(`Successfully loaded font "${r}"`),s()},l.onerror=()=>{console.warn(`Failed to load font "${r}" from Google Fonts`),c(new Error(`Failed to load font: ${r}`))},document.head.appendChild(l),setTimeout(()=>{yt(r)||console.warn(`Font "${r}" did not load within timeout`),s()},5e3)}))}async function vt(n){if(!n)return Promise.resolve();let e=new Set;n.fontFamilyHeadings&&e.add(n.fontFamilyHeadings),n.fontFamilyBody&&e.add(n.fontFamilyBody),n.fontFamilyMono&&e.add(n.fontFamilyMono);let t=Array.from(e).map(o=>nr(o).catch(r=>{console.warn(`Could not load font: ${o}`,r)}));await Promise.all(t)}var Re=class extends EventTarget{},m=new Re;m.Generator=ne;m.registry=oe;m.ontology=Oe;m.adoptLayers=He;m.adoptPrimitives=Ie;m.createStylesheet=Ge;m.isLiveMode=qe;m.enums=u;m.ask=pt;m.common=Te;m.presets=C;m.findComponentForElement=Ne;m.query=async function(n){return await new ue(m).search(n)};function St(n){let e=typeof CustomEvent=="function";try{let t=e?new CustomEvent("pds:ready",{detail:n}):new Event("pds:ready");m.dispatchEvent(t)}catch{}if(typeof document<"u")if(e){let t={detail:n,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&&m.registry?._designer?m.registry._designer.compiled:null},enumerable:!0,configurable:!1});typeof window<"u"&&(window.PDS=m);typeof document<"u"&&m.addEventListener("pds:ready",n=>{let e=n.detail?.mode;e&&(document.documentElement.classList.add(`pds-${e}`),e==="live"&&document.documentElement.classList.add("pds-ready"))});var Fe="pure-ds-theme",N=null,X=null;function $t(n){try{if(typeof document>"u")return;let e="light";n?n==="system"?e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e=n:e=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e)}catch{}}function zt(n){try{if(N&&X){try{typeof N.removeEventListener=="function"?N.removeEventListener("change",X):typeof N.removeListener=="function"&&N.removeListener(X)}catch{}N=null,X=null}if(n==="system"&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=o=>{let r=o?.matches===void 0?e.matches:o.matches;try{let a=r?"dark":"light";document.documentElement.setAttribute("data-theme",a),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:a,source:"system"}}))}catch{}};N=e,X=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(Fe)||null}catch{return null}},set(n){try{if(typeof window>"u")return;n==null?localStorage.removeItem(Fe):localStorage.setItem(Fe,n),$t(n),zt(n),m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:n,source:"api"}}))}catch{}}});m.defaultEnhancers=gt;function Et(n={},e={}){let t=Number(e.minContrast||4.5),o=s=>{let c=String(s||"").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}},r=s=>{let{r:c,g:l,b:d}=o(s),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=(s,c)=>{if(!s||!c)return 0;let l=r(s),d=r(c),p=Math.max(l,d),h=Math.min(l,d);return(p+.05)/(h+.05)},i=[];try{let c=new m.Generator({design:structuredClone(n)}).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&&i.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&&i.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&&i.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 x={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(x.primaryFill,"#ffffff");f<t&&i.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(x.primaryText,x.surfaceBg);b<t&&i.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(s){i.push({path:"/",message:`Validation failed: ${String(s?.message||s)}`,ratio:0,min:0})}return{ok:i.length===0,issues:i}}m.validateDesign=Et;function sr(n=[],e={}){let t=[],o=Array.isArray(n)?n:n&&typeof n=="object"?Object.values(n):[];for(let r of o){let a,i=null;if(typeof r=="string"){let l=String(r).toLowerCase(),d=C?.[l]||Object.values(C||{}).find(p=>ee(p.name)===l||String(p.name||"").toLowerCase()===l);if(!d){t.push({name:r,ok:!1,issues:[{path:"/",message:`Preset not found: ${r}`,ratio:0,min:0}]});continue}a=d.name||l,i=structuredClone(d)}else if(r&&typeof r=="object")if(a=r.name||r.preset||void 0,"preset"in r||"design"in r){let l=String(r.preset||"default").toLowerCase(),d=C?.[l]||Object.values(C||{}).find(h=>ee(h.name)===l||String(h.name||"").toLowerCase()===l);if(!d){t.push({name:a,ok:!1,issues:[{path:"/",message:`Preset not found: ${r.preset}`,ratio:0,min:0}]});continue}let p=structuredClone(d);r.design&&typeof r.design=="object"&&(p=Pe(p,structuredClone(r.design))),i=p}else i=r;if(!i){t.push({name:a,ok:!1,issues:[{path:"/",message:"Invalid design entry",ratio:0,min:0}]});continue}let{ok:s,issues:c}=Et(i,e);t.push({name:a,ok:s,issues:c})}return{ok:t.every(r=>r.ok),results:t}}m.validateDesigns=sr;function Mt({manageTheme:n,themeStorageKey:e}){let t="light",o=null;if(n&&typeof window<"u"){try{o=localStorage.getItem(e)||null}catch{o=null}try{$t(o),zt(o)}catch{}o?o==="system"?t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=o:t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:t,storedTheme:o}}function Pe(n={},e={}){if(!e||typeof e!="object")return n;let t=Array.isArray(n)?[...n]:{...n};for(let[o,r]of Object.entries(e))r&&typeof r=="object"&&!Array.isArray(r)?t[o]=Pe(t[o]&&typeof t[o]=="object"?t[o]:{},r):t[o]=r;return t}function ee(n=""){return String(n).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function re(n){if(n==null)return n;if(typeof n=="function")return;if(typeof n!="object")return n;if(Array.isArray(n))return n.map(t=>re(t)).filter(t=>t!==void 0);let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t];if(typeof o!="function"){let r=re(o);r!==void 0&&(e[t]=r)}}return e}var cr=/^[a-z][a-z0-9+\-.]*:\/\//i,te=(()=>{try{return import.meta.url}catch{return}})();function ge(n,e={}){if(!n||cr.test(n))return n;let{preferModule:t=!0}=e,o=()=>{if(!te)return null;try{return new URL(n,te).href}catch{return null}},r=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(n,window.location.origin).href}catch{return null}};return(t?o()||r():r()||o())||n}var me=n=>typeof n=="string"&&n.length&&!n.endsWith("/")?`${n}/`:n,kt=(()=>{if(te)try{let n=new URL(te);if(/\/public\/assets\/js\//.test(n.pathname))return new URL("../pds/",te).href}catch{return}})();function At(n){let e=!!(n?.public?.root||n?.static?.root),t=bt(n);return!e&&kt&&(t=kt),me(ge(t))}function Ct(n={},e={}){let t=typeof n=="object"&&("colors"in n||"typography"in n||"spatialRhythm"in n||"shape"in n||"behavior"in n||"layout"in n||"advanced"in n||"a11y"in n||"components"in n||"icons"in n),o=n&&n.enhancers;o&&!Array.isArray(o)&&(o=Object.values(o));let r=o??e.enhancers??[],a=n&&n.preset,i=n&&n.design,s="preset"in(n||{})||"design"in(n||{})||"enhancers"in(n||{}),c,l=null;if(s){let d=String(a||"default").toLowerCase(),p=C?.[d]||Object.values(C||{}).find(M=>ee(M.name)===d||String(M.name||"").toLowerCase()===d);if(!p)throw new Error(`PDS preset not found: "${a||"default"}"`);l={id:p.id||ee(p.name),name:p.name||p.id||String(d)};let h=structuredClone(p);if(i&&typeof i=="object"){let M=re(i);h=Pe(h,structuredClone(M))}let{mode:g,autoDefine:x,applyGlobalStyles:f,manageTheme:b,themeStorageKey:E,preloadStyles:F,criticalLayers:_,preset:S,design:$,enhancers:z,log:T,...fe}=n;c={...fe,design:h,preset:l.name,log:T||ie}}else if(t){let{log:d,...p}=n;c={design:structuredClone(p),log:d||ie}}else{let d=C?.default||Object.values(C||{}).find(p=>ee(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:r,presetInfo:l}}async function _t(n){let{autoDefineBaseURL:e="/auto-define/",autoDefinePreload:t=[],autoDefineMapper:o=null,enhancers:r=[],autoDefineOverrides:a=null,autoDefinePreferModule:i=!0}=n,s=(()=>{let l=new Map;return(m.defaultEnhancers||[]).forEach(d=>l.set(d.selector,d)),(r||[]).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(()=>(wt(),xt));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:{},x={baseURL:e&&me(ge(e,{preferModule:i})),predefine:t,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:s,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 o=="function")try{let b=o(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(x),t.length>0&&typeof l.define=="function"&&await l.define(...t,{baseURL:e,mapper:x.mapper,onError:x.onError}))}return{autoDefiner:c}}async function lr(n){if(!n||typeof n!="object")throw new Error("PDS.start({ mode: 'live', ... }) requires a valid configuration object");if(typeof document<"u"&&document.adoptedStyleSheets){let s=`
3382
3382
  html { opacity: 0; }
3383
3383
  html.pds-ready { opacity: 1; transition: opacity 0.3s ease-in; }
3384
3384
  `;try{if(!document.adoptedStyleSheets.some(l=>l._pdsFouc)){let l=new CSSStyleSheet;l.replaceSync(s),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=s,document.head.insertBefore(d,document.head.firstChild)}}}let e=n.applyGlobalStyles??!0,t=n.manageTheme??!0,o=n.themeStorageKey??"pure-ds-theme",r=n.preloadStyles??!1,a=n.criticalLayers??["tokens","primitives"],i=n&&n.autoDefine||null;try{let{resolvedTheme:s,storedTheme:c}=Mt({manageTheme:t,themeStorageKey:o}),l=Ct(n,{}),d=l.enhancers,{log:p,...h}=l.generatorConfig,g=structuredClone(h);g.log=p,t&&(g.theme=s);let x=new m.Generator(g);if(g.design?.typography)try{await vt(g.design.typography)}catch(S){g?.log?.("warn","Failed to load some fonts from Google Fonts:",S)}if(r&&typeof window<"u"&&document.head)try{let S=a.map($=>{try{return x.css?.[$]||""}catch(z){return g?.log?.("warn",`Failed to generate critical CSS for layer "${$}":`,z),""}}).filter($=>$.trim()).join(`
3385
- `);if(S){let $=document.head.querySelector("style[data-pds-critical]");$&&$.remove();let z=document.createElement("style");z.setAttribute("data-pds-critical",""),z.textContent=S;let T=document.head.querySelector('meta[charset], meta[name="viewport"]');T?T.parentNode.insertBefore(z,T.nextSibling):document.head.insertBefore(z,document.head.firstChild)}}catch(S){g?.log?.("warn","Failed to preload critical styles:",S)}m.registry.setDesigner(x,{presetName:l.presetInfo?.name}),e&&(await m.Generator.applyStyles(x),typeof window<"u"&&setTimeout(()=>{let S=document.head.querySelector("style[data-pds-critical]");S&&S.remove();let $=document.head.querySelector("style[data-pds-preload]");$&&$.remove();let z=document.getElementById("pds-runtime-stylesheet");z&&z.remove()},100));let f=At(n),b;i&&i.baseURL?b=ge(he(i.baseURL,{preferModule:!1})):b=`${f}components/`;let E=null;try{E=(await _t({autoDefineBaseURL:b,autoDefinePreload:i&&Array.isArray(i.predefine)&&i.predefine||[],autoDefineMapper:i&&typeof i.mapper=="function"&&i.mapper||null,enhancers:d,autoDefineOverrides:i||null,autoDefinePreferModule:!(i&&i.baseURL)})).autoDefiner}catch(S){g?.log?.("error","\u274C Failed to initialize AutoDefiner/Enhancers:",S)}let F=x?.options||g,_=re(n);return m.currentConfig=Object.freeze({mode:"live",...structuredClone(_),design:structuredClone(l.generatorConfig.design),preset:l.generatorConfig.preset,theme:s}),St({mode:"live",generator:x,config:F,theme:s,autoDefiner:E}),{generator:x,config:F,theme:s,autoDefiner:E}}catch(s){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:s}})),s}}async function dr(n){let e=n&&n.mode||"live",{mode:t,...o}=n||{};return e==="static"?pr(o):lr(o)}m.start=dr;async function pr(n){if(!n||typeof n!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let e=n.applyGlobalStyles??!0,t=n.manageTheme??!0,o=n.themeStorageKey??"pure-ds-theme",r=n.staticPaths??{},a=At(n),i=n&&n.autoDefine||null,s;i&&i.baseURL?s=ge(he(i.baseURL,{preferModule:!1})):s=`${a}components/`;let c=i&&Array.isArray(i.predefine)&&i.predefine||[],l=i&&typeof i.mapper=="function"&&i.mapper||null;try{let{resolvedTheme:d}=Mt({manageTheme:t,themeStorageKey:o}),p=Ct(n,{}),h=p.enhancers;if(r={...{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`},...r},m.registry.setStaticMode(r),e&&typeof document<"u")try{let b=await m.registry.getStylesheet("styles");if(b){b._pds=!0;let E=(document.adoptedStyleSheets||[]).filter(F=>F._pds!==!0);document.adoptedStyleSheets=[...E,b]}}catch(b){console.warn("Failed to apply static styles:",b)}let x=null;try{x=(await _t({autoDefineBaseURL:s,autoDefinePreload:c,autoDefineMapper:l,enhancers:h,autoDefineOverrides:i||null,autoDefinePreferModule:!(i&&i.baseURL)})).autoDefiner}catch(b){console.error("\u274C Failed to initialize AutoDefiner/Enhancers (static):",b)}let f=re(n);return m.currentConfig=Object.freeze({mode:"static",...structuredClone(f),design:structuredClone(p.generatorConfig.design),preset:p.generatorConfig.preset,theme:d}),St({mode:"static",config:p.generatorConfig,theme:d,autoDefiner:x}),{config:p.generatorConfig,theme:d,autoDefiner:x}}catch(d){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}async function ur(n,e={}){let{storageKey:t="pure-ds-theme",persist:o=!0}=e;if(!["light","dark","system"].includes(n))throw new Error(`Invalid theme "${n}". Must be "light", "dark", or "system".`);if(typeof window>"u")return n==="system"?"light":n;let r=n;if(n==="system"&&(r=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",r),o&&localStorage.setItem(t,n),m.registry.isLive&&m.registry.hasDesigner)try{let a=m.registry._designer;if(a&&a.configure){let i={...a.config,theme:r};a.configure(i),await m.Generator.applyStyles(a)}}catch(a){currentDesigner?.options?.log?.("warn","Failed to update styles for new theme:",a)}return m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,requested:n,source:"programmatic"}})),r}m.setTheme=ur;function hr(n,e={}){if(typeof window>"u"||!document.head||!n)return;let{theme:t,layers:o=["tokens"]}=e;try{let r=t||"light";(t==="system"||!t)&&(r=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",r);let a=n.design?{...n,theme:r}:{design:n,theme:r},i=new m.Generator(a),s=o.map(c=>{try{return i.css?.[c]||""}catch{return""}}).filter(c=>c.trim()).join(`
3385
+ `);if(S){let $=document.head.querySelector("style[data-pds-critical]");$&&$.remove();let z=document.createElement("style");z.setAttribute("data-pds-critical",""),z.textContent=S;let T=document.head.querySelector('meta[charset], meta[name="viewport"]');T?T.parentNode.insertBefore(z,T.nextSibling):document.head.insertBefore(z,document.head.firstChild)}}catch(S){g?.log?.("warn","Failed to preload critical styles:",S)}m.registry.setDesigner(x,{presetName:l.presetInfo?.name}),e&&(await m.Generator.applyStyles(x),typeof window<"u"&&setTimeout(()=>{let S=document.head.querySelector("style[data-pds-critical]");S&&S.remove();let $=document.head.querySelector("style[data-pds-preload]");$&&$.remove();let z=document.getElementById("pds-runtime-stylesheet");z&&z.remove()},100));let f=At(n),b;i&&i.baseURL?b=me(ge(i.baseURL,{preferModule:!1})):b=`${f}components/`;let E=null;try{E=(await _t({autoDefineBaseURL:b,autoDefinePreload:i&&Array.isArray(i.predefine)&&i.predefine||[],autoDefineMapper:i&&typeof i.mapper=="function"&&i.mapper||null,enhancers:d,autoDefineOverrides:i||null,autoDefinePreferModule:!(i&&i.baseURL)})).autoDefiner}catch(S){g?.log?.("error","\u274C Failed to initialize AutoDefiner/Enhancers:",S)}let F=x?.options||g,_=re(n);return m.currentConfig=Object.freeze({mode:"live",...structuredClone(_),design:structuredClone(l.generatorConfig.design),preset:l.generatorConfig.preset,theme:s}),St({mode:"live",generator:x,config:F,theme:s,autoDefiner:E}),{generator:x,config:F,theme:s,autoDefiner:E}}catch(s){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:s}})),s}}async function dr(n){let e=n&&n.mode||"live",{mode:t,...o}=n||{};return e==="static"?pr(o):lr(o)}m.start=dr;async function pr(n){if(!n||typeof n!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let e=n.applyGlobalStyles??!0,t=n.manageTheme??!0,o=n.themeStorageKey??"pure-ds-theme",r=n.staticPaths??{},a=At(n),i=n&&n.autoDefine||null,s;i&&i.baseURL?s=me(ge(i.baseURL,{preferModule:!1})):s=`${a}components/`;let c=i&&Array.isArray(i.predefine)&&i.predefine||[],l=i&&typeof i.mapper=="function"&&i.mapper||null;try{let{resolvedTheme:d}=Mt({manageTheme:t,themeStorageKey:o}),p=Ct(n,{}),h=p.enhancers;if(r={...{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`},...r},m.registry.setStaticMode(r),e&&typeof document<"u")try{let b=await m.registry.getStylesheet("styles");if(b){b._pds=!0;let E=(document.adoptedStyleSheets||[]).filter(F=>F._pds!==!0);document.adoptedStyleSheets=[...E,b]}}catch(b){console.warn("Failed to apply static styles:",b)}let x=null;try{x=(await _t({autoDefineBaseURL:s,autoDefinePreload:c,autoDefineMapper:l,enhancers:h,autoDefineOverrides:i||null,autoDefinePreferModule:!(i&&i.baseURL)})).autoDefiner}catch(b){console.error("\u274C Failed to initialize AutoDefiner/Enhancers (static):",b)}let f=re(n);return m.currentConfig=Object.freeze({mode:"static",...structuredClone(f),design:structuredClone(p.generatorConfig.design),preset:p.generatorConfig.preset,theme:d}),St({mode:"static",config:p.generatorConfig,theme:d,autoDefiner:x}),{config:p.generatorConfig,theme:d,autoDefiner:x}}catch(d){throw m.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}async function ur(n,e={}){let{storageKey:t="pure-ds-theme",persist:o=!0}=e;if(!["light","dark","system"].includes(n))throw new Error(`Invalid theme "${n}". Must be "light", "dark", or "system".`);if(typeof window>"u")return n==="system"?"light":n;let r=n;if(n==="system"&&(r=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",r),o&&localStorage.setItem(t,n),m.registry.isLive&&m.registry.hasDesigner)try{let a=m.registry._designer;if(a&&a.configure){let i={...a.config,theme:r};a.configure(i),await m.Generator.applyStyles(a)}}catch(a){currentDesigner?.options?.log?.("warn","Failed to update styles for new theme:",a)}return m.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,requested:n,source:"programmatic"}})),r}m.setTheme=ur;function hr(n,e={}){if(typeof window>"u"||!document.head||!n)return;let{theme:t,layers:o=["tokens"]}=e;try{let r=t||"light";(t==="system"||!t)&&(r=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",r);let a=n.design?{...n,theme:r}:{design:n,theme:r},i=new m.Generator(a),s=o.map(c=>{try{return i.css?.[c]||""}catch{return""}}).filter(c=>c.trim()).join(`
3386
3386
  `);if(s){let c=document.head.querySelector("style[data-pds-preload]");c&&c.remove();let l=document.createElement("style");l.setAttribute("data-pds-preload",""),l.textContent=s,document.head.insertBefore(l,document.head.firstChild)}}catch(r){console.warn("PDS preload failed:",r)}}m.preloadCritical=hr;export{m as PDS,Et as validateDesign};
3387
3387
  /*! Bundled license information:
3388
3388