@domphy/ui 0.17.0 → 0.18.1

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,6 +1,6 @@
1
- "use strict";var Domphy=(()=>{var qe=Object.defineProperty,Dn=Object.defineProperties,$n=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyDescriptors,Rn=Object.getOwnPropertyNames,Qt=Object.getOwnPropertySymbols;var to=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable;var eo=(e,t,n)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,we=(e,t)=>{for(var n in t||(t={}))to.call(t,n)&&eo(e,n,t[n]);if(Qt)for(var n of Qt(t))zn.call(t,n)&&eo(e,n,t[n]);return e},oo=(e,t)=>Dn(e,Ln(t));var Ye=(e,t)=>{for(var n in t)qe(e,n,{get:t[n],enumerable:!0})},In=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rn(t))!to.call(e,i)&&i!==n&&qe(e,i,{get:()=>t[i],enumerable:!(o=$n(t,i))||o.enumerable});return e};var Mn=e=>In(qe({},"__esModule",{value:!0}),e);var Qa={};Ye(Qa,{core:()=>Je,theme:()=>et,ui:()=>ht});var Je={};Ye(Je,{AttributeList:()=>wo,BooleanAttributes:()=>Tt,CamelAttributes:()=>so,ElementList:()=>ko,ElementNode:()=>B,HtmlTags:()=>_t,Notifier:()=>Me,PrefixCSS:()=>de,RecordState:()=>cr,State:()=>St,SvgTags:()=>co,VoidTags:()=>uo,batch:()=>lr,computed:()=>ar,configure:()=>Bn,effect:()=>ir,effectScope:()=>rr,flushPendingNotifiers:()=>yo,flushSync:()=>tr,hasPendingNotifiers:()=>go,hashString:()=>Te,merge:()=>$,r:()=>Un,runBatched:()=>po,toState:()=>f,untrack:()=>sr});var An=Object.defineProperty,no=Object.getOwnPropertySymbols,Vn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,ro=(e,t,n)=>t in e?An(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,io=(e,t)=>{for(var n in t||(t={}))Vn.call(t,n)&&ro(e,n,t[n]);if(no)for(var n of no(t))Nn.call(t,n)&&ro(e,n,t[n]);return e},Tt=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","contentEditable","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","autoCapitalize","translate","spellCheck","inert","download","noModule","paused","autoPictureInPicture"],so=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],_t=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],de={transform:["webkit","ms"],transition:["webkit","ms"],animation:["webkit"],userSelect:["webkit","ms"],flexDirection:["webkit","ms"],flexWrap:["webkit","ms"],justifyContent:["webkit","ms"],alignItems:["webkit","ms"],alignSelf:["webkit","ms"],order:["webkit","ms"],flexGrow:["webkit","ms"],flexShrink:["webkit","ms"],flexBasis:["webkit","ms"],columns:["webkit"],columnCount:["webkit"],columnGap:["webkit"],columnRule:["webkit"],columnWidth:["webkit"],boxSizing:["webkit"],appearance:["webkit","moz"],filter:["webkit"],backdropFilter:["webkit"],clipPath:["webkit"],mask:["webkit"],maskImage:["webkit"],textSizeAdjust:["webkit","ms"],hyphens:["webkit","ms"],writingMode:["webkit","ms"],gridTemplateColumns:["ms"],gridTemplateRows:["ms"],gridAutoColumns:["ms"],gridAutoRows:["ms"],gridColumn:["ms"],gridRow:["ms"],marginInlineStart:["webkit"],marginInlineEnd:["webkit"],paddingInlineStart:["webkit"],paddingInlineEnd:["webkit"],minInlineSize:["webkit"],maxInlineSize:["webkit"],minBlockSize:["webkit"],maxBlockSize:["webkit"],inlineSize:["webkit"],blockSize:["webkit"],tabSize:["moz"],overscrollBehavior:["webkit","ms"],touchAction:["ms"],resize:["webkit"],printColorAdjust:["webkit"],backgroundClip:["webkit"],boxDecorationBreak:["webkit"],overflowScrolling:["webkit"]},co=["svg","circle","path","rect","ellipse","line","polyline","polygon","g","defs","use","symbol","linearGradient","radialGradient","stop","clipPath","mask","filter","text","tspan","textPath","image","pattern","marker","animate","animateTransform","animateMotion","feGaussianBlur","feComposite","feColorMatrix","feMerge","feMergeNode","feOffset","feFlood","feBlend","foreignObject"],uo=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],mo={};function Bn(e){Object.assign(mo,e)}function Hn(){return mo}var jn=["onAbort","onAuxClick","onBeforeMatch","onBeforeToggle","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLoad","onLoadedData","onLoadedMetadata","onLoadStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPaste","onPause","onPlay","onPlaying","onProgress","onRateChange","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onSubmit","onSuspend","onTimeUpdate","onToggle","onVolumeChange","onWaiting","onWheel","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onCompositionStart","onCompositionUpdate","onCompositionEnd","onTransitionEnd","onTransitionStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onFullscreenChange","onFullscreenError","onFocusIn","onFocusOut"],Fn=jn.reduce((e,t)=>{let n=t.slice(2).toLowerCase();return e[n]=t,e},{}),ho=class{constructor(e){this._releases=new Set;let t=(()=>e());t.onSubscribe=n=>{this._releases.add(n)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear()}get dependencyCount(){return this._releases.size}},ze=[],bt=0;function Ot(){return bt>0?null:ze.length?ze[ze.length-1]:null}function fo(e,t){ze.push(e);try{return t()}finally{ze.pop()}}function Wn(e){bt++;try{return e()}finally{bt--}}var J=[],Kn=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},ao=100,Xe=0,vt=new Set,ke=new Set;function po(e){Xe++;try{return e()}finally{if(Xe--,Xe===0){let t=vt;vt=new Set;for(let n of t)n._scheduleFlush()}}}var Me=class{constructor(){this._listeners={},this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let n=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(n)),n}removeListener(e,t){if(!this._listeners)return;let n=this._listeners[e];n&&n.has(t)&&(n.delete(t),n.size===0&&delete this._listeners[e])}listenerCount(e){var t,n,o;return(o=(n=(t=this._listeners)==null?void 0:t[e])==null?void 0:n.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let n=J.length?J[J.length-1]:null;if(n&&n[0]===this&&n[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=ao){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${ao} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...J]})}Xe>0?vt.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,ke.add(this),Kn(()=>this._flushAll()))}_isCircular(e){let t=J.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let n=[...J.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
- ${n.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,ke.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:n,chain:o}]of e)J=o,this._flush(t,n);J=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let n=this._listeners[e];if(n){J.push([this,e]),this._flushing.set(e,t);for(let o of[...n])if(n.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),J.pop()}}};function go(){return ke.size>0}function yo(){let e=0;for(;ke.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...ke];ke.clear();for(let n of t)n._flushAll()}}var St=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Me,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=Ot();t&&this.addListener(t.handler)}return this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function $(e={},t={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=ae(t));for(let r in t){let a=t[r];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof e[r]=="object"?e[r]=$(e[r],a):e[r]=a;else if(n.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let c=e[r];e[r]=u=>{let h=typeof c=="function"?c(u):c,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join(", ")}}else e[r]=[e[r],a].filter(c=>c).join(", ");else if(i.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let c=e[r];e[r]=u=>{let h=typeof c=="function"?c(u):c,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join("")}}else e[r]=[e[r],a].filter(c=>c).join("");else if(o.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let c=e[r];e[r]=u=>{let h=typeof c=="function"?c(u):c,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join(" ")}}else e[r]=[e[r],a].filter(c=>c).join(" ");else if(r.startsWith("on")){let c=r.replace("on","").toLowerCase();Yn(e,c,a)}else if(r.startsWith("_on")){let c=r.replace("_on","");qn(e,c,a)}else e[r]=a}return e}function Te(e=""){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof St||e!=null&&e._isState?e:new St(e,t)}function Un(e){return e}function qn(e,t,n){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...r)=>{i(...r),n(...r)}:e[o]=n}function Yn(e,t,n){let o=Fn[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(r,a)=>{i(r,a),n(r,a)}:e[o]=n}function ae(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(ae(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,r]of e)o.set(ae(i,t),ae(r,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(ae(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(n),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=ae(e[i],t);return o}function bo(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],r=e[i];if(o===0&&!_t.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i==="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(i==="$")e.$.forEach(a=>bo(a,!0));else{if(i.startsWith("_on")&&typeof r!="function")throw Error(`hook ${i} value "${r}" must be a function `);if(i.startsWith("on")&&typeof r!="function")throw Error(`event ${i} value "${r}" must be a function `);if(i==="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(i==="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(i==="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(i==="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function Ge(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function Gn(e){let t=e.replace(/\s+on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/g,"");return t=t.replace(/\/on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/g,"/"),t=t.replace(/((?:href|src|action|formaction)\s*=\s*)(["']?)[\s]*javascript:[^"'\s>]*/gi,"$1$2#"),t}function vo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function So(e){return Object.keys(e).find(t=>_t.includes(t))}function xo(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Xn(e){if(e.indexOf("@")===0)return[e];for(var t=[],n=0,o=0,i="",r=0,a=e.length;r<a;r++){var c=e[r];if(c==="(")n+=1;else if(c===")")n-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!n&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function xt(e){let t=e.trim();return t.startsWith("@")?t.replace(/\s+/g,""):t.replace(/\s*([>+~,])\s*/g,"$1").replace(/\s+/g," ").replace(/\(\s*odd\s*\)/g,"(2n+1)").replace(/\(\s*even\s*\)/g,"(2n)").trim()}function Jn(e,t){for(let n=0;n<e.length;n++){let o=e[n],i=null;typeof o.selectorText=="string"?i=xt(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=xt(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function Co(e,t){var n;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let i=t!=null?t:Hn().cspNonce;i&&(o.nonce=i),e.appendChild(o)}return o.dataset.domphyBase!=="true"&&((n=o.sheet)==null||n.insertRule("[hidden] { display: none !important; }",0),o.dataset.domphyBase="true"),o}var Ct=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(n=>$(t,Ct(n))),delete e.$,$(t,e),t}else return e},Zn=class{constructor(e,t,n){this._notifier=new Me,this._releases=[],this.parent=n,this.isBoolean=Tt.includes(e),so.includes(e)?this.name=e:this.name=xo(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,n;let o=this.value;if(this._releases.length){for(let i of this._releases)i();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let r=this.value;this.value=this.isBoolean?!!e(i):e(i),this.render(),r!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(n=this.parent)==null?void 0:n.nodeId} attribute:${this.name}`,i.onSubscribe=r=>{this._releases.push(r),this.parent&&this.parent.addHook("BeforeRemove",()=>{r(),i=null})},this.value=this.isBoolean?!!e(i):e(i)}else this.value=this.isBoolean?!!e:e;this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=n=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",n)},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let n=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${vo(String(n))}"`}}},wo=class{constructor(e){this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?this.items[e].set(t):this.items[e]=new Zn(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.hasOwn(this.items,e):!1}remove(e){this.items&&(this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(e))}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this.items=null,this.parent=null}toggle(e,t){if(!Tt.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){if(!e||typeof e!="string")return;let t=(o,i)=>{let r=(o||"").split(" ").filter(a=>a);return!r.includes(i)&&r.push(e),r.join(" ")},n=this.get("class");typeof n=="function"?this.set("class",()=>t(n(),e)):this.set("class",t(n,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},wt=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",Qn=class{constructor(e,t,n){this.value="",this.name=e,this.cssName=xo(e),this.parentRule=n,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),de[this.name]&&de[this.name].forEach(n=>{t.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,n,o,i;if(typeof e=="function"){let r=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(r),this._domUpdate())});r.onSubscribe=a=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{a(),r=null})},r.elementNode=this.parentRule.root,r.debug=`class:${(n=(t=this.parentRule)==null?void 0:t.root)==null?void 0:n.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(r)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),de[this.name]&&de[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=`${this.cssName}: ${this.value}`;return de[this.name]&&de[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},me=class Et{constructor(t,n){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new Eo(this),this.parent=n}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof Et;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Et;)t=t.parent;return t}insertStyle(t,n){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(n):this.styleBlock[t]=new Qn(t,n,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${t} ${n} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,n=t.cssRules;for(let o=0;o<n.length;o++)if(n[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let n=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Eo=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof me;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let n={},o=[];function i(r,a){return r.startsWith("&")?`${a}${r.slice(1)}`:`${a} ${r}`}for(let r in e){let a=e[r],c=Xn(r);for(let u of c){let h=i(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof a=="object"&&a!=null){let m=new me(u,this.parent);m.styleList.addCSS(a,t),o.push(m)}}else if(u.startsWith("@keyframes")){let m=new me(u,this.parent);m.styleList.addCSS(a,""),this.items.push(m)}else if(u.startsWith("@font-face")){let m=new me(u,this.parent);for(let d in a)m.insertStyle(d,a[d]);this.items.push(m)}else if(typeof a=="object"&&a!=null){let m=new me(h,this.parent);this.items.push(m);for(let[d,p]of Object.entries(a))if(typeof p=="object"&&p!=null){let g=i(d,h);d.startsWith("&")?this.addCSS(p,g):m.styleList.insertRule(g).styleList.addCSS(p,g)}else m.insertStyle(d,p)}else n[u]=a}}if(Object.keys(n).length){let r=new me(t,this.parent);for(let a in n)r.insertStyle(a,n[a]);this.items.push(r)}for(let r of o)this.items.push(r)}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(n=>n.selectorText===e);return t||(t=new me(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let n=e.get(xt(t.selectorText));n&&t.mount(n)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,n=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let r=i-t,a=e[r];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==n(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},B=class Ee{constructor(t,n=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new ko(this),this.styles=new Eo(this),this.attributes=new wo(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,r;t=ae(t),bo(t),t.style=t.style||{},this.parent=n,this.tagName=So(t),t=Ct(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(r=this.parent)==null?void 0:r.nodeId}.${o}`,c=JSON.stringify(t.style||{},(h,m)=>typeof m=="function"?a:m);this.nodeId=Te(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let u=t[this.tagName];if(u!=null&&u!==void 0)if(typeof u=="function"){let h=()=>{if(!this._disposed)try{let m=u(h);this.children.update(Array.isArray(m)?m:[m])}catch(m){this._handleError(m)}};h.elementNode=this,h.debug=`class:${this.tagName}_${this.nodeId} children`,h.onSubscribe=m=>this.addHook("BeforeRemove",()=>{m(),h=null}),h&&h()}else this.children.update(Array.isArray(u)?u:[u]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=co.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let n in this._events)this._bindEvent(n);return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let n=o=>{var i,r;return(r=(i=this._events)==null?void 0:i[t])==null?void 0:r.call(i,o,this)};this.domElement.addEventListener(t,n),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,n),n=null})}_dispose(){var t,n,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(n=(t=this._hooks).BeforeRemove)==null||n.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(r=>r.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(o=this._hooks).Remove)==null||i.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){$(this._context,t._context),$(this._metadata,t._metadata);let n=Object.keys(t);for(let o=0;o<n.length;o++){let i=n[o],r=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(i)?this.addHook(i.substring(3),r):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),r):i==="_portal"?this._portal=r:i==="class"&&typeof r=="string"?this.attributes.addClass(r):this.attributes.set(i,r))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){let n=ae(t);n.style=n.style||{},n=Ct(n);let o=n[this.tagName];if(typeof o!="function"){let h=o==null?[]:Array.isArray(o)?o:[o];this.children.update(h,!!this.domElement,!0)}n._context&&$(this._context,n._context),n._metadata&&$(this._metadata,n._metadata);let i=`${this.tagName}_${this.nodeId}`,r=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],a=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],c=new Set(["class"]),u=null;this._events={};for(let h of Object.keys(n)){if(r.includes(h)||a.includes(h)||h==="_portal")continue;let m=n[h];h.startsWith("on")&&typeof m=="function"?this.addEvent(h.substring(2).toLowerCase(),m):h==="class"&&typeof m=="string"?u=m:(this.attributes.set(h,m),c.add(h))}if(this.attributes.set("class",u?`${i} ${u}`:i),this.attributes.items)for(let h of Object.keys(this.attributes.items))c.has(h)||this.attributes.remove(h);if(this._events)for(let h in this._events)this._bindEvent(h)}_handleError(t){let n=this;for(;n;){if(n._hooks.Error){let o=n;n._hooks.Error(o,t,()=>{o.children.update([])});return}n=n.parent}console.error("[Domphy] Unhandled error in reactive child:",t)}addEvent(t,n){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,r)=>{o(i,r),n(i,r)}:this._events[t]=n}addHook(t,n){let o=this._hooks[t];if(typeof o=="function"){let i=((...r)=>{o(...r),n(...r)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,n.length),configurable:!0})}catch(r){}this._hooks[t]=i}else this._hooks[t]=n}getRoot(){let t=this;for(;t&&t instanceof Ee&&t.parent;)t=t.parent;return t}getContext(t){let n=this;for(;n&&(!n._context||!Object.hasOwn(n._context,t));)n=n.parent;return n&&n._context?n._context[t]:void 0}setContext(t,n){this._context=this._context||{},this._context[t]=n}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,n){this._metadata=this._metadata||{},this._metadata[t]=n}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(n=>n instanceof Ee?n.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(uo.includes(this.tagName))return`<${this.tagName}${t}>`;let n=this.children.generateHTML();return`<${this.tagName}${t}>${n}</${this.tagName}>`}mount(t,n){if(!t)throw new Error("Missing dom node on bind");if(wt&&!n&&this.parent===null&&t.childNodes.length>0&&console.warn("[Domphy] mount() was called without a style element on already-rendered DOM. Reactive style updates after hydration will be dropped \u2014 pass the server-rendered <style> element as the second argument to mount()."),this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children&&this.children.items.forEach((o,i)=>{let r=t.childNodes[i];r&&(o instanceof Ee?o.mount(r):o.domText=r)}),n){let o=n.sheet;o&&this._hydrateStyles(Jn(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var n;if((n=this.styles)==null||n.hydrate(t),this.children)for(let o of this.children.items)o instanceof Ee&&o._hydrateStyles(t)}render(t){let n=this._createDOMNode();t.appendChild(n),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),r=i instanceof ShadowRoot?i:document.head;return o||(o=Co(r)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof Ee&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(n)}),n}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var n;(n=this.domElement)==null||n.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let n=!1,o=()=>{n||(n=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!n?o():wt&&!n&&setTimeout(()=>{n||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else t()}}},lo=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Ge(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),t.content.querySelectorAll("*").forEach(n=>{for(let o of Array.from(n.attributes))/^on/i.test(o.name)?n.removeAttribute(o.name):/^(?:href|src|action|formaction)$/i.test(o.name)&&/^\s*javascript:/i.test(o.value)&&n.setAttribute(o.name,"#")}),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}setText(e){var t;let n=e===""?"\u200B":String(e);if(n===this.text&&this.domText)return;let o=Ge(this.text);if(this.text=n,!this.domText)return;if(!o&&!Ge(n)&&this.domText.nodeType===3){this.domText.nodeValue=n;return}let i=this.domText,r=this._createDOMNode();(t=i.parentNode)==null||t.replaceChild(r,i)}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":Ge(this.text)?Gn(this.text):vo(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},ko=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new B(e,this.owner,this._nextKey++):new lo(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof B?e.domElement:e.domText;if(o){let i=n.childNodes[t]||null;o!==i&&n.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof B?e.domElement:e.domText,i=t instanceof B?t.domElement:t.domText;if(!o||!i)return;let r=o.nextSibling,a=i.nextSibling;n.insertBefore(o,a),n.insertBefore(i,r)}update(e,t=!0,n=!1){var o,i,r,a;let c=this.items.slice(),u=new Map;for(let p of c)p instanceof B&&p.key!==null&&p.key!==void 0&&u.set(p.key,p);!n&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let h=new Set(c),m=new Set;for(let p=0;p<e.length;p++){let g=e[p],v=typeof g=="object"&&g!==null,x=v?g._key:void 0,C=v?So(g):void 0;if(x!==void 0){let w=u.get(x);if(w instanceof B&&w.tagName===C){u.delete(x);let E=this.items.indexOf(w);if(E!==p&&E>=0){let O=!!w._portal;this.move(E,p,O?!1:t,!0)}w.parent=this.owner,w.patch(g),m.add(w);continue}}else if(v){let w=this.items[p];if(w instanceof B&&w.key==null&&w.tagName===C&&h.has(w)&&!m.has(w)){w.parent=this.owner,w.patch(g),m.add(w);continue}}else{let w=this.items[p];if(w instanceof lo&&h.has(w)&&!m.has(w)){w.setText(g==null?"":g),m.add(w);continue}}m.add(this.insert(g,p,t,!0))}let d=this.items.slice(e.length);for(let p of d)this.remove(p,t,!0);u.forEach(p=>this.remove(p,t,!0)),n||(a=(r=this.owner._hooks)==null?void 0:r.Update)==null||a.call(r,this.owner)}insert(e,t,n=!0,o=!1){var i,r;let a=this.items.length,c=typeof t!="number"||Number.isNaN(t)||t<0||t>a?a:t,u=this._createNode(e);if(this.items.splice(c,0,u),u instanceof B){u._hooks.Insert&&u._hooks.Insert(u);let h=this.owner.domElement;if(n&&h)if(u._portal){let m=u._portal(this.owner.getRoot());m&&u.render(m)}else{let m=u._createDOMNode(),d=(i=h.childNodes[c])!=null?i:null;h.insertBefore(m,d);let p=h.getRootNode(),g=p instanceof ShadowRoot?p:document.head,v=Co(g);u.styles.render(v),u._hooks.Mount&&u._hooks.Mount(u),u.children.items.forEach(x=>{if(x instanceof B&&x._portal){let C=x._portal(x.getRoot());C&&x.render(C)}else x.render(m)})}}else{let h=this.owner.domElement;if(n&&h){let m=u._createDOMNode(),d=(r=h.childNodes[c])!=null?r:null;h.insertBefore(m,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),u}remove(e,t=!0,n=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof B){if(e._beforeRemoveFired)return;let i=()=>{let r=e.domElement,a=this.items.indexOf(e);a>=0&&this.items.splice(a,1),t&&r&&r.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let r=!1,a=()=>{r||(r=!0,i())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,a),e._hooks.BeforeRemove.length<2&&!r?a():wt&&!r&&setTimeout(()=>{r||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter (e.g. an exit animation) but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,n=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],r=this.items[t];this.items[e]=r,this.items[t]=i,n&&this._swapDomElement(i,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,n=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),n&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},er=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},he=new Set,kt=!1;function To(e){he.add(e),!kt&&(kt=!0,er(_o))}function _o(){for(kt=!1;he.size>0;){let e=[...he];he.clear();for(let t of e)try{t()}catch(n){console.error("[Domphy] Uncaught error in effect:",n)}}}function tr(){let e=0;for(;go()||he.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}yo(),_o()}}var Ie=[];function or(){return Ie.length?Ie[Ie.length-1]:null}function Pt(e){let t=or();t&&t._add(e)}var nr=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){Ie.push(this);try{return e()}finally{Ie.pop()}}stop(){if(!this._stopped){this._stopped=!0;for(let e of this._disposers)e();this._disposers.clear()}}};function rr(){let e=new nr;return Pt(()=>e.stop()),e}function ir(e){let t=!1,n=!1,o=()=>{t||r()},i=new ho(()=>{t||To(o)}),r=()=>{if(!(t||n)){n=!0,i.reset();try{fo(i,e)}finally{n=!1}}},a=()=>{t||(t=!0,i.reset(),he.delete(o))};return Pt(a),r(),a}function ar(e){let t="computed",n=new Me,o,i=!0,r=!1,a=()=>{i&&n.listenerCount(t)>0&&h()},c=new ho(()=>{i||(i=!0,To(a))}),u=()=>{c.reset(),o=fo(c,e),i=!1,r=!0},h=()=>{let d=o,p=r;u(),!(p&&o===d)&&n.notify(t,o)},m=d=>{if(d)n.addListener(t,d);else{let p=Ot();p&&n.addListener(t,p.handler)}return i&&u(),o};return Pt(()=>{c.reset(),he.delete(a),n._dispose()}),{_isState:!0,_notifier:n,get:m}}function lr(e){return po(e)}function sr(e){return Wn(e)}var cr=class{constructor(e){this._notifier=new Me,this.initialRecord=io({},e),this._record=io({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let n=Ot();n&&this._notifier.addListener(e,n.handler)}return this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e,t)}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var et={};Ye(et,{ElementTones:()=>Ve,getTheme:()=>Z,setTheme:()=>hr,themeApply:()=>pr,themeCSS:()=>$t,themeColor:()=>s,themeColorToken:()=>Mt,themeDensity:()=>y,themeName:()=>Qe,themeSize:()=>b,themeSpacing:()=>l,themeTokens:()=>$o,themeVars:()=>Ae});var ur={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},Ne=ur,zt=e=>JSON.parse(JSON.stringify(e)),Po=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),_e={light:zt(Ne),dark:fr(Ne)},Ze=null,Dt=new Map;function It(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function mr(e){for(let t in e)if(!Object.keys(Ne).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}}function Do(e,t){var n;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((n=e[o])!=null||(e[o]={}),Do(e[o],t[o])):e[o]=t[o]}function dr(e,t){let n={},o=It(t);for(let r in t){let a=t[r];if(r==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(u=>n[`--${c}-${u}`]=t.colors[c][u]);else if(r==="fontSizes")[...Array(8).keys()].forEach(c=>n[`--fontSize-${c}`]=t.fontSizes[c]);else if(r==="custom"&&a&&typeof a=="object")for(let c in a)n[`--custom-${Po(c)}`]=a[c]}let i="";for(let r in n)i+=` ${r}: ${n[r]};
1
+ "use strict";var Domphy=(()=>{var Ye=Object.defineProperty,Rn=Object.defineProperties,Ln=Object.getOwnPropertyDescriptor,zn=Object.getOwnPropertyDescriptors,In=Object.getOwnPropertyNames,oo=Object.getOwnPropertySymbols;var ro=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable;var no=(e,t,n)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,we=(e,t)=>{for(var n in t||(t={}))ro.call(t,n)&&no(e,n,t[n]);if(oo)for(var n of oo(t))Mn.call(t,n)&&no(e,n,t[n]);return e},io=(e,t)=>Rn(e,zn(t));var Ge=(e,t)=>{for(var n in t)Ye(e,n,{get:t[n],enumerable:!0})},An=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of In(t))!ro.call(e,i)&&i!==n&&Ye(e,i,{get:()=>t[i],enumerable:!(o=Ln(t,i))||o.enumerable});return e};var Vn=e=>An(Ye({},"__esModule",{value:!0}),e);var ea={};Ge(ea,{core:()=>Ze,theme:()=>tt,ui:()=>ft});var Ze={};Ge(Ze,{AttributeList:()=>ko,BooleanAttributes:()=>Ot,CamelAttributes:()=>uo,ElementList:()=>_o,ElementNode:()=>V,HtmlTags:()=>Pt,Notifier:()=>Ae,PrefixCSS:()=>de,RecordState:()=>cr,State:()=>Ct,SvgTags:()=>mo,VoidTags:()=>ho,_microtask:()=>$t,_resetKeylessWarnings:()=>er,batch:()=>ar,computed:()=>lr,configure:()=>jn,effect:()=>ir,effectScope:()=>rr,flushPendingNotifiers:()=>vo,flushSync:()=>tr,hasPendingNotifiers:()=>bo,hashString:()=>_e,merge:()=>$,runBatched:()=>yo,toState:()=>f,untrack:()=>sr});var Nn=Object.defineProperty,lo=Object.getOwnPropertySymbols,Bn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,ao=(e,t,n)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,so=(e,t)=>{for(var n in t||(t={}))Bn.call(t,n)&&ao(e,n,t[n]);if(lo)for(var n of lo(t))Hn.call(t,n)&&ao(e,n,t[n]);return e},Ot=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","contentEditable","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","autoCapitalize","translate","spellCheck","inert","download","noModule","paused","autoPictureInPicture"],uo=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Pt=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],de={transform:["webkit","ms"],transition:["webkit","ms"],animation:["webkit"],userSelect:["webkit","ms"],flexDirection:["webkit","ms"],flexWrap:["webkit","ms"],justifyContent:["webkit","ms"],alignItems:["webkit","ms"],alignSelf:["webkit","ms"],order:["webkit","ms"],flexGrow:["webkit","ms"],flexShrink:["webkit","ms"],flexBasis:["webkit","ms"],columns:["webkit"],columnCount:["webkit"],columnGap:["webkit"],columnRule:["webkit"],columnWidth:["webkit"],boxSizing:["webkit"],appearance:["webkit","moz"],filter:["webkit"],backdropFilter:["webkit"],clipPath:["webkit"],mask:["webkit"],maskImage:["webkit"],textSizeAdjust:["webkit","ms"],hyphens:["webkit","ms"],writingMode:["webkit","ms"],gridTemplateColumns:["ms"],gridTemplateRows:["ms"],gridAutoColumns:["ms"],gridAutoRows:["ms"],gridColumn:["ms"],gridRow:["ms"],marginInlineStart:["webkit"],marginInlineEnd:["webkit"],paddingInlineStart:["webkit"],paddingInlineEnd:["webkit"],minInlineSize:["webkit"],maxInlineSize:["webkit"],minBlockSize:["webkit"],maxBlockSize:["webkit"],inlineSize:["webkit"],blockSize:["webkit"],tabSize:["moz"],overscrollBehavior:["webkit","ms"],touchAction:["ms"],resize:["webkit"],printColorAdjust:["webkit"],backgroundClip:["webkit"],boxDecorationBreak:["webkit"],overflowScrolling:["webkit"]},mo=["svg","circle","path","rect","ellipse","line","polyline","polygon","g","defs","use","symbol","linearGradient","radialGradient","stop","clipPath","mask","filter","text","tspan","textPath","image","pattern","marker","animate","animateTransform","animateMotion","feGaussianBlur","feComposite","feColorMatrix","feMerge","feMergeNode","feOffset","feFlood","feBlend","foreignObject"],ho=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],fo={};function jn(e){Object.assign(fo,e)}function Fn(){return fo}var Wn=["onAbort","onAuxClick","onBeforeMatch","onBeforeToggle","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLoad","onLoadedData","onLoadedMetadata","onLoadStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPaste","onPause","onPlay","onPlaying","onProgress","onRateChange","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onSubmit","onSuspend","onTimeUpdate","onToggle","onVolumeChange","onWaiting","onWheel","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onCompositionStart","onCompositionUpdate","onCompositionEnd","onTransitionEnd","onTransitionStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onFullscreenChange","onFullscreenError","onFocusIn","onFocusOut"],Kn=Wn.reduce((e,t)=>{let n=t.slice(2).toLowerCase();return e[n]=t,e},{}),po=class{constructor(e){this._releases=new Set;let t=(()=>e());t.onSubscribe=n=>{this._releases.add(n)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear()}get dependencyCount(){return this._releases.size}},Ie=[],St=0;function Dt(){return St>0?null:Ie.length?Ie[Ie.length-1]:null}function go(e,t){Ie.push(e);try{return t()}finally{Ie.pop()}}function Un(e){St++;try{return e()}finally{St--}}var J=[],$t=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},co=100,Je=0,xt=new Set,Te=new Set;function yo(e){Je++;try{return e()}finally{if(Je--,Je===0){let t=xt;xt=new Set;for(let n of t)n._scheduleFlush()}}}var Ae=class{constructor(){this._listeners={},this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let n=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(n)),n}removeListener(e,t){if(!this._listeners)return;let n=this._listeners[e];n&&n.has(t)&&(n.delete(t),n.size===0&&delete this._listeners[e])}listenerCount(e){var t,n,o;return(o=(n=(t=this._listeners)==null?void 0:t[e])==null?void 0:n.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let n=J.length?J[J.length-1]:null;if(n&&n[0]===this&&n[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=co){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${co} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...J]})}Je>0?xt.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,Te.add(this),$t(()=>this._flushAll()))}_isCircular(e){let t=J.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let n=[...J.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
+ ${n.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,Te.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:n,chain:o}]of e)J=o,this._flush(t,n);J=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let n=this._listeners[e];if(n){J.push([this,e]),this._flushing.set(e,t);for(let o of[...n])if(n.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),J.pop()}}};function bo(){return Te.size>0}function vo(){let e=0;for(;Te.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...Te];Te.clear();for(let n of t)n._flushAll()}}var Ct=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Ae,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=Dt();t&&this.addListener(t.handler)}return this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function $(e={},t={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=le(t));for(let r in t){let l=t[r];if(!(l==null||l===""))if(typeof l=="object"&&!Array.isArray(l))typeof e[r]=="object"?e[r]=$(e[r],l):e[r]=l;else if(n.includes(r))if(typeof e[r]=="function"||typeof l=="function"){let c=e[r];e[r]=u=>{let h=typeof c=="function"?c(u):c,m=typeof l=="function"?l(u):l;return[h,m].filter(d=>d).join(", ")}}else e[r]=[e[r],l].filter(c=>c).join(", ");else if(i.includes(r))if(typeof e[r]=="function"||typeof l=="function"){let c=e[r];e[r]=u=>{let h=typeof c=="function"?c(u):c,m=typeof l=="function"?l(u):l;return[h,m].filter(d=>d).join("")}}else e[r]=[e[r],l].filter(c=>c).join("");else if(o.includes(r))if(typeof e[r]=="function"||typeof l=="function"){let c=e[r];e[r]=u=>{let h=typeof c=="function"?c(u):c,m=typeof l=="function"?l(u):l;return[h,m].filter(d=>d).join(" ")}}else e[r]=[e[r],l].filter(c=>c).join(" ");else if(r.startsWith("on")){let c=r.replace("on","").toLowerCase();Yn(e,c,l)}else if(r.startsWith("_on")){let c=r.replace("_on","");qn(e,c,l)}else e[r]=l}return e}function _e(e=""){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof Ct||e!=null&&e._isState?e:new Ct(e,t)}function qn(e,t,n){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...r)=>{i(...r),n(...r)}:e[o]=n}function Yn(e,t,n){let o=Kn[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(r,l)=>{i(r,l),n(r,l)}:e[o]=n}function le(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(le(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,r]of e)o.set(le(i,t),le(r,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(le(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(n),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=le(e[i],t);return o}function So(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],r=e[i];if(o===0&&!Pt.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i==="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(i==="$")e.$.forEach(l=>So(l,!0));else{if(i.startsWith("_on")&&typeof r!="function")throw Error(`hook ${i} value "${r}" must be a function `);if(i.startsWith("on")&&typeof r!="function")throw Error(`event ${i} value "${r}" must be a function `);if(i==="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(i==="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(i==="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(i==="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function Xe(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function Gn(e){let t=e.replace(/\s+on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/g,"");return t=t.replace(/\/on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/g,"/"),t=t.replace(/((?:href|src|action|formaction)\s*=\s*)(["']?)[\s]*javascript:[^"'\s>]*/gi,"$1$2#"),t}function xo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Co(e){return Object.keys(e).find(t=>Pt.includes(t))}function wo(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Xn(e){if(e.indexOf("@")===0)return[e];for(var t=[],n=0,o=0,i="",r=0,l=e.length;r<l;r++){var c=e[r];if(c==="(")n+=1;else if(c===")")n-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!n&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function wt(e){let t=e.trim();return t.startsWith("@")?t.replace(/\s+/g,""):t.replace(/\s*([>+~,])\s*/g,"$1").replace(/\s+/g," ").replace(/\(\s*odd\s*\)/g,"(2n+1)").replace(/\(\s*even\s*\)/g,"(2n)").trim()}function Jn(e,t){for(let n=0;n<e.length;n++){let o=e[n],i=null;typeof o.selectorText=="string"?i=wt(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=wt(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function Eo(e,t){var n;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let i=t!=null?t:Fn().cspNonce;i&&(o.nonce=i),e.appendChild(o)}return o.dataset.domphyBase!=="true"&&((n=o.sheet)==null||n.insertRule("[hidden] { display: none !important; }",0),o.dataset.domphyBase="true"),o}var Et=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(n=>$(t,Et(n))),delete e.$,$(t,e),t}else return e},Zn=class{constructor(e,t,n){this._notifier=new Ae,this._releases=[],this.parent=n,this.isBoolean=Ot.includes(e),uo.includes(e)?this.name=e:this.name=wo(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,n;let o=this.value;if(this._releases.length){for(let i of this._releases)i();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let r=this.value;this.value=this.isBoolean?!!e(i):e(i),this.render(),r!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(n=this.parent)==null?void 0:n.nodeId} attribute:${this.name}`,i.onSubscribe=r=>{this._releases.push(r),this.parent&&this.parent.addHook("BeforeRemove",()=>{r(),i=null})},this.value=this.isBoolean?!!e(i):e(i)}else this.value=this.isBoolean?!!e:e;this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=n=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",n)},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let n=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${xo(String(n))}"`}}},ko=class{constructor(e){this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?this.items[e].set(t):this.items[e]=new Zn(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.hasOwn(this.items,e):!1}remove(e){this.items&&(this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(e))}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this.items=null,this.parent=null}toggle(e,t){if(!Ot.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){if(!e||typeof e!="string")return;let t=(o,i)=>{let r=(o||"").split(" ").filter(l=>l);return!r.includes(i)&&r.push(i),r.join(" ")},n=this.get("class");typeof n=="function"?this.set("class",()=>t(n(),e)):this.set("class",t(n,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},ke=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",Qn=class{constructor(e,t,n){this.value="",this.name=e,this.cssName=wo(e),this.parentRule=n,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),de[this.name]&&de[this.name].forEach(n=>{t.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,n,o,i;if(typeof e=="function"){let r=(()=>{var l;!this.parentRule||(l=this.parentRule.parentNode)!=null&&l._disposed||(this.value=e(r),this._domUpdate())});r.onSubscribe=l=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{l(),r=null})},r.elementNode=this.parentRule.root,r.debug=`class:${(n=(t=this.parentRule)==null?void 0:t.root)==null?void 0:n.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(r)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),de[this.name]&&de[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=`${this.cssName}: ${this.value}`;return de[this.name]&&de[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},me=class kt{constructor(t,n){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new To(this),this.parent=n}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof kt;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof kt;)t=t.parent;return t}insertStyle(t,n){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(n):this.styleBlock[t]=new Qn(t,n,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${t} ${n} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,n=t.cssRules;for(let o=0;o<n.length;o++)if(n[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let n=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},To=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof me;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let n={},o=[];function i(r,l){return r.startsWith("&")?`${l}${r.slice(1)}`:`${l} ${r}`}for(let r in e){let l=e[r],c=Xn(r);for(let u of c){let h=i(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof l=="object"&&l!=null){let m=new me(u,this.parent);m.styleList.addCSS(l,t),o.push(m)}}else if(u.startsWith("@keyframes")){let m=new me(u,this.parent);m.styleList.addCSS(l,""),this.items.push(m)}else if(u.startsWith("@font-face")){let m=new me(u,this.parent);for(let d in l)m.insertStyle(d,l[d]);this.items.push(m)}else if(typeof l=="object"&&l!=null){let m=new me(h,this.parent);this.items.push(m);for(let[d,p]of Object.entries(l))if(typeof p=="object"&&p!=null){let b=i(d,h);d.startsWith("&")?this.addCSS(p,b):m.styleList.insertRule(b).styleList.addCSS(p,b)}else m.insertStyle(d,p)}else n[u]=l}}if(Object.keys(n).length){let r=new me(t,this.parent);for(let l in n)r.insertStyle(l,n[l]);this.items.push(r)}for(let r of o)this.items.push(r)}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(n=>n.selectorText===e);return t||(t=new me(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let n=e.get(wt(t.selectorText));n&&t.mount(n)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,n=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let r=i-t,l=e[r];l&&(o.selectorText.startsWith("@")&&l instanceof CSSKeyframesRule||"keyText"in l?o.mount(l):"selectorText"in l?l.selectorText!==n(o.selectorText)?t+=1:o.mount(l):"cssRules"in l&&o.mount(l))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},V=class Ee{constructor(t,n=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new _o(this),this.styles=new To(this),this.attributes=new ko(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,r;t=le(t),So(t),t.style=t.style||{},this.parent=n,this.tagName=Co(t),t=Et(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let l=`${(r=this.parent)==null?void 0:r.nodeId}.${o}`,c=JSON.stringify(t.style||{},(h,m)=>typeof m=="function"?l:m);this.nodeId=_e(l+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let u=t[this.tagName];u!=null&&(typeof u=="function"?this._setupFunctionChildren(u):this.children.update(Array.isArray(u)?u:[u])),this._hooks.Init&&this._hooks.Init(this)}_setupFunctionChildren(t){let n=()=>{if(!this._disposed)try{let o=t(n);this.children.update(Array.isArray(o)?o:[o])}catch(o){this._handleError(o)}};n.elementNode=this,n.debug=`class:${this.tagName}_${this.nodeId} children`,n.onSubscribe=o=>{this._childrenRelease=()=>{o(),n=null},this.addHook("BeforeRemove",()=>{var i;(i=this._childrenRelease)==null||i.call(this),this._childrenRelease=void 0})},n()}_createDOMNode(){let t=mo.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let n in this._events)this._bindEvent(n);return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let n=o=>{var i,r;return(r=(i=this._events)==null?void 0:i[t])==null?void 0:r.call(i,o,this)};this.domElement.addEventListener(t,n),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,n),n=null})}_dispose(){var t,n,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(n=(t=this._hooks).BeforeRemove)==null||n.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(r=>r.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(o=this._hooks).Remove)==null||i.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){$(this._context,t._context),$(this._metadata,t._metadata);let n=Object.keys(t);for(let o=0;o<n.length;o++){let i=n[o],r=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(i)?this.addHook(i.substring(3),r):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),r):i==="_portal"?this._portal=r:i==="class"&&typeof r=="string"?this.attributes.addClass(r):this.attributes.set(i,r))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var n;let o=le(t);o.style=o.style||{},o=Et(o);let i=o[this.tagName];if(typeof i=="function")(n=this._childrenRelease)==null||n.call(this),this._childrenRelease=void 0,this._setupFunctionChildren(i);else{let m=i==null?[]:Array.isArray(i)?i:[i];this.children.update(m,!!this.domElement,!0)}o._context&&$(this._context,o._context),o._metadata&&$(this._metadata,o._metadata);let r=`${this.tagName}_${this.nodeId}`,l=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],c=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],u=new Set(["class"]),h=null;this._events={};for(let m of Object.keys(o)){if(l.includes(m)||c.includes(m)||m==="_portal")continue;let d=o[m];m.startsWith("on")&&typeof d=="function"?this.addEvent(m.substring(2).toLowerCase(),d):m==="class"&&typeof d=="string"?h=d:(this.attributes.set(m,d),u.add(m))}if(this.attributes.set("class",h?`${r} ${h}`:r),this.attributes.items)for(let m of Object.keys(this.attributes.items))u.has(m)||this.attributes.remove(m);if(this._events)for(let m in this._events)this._bindEvent(m)}_handleError(t){let n=this;for(;n;){if(n._hooks.Error){let o=n;n._hooks.Error(o,t,()=>{o.children.update([])});return}n=n.parent}console.error("[Domphy] Unhandled error in reactive child:",t)}addEvent(t,n){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,r)=>{o(i,r),n(i,r)}:this._events[t]=n}addHook(t,n){let o=this._hooks[t];if(typeof o=="function"){let i=((...r)=>{o(...r),n(...r)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,n.length),configurable:!0})}catch(r){}this._hooks[t]=i}else this._hooks[t]=n}getRoot(){let t=this;for(;t&&t instanceof Ee&&t.parent;)t=t.parent;return t}getContext(t){let n=this;for(;n&&(!n._context||!Object.hasOwn(n._context,t));)n=n.parent;return n&&n._context?n._context[t]:void 0}setContext(t,n){this._context=this._context||{},this._context[t]=n}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,n){this._metadata=this._metadata||{},this._metadata[t]=n}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(n=>n instanceof Ee?n.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(ho.includes(this.tagName))return`<${this.tagName}${t}>`;let n=this.children.generateHTML();return`<${this.tagName}${t}>${n}</${this.tagName}>`}mount(t,n){if(!t)throw new Error("Missing dom node on bind");if(ke&&!n&&this.parent===null&&t.childNodes.length>0&&console.warn("[Domphy] mount() was called without a style element on already-rendered DOM. Reactive style updates after hydration will be dropped \u2014 pass the server-rendered <style> element as the second argument to mount()."),this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children&&this.children.items.forEach((o,i)=>{let r=t.childNodes[i];r&&(o instanceof Ee?o.mount(r):o.domText=r)}),n){let o=n.sheet;o&&this._hydrateStyles(Jn(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var n;if((n=this.styles)==null||n.hydrate(t),this.children)for(let o of this.children.items)o instanceof Ee&&o._hydrateStyles(t)}render(t){let n=this._createDOMNode();t.appendChild(n),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),r=i instanceof ShadowRoot?i:document.head;return o||(o=Eo(r)),this.styles.render(o),this.children.items.forEach(l=>{if(l instanceof Ee&&l._portal){let c=l._portal(this.getRoot());c&&l.render(c)}else l.render(n)}),n}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var n;(n=this.domElement)==null||n.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let n=!1,o=()=>{n||(n=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!n?o():ke&&!n&&setTimeout(()=>{n||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else t()}}},vt=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Xe(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),t.content.querySelectorAll("*").forEach(n=>{for(let o of Array.from(n.attributes))/^on/i.test(o.name)?n.removeAttribute(o.name):/^(?:href|src|action|formaction)$/i.test(o.name)&&/^\s*javascript:/i.test(o.value)&&n.setAttribute(o.name,"#")}),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}setText(e){var t;let n=e===""?"\u200B":String(e);if(n===this.text&&this.domText)return;let o=Xe(this.text);if(this.text=n,!this.domText)return;if(!o&&!Xe(n)&&this.domText.nodeType===3){this.domText.nodeValue=n;return}let i=this.domText,r=this._createDOMNode();(t=i.parentNode)==null||t.replaceChild(r,i)}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":Xe(this.text)?Gn(this.text):xo(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},Tt=new Set;function er(){Tt.clear()}var _o=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new V(e,this.owner,this._nextKey++):new vt(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof V?e.domElement:e.domText;if(!o)return;let i=this.items[t+1],r=i instanceof V?i.domElement:i instanceof vt?i.domText:null;o!==r&&n.insertBefore(o,r!=null?r:null)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof V?e.domElement:e.domText,i=t instanceof V?t.domElement:t.domText;if(!o||!i)return;let r=o.nextSibling,l=i.nextSibling;n.insertBefore(o,l),n.insertBefore(i,r)}update(e,t=!0,n=!1){var o,i,r,l;let c=this.items.slice(),u=new Map;for(let v of c)v instanceof V&&v.key!==null&&v.key!==void 0&&u.set(v.key,v);!n&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let h=new Set(c),m=new Set,d=0,p=ke&&c.length>0?e.length!==c.length:!1;for(let v=0;v<e.length;v++){let S=e[v],x=typeof S=="object"&&S!==null,w=x?S._key:void 0,E=x?Co(S):void 0;if(ke&&x&&w===void 0&&d++,w!==void 0){let k=u.get(w);if(k instanceof V&&k.tagName===E){u.delete(w);let _=this.items.indexOf(k);if(_!==v&&_>=0){let O=!!k._portal;this.move(_,v,O?!1:t,!0)}k.parent=this.owner,k.patch(S),m.add(k);continue}}else if(x){let k=this.items[v];if(k instanceof V&&k.key==null&&k.tagName===E&&h.has(k)&&!m.has(k)){k.parent=this.owner,k.patch(S),m.add(k);continue}}else{let k=this.items[v];if(k instanceof vt&&h.has(k)&&!m.has(k)){k.setText(S==null?"":S),m.add(k);continue}}m.add(this.insert(S,v,t,!0))}let b=this.items.slice(e.length);for(let v of b)this.remove(v,t,!0);if(u.forEach(v=>this.remove(v,t,!0)),ke&&c.length>0&&d>0&&p){let v=this.owner.nodeId;if(!Tt.has(v)){Tt.add(v);let S=`[domphy] unkeyed list length changed \u2014 DOM nodes reused by position may not match their data slot (focus/scroll/input-value drift). Add _key to each item. (parent <${this.owner.tagName}>, ${d} unkeyed item${d===1?"":"s"})`;console.warn(S)}}n||(l=(r=this.owner._hooks)==null?void 0:r.Update)==null||l.call(r,this.owner)}insert(e,t,n=!0,o=!1){var i,r;let l=this.items.length,c=typeof t!="number"||Number.isNaN(t)||t<0||t>l?l:t,u=this._createNode(e);if(this.items.splice(c,0,u),u instanceof V){u._hooks.Insert&&u._hooks.Insert(u);let h=this.owner.domElement;if(n&&h)if(u._portal){let m=u._portal(this.owner.getRoot());m&&u.render(m)}else{let m=u._createDOMNode(),d=(i=h.childNodes[c])!=null?i:null;h.insertBefore(m,d);let p=h.getRootNode(),b=p instanceof ShadowRoot?p:document.head,v=Eo(b);u.styles.render(v),u._hooks.Mount&&u._hooks.Mount(u),u.children.items.forEach(S=>{if(S instanceof V&&S._portal){let x=S._portal(S.getRoot());x&&S.render(x)}else S.render(m)})}}else{let h=this.owner.domElement;if(n&&h){let m=u._createDOMNode(),d=(r=h.childNodes[c])!=null?r:null;h.insertBefore(m,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),u}remove(e,t=!0,n=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof V){if(e._beforeRemoveFired)return;let i=()=>{let r=e.domElement,l=this.items.indexOf(e);l>=0&&this.items.splice(l,1),t&&r&&r.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let r=!1,l=()=>{r||(r=!0,i())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,l),e._hooks.BeforeRemove.length<2&&!r?l():ke&&!r&&setTimeout(()=>{r||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter (e.g. an exit animation) but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,n=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],r=this.items[t];this.items[e]=r,this.items[t]=i,n&&this._swapDomElement(i,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,n=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),n&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},he=new Set,_t=!1;function Oo(e){he.add(e),!_t&&(_t=!0,$t(Po))}function Po(){for(_t=!1;he.size>0;){let e=[...he];he.clear();for(let t of e)try{t()}catch(n){console.error("[Domphy] Uncaught error in effect:",n)}}}function tr(){let e=0;for(;bo()||he.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}vo(),Po()}}var Me=[];function or(){return Me.length?Me[Me.length-1]:null}function Rt(e){let t=or();t&&t._add(e)}var nr=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){Me.push(this);try{return e()}finally{Me.pop()}}stop(){if(!this._stopped){this._stopped=!0;for(let e of this._disposers)e();this._disposers.clear()}}};function rr(){let e=new nr;return Rt(()=>e.stop()),e}function ir(e){let t=!1,n=!1,o=()=>{t||r()},i=new po(()=>{t||Oo(o)}),r=()=>{if(!(t||n)){n=!0,i.reset();try{go(i,e)}finally{n=!1}}},l=()=>{t||(t=!0,i.reset(),he.delete(o))};return Rt(l),r(),l}function lr(e){let t="computed",n=new Ae,o,i=!0,r=!1,l=()=>{i&&n.listenerCount(t)>0&&h()},c=new po(()=>{i||(i=!0,Oo(l))}),u=()=>{c.reset(),o=go(c,e),i=!1,r=!0},h=()=>{let d=o,p=r;u(),!(p&&o===d)&&n.notify(t,o)},m=d=>{if(d)n.addListener(t,d);else{let p=Dt();p&&n.addListener(t,p.handler)}return i&&u(),o};return Rt(()=>{c.reset(),he.delete(l),n._dispose()}),{_isState:!0,_notifier:n,get:m}}function ar(e){return yo(e)}function sr(e){return Un(e)}var cr=class{constructor(e){this._notifier=new Ae,this.initialRecord=so({},e),this._record=so({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let n=Dt();n&&this._notifier.addListener(e,n.handler)}return this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e,t)}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var tt={};Ge(tt,{ElementTones:()=>Ne,getTheme:()=>Z,setTheme:()=>hr,themeApply:()=>pr,themeCSS:()=>zt,themeColor:()=>s,themeColorToken:()=>Nt,themeDensity:()=>g,themeName:()=>et,themeSize:()=>y,themeSpacing:()=>a,themeTokens:()=>Lo,themeVars:()=>Ve});var ur={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},Be=ur,At=e=>JSON.parse(JSON.stringify(e)),$o=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),Oe={light:At(Be),dark:fr(Be)},Qe=null,Lt=new Map;function Vt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function mr(e){for(let t in e)if(!Object.keys(Be).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}}function Ro(e,t){var n;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((n=e[o])!=null||(e[o]={}),Ro(e[o],t[o])):e[o]=t[o]}function dr(e,t){let n={},o=Vt(t);for(let r in t){let l=t[r];if(r==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(u=>n[`--${c}-${u}`]=t.colors[c][u]);else if(r==="fontSizes")[...Array(8).keys()].forEach(c=>n[`--fontSize-${c}`]=t.fontSizes[c]);else if(r==="custom"&&l&&typeof l=="object")for(let c in l)n[`--custom-${$o(c)}`]=l[c]}let i="";for(let r in n)i+=` ${r}: ${n[r]};
3
3
  `;return`[data-theme="${e}"] {
4
- ${i}}`}function Z(e){if(!_e[e])throw Error(`Theme "${e}" not found`);return _e[e]}function hr(e,t){mr(t),_e[e]||(_e[e]=zt(Ne)),Do(_e[e],t),Ze=null,Dt.clear()}function fr(e){let t=zt(e);t.direction="lighten";for(let n in t.colors)t.colors[n].reverse(),t.baseTones[n]=t.colors[n].length-1-t.baseTones[n];return t}function $o(e){let t=Dt.get(e);if(t)return t;let n=Z(e),o=It(n),i={};for(let r in n){let a=n[r];if(r==="colors")for(let c in n.colors){let u={};[...Array(o).keys()].forEach(h=>u[h]=n.colors[c][h]),i[c]=u}else if(r==="fontSizes")i.fontSizes=n.fontSizes;else if(r==="densities")i.densities=n.densities;else if(r==="custom"&&(i.custom={},a&&typeof a=="object"))for(let c in a)i.custom[c]=a[c]}return Dt.set(e,i),i}function Ae(){if(Ze)return Ze;let e=Z("light"),t=It(e),n={};for(let o in e){let i=e[o];if(o==="colors")for(let r in e.colors){let a={};[...Array(t).keys()].forEach(c=>a[c]=`var(--${r}-${c})`),n[r]=a}else if(o==="fontSizes")n.fontSizes=[...Array(8).keys()].map(r=>`var(--fontSize-${r})`);else if(o==="custom"&&(n.custom={},i&&typeof i=="object"))for(let r in i)n.custom[r]=`var(--custom-${Po(r)})`}return Ze=n,n}function $t(){return Object.entries(_e).map(([e,t])=>dr(e,t)).join(`
5
- `)}function pr(e){var t;if(typeof document!="undefined")if(e){e.textContent=$t();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=$t(),document.head.appendChild(e)}function l(e){return`${e/4}em`}function Qe(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let n="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(n=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),n}var Lt=["inherit"];[...Array(5).keys()].forEach(e=>{Lt.push(`decrease-${e}`),Lt.push(`increase-${e}`)});function gr(e,t="inherit"){if(!Lt.includes(t))throw Error(`density name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(4,n))}function yr(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(n=gr(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function y(e){let t=yr(e);return Z(e?Qe(e):"light").densities[t]}var Rt=["inherit"];[...Array(8).keys()].forEach(e=>{Rt.push(`decrease-${e}`),Rt.push(`increase-${e}`)});function Lo(e,t="inherit"){if(!Rt.includes(t))throw Error(`size name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(7,n))}function br(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(n=Lo(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function b(e,t="inherit"){let n=Lo(br(e),t);return Ae().fontSizes[n]}var le=Ne.colors.neutral.length,Ve=["inherit","base"];[...Array(le).keys()].forEach(e=>{Ve.push(`decrease-${e}`),Ve.push(`increase-${e}`),Ve.push(`shift-${e}`)});function Oo(e,t){if(e<0||e>le-1)return e;let n=e+t;return n=Math.max(0,Math.min(le-1,n)),n}function vr(e,t){if(e<0||e>le-1)return e;let n=Math.floor((le-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(le-1,o)),o}function Be(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!Ve.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return Oo(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return Oo(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return vr(e,n)}else return e}function Ro(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let n=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(n=Be(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function zo(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===le-1?le-1-n:e}function s(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e)return t==="base"?Ae()[o][Z("light").baseTones[o]]:Ae()[o][Be(0,t)];let i=Qe(e),r;if(t==="base")r=Z(i).baseTones[o];else{let c=Z(i),u=zo(Ro(e),c.direction,c.darkBias);r=Be(u,t)}let a=Ae()[o];if(!a)throw Error(`color "${o}" not found on theme "${i}"`);return a[r]}function Mt(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,i=e?Qe(e):"light",r=$o(i);if(!e)return t==="base"?r[o][Z("light").baseTones[o]]:r[o][Be(0,t)];let a;if(t==="base")a=Z(i).baseTones[o];else{let c=Z(i),u=zo(Ro(e),c.direction,c.darkBias);a=Be(u,t)}return r[o][a]}var ht={};Ye(ht,{abbreviation:()=>Sr,accordion:()=>xr,alert:()=>Cr,avatar:()=>wr,badge:()=>Er,blockquote:()=>kr,breadcrumb:()=>Tr,breadcrumbEllipsis:()=>_r,button:()=>Or,buttonSwitch:()=>Pr,card:()=>Dr,code:()=>$r,combobox:()=>vi,command:()=>Si,commandItem:()=>Ci,commandSearch:()=>xi,datePicker:()=>Ei,descriptionList:()=>_i,details:()=>Oi,dialog:()=>Pi,divider:()=>Di,drawer:()=>$i,emphasis:()=>Li,empty:()=>Ri,errorBoundary:()=>zi,fab:()=>Mi,figure:()=>Ai,formGroup:()=>Vi,heading:()=>Bi,horizontalRule:()=>Hi,icon:()=>ji,image:()=>Fi,inputCheckbox:()=>Wi,inputColor:()=>Ki,inputDateTime:()=>Ui,inputFile:()=>qi,inputNumber:()=>Yi,inputOTP:()=>Gi,inputRadio:()=>Xi,inputRange:()=>Ji,inputSearch:()=>Zi,inputSwitch:()=>Qi,inputText:()=>ea,keyboard:()=>ta,label:()=>oa,link:()=>na,list:()=>ra,listItem:()=>ia,listItemButton:()=>aa,mark:()=>la,menu:()=>sa,menuItem:()=>ca,motion:()=>ua,orderedList:()=>ma,pagination:()=>ha,paragraph:()=>fa,popover:()=>pa,popoverArrow:()=>Yt,preformated:()=>ga,progress:()=>ya,rating:()=>Sa,segmented:()=>xa,segmentedItem:()=>Ca,select:()=>wa,selectBox:()=>Ea,selectItem:()=>ka,selectList:()=>Ta,skeleton:()=>_a,small:()=>Oa,spinner:()=>Pa,splitter:()=>Da,splitterHandle:()=>La,splitterPanel:()=>$a,stepItem:()=>Ra,steps:()=>za,strong:()=>Ia,subscript:()=>Ma,superscript:()=>Aa,tab:()=>Va,tabPanel:()=>Ba,table:()=>Na,tabs:()=>Ha,tag:()=>Fe,textarea:()=>ja,timeline:()=>Fa,timelineItem:()=>Wa,toast:()=>Ka,toggle:()=>Ua,toggleGroup:()=>qa,toolbar:()=>Ya,toolbarSpacer:()=>Ga,tooltip:()=>Xa,transitionGroup:()=>Ja,unorderedList:()=>Za});function Sr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>b(r),backgroundColor:r=>s(r),color:r=>s(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>s(r,"shift-7",t.get(r)),textUnderlineOffset:l(.72),cursor:"help","&:hover":{color:r=>s(r,"shift-11",n.get(r)),textDecorationColor:r=>s(r,"shift-9",n.get(r))}}}}function xr(e={}){var i,r;let{type:t="single"}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=f((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:a=>{if(t!=="single")return;let c=a.domElement;if(!c)return;let u=h=>{let m=h.target.closest("summary");if(!m)return;let d=m.closest("details");!d||d.parentElement!==c||d.open||Array.from(c.querySelectorAll(":scope > details")).forEach(p=>{p!==d&&(p.open=!1)})};c.addEventListener("click",u),a.addHook("Remove",()=>c.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:a=>l(y(a)*1),outline:a=>`1px solid ${s(a,"shift-4",n.get(a))}`,outlineOffset:"-1px",overflow:"hidden","& > details":{borderBottom:a=>`1px solid ${s(a,"shift-4",n.get(a))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{outline:a=>`${l(.5)} solid ${s(a,"shift-6",o.get(a))}`}}}}function Cr(e={}){var n;let t=f((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:l(3),paddingBlock:o=>l(y(o)*2),paddingInline:o=>l(y(o)*4),boxShadow:o=>`inset ${l(1)} 0 0 0 ${s(o,"shift-8",t.get(o))}`,backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),fontSize:o=>b(o,"inherit")}}}function wr(e={}){var n;let t=f((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:l(9),height:l(9),fontSize:o=>b(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function Er(e={}){var i;let{label:t=999}=e,n=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:l(1),minWidth:l(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>b(r,"decrease-1"),borderRadius:l(999),backgroundColor:r=>s(r,"shift-9",o.get(r)),color:r=>s(r,"shift-0",o.get(r))}}}}function kr(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>b(o,"inherit"),backgroundColor:o=>s(o,"inherit",t.get(o)),boxShadow:o=>`inset ${l(1)} 0 0 0 ${s(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>l(y(o)*2),paddingInline:o=>l(y(o)*4),margin:0}}}function Tr(e={}){var o;let{separator:t="/"}=e,n=f((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>b(i,"inherit"),gap:l(1),color:i=>s(i,"shift-9",n.get(i)),backgroundColor:i=>s(i,"inherit",n.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>s(i,"shift-8",n.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>s(i,"shift-4",n.get(i)),paddingInlineStart:l(1)},"& > [aria-current=page]":{color:i=>s(i,"shift-10",n.get(i)),pointerEvents:"none"}}}}function _r(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>b(o,"inherit"),paddingInline:l(1),border:"none",background:"none",cursor:"pointer",color:o=>s(o,"shift-8",t.get(o)),borderRadius:l(1),"&:hover":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",t.get(o))}`,outlineOffset:l(.5)}}}}function Or(e={}){var n;let t=f((n=e.color)!=null?n:"primary","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>b(o,"inherit"),paddingBlock:o=>l(y(o)*1),paddingInline:o=>l(y(o)*3),borderRadius:o=>l(y(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>l(y(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${l(.5)} ${s(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,color:o=>s(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Pr(e={}){var r,a;let{checked:t=!1}=e,n=f(t),o=f((r=e.color)!=null?r:"neutral","color"),i=f((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:c=>{c.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>n.get(c),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>b(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${s(c,"shift-3",o.get(c))}`,minWidth:l(12),minHeight:l(6),borderRadius:l(999),paddingLeft:l(7),paddingRight:l(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>s(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:l(5),height:l(5),borderRadius:l(999),color:c=>s(c,"shift-9"),backgroundColor:c=>s(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>s(c,"increase-3",i.get(c)),outline:"none",color:c=>s(c,"decrease-2"),paddingLeft:l(2),paddingRight:l(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${l(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Dr(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>l(y(o)*2),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>l(y(o)*2),paddingInline:o=>l(y(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>l(y(o)*4),color:o=>s(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>l(y(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>l(y(o)*4),color:o=>s(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:l(2),paddingBlock:o=>l(y(o)*2),paddingInline:o=>l(y(o)*4),borderTop:o=>`1px solid ${s(o,"shift-3",t.get(o))}`}}}}function $r(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:l(6),paddingInline:l(1.5),borderRadius:l(1)}}}var Lr=Object.defineProperty,Rr=Object.defineProperties,zr=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Io=(e,t,n)=>t in e?Lr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y=(e,t)=>{for(var n in t||(t={}))Ko.call(t,n)&&Io(e,n,t[n]);if(ot)for(var n of ot(t))Uo.call(t,n)&&Io(e,n,t[n]);return e},ge=(e,t)=>Rr(e,zr(t)),qo=(e,t)=>{var n={};for(var o in e)Ko.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&ot)for(var o of ot(e))t.indexOf(o)<0&&Uo.call(e,o)&&(n[o]=e[o]);return n},ve=(e,t,n)=>new Promise((o,i)=>{var r=u=>{try{c(n.next(u))}catch(h){i(h)}},a=u=>{try{c(n.throw(u))}catch(h){i(h)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(r,a);c((n=n.apply(e,t)).next())}),Ir=["top","right","bottom","left"],Mo=["start","end"],Yl=Ir.reduce((e,t)=>e.concat(t,`${t}-${Mo[0]}`,`${t}-${Mo[1]}`),[]),nt=Math.min,pe=Math.max,rt=Math.round,tt=Math.floor,Q=e=>({x:e,y:e}),Mr={left:"right",right:"left",bottom:"top",top:"bottom"};function Ao(e,t,n){return pe(e,nt(t,n))}function lt(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function st(e){return e.split("-")[1]}function Yo(e){return e==="x"?"y":"x"}function Go(e){return e==="y"?"height":"width"}function se(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Xo(e){return Yo(se(e))}function Ar(e,t,n=!1){let o=st(e),i=Xo(e),r=Go(i),a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=it(a)),[a,it(a)]}function Vr(e){let t=it(e);return[Nt(e),t,Nt(t)]}function Nt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Vo=["left","right"],No=["right","left"],Nr=["top","bottom"],Br=["bottom","top"];function Hr(e,t,n){switch(e){case"top":case"bottom":return n?t?No:Vo:t?Vo:No;case"left":case"right":return t?Nr:Br;default:return[]}}function jr(e,t,n,o){let i=st(e),r=Hr(ye(e),n==="start",o);return i&&(r=r.map(a=>`${a}-${i}`),t&&(r=r.concat(r.map(Nt)))),r}function it(e){let t=ye(e);return Mr[t]+e.slice(t.length)}function Fr(e){return Y({top:0,right:0,bottom:0,left:0},e)}function Wr(e){return typeof e!="number"?Fr(e):{top:e,right:e,bottom:e,left:e}}function at(e){let{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Bo({reference:e,floating:t},n,o){let i=se(n),r=Xo(n),a=Go(r),c=ye(n),u=i==="y",h=e.x+e.width/2-t.width/2,m=e.y+e.height/2-t.height/2,d=e[a]/2-t[a]/2,p;switch(c){case"top":p={x:h,y:e.y-t.height};break;case"bottom":p={x:h,y:e.y+e.height};break;case"right":p={x:e.x+e.width,y:m};break;case"left":p={x:e.x-t.width,y:m};break;default:p={x:e.x,y:e.y}}switch(st(n)){case"start":p[r]-=d*(o&&u?-1:1);break;case"end":p[r]+=d*(o&&u?-1:1);break;default:}return p}function Kr(e){return ve(this,arguments,function*(t,n={}){var o,i,r,a,c,u;let{x:h,y:m,platform:d,rects:p,elements:g,strategy:v}=t,{boundary:x="clippingAncestors",rootBoundary:C="viewport",elementContext:w="floating",altBoundary:E=!1,padding:O=0}=lt(n,t),T=Wr(O),D=g[E?w==="floating"?"reference":"floating":w],M=at(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,D))==null||i?D:D.contextElement||(yield(r=d.getDocumentElement)==null?void 0:r.call(d,g.floating)),boundary:x,rootBoundary:C,strategy:v})),R=w==="floating"?{x:h,y:m,width:p.floating.width,height:p.floating.height}:p.reference,ie=yield(a=d.getOffsetParent)==null?void 0:a.call(d,g.floating),W=(yield(c=d.isElement)==null?void 0:c.call(d,ie))?(yield(u=d.getScale)==null?void 0:u.call(d,ie))||{x:1,y:1}:{x:1,y:1},H=at(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:R,offsetParent:ie,strategy:v}):R);return{top:(M.top-H.top+T.top)/W.y,bottom:(H.bottom-M.bottom+T.bottom)/W.y,left:(M.left-H.left+T.left)/W.x,right:(H.right-M.right+T.right)/W.x}})}var Ur=50,qr=(e,t,n)=>ve(null,null,function*(){var o;let{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:c}=n,u=c.detectOverflow?c:ge(Y({},c),{detectOverflow:Kr}),h=yield(o=c.isRTL)==null?void 0:o.call(c,t),m=yield c.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:p}=Bo(m,i,h),g=i,v=0,x={};for(let C=0;C<a.length;C++){let w=a[C];if(!w)continue;let{name:E,fn:O}=w,{x:T,y:D,data:M,reset:R}=yield O({x:d,y:p,initialPlacement:i,placement:g,strategy:r,middlewareData:x,rects:m,platform:u,elements:{reference:e,floating:t}});d=T!=null?T:d,p=D!=null?D:p,x[E]=Y(Y({},x[E]),M),R&&v<Ur&&(v++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(m=R.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:d,y:p}=Bo(m,g,h)),C=-1)}return{x:d,y:p,placement:g,strategy:r,middlewareData:x}});var Yr=(e={})=>({name:"flip",options:e,fn(t){return ve(this,null,function*(){var n,o,i,r,a,c;let{placement:u,middlewareData:h,rects:m,initialPlacement:d,platform:p,elements:g}=t,v=lt(e,t),{mainAxis:x=!0,crossAxis:C=!0,fallbackPlacements:w,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:T=!0}=v,D=qo(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=h.arrow)!=null&&n.alignmentOffset)return{};let M=ye(u),R=se(d),ie=ye(d)===d,W=yield(o=p.isRTL)==null?void 0:o.call(p,g.floating),H=w||(ie||!T?[it(d)]:Vr(d)),Ue=O!=="none";!w&&Ue&&H.push(...jr(d,T,O,W));let ft=[d,...H],xe=yield p.detectOverflow(t,D),j=[],oe=((i=h.flip)==null?void 0:i.overflows)||[];if(x&&j.push(xe[M]),C){let ne=Ar(u,m,W);j.push(xe[ne[0]],xe[ne[1]])}if(oe=[...oe,{placement:u,overflows:j}],!j.every(ne=>ne<=0)){let ne=(((r=h.flip)==null?void 0:r.index)||0)+1,Le=ft[ne];if(Le&&(!(C==="alignment"&&R!==se(Le))||oe.every(V=>se(V.placement)===R?V.overflows[0]>0:!0)))return{data:{index:ne,overflows:oe},reset:{placement:Le}};let ue=(a=oe.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:a.placement;if(!ue)switch(E){case"bestFit":{let V=(c=oe.filter(U=>{if(Ue){let q=se(U.placement);return q===R||q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(q=>q>0).reduce((q,Re)=>q+Re,0)]).sort((U,q)=>U[1]-q[1])[0])==null?void 0:c[0];V&&(ue=V);break}case"initialPlacement":ue=d;break;default:}if(u!==ue)return{reset:{placement:ue}}}return{}})}});var Gr=new Set(["left","top"]);function Xr(e,t){return ve(this,null,function*(){var n;let{placement:o,platform:i,elements:r}=e,a=yield(n=i.isRTL)==null?void 0:n.call(i,r.floating),c=ye(o),u=st(o),h=se(o)==="y",m=Gr.has(c)?-1:1,d=a&&h?-1:1,p=lt(t,e),{mainAxis:g,crossAxis:v,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(v=u==="end"?x*-1:x),h?{x:v*d,y:g*m}:{x:g*m,y:v*d}})}var Jr=(e=0)=>({name:"offset",options:e,fn(t){return ve(this,null,function*(){var n,o;let{x:i,y:r,placement:a,middlewareData:c}=t,u=yield Xr(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:r+u.y,data:ge(Y({},u),{placement:a})}})}}),Zr=(e={})=>({name:"shift",options:e,fn(t){return ve(this,null,function*(){let{x:n,y:o,placement:i,platform:r}=t,a=lt(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:h={fn:({x:E,y:O})=>({x:E,y:O})}}=a,m=qo(a,["mainAxis","crossAxis","limiter"]),d={x:n,y:o},p=yield r.detectOverflow(t,m),g=se(ye(i)),v=Yo(g),x=d[v],C=d[g];if(c){let E=v==="y"?"top":"left",O=v==="y"?"bottom":"right",T=x+p[E],D=x-p[O];x=Ao(T,x,D)}if(u){let E=g==="y"?"top":"left",O=g==="y"?"bottom":"right",T=C+p[E],D=C-p[O];C=Ao(T,C,D)}let w=h.fn(ge(Y({},t),{[v]:x,[g]:C}));return ge(Y({},w),{data:{x:w.x-n,y:w.y-o,enabled:{[v]:c,[g]:u}}})})}});function ct(){return typeof window!="undefined"}function De(e){return Jo(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function ee(e){var t;return(t=(Jo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jo(e){return ct()?e instanceof Node||e instanceof F(e).Node:!1}function G(e){return ct()?e instanceof Element||e instanceof F(e).Element:!1}function re(e){return ct()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function Ho(e){return!ct()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function je(e){let{overflow:t,overflowX:n,overflowY:o,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&i!=="inline"&&i!=="contents"}function Qr(e){return/^(table|td|th)$/.test(De(e))}function ut(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var ei=/transform|translate|scale|rotate|perspective|filter/,ti=/paint|layout|strict|content/,fe=e=>!!e&&e!=="none",At;function Ht(e){let t=G(e)?X(e):e;return fe(t.transform)||fe(t.translate)||fe(t.scale)||fe(t.rotate)||fe(t.perspective)||!jt()&&(fe(t.backdropFilter)||fe(t.filter))||ei.test(t.willChange||"")||ti.test(t.contain||"")}function oi(e){let t=ce(e);for(;re(t)&&!Pe(t);){if(Ht(t))return t;if(ut(t))return null;t=ce(t)}return null}function jt(){return At==null&&(At=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),At}function Pe(e){return/^(html|body|#document)$/.test(De(e))}function X(e){return F(e).getComputedStyle(e)}function mt(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(De(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ho(e)&&e.host||ee(e);return Ho(t)?t.host:t}function Zo(e){let t=ce(e);return Pe(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&je(t)?t:Zo(t)}function He(e,t=[],n=!0){var o;let i=Zo(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),a=F(i);if(r){let c=Bt(a);return t.concat(a,a.visualViewport||[],je(i)?i:[],c&&n?He(c):[])}else return t.concat(i,He(i,[],n))}function Bt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qo(e){let t=X(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=re(e),r=i?e.offsetWidth:n,a=i?e.offsetHeight:o,c=rt(n)!==r||rt(o)!==a;return c&&(n=r,o=a),{width:n,height:o,$:c}}function Ft(e){return G(e)?e:e.contextElement}function Oe(e){let t=Ft(e);if(!re(t))return Q(1);let n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Qo(t),a=(r?rt(n.width):n.width)/o,c=(r?rt(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var ni=Q(0);function en(e){let t=F(e);return!jt()||!t.visualViewport?ni:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ri(e,t=!1,n){return!n||t&&n!==F(e)?!1:t}function be(e,t=!1,n=!1,o){let i=e.getBoundingClientRect(),r=Ft(e),a=Q(1);t&&(o?G(o)&&(a=Oe(o)):a=Oe(e));let c=ri(r,n,o)?en(r):Q(0),u=(i.left+c.x)/a.x,h=(i.top+c.y)/a.y,m=i.width/a.x,d=i.height/a.y;if(r){let p=F(r),g=o&&G(o)?F(o):o,v=p,x=Bt(v);for(;x&&o&&g!==v;){let C=Oe(x),w=x.getBoundingClientRect(),E=X(x),O=w.left+(x.clientLeft+parseFloat(E.paddingLeft))*C.x,T=w.top+(x.clientTop+parseFloat(E.paddingTop))*C.y;u*=C.x,h*=C.y,m*=C.x,d*=C.y,u+=O,h+=T,v=F(x),x=Bt(v)}}return at({width:m,height:d,x:u,y:h})}function dt(e,t){let n=mt(e).scrollLeft;return t?t.left+n:be(ee(e)).left+n}function tn(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-dt(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function ii({elements:e,rect:t,offsetParent:n,strategy:o}){let i=o==="fixed",r=ee(n),a=e?ut(e.floating):!1;if(n===r||a&&i)return t;let c={scrollLeft:0,scrollTop:0},u=Q(1),h=Q(0),m=re(n);if((m||!m&&!i)&&((De(n)!=="body"||je(r))&&(c=mt(n)),m)){let p=be(n);u=Oe(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}let d=r&&!m&&!i?tn(r,c):Q(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+h.x+d.x,y:t.y*u.y-c.scrollTop*u.y+h.y+d.y}}function ai(e){return Array.from(e.getClientRects())}function li(e){let t=ee(e),n=mt(e),o=e.ownerDocument.body,i=pe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=pe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+dt(e),c=-n.scrollTop;return X(o).direction==="rtl"&&(a+=pe(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:c}}var jo=25;function si(e,t){let n=F(e),o=ee(e),i=n.visualViewport,r=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){r=i.width,a=i.height;let m=jt();(!m||m&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let h=dt(o);if(h<=0){let m=o.ownerDocument,d=m.body,p=getComputedStyle(d),g=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-g);v<=jo&&(r-=v)}else h<=jo&&(r+=h);return{width:r,height:a,x:c,y:u}}function ci(e,t){let n=be(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=re(e)?Oe(e):Q(1),a=e.clientWidth*r.x,c=e.clientHeight*r.y,u=i*r.x,h=o*r.y;return{width:a,height:c,x:u,y:h}}function Fo(e,t,n){let o;if(t==="viewport")o=si(e,n);else if(t==="document")o=li(ee(e));else if(G(t))o=ci(t,n);else{let i=en(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return at(o)}function on(e,t){let n=ce(e);return n===t||!G(n)||Pe(n)?!1:X(n).position==="fixed"||on(n,t)}function ui(e,t){let n=t.get(e);if(n)return n;let o=He(e,[],!1).filter(c=>G(c)&&De(c)!=="body"),i=null,r=X(e).position==="fixed",a=r?ce(e):e;for(;G(a)&&!Pe(a);){let c=X(a),u=Ht(a);!u&&c.position==="fixed"&&(i=null),(r?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||je(a)&&!u&&on(e,a))?o=o.filter(h=>h!==a):i=c,a=ce(a)}return t.set(e,o),o}function mi({element:e,boundary:t,rootBoundary:n,strategy:o}){let i=[...t==="clippingAncestors"?ut(e)?[]:ui(e,this._c):[].concat(t),n],r=Fo(e,i[0],o),a=r.top,c=r.right,u=r.bottom,h=r.left;for(let m=1;m<i.length;m++){let d=Fo(e,i[m],o);a=pe(d.top,a),c=nt(d.right,c),u=nt(d.bottom,u),h=pe(d.left,h)}return{width:c-h,height:u-a,x:h,y:a}}function di(e){let{width:t,height:n}=Qo(e);return{width:t,height:n}}function hi(e,t,n){let o=re(t),i=ee(t),r=n==="fixed",a=be(e,!0,r,t),c={scrollLeft:0,scrollTop:0},u=Q(0);function h(){u.x=dt(i)}if(o||!o&&!r)if((De(t)!=="body"||je(i))&&(c=mt(t)),o){let g=be(t,!0,r,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else i&&h();r&&!o&&i&&h();let m=i&&!o&&!r?tn(i,c):Q(0),d=a.left+c.scrollLeft-u.x-m.x,p=a.top+c.scrollTop-u.y-m.y;return{x:d,y:p,width:a.width,height:a.height}}function Vt(e){return X(e).position==="static"}function Wo(e,t){if(!re(e)||X(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function nn(e,t){let n=F(e);if(ut(e))return n;if(!re(e)){let i=ce(e);for(;i&&!Pe(i);){if(G(i)&&!Vt(i))return i;i=ce(i)}return n}let o=Wo(e,t);for(;o&&Qr(o)&&Vt(o);)o=Wo(o,t);return o&&Pe(o)&&Vt(o)&&!Ht(o)?n:o||oi(e)||n}var fi=function(e){return ve(this,null,function*(){let t=this.getOffsetParent||nn,n=this.getDimensions,o=yield n(e.floating);return{reference:hi(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function pi(e){return X(e).direction==="rtl"}var gi={convertOffsetParentRelativeRectToViewportRelativeRect:ii,getDocumentElement:ee,getClippingRect:mi,getOffsetParent:nn,getElementRects:fi,getClientRects:ai,getDimensions:di,getScale:Oe,isElement:G,isRTL:pi};function rn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yi(e,t){let n=null,o,i=ee(e);function r(){clearTimeout(o),n==null||n.disconnect(),n=null}function a(c=!1,u=1){r();let h=e.getBoundingClientRect(),{left:m,top:d,width:p,height:g}=h;if(c||t(),!p||!g)return;let v=tt(d),x=tt(i.clientWidth-(m+p)),C=tt(i.clientHeight-(d+g)),w=tt(m),E={rootMargin:`${-v}px ${-x}px ${-C}px ${-w}px`,threshold:pe(0,nt(1,u))||1},O=!0;function T(D){let M=D[0].intersectionRatio;if(M!==u){if(!O)return a();M?a(!1,M):o=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!rn(h,e.getBoundingClientRect())&&a(),O=!1}try{n=new IntersectionObserver(T,ge(Y({},E),{root:i.ownerDocument}))}catch(D){n=new IntersectionObserver(T,E)}n.observe(e)}return a(!0),r}function an(e,t,n,o={}){let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,h=Ft(e),m=i||r?[...h?He(h):[],...t?He(t):[]]:[];m.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});let d=h&&c?yi(h,n):null,p=-1,g=null;a&&(g=new ResizeObserver(([w])=>{w&&w.target===h&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g==null||g.observe(t)})),n()}),h&&!u&&g.observe(h),t&&g.observe(t));let v,x=u?be(e):null;u&&C();function C(){let w=be(e);x&&!rn(x,w)&&n(),x=w,v=requestAnimationFrame(C)}return n(),()=>{m.forEach(w=>{i&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),d==null||d(),g==null||g.disconnect(),g=null,u&&cancelAnimationFrame(v)}}var ln=Jr;var sn=Zr,cn=Yr;var un=(e,t,n)=>{let o=new Map,i=Y({platform:gi},n),r=ge(Y({},i.platform),{_c:o});return qr(e,t,ge(Y({},i),{platform:r}))};function te(e){let{open:t=!1,placement:n}=e,o=null,i=null,r=null,a=null,c=null,u=null,h=!1,m=f(t),d=()=>{h||!u||(h=!0,c=u.children.insert(e.content))},p=()=>{d(),r&&a&&(i&&i(),i=an(r,a,()=>{un(r,a,{placement:n.get(),middleware:[ln(12),cn(),sn()],strategy:"fixed"}).then(({x:E,y:O,placement:T})=>{Object.assign(a.style,{left:`${E}px`,top:`${O}px`}),n.set(T)})}),m.set(!0))},g=()=>{i&&i(),i=null,m.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(p,100)},x=()=>{o&&clearTimeout(o),o=setTimeout(g,100)},C={style:{position:"fixed",pointerEvents:"auto",visibility:E=>m.get(E)?"visible":"hidden"},_onMount:E=>a=E.domElement,_portal:E=>{let O=E.domElement.querySelector("#domphy-floating");if(!O){let T={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};O=E.children.insert(T).domElement}return O}};return $(e.content,C),{show:v,hide:x,anchorPartial:{onKeyDown:E=>E.key==="Escape"&&x(),_onMount:E=>{u=E.getRoot(),r=E.domElement;let O=T=>{if(!m.get()||!r||!a)return;let D=T.target;!r.contains(D)&&!a.contains(D)&&x()};E.getRoot().domElement.addEventListener("click",O),E.addHook("BeforeRemove",()=>{o&&clearTimeout(o),i&&(i(),i=null),c&&c.remove(),E.getRoot().domElement.removeEventListener("click",O)})}}}}var bi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function Fe(e={}){var o;let{removable:t=!1}=e,n=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let r={span:bi,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:l(1),width:l(4),height:l(4),flexShrink:0,"&:hover":{backgroundColor:a=>s(a,"shift-4",n.get(a))}}};t&&i.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:l(6),paddingBlock:"0px",borderRadius:l(1),paddingInlineStart:l(2),paddingInlineEnd:t?l(1):l(2),gap:l(2),fontSize:i=>b(i,"inherit"),backgroundColor:i=>s(i,"inherit",n.get(i)),color:i=>s(i,"shift-9",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"shift-4",n.get(i))}`}}}function vi(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,a=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(n),content:e.content}),d={onClick:()=>!r&&h()};$(e.content,d);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:l(6),marginInlineStart:l(2),fontSize:C=>b(C,"inherit"),color:C=>s(C,"shift-9",o),backgroundColor:C=>s(C,"inherit",o)},g;e.input?($(e.input,{onFocus:()=>u(),style:p,_key:"combobox-input"}),g=e.input):g={input:null,onFocus:()=>u(),value:C=>(a.get(C),""),style:p,_key:"combobox-input"};let v={div:C=>{let w=a.get(C),E=Array.isArray(w)?w:[w],T=t.filter(D=>E.includes(D.value)).map(D=>({span:D.label,$:[Fe({color:o,removable:!0})],_key:D.value,_onRemove:M=>{let R=a.get(),W=(Array.isArray(R)?R:[R]).filter(H=>H!==D.value);r?a.set(W):a.set(W[0])}}));return T.push(g),T},style:{display:"flex",flexWrap:"wrap",gap:l(1)}},x={_onInsert:C=>{C.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:C=>C.children.insert(v),style:{minWidth:l(32),outlineOffset:"-1px",outline:C=>`1px solid ${s(C,"shift-4","neutral")}`,paddingBlock:C=>l(y(C)*1),paddingInline:C=>l(y(C)*1),borderRadius:C=>l(y(C)*1),fontSize:C=>b(C,"inherit"),color:C=>s(C,"shift-9",o),backgroundColor:C=>s(C,"inherit",o)}};return $(m,x),m}function Si(){return{_onSchedule:(e,t)=>{$(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function xi(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,a=()=>i.query.set(r.value);r.addEventListener("input",a),o.addHook("Remove",()=>r.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>b(o,"inherit"),paddingInline:o=>l(y(o)*3),paddingBlock:o=>l(y(o)*2),border:"none",borderBottom:o=>`1px solid ${s(o,"shift-3",t)}`,outline:"none",color:o=>s(o,"shift-10",t),backgroundColor:o=>s(o,"inherit",t),"&::placeholder":{color:o=>s(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>s(o,"shift-6",n)}}}}function Ci(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{role:"option",_onMount:o=>{var h,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,a=(m=(h=r.textContent)==null?void 0:h.toLowerCase())!=null?m:"",c=d=>{r.hidden=d.length>0&&!a.includes(d.toLowerCase())};c(i.query.get());let u=i.query.addListener(c);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>b(o,"inherit"),height:o=>l(6+y(o)*2),paddingInline:o=>l(y(o)*3),border:"none",outline:"none",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`,outlineOffset:`-${l(.5)}`}}}}var A=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Se=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Wt=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),We=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Kt=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Ut=(e,t)=>Se(e,-((e.getDay()-t+7)%7));function wi(e){var t,n;try{let o=new Intl.Locale(e),i=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function Ei(e={}){var Gt,Xt,Jt,Zt;let{mode:t="single",time:n=!1,min:o,max:i,disabledDate:r,locale:a=typeof navigator!="undefined"?navigator.language:"en-US",format:c,onChange:u}=e,h=(Gt=e.weekStartsOn)!=null?Gt:wi(a),m=f((Xt=e.accentColor)!=null?Xt:"primary","accentColor"),d=f((Jt=e.placement)!=null?Jt:"bottom-start"),p=f((Zt=e.value)!=null?Zt:t==="range"?[null,null]:null),g=u?p.addListener(S=>u(S)):null,v=(()=>{let S=p.get(),k=t==="range"?S==null?void 0:S[0]:S;return k instanceof Date?k:new Date})(),x=f(v.getFullYear(),"viewYear"),C=f(v.getMonth(),"viewMonth"),w=f(A(v),"focused"),E=f(null,"hovered"),O=f(v.getHours(),"hour"),T=f(v.getMinutes(),"minute"),D=null,M=new Intl.DateTimeFormat(a,we({dateStyle:"medium"},n?{timeStyle:"short"}:{})),R=new Intl.DateTimeFormat(a,{month:"long",year:"numeric"}),ie=new Intl.DateTimeFormat(a,{weekday:"short"}),W=new Intl.DateTimeFormat(a,{dateStyle:"full"}),H=S=>S?M.format(S):"",Ue=S=>{if(c)return c(S);if(t==="range"){let[k,_]=S!=null?S:[null,null];return k?`${H(k)} \u2013 ${H(_)}`:""}return H(S)},ft=Array.from({length:7},(S,k)=>ie.format(new Date(2023,0,1+(k+h)%7))),xe=S=>!!o&&A(S)<A(o)||!!i&&A(S)>A(i)||!!r&&r(S),j=S=>{if(!n)return A(S);let k=A(S);return k.setHours(O.get(),T.get(),0,0),k},oe=S=>{var P;if(xe(S))return;if(t==="single"){p.set(j(S)),n||gt();return}let[k,_]=(P=p.get())!=null?P:[null,null];!k||k&&_?p.set([j(S),null]):A(S)<A(k)?(p.set([j(S),j(k)]),n||gt()):(p.set([k,j(S)]),n||gt())},ne=()=>{var S;if(n)if(t==="single"){let k=p.get();k&&p.set(j(k))}else{let[k,_]=(S=p.get())!=null?S:[null,null];p.set([k&&j(k),_&&j(_)])}},Le=(S,k)=>{var Ce;if(t!=="range")return!1;let[_,P]=(Ce=p.get(k))!=null?Ce:[null,null],z=P!=null?P:E.get(k);if(!_||!z)return!1;let L=A(_)<=A(z)?_:z,K=A(_)<=A(z)?z:_,N=A(S);return N>=A(L)&&N<=A(K)},ue=(S,k)=>{let _=p.get(k);if(t==="range"){let[P,z]=_!=null?_:[null,null];return We(S,P)||We(S,z)}return We(S,_)},V=S=>{x.set(S.getFullYear()),C.set(S.getMonth())},U=S=>{let k=Wt(new Date(x.get(),C.get(),1),S);V(k)},q=S=>x.set(x.get()+S),Re=()=>{setTimeout(()=>{var S;(S=D==null?void 0:D.querySelector(`[data-date="${Kt(w.get())}"]`))==null||S.focus()},0)},vn=En(),{show:Sn,hide:xn,anchorPartial:pt}=te({open:!1,placement:d,content:vn});function gt(){xn()}pt.onClick=()=>{};let Cn={type:"text",readonly:!0,value:S=>Ue(p.get(S)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:()=>{yt()},onFocus:()=>{yt()},onKeyDown:S=>{let k=S.key;(k==="ArrowDown"||k==="Enter")&&(S.preventDefault(),yt())},_onMount:S=>g&&S.addHook("Remove",()=>{g()})};function yt(){var k;let S=(k=wn())!=null?k:new Date;w.set(A(S)),V(S),Sn(),Re()}function wn(){var k;let S=p.get();return t==="range"?(k=S==null?void 0:S[0])!=null?k:null:S!=null?S:null}return $(pt,Cn),pt;function En(){let S=(L,K,N)=>({button:L,type:"button",ariaLabel:K,onClick:N,style:ki()}),k={div:[S("\xAB","Previous year",()=>q(-1)),S("\u2039","Previous month",()=>U(-1)),{div:L=>R.format(new Date(x.get(L),C.get(L),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:L=>b(L)}},S("\u203A","Next month",()=>U(1)),S("\xBB","Next year",()=>q(1))],style:{display:"flex",alignItems:"center",gap:l(1),marginBottom:l(2)}},_={div:ft.map((L,K)=>({div:L,style:{textAlign:"center",fontSize:N=>b(N,"decrease-1"),fontWeight:"600",color:N=>s(N,"shift-7"),paddingBlock:l(1)},_key:K})),role:"row",style:mn()},P={div:L=>kn(L),role:"grid",ariaLabel:"Calendar",onKeyDown:Pn,onMouseLeave:()=>t==="range"&&E.set(null),style:{display:"flex",flexDirection:"column",gap:l(.5)}},z=[k,_,P];return n&&z.push(_n()),z.push(On()),{div:z,role:"dialog",ariaModal:"false",_onMount:L=>{D=L.domElement},style:{minWidth:l(70),padding:l(3),borderRadius:l(2),backgroundColor:L=>s(L,"base"),color:L=>s(L,"shift-10"),border:L=>`1px solid ${s(L,"shift-4")}`,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"}}}function kn(S){let k=new Date(x.get(S),C.get(S),1),_=C.get(S),P=Ut(k,h),z=[];for(let L=0;L<6;L++){let K=[];for(let N=0;N<7;N++){let Ce=Se(P,L*7+N);K.push(Tn(Ce,_,S))}z.push({div:K,role:"row",style:mn(),_key:L})}return z}function Tn(S,k,_){let P=xe(S),z=ue(S,_),L=Le(S,_),K=S.getMonth()!==k,N=We(S,w.get(_)),Ce=We(S,new Date);return{button:String(S.getDate()),type:"button",role:"gridcell",tabIndex:N?0:-1,ariaSelected:z,ariaDisabled:P,disabled:P,ariaLabel:W.format(S),dataDate:Kt(S),onClick:()=>oe(S),onMouseEnter:()=>t==="range"&&E.set(S),style:{appearance:"none",border:"none",cursor:P?"not-allowed":"pointer",aspectRatio:"1",borderRadius:l(1),fontSize:I=>b(I),fontFamily:"inherit",opacity:P?.35:K?.5:1,backgroundColor:I=>z?s(I,"shift-7",m.get(I)):L?s(I,"shift-2",m.get(I)):"transparent",color:I=>z?s(I,"shift-0",m.get(I)):s(I,"shift-9"),outline:Ce?I=>`1px solid ${s(I,"shift-6",m.get(I))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:I=>z?s(I,"shift-7",m.get(I)):s(I,"shift-3",m.get(I))},"&:focus-visible":{outline:I=>`2px solid ${s(I,"shift-6",m.get(I))}`}},_key:Kt(S)}}function _n(){let S=(k,_,P)=>({select:Array.from({length:k},(z,L)=>({option:String(L).padStart(2,"0"),value:String(L),selected:K=>_.get(K)===L,_key:L})),ariaLabel:P,onChange:z=>{_.set(Number(z.target.value)),ne()},style:Ti()});return{div:[S(24,O,"Hour"),{span:":",style:{fontWeight:"600"}},S(60,T,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:l(1),marginTop:l(3)}}}function On(){let S=(k,_)=>({button:k,type:"button",onClick:_,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:P=>b(P,"decrease-1"),color:P=>s(P,"shift-8",m.get(P)),padding:l(1)}});return{div:[S("Today",()=>{let k=new Date;w.set(A(k)),V(k),Re()}),S("Clear",()=>{p.set(t==="range"?[null,null]:null),E.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:l(2),paddingTop:l(2),borderTop:k=>`1px solid ${s(k,"shift-3")}`}}}function Pn(S){let k=S,_=w.get(),P=null;switch(k.key){case"ArrowLeft":P=Se(_,-1);break;case"ArrowRight":P=Se(_,1);break;case"ArrowUp":P=Se(_,-7);break;case"ArrowDown":P=Se(_,7);break;case"Home":P=Ut(_,h);break;case"End":P=Se(Ut(_,h),6);break;case"PageUp":P=Wt(_,k.shiftKey?-12:-1);break;case"PageDown":P=Wt(_,k.shiftKey?12:1);break;case"Enter":case" ":k.preventDefault(),oe(_);return;default:return}k.preventDefault(),w.set(P),V(P),Re()}}function mn(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:l(.5)}}function ki(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>b(e),color:e=>s(e,"shift-8"),width:l(7),height:l(7),borderRadius:l(1),"&:hover":{backgroundColor:e=>s(e,"shift-3")}}}function Ti(){return{fontFamily:"inherit",fontSize:e=>b(e),padding:l(1),borderRadius:l(1),border:e=>`1px solid ${s(e,"shift-4")}`,backgroundColor:e=>s(e,"base"),color:e=>s(e,"shift-9")}}function _i(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${l(24)}, max-content) 1fr`,columnGap:l(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}}function Oi(e={}){var i,r;let{duration:t=240}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=f((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:a=>{a.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>b(a,"inherit"),color:a=>s(a,"shift-9",n.get(a)),backgroundColor:a=>s(a,"inherit",n.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>s(a,"shift-2",n.get(a)),color:a=>s(a,"shift-10",n.get(a)),fontSize:a=>b(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:l(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>l(y(a)*4),height:l(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:l(2),height:l(2),flexShrink:0,marginTop:`-${l(.5)}`,borderInlineEnd:a=>`${l(.5)} solid ${s(a,"shift-9",n.get(a))}`,borderBottom:a=>`${l(.5)} solid ${s(a,"shift-9",n.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>s(a,"shift-3",n.get(a))},"& > summary:focus-visible":{borderRadius:a=>l(y(a)*2),outlineOffset:`-${l(.5)}`,outline:a=>`${l(.5)} solid ${s(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>l(y(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:l(250),opacity:1,paddingTop:a=>l(y(a)*1),paddingBottom:a=>l(y(a)*3)}}}}var dn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function Pi(e={}){let{color:t="neutral",open:n=!1}=e,o=f(n),i=null,r=!1;return{_onInsert:a=>{a.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(a,c)=>{if(a.target!==c.domElement)return;let u=c.domElement.getBoundingClientRect();a.clientX>=u.left&&a.clientX<=u.right&&a.clientY>=u.top&&a.clientY<=u.bottom||o.set(!1)},onTransitionEnd:(a,c)=>{if(!r)return;r=!1,c.domElement.close(),document.body.style.overflow="",i==null||i.focus(),i=null},_onMount:a=>{let c=a.domElement;c.setAttribute("aria-modal","true");let u=p=>{if(p.key!=="Tab")return;let g=Array.from(c.querySelectorAll(dn)).filter(C=>!C.closest("[aria-hidden='true']")&&C.offsetParent!==null);if(!g.length){p.preventDefault();return}let v=g[0],x=g[g.length-1];p.shiftKey?(document.activeElement===v||document.activeElement===c)&&(p.preventDefault(),x.focus()):document.activeElement===x&&(p.preventDefault(),v.focus())},h=p=>{p.preventDefault(),o.set(!1)};c.addEventListener("cancel",h);let m=p=>{p?(i=document.activeElement,c.showModal(),document.body.style.overflow="hidden",c.addEventListener("keydown",u),requestAnimationFrame(()=>{c.style.opacity="1";let g=c.querySelector(dn);g==null||g.focus()})):(r=!0,c.style.opacity="0",c.removeEventListener("keydown",u),setTimeout(()=>{r&&(r=!1,c.close(),document.body.style.overflow="",i==null||i.focus(),i=null)},350))};m(o.get());let d=o.addListener(m);a.addHook("Remove",()=>{d(),c.removeEventListener("cancel",h),document.body.style.overflow="",c.removeEventListener("keydown",u),i==null||i.focus(),i=null})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:a=>b(a,"inherit"),color:a=>s(a,"shift-10",t),backgroundColor:a=>s(a,"inherit",t),border:"none",padding:a=>l(y(a)*3),boxShadow:a=>`0 ${l(9)} ${l(16)} ${s(a,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:a=>s(a,"shift-2","neutral"),opacity:.75}}}}function Di(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:l(2),fontSize:o=>b(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var qt={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},hn={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},Ke=e=>e==="left"||e==="right";function fn(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function $i(e={}){let{color:t="neutral",open:n=!1,placement:o="end",size:i}=e,r=f(n),a=o==="start"||o==="end",c=fn(o,!1),u=Ke(c)?l(80):l(64),h=i!=null?i:u;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,d)=>{m.target===d.domElement&&r.set(!1)},_onMount:m=>{let d=m.domElement;d.setAttribute("aria-modal","true");let p=T=>{T.preventDefault(),r.set(!1)};d.addEventListener("cancel",p);let g=a&&(d.ownerDocument.documentElement.dir==="rtl"||d.ownerDocument.dir==="rtl"),v=fn(o,g);a&&(d.style.transform=qt[v],d.style.margin=hn[v],d.style.width=Ke(v)?h:"100dvw",d.style.height=Ke(v)?"100dvh":h);let x=!1,C=()=>{x&&(x=!1,d.close(),document.body.style.overflow="")},w=T=>{T.target===d&&T.propertyName==="transform"&&C()};d.addEventListener("transitionend",w);let E=T=>{T?(x=!1,d.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{d.style.transform="translate(0, 0)"})):(x=!0,d.style.transform=qt[v],setTimeout(C,350))};E(r.get());let O=r.addListener(E);m.addHook("Remove",()=>{O(),d.removeEventListener("cancel",p),d.removeEventListener("transitionend",w),document.body.style.overflow=""})},style:{transform:qt[c],transition:"transform 0.25s ease",fontSize:m=>b(m,"inherit"),color:m=>s(m,"shift-10",t),backgroundColor:m=>s(m,"inherit",t),border:"none",padding:m=>l(y(m)*3),margin:hn[c],width:Ke(c)?h:"100dvw",height:Ke(c)?"100dvh":h,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${l(4)} ${l(12)} ${s(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>s(m,"shift-2","neutral"),opacity:.75}}}}function Li(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>b(o,"inherit"),fontStyle:"italic",color:o=>s(o,"shift-10",t.get(o))}}}function Ri(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:l(3),paddingBlock:l(12),paddingInline:l(6),textAlign:"center",color:o=>s(o,"shift-6",t.get(o)),"& > :first-child":{color:o=>s(o,"shift-5",t.get(o))}}}}function zi(e={}){return{_onError:(t,n,o)=>{var r,a;(r=e.onError)==null||r.call(e,n);let i=typeof e.fallback=="function"?e.fallback(n,o):(a=e.fallback)!=null?a:{div:"An error occurred."};t.children.update([i])}}}var Ii={small:8,medium:10,large:14};function Mi(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),n=l(Ii[(i=e.size)!=null?i:"medium"]);return{_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>b(r,"inherit"),backgroundColor:r=>s(r,"shift-9",t.get(r)),color:r=>s(r,"shift-0",t.get(r)),boxShadow:r=>`0 ${l(1)} ${l(4)} ${s(r,"shift-4","neutral")}`,transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>s(r,"shift-10",t.get(r)),boxShadow:r=>`0 ${l(2)} ${l(6)} ${s(r,"shift-5","neutral")}`},"&:focus-visible":{outline:r=>`2px solid ${s(r,"shift-6",t.get(r))}`,outlineOffset:"2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Ai(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:l(2),marginInline:0,marginTop:l(3),marginBottom:l(3),color:o=>s(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:l(2)},"& figcaption":{fontSize:o=>b(o,"decrease-1"),color:o=>s(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Vi(e={}){var i;let{layout:t="horizontal"}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>l(y(r)*3),paddingBlock:r=>l(y(r)*3),border:"none",borderRadius:r=>l(y(r)*2),fontSize:r=>b(r,"inherit"),backgroundColor:r=>s(r,"inherit",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:l(4),rowGap:l(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>b(r,"inherit"),fontWeight:600,paddingBlock:r=>l(y(r)*1),borderRadius:r=>l(y(r)*2),color:r=>s(r,"shift-9",n.get(r)),backgroundColor:r=>s(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?"0px":l(y(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${l(2)} * -1)`,fontSize:r=>b(r,"decrease-1"),color:r=>s(r,"shift-9",n.get(r))}}}}var Ni={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Bi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>s(o,"shift-11",t.get(o)),marginTop:0,marginBottom:l(2),fontSize:o=>{let i=Ni[o.elementNode.tagName]||"inherit";return b(o,i)}}}}function Hi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:l(3),marginBottom:l(3),backgroundColor:o=>s(o,"shift-4",t.get(o))}}}function ji(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:l(4),height:l(4),flexShrink:"0",fontSize:o=>b(o),backgroundColor:"transparent",color:o=>s(o,"shift-9",t.get(o))}}}function Fi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:l(2),backgroundColor:o=>s(o,"inherit",t.get(o))}}}function Wi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>b(r,"inherit"),display:"inline-flex",position:"relative",width:l(6),height:l(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:l(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:r=>s(r,"shift-2",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${s(r,"shift-6",n.get(r))}`,backgroundColor:r=>s(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>s(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${l(.5)} solid ${s(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${s(r,"shift-6",n.get(r))}`,backgroundColor:r=>s(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>s(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>s(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:l(1.5),outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>s(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Ki(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:r=>b(r,"inherit"),paddingBlock:r=>l(y(r)*1),paddingInline:r=>l(y(r)*1),blockSize:r=>l(6+y(r)*2),inlineSize:r=>l(6+y(r)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:r=>l(y(r)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>s(r,"shift-2","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`}}}}function Ui(e={}){var i,r;let{mode:t="datetime-local"}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=f((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onSchedule:(a,c)=>{a.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:a=>b(a,"inherit"),lineHeight:"inherit",color:a=>s(a,"shift-9",n.get(a)),backgroundColor:a=>s(a,"inherit",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${s(a,"shift-4",n.get(a))}`,borderRadius:a=>l(y(a)*1),paddingInline:a=>l(y(a)*3),height:a=>l(6+y(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${l(.5)} solid ${s(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>s(a,"shift-8","neutral"),backgroundColor:a=>s(a,"shift-2","neutral"),outline:a=>`1px solid ${s(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${l(.5)} solid ${s(a,"shift-6","error")}`}}}}function qi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:r=>b(r,"inherit"),lineHeight:"inherit",color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,borderRadius:r=>l(y(r)*1),height:r=>l(6+y(r)*2),paddingInline:r=>l(y(r)*1),"&::-webkit-file-upload-button":{marginTop:r=>l(y(r)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:r=>s(r,"shift-11",t.get(r)),backgroundColor:r=>s(r,"shift-1",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`,backgroundColor:r=>s(r,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>s(r,"shift-8","neutral"),backgroundColor:r=>s(r,"shift-3","neutral")}}}}function Yi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(10),paddingInlineStart:r=>l(y(r)*3),paddingInlineEnd:r=>l(y(r)*1.5),paddingBlock:r=>l(y(r)*1),borderRadius:r=>l(y(r)*1),fontSize:r=>b(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>s(r,"shift-2","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`,color:r=>s(r,"shift-8","neutral")}}}}function Gi(){return{style:{display:"flex",alignItems:"center",gap:l(2),"& > *":{minWidth:`${l(9)}!important`}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=n(),u=a.target,h=c.indexOf(u);u.value&&h<c.length-1&&c[h+1].focus()},i=a=>{let c=n(),u=a.target,h=c.indexOf(u);a.key==="Backspace"&&!u.value&&h>0&&c[h-1].focus(),a.key==="ArrowLeft"&&h>0&&c[h-1].focus(),a.key==="ArrowRight"&&h<c.length-1&&c[h+1].focus()},r=a=>{var p,g,v;a.preventDefault();let c=(g=(p=a.clipboardData)==null?void 0:p.getData("text"))!=null?g:"",u=n(),h=u.indexOf(a.target),m=h===-1?0:h;[...c].forEach((x,C)=>{u[m+C]&&(u[m+C].value=x)});let d=Math.min(m+c.length-1,u.length-1);(v=u[d])==null||v.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",r)})}}}function Xi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:r=>{if(r.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:r=>b(r,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:l(6),height:l(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:r=>s(r,"shift-2",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${s(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>s(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>s(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>s(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Ji(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:l(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:l(1.5),borderRadius:l(999),backgroundColor:r=>s(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:l(4),height:l(4),borderRadius:l(999),border:"none",marginTop:`calc((${l(1.5)} - ${l(4)}) / 2)`,backgroundColor:r=>s(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>s(r,"shift-10",n.get(r))},"&:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`,outlineOffset:l(1),borderRadius:l(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Zi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:r=>b(r,"inherit"),lineHeight:"inherit",color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,borderRadius:r=>l(y(r)*1),minWidth:l(32),paddingInline:r=>l(y(r)*3),paddingBlock:r=>l(y(r)*1),"&::placeholder":{color:r=>s(r,"shift-7",t.get(r))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral"),backgroundColor:r=>s(r,"shift-2","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`}}}}function Qi(e={}){var n;let t=f((n=e.accentColor)!=null?n:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>b(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:l(9),height:l(6),cursor:"pointer",margin:"0",paddingBlock:l(1),"&:checked":{"&::before":{backgroundColor:o=>s(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${l(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:l(3),height:l(3),borderRadius:l(999),left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>s(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:l(999),display:"inline-block",fontSize:o=>b(o,"inherit"),lineHeight:1,backgroundColor:o=>s(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ea(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(10),paddingInline:r=>l(y(r)*3),paddingBlock:r=>l(y(r)*1),borderRadius:r=>l(y(r)*1),fontSize:r=>b(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),"&::placeholder":{color:r=>s(r,"shift-7")},"&:not(:placeholder-shown)":{color:r=>s(r,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>s(r,"shift-2","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`,color:r=>s(r,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:r=>`${l(.5)} solid ${s(r,"shift-6","error")}`},"&[data-status=error]":{outline:r=>`${l(.5)} solid ${s(r,"shift-6","error")}`},"&[data-status=warning]":{outline:r=>`${l(.5)} solid ${s(r,"shift-6","warning")}`}}}}function ta(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),paddingBlock:l(.5),paddingInline:l(1.5),borderRadius:l(1),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`}}}function oa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:l(2),fontSize:r=>b(r,"inherit"),color:r=>s(r,"shift-9",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>s(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral")}}}}function na(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),n=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:r=>b(r,"inherit"),backgroundColor:r=>s(r),color:r=>s(r,"shift-9",t.get(r)),textDecoration:"none","&:visited":{color:r=>s(r,"shift-9",n.get(r))},"&:hover:not([disabled])":{color:r=>s(r,"shift-10",t.get(r)),textDecoration:"underline"},"&:focus-visible":{borderRadius:l(1),outlineOffset:l(1),outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral")}}}}function ra(e={}){let{color:t="neutral"}=e;return{_context:{list:{color:t}},style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function ia(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>l(y(n)*2),paddingBlock:n=>l(t?1:y(n)*2),paddingInline:n=>l(y(n)*3),fontSize:n=>b(n,"inherit")}}}function aa(e={}){var i,r;let t=f((i=e.color)!=null?i:"neutral","color"),n=(r=e.accentColor)!=null?r:"primary",{dense:o=!1}=e;return{cursor:"pointer",style:{appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:a=>l(y(a)*2),paddingBlock:a=>l(o?1:y(a)*2),paddingInline:a=>l(y(a)*3),fontSize:a=>b(a,"inherit"),color:a=>s(a,"shift-9",t.get(a)),borderRadius:a=>l(y(a)*1),transition:"background-color 150ms ease","&:hover:not([disabled])":{backgroundColor:a=>s(a,"shift-2",t.get(a))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:a=>s(a,"shift-3",n),color:a=>s(a,"shift-12",n)},"&:focus-visible":{outline:a=>`2px solid ${s(a,"shift-6",n)}`,outlineOffset:"-2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function la(e={}){var n;let t=f((n=e.accentColor)!=null?n:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:l(6),borderRadius:l(1),paddingInline:l(1.5)}}}function sa(e={}){let{color:t="neutral",selectable:n=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,r)=>{var c;let a={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:n}}};$(r,a)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>l(y(i)*2),paddingInline:i=>l(y(i)*2),fontSize:i=>b(i,"inherit"),backgroundColor:i=>s(i,"inherit",t)}}}function ca(e={}){let{accentColor:t="primary",color:n="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var u,h;i.tagName!=="button"&&console.warn('"menuItem" patch must use button tag');let r=i.getContext("menu");if(!r){console.warn('"menuItem" patch must be used inside a "menu"');return}let a=(h=(u=i.parent)==null?void 0:u.children.items)!=null?h:[];a=a.filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:a.indexOf(i);r.selectable&&(i.attributes.set("ariaCurrent",m=>r.activeKey.get(m)===c||void 0),i.addEvent("click",()=>r.activeKey.set(c)))},onKeyDown:(i,r)=>{var m,d,p,g;let a=i.key;if(a==="Enter"||a===" "){i.preventDefault(),(m=r.domElement)==null||m.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((p=(d=r.parent)==null?void 0:d.children.items)!=null?p:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem");if(!c.length)return;let u=c.indexOf(r),h=u;a==="ArrowDown"?h=(u+1)%c.length:a==="ArrowUp"?h=(u-1+c.length)%c.length:a==="Home"?h=0:a==="End"&&(h=c.length-1),(g=c[h].domElement)==null||g.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>l(2),width:"100%",fontSize:i=>b(i,"inherit"),height:i=>l(6+y(i)*2),paddingInline:i=>l(y(i)*3),border:"none",outline:"none",color:i=>s(i,"shift-9",n),backgroundColor:i=>s(i,"inherit",n),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>s(i,"shift-2",n)},"&[aria-current=true]":{backgroundColor:i=>s(i,"shift-3",t),color:i=>s(i,"shift-10")},"&:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-6",t)}`,outlineOffset:`-${l(.5)}`}}}}var pn=e=>!!e&&typeof e.get=="function"&&e._isState===!0,$e=e=>{let t={},n=[];for(let o in e){let i=e[o];o==="x"?n.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?n.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?n.push(`scale(${i})`):o==="rotate"?n.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return n.length&&(t.transform=n.join(" ")),t};function ua(e={}){var a,c,u,h;let{initial:t,animate:n,exit:o,transition:i={}}=e,r={duration:(a=i.duration)!=null?a:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(h=i.iterations)!=null?h:1,fill:"both"};return{_onMount:m=>{let d=m.domElement;if(!d||typeof d.animate!="function")return;let p=pn(n)?n.get():n;if(p?d.animate(t?[$e(t),$e(p)]:[$e(p)],r):t&&Object.assign(d.style,$e(t)),pn(n)){let g=n.addListener(v=>{d.animate([$e(v)],r)});m.setMetadata("motionRelease",g)}},_onBeforeRemove:(m,d)=>{let p=m.domElement;if(!p||!o||typeof p.animate!="function")return d();p.animate([$e(o)],r).finished.then(d,d)},_onRemove:m=>{let d=m.getMetadata("motionRelease");d==null||d()}}}function ma(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>b(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"decimal",listStylePosition:"outside"}}}function da(e,t){if(t<=7)return Array.from({length:t},(r,a)=>a+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let r=o;r<=i;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function ha(e){var c;let{total:t,color:n="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),r={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>l(6+y(u)*2),height:u=>l(6+y(u)*2),paddingInline:u=>l(y(u)*2),borderRadius:u=>l(y(u)*1),border:"none",cursor:"pointer",fontSize:u=>b(u,"inherit"),backgroundColor:"transparent",color:u=>s(u,"shift-9",n),"&:hover:not([disabled])":{backgroundColor:u=>s(u,"shift-2",n)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=oo(we({},r),{backgroundColor:u=>s(u,"shift-6",o),color:u=>s(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>s(u,"shift-6",o)}});return{role:"navigation",ariaLabel:"Pagination",_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let h={div:m=>{let d=i.get(m),p=[];p.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:r});for(let g of da(d,t))if(g==="...")p.push({span:"\u2026",ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>l(y(v)*2),color:v=>s(v,"shift-7",n)}});else{let v=g===d;p.push({button:String(g),type:"button",ariaLabel:`Page ${g}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(g),style:v?a:r})}return p.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:r}),p},style:{display:"flex",alignItems:"center",gap:l(1)}};u.children.insert(h)},style:{display:"inline-flex"}}}function fa(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function pa(e){var p;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,i=null,r=f(t),a=f(n),{show:c,hide:u,anchorPartial:h}=te({open:r,placement:a,content:e.content}),m={role:"dialog",dataTone:"shift-11",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),_onInsert:g=>{let v=g.attributes.get("id");i=v||g.nodeId,!v&&g.attributes.set("id",i)}};return(p=e.content).$||(p.$=[]),e.content.$.push(m),$(h,{ariaHaspopup:"dialog",ariaExpanded:g=>r.get(g),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),onClick:()=>{o==="click"&&(r.get()?u():c())},onKeyDown:g=>{g.key==="Escape"&&r.get()&&u()},onFocus:()=>o==="hover"&&c(),onBlur:(g,v)=>{let x=g.relatedTarget,C=v.getRoot().domElement,w=i?C.querySelector(`#${CSS.escape(i)}`):null;x&&(w!=null&&w.contains(x))||u()},_onMount:g=>i&&g.attributes.set("ariaControls",i)}),h}function Yt(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=l(6),bordered:i=!0}=e,r=f(t),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=m=>{var d;return(d=a[r.get(m)])!=null?d:a["bottom-end"]},u=m=>m.includes("start")?o:m.includes("end")?"auto":"50%",h=m=>m.includes("end")?o:m.includes("start")?"auto":"50%";return{style:{fontSize:m=>b(m),backgroundColor:m=>s(m),color:m=>s(m,"shift-9",n),position:"relative","&::after":{content:'""',position:"absolute",width:l(1.5),height:l(1.5),backgroundColor:m=>s(m,"inherit",n),borderWidth:i?"1px":"0px",borderColor:m=>s(m,"inherit",n),borderTopStyle:m=>{let d=c(m);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:m=>{let d=c(m);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:m=>{let d=c(m);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:m=>{let d=c(m);return d.includes("right")?0:d.includes("left")?"auto":h(d)},bottom:m=>{let d=c(m);return d.includes("bottom")?0:d.includes("top")?"auto":h(d)},left:m=>{let d=c(m);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:m=>{let d=c(m),p=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",g=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${p},${g}) rotate(45deg)`}}}}}function ga(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>l(y(o)*2),paddingInline:o=>l(y(o)*3),borderRadius:o=>l(y(o)*2)}}}function ya(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:l(2),border:0,borderRadius:l(999),overflow:"hidden",backgroundColor:r=>s(r,"shift-3",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>s(r,"shift-3",t.get(r)),borderRadius:l(999)},"&::-webkit-progress-value":{backgroundColor:r=>s(r,"shift-9",n.get(r)),borderRadius:l(999),transition:"width 220ms ease"}}}}var ba='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',va='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function Sa(e={}){var a,c;let{max:t=5,readOnly:n=!1,onChange:o}=e,i=(a=e.color)!=null?a:"warning",r=f((c=e.value)!=null?c:0);return{role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:l(.5),fontSize:"1.5rem",cursor:n?"default":"pointer",color:u=>s(u,"shift-8",i)},_onMount:u=>{let h=u.domElement,m=r.get(),d=0,p=()=>{let v=d>0?d:m;Array.from(h.children).forEach((x,C)=>{x.innerHTML=C<v?ba:va})};h.innerHTML="";for(let v=1;v<=t;v++){let x=document.createElement("button");if(x.type="button",x.setAttribute("aria-label",`${v} star${v>1?"s":""}`),x.style.cssText="background:none;border:none;padding:0;cursor:inherit;color:inherit;font-size:inherit;display:flex;align-items:center;",!n){let C=v;x.addEventListener("click",()=>{let w=C===m?0:C;m=w,r.set(w),o==null||o(w),d=0,p()}),x.addEventListener("mouseenter",()=>{d=C,p()}),x.addEventListener("mouseleave",()=>{d=0,p()}),x.addEventListener("keydown",w=>{var T;let E=m;if(w.key==="ArrowRight"||w.key==="ArrowUp")E=Math.min(t,m+1),w.preventDefault();else if(w.key==="ArrowLeft"||w.key==="ArrowDown")E=Math.max(0,m-1),w.preventDefault();else return;m=E,r.set(E),o==null||o(E),p();let O=E>0?E-1:0;(T=h.children[O])==null||T.focus()})}h.appendChild(x)}p();let g=r.addListener(v=>{m=v,d===0&&p()});u.addHook("Remove",g)}}}function xa(e={}){var n;let{color:t="neutral"}=e;return{role:"radiogroup",_context:{segmented:{value:f((n=e.value)!=null?n:"")}},style:{display:"inline-flex",paddingBlock:l(1),paddingInline:l(1),gap:l(.5),borderRadius:l(10),backgroundColor:o=>s(o,"shift-2",t)}}}function Ca(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"radio",_onInsert:r=>{var m,d;r.tagName!=="button"&&console.warn('"segmentedItem" patch must use button tag');let a=r.getContext("segmented");if(!a){console.warn('"segmentedItem" patch must be used inside a "segmented"');return}let u=((d=(m=r.parent)==null?void 0:m.children.items)!=null?d:[]).filter(p=>p.type==="ElementNode"&&p.attributes.get("role")==="radio"),h=r.key!==null&&r.key!==void 0?String(r.key):String(u.indexOf(r));r.attributes.set("ariaChecked",p=>a.value.get(p)===h),r.addEvent("click",()=>a.value.set(h))},style:{cursor:"pointer",fontSize:r=>b(r,"inherit"),height:l(6),paddingBlock:l(1),paddingInline:l(3),border:"none",borderRadius:l(10),color:r=>s(r,"shift-9",t.get(r)),backgroundColor:"transparent",transition:"background-color 300ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:r=>s(r,"shift-3",t.get(r))},"&[aria-checked=true]":{backgroundColor:r=>s(r,"shift-0",n.get(r)),color:r=>s(r,"shift-10",n.get(r))},"&:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`,outlineOffset:`-${l(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function wa(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>b(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",t)}`,borderRadius:o=>l(y(o)*1),paddingBlock:o=>l(y(o)*1),paddingLeft:o=>l(y(o)*3),paddingRight:o=>l(y(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Mt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${l(2)} center`,backgroundSize:`${l(2.5)} ${l(1.5)}`,"&:not([multiple])":{height:o=>l(6+y(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"& optgroup":{color:o=>s(o,"shift-11",t)},"& option[disabled]":{color:o=>s(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")}}}}function Ea(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,a=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(n),content:e.content}),d={onClick:()=>!r&&h()};$(e.content,d);let p={div:v=>{let x=a.get(v),C=Array.isArray(x)?x:[x];return t.filter(E=>C.includes(E.value)).map(E=>({span:E.label,$:[Fe({color:o,removable:r})],_key:E.value,_onRemove:O=>{let T=a.get(),M=(Array.isArray(T)?T:[T]).filter(R=>R!==E.value);r?a.set(M):a.set(M[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:l(1),flex:1}},g={_onInsert:v=>{v.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(p),onClick:()=>c.get()?h():u(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>l(6+y(v)*2),minWidth:l(32),outlineOffset:"-1px",outline:v=>`1px solid ${s(v,"shift-4","neutral")}`,paddingInline:v=>l(y(v)*2),borderRadius:v=>l(y(v)*1),fontSize:v=>b(v,"inherit"),color:v=>s(v,"shift-9",o),backgroundColor:v=>s(v,"inherit",o)}};return $(m,g),m}function ka(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag');let a=r.getContext("select");if(a){let c=a.value;r.attributes.set("ariaSelected",u=>{let h=c.get(u);return a.multiple?h.includes(o):h===o}),r.addEvent("click",()=>{let u=c.get();a.multiple?u.includes(o)?c.set(u.filter(h=>h!==o)):c.set(u.concat([o])):u!==o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>b(r,"inherit"),height:r=>l(6+y(r)*2),paddingInline:r=>l(y(r)*3),border:"none",outline:"none",color:r=>s(r,"shift-9",n),backgroundColor:r=>s(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>s(r,"shift-2",n)},"&[aria-selected=true]":{backgroundColor:r=>s(r,"shift-6",t),color:r=>s(r,"shift-11")},"&:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",t)}`,outlineOffset:`-${l(.5)}`}}}}function Ta(e={}){var a;let{color:t="neutral",multiple:n=!1}=e,o=f((a=e.value)!=null?a:n?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(m=>({input:null,name:e.name,value:m||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:n}},_onInit:c=>{c.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>l(y(c)*2),paddingInline:c=>l(y(c)*2),fontSize:c=>b(c,"inherit"),backgroundColor:c=>s(c,"inherit",t)}}}function _a(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=Te(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:r=>b(r),color:r=>s(r,"shift-9",t.get(r)),height:l(6),display:"block",borderRadius:l(1),backgroundColor:r=>s(r,"inherit",t.get(r)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function Oa(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!=="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}var yn={to:{transform:"rotate(360deg)"}},gn=Te(JSON.stringify(yn));function Pa(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>b(o),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:l(6),height:l(6),borderRadius:"50%",border:o=>`${l(.5)} solid ${s(o,"shift-4",t.get(o))}`,borderTopColor:o=>s(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${gn} 0.7s linear infinite`,[`@keyframes ${gn}`]:yn}}}function Da(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:i=90}=e;return{_onSchedule:(r,a)=>{$(a,{_context:{splitter:{direction:t,size:f(n),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function $a(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal"?"width":"height";n.style[o]=`${t.size.get()}%`,n.style.flexShrink="0",n.style.overflow="auto";let i=t.size.addListener(r=>{n.style[o]=`${r}%`});e.addHook("Remove",i)}}}function La(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize",n.setAttribute("aria-orientation",o?"vertical":"horizontal"),n.setAttribute("aria-valuemin",String(t.min)),n.setAttribute("aria-valuemax",String(t.max)),n.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let i=t.size.addListener(u=>{n.setAttribute("aria-valuenow",String(Math.round(u)))}),r=u=>{let h=u.shiftKey?10:1,m=null;o?u.key==="ArrowRight"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowLeft"&&(m=Math.max(t.size.get()-h,t.min)):u.key==="ArrowDown"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowUp"&&(m=Math.max(t.size.get()-h,t.min)),u.key==="Home"?m=t.min:u.key==="End"&&(m=t.max),m!==null&&(u.preventDefault(),t.size.set(m))},a=null,c=u=>{u.preventDefault();let h=n.parentElement,m=p=>{let g=h.getBoundingClientRect(),v=o?(p.clientX-g.left)/g.width*100:(p.clientY-g.top)/g.height*100;t.size.set(Math.min(Math.max(v,t.min),t.max))},d=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null};a=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null},document.addEventListener("mousemove",m),document.addEventListener("mouseup",d)};n.addEventListener("keydown",r),n.addEventListener("mousedown",c),e.addHook("Remove",()=>{a==null||a(),i(),n.removeEventListener("keydown",r),n.removeEventListener("mousedown",c)})},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>s(e,"shift-2"),"&:hover":{backgroundColor:e=>s(e,"shift-3")},"&:focus-visible":{outline:e=>`2px solid ${s(e,"shift-6")}`,outlineOffset:"2px"},"&::after":{content:'""',borderRadius:l(999),backgroundColor:e=>s(e,"shift-4")}}}}function Ra(){let e="neutral",t="primary";return{_onInsert:n=>{var c,u;let o=n.getContext("steps");if(!o){console.warn('"stepItem" patch must be used inside a "steps"');return}e=o.color,t=o.accentColor;let a=((u=(c=n.parent)==null?void 0:c.children.items)!=null?u:[]).filter(h=>h.type==="ElementNode").indexOf(n);n.domElement&&(n.domElement.dataset.step=String(a+1)),n.attributes.set("dataStatus",h=>{let m=o.current.get(h);return a<m?"done":a===m?"active":"pending"}),n.attributes.set("ariaCurrent",h=>o.current.get(h)===a?"step":void 0)},style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:l(1),flex:"1",fontSize:n=>b(n,"decrease-1"),textAlign:"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:l(6),height:l(6),borderRadius:l(999),fontSize:n=>b(n,"decrease-1"),fontWeight:"600",flexShrink:"0",border:n=>`2px solid ${s(n,"shift-4",e)}`,backgroundColor:n=>s(n,"inherit"),color:n=>s(n,"shift-8"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"},"&:not(:first-child)::after":{content:'""',position:"absolute",top:l(3),right:`calc(50% + ${l(3)})`,left:`calc(-50% + ${l(3)})`,height:"2px",backgroundColor:n=>s(n,"shift-3",e),zIndex:"0"},"&[data-status=active]::before":{backgroundColor:n=>s(n,"shift-6",t),borderColor:n=>s(n,"shift-6",t),color:n=>s(n,"shift-15",t)},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:n=>s(n,"shift-3",e),borderColor:n=>s(n,"shift-3",e),color:n=>s(n,"shift-9",e)},"&[data-status=done]:not(:first-child)::after":{backgroundColor:n=>s(n,"shift-3",e)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:n=>s(n,"shift-6",t)},"&[data-status=pending]":{color:n=>s(n,"shift-7")},"&[data-status=active]":{color:n=>s(n,"shift-10"),fontWeight:"600"},"&[data-status=done]":{color:n=>s(n,"shift-8")}}}}function za(e={}){var r,a,c;let t=(r=e.direction)!=null?r:"horizontal",n=(a=e.color)!=null?a:"neutral",o=(c=e.accentColor)!=null?c:"primary";return{_onSchedule:(u,h)=>{var d;let m={_context:{steps:{current:f((d=e.current)!=null?d:0),direction:t,color:n,accentColor:o}}};$(h,m)},style:{display:"flex",flexDirection:t==="vertical"?"column":"row",alignItems:t==="vertical"?"flex-start":"center",gap:l(2),listStyle:"none",margin:"0",padding:"0"}}}function Ia(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>b(o,"inherit"),fontWeight:700,color:o=>s(o,"shift-11",t.get(o)),backgroundColor:o=>s(o)}}}function Ma(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>b(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function Aa(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>b(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function Va(e={}){let{accentColor:t="primary",color:n="neutral"}=e;return{role:"tab",_onInsert:i=>{var h,m;i.tagName!=="button"&&console.warn('"tab" patch must use button tag');let r=i.getContext("tabs");if(!r){console.warn('"tab" patch must be used inside a "tabs"');return}let a=(m=(h=i.parent)==null?void 0:h.children.items)!=null?m:[];a=a.filter(d=>d.type==="ElementNode"&&d.attributes.get("role")==="tab");let c=i.key!==null&&i.key!==void 0?i.key:a.indexOf(i),u={id:`tab${i.parent.nodeId}${c}`,ariaControls:`tabpanel${i.parent.nodeId}${c}`,ariaSelected:d=>r.activeKey.get(d)===c,onClick:()=>r.activeKey.set(c),onKeyDown:d=>{var w,E,O,T;let p=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(p))return;d.preventDefault();let g=((E=(w=i.parent)==null?void 0:w.children.items)!=null?E:[]).filter(D=>D.type==="ElementNode"&&D.attributes.get("role")==="tab");if(!g.length)return;let v=g.indexOf(i),x=v;p==="ArrowRight"?x=(v+1)%g.length:p==="ArrowLeft"?x=(v-1+g.length)%g.length:p==="Home"?x=0:p==="End"&&(x=g.length-1);let C=g[x];r.activeKey.set((O=C.key)!=null?O:x),(T=C.domElement)==null||T.focus()}};i.merge(u)},style:{cursor:"pointer",fontSize:i=>b(i,"inherit"),height:i=>l(6+y(i)*2),paddingInline:i=>l(y(i)*4),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-1",n)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-2",n)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",t)}`}}}}function Na(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>b(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>l(y(o)*3),paddingBlock:o=>l(y(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>l(y(o)*3),paddingBlock:o=>l(y(o)*1),color:o=>s(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${s(o,"shift-3",t.get(o))}`,fontSize:o=>b(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>l(y(o)*3),paddingBlock:o=>l(y(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${s(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>s(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>`${s(o,"shift-2")}!important`}}}}function Ba(){return{role:"tabpanel",style:{paddingBlock:t=>l(y(t)*2),paddingInline:t=>l(y(t)*2)},_onInsert:t=>{var a,c;let n=t.getContext("tabs");if(!n){console.warn('"tabPanel" patch must be used inside a "tabs"');return}let o=(c=(a=t.parent)==null?void 0:a.children.items)!=null?c:[];o=o.filter(u=>u.type==="ElementNode"&&u.attributes.get("role")==="tabpanel");let i=t.key!==null&&t.key!==void 0?t.key:o.indexOf(t),r={id:`tabpanel${t.parent.nodeId}${i}`,ariaLabelledby:`tab${t.parent.nodeId}${i}`,hidden:u=>n.activeKey.get(u)!==i};t.merge(r)}}}function Ha(e={}){return{role:"tablist",ariaOrientation:"horizontal",_onSchedule:(n,o)=>{var r;let i={_context:{tabs:{activeKey:f((r=e.activeKey)!=null?r:0)}}};$(o,i)}}}function ja(e={}){var i,r;let t=f((i=e.color)!=null?i:"neutral","color"),n=f((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:a=>{a.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:a=>{if(o){let c=a.domElement;c.style.overflow="hidden";let u=()=>{c.style.height="auto",c.style.height=`${c.scrollHeight}px`};c.addEventListener("input",u),u(),a.addHook("Remove",()=>c.removeEventListener("input",u))}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>l(y(a)*2),paddingBlock:a=>l(y(a)*1.5),border:"none",borderRadius:a=>l(y(a)*1.5),fontSize:a=>b(a,"inherit"),color:a=>s(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${s(a,"shift-4",t.get(a))}`,backgroundColor:a=>s(a,"inherit",t.get(a)),"&::placeholder":{color:a=>s(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${l(.5)} solid ${s(a,"shift-5",n.get(a))}`},"&:focus-visible":{outline:a=>`${l(.5)} solid ${s(a,"shift-6",n.get(a))}`},"&:invalid":{outline:a=>`${l(.5)} solid ${s(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>s(a,"shift-8","neutral"),outline:a=>`1px solid ${s(a,"shift-4","neutral")}`,backgroundColor:a=>s(a,"shift-2","neutral")}}}}function Fa(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Wa(e={}){var r,a,c;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(a=e.accentColor)!=null?a:"primary",i=f((c=e.active)!=null?c:!1);return{style:we({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>l(y(u)*2),paddingBottom:u=>t?"0":l(y(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:"0.25em",transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>s(u,"shift-8",i.get(u)?o:n),opacity:u=>i.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>`-${l(y(u)*4)}`,width:"2px",backgroundColor:u=>s(u,"shift-3",n)}})}}function Ka(e={}){let{position:t="top-center",color:n="neutral"}=e,o=f(!1),i=t.startsWith("top"),r=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:r?"center":a?"end":"start",inset:0,gap:l(4),zIndex:30,padding:l(6),pointerEvents:"none"}};return{_portal:u=>{let h=u.domElement.querySelector(`#domphy-toast-${t}`);return h||(h=u.children.insert(c).domElement),h},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:l(32),pointerEvents:"auto",paddingBlock:u=>l(y(u)*2),paddingInline:u=>l(y(u)*4),borderRadius:u=>l(y(u)*2),fontSize:u=>b(u,"inherit"),color:u=>s(u,"shift-9",n),backgroundColor:u=>s(u,"inherit",n),boxShadow:u=>`0 ${l(2)} ${l(9)} ${s(u,"shift-4","neutral")}`,opacity:u=>Number(o.get(u)),transform:u=>o.get(u)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(u,h)=>{let m=!1,d=()=>{m||(m=!0,u.domElement.removeEventListener("transitionend",p),h())},p=g=>{g.propertyName==="transform"&&d()};u.domElement.addEventListener("transitionend",p),setTimeout(d,350),o.set(!1)}}}function Ua(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:r=>{var m,d;r.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=r.getContext("toggleGroup");if(!a){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let u=((d=(m=r.parent)==null?void 0:m.children.items)!=null?d:[]).filter(p=>p.type==="ElementNode"&&p.attributes.get("role")==="button"),h=r.key!==null&&r.key!==void 0?String(r.key):String(u.indexOf(r));r.attributes.set("ariaPressed",p=>{let g=a.value.get(p);return Array.isArray(g)?g.includes(h):g===h}),r.addEvent("click",()=>{let p=a.value.get();if(a.multiple){let g=Array.isArray(p)?[...p]:[];a.value.set(g.includes(h)?g.filter(v=>v!==h):[...g,h])}else a.value.set(p===h?"":h)})},style:{cursor:"pointer",fontSize:r=>b(r,"inherit"),height:l(6),paddingBlock:l(1),paddingInline:l(2),border:"none",borderRadius:l(1),color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:r=>s(r,"shift-2",t.get(r))},"&[aria-pressed=true]":{backgroundColor:r=>s(r,"shift-3",n.get(r)),color:r=>s(r,"shift-12",n.get(r))},"&:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",n.get(r))}`,outlineOffset:`-${l(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function qa(e={}){var o;let{multiple:t=!1,color:n="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:l(1),paddingInline:l(1),gap:l(1),borderRadius:l(2),fontSize:i=>b(i,"inherit"),backgroundColor:i=>s(i,"inherit",n),outline:i=>`1px solid ${s(i,"shift-3",n)}`,outlineOffset:"-1px"}}}function Ya(e={}){var n;let t=(n=e.gap)!=null?n:4;return{style:{display:"flex",alignItems:"center",gap:o=>l(y(o)*t)}}}function Ga(){return{div:null,style:{flex:"1 1 0"}}}function Xa(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content"}=e,i=f(n),r=f(o),a=`domphy-tt-${Math.random().toString(36).slice(2,9)}`,c={span:g=>r.get(g),id:a},{show:u,hide:h,anchorPartial:m}=te({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:g=>l(y(g)*1),paddingInline:g=>l(y(g)*3),borderRadius:g=>l(y(g)*1),color:g=>s(g,"shift-9"),backgroundColor:g=>s(g),fontSize:g=>b(g,"inherit")},$:[Yt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),$(m,{ariaDescribedby:a,onMouseEnter:()=>u(),onMouseLeave:()=>h(),onFocus:()=>u(),onBlur:()=>h(),onKeyDown:g=>g.key==="Escape"&&h()}),m}function bn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Ja(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,i=new Map;return{_onBeforeUpdate:r=>{o=new Map,r.children.items.forEach((a,c)=>{if(!(a instanceof B))return;let u=a.domElement;u&&o.set(bn(a,c),u.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((a,c)=>{var w;if(!(a instanceof B))return;let u=a.domElement;if(!u)return;let h=bn(a,c),m=o.get(h);if(!m)return;let d=u.getBoundingClientRect(),p=m.left-d.left,g=m.top-d.top;if(Math.abs(p)<.5&&Math.abs(g)<.5)return;(w=i.get(u))==null||w(),u.style.transition="none",u.style.transform=`translate(${p}px, ${g}px)`,u.getBoundingClientRect(),requestAnimationFrame(()=>{u.style.transition=`transform ${t}ms ease ${n}ms`,u.style.transform="translate(0px, 0px)"});let v=!1,x=()=>{v||(v=!0,i.delete(u),u.removeEventListener("transitionend",C),u.style.transition="",u.style.transform="")},C=E=>{E.propertyName==="transform"&&x()};i.set(u,()=>{v=!0,i.delete(u),u.removeEventListener("transitionend",C)}),u.addEventListener("transitionend",C),setTimeout(x,t+n+34)}),o.clear()}}}function Za(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>b(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"disc",listStylePosition:"outside"}}}return Mn(Qa);})();
4
+ ${i}}`}function Z(e){if(!Oe[e])throw Error(`Theme "${e}" not found`);return Oe[e]}function hr(e,t){mr(t),Oe[e]||(Oe[e]=At(Be)),Ro(Oe[e],t),Qe=null,Lt.clear()}function fr(e){let t=At(e);t.direction="lighten";for(let n in t.colors)t.colors[n].reverse(),t.baseTones[n]=t.colors[n].length-1-t.baseTones[n];return t}function Lo(e){let t=Lt.get(e);if(t)return t;let n=Z(e),o=Vt(n),i={};for(let r in n){let l=n[r];if(r==="colors")for(let c in n.colors){let u={};[...Array(o).keys()].forEach(h=>u[h]=n.colors[c][h]),i[c]=u}else if(r==="fontSizes")i.fontSizes=n.fontSizes;else if(r==="densities")i.densities=n.densities;else if(r==="custom"&&(i.custom={},l&&typeof l=="object"))for(let c in l)i.custom[c]=l[c]}return Lt.set(e,i),i}function Ve(){if(Qe)return Qe;let e=Z("light"),t=Vt(e),n={};for(let o in e){let i=e[o];if(o==="colors")for(let r in e.colors){let l={};[...Array(t).keys()].forEach(c=>l[c]=`var(--${r}-${c})`),n[r]=l}else if(o==="fontSizes")n.fontSizes=[...Array(8).keys()].map(r=>`var(--fontSize-${r})`);else if(o==="custom"&&(n.custom={},i&&typeof i=="object"))for(let r in i)n.custom[r]=`var(--custom-${$o(r)})`}return Qe=n,n}function zt(){return Object.entries(Oe).map(([e,t])=>dr(e,t)).join(`
5
+ `)}function pr(e){var t;if(typeof document!="undefined")if(e){e.textContent=zt();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=zt(),document.head.appendChild(e)}function a(e){return`${e/4}em`}function et(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let n="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(n=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),n}var It=["inherit"];[...Array(5).keys()].forEach(e=>{It.push(`decrease-${e}`),It.push(`increase-${e}`)});function gr(e,t="inherit"){if(!It.includes(t))throw Error(`density name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(4,n))}function yr(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(n=gr(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function g(e){let t=yr(e);return Z(e?et(e):"light").densities[t]}var Mt=["inherit"];[...Array(8).keys()].forEach(e=>{Mt.push(`decrease-${e}`),Mt.push(`increase-${e}`)});function zo(e,t="inherit"){if(!Mt.includes(t))throw Error(`size name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(7,n))}function br(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(n=zo(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function y(e,t="inherit"){let n=zo(br(e),t);return Ve().fontSizes[n]}var ae=Be.colors.neutral.length,Ne=["inherit","base"];[...Array(ae).keys()].forEach(e=>{Ne.push(`decrease-${e}`),Ne.push(`increase-${e}`),Ne.push(`shift-${e}`)});function Do(e,t){if(e<0||e>ae-1)return e;let n=e+t;return n=Math.max(0,Math.min(ae-1,n)),n}function vr(e,t){if(e<0||e>ae-1)return e;let n=Math.floor((ae-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(ae-1,o)),o}function He(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!Ne.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return Do(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return Do(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return vr(e,n)}else return e}function Io(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let n=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(n=He(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function Mo(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===ae-1?ae-1-n:e}function s(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e)return t==="base"?Ve()[o][Z("light").baseTones[o]]:Ve()[o][He(0,t)];let i=et(e),r;if(t==="base")r=Z(i).baseTones[o];else{let c=Z(i),u=Mo(Io(e),c.direction,c.darkBias);r=He(u,t)}let l=Ve()[o];if(!l)throw Error(`color "${o}" not found on theme "${i}"`);return l[r]}function Nt(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,i=e?et(e):"light",r=Lo(i);if(!e)return t==="base"?r[o][Z("light").baseTones[o]]:r[o][He(0,t)];let l;if(t==="base")l=Z(i).baseTones[o];else{let c=Z(i),u=Mo(Io(e),c.direction,c.darkBias);l=He(u,t)}return r[o][l]}var ft={};Ge(ft,{abbreviation:()=>Sr,accordion:()=>xr,alert:()=>Cr,avatar:()=>wr,badge:()=>Er,blockquote:()=>kr,breadcrumb:()=>Tr,breadcrumbEllipsis:()=>_r,button:()=>Or,buttonGhost:()=>Pr,buttonSwitch:()=>Dr,card:()=>$r,code:()=>Rr,combobox:()=>Si,command:()=>xi,commandItem:()=>wi,commandSearch:()=>Ci,datePicker:()=>ki,descriptionList:()=>Oi,details:()=>Pi,dialog:()=>Di,divider:()=>$i,drawer:()=>Ri,emphasis:()=>Li,empty:()=>zi,errorBoundary:()=>Ii,fab:()=>Ai,figure:()=>Vi,formGroup:()=>Ni,heading:()=>Hi,horizontalRule:()=>ji,icon:()=>Fi,image:()=>Wi,inputCheckbox:()=>Ki,inputColor:()=>Ui,inputDateTime:()=>qi,inputFile:()=>Yi,inputNumber:()=>Gi,inputOTP:()=>Xi,inputRadio:()=>Ji,inputRange:()=>Zi,inputSearch:()=>Qi,inputSwitch:()=>el,inputText:()=>tl,keyboard:()=>ol,label:()=>nl,link:()=>rl,list:()=>il,listItem:()=>ll,listItemButton:()=>al,mark:()=>sl,menu:()=>cl,menuItem:()=>ul,motion:()=>ml,orderedList:()=>dl,pagination:()=>fl,paragraph:()=>pl,popover:()=>gl,popoverArrow:()=>Jt,preformated:()=>yl,progress:()=>bl,rating:()=>xl,segmented:()=>Cl,segmentedItem:()=>wl,select:()=>El,selectBox:()=>kl,selectItem:()=>Tl,selectList:()=>_l,skeleton:()=>Ol,small:()=>Pl,spinner:()=>Dl,splitter:()=>$l,splitterHandle:()=>Ll,splitterPanel:()=>Rl,stepItem:()=>zl,steps:()=>Il,strong:()=>Ml,subscript:()=>Al,superscript:()=>Vl,tab:()=>Nl,tabPanel:()=>Hl,table:()=>Bl,tabs:()=>jl,tag:()=>We,textarea:()=>Fl,timeline:()=>Wl,timelineItem:()=>Kl,toast:()=>Ul,toggle:()=>ql,toggleGroup:()=>Yl,toolbar:()=>Gl,toolbarSpacer:()=>Xl,tooltip:()=>Jl,transitionGroup:()=>Zl,unorderedList:()=>Ql});function Sr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>y(r),backgroundColor:r=>s(r),color:r=>s(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>s(r,"shift-7",t.get(r)),textUnderlineOffset:a(.72),cursor:"help","&:hover":{color:r=>s(r,"shift-11",n.get(r)),textDecorationColor:r=>s(r,"shift-9",n.get(r))}}}}function xr(e={}){var i,r;let{type:t="single"}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=f((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:l=>{if(t!=="single")return;let c=l.domElement;if(!c)return;let u=h=>{let m=h.target.closest("summary");if(!m)return;let d=m.closest("details");!d||d.parentElement!==c||d.open||Array.from(c.querySelectorAll(":scope > details")).forEach(p=>{p!==d&&(p.open=!1)})};c.addEventListener("click",u),l.addHook("Remove",()=>c.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:l=>a(g(l)*1),outline:l=>`1px solid ${s(l,"shift-4",n.get(l))}`,outlineOffset:"-1px",overflow:"hidden","& > details":{borderBottom:l=>`1px solid ${s(l,"shift-4",n.get(l))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{outline:l=>`${a(.5)} solid ${s(l,"shift-6",o.get(l))}`}}}}function Cr(e={}){var n;let t=f((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:a(3),paddingBlock:o=>a(g(o)*2),paddingInline:o=>a(g(o)*4),boxShadow:o=>`inset ${a(1)} 0 0 0 ${s(o,"shift-8",t.get(o))}`,backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),fontSize:o=>y(o,"inherit")}}}function wr(e={}){var n;let t=f((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:a(9),height:a(9),fontSize:o=>y(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function Er(e={}){var i;let{label:t=999}=e,n=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:a(1),minWidth:a(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>y(r,"decrease-1"),borderRadius:a(999),backgroundColor:r=>s(r,"shift-9",o.get(r)),color:r=>s(r,"shift-0",o.get(r))}}}}function kr(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>s(o,"inherit",t.get(o)),boxShadow:o=>`inset ${a(1)} 0 0 0 ${s(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>a(g(o)*2),paddingInline:o=>a(g(o)*4),margin:0}}}function Tr(e={}){var o;let{separator:t="/"}=e,n=f((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>y(i,"inherit"),gap:a(1),color:i=>s(i,"shift-9",n.get(i)),backgroundColor:i=>s(i,"inherit",n.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>s(i,"shift-8",n.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>s(i,"shift-4",n.get(i)),paddingInlineStart:a(1)},"& > [aria-current=page]":{color:i=>s(i,"shift-10",n.get(i)),pointerEvents:"none"}}}}function _r(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>y(o,"inherit"),paddingInline:a(1),border:"none",background:"none",cursor:"pointer",color:o=>s(o,"shift-8",t.get(o)),borderRadius:a(1),"&:hover":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${a(.5)} solid ${s(o,"shift-6",t.get(o))}`,outlineOffset:a(.5)}}}}function Or(e={}){var n;let t=f((n=e.color)!=null?n:"primary","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>y(o,"inherit"),paddingBlock:o=>a(g(o)*1),paddingInline:o=>a(g(o)*3),borderRadius:o=>a(g(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>a(g(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${a(.5)} ${s(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,color:o=>s(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Pr(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>y(o,"inherit"),paddingBlock:o=>a(g(o)*1),paddingInline:o=>a(g(o)*1),borderRadius:o=>a(g(o)*1),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>a(g(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",color:o=>s(o,"shift-6",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${a(.5)} ${s(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-4","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Dr(e={}){var r,l;let{checked:t=!1}=e,n=f(t),o=f((r=e.color)!=null?r:"neutral","color"),i=f((l=e.accentColor)!=null?l:"primary","accentColor");return{_onSchedule:c=>{c.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>n.get(c),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>y(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${s(c,"shift-3",o.get(c))}`,minWidth:a(12),minHeight:a(6),borderRadius:a(999),paddingLeft:a(7),paddingRight:a(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>s(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:a(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:a(5),height:a(5),borderRadius:a(999),color:c=>s(c,"shift-9"),backgroundColor:c=>s(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>s(c,"increase-3",i.get(c)),outline:"none",color:c=>s(c,"decrease-2"),paddingLeft:a(2),paddingRight:a(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${a(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function $r(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>a(g(o)*2),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>a(g(o)*2),paddingInline:o=>a(g(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>a(g(o)*4),color:o=>s(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>a(g(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>a(g(o)*4),color:o=>s(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:a(2),paddingBlock:o=>a(g(o)*2),paddingInline:o=>a(g(o)*4),borderTop:o=>`1px solid ${s(o,"shift-3",t.get(o))}`}}}}function Rr(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:a(6),paddingInline:a(1.5),borderRadius:a(1)}}}var Lr=Object.defineProperty,zr=Object.defineProperties,Ir=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,qo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,Ao=(e,t,n)=>t in e?Lr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y=(e,t)=>{for(var n in t||(t={}))qo.call(t,n)&&Ao(e,n,t[n]);if(nt)for(var n of nt(t))Yo.call(t,n)&&Ao(e,n,t[n]);return e},ge=(e,t)=>zr(e,Ir(t)),Go=(e,t)=>{var n={};for(var o in e)qo.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&nt)for(var o of nt(e))t.indexOf(o)<0&&Yo.call(e,o)&&(n[o]=e[o]);return n},ve=(e,t,n)=>new Promise((o,i)=>{var r=u=>{try{c(n.next(u))}catch(h){i(h)}},l=u=>{try{c(n.throw(u))}catch(h){i(h)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(r,l);c((n=n.apply(e,t)).next())}),Mr=["top","right","bottom","left"],Vo=["start","end"],Za=Mr.reduce((e,t)=>e.concat(t,`${t}-${Vo[0]}`,`${t}-${Vo[1]}`),[]),rt=Math.min,pe=Math.max,it=Math.round,ot=Math.floor,Q=e=>({x:e,y:e}),Ar={left:"right",right:"left",bottom:"top",top:"bottom"};function No(e,t,n){return pe(e,rt(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function Xo(e){return e==="x"?"y":"x"}function Jo(e){return e==="y"?"height":"width"}function se(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Zo(e){return Xo(se(e))}function Vr(e,t,n=!1){let o=ct(e),i=Zo(e),r=Jo(i),l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=lt(l)),[l,lt(l)]}function Nr(e){let t=lt(e);return[jt(e),t,jt(t)]}function jt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Bo=["left","right"],Ho=["right","left"],Br=["top","bottom"],Hr=["bottom","top"];function jr(e,t,n){switch(e){case"top":case"bottom":return n?t?Ho:Bo:t?Bo:Ho;case"left":case"right":return t?Br:Hr;default:return[]}}function Fr(e,t,n,o){let i=ct(e),r=jr(ye(e),n==="start",o);return i&&(r=r.map(l=>`${l}-${i}`),t&&(r=r.concat(r.map(jt)))),r}function lt(e){let t=ye(e);return Ar[t]+e.slice(t.length)}function Wr(e){return Y({top:0,right:0,bottom:0,left:0},e)}function Kr(e){return typeof e!="number"?Wr(e):{top:e,right:e,bottom:e,left:e}}function at(e){let{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function jo({reference:e,floating:t},n,o){let i=se(n),r=Zo(n),l=Jo(r),c=ye(n),u=i==="y",h=e.x+e.width/2-t.width/2,m=e.y+e.height/2-t.height/2,d=e[l]/2-t[l]/2,p;switch(c){case"top":p={x:h,y:e.y-t.height};break;case"bottom":p={x:h,y:e.y+e.height};break;case"right":p={x:e.x+e.width,y:m};break;case"left":p={x:e.x-t.width,y:m};break;default:p={x:e.x,y:e.y}}switch(ct(n)){case"start":p[r]-=d*(o&&u?-1:1);break;case"end":p[r]+=d*(o&&u?-1:1);break;default:}return p}function Ur(e){return ve(this,arguments,function*(t,n={}){var o,i,r,l,c,u;let{x:h,y:m,platform:d,rects:p,elements:b,strategy:v}=t,{boundary:S="clippingAncestors",rootBoundary:x="viewport",elementContext:w="floating",altBoundary:E=!1,padding:k=0}=st(n,t),_=Kr(k),O=b[E?w==="floating"?"reference":"floating":w],L=at(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,O))==null||i?O:O.contextElement||(yield(r=d.getDocumentElement)==null?void 0:r.call(d,b.floating)),boundary:S,rootBoundary:x,strategy:v})),z=w==="floating"?{x:h,y:m,width:p.floating.width,height:p.floating.height}:p.reference,ie=yield(l=d.getOffsetParent)==null?void 0:l.call(d,b.floating),W=(yield(c=d.isElement)==null?void 0:c.call(d,ie))?(yield(u=d.getScale)==null?void 0:u.call(d,ie))||{x:1,y:1}:{x:1,y:1},H=at(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:b,rect:z,offsetParent:ie,strategy:v}):z);return{top:(L.top-H.top+_.top)/W.y,bottom:(H.bottom-L.bottom+_.bottom)/W.y,left:(L.left-H.left+_.left)/W.x,right:(H.right-L.right+_.right)/W.x}})}var qr=50,Yr=(e,t,n)=>ve(null,null,function*(){var o;let{placement:i="bottom",strategy:r="absolute",middleware:l=[],platform:c}=n,u=c.detectOverflow?c:ge(Y({},c),{detectOverflow:Ur}),h=yield(o=c.isRTL)==null?void 0:o.call(c,t),m=yield c.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:p}=jo(m,i,h),b=i,v=0,S={};for(let x=0;x<l.length;x++){let w=l[x];if(!w)continue;let{name:E,fn:k}=w,{x:_,y:O,data:L,reset:z}=yield k({x:d,y:p,initialPlacement:i,placement:b,strategy:r,middlewareData:S,rects:m,platform:u,elements:{reference:e,floating:t}});d=_!=null?_:d,p=O!=null?O:p,S[E]=Y(Y({},S[E]),L),z&&v<qr&&(v++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(m=z.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:r}):z.rects),{x:d,y:p}=jo(m,b,h)),x=-1)}return{x:d,y:p,placement:b,strategy:r,middlewareData:S}});var Gr=(e={})=>({name:"flip",options:e,fn(t){return ve(this,null,function*(){var n,o,i,r,l,c;let{placement:u,middlewareData:h,rects:m,initialPlacement:d,platform:p,elements:b}=t,v=st(e,t),{mainAxis:S=!0,crossAxis:x=!0,fallbackPlacements:w,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:_=!0}=v,O=Go(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=h.arrow)!=null&&n.alignmentOffset)return{};let L=ye(u),z=se(d),ie=ye(d)===d,W=yield(o=p.isRTL)==null?void 0:o.call(p,b.floating),H=w||(ie||!_?[lt(d)]:Nr(d)),qe=k!=="none";!w&&qe&&H.push(...Fr(d,_,k,W));let pt=[d,...H],xe=yield p.detectOverflow(t,O),j=[],oe=((i=h.flip)==null?void 0:i.overflows)||[];if(S&&j.push(xe[L]),x){let ne=Vr(u,m,W);j.push(xe[ne[0]],xe[ne[1]])}if(oe=[...oe,{placement:u,overflows:j}],!j.every(ne=>ne<=0)){let ne=(((r=h.flip)==null?void 0:r.index)||0)+1,Le=pt[ne];if(Le&&(!(x==="alignment"&&z!==se(Le))||oe.every(N=>se(N.placement)===z?N.overflows[0]>0:!0)))return{data:{index:ne,overflows:oe},reset:{placement:Le}};let ue=(l=oe.filter(N=>N.overflows[0]<=0).sort((N,U)=>N.overflows[1]-U.overflows[1])[0])==null?void 0:l.placement;if(!ue)switch(E){case"bestFit":{let N=(c=oe.filter(U=>{if(qe){let q=se(U.placement);return q===z||q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(q=>q>0).reduce((q,ze)=>q+ze,0)]).sort((U,q)=>U[1]-q[1])[0])==null?void 0:c[0];N&&(ue=N);break}case"initialPlacement":ue=d;break;default:}if(u!==ue)return{reset:{placement:ue}}}return{}})}});var Xr=new Set(["left","top"]);function Jr(e,t){return ve(this,null,function*(){var n;let{placement:o,platform:i,elements:r}=e,l=yield(n=i.isRTL)==null?void 0:n.call(i,r.floating),c=ye(o),u=ct(o),h=se(o)==="y",m=Xr.has(c)?-1:1,d=l&&h?-1:1,p=st(t,e),{mainAxis:b,crossAxis:v,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof S=="number"&&(v=u==="end"?S*-1:S),h?{x:v*d,y:b*m}:{x:b*m,y:v*d}})}var Zr=(e=0)=>({name:"offset",options:e,fn(t){return ve(this,null,function*(){var n,o;let{x:i,y:r,placement:l,middlewareData:c}=t,u=yield Jr(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:r+u.y,data:ge(Y({},u),{placement:l})}})}}),Qr=(e={})=>({name:"shift",options:e,fn(t){return ve(this,null,function*(){let{x:n,y:o,placement:i,platform:r}=t,l=st(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:h={fn:({x:E,y:k})=>({x:E,y:k})}}=l,m=Go(l,["mainAxis","crossAxis","limiter"]),d={x:n,y:o},p=yield r.detectOverflow(t,m),b=se(ye(i)),v=Xo(b),S=d[v],x=d[b];if(c){let E=v==="y"?"top":"left",k=v==="y"?"bottom":"right",_=S+p[E],O=S-p[k];S=No(_,S,O)}if(u){let E=b==="y"?"top":"left",k=b==="y"?"bottom":"right",_=x+p[E],O=x-p[k];x=No(_,x,O)}let w=h.fn(ge(Y({},t),{[v]:S,[b]:x}));return ge(Y({},w),{data:{x:w.x-n,y:w.y-o,enabled:{[v]:c,[b]:u}}})})}});function ut(){return typeof window!="undefined"}function $e(e){return Qo(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function ee(e){var t;return(t=(Qo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qo(e){return ut()?e instanceof Node||e instanceof F(e).Node:!1}function G(e){return ut()?e instanceof Element||e instanceof F(e).Element:!1}function re(e){return ut()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function Fo(e){return!ut()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function Fe(e){let{overflow:t,overflowX:n,overflowY:o,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&i!=="inline"&&i!=="contents"}function ei(e){return/^(table|td|th)$/.test($e(e))}function mt(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var ti=/transform|translate|scale|rotate|perspective|filter/,oi=/paint|layout|strict|content/,fe=e=>!!e&&e!=="none",Bt;function Wt(e){let t=G(e)?X(e):e;return fe(t.transform)||fe(t.translate)||fe(t.scale)||fe(t.rotate)||fe(t.perspective)||!Kt()&&(fe(t.backdropFilter)||fe(t.filter))||ti.test(t.willChange||"")||oi.test(t.contain||"")}function ni(e){let t=ce(e);for(;re(t)&&!De(t);){if(Wt(t))return t;if(mt(t))return null;t=ce(t)}return null}function Kt(){return Bt==null&&(Bt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Bt}function De(e){return/^(html|body|#document)$/.test($e(e))}function X(e){return F(e).getComputedStyle(e)}function dt(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if($e(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Fo(e)&&e.host||ee(e);return Fo(t)?t.host:t}function en(e){let t=ce(e);return De(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&Fe(t)?t:en(t)}function je(e,t=[],n=!0){var o;let i=en(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=F(i);if(r){let c=Ft(l);return t.concat(l,l.visualViewport||[],Fe(i)?i:[],c&&n?je(c):[])}else return t.concat(i,je(i,[],n))}function Ft(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tn(e){let t=X(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=re(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,c=it(n)!==r||it(o)!==l;return c&&(n=r,o=l),{width:n,height:o,$:c}}function Ut(e){return G(e)?e:e.contextElement}function Pe(e){let t=Ut(e);if(!re(t))return Q(1);let n=t.getBoundingClientRect(),{width:o,height:i,$:r}=tn(t),l=(r?it(n.width):n.width)/o,c=(r?it(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}var ri=Q(0);function on(e){let t=F(e);return!Kt()||!t.visualViewport?ri:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ii(e,t=!1,n){return!n||t&&n!==F(e)?!1:t}function be(e,t=!1,n=!1,o){let i=e.getBoundingClientRect(),r=Ut(e),l=Q(1);t&&(o?G(o)&&(l=Pe(o)):l=Pe(e));let c=ii(r,n,o)?on(r):Q(0),u=(i.left+c.x)/l.x,h=(i.top+c.y)/l.y,m=i.width/l.x,d=i.height/l.y;if(r){let p=F(r),b=o&&G(o)?F(o):o,v=p,S=Ft(v);for(;S&&o&&b!==v;){let x=Pe(S),w=S.getBoundingClientRect(),E=X(S),k=w.left+(S.clientLeft+parseFloat(E.paddingLeft))*x.x,_=w.top+(S.clientTop+parseFloat(E.paddingTop))*x.y;u*=x.x,h*=x.y,m*=x.x,d*=x.y,u+=k,h+=_,v=F(S),S=Ft(v)}}return at({width:m,height:d,x:u,y:h})}function ht(e,t){let n=dt(e).scrollLeft;return t?t.left+n:be(ee(e)).left+n}function nn(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ht(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function li({elements:e,rect:t,offsetParent:n,strategy:o}){let i=o==="fixed",r=ee(n),l=e?mt(e.floating):!1;if(n===r||l&&i)return t;let c={scrollLeft:0,scrollTop:0},u=Q(1),h=Q(0),m=re(n);if((m||!m&&!i)&&(($e(n)!=="body"||Fe(r))&&(c=dt(n)),m)){let p=be(n);u=Pe(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}let d=r&&!m&&!i?nn(r,c):Q(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+h.x+d.x,y:t.y*u.y-c.scrollTop*u.y+h.y+d.y}}function ai(e){return Array.from(e.getClientRects())}function si(e){let t=ee(e),n=dt(e),o=e.ownerDocument.body,i=pe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=pe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),l=-n.scrollLeft+ht(e),c=-n.scrollTop;return X(o).direction==="rtl"&&(l+=pe(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:c}}var Wo=25;function ci(e,t){let n=F(e),o=ee(e),i=n.visualViewport,r=o.clientWidth,l=o.clientHeight,c=0,u=0;if(i){r=i.width,l=i.height;let m=Kt();(!m||m&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let h=ht(o);if(h<=0){let m=o.ownerDocument,d=m.body,p=getComputedStyle(d),b=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=Wo&&(r-=v)}else h<=Wo&&(r+=h);return{width:r,height:l,x:c,y:u}}function ui(e,t){let n=be(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=re(e)?Pe(e):Q(1),l=e.clientWidth*r.x,c=e.clientHeight*r.y,u=i*r.x,h=o*r.y;return{width:l,height:c,x:u,y:h}}function Ko(e,t,n){let o;if(t==="viewport")o=ci(e,n);else if(t==="document")o=si(ee(e));else if(G(t))o=ui(t,n);else{let i=on(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return at(o)}function rn(e,t){let n=ce(e);return n===t||!G(n)||De(n)?!1:X(n).position==="fixed"||rn(n,t)}function mi(e,t){let n=t.get(e);if(n)return n;let o=je(e,[],!1).filter(c=>G(c)&&$e(c)!=="body"),i=null,r=X(e).position==="fixed",l=r?ce(e):e;for(;G(l)&&!De(l);){let c=X(l),u=Wt(l);!u&&c.position==="fixed"&&(i=null),(r?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Fe(l)&&!u&&rn(e,l))?o=o.filter(h=>h!==l):i=c,l=ce(l)}return t.set(e,o),o}function di({element:e,boundary:t,rootBoundary:n,strategy:o}){let i=[...t==="clippingAncestors"?mt(e)?[]:mi(e,this._c):[].concat(t),n],r=Ko(e,i[0],o),l=r.top,c=r.right,u=r.bottom,h=r.left;for(let m=1;m<i.length;m++){let d=Ko(e,i[m],o);l=pe(d.top,l),c=rt(d.right,c),u=rt(d.bottom,u),h=pe(d.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function hi(e){let{width:t,height:n}=tn(e);return{width:t,height:n}}function fi(e,t,n){let o=re(t),i=ee(t),r=n==="fixed",l=be(e,!0,r,t),c={scrollLeft:0,scrollTop:0},u=Q(0);function h(){u.x=ht(i)}if(o||!o&&!r)if(($e(t)!=="body"||Fe(i))&&(c=dt(t)),o){let b=be(t,!0,r,t);u.x=b.x+t.clientLeft,u.y=b.y+t.clientTop}else i&&h();r&&!o&&i&&h();let m=i&&!o&&!r?nn(i,c):Q(0),d=l.left+c.scrollLeft-u.x-m.x,p=l.top+c.scrollTop-u.y-m.y;return{x:d,y:p,width:l.width,height:l.height}}function Ht(e){return X(e).position==="static"}function Uo(e,t){if(!re(e)||X(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function ln(e,t){let n=F(e);if(mt(e))return n;if(!re(e)){let i=ce(e);for(;i&&!De(i);){if(G(i)&&!Ht(i))return i;i=ce(i)}return n}let o=Uo(e,t);for(;o&&ei(o)&&Ht(o);)o=Uo(o,t);return o&&De(o)&&Ht(o)&&!Wt(o)?n:o||ni(e)||n}var pi=function(e){return ve(this,null,function*(){let t=this.getOffsetParent||ln,n=this.getDimensions,o=yield n(e.floating);return{reference:fi(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function gi(e){return X(e).direction==="rtl"}var yi={convertOffsetParentRelativeRectToViewportRelativeRect:li,getDocumentElement:ee,getClippingRect:di,getOffsetParent:ln,getElementRects:pi,getClientRects:ai,getDimensions:hi,getScale:Pe,isElement:G,isRTL:gi};function an(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bi(e,t){let n=null,o,i=ee(e);function r(){clearTimeout(o),n==null||n.disconnect(),n=null}function l(c=!1,u=1){r();let h=e.getBoundingClientRect(),{left:m,top:d,width:p,height:b}=h;if(c||t(),!p||!b)return;let v=ot(d),S=ot(i.clientWidth-(m+p)),x=ot(i.clientHeight-(d+b)),w=ot(m),E={rootMargin:`${-v}px ${-S}px ${-x}px ${-w}px`,threshold:pe(0,rt(1,u))||1},k=!0;function _(O){let L=O[0].intersectionRatio;if(L!==u){if(!k)return l();L?l(!1,L):o=setTimeout(()=>{l(!1,1e-7)},1e3)}L===1&&!an(h,e.getBoundingClientRect())&&l(),k=!1}try{n=new IntersectionObserver(_,ge(Y({},E),{root:i.ownerDocument}))}catch(O){n=new IntersectionObserver(_,E)}n.observe(e)}return l(!0),r}function sn(e,t,n,o={}){let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,h=Ut(e),m=i||r?[...h?je(h):[],...t?je(t):[]]:[];m.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});let d=h&&c?bi(h,n):null,p=-1,b=null;l&&(b=new ResizeObserver(([w])=>{w&&w.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{b==null||b.observe(t)})),n()}),h&&!u&&b.observe(h),t&&b.observe(t));let v,S=u?be(e):null;u&&x();function x(){let w=be(e);S&&!an(S,w)&&n(),S=w,v=requestAnimationFrame(x)}return n(),()=>{m.forEach(w=>{i&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),d==null||d(),b==null||b.disconnect(),b=null,u&&cancelAnimationFrame(v)}}var cn=Zr;var un=Qr,mn=Gr;var dn=(e,t,n)=>{let o=new Map,i=Y({platform:yi},n),r=ge(Y({},i.platform),{_c:o});return Yr(e,t,ge(Y({},i),{platform:r}))};function te(e){let{open:t=!1,placement:n}=e,o=null,i=null,r=null,l=null,c=null,u=null,h=!1,m=f(t),d=()=>{h||!u||(h=!0,c=u.children.insert(e.content))},p=()=>{d(),r&&l&&(i&&i(),i=sn(r,l,()=>{dn(r,l,{placement:n.get(),middleware:[cn(12),mn(),un()],strategy:"fixed"}).then(({x:E,y:k,placement:_})=>{Object.assign(l.style,{left:`${E}px`,top:`${k}px`}),n.set(_)})}),m.set(!0))},b=()=>{i&&i(),i=null,m.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(p,100)},S=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},x={style:{position:"fixed",pointerEvents:"auto",visibility:E=>m.get(E)?"visible":"hidden"},_onMount:E=>l=E.domElement,_portal:E=>{var _;let k=E.domElement.querySelector("#domphy-floating");if(!k){let O={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};k=E.children.insert(O).domElement}if(r&&k instanceof HTMLElement&&!k.hasAttribute("data-theme")){let O=(_=r.closest("[data-theme]"))==null?void 0:_.getAttribute("data-theme");O&&k.setAttribute("data-theme",O)}return k}};return $(e.content,x),{show:v,hide:S,anchorPartial:{onKeyDown:E=>E.key==="Escape"&&S(),_onMount:E=>{u=E.getRoot(),r=E.domElement;let k=_=>{if(!m.get()||!r||!l)return;let O=_.target;!r.contains(O)&&!l.contains(O)&&S()};E.getRoot().domElement.addEventListener("click",k),E.addHook("BeforeRemove",()=>{o&&clearTimeout(o),i&&(i(),i=null),c&&c.remove(),E.getRoot().domElement.removeEventListener("click",k)})}}}}var vi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function We(e={}){var o;let{removable:t=!1}=e,n=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let r={span:vi,onClick:l=>{l.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:a(1),width:a(4),height:a(4),flexShrink:0,"&:hover":{backgroundColor:l=>s(l,"shift-4",n.get(l))}}};t&&i.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:a(6),paddingBlock:"0px",borderRadius:a(1),paddingInlineStart:a(2),paddingInlineEnd:t?a(1):a(2),gap:a(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>s(i,"inherit",n.get(i)),color:i=>s(i,"shift-9",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"shift-4",n.get(i))}`}}}function Si(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,l=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(n),content:e.content}),d={onClick:()=>!r&&h()};$(e.content,d);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:a(6),marginInlineStart:a(2),fontSize:x=>y(x,"inherit"),color:x=>s(x,"shift-9",o),backgroundColor:x=>s(x,"inherit",o)},b;e.input?($(e.input,{onFocus:()=>u(),style:p,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>u(),value:x=>(l.get(x),""),style:p,_key:"combobox-input"};let v={div:x=>{let w=l.get(x),E=Array.isArray(w)?w:[w],_=t.filter(O=>E.includes(O.value)).map(O=>({span:O.label,$:[We({color:o,removable:!0})],_key:O.value,_onRemove:L=>{let z=l.get(),W=(Array.isArray(z)?z:[z]).filter(H=>H!==O.value);r?l.set(W):l.set(W[0])}}));return _.push(b),_},style:{display:"flex",flexWrap:"wrap",gap:a(1)}},S={_onInsert:x=>{x.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:x=>x.children.insert(v),style:{minWidth:a(32),outlineOffset:"-1px",outline:x=>`1px solid ${s(x,"shift-4","neutral")}`,paddingBlock:x=>a(g(x)*1),paddingInline:x=>a(g(x)*1),borderRadius:x=>a(g(x)*1),fontSize:x=>y(x,"inherit"),color:x=>s(x,"shift-9",o),backgroundColor:x=>s(x,"inherit",o)}};return $(m,S),m}function xi(){return{_onSchedule:(e,t)=>{$(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Ci(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,l=()=>i.query.set(r.value);r.addEventListener("input",l),o.addHook("Remove",()=>r.removeEventListener("input",l))},style:{fontFamily:"inherit",fontSize:o=>y(o,"inherit"),paddingInline:o=>a(g(o)*3),paddingBlock:o=>a(g(o)*2),border:"none",borderBottom:o=>`1px solid ${s(o,"shift-3",t)}`,outline:"none",color:o=>s(o,"shift-10",t),backgroundColor:o=>s(o,"inherit",t),"&::placeholder":{color:o=>s(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>s(o,"shift-6",n)}}}}function wi(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{role:"option",_onMount:o=>{var h,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,l=(m=(h=r.textContent)==null?void 0:h.toLowerCase())!=null?m:"",c=d=>{r.hidden=d.length>0&&!l.includes(d.toLowerCase())};c(i.query.get());let u=i.query.addListener(c);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>y(o,"inherit"),height:o=>a(6+g(o)*2),paddingInline:o=>a(g(o)*3),border:"none",outline:"none",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${a(.5)} solid ${s(o,"shift-6",n)}`,outlineOffset:`-${a(.5)}`}}}}var A=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Se=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),qt=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Ke=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Yt=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Gt=(e,t)=>Se(e,-((e.getDay()-t+7)%7));function Ei(e){var t,n;try{let o=new Intl.Locale(e),i=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function ki(e={}){var Zt,Qt,eo,to;let{mode:t="single",time:n=!1,min:o,max:i,disabledDate:r,locale:l=typeof navigator!="undefined"?navigator.language:"en-US",format:c,onChange:u}=e,h=(Zt=e.weekStartsOn)!=null?Zt:Ei(l),m=f((Qt=e.accentColor)!=null?Qt:"primary","accentColor"),d=f((eo=e.placement)!=null?eo:"bottom-start"),p=f((to=e.value)!=null?to:t==="range"?[null,null]:null),b=u?p.addListener(C=>u(C)):null,v=(()=>{let C=p.get(),T=t==="range"?C==null?void 0:C[0]:C;return T instanceof Date?T:new Date})(),S=f(v.getFullYear(),"viewYear"),x=f(v.getMonth(),"viewMonth"),w=f(A(v),"focused"),E=f(null,"hovered"),k=f(v.getHours(),"hour"),_=f(v.getMinutes(),"minute"),O=null,L=new Intl.DateTimeFormat(l,we({dateStyle:"medium"},n?{timeStyle:"short"}:{})),z=new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}),ie=new Intl.DateTimeFormat(l,{weekday:"short"}),W=new Intl.DateTimeFormat(l,{dateStyle:"full"}),H=C=>C?L.format(C):"",qe=C=>{if(c)return c(C);if(t==="range"){let[T,P]=C!=null?C:[null,null];return T?`${H(T)} \u2013 ${H(P)}`:""}return H(C)},pt=Array.from({length:7},(C,T)=>ie.format(new Date(2023,0,1+(T+h)%7))),xe=C=>!!o&&A(C)<A(o)||!!i&&A(C)>A(i)||!!r&&r(C),j=C=>{if(!n)return A(C);let T=A(C);return T.setHours(k.get(),_.get(),0,0),T},oe=C=>{var D;if(xe(C))return;if(t==="single"){p.set(j(C)),n||yt();return}let[T,P]=(D=p.get())!=null?D:[null,null];!T||T&&P?p.set([j(C),null]):A(C)<A(T)?(p.set([j(C),j(T)]),n||yt()):(p.set([T,j(C)]),n||yt())},ne=()=>{var C;if(n)if(t==="single"){let T=p.get();T&&p.set(j(T))}else{let[T,P]=(C=p.get())!=null?C:[null,null];p.set([T&&j(T),P&&j(P)])}},Le=(C,T)=>{var Ce;if(t!=="range")return!1;let[P,D]=(Ce=p.get(T))!=null?Ce:[null,null],I=D!=null?D:E.get(T);if(!P||!I)return!1;let R=A(P)<=A(I)?P:I,K=A(P)<=A(I)?I:P,B=A(C);return B>=A(R)&&B<=A(K)},ue=(C,T)=>{let P=p.get(T);if(t==="range"){let[D,I]=P!=null?P:[null,null];return Ke(C,D)||Ke(C,I)}return Ke(C,P)},N=C=>{S.set(C.getFullYear()),x.set(C.getMonth())},U=C=>{let T=qt(new Date(S.get(),x.get(),1),C);N(T)},q=C=>S.set(S.get()+C),ze=()=>{setTimeout(()=>{var C;(C=O==null?void 0:O.querySelector(`[data-date="${Yt(w.get())}"]`))==null||C.focus()},0)},xn=Tn(),{show:Cn,hide:wn,anchorPartial:gt}=te({open:!1,placement:d,content:xn});function yt(){wn()}gt.onClick=()=>{};let En={type:"text",readonly:!0,value:C=>qe(p.get(C)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:()=>{bt()},onFocus:()=>{bt()},onKeyDown:C=>{let T=C.key;(T==="ArrowDown"||T==="Enter")&&(C.preventDefault(),bt())},_onMount:C=>b&&C.addHook("Remove",()=>{b()})};function bt(){var T;let C=(T=kn())!=null?T:new Date;w.set(A(C)),N(C),Cn(),ze()}function kn(){var T;let C=p.get();return t==="range"?(T=C==null?void 0:C[0])!=null?T:null:C!=null?C:null}return $(gt,En),gt;function Tn(){let C=(R,K,B)=>({button:R,type:"button",ariaLabel:K,onClick:B,style:Ti()}),T={div:[C("\xAB","Previous year",()=>q(-1)),C("\u2039","Previous month",()=>U(-1)),{div:R=>z.format(new Date(S.get(R),x.get(R),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:R=>y(R)}},C("\u203A","Next month",()=>U(1)),C("\xBB","Next year",()=>q(1))],style:{display:"flex",alignItems:"center",gap:a(1),marginBottom:a(2)}},P={div:pt.map((R,K)=>({div:R,style:{textAlign:"center",fontSize:B=>y(B,"decrease-1"),fontWeight:"600",color:B=>s(B,"shift-7"),paddingBlock:a(1)},_key:K})),role:"row",style:hn()},D={div:R=>_n(R),role:"grid",ariaLabel:"Calendar",onKeyDown:$n,onMouseLeave:()=>t==="range"&&E.set(null),style:{display:"flex",flexDirection:"column",gap:a(.5)}},I=[T,P,D];return n&&I.push(Pn()),I.push(Dn()),{div:I,role:"dialog",ariaModal:"false",_onMount:R=>{O=R.domElement},style:{minWidth:a(70),padding:a(3),borderRadius:a(2),backgroundColor:R=>s(R,"base"),color:R=>s(R,"shift-10"),border:R=>`1px solid ${s(R,"shift-4")}`,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"}}}function _n(C){let T=new Date(S.get(C),x.get(C),1),P=x.get(C),D=Gt(T,h),I=[];for(let R=0;R<6;R++){let K=[];for(let B=0;B<7;B++){let Ce=Se(D,R*7+B);K.push(On(Ce,P,C))}I.push({div:K,role:"row",style:hn(),_key:R})}return I}function On(C,T,P){let D=xe(C),I=ue(C,P),R=Le(C,P),K=C.getMonth()!==T,B=Ke(C,w.get(P)),Ce=Ke(C,new Date);return{button:String(C.getDate()),type:"button",role:"gridcell",tabIndex:B?0:-1,ariaSelected:I,ariaDisabled:D,disabled:D,ariaLabel:W.format(C),dataDate:Yt(C),onClick:()=>oe(C),onMouseEnter:()=>t==="range"&&E.set(C),style:{appearance:"none",border:"none",cursor:D?"not-allowed":"pointer",aspectRatio:"1",borderRadius:a(1),fontSize:M=>y(M),fontFamily:"inherit",opacity:D?.35:K?.5:1,backgroundColor:M=>I?s(M,"shift-7",m.get(M)):R?s(M,"shift-2",m.get(M)):"transparent",color:M=>I?s(M,"shift-0",m.get(M)):s(M,"shift-9"),outline:Ce?M=>`1px solid ${s(M,"shift-6",m.get(M))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:M=>I?s(M,"shift-7",m.get(M)):s(M,"shift-3",m.get(M))},"&:focus-visible":{outline:M=>`2px solid ${s(M,"shift-6",m.get(M))}`}},_key:Yt(C)}}function Pn(){let C=(T,P,D)=>({select:Array.from({length:T},(I,R)=>({option:String(R).padStart(2,"0"),value:String(R),selected:K=>P.get(K)===R,_key:R})),ariaLabel:D,onChange:I=>{P.set(Number(I.target.value)),ne()},style:_i()});return{div:[C(24,k,"Hour"),{span:":",style:{fontWeight:"600"}},C(60,_,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:a(1),marginTop:a(3)}}}function Dn(){let C=(T,P)=>({button:T,type:"button",onClick:P,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:D=>y(D,"decrease-1"),color:D=>s(D,"shift-8",m.get(D)),padding:a(1)}});return{div:[C("Today",()=>{let T=new Date;w.set(A(T)),N(T),ze()}),C("Clear",()=>{p.set(t==="range"?[null,null]:null),E.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:a(2),paddingTop:a(2),borderTop:T=>`1px solid ${s(T,"shift-3")}`}}}function $n(C){let T=C,P=w.get(),D=null;switch(T.key){case"ArrowLeft":D=Se(P,-1);break;case"ArrowRight":D=Se(P,1);break;case"ArrowUp":D=Se(P,-7);break;case"ArrowDown":D=Se(P,7);break;case"Home":D=Gt(P,h);break;case"End":D=Se(Gt(P,h),6);break;case"PageUp":D=qt(P,T.shiftKey?-12:-1);break;case"PageDown":D=qt(P,T.shiftKey?12:1);break;case"Enter":case" ":T.preventDefault(),oe(P);return;default:return}T.preventDefault(),w.set(D),N(D),ze()}}function hn(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:a(.5)}}function Ti(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>y(e),color:e=>s(e,"shift-8"),width:a(7),height:a(7),borderRadius:a(1),"&:hover":{backgroundColor:e=>s(e,"shift-3")}}}function _i(){return{fontFamily:"inherit",fontSize:e=>y(e),padding:a(1),borderRadius:a(1),border:e=>`1px solid ${s(e,"shift-4")}`,backgroundColor:e=>s(e,"base"),color:e=>s(e,"shift-9")}}function Oi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${a(24)}, max-content) 1fr`,columnGap:a(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}}function Pi(e={}){var i,r;let{duration:t=240}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=f((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:l=>{l.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:l=>y(l,"inherit"),color:l=>s(l,"shift-9",n.get(l)),backgroundColor:l=>s(l,"inherit",n.get(l)),overflow:"hidden","& > summary":{backgroundColor:l=>s(l,"shift-2",n.get(l)),color:l=>s(l,"shift-10",n.get(l)),fontSize:l=>y(l,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:a(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:l=>a(g(l)*4),height:a(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:a(2),height:a(2),flexShrink:0,marginTop:`-${a(.5)}`,borderInlineEnd:l=>`${a(.5)} solid ${s(l,"shift-9",n.get(l))}`,borderBottom:l=>`${a(.5)} solid ${s(l,"shift-9",n.get(l))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:l=>s(l,"shift-3",n.get(l))},"& > summary:focus-visible":{borderRadius:l=>a(g(l)*2),outlineOffset:`-${a(.5)}`,outline:l=>`${a(.5)} solid ${s(l,"shift-6",o.get(l))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:l=>a(g(l)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:a(250),opacity:1,paddingTop:l=>a(g(l)*1),paddingBottom:l=>a(g(l)*3)}}}}var fn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function Di(e={}){let{color:t="neutral",open:n=!1}=e,o=f(n),i=null,r=!1;return{_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(l,c)=>{if(l.target!==c.domElement)return;let u=c.domElement.getBoundingClientRect();l.clientX>=u.left&&l.clientX<=u.right&&l.clientY>=u.top&&l.clientY<=u.bottom||o.set(!1)},onTransitionEnd:(l,c)=>{if(!r)return;r=!1,c.domElement.close(),document.body.style.overflow="",i==null||i.focus(),i=null},_onMount:l=>{let c=l.domElement;c.setAttribute("aria-modal","true");let u=null,h=b=>{if(b.key!=="Tab")return;let v=Array.from(c.querySelectorAll(fn)).filter(w=>!w.closest("[aria-hidden='true']")&&w.offsetParent!==null);if(!v.length){b.preventDefault();return}let S=v[0],x=v[v.length-1];b.shiftKey?(document.activeElement===S||document.activeElement===c)&&(b.preventDefault(),x.focus()):document.activeElement===x&&(b.preventDefault(),S.focus())},m=b=>{b.preventDefault(),o.set(!1)};c.addEventListener("cancel",m);let d=b=>{b?(i=document.activeElement,c.showModal(),document.body.style.overflow="hidden",c.addEventListener("keydown",h),requestAnimationFrame(()=>{c.style.opacity="1";let v=c.querySelector(fn);v==null||v.focus()})):(r=!0,c.style.opacity="0",c.removeEventListener("keydown",h),u=setTimeout(()=>{u=null,r&&(r=!1,c.close(),document.body.style.overflow="",i==null||i.focus(),i=null)},350))};d(o.get());let p=o.addListener(d);l.addHook("Remove",()=>{u&&(clearTimeout(u),u=null),p(),c.removeEventListener("cancel",m),document.body.style.overflow="",c.removeEventListener("keydown",h),i==null||i.focus(),i=null})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:l=>y(l,"inherit"),color:l=>s(l,"shift-10",t),backgroundColor:l=>s(l,"inherit",t),border:"none",padding:l=>a(g(l)*3),boxShadow:l=>`0 ${a(9)} ${a(16)} ${s(l,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:l=>s(l,"shift-2","neutral"),opacity:.75}}}}function $i(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:a(2),fontSize:o=>y(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Xt={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},pn={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},Ue=e=>e==="left"||e==="right";function gn(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function Ri(e={}){let{color:t="neutral",open:n=!1,placement:o="end",size:i}=e,r=f(n),l=o==="start"||o==="end",c=gn(o,!1),u=Ue(c)?a(80):a(64),h=i!=null?i:u;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,d)=>{m.target===d.domElement&&r.set(!1)},_onMount:m=>{let d=m.domElement;d.setAttribute("aria-modal","true");let p=O=>{O.preventDefault(),r.set(!1)};d.addEventListener("cancel",p);let b=l&&(d.ownerDocument.documentElement.dir==="rtl"||d.ownerDocument.dir==="rtl"),v=gn(o,b);l&&(d.style.transform=Xt[v],d.style.margin=pn[v],d.style.width=Ue(v)?h:"100dvw",d.style.height=Ue(v)?"100dvh":h);let S=!1,x=null,w=()=>{x=null,S&&(S=!1,d.close(),document.body.style.overflow="")},E=O=>{O.target===d&&O.propertyName==="transform"&&w()};d.addEventListener("transitionend",E);let k=O=>{O?(S=!1,d.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{d.style.transform="translate(0, 0)"})):(S=!0,d.style.transform=Xt[v],x=setTimeout(w,350))};k(r.get());let _=r.addListener(k);m.addHook("Remove",()=>{x&&(clearTimeout(x),x=null),_(),d.removeEventListener("cancel",p),d.removeEventListener("transitionend",E),document.body.style.overflow=""})},style:{transform:Xt[c],transition:"transform 0.25s ease",fontSize:m=>y(m,"inherit"),color:m=>s(m,"shift-10",t),backgroundColor:m=>s(m,"inherit",t),border:"none",padding:m=>a(g(m)*3),margin:pn[c],width:Ue(c)?h:"100dvw",height:Ue(c)?"100dvh":h,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${a(4)} ${a(12)} ${s(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>s(m,"shift-2","neutral"),opacity:.75}}}}function Li(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>y(o,"inherit"),fontStyle:"italic",color:o=>s(o,"shift-10",t.get(o))}}}function zi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:a(3),paddingBlock:a(12),paddingInline:a(6),textAlign:"center",color:o=>s(o,"shift-6",t.get(o)),"& > :first-child":{color:o=>s(o,"shift-5",t.get(o))}}}}function Ii(e={}){return{_onError:(t,n,o)=>{var r,l;(r=e.onError)==null||r.call(e,n);let i=typeof e.fallback=="function"?e.fallback(n,o):(l=e.fallback)!=null?l:{div:"An error occurred."};t.children.update([i])}}}var Mi={small:8,medium:10,large:14};function Ai(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),n=a(Mi[(i=e.size)!=null?i:"medium"]);return{_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>y(r,"inherit"),backgroundColor:r=>s(r,"shift-9",t.get(r)),color:r=>s(r,"shift-0",t.get(r)),boxShadow:r=>`0 ${a(1)} ${a(4)} ${s(r,"shift-4","neutral")}`,transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>s(r,"shift-10",t.get(r)),boxShadow:r=>`0 ${a(2)} ${a(6)} ${s(r,"shift-5","neutral")}`},"&:focus-visible":{outline:r=>`2px solid ${s(r,"shift-6",t.get(r))}`,outlineOffset:"2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Vi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:a(2),marginInline:0,marginTop:a(3),marginBottom:a(3),color:o=>s(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:a(2)},"& figcaption":{fontSize:o=>y(o,"decrease-1"),color:o=>s(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Ni(e={}){var i;let{layout:t="horizontal"}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>a(g(r)*3),paddingBlock:r=>a(g(r)*3),border:"none",borderRadius:r=>a(g(r)*2),fontSize:r=>y(r,"inherit"),backgroundColor:r=>s(r,"inherit",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:a(4),rowGap:a(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>y(r,"inherit"),fontWeight:600,paddingBlock:r=>a(g(r)*1),borderRadius:r=>a(g(r)*2),color:r=>s(r,"shift-9",n.get(r)),backgroundColor:r=>s(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?"0px":a(g(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${a(2)} * -1)`,fontSize:r=>y(r,"decrease-1"),color:r=>s(r,"shift-9",n.get(r))}}}}var Bi={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Hi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>s(o,"shift-11",t.get(o)),marginTop:0,marginBottom:a(2),fontSize:o=>{let i=Bi[o.elementNode.tagName]||"inherit";return y(o,i)}}}}function ji(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:a(3),marginBottom:a(3),backgroundColor:o=>s(o,"shift-4",t.get(o))}}}function Fi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:a(4),height:a(4),flexShrink:"0",fontSize:o=>y(o),backgroundColor:"transparent",color:o=>s(o,"shift-9",t.get(o))}}}function Wi(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:a(2),backgroundColor:o=>s(o,"inherit",t.get(o))}}}function Ki(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>y(r,"inherit"),display:"inline-flex",position:"relative",width:a(6),height:a(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:a(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),width:a(4),height:a(4)},"&:hover::before":{backgroundColor:r=>s(r,"shift-2",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${s(r,"shift-6",n.get(r))}`,backgroundColor:r=>s(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>s(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${a(.5)} solid ${s(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${s(r,"shift-6",n.get(r))}`,backgroundColor:r=>s(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>s(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>s(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:a(1.5),outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>s(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Ui(e={}){return{type:"color",_onSchedule:(t,n)=>{t.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),n.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:t=>y(t,"inherit"),paddingBlock:t=>a(g(t)*1),paddingInline:t=>a(g(t)*1),blockSize:t=>a(6+g(t)*2),inlineSize:t=>a(6+g(t)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:t=>a(g(t)*1)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>s(t,"shift-2","neutral"),outline:t=>`1px solid ${s(t,"shift-4","neutral")}`}}}}function qi(e={}){var i,r;let{mode:t="datetime-local"}=e,n=f((i=e.color)!=null?i:"neutral","color"),o=f((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onSchedule:(l,c)=>{l.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:l=>y(l,"inherit"),lineHeight:"inherit",color:l=>s(l,"shift-9",n.get(l)),backgroundColor:l=>s(l,"inherit",n.get(l)),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${s(l,"shift-4",n.get(l))}`,borderRadius:l=>a(g(l)*1),paddingInline:l=>a(g(l)*3),height:l=>a(6+g(l)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:l=>`${a(.5)} solid ${s(l,"shift-6",o.get(l))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>s(l,"shift-8","neutral"),backgroundColor:l=>s(l,"shift-2","neutral"),outline:l=>`1px solid ${s(l,"shift-4","neutral")}`},"&:invalid":{outline:l=>`${a(.5)} solid ${s(l,"shift-6","error")}`}}}}function Yi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(r,l)=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),l.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:r=>y(r,"inherit"),lineHeight:"inherit",color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,borderRadius:r=>a(g(r)*1),height:r=>a(6+g(r)*2),paddingInline:r=>a(g(r)*1),"&::-webkit-file-upload-button":{marginTop:r=>a(g(r)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:a(1),height:a(6),paddingInline:a(2),cursor:"pointer",color:r=>s(r,"shift-11",t.get(r)),backgroundColor:r=>s(r,"shift-1",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`,backgroundColor:r=>s(r,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>s(r,"shift-8","neutral"),backgroundColor:r=>s(r,"shift-3","neutral")}}}}function Gi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(r,l)=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),l.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:a(10),paddingInlineStart:r=>a(g(r)*3),paddingInlineEnd:r=>a(g(r)*1.5),paddingBlock:r=>a(g(r)*1),borderRadius:r=>a(g(r)*1),fontSize:r=>y(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>s(r,"shift-2","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`,color:r=>s(r,"shift-8","neutral")}}}}function Xi(){return{style:{display:"flex",alignItems:"center",gap:a(2),"& > *":{minWidth:`${a(9)}!important`}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=l=>{let c=n(),u=l.target,h=c.indexOf(u);u.value&&h<c.length-1&&c[h+1].focus()},i=l=>{let c=n(),u=l.target,h=c.indexOf(u);l.key==="Backspace"&&!u.value&&h>0&&c[h-1].focus(),l.key==="ArrowLeft"&&h>0&&c[h-1].focus(),l.key==="ArrowRight"&&h<c.length-1&&c[h+1].focus()},r=l=>{var p,b,v;l.preventDefault();let c=(b=(p=l.clipboardData)==null?void 0:p.getData("text"))!=null?b:"",u=n(),h=u.indexOf(l.target),m=h===-1?0:h;[...c].forEach((S,x)=>{u[m+x]&&(u[m+x].value=S)});let d=Math.min(m+c.length-1,u.length-1);(v=u[d])==null||v.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",r)})}}}function Ji(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:r=>{if(r.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:r=>y(r,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:a(6),height:a(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),width:a(4),height:a(4)},"&:hover::before":{backgroundColor:r=>s(r,"shift-2",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${s(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>s(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>s(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>s(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Zi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:a(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:a(1.5),borderRadius:a(999),backgroundColor:r=>s(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:a(4),height:a(4),borderRadius:a(999),border:"none",marginTop:`calc((${a(1.5)} - ${a(4)}) / 2)`,backgroundColor:r=>s(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>s(r,"shift-10",n.get(r))},"&:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`,outlineOffset:a(1),borderRadius:a(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Qi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(r,l)=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),l.type="search"},style:{fontFamily:"inherit",fontSize:r=>y(r,"inherit"),lineHeight:"inherit",color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,borderRadius:r=>a(g(r)*1),minWidth:a(32),paddingInline:r=>a(g(r)*3),paddingBlock:r=>a(g(r)*1),"&::placeholder":{color:r=>s(r,"shift-7",t.get(r))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral"),backgroundColor:r=>s(r,"shift-2","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`}}}}function el(e={}){var n;let t=f((n=e.accentColor)!=null?n:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>y(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:a(9),height:a(6),cursor:"pointer",margin:"0",paddingBlock:a(1),"&:checked":{"&::before":{backgroundColor:o=>s(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${a(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:a(3),height:a(3),borderRadius:a(999),left:a(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>s(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:a(999),display:"inline-block",fontSize:o=>y(o,"inherit"),lineHeight:1,backgroundColor:o=>s(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function tl(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(r,l)=>{r.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),l.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:a(10),paddingInline:r=>a(g(r)*3),paddingBlock:r=>a(g(r)*1),borderRadius:r=>a(g(r)*1),fontSize:r=>y(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${s(r,"shift-4",t.get(r))}`,color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),"&::placeholder":{color:r=>s(r,"shift-7")},"&:not(:placeholder-shown)":{color:r=>s(r,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>s(r,"shift-2","neutral"),outline:r=>`1px solid ${s(r,"shift-4","neutral")}`,color:r=>s(r,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:r=>`${a(.5)} solid ${s(r,"shift-6","error")}`},"&[data-status=error]":{outline:r=>`${a(.5)} solid ${s(r,"shift-6","error")}`},"&[data-status=warning]":{outline:r=>`${a(.5)} solid ${s(r,"shift-6","warning")}`}}}}function ol(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),paddingBlock:a(.5),paddingInline:a(1.5),borderRadius:a(1),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`}}}function nl(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:a(2),fontSize:r=>y(r,"inherit"),color:r=>s(r,"shift-9",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>s(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral")}}}}function rl(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),n=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:r=>y(r,"inherit"),backgroundColor:r=>s(r),color:r=>s(r,"shift-9",t.get(r)),textDecoration:"none","&:visited":{color:r=>s(r,"shift-9",n.get(r))},"&:hover:not([disabled])":{color:r=>s(r,"shift-10",t.get(r)),textDecoration:"underline"},"&:focus-visible":{borderRadius:a(1),outlineOffset:a(1),outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>s(r,"shift-8","neutral")}}}}function il(e={}){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function ll(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>a(g(n)*2),paddingBlock:n=>a(t?1:g(n)*2),paddingInline:n=>a(g(n)*3),fontSize:n=>y(n,"inherit")}}}function al(e={}){var i,r;let t=f((i=e.color)!=null?i:"neutral","color"),n=(r=e.accentColor)!=null?r:"primary",{dense:o=!1}=e;return{cursor:"pointer",style:{appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:l=>a(g(l)*2),paddingBlock:l=>a(o?1:g(l)*2),paddingInline:l=>a(g(l)*3),fontSize:l=>y(l,"inherit"),color:l=>s(l,"shift-9",t.get(l)),borderRadius:l=>a(g(l)*1),transition:"background-color 150ms ease","&:hover:not([disabled])":{backgroundColor:l=>s(l,"shift-2",t.get(l))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:l=>s(l,"shift-3",n),color:l=>s(l,"shift-12",n)},"&:focus-visible":{outline:l=>`2px solid ${s(l,"shift-6",n)}`,outlineOffset:"-2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function sl(e={}){var n;let t=f((n=e.accentColor)!=null?n:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:a(6),borderRadius:a(1),paddingInline:a(1.5)}}}function cl(e={}){let{color:t="neutral",selectable:n=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,r)=>{var c;let l={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:n}}};$(r,l)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>a(g(i)*2),paddingInline:i=>a(g(i)*2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>s(i,"inherit",t)}}}function ul(e={}){let{accentColor:t="primary",color:n="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var u,h;i.tagName!=="button"&&console.warn('"menuItem" patch must use button tag');let r=i.getContext("menu");if(!r){console.warn('"menuItem" patch must be used inside a "menu"');return}let l=(h=(u=i.parent)==null?void 0:u.children.items)!=null?h:[];l=l.filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:l.indexOf(i);r.selectable&&(i.attributes.set("ariaCurrent",m=>r.activeKey.get(m)===c||void 0),i.addEvent("click",()=>r.activeKey.set(c)))},onKeyDown:(i,r)=>{var m,d,p,b;let l=i.key;if(l==="Enter"||l===" "){i.preventDefault(),(m=r.domElement)==null||m.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(l))return;i.preventDefault();let c=((p=(d=r.parent)==null?void 0:d.children.items)!=null?p:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem");if(!c.length)return;let u=c.indexOf(r),h=u;l==="ArrowDown"?h=(u+1)%c.length:l==="ArrowUp"?h=(u-1+c.length)%c.length:l==="Home"?h=0:l==="End"&&(h=c.length-1),(b=c[h].domElement)==null||b.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>a(2),width:"100%",fontSize:i=>y(i,"inherit"),height:i=>a(6+g(i)*2),paddingInline:i=>a(g(i)*3),border:"none",outline:"none",color:i=>s(i,"shift-9",n),backgroundColor:i=>s(i,"inherit",n),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>s(i,"shift-2",n)},"&[aria-current=true]":{backgroundColor:i=>s(i,"shift-3",t),color:i=>s(i,"shift-10")},"&:focus-visible":{outline:i=>`${a(.5)} solid ${s(i,"shift-6",t)}`,outlineOffset:`-${a(.5)}`}}}}var yn=e=>!!e&&typeof e.get=="function"&&e._isState===!0,Re=e=>{let t={},n=[];for(let o in e){let i=e[o];o==="x"?n.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?n.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?n.push(`scale(${i})`):o==="rotate"?n.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return n.length&&(t.transform=n.join(" ")),t};function ml(e={}){var l,c,u,h;let{initial:t,animate:n,exit:o,transition:i={}}=e,r={duration:(l=i.duration)!=null?l:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(h=i.iterations)!=null?h:1,fill:"both"};return{_onMount:m=>{let d=m.domElement;if(!d||typeof d.animate!="function")return;let p=yn(n)?n.get():n;if(p?d.animate(t?[Re(t),Re(p)]:[Re(p)],r):t&&Object.assign(d.style,Re(t)),yn(n)){let b=n.addListener(v=>{d.animate([Re(v)],r)});m.setMetadata("motionRelease",b)}},_onBeforeRemove:(m,d)=>{let p=m.domElement;if(!p||!o||typeof p.animate!="function")return d();p.animate([Re(o)],r).finished.then(d,d)},_onRemove:m=>{let d=m.getMetadata("motionRelease");d==null||d()}}}function dl(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:a(3),listStyleType:"decimal",listStylePosition:"outside"}}}function hl(e,t){if(t<=7)return Array.from({length:t},(r,l)=>l+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let r=o;r<=i;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function fl(e){var c;let{total:t,color:n="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),r={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>a(6+g(u)*2),height:u=>a(6+g(u)*2),paddingInline:u=>a(g(u)*2),borderRadius:u=>a(g(u)*1),border:"none",cursor:"pointer",fontSize:u=>y(u,"inherit"),backgroundColor:"transparent",color:u=>s(u,"shift-9",n),"&:hover:not([disabled])":{backgroundColor:u=>s(u,"shift-2",n)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},l=io(we({},r),{backgroundColor:u=>s(u,"shift-6",o),color:u=>s(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>s(u,"shift-6",o)}});return{role:"navigation",ariaLabel:"Pagination",_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let h={div:m=>{let d=i.get(m),p=[];p.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:r});for(let b of hl(d,t))if(b==="...")p.push({span:"\u2026",ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>a(g(v)*2),color:v=>s(v,"shift-7",n)}});else{let v=b===d;p.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(b),style:v?l:r})}return p.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:r}),p},style:{display:"flex",alignItems:"center",gap:a(1)}};u.children.insert(h)},style:{display:"inline-flex"}}}function pl(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function gl(e){var p;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,i=null,r=f(t),l=f(n),{show:c,hide:u,anchorPartial:h}=te({open:r,placement:l,content:e.content}),m={role:"dialog",dataTone:"shift-11",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),_onInsert:b=>{let v=b.attributes.get("id");i=v||b.nodeId,!v&&b.attributes.set("id",i)}};return(p=e.content).$||(p.$=[]),e.content.$.push(m),$(h,{ariaHaspopup:"dialog",ariaExpanded:b=>r.get(b),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),onClick:()=>{o==="click"&&(r.get()?u():c())},onKeyDown:b=>{b.key==="Escape"&&r.get()&&u()},onFocus:()=>o==="hover"&&c(),onBlur:(b,v)=>{let S=b.relatedTarget,x=v.getRoot().domElement,w=i?x.querySelector(`#${CSS.escape(i)}`):null;S&&(w!=null&&w.contains(S))||u()},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),h}function Jt(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=a(6),bordered:i=!0}=e,r=f(t),l={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=m=>{var d;return(d=l[r.get(m)])!=null?d:l["bottom-end"]},u=m=>m.includes("start")?o:m.includes("end")?"auto":"50%",h=m=>m.includes("end")?o:m.includes("start")?"auto":"50%";return{style:{fontSize:m=>y(m),backgroundColor:m=>s(m),color:m=>s(m,"shift-9",n),position:"relative","&::after":{content:'""',position:"absolute",width:a(1.5),height:a(1.5),backgroundColor:m=>s(m,"inherit",n),borderWidth:i?"1px":"0px",borderColor:m=>s(m,"inherit",n),borderTopStyle:m=>{let d=c(m);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:m=>{let d=c(m);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:m=>{let d=c(m);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:m=>{let d=c(m);return d.includes("right")?0:d.includes("left")?"auto":h(d)},bottom:m=>{let d=c(m);return d.includes("bottom")?0:d.includes("top")?"auto":h(d)},left:m=>{let d=c(m);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:m=>{let d=c(m),p=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${p},${b}) rotate(45deg)`}}}}}function yl(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>a(g(o)*2),paddingInline:o=>a(g(o)*3),borderRadius:o=>a(g(o)*2)}}}function bl(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:a(2),border:0,borderRadius:a(999),overflow:"hidden",backgroundColor:r=>s(r,"shift-3",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>s(r,"shift-3",t.get(r)),borderRadius:a(999)},"&::-webkit-progress-value":{backgroundColor:r=>s(r,"shift-9",n.get(r)),borderRadius:a(999),transition:"width 220ms ease"}}}}var vl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',Sl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function xl(e={}){var l,c;let{max:t=5,readOnly:n=!1,onChange:o}=e,i=(l=e.color)!=null?l:"warning",r=f((c=e.value)!=null?c:0);return{role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:a(.5),fontSize:"1.5rem",cursor:n?"default":"pointer",color:u=>s(u,"shift-8",i)},_onMount:u=>{let h=u.domElement,m=r.get(),d=0,p=()=>{let v=d>0?d:m;Array.from(h.children).forEach((S,x)=>{S.innerHTML=x<v?vl:Sl})};h.innerHTML="";for(let v=1;v<=t;v++){let S=document.createElement("button");if(S.type="button",S.setAttribute("aria-label",`${v} star${v>1?"s":""}`),S.style.cssText="background:none;border:none;padding:0;cursor:inherit;color:inherit;font-size:inherit;display:flex;align-items:center;",!n){let x=v;S.addEventListener("click",()=>{let w=x===m?0:x;m=w,r.set(w),o==null||o(w),d=0,p()}),S.addEventListener("mouseenter",()=>{d=x,p()}),S.addEventListener("mouseleave",()=>{d=0,p()}),S.addEventListener("keydown",w=>{var _;let E=m;if(w.key==="ArrowRight"||w.key==="ArrowUp")E=Math.min(t,m+1),w.preventDefault();else if(w.key==="ArrowLeft"||w.key==="ArrowDown")E=Math.max(0,m-1),w.preventDefault();else return;m=E,r.set(E),o==null||o(E),p();let k=E>0?E-1:0;(_=h.children[k])==null||_.focus()})}h.appendChild(S)}p();let b=r.addListener(v=>{m=v,d===0&&p()});u.addHook("Remove",b)}}}function Cl(e={}){var n;let{color:t="neutral"}=e;return{role:"radiogroup",_context:{segmented:{value:f((n=e.value)!=null?n:"")}},style:{display:"inline-flex",paddingBlock:a(1),paddingInline:a(1),gap:a(.5),borderRadius:a(10),backgroundColor:o=>s(o,"shift-2",t)}}}function wl(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"radio",_onInsert:r=>{var m,d;r.tagName!=="button"&&console.warn('"segmentedItem" patch must use button tag');let l=r.getContext("segmented");if(!l){console.warn('"segmentedItem" patch must be used inside a "segmented"');return}let u=((d=(m=r.parent)==null?void 0:m.children.items)!=null?d:[]).filter(p=>p.type==="ElementNode"&&p.attributes.get("role")==="radio"),h=r.key!==null&&r.key!==void 0?String(r.key):String(u.indexOf(r));r.attributes.set("ariaChecked",p=>l.value.get(p)===h),r.addEvent("click",()=>l.value.set(h))},style:{cursor:"pointer",fontSize:r=>y(r,"inherit"),height:a(6),paddingBlock:a(1),paddingInline:a(3),border:"none",borderRadius:a(10),color:r=>s(r,"shift-9",t.get(r)),backgroundColor:"transparent",transition:"background-color 300ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:r=>s(r,"shift-3",t.get(r))},"&[aria-checked=true]":{backgroundColor:r=>s(r,"shift-0",n.get(r)),color:r=>s(r,"shift-10",n.get(r))},"&:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`,outlineOffset:`-${a(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function El(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>y(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",t)}`,borderRadius:o=>a(g(o)*1),paddingBlock:o=>a(g(o)*1),paddingLeft:o=>a(g(o)*3),paddingRight:o=>a(g(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Nt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${a(2)} center`,backgroundSize:`${a(2.5)} ${a(1.5)}`,"&:not([multiple])":{height:o=>a(6+g(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${a(.5)} solid ${s(o,"shift-5",n)}`},"&:focus-visible":{outline:o=>`${a(.5)} solid ${s(o,"shift-6",n)}`},"& optgroup":{color:o=>s(o,"shift-11",t)},"& option[disabled]":{color:o=>s(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")}}}}function kl(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,l=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(n),content:e.content}),d={onClick:()=>!r&&h()};$(e.content,d);let p={div:v=>{let S=l.get(v),x=Array.isArray(S)?S:[S];return t.filter(E=>x.includes(E.value)).map(E=>({span:E.label,$:[We({color:o,removable:r})],_key:E.value,_onRemove:k=>{let _=l.get(),L=(Array.isArray(_)?_:[_]).filter(z=>z!==E.value);r?l.set(L):l.set(L[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:a(1),flex:1}},b={_onInsert:v=>{v.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(p),onClick:()=>c.get()?h():u(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>a(6+g(v)*2),minWidth:a(32),outlineOffset:"-1px",outline:v=>`1px solid ${s(v,"shift-4","neutral")}`,paddingInline:v=>a(g(v)*2),borderRadius:v=>a(g(v)*1),fontSize:v=>y(v,"inherit"),color:v=>s(v,"shift-9",o),backgroundColor:v=>s(v,"inherit",o)}};return $(m,b),m}function Tl(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag');let l=r.getContext("select");if(l){let c=l.value;r.attributes.set("ariaSelected",u=>{let h=c.get(u);return l.multiple?h.includes(o):h===o}),r.addEvent("click",()=>{let u=c.get();l.multiple?u.includes(o)?c.set(u.filter(h=>h!==o)):c.set(u.concat([o])):u!==o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>y(r,"inherit"),height:r=>a(6+g(r)*2),paddingInline:r=>a(g(r)*3),border:"none",outline:"none",color:r=>s(r,"shift-9",n),backgroundColor:r=>s(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>s(r,"shift-2",n)},"&[aria-selected=true]":{backgroundColor:r=>s(r,"shift-6",t),color:r=>s(r,"shift-11")},"&:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",t)}`,outlineOffset:`-${a(.5)}`}}}}function _l(e={}){var l;let{color:t="neutral",multiple:n=!1}=e,o=f((l=e.value)!=null?l:n?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(m=>({input:null,name:e.name,value:m==null?"":String(m)}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:n}},_onInit:c=>{c.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>a(g(c)*2),paddingInline:c=>a(g(c)*2),fontSize:c=>y(c,"inherit"),backgroundColor:c=>s(c,"inherit",t)}}}function Ol(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=_e(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:r=>y(r),color:r=>s(r,"shift-9",t.get(r)),height:a(6),display:"block",borderRadius:a(1),backgroundColor:r=>s(r,"inherit",t.get(r)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function Pl(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!=="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}var vn={to:{transform:"rotate(360deg)"}},bn=_e(JSON.stringify(vn));function Dl(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>y(o),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:a(6),height:a(6),borderRadius:"50%",border:o=>`${a(.5)} solid ${s(o,"shift-4",t.get(o))}`,borderTopColor:o=>s(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${bn} 0.7s linear infinite`,[`@keyframes ${bn}`]:vn}}}function $l(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:i=90}=e;return{_onSchedule:(r,l)=>{$(l,{_context:{splitter:{direction:t,size:f(n),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function Rl(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal"?"width":"height";n.style[o]=`${t.size.get()}%`,n.style.flexShrink="0",n.style.overflow="auto";let i=t.size.addListener(r=>{n.style[o]=`${r}%`});e.addHook("Remove",i)}}}function Ll(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize",n.setAttribute("aria-orientation",o?"vertical":"horizontal"),n.setAttribute("aria-valuemin",String(t.min)),n.setAttribute("aria-valuemax",String(t.max)),n.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let i=t.size.addListener(u=>{n.setAttribute("aria-valuenow",String(Math.round(u)))}),r=u=>{let h=u.shiftKey?10:1,m=null;o?u.key==="ArrowRight"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowLeft"&&(m=Math.max(t.size.get()-h,t.min)):u.key==="ArrowDown"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowUp"&&(m=Math.max(t.size.get()-h,t.min)),u.key==="Home"?m=t.min:u.key==="End"&&(m=t.max),m!==null&&(u.preventDefault(),t.size.set(m))},l=null,c=u=>{u.preventDefault();let h=n.parentElement,m=p=>{let b=h.getBoundingClientRect(),v=o?(p.clientX-b.left)/b.width*100:(p.clientY-b.top)/b.height*100;t.size.set(Math.min(Math.max(v,t.min),t.max))},d=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),l=null};l=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),l=null},document.addEventListener("mousemove",m),document.addEventListener("mouseup",d)};n.addEventListener("keydown",r),n.addEventListener("mousedown",c),e.addHook("Remove",()=>{l==null||l(),i(),n.removeEventListener("keydown",r),n.removeEventListener("mousedown",c)})},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>s(e,"shift-2"),"&:hover":{backgroundColor:e=>s(e,"shift-3")},"&:focus-visible":{outline:e=>`2px solid ${s(e,"shift-6")}`,outlineOffset:"2px"},"&::after":{content:'""',width:a(1),height:a(1),borderRadius:a(999),backgroundColor:e=>s(e,"shift-4")}}}}function zl(){let e="neutral",t="primary";return{_onInsert:n=>{var c,u;let o=n.getContext("steps");if(!o){console.warn('"stepItem" patch must be used inside a "steps"');return}e=o.color,t=o.accentColor;let l=((u=(c=n.parent)==null?void 0:c.children.items)!=null?u:[]).filter(h=>h.type==="ElementNode").indexOf(n);n.domElement&&(n.domElement.dataset.step=String(l+1)),n.attributes.set("dataStatus",h=>{let m=o.current.get(h);return l<m?"done":l===m?"active":"pending"}),n.attributes.set("ariaCurrent",h=>o.current.get(h)===l?"step":void 0)},style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:a(1),flex:"1",fontSize:n=>y(n,"decrease-1"),textAlign:"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:a(6),height:a(6),borderRadius:a(999),fontSize:n=>y(n,"decrease-1"),fontWeight:"600",flexShrink:"0",border:n=>`2px solid ${s(n,"shift-4",e)}`,backgroundColor:n=>s(n,"inherit"),color:n=>s(n,"shift-8"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"},"&:not(:first-child)::after":{content:'""',position:"absolute",top:a(3),right:`calc(50% + ${a(3)})`,left:`calc(-50% + ${a(3)})`,height:"2px",backgroundColor:n=>s(n,"shift-3",e),zIndex:"0"},"&[data-status=active]::before":{backgroundColor:n=>s(n,"shift-6",t),borderColor:n=>s(n,"shift-6",t),color:n=>s(n,"shift-15",t)},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:n=>s(n,"shift-3",e),borderColor:n=>s(n,"shift-3",e),color:n=>s(n,"shift-9",e)},"&[data-status=done]:not(:first-child)::after":{backgroundColor:n=>s(n,"shift-3",e)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:n=>s(n,"shift-6",t)},"&[data-status=pending]":{color:n=>s(n,"shift-7")},"&[data-status=active]":{color:n=>s(n,"shift-10"),fontWeight:"600"},"&[data-status=done]":{color:n=>s(n,"shift-8")}}}}function Il(e={}){var r,l,c;let t=(r=e.direction)!=null?r:"horizontal",n=(l=e.color)!=null?l:"neutral",o=(c=e.accentColor)!=null?c:"primary";return{_onSchedule:(u,h)=>{var d;let m={_context:{steps:{current:f((d=e.current)!=null?d:0),direction:t,color:n,accentColor:o}}};$(h,m)},style:{display:"flex",flexDirection:t==="vertical"?"column":"row",alignItems:t==="vertical"?"flex-start":"center",gap:a(2),listStyle:"none",margin:"0",padding:"0"}}}function Ml(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>y(o,"inherit"),fontWeight:700,color:o=>s(o,"shift-11",t.get(o)),backgroundColor:o=>s(o)}}}function Al(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>y(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function Vl(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>y(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function Nl(e={}){let{accentColor:t="primary",color:n="neutral"}=e;return{role:"tab",_onInsert:i=>{var h,m;i.tagName!=="button"&&console.warn('"tab" patch must use button tag');let r=i.getContext("tabs");if(!r){console.warn('"tab" patch must be used inside a "tabs"');return}let l=(m=(h=i.parent)==null?void 0:h.children.items)!=null?m:[];l=l.filter(d=>d.type==="ElementNode"&&d.attributes.get("role")==="tab");let c=i.key!==null&&i.key!==void 0?i.key:l.indexOf(i),u={id:`tab${i.parent.nodeId}${c}`,ariaControls:`tabpanel${i.parent.nodeId}${c}`,ariaSelected:d=>r.activeKey.get(d)===c,onClick:()=>r.activeKey.set(c),onKeyDown:d=>{var w,E,k,_;let p=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(p))return;d.preventDefault();let b=((E=(w=i.parent)==null?void 0:w.children.items)!=null?E:[]).filter(O=>O.type==="ElementNode"&&O.attributes.get("role")==="tab");if(!b.length)return;let v=b.indexOf(i),S=v;p==="ArrowRight"?S=(v+1)%b.length:p==="ArrowLeft"?S=(v-1+b.length)%b.length:p==="Home"?S=0:p==="End"&&(S=b.length-1);let x=b[S];r.activeKey.set((k=x.key)!=null?k:S),(_=x.domElement)==null||_.focus()}};i.merge(u)},style:{cursor:"pointer",fontSize:i=>y(i,"inherit"),height:i=>a(6+g(i)*2),paddingInline:i=>a(g(i)*4),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),boxShadow:i=>`inset 0 -${a(.5)} 0 0 ${s(i,"shift-1",n)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${a(.5)} 0 0 ${s(i,"shift-2",n)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${a(.5)} 0 0 ${s(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${a(.5)} 0 0 ${s(i,"shift-6",t)}`}}}}function Bl(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>a(g(o)*3),paddingBlock:o=>a(g(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>a(g(o)*3),paddingBlock:o=>a(g(o)*1),color:o=>s(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${s(o,"shift-3",t.get(o))}`,fontSize:o=>y(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>a(g(o)*3),paddingBlock:o=>a(g(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${s(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>s(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>`${s(o,"shift-2")}!important`}}}}function Hl(){return{role:"tabpanel",style:{paddingBlock:t=>a(g(t)*2),paddingInline:t=>a(g(t)*2)},_onInsert:t=>{var l,c;let n=t.getContext("tabs");if(!n){console.warn('"tabPanel" patch must be used inside a "tabs"');return}let o=(c=(l=t.parent)==null?void 0:l.children.items)!=null?c:[];o=o.filter(u=>u.type==="ElementNode"&&u.attributes.get("role")==="tabpanel");let i=t.key!==null&&t.key!==void 0?t.key:o.indexOf(t),r={id:`tabpanel${t.parent.nodeId}${i}`,ariaLabelledby:`tab${t.parent.nodeId}${i}`,hidden:u=>n.activeKey.get(u)!==i};t.merge(r)}}}function jl(e={}){return{role:"tablist",ariaOrientation:"horizontal",_onSchedule:(n,o)=>{var r;let i={_context:{tabs:{activeKey:f((r=e.activeKey)!=null?r:0)}}};$(o,i)}}}function Fl(e={}){var i,r;let t=f((i=e.color)!=null?i:"neutral","color"),n=f((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:l=>{l.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:l=>{if(o){let c=l.domElement;c.style.overflow="hidden";let u=()=>{c.style.height="auto",c.style.height=`${c.scrollHeight}px`};c.addEventListener("input",u),u(),l.addHook("Remove",()=>c.removeEventListener("input",u))}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:l=>a(g(l)*2),paddingBlock:l=>a(g(l)*1.5),border:"none",borderRadius:l=>a(g(l)*1.5),fontSize:l=>y(l,"inherit"),color:l=>s(l,"shift-9",t.get(l)),outlineOffset:"-1px",outline:l=>`1px solid ${s(l,"shift-4",t.get(l))}`,backgroundColor:l=>s(l,"inherit",t.get(l)),"&::placeholder":{color:l=>s(l,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:l=>`${a(.5)} solid ${s(l,"shift-5",n.get(l))}`},"&:focus-visible":{outline:l=>`${a(.5)} solid ${s(l,"shift-6",n.get(l))}`},"&:invalid":{outline:l=>`${a(.5)} solid ${s(l,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>s(l,"shift-8","neutral"),outline:l=>`1px solid ${s(l,"shift-4","neutral")}`,backgroundColor:l=>s(l,"shift-2","neutral")}}}}function Wl(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Kl(e={}){var r,l,c;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(l=e.accentColor)!=null?l:"primary",i=f((c=e.active)!=null?c:!1);return{style:we({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>a(g(u)*2),paddingBottom:u=>t?"0":a(g(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:"0.25em",transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>s(u,"shift-8",i.get(u)?o:n),opacity:u=>i.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>`-${a(g(u)*4)}`,width:"2px",backgroundColor:u=>s(u,"shift-3",n)}})}}function Ul(e={}){let{position:t="top-center",color:n="neutral"}=e,o=f(!1),i=t.startsWith("top"),r=t.endsWith("center"),l=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:r?"center":l?"end":"start",inset:0,gap:a(4),zIndex:30,padding:a(6),pointerEvents:"none"}};return{_portal:u=>{let h=u.domElement.querySelector(`#domphy-toast-${t}`);return h||(h=u.children.insert(c).domElement),h},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:a(32),pointerEvents:"auto",paddingBlock:u=>a(g(u)*2),paddingInline:u=>a(g(u)*4),borderRadius:u=>a(g(u)*2),fontSize:u=>y(u,"inherit"),color:u=>s(u,"shift-9",n),backgroundColor:u=>s(u,"inherit",n),boxShadow:u=>`0 ${a(2)} ${a(9)} ${s(u,"shift-4","neutral")}`,opacity:u=>Number(o.get(u)),transform:u=>o.get(u)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(u,h)=>{let m=!1,d=null,p=()=>{m||(m=!0,d&&(clearTimeout(d),d=null),u.domElement.removeEventListener("transitionend",b),h())},b=v=>{v.propertyName==="transform"&&p()};u.domElement.addEventListener("transitionend",b),d=setTimeout(p,350),u.addHook("Remove",()=>{var v;d&&(clearTimeout(d),d=null),(v=u.domElement)==null||v.removeEventListener("transitionend",b)}),o.set(!1)}}}function ql(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),n=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:r=>{var m,d;r.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let l=r.getContext("toggleGroup");if(!l){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let u=((d=(m=r.parent)==null?void 0:m.children.items)!=null?d:[]).filter(p=>p.type==="ElementNode"&&p.attributes.get("role")==="button"),h=r.key!==null&&r.key!==void 0?String(r.key):String(u.indexOf(r));r.attributes.set("ariaPressed",p=>{let b=l.value.get(p);return Array.isArray(b)?b.includes(h):b===h}),r.addEvent("click",()=>{let p=l.value.get();if(l.multiple){let b=Array.isArray(p)?[...p]:[];l.value.set(b.includes(h)?b.filter(v=>v!==h):[...b,h])}else l.value.set(p===h?"":h)})},style:{cursor:"pointer",fontSize:r=>y(r,"inherit"),height:a(6),paddingBlock:a(1),paddingInline:a(2),border:"none",borderRadius:a(1),color:r=>s(r,"shift-9",t.get(r)),backgroundColor:r=>s(r,"inherit",t.get(r)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:r=>s(r,"shift-2",t.get(r))},"&[aria-pressed=true]":{backgroundColor:r=>s(r,"shift-3",n.get(r)),color:r=>s(r,"shift-12",n.get(r))},"&:focus-visible":{outline:r=>`${a(.5)} solid ${s(r,"shift-6",n.get(r))}`,outlineOffset:`-${a(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Yl(e={}){var o;let{multiple:t=!1,color:n="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:a(1),paddingInline:a(1),gap:a(1),borderRadius:a(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>s(i,"inherit",n),outline:i=>`1px solid ${s(i,"shift-3",n)}`,outlineOffset:"-1px"}}}function Gl(e={}){var n;let t=(n=e.gap)!=null?n:4;return{style:{display:"flex",alignItems:"center",gap:o=>a(g(o)*t)}}}function Xl(){return{div:null,style:{flex:"1 1 0"}}}function Jl(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content"}=e,i=f(n),r=f(o),l=`domphy-tt-${Math.random().toString(36).slice(2,9)}`,c={span:b=>r.get(b),id:l},{show:u,hide:h,anchorPartial:m}=te({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:b=>a(g(b)*1),paddingInline:b=>a(g(b)*3),borderRadius:b=>a(g(b)*1),color:b=>s(b,"shift-9"),backgroundColor:b=>s(b),fontSize:b=>y(b,"inherit")},$:[Jt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),$(m,{ariaDescribedby:l,onMouseEnter:()=>u(),onMouseLeave:()=>h(),onFocus:()=>u(),onBlur:()=>h(),onKeyDown:b=>b.key==="Escape"&&h()}),m}function Sn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Zl(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,i=new Map,r=new Set,l=new Set;return{_onMount:c=>{c.addHook("Remove",()=>{for(let u of Array.from(i.values()))u();i.clear();for(let u of r)clearTimeout(u);r.clear();for(let u of l)cancelAnimationFrame(u);l.clear()})},_onBeforeUpdate:c=>{o=new Map,c.children.items.forEach((u,h)=>{if(!(u instanceof V))return;let m=u.domElement;m&&o.set(Sn(u,h),m.getBoundingClientRect())})},_onUpdate:c=>{c.children.items.forEach((u,h)=>{var O;if(!(u instanceof V))return;let m=u.domElement;if(!m)return;let d=Sn(u,h),p=o.get(d);if(!p)return;let b=m.getBoundingClientRect(),v=p.left-b.left,S=p.top-b.top;if(Math.abs(v)<.5&&Math.abs(S)<.5)return;(O=i.get(m))==null||O(),m.style.transition="none",m.style.transform=`translate(${v}px, ${S}px)`,m.getBoundingClientRect();let x=requestAnimationFrame(()=>{l.delete(x),m.style.transition=`transform ${t}ms ease ${n}ms`,m.style.transform="translate(0px, 0px)"});l.add(x);let w=!1,E=null,k=()=>{w||(w=!0,E&&(r.delete(E),E=null),i.delete(m),m.removeEventListener("transitionend",_),m.style.transition="",m.style.transform="")},_=L=>{L.propertyName==="transform"&&k()};i.set(m,()=>{w=!0,E&&(clearTimeout(E),r.delete(E),E=null),i.delete(m),m.removeEventListener("transitionend",_)}),m.addEventListener("transitionend",_),E=setTimeout(k,t+n+34),r.add(E)}),o.clear()}}}function Ql(e={}){var n;let t=f((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:a(3),listStyleType:"disc",listStylePosition:"outside"}}}return Vn(ea);})();
6
6
  //# sourceMappingURL=core-theme-ui.global.js.map