@domphy/ui 0.13.0 → 0.15.0

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 _e=Object.defineProperty,No=Object.defineProperties,Vo=Object.getOwnPropertyDescriptor,Ao=Object.getOwnPropertyDescriptors,Do=Object.getOwnPropertyNames,Ct=Object.getOwnPropertySymbols;var wt=Object.prototype.hasOwnProperty,Bo=Object.prototype.propertyIsEnumerable;var xt=(e,t,r)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Et=(e,t)=>{for(var r in t||(t={}))wt.call(t,r)&&xt(e,r,t[r]);if(Ct)for(var r of Ct(t))Bo.call(t,r)&&xt(e,r,t[r]);return e},kt=(e,t)=>No(e,Ao(t));var Te=(e,t)=>{for(var r in t)_e(e,r,{get:t[r],enumerable:!0})},jo=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Do(t))!wt.call(e,i)&&i!==r&&_e(e,i,{get:()=>t[i],enumerable:!(o=Vo(t,i))||o.enumerable});return e};var Ho=e=>jo(_e({},"__esModule",{value:!0}),e);var Ni={};Te(Ni,{core:()=>Pe,theme:()=>Ie,ui:()=>Ue});var Pe={};Te(Pe,{AttributeList:()=>Ht,BooleanAttributes:()=>nt,CamelAttributes:()=>jt,ElementList:()=>Wt,ElementNode:()=>$,HtmlTags:()=>tt,Notifier:()=>be,PrefixCSS:()=>Z,RecordState:()=>rn,State:()=>Xe,SvgTags:()=>Bt,VoidTags:()=>Dt,batch:()=>dn,computed:()=>hn,effect:()=>mn,effectScope:()=>un,hashString:()=>ce,merge:()=>T,r:()=>Xo,runBatched:()=>Rt,toState:()=>f,untrack:()=>fn});var Wo=Object.defineProperty,_t=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Tt=(e,t,r)=>t in e?Wo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ot=(e,t)=>{for(var r in t||(t={}))Fo.call(t,r)&&Tt(e,r,t[r]);if(_t)for(var r of _t(t))Uo.call(t,r)&&Tt(e,r,t[r]);return e},Ko=["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"],qo=Ko.reduce((e,t)=>{let r=t.slice(2).toLowerCase();return e[r]=t,e},{}),tt=["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"],N=[],Go=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},Pt=100,Oe=0,Ge=new Set;function Rt(e){Oe++;try{return e()}finally{if(Oe--,Oe===0){let t=Ge;Ge=new Set;for(let r of t)r._scheduleFlush()}}}var be=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 r=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(r)),r}removeListener(e,t){if(!this._listeners)return;let r=this._listeners[e];r&&r.has(t)&&(r.delete(t),r.size===0&&delete this._listeners[e])}listenerCount(e){var t,r,o;return(o=(r=(t=this._listeners)==null?void 0:t[e])==null?void 0:r.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let r=N.length?N[N.length-1]:null;if(r&&r[0]===this&&r[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=Pt){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${Pt} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...N]})}Oe>0?Ge.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,Go(()=>this._flushAll()))}_isCircular(e){let t=N.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let r=[...N.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
- ${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)N=o,this._flush(t,r);N=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){N.push([this,e]),this._flushing.set(e,t);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),N.pop()}}},It=class{constructor(e){this._releases=new Set;let t=(()=>e());t.onSubscribe=r=>{this._releases.add(r)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear()}get dependencyCount(){return this._releases.size}},ge=[],Ye=0;function ot(){return Ye>0?null:ge.length?ge[ge.length-1]:null}function zt(e,t){ge.push(e);try{return t()}finally{ge.pop()}}function Yo(e){Ye++;try{return e()}finally{Ye--}}var Xe=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new be,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 T(e={},t={}){let r=["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=U(t));for(let n in t){let l=t[n];if(!(l==null||l===""))if(typeof l=="object"&&!Array.isArray(l))typeof e[n]=="object"?e[n]=T(e[n],l):e[n]=l;else if(r.includes(n))if(typeof e[n]=="function"||typeof l=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof l=="function"?l(u):l;return[m,h].filter(d=>d).join(", ")}}else e[n]=[e[n],l].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof l=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof l=="function"?l(u):l;return[m,h].filter(d=>d).join("")}}else e[n]=[e[n],l].filter(c=>c).join("");else if(o.includes(n))if(typeof e[n]=="function"||typeof l=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof l=="function"?l(u):l;return[m,h].filter(d=>d).join(" ")}}else e[n]=[e[n],l].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();Zo(e,c,l)}else if(n.startsWith("_on")){let c=n.replace("_on","");Jo(e,c,l)}else e[n]=l}return e}function ce(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof Xe||e!=null&&e._isState?e:new Xe(e,t)}function Xo(e){return e}function Jo(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function Zo(e,t,r){let o=qo[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,l)=>{i(n,l),r(n,l)}:e[o]=r}function U(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r=Object.getPrototypeOf(e);if(r!==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(U(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,n]of e)o.set(U(i,t),U(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(U(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=U(e[i],t);return o}function Lt(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o==0&&!tt.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")e.$.forEach(l=>Lt(l,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function $t(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function Mt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Nt(e){return Object.keys(e).find(t=>tt.includes(t))}function Vt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Qo(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,l=e.length;n<l;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function Je(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 en(e,t){for(let r=0;r<e.length;r++){let o=e[r],i=null;typeof o.selectorText=="string"?i=Je(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=Je(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function At(e){var t;let r=e.querySelector("#domphy-style");return r||(r=document.createElement("style"),r.id="domphy-style",e.appendChild(r)),r.dataset.domphyBase!=="true"&&((t=r.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),r.dataset.domphyBase="true"),r}var Ze=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>T(t,Ze(r))),delete e.$,T(t,e),t}else return e},Dt=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Bt=["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"],nt=["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"],Z={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"]},jt=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],tn=class{constructor(e,t,r){this._notifier=new be,this._releases=[],this.parent=r,this.isBoolean=nt.includes(e),jt.includes(e)?this.name=e:this.name=Vt(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,r;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 n=this.value;this.value=this.isBoolean?!!e(i):e(i),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,i.onSubscribe=n=>{this._releases.push(n),this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),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=r=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",r)},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 r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${Mt(String(r))}"`}}},Ht=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 tn(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.prototype.hasOwnProperty.call(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(!nt.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 n=(o||"").split(" ").filter(l=>l);return!n.includes(i)&&n.push(e),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,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(r=>r).filter(r=>r!==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))}},on=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if($t(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":$t(this.text)?this.text:Mt(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},Wt=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new $(e,this.owner,this._nextKey++):new on(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof $?e.domElement:e.domText;if(o){let i=r.childNodes[t]||null;o!==i&&r.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof $?e.domElement:e.domText,i=t instanceof $?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,l=i.nextSibling;r.insertBefore(o,l),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,l;let c=this.items.slice(),u=new Map;for(let p of c)p instanceof $&&p.key!==null&&p.key!==void 0&&u.set(p.key,p);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let m=new Set(c),h=new Set;for(let p=0;p<e.length;p++){let b=e[p],v=typeof b=="object"&&b!==null,C=v?b._key:void 0,S=v?Nt(b):void 0;if(C!==void 0){let x=u.get(C);if(x instanceof $&&x.tagName===S){u.delete(C);let w=this.items.indexOf(x);if(w!==p&&w>=0){let k=!!x._portal;this.move(w,p,k?!1:t,!0)}x.parent=this.owner,x.patch(b),h.add(x);continue}}else if(v){let x=this.items[p];if(x instanceof $&&x.key==null&&x.tagName===S&&m.has(x)&&!h.has(x)){x.parent=this.owner,x.patch(b),h.add(x);continue}}h.add(this.insert(b,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)),r||(l=(n=this.owner._hooks)==null?void 0:n.Update)==null||l.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let l=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>l?l:t,u=this._createNode(e);if(this.items.splice(c,0,u),u instanceof $){u._hooks.Insert&&u._hooks.Insert(u);let m=this.owner.domElement;if(r&&m)if(u._portal){let h=u._portal(this.owner.getRoot());h&&u.render(h)}else{let h=u._createDOMNode(),d=(i=m.childNodes[c])!=null?i:null;m.insertBefore(h,d);let p=m.getRootNode(),b=p instanceof ShadowRoot?p:document.head,v=At(b);u.styles.render(v),u._hooks.Mount&&u._hooks.Mount(u),u.children.items.forEach(C=>{if(C instanceof $&&C._portal){let S=C._portal(C.getRoot());S&&C.render(S)}else C.render(h)})}}else{let m=this.owner.domElement;if(r&&m){let h=u._createDOMNode(),d=(n=m.childNodes[c])!=null?n:null;m.insertBefore(h,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),u}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof $){if(e._beforeRemoveFired)return;let i=()=>{let n=e.domElement,l=this.items.indexOf(e);l>=0&&this.items.splice(l,1),t&&n&&n.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,l=()=>{n||(n=!0,i())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,l),e._hooks.BeforeRemove.length<2&&!n&&l()}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!r&&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 r=this.items.slice();for(let o of r)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,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!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),r&&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}},nn=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=Vt(e),this.parentRule=r,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)),Z[this.name]&&Z[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=(()=>{var l;!this.parentRule||(l=this.parentRule.parentNode)!=null&&l._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=l=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{l(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}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),Z[this.name]&&Z[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 Z[this.name]&&Z[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},J=class Qe{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new Ft(this),this.parent=r}_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 Qe;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Qe;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new nn(t,r,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(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}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,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=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),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Ft=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof J;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={};function o(i,n){return i.startsWith("&")?`${n}${i.slice(1)}`:`${n} ${i}`}for(let i in e){let n=e[i],l=Qo(i);for(let c of l){let u=o(c,t);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof n=="object"&&n!=null){let m=new J(c,this.parent);m.styleList.addCSS(n,t),this.items.push(m)}}else if(c.startsWith("@keyframes")){let m=new J(c,this.parent);m.styleList.addCSS(n,""),this.items.push(m)}else if(c.startsWith("@font-face")){let m=new J(c,this.parent);for(let h in n)m.insertStyle(h,n[h]);this.items.push(m)}else if(typeof n=="object"&&n!=null){let m=new J(u,this.parent);this.items.push(m);for(let[h,d]of Object.entries(n))if(typeof d=="object"&&d!=null){let p=o(h,u);h.startsWith("&")?this.addCSS(d,p):m.styleList.insertRule(p).styleList.addCSS(d,p)}else m.insertStyle(h,d)}else r[c]=n}}if(Object.keys(r).length){let i=new J(t,this.parent);for(let n in r)i.insertStyle(n,r[n]);this.items.push(i)}}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(r=>r.selectorText===e);return t||(t=new J(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let r=e.get(Je(t.selectorText));r&&t.mount(r)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,l=e[n];l&&(o.selectorText.startsWith("@")&&l instanceof CSSKeyframesRule||"keyText"in l?o.mount(l):"selectorText"in l?l.selectorText!==r(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}},$=class ae{constructor(t,r=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new Wt(this),this.styles=new Ft(this),this.attributes=new Ht(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,n;t=U(t),Lt(t),t.style=t.style||{},this.parent=r,this.tagName=Nt(t),t=Ze(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let l=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(m,h)=>typeof h=="function"?l:h);this.nodeId=ce(l+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!=null)if(typeof u=="function"){let m=()=>{if(this._disposed)return;let h=u(m);this.children.update(Array.isArray(h)?h:[h])};m.elementNode=this,m.debug=`class:${this.tagName}_${this.nodeId} children`,m.onSubscribe=h=>this.addHook("BeforeRemove",()=>{h(),m=null}),m&&m()}else this.children.update(Array.isArray(u)?u:[u]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=Bt.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 r in this._events)this._bindEvent(r);return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let r=o=>{var i,n;return(n=(i=this._events)==null?void 0:i[t])==null?void 0:n.call(i,o,this)};this.domElement.addEventListener(t,r),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,r),r=null})}_dispose(){var t,r,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(r=(t=this._hooks).BeforeRemove)==null||r.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(n=>n.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){T(this._context,t._context),T(this._metadata,t._metadata);let r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i=="_portal"?this._portal=n:i=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){let r=U(t);r.style=r.style||{},r=Ze(r);let o=r[this.tagName];if(typeof o!="function"){let m=o==null?[]:Array.isArray(o)?o:[o];this.children.update(m,!!this.domElement,!0)}r._context&&T(this._context,r._context),r._metadata&&T(this._metadata,r._metadata);let i=`${this.tagName}_${this.nodeId}`,n=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],l=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"],c=new Set(["class"]),u=null;this._events={};for(let m of Object.keys(r)){if(n.includes(m)||l.includes(m)||m==="_portal")continue;let h=r[m];m.startsWith("on")&&typeof h=="function"?this.addEvent(m.substring(2).toLowerCase(),h):m==="class"&&typeof h=="string"?u=h:(this.attributes.set(m,h),c.add(m))}if(this.attributes.set("class",u?`${i} ${u}`:i),this.attributes.items)for(let m of Object.keys(this.attributes.items))c.has(m)||this.attributes.remove(m);if(this._events)for(let m in this._events)this._bindEvent(m)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];if(typeof o=="function"){let i=((...n)=>{o(...n),r(...n)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,r.length),configurable:!0})}catch(n){}this._hooks[t]=i}else this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof ae&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.prototype.hasOwnProperty.call(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof ae?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(Dt.includes(this.tagName))return`<${this.tagName}${t}>`;let r=this.children.generateHTML();return`<${this.tagName}${t}>${r}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children&&this.children.items.forEach((o,i)=>{let n=t.childNodes[i];n&&(o instanceof ae?o.mount(n):o.domText=n)}),r){let o=r.sheet;o&&this._hydrateStyles(en(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var r;if((r=this.styles)==null||r.hydrate(t),this.children)for(let o of this.children.items)o instanceof ae&&o._hydrateStyles(t)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=At(n)),this.styles.render(o),this.children.items.forEach(l=>{if(l instanceof ae&&l._portal){let c=l._portal(this.getRoot());c&&l.render(c)}else l.render(r)}),r}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var r;(r=this.domElement)==null||r.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let r=!1,o=()=>{r||(r=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!r&&o()}else t()}}},rn=class{constructor(e){this._notifier=new be,this.initialRecord=Ot({},e),this._record=Ot({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let r=ot();r&&this._notifier.addListener(e,r.handler)}return this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e)}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()}},ln=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},se=new Set,et=!1;function Ut(e){se.add(e),!et&&(et=!0,ln(an))}function an(){for(et=!1;se.size>0;){let e=[...se];se.clear();for(let t of e)t()}}var ye=[];function sn(){return ye.length?ye[ye.length-1]:null}function rt(e){let t=sn();t&&t._add(e)}var cn=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){ye.push(this);try{return e()}finally{ye.pop()}}stop(){if(!this._stopped){this._stopped=!0;for(let e of this._disposers)e();this._disposers.clear()}}};function un(){let e=new cn;return rt(()=>e.stop()),e}function mn(e){let t=!1,r=!1,o=()=>{t||n()},i=new It(()=>{t||Ut(o)}),n=()=>{if(!(t||r)){r=!0,i.reset();try{zt(i,e)}finally{r=!1}}},l=()=>{t||(t=!0,i.reset(),se.delete(o))};return rt(l),n(),l}function hn(e){let t="computed",r=new be,o,i=!0,n=!1,l=()=>{i&&r.listenerCount(t)>0&&m()},c=new It(()=>{i||(i=!0,Ut(l))}),u=()=>{c.reset(),o=zt(c,e),i=!1,n=!0},m=()=>{let d=o,p=n;u(),!(p&&o===d)&&r.notify(t,o)},h=d=>{if(d)r.addListener(t,d);else{let p=ot();p&&r.addListener(t,p.handler)}return i&&u(),o};return rt(()=>{c.reset(),se.delete(l),r._dispose()}),{_isState:!0,_notifier:r,get:h}}function dn(e){return Rt(e)}function fn(e){return Yo(e)}var Ie={};Te(Ie,{getTheme:()=>V,setTheme:()=>bn,themeApply:()=>Sn,themeCSS:()=>it,themeColor:()=>a,themeColorToken:()=>ut,themeDensity:()=>g,themeName:()=>Re,themeSize:()=>y,themeSpacing:()=>s,themeTokens:()=>Yt,themeVars:()=>ve});var pn={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:{}},Se=pn,st=e=>JSON.parse(JSON.stringify(e)),qt=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),ue={light:st(Se),dark:vn(Se)};function ct(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function gn(e){for(let t in e)if(!Object.keys(Se).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 Gt(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),Gt(e[o],t[o])):e[o]=t[o]}function yn(e,t){let r={},o=ct(t);for(let n in t){let l=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(u=>r[`--${c}-${u}`]=t.colors[c][u]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else if(n==="custom"&&l&&typeof l=="object")for(let c in l)r[`--custom-${qt(c)}`]=l[c]}let i="";for(let n in r)i+=` ${n}: ${r[n]};
1
+ "use strict";var Domphy=(()=>{var Ke=Object.defineProperty,En=Object.defineProperties,_n=Object.getOwnPropertyDescriptor,Tn=Object.getOwnPropertyDescriptors,On=Object.getOwnPropertyNames,Zt=Object.getOwnPropertySymbols;var eo=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable;var Qt=(e,t,r)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ue=(e,t)=>{for(var r in t||(t={}))eo.call(t,r)&&Qt(e,r,t[r]);if(Zt)for(var r of Zt(t))Pn.call(t,r)&&Qt(e,r,t[r]);return e},to=(e,t)=>En(e,Tn(t));var qe=(e,t)=>{for(var r in t)Ke(e,r,{get:t[r],enumerable:!0})},Dn=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of On(t))!eo.call(e,i)&&i!==r&&Ke(e,i,{get:()=>t[i],enumerable:!(o=_n(t,i))||o.enumerable});return e};var $n=e=>Dn(Ke({},"__esModule",{value:!0}),e);var Ta={};qe(Ta,{core:()=>Xe,theme:()=>Qe,ui:()=>ht});var Xe={};qe(Xe,{AttributeList:()=>wo,BooleanAttributes:()=>Et,CamelAttributes:()=>lo,ElementList:()=>Co,ElementNode:()=>B,HtmlTags:()=>_t,Notifier:()=>Le,PrefixCSS:()=>de,RecordState:()=>tr,State:()=>vt,SvgTags:()=>so,VoidTags:()=>co,batch:()=>Qn,computed:()=>Zn,effect:()=>Jn,effectScope:()=>Xn,flushPendingNotifiers:()=>po,flushSync:()=>qn,hasPendingNotifiers:()=>fo,hashString:()=>Ee,merge:()=>R,r:()=>An,runBatched:()=>ho,toState:()=>f,untrack:()=>er});var Rn=Object.defineProperty,oo=Object.getOwnPropertySymbols,In=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable,no=(e,t,r)=>t in e?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ro=(e,t)=>{for(var r in t||(t={}))In.call(t,r)&&no(e,r,t[r]);if(oo)for(var r of oo(t))Ln.call(t,r)&&no(e,r,t[r]);return e},Et=["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"],lo=["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"]},so=["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"],co=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],zn=["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"],Mn=zn.reduce((e,t)=>{let r=t.slice(2).toLowerCase();return e[r]=t,e},{}),uo=class{constructor(e){this._releases=new Set;let t=(()=>e());t.onSubscribe=r=>{this._releases.add(r)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear()}get dependencyCount(){return this._releases.size}},Re=[],yt=0;function Tt(){return yt>0?null:Re.length?Re[Re.length-1]:null}function mo(e,t){Re.push(e);try{return t()}finally{Re.pop()}}function Nn(e){yt++;try{return e()}finally{yt--}}var Z=[],Vn=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},io=100,Ge=0,bt=new Set,ke=new Set;function ho(e){Ge++;try{return e()}finally{if(Ge--,Ge===0){let t=bt;bt=new Set;for(let r of t)r._scheduleFlush()}}}var Le=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 r=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(r)),r}removeListener(e,t){if(!this._listeners)return;let r=this._listeners[e];r&&r.has(t)&&(r.delete(t),r.size===0&&delete this._listeners[e])}listenerCount(e){var t,r,o;return(o=(r=(t=this._listeners)==null?void 0:t[e])==null?void 0:r.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let r=Z.length?Z[Z.length-1]:null;if(r&&r[0]===this&&r[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=io){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${io} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...Z]})}Ge>0?bt.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,ke.add(this),Vn(()=>this._flushAll()))}_isCircular(e){let t=Z.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let r=[...Z.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
+ ${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,ke.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)Z=o,this._flush(t,r);Z=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){Z.push([this,e]),this._flushing.set(e,t);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),Z.pop()}}};function fo(){return ke.size>0}function po(){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 r of t)r._flushAll()}}var vt=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Le,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=Tt();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 R(e={},t={}){let r=["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 n in t){let a=t[n];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof e[n]=="object"?e[n]=R(e[n],a):e[n]=a;else if(r.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join("")}}else e[n]=[e[n],a].filter(c=>c).join("");else if(o.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join(" ")}}else e[n]=[e[n],a].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();Hn(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");Bn(e,c,a)}else e[n]=a}return e}function Ee(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof vt||e!=null&&e._isState?e:new vt(e,t)}function An(e){return e}function Bn(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function Hn(e,t,r){let o=Mn[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,a)=>{i(n,a),r(n,a)}:e[o]=r}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 r=Object.getPrototypeOf(e);if(r!==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,n]of e)o.set(le(i,t),le(n,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(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=le(e[i],t);return o}function go(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o==0&&!_t.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")e.$.forEach(a=>go(a,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function Ye(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function yo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function bo(e){return Object.keys(e).find(t=>_t.includes(t))}function vo(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function jn(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function St(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 Fn(e,t){for(let r=0;r<e.length;r++){let o=e[r],i=null;typeof o.selectorText=="string"?i=St(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=St(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function So(e){var t;let r=e.querySelector("#domphy-style");return r||(r=document.createElement("style"),r.id="domphy-style",e.appendChild(r)),r.dataset.domphyBase!=="true"&&((t=r.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),r.dataset.domphyBase="true"),r}var wt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>R(t,wt(r))),delete e.$,R(t,e),t}else return e},Wn=class{constructor(e,t,r){this._notifier=new Le,this._releases=[],this.parent=r,this.isBoolean=Et.includes(e),lo.includes(e)?this.name=e:this.name=vo(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,r;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 n=this.value;this.value=this.isBoolean?!!e(i):e(i),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,i.onSubscribe=n=>{this._releases.push(n),this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),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=r=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",r)},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 r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${yo(String(r))}"`}}},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 Wn(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(!Et.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 n=(o||"").split(" ").filter(a=>a);return!n.includes(i)&&n.push(e),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,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(r=>r).filter(r=>r!==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))}},xt=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",Kn=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=vo(e),this.parentRule=r,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(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=a=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{a(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}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}},he=class Ct{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new xo(this),this.parent=r}_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 Ct;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Ct;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new Kn(t,r,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(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}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,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=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),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},xo=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof he;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={};function o(i,n){return i.startsWith("&")?`${n}${i.slice(1)}`:`${n} ${i}`}for(let i in e){let n=e[i],a=jn(i);for(let c of a){let u=o(c,t);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof n=="object"&&n!=null){let m=new he(c,this.parent);m.styleList.addCSS(n,t),this.items.push(m)}}else if(c.startsWith("@keyframes")){let m=new he(c,this.parent);m.styleList.addCSS(n,""),this.items.push(m)}else if(c.startsWith("@font-face")){let m=new he(c,this.parent);for(let h in n)m.insertStyle(h,n[h]);this.items.push(m)}else if(typeof n=="object"&&n!=null){let m=new he(u,this.parent);this.items.push(m);for(let[h,d]of Object.entries(n))if(typeof d=="object"&&d!=null){let p=o(h,u);h.startsWith("&")?this.addCSS(d,p):m.styleList.insertRule(p).styleList.addCSS(d,p)}else m.insertStyle(h,d)}else r[c]=n}}if(Object.keys(r).length){let i=new he(t,this.parent);for(let n in r)i.insertStyle(n,r[n]);this.items.push(i)}}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(r=>r.selectorText===e);return t||(t=new he(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let r=e.get(St(t.selectorText));r&&t.mount(r)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==r(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 Ce{constructor(t,r=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new Co(this),this.styles=new xo(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,n;t=le(t),go(t),t.style=t.style||{},this.parent=r,this.tagName=bo(t),t=wt(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(m,h)=>typeof h=="function"?a:h);this.nodeId=Ee(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!=null)if(typeof u=="function"){let m=()=>{if(this._disposed)return;let h=u(m);this.children.update(Array.isArray(h)?h:[h])};m.elementNode=this,m.debug=`class:${this.tagName}_${this.nodeId} children`,m.onSubscribe=h=>this.addHook("BeforeRemove",()=>{h(),m=null}),m&&m()}else this.children.update(Array.isArray(u)?u:[u]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=so.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 r in this._events)this._bindEvent(r);return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let r=o=>{var i,n;return(n=(i=this._events)==null?void 0:i[t])==null?void 0:n.call(i,o,this)};this.domElement.addEventListener(t,r),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,r),r=null})}_dispose(){var t,r,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(r=(t=this._hooks).BeforeRemove)==null||r.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(n=>n.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){R(this._context,t._context),R(this._metadata,t._metadata);let r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i=="_portal"?this._portal=n:i=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){let r=le(t);r.style=r.style||{},r=wt(r);let o=r[this.tagName];if(typeof o!="function"){let m=o==null?[]:Array.isArray(o)?o:[o];this.children.update(m,!!this.domElement,!0)}r._context&&R(this._context,r._context),r._metadata&&R(this._metadata,r._metadata);let i=`${this.tagName}_${this.nodeId}`,n=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],a=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"],c=new Set(["class"]),u=null;this._events={};for(let m of Object.keys(r)){if(n.includes(m)||a.includes(m)||m==="_portal")continue;let h=r[m];m.startsWith("on")&&typeof h=="function"?this.addEvent(m.substring(2).toLowerCase(),h):m==="class"&&typeof h=="string"?u=h:(this.attributes.set(m,h),c.add(m))}if(this.attributes.set("class",u?`${i} ${u}`:i),this.attributes.items)for(let m of Object.keys(this.attributes.items))c.has(m)||this.attributes.remove(m);if(this._events)for(let m in this._events)this._bindEvent(m)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];if(typeof o=="function"){let i=((...n)=>{o(...n),r(...n)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,r.length),configurable:!0})}catch(n){}this._hooks[t]=i}else this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof Ce&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.hasOwn(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof Ce?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(co.includes(this.tagName))return`<${this.tagName}${t}>`;let r=this.children.generateHTML();return`<${this.tagName}${t}>${r}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(xt&&!r&&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 n=t.childNodes[i];n&&(o instanceof Ce?o.mount(n):o.domText=n)}),r){let o=r.sheet;o&&this._hydrateStyles(Fn(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var r;if((r=this.styles)==null||r.hydrate(t),this.children)for(let o of this.children.items)o instanceof Ce&&o._hydrateStyles(t)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=So(n)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof Ce&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(r)}),r}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var r;(r=this.domElement)==null||r.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let r=!1,o=()=>{r||(r=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!r?o():xt&&!r&&setTimeout(()=>{r||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()}}},ao=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Ye(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}setText(e){var t;let r=e===""?"\u200B":String(e);if(r===this.text&&this.domText)return;let o=Ye(this.text);if(this.text=r,!this.domText)return;if(!o&&!Ye(r)&&this.domText.nodeType===3){this.domText.nodeValue=r;return}let i=this.domText,n=this._createDOMNode();(t=i.parentNode)==null||t.replaceChild(n,i)}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":Ye(this.text)?this.text:yo(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},Co=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 ao(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof B?e.domElement:e.domText;if(o){let i=r.childNodes[t]||null;o!==i&&r.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof B?e.domElement:e.domText,i=t instanceof B?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,a=i.nextSibling;r.insertBefore(o,a),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,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);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let m=new Set(c),h=new Set;for(let p=0;p<e.length;p++){let y=e[p],v=typeof y=="object"&&y!==null,x=v?y._key:void 0,w=v?bo(y):void 0;if(x!==void 0){let C=u.get(x);if(C instanceof B&&C.tagName===w){u.delete(x);let E=this.items.indexOf(C);if(E!==p&&E>=0){let O=!!C._portal;this.move(E,p,O?!1:t,!0)}C.parent=this.owner,C.patch(y),h.add(C);continue}}else if(v){let C=this.items[p];if(C instanceof B&&C.key==null&&C.tagName===w&&m.has(C)&&!h.has(C)){C.parent=this.owner,C.patch(y),h.add(C);continue}}else{let C=this.items[p];if(C instanceof ao&&m.has(C)&&!h.has(C)){C.setText(y==null?"":y),h.add(C);continue}}h.add(this.insert(y,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)),r||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let a=this.items.length,c=typeof t!="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 m=this.owner.domElement;if(r&&m)if(u._portal){let h=u._portal(this.owner.getRoot());h&&u.render(h)}else{let h=u._createDOMNode(),d=(i=m.childNodes[c])!=null?i:null;m.insertBefore(h,d);let p=m.getRootNode(),y=p instanceof ShadowRoot?p:document.head,v=So(y);u.styles.render(v),u._hooks.Mount&&u._hooks.Mount(u),u.children.items.forEach(x=>{if(x instanceof B&&x._portal){let w=x._portal(x.getRoot());w&&x.render(w)}else x.render(h)})}}else{let m=this.owner.domElement;if(r&&m){let h=u._createDOMNode(),d=(n=m.childNodes[c])!=null?n:null;m.insertBefore(h,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),u}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof B){if(e._beforeRemoveFired)return;let i=()=>{let n=e.domElement,a=this.items.indexOf(e);a>=0&&this.items.splice(a,1),t&&n&&n.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,a=()=>{n||(n=!0,i())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,a),e._hooks.BeforeRemove.length<2&&!n?a():xt&&!n&&setTimeout(()=>{n||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()}!r&&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 r=this.items.slice();for(let o of r)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,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!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),r&&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}},Un=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},fe=new Set,kt=!1;function ko(e){fe.add(e),!kt&&(kt=!0,Un(Eo))}function Eo(){for(kt=!1;fe.size>0;){let e=[...fe];fe.clear();for(let t of e)t()}}function qn(){let e=0;for(;fo()||fe.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}po(),Eo()}}var Ie=[];function Yn(){return Ie.length?Ie[Ie.length-1]:null}function Ot(e){let t=Yn();t&&t._add(e)}var Gn=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 Xn(){let e=new Gn;return Ot(()=>e.stop()),e}function Jn(e){let t=!1,r=!1,o=()=>{t||n()},i=new uo(()=>{t||ko(o)}),n=()=>{if(!(t||r)){r=!0,i.reset();try{mo(i,e)}finally{r=!1}}},a=()=>{t||(t=!0,i.reset(),fe.delete(o))};return Ot(a),n(),a}function Zn(e){let t="computed",r=new Le,o,i=!0,n=!1,a=()=>{i&&r.listenerCount(t)>0&&m()},c=new uo(()=>{i||(i=!0,ko(a))}),u=()=>{c.reset(),o=mo(c,e),i=!1,n=!0},m=()=>{let d=o,p=n;u(),!(p&&o===d)&&r.notify(t,o)},h=d=>{if(d)r.addListener(t,d);else{let p=Tt();p&&r.addListener(t,p.handler)}return i&&u(),o};return Ot(()=>{c.reset(),fe.delete(a),r._dispose()}),{_isState:!0,_notifier:r,get:h}}function Qn(e){return ho(e)}function er(e){return Nn(e)}var tr=class{constructor(e){this._notifier=new Le,this.initialRecord=ro({},e),this._record=ro({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let r=Tt();r&&this._notifier.addListener(e,r.handler)}return this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e)}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 Qe={};qe(Qe,{ElementTones:()=>Me,getTheme:()=>Q,setTheme:()=>ir,themeApply:()=>lr,themeCSS:()=>Dt,themeColor:()=>l,themeColorToken:()=>zt,themeDensity:()=>b,themeName:()=>Ze,themeSize:()=>g,themeSpacing:()=>s,themeTokens:()=>Po,themeVars:()=>ze});var or={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=or,It=e=>JSON.parse(JSON.stringify(e)),To=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),_e={light:It(Ne),dark:ar(Ne)},Je=null,Pt=new Map;function Lt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function nr(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 Oo(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),Oo(e[o],t[o])):e[o]=t[o]}function rr(e,t){let r={},o=Lt(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(u=>r[`--${c}-${u}`]=t.colors[c][u]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else if(n==="custom"&&a&&typeof a=="object")for(let c in a)r[`--custom-${To(c)}`]=a[c]}let i="";for(let n in r)i+=` ${n}: ${r[n]};
3
3
  `;return`[data-theme="${e}"] {
4
- ${i}}`}function V(e){if(!ue[e])throw Error(`Theme "${e}" not found`);return ue[e]}function bn(e,t){gn(t),ue[e]||(ue[e]=st(Se)),Gt(ue[e],t)}function vn(e){let t=st(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function Yt(e){let t=V(e),r=ct(t),o={};for(let i in t){let n=t[i];if(i==="colors")for(let l in t.colors){let c={};[...Array(r).keys()].forEach(u=>c[u]=t.colors[l][u]),o[l]=c}else if(i==="fontSizes")o.fontSizes=t.fontSizes;else if(i==="densities")o.densities=t.densities;else if(i==="custom"&&(o.custom={},n&&typeof n=="object"))for(let l in n)o.custom[l]=n[l]}return o}function ve(){let e=V("light"),t=ct(e),r={};for(let o in e){let i=e[o];if(o==="colors")for(let n in e.colors){let l={};[...Array(t).keys()].forEach(c=>l[c]=`var(--${n}-${c})`),r[n]=l}else if(o==="fontSizes")r.fontSizes=[...Array(8).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(r.custom={},i&&typeof i=="object"))for(let n in i)r.custom[n]=`var(--custom-${qt(n)})`}return r}function it(){return Object.entries(ue).map(([e,t])=>yn(e,t)).join(`
5
- `)}function Sn(e){var t;if(typeof document!="undefined")if(e){e.textContent=it();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=it(),document.head.appendChild(e)}function s(e){return e/4+"em"}function Re(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var lt=["inherit"];[...Array(8).keys()].forEach(e=>{lt.push(`decrease-${e}`),lt.push(`increase-${e}`)});function Xt(e,t="inherit"){if(!lt.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function Cn(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 r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Xt(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function y(e,t="inherit"){let r=Xt(Cn(e),t);return ve().fontSizes[r]}var at=["inherit"];[...Array(5).keys()].forEach(e=>{at.push(`decrease-${e}`),at.push(`increase-${e}`)});function xn(e,t="inherit"){if(!at.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function wn(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 r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=xn(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function g(e){let t=wn(e);return V(e?Re(e):"light").densities[t]}var K=Se.colors.neutral.length,$e=["inherit","base"];[...Array(K).keys()].forEach(e=>{$e.push(`decrease-${e}`),$e.push(`increase-${e}`),$e.push(`shift-${e}`)});function Kt(e,t){if(e<0||e>K-1)return e;let r=e+t;return r=Math.max(0,Math.min(K-1,r)),r}function En(e,t){if(e<0||e>K-1)return e;let r=Math.floor((K-1)/2),o=e<=r?e+t:e-t;return o=Math.max(0,Math.min(K-1,o)),o}function Ce(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!$e.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return Kt(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return Kt(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return En(e,r)}else return e}function Jt(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 r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=Ce(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Zt(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===K-1?K-1-r:e}function a(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return t=="base"?ve()[o][V("light").baseTones[o]]:ve()[o][Ce(0,t)];let i=Re(e),n;if(t=="base")n=V(i).baseTones[o];else{let c=V(i),u=Zt(Jt(e),c.direction,c.darkBias);n=Ce(u,t)}let l=ve()[o];if(!l)throw Error(`color "${o}" not found on theme "${i}"`);return l[n]}function ut(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r,i=e?Re(e):"light",n=Yt(i);if(!e)return t=="base"?n[o][V("light").baseTones[o]]:n[o][Ce(0,t)];let l;if(t=="base")l=V(i).baseTones[o];else{let c=V(i),u=Zt(Jt(e),c.direction,c.darkBias);l=Ce(u,t)}return n[o][l]}var Ue={};Te(Ue,{abbreviation:()=>kn,alert:()=>Nn,avatar:()=>Vn,badge:()=>An,blockquote:()=>Pr,breadcrumb:()=>Dn,breadcrumbEllipsis:()=>Bn,button:()=>$r,buttonSwitch:()=>hi,card:()=>_n,code:()=>Ir,combobox:()=>Or,command:()=>$n,commandItem:()=>In,commandSearch:()=>Rn,descriptionList:()=>Lr,details:()=>zr,dialog:()=>Mr,divider:()=>wi,drawer:()=>ki,emphasis:()=>Nr,figure:()=>Vr,formGroup:()=>Ar,heading:()=>Br,horizontalRule:()=>jr,icon:()=>Wr,image:()=>Hr,inputCheckbox:()=>Rr,inputColor:()=>Fr,inputDateTime:()=>Ur,inputFile:()=>Kr,inputNumber:()=>Xr,inputOTP:()=>Mn,inputRadio:()=>ri,inputRange:()=>Yr,inputSearch:()=>qr,inputSwitch:()=>mi,inputText:()=>Gr,keyboard:()=>Jr,label:()=>Zr,link:()=>Qr,mark:()=>ei,menu:()=>zi,menuItem:()=>Li,motion:()=>Mi,orderedList:()=>Si,pagination:()=>xi,paragraph:()=>ti,popover:()=>_i,popoverArrow:()=>bt,preformated:()=>oi,progress:()=>ni,select:()=>ii,selectBox:()=>ui,selectItem:()=>ci,selectList:()=>si,skeleton:()=>li,small:()=>di,spinner:()=>ai,splitter:()=>Tn,splitterHandle:()=>Pn,splitterPanel:()=>On,strong:()=>fi,subscript:()=>pi,superscript:()=>gi,tab:()=>Ri,tabPanel:()=>Ii,table:()=>yi,tabs:()=>$i,tag:()=>xe,textarea:()=>bi,toast:()=>Ti,toggle:()=>zn,toggleGroup:()=>Ln,tooltip:()=>Oi,transitionGroup:()=>Pi,unorderedList:()=>vi});function kn(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>y(n),backgroundColor:n=>a(n),color:n=>a(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>a(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>a(n,"shift-11",r.get(n)),textDecorationColor:n=>a(n,"shift-9",r.get(n))}}}}function _n(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(g(o)*2),backgroundColor:o=>a(o,"inherit",t.get(o)),color:o=>a(o,"shift-10",t.get(o)),outline:o=>`1px solid ${a(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=>s(g(o)*2),paddingInline:o=>s(g(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(g(o)*4),color:o=>a(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(g(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(g(o)*4),color:o=>a(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),borderTop:o=>`1px solid ${a(o,"shift-3",t.get(o))}`}}}}function Tn(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,l)=>{T(l,{_context:{splitter:{direction:t,size:f(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function On(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function Pn(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let l=r.parentElement,c=m=>{let h=l.getBoundingClientRect(),d=o?(m.clientX-h.left)/h.width*100:(m.clientY-h.top)/h.height*100;t.size.set(Math.min(Math.max(d,t.min),t.max))},u=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>a(e,"shift-2"),"&:hover":{backgroundColor:e=>a(e,"shift-3")},"&::after":{content:'""',borderRadius:s(999),backgroundColor:e=>a(e,"shift-4")}}}}function $n(){return{_onSchedule:(e,t)=>{T(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Rn(e={}){let{color:t="neutral",accentColor:r="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 n=o.domElement,l=()=>i.query.set(n.value);n.addEventListener("input",l),o.addHook("Remove",()=>n.removeEventListener("input",l))},style:{fontFamily:"inherit",fontSize:o=>y(o,"inherit"),paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*2),border:"none",borderBottom:o=>`1px solid ${a(o,"shift-3",t)}`,outline:"none",color:o=>a(o,"shift-10",t),backgroundColor:o=>a(o,"inherit",t),"&::placeholder":{color:o=>a(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>a(o,"shift-6",r)}}}}function In(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var u,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,l=(m=(u=n.textContent)==null?void 0:u.toLowerCase())!=null?m:"",c=i.query.addListener(h=>{n.hidden=h.length>0&&!l.includes(h.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>y(o,"inherit"),height:o=>s(6+g(o)*2),paddingInline:o=>s(g(o)*3),border:"none",outline:"none",color:o=>a(o,"shift-9",t),backgroundColor:o=>a(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>a(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${a(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}function zn(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var h,d;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let l=n.getContext("toggleGroup");if(!l){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let u=((d=(h=n.parent)==null?void 0:h.children.items)!=null?d:[]).filter(p=>p.type==="ElementNode"&&p.attributes.get("role")==="button"),m=n.key!==null&&n.key!==void 0?String(n.key):String(u.findIndex(p=>p===n));n.attributes.set("ariaPressed",p=>{let b=l.value.get(p);return Array.isArray(b)?b.includes(m):b===m}),n.addEvent("click",()=>{let p=l.value.get();if(l.multiple){let b=Array.isArray(p)?[...p]:[];l.value.set(b.includes(m)?b.filter(v=>v!==m):[...b,m])}else l.value.set(p===m?"":m)})},style:{cursor:"pointer",fontSize:n=>y(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>a(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>a(n,"shift-3",r.get(n)),color:n=>a(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ln(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>a(i,"inherit",r),outline:i=>`1px solid ${a(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function Mn(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=l=>{let c=r(),u=l.target,m=c.indexOf(u);u.value&&m<c.length-1&&c[m+1].focus()},i=l=>{let c=r(),u=l.target,m=c.indexOf(u);l.key==="Backspace"&&!u.value&&m>0&&c[m-1].focus(),l.key==="ArrowLeft"&&m>0&&c[m-1].focus(),l.key==="ArrowRight"&&m<c.length-1&&c[m+1].focus()},n=l=>{var d,p,b;l.preventDefault();let c=(p=(d=l.clipboardData)==null?void 0:d.getData("text"))!=null?p:"",u=r(),m=u.indexOf(l.target);[...c].forEach((v,C)=>{u[m+C]&&(u[m+C].value=v)});let h=Math.min(m+c.length-1,u.length-1);(b=u[h])==null||b.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function Nn(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${a(o,"shift-8",t.get(o))}`,backgroundColor:o=>a(o,"inherit",t.get(o)),color:o=>a(o,"shift-10",t.get(o)),fontSize:o=>y(o,"inherit")}}}function Vn(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>y(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>a(o,"inherit",t.get(o)),color:o=>a(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function An(e={}){var i;let{label:t=999}=e,r=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>y(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>a(n,"shift-9",o.get(n)),color:n=>a(n,"shift-0",o.get(n))}}}}function Dn(e={}){var o;let{separator:t="/"}=e,r=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:s(1),color:i=>a(i,"shift-9",r.get(i)),backgroundColor:i=>a(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>a(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>a(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>a(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function Bn(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(1),border:"none",background:"none",cursor:"pointer",color:o=>a(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${a(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}var jn='<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 xe(e={}){var o;let{removable:t=!1}=e,r=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:jn,onClick:l=>{l.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:l=>a(l,"shift-4",r.get(l))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>a(i,"inherit",r.get(i)),color:i=>a(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${a(i,"shift-4",r.get(i))}`}}}var Hn=Object.defineProperty,Wn=Object.defineProperties,Fn=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,co=Object.prototype.hasOwnProperty,uo=Object.prototype.propertyIsEnumerable,Qt=(e,t,r)=>t in e?Hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,I=(e,t)=>{for(var r in t||(t={}))co.call(t,r)&&Qt(e,r,t[r]);if(Le)for(var r of Le(t))uo.call(t,r)&&Qt(e,r,t[r]);return e},te=(e,t)=>Wn(e,Fn(t)),mo=(e,t)=>{var r={};for(var o in e)co.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Le)for(var o of Le(e))t.indexOf(o)<0&&uo.call(e,o)&&(r[o]=e[o]);return r},re=(e,t,r)=>new Promise((o,i)=>{var n=u=>{try{c(r.next(u))}catch(m){i(m)}},l=u=>{try{c(r.throw(u))}catch(m){i(m)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(n,l);c((r=r.apply(e,t)).next())}),Un=["top","right","bottom","left"],eo=["start","end"],Wl=Un.reduce((e,t)=>e.concat(t,`${t}-${eo[0]}`,`${t}-${eo[1]}`),[]),Me=Math.min,ee=Math.max,Ne=Math.round,ze=Math.floor,A=e=>({x:e,y:e}),Kn={left:"right",right:"left",bottom:"top",top:"bottom"};function to(e,t,r){return ee(e,Me(t,r))}function De(e,t){return typeof e=="function"?e(t):e}function oe(e){return e.split("-")[0]}function Be(e){return e.split("-")[1]}function ho(e){return e==="x"?"y":"x"}function fo(e){return e==="y"?"height":"width"}function q(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function po(e){return ho(q(e))}function qn(e,t,r=!1){let o=Be(e),i=po(e),n=fo(i),l=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(l=Ve(l)),[l,Ve(l)]}function Gn(e){let t=Ve(e);return[dt(e),t,dt(t)]}function dt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var oo=["left","right"],no=["right","left"],Yn=["top","bottom"],Xn=["bottom","top"];function Jn(e,t,r){switch(e){case"top":case"bottom":return r?t?no:oo:t?oo:no;case"left":case"right":return t?Yn:Xn;default:return[]}}function Zn(e,t,r,o){let i=Be(e),n=Jn(oe(e),r==="start",o);return i&&(n=n.map(l=>`${l}-${i}`),t&&(n=n.concat(n.map(dt)))),n}function Ve(e){let t=oe(e);return Kn[t]+e.slice(t.length)}function Qn(e){return I({top:0,right:0,bottom:0,left:0},e)}function er(e){return typeof e!="number"?Qn(e):{top:e,right:e,bottom:e,left:e}}function Ae(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function ro({reference:e,floating:t},r,o){let i=q(r),n=po(r),l=fo(n),c=oe(r),u=i==="y",m=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,d=e[l]/2-t[l]/2,p;switch(c){case"top":p={x:m,y:e.y-t.height};break;case"bottom":p={x:m,y:e.y+e.height};break;case"right":p={x:e.x+e.width,y:h};break;case"left":p={x:e.x-t.width,y:h};break;default:p={x:e.x,y:e.y}}switch(Be(r)){case"start":p[n]-=d*(o&&u?-1:1);break;case"end":p[n]+=d*(o&&u?-1:1);break;default:}return p}function tr(e){return re(this,arguments,function*(t,r={}){var o,i,n,l,c,u;let{x:m,y:h,platform:d,rects:p,elements:b,strategy:v}=t,{boundary:C="clippingAncestors",rootBoundary:S="viewport",elementContext:x="floating",altBoundary:w=!1,padding:k=0}=De(r,t),E=er(k),_=b[w?x==="floating"?"reference":"floating":x],P=Ae(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,_))==null||i?_:_.contextElement||(yield(n=d.getDocumentElement)==null?void 0:n.call(d,b.floating)),boundary:C,rootBoundary:S,strategy:v})),O=x==="floating"?{x:m,y:h,width:p.floating.width,height:p.floating.height}:p.reference,ie=yield(l=d.getOffsetParent)==null?void 0:l.call(d,b.floating),M=(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},B=Ae(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:b,rect:O,offsetParent:ie,strategy:v}):O);return{top:(P.top-B.top+E.top)/M.y,bottom:(B.bottom-P.bottom+E.bottom)/M.y,left:(P.left-B.left+E.left)/M.x,right:(B.right-P.right+E.right)/M.x}})}var or=50,nr=(e,t,r)=>re(null,null,function*(){var o;let{placement:i="bottom",strategy:n="absolute",middleware:l=[],platform:c}=r,u=c.detectOverflow?c:te(I({},c),{detectOverflow:tr}),m=yield(o=c.isRTL)==null?void 0:o.call(c,t),h=yield c.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:p}=ro(h,i,m),b=i,v=0,C={};for(let S=0;S<l.length;S++){let x=l[S];if(!x)continue;let{name:w,fn:k}=x,{x:E,y:_,data:P,reset:O}=yield k({x:d,y:p,initialPlacement:i,placement:b,strategy:n,middlewareData:C,rects:h,platform:u,elements:{reference:e,floating:t}});d=E!=null?E:d,p=_!=null?_:p,C[w]=I(I({},C[w]),P),O&&v<or&&(v++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(h=O.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:n}):O.rects),{x:d,y:p}=ro(h,b,m)),S=-1)}return{x:d,y:p,placement:b,strategy:n,middlewareData:C}});var rr=(e={})=>({name:"flip",options:e,fn(t){return re(this,null,function*(){var r,o,i,n,l,c;let{placement:u,middlewareData:m,rects:h,initialPlacement:d,platform:p,elements:b}=t,v=De(e,t),{mainAxis:C=!0,crossAxis:S=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:E=!0}=v,_=mo(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=m.arrow)!=null&&r.alignmentOffset)return{};let P=oe(u),O=q(d),ie=oe(d)===d,M=yield(o=p.isRTL)==null?void 0:o.call(p,b.floating),B=x||(ie||!E?[Ve(d)]:Gn(d)),St=k!=="none";!x&&St&&B.push(...Zn(d,E,k,M));let Lo=[d,...B],Ke=yield p.detectOverflow(t,_),ke=[],le=((i=m.flip)==null?void 0:i.overflows)||[];if(C&&ke.push(Ke[P]),S){let X=qn(u,h,M);ke.push(Ke[X[0]],Ke[X[1]])}if(le=[...le,{placement:u,overflows:ke}],!ke.every(X=>X<=0)){let X=(((n=m.flip)==null?void 0:n.index)||0)+1,qe=Lo[X];if(qe&&(!(S==="alignment"&&O!==q(qe))||le.every(j=>q(j.placement)===O?j.overflows[0]>0:!0)))return{data:{index:X,overflows:le},reset:{placement:qe}};let pe=(l=le.filter(j=>j.overflows[0]<=0).sort((j,W)=>j.overflows[1]-W.overflows[1])[0])==null?void 0:l.placement;if(!pe)switch(w){case"bestFit":{let j=(c=le.filter(W=>{if(St){let F=q(W.placement);return F===O||F==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(F=>F>0).reduce((F,Mo)=>F+Mo,0)]).sort((W,F)=>W[1]-F[1])[0])==null?void 0:c[0];j&&(pe=j);break}case"initialPlacement":pe=d;break;default:}if(u!==pe)return{reset:{placement:pe}}}return{}})}});var ir=new Set(["left","top"]);function lr(e,t){return re(this,null,function*(){var r;let{placement:o,platform:i,elements:n}=e,l=yield(r=i.isRTL)==null?void 0:r.call(i,n.floating),c=oe(o),u=Be(o),m=q(o)==="y",h=ir.has(c)?-1:1,d=l&&m?-1:1,p=De(t,e),{mainAxis:b,crossAxis:v,alignmentAxis:C}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof C=="number"&&(v=u==="end"?C*-1:C),m?{x:v*d,y:b*h}:{x:b*h,y:v*d}})}var ar=(e=0)=>({name:"offset",options:e,fn(t){return re(this,null,function*(){var r,o;let{x:i,y:n,placement:l,middlewareData:c}=t,u=yield lr(t,e);return l===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:n+u.y,data:te(I({},u),{placement:l})}})}}),sr=(e={})=>({name:"shift",options:e,fn(t){return re(this,null,function*(){let{x:r,y:o,placement:i,platform:n}=t,l=De(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:m={fn:({x:w,y:k})=>({x:w,y:k})}}=l,h=mo(l,["mainAxis","crossAxis","limiter"]),d={x:r,y:o},p=yield n.detectOverflow(t,h),b=q(oe(i)),v=ho(b),C=d[v],S=d[b];if(c){let w=v==="y"?"top":"left",k=v==="y"?"bottom":"right",E=C+p[w],_=C-p[k];C=to(E,C,_)}if(u){let w=b==="y"?"top":"left",k=b==="y"?"bottom":"right",E=S+p[w],_=S-p[k];S=to(E,S,_)}let x=m.fn(te(I({},t),{[v]:C,[b]:S}));return te(I({},x),{data:{x:x.x-r,y:x.y-o,enabled:{[v]:c,[b]:u}}})})}});function je(){return typeof window!="undefined"}function de(e){return go(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function D(e){var t;return(t=(go(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function go(e){return je()?e instanceof Node||e instanceof R(e).Node:!1}function z(e){return je()?e instanceof Element||e instanceof R(e).Element:!1}function H(e){return je()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function io(e){return!je()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function Ee(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=L(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function cr(e){return/^(table|td|th)$/.test(de(e))}function He(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var ur=/transform|translate|scale|rotate|perspective|filter/,mr=/paint|layout|strict|content/,Q=e=>!!e&&e!=="none",mt;function pt(e){let t=z(e)?L(e):e;return Q(t.transform)||Q(t.translate)||Q(t.scale)||Q(t.rotate)||Q(t.perspective)||!gt()&&(Q(t.backdropFilter)||Q(t.filter))||ur.test(t.willChange||"")||mr.test(t.contain||"")}function hr(e){let t=G(e);for(;H(t)&&!he(t);){if(pt(t))return t;if(He(t))return null;t=G(t)}return null}function gt(){return mt==null&&(mt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),mt}function he(e){return/^(html|body|#document)$/.test(de(e))}function L(e){return R(e).getComputedStyle(e)}function We(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if(de(e)==="html")return e;let t=e.assignedSlot||e.parentNode||io(e)&&e.host||D(e);return io(t)?t.host:t}function yo(e){let t=G(e);return he(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&Ee(t)?t:yo(t)}function we(e,t=[],r=!0){var o;let i=yo(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),l=R(i);if(n){let c=ft(l);return t.concat(l,l.visualViewport||[],Ee(i)?i:[],c&&r?we(c):[])}else return t.concat(i,we(i,[],r))}function ft(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bo(e){let t=L(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=H(e),n=i?e.offsetWidth:r,l=i?e.offsetHeight:o,c=Ne(r)!==n||Ne(o)!==l;return c&&(r=n,o=l),{width:r,height:o,$:c}}function yt(e){return z(e)?e:e.contextElement}function me(e){let t=yt(e);if(!H(t))return A(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=bo(t),l=(n?Ne(r.width):r.width)/o,c=(n?Ne(r.height):r.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}var dr=A(0);function vo(e){let t=R(e);return!gt()||!t.visualViewport?dr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fr(e,t=!1,r){return!r||t&&r!==R(e)?!1:t}function ne(e,t=!1,r=!1,o){let i=e.getBoundingClientRect(),n=yt(e),l=A(1);t&&(o?z(o)&&(l=me(o)):l=me(e));let c=fr(n,r,o)?vo(n):A(0),u=(i.left+c.x)/l.x,m=(i.top+c.y)/l.y,h=i.width/l.x,d=i.height/l.y;if(n){let p=R(n),b=o&&z(o)?R(o):o,v=p,C=ft(v);for(;C&&o&&b!==v;){let S=me(C),x=C.getBoundingClientRect(),w=L(C),k=x.left+(C.clientLeft+parseFloat(w.paddingLeft))*S.x,E=x.top+(C.clientTop+parseFloat(w.paddingTop))*S.y;u*=S.x,m*=S.y,h*=S.x,d*=S.y,u+=k,m+=E,v=R(C),C=ft(v)}}return Ae({width:h,height:d,x:u,y:m})}function Fe(e,t){let r=We(e).scrollLeft;return t?t.left+r:ne(D(e)).left+r}function So(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Fe(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function pr({elements:e,rect:t,offsetParent:r,strategy:o}){let i=o==="fixed",n=D(r),l=e?He(e.floating):!1;if(r===n||l&&i)return t;let c={scrollLeft:0,scrollTop:0},u=A(1),m=A(0),h=H(r);if((h||!h&&!i)&&((de(r)!=="body"||Ee(n))&&(c=We(r)),h)){let p=ne(r);u=me(r),m.x=p.x+r.clientLeft,m.y=p.y+r.clientTop}let d=n&&!h&&!i?So(n,c):A(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+m.x+d.x,y:t.y*u.y-c.scrollTop*u.y+m.y+d.y}}function gr(e){return Array.from(e.getClientRects())}function yr(e){let t=D(e),r=We(e),o=e.ownerDocument.body,i=ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),l=-r.scrollLeft+Fe(e),c=-r.scrollTop;return L(o).direction==="rtl"&&(l+=ee(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:l,y:c}}var lo=25;function br(e,t){let r=R(e),o=D(e),i=r.visualViewport,n=o.clientWidth,l=o.clientHeight,c=0,u=0;if(i){n=i.width,l=i.height;let h=gt();(!h||h&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let m=Fe(o);if(m<=0){let h=o.ownerDocument,d=h.body,p=getComputedStyle(d),b=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=lo&&(n-=v)}else m<=lo&&(n+=m);return{width:n,height:l,x:c,y:u}}function vr(e,t){let r=ne(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=H(e)?me(e):A(1),l=e.clientWidth*n.x,c=e.clientHeight*n.y,u=i*n.x,m=o*n.y;return{width:l,height:c,x:u,y:m}}function ao(e,t,r){let o;if(t==="viewport")o=br(e,r);else if(t==="document")o=yr(D(e));else if(z(t))o=vr(t,r);else{let i=vo(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ae(o)}function Co(e,t){let r=G(e);return r===t||!z(r)||he(r)?!1:L(r).position==="fixed"||Co(r,t)}function Sr(e,t){let r=t.get(e);if(r)return r;let o=we(e,[],!1).filter(c=>z(c)&&de(c)!=="body"),i=null,n=L(e).position==="fixed",l=n?G(e):e;for(;z(l)&&!he(l);){let c=L(l),u=pt(l);!u&&c.position==="fixed"&&(i=null),(n?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Ee(l)&&!u&&Co(e,l))?o=o.filter(m=>m!==l):i=c,l=G(l)}return t.set(e,o),o}function Cr({element:e,boundary:t,rootBoundary:r,strategy:o}){let i=[...t==="clippingAncestors"?He(e)?[]:Sr(e,this._c):[].concat(t),r],n=ao(e,i[0],o),l=n.top,c=n.right,u=n.bottom,m=n.left;for(let h=1;h<i.length;h++){let d=ao(e,i[h],o);l=ee(d.top,l),c=Me(d.right,c),u=Me(d.bottom,u),m=ee(d.left,m)}return{width:c-m,height:u-l,x:m,y:l}}function xr(e){let{width:t,height:r}=bo(e);return{width:t,height:r}}function wr(e,t,r){let o=H(t),i=D(t),n=r==="fixed",l=ne(e,!0,n,t),c={scrollLeft:0,scrollTop:0},u=A(0);function m(){u.x=Fe(i)}if(o||!o&&!n)if((de(t)!=="body"||Ee(i))&&(c=We(t)),o){let b=ne(t,!0,n,t);u.x=b.x+t.clientLeft,u.y=b.y+t.clientTop}else i&&m();n&&!o&&i&&m();let h=i&&!o&&!n?So(i,c):A(0),d=l.left+c.scrollLeft-u.x-h.x,p=l.top+c.scrollTop-u.y-h.y;return{x:d,y:p,width:l.width,height:l.height}}function ht(e){return L(e).position==="static"}function so(e,t){if(!H(e)||L(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return D(e)===r&&(r=r.ownerDocument.body),r}function xo(e,t){let r=R(e);if(He(e))return r;if(!H(e)){let i=G(e);for(;i&&!he(i);){if(z(i)&&!ht(i))return i;i=G(i)}return r}let o=so(e,t);for(;o&&cr(o)&&ht(o);)o=so(o,t);return o&&he(o)&&ht(o)&&!pt(o)?r:o||hr(e)||r}var Er=function(e){return re(this,null,function*(){let t=this.getOffsetParent||xo,r=this.getDimensions,o=yield r(e.floating);return{reference:wr(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function kr(e){return L(e).direction==="rtl"}var _r={convertOffsetParentRelativeRectToViewportRelativeRect:pr,getDocumentElement:D,getClippingRect:Cr,getOffsetParent:xo,getElementRects:Er,getClientRects:gr,getDimensions:xr,getScale:me,isElement:z,isRTL:kr};function wo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tr(e,t){let r=null,o,i=D(e);function n(){clearTimeout(o),r==null||r.disconnect(),r=null}function l(c=!1,u=1){n();let m=e.getBoundingClientRect(),{left:h,top:d,width:p,height:b}=m;if(c||t(),!p||!b)return;let v=ze(d),C=ze(i.clientWidth-(h+p)),S=ze(i.clientHeight-(d+b)),x=ze(h),w={rootMargin:`${-v}px ${-C}px ${-S}px ${-x}px`,threshold:ee(0,Me(1,u))||1},k=!0;function E(_){let P=_[0].intersectionRatio;if(P!==u){if(!k)return l();P?l(!1,P):o=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!wo(m,e.getBoundingClientRect())&&l(),k=!1}try{r=new IntersectionObserver(E,te(I({},w),{root:i.ownerDocument}))}catch(_){r=new IntersectionObserver(E,w)}r.observe(e)}return l(!0),n}function Eo(e,t,r,o={}){let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,m=yt(e),h=i||n?[...m?we(m):[],...t?we(t):[]]:[];h.forEach(x=>{i&&x.addEventListener("scroll",r,{passive:!0}),n&&x.addEventListener("resize",r)});let d=m&&c?Tr(m,r):null,p=-1,b=null;l&&(b=new ResizeObserver(([x])=>{x&&x.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{b==null||b.observe(t)})),r()}),m&&!u&&b.observe(m),t&&b.observe(t));let v,C=u?ne(e):null;u&&S();function S(){let x=ne(e);C&&!wo(C,x)&&r(),C=x,v=requestAnimationFrame(S)}return r(),()=>{h.forEach(x=>{i&&x.removeEventListener("scroll",r),n&&x.removeEventListener("resize",r)}),d==null||d(),b==null||b.disconnect(),b=null,u&&cancelAnimationFrame(v)}}var ko=ar;var _o=sr,To=rr;var Oo=(e,t,r)=>{let o=new Map,i=I({platform:_r},r),n=te(I({},i.platform),{_c:o});return nr(e,t,te(I({},i),{platform:n}))};function Y(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,l=null,c=null,u=null,m=!1,h=f(t),d=()=>{m||!u||(m=!0,c=u.children.insert(e.content))},p=()=>{d(),n&&l&&(i&&i(),i=Eo(n,l,()=>{Oo(n,l,{placement:r.get(),middleware:[ko(12),To(),_o()],strategy:"fixed"}).then(({x:w,y:k,placement:E})=>{Object.assign(l.style,{left:`${w}px`,top:`${k}px`}),r.set(E)})}),h.set(!0))},b=()=>{i&&i(),i=null,h.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(p,100)},C=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},S={style:{position:"fixed",pointerEvents:"auto",visibility:w=>h.get(w)?"visible":"hidden"},_onMount:w=>l=w.domElement,_portal:w=>{let k=w.domElement.querySelector("#domphy-floating");if(!k){let E={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};k=w.children.insert(E).domElement}return k}};return T(e.content,S),{show:v,hide:C,anchorPartial:{onKeyDown:w=>w.key==="Escape"&&C(),_onMount:w=>{u=w.getRoot(),n=w.domElement;let k=E=>{if(!h.get()||!n||!l)return;let _=E.target;!n.contains(_)&&!l.contains(_)&&C()};w.getRoot().domElement.addEventListener("click",k),w.addHook("BeforeRemove",()=>{o&&clearTimeout(o),i&&(i(),i=null),c&&c.remove(),w.getRoot().domElement.removeEventListener("click",k)})}}}}function Or(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,l=f(e.value),c=f(i),{show:u,hide:m,anchorPartial:h}=Y({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&m()};T(e.content,d);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:S=>y(S,"inherit"),color:S=>a(S,"shift-9",o),backgroundColor:S=>a(S,"inherit",o)},b;e.input?(T(e.input,{onFocus:()=>u(),style:p,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>u(),value:S=>(l.get(S),""),style:p,_key:"combobox-input"};let v={div:S=>{let x=l.get(S),w=Array.isArray(x)?x:[x],E=t.filter(_=>w.includes(_.value)).map(_=>({span:_.label,$:[xe({color:o,removable:!0})],_key:_.value,_onRemove:P=>{let O=l.get(),M=(Array.isArray(O)?O:[O]).filter(B=>B!==_.value);n?l.set(M):l.set(M[0])}}));return E.push(b),E},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},C={_onInsert:S=>{S.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:S=>`1px solid ${a(S,"shift-4","neutral")}`,paddingBlock:S=>s(g(S)*1),paddingInline:S=>s(g(S)*1),borderRadius:S=>s(g(S)*1),fontSize:S=>y(S,"inherit"),color:S=>a(S,"shift-9",o),backgroundColor:S=>a(S,"inherit",o)}};return T(h,C),h}function bt(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=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=h=>{var d;return(d=l[n.get(h)])!=null?d:l["bottom-end"]},u=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",m=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>y(h),backgroundColor:h=>a(h),color:h=>a(h,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:h=>a(h,"inherit",r),borderWidth:i?"1px":"0px",borderColor:h=>a(h,"inherit",r),borderTopStyle:h=>{let d=c(h);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:h=>{let d=c(h);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:h=>{let d=c(h);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:h=>{let d=c(h);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:h=>{let d=c(h);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:h=>{let d=c(h);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:h=>{let d=c(h),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 Pr(e={}){var r;let t=f((r=e.color)!=null?r:"inherit","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=>a(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${a(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),margin:0}}}function $r(e={}){var r;let t=f((r=e.color)!=null?r:"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=>s(g(o)*1),paddingInline:o=>s(g(o)*3),borderRadius:o=>s(g(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(g(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${a(o,"shift-4",t.get(o))}`,color:o=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${a(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>a(o,"shift-2","neutral"),outline:o=>`1px solid ${a(o,"shift-4","neutral")}`,color:o=>a(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Rr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>y(n,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>a(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${a(n,"shift-6",r.get(n))}`,backgroundColor:n=>a(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>a(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${a(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${a(n,"shift-6",r.get(n))}`,backgroundColor:n=>a(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>a(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>a(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>a(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Ir(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}function zr(e={}){var i,n;let{duration:t=240}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"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=>a(l,"shift-9",r.get(l)),backgroundColor:l=>a(l,"inherit",r.get(l)),overflow:"hidden","& > summary":{backgroundColor:l=>a(l,"shift-2",r.get(l)),color:l=>a(l,"shift-10",r.get(l)),fontSize:l=>y(l,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:l=>s(g(l)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:l=>`${s(.5)} solid ${a(l,"shift-9",r.get(l))}`,borderBottom:l=>`${s(.5)} solid ${a(l,"shift-9",r.get(l))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:l=>a(l,"shift-3",r.get(l))},"& > summary:focus-visible":{borderRadius:l=>s(g(l)*2),outlineOffset:`-${s(.5)}`,outline:l=>`${s(.5)} solid ${a(l,"shift-6",o.get(l))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:l=>s(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:s(250),opacity:1,paddingTop:l=>s(g(l)*1),paddingBottom:l=>s(g(l)*3)}}}}function Lr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>y(o,"inherit"),color:o=>a(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>y(o,"inherit"),color:o=>a(o,"shift-9",t.get(o))}}}}function Mr(e={}){let{color:t="neutral",open:r=!1}=e,o=f(r);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let l=n.domElement.getBoundingClientRect();i.clientX>=l.left&&i.clientX<=l.right&&i.clientY>=l.top&&i.clientY<=l.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let l=n.domElement;l.style.opacity==="0"&&(l.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,l=u=>{u?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let m=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):n.style.opacity="0"};l(o.get());let c=o.addListener(l);i.addHook("Remove",()=>{c(),document.body.style.overflow=""})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>y(i,"inherit"),color:i=>a(i,"shift-10",t),backgroundColor:i=>a(i,"inherit",t),border:"none",padding:i=>s(g(i)*3),boxShadow:i=>`0 ${s(9)} ${s(16)} ${a(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>a(i,"shift-2","neutral"),opacity:.75}}}}function Nr(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-10",t.get(o))}}}function Vr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>a(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>y(o,"decrease-1"),color:o=>a(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Ar(e={}){var i;let{layout:t="horizontal"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*3),border:"none",borderRadius:n=>s(g(n)*2),fontSize:n=>y(n,"inherit"),backgroundColor:n=>a(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>y(n,"inherit"),fontWeight:600,paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*2),color:n=>a(n,"shift-9",r.get(n)),backgroundColor:n=>a(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(g(n)*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(${s(2)} * -1)`,fontSize:n=>y(n,"decrease-1"),color:n=>a(n,"shift-9",r.get(n))}}}}var Dr={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Br(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=Dr[o.elementNode.tagName]||"inherit";return y(o,i)}}}}function jr(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(3),marginBottom:s(3),backgroundColor:o=>a(o,"shift-4",t.get(o))}}}function Hr(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(2),backgroundColor:o=>a(o,"inherit",t.get(o))}}}function Wr(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(4),height:s(4),flexShrink:"0",fontSize:o=>y(o),backgroundColor:"transparent",color:o=>a(o,"shift-9",t.get(o))}}}function Fr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),l.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>y(n,"inherit"),paddingBlock:n=>s(g(n)*1),paddingInline:n=>s(g(n)*1),blockSize:n=>s(6+g(n)*2),inlineSize:n=>s(6+g(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>s(g(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`}}}}function Ur(e={}){var i,n;let{mode:t="datetime-local"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"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=>a(l,"shift-9",r.get(l)),backgroundColor:l=>a(l,"inherit",r.get(l)),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${a(l,"shift-4",r.get(l))}`,borderRadius:l=>s(g(l)*1),paddingInline:l=>s(g(l)*3),height:l=>s(6+g(l)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:l=>`${s(.5)} solid ${a(l,"shift-6",o.get(l))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>a(l,"shift-8","neutral"),backgroundColor:l=>a(l,"shift-2","neutral"),outline:l=>`1px solid ${a(l,"shift-4","neutral")}`},"&:invalid":{outline:l=>`${s(.5)} solid ${a(l,"shift-6","error")}`}}}}function Kr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),l.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>y(n,"inherit"),lineHeight:"inherit",color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,borderRadius:n=>s(g(n)*1),height:n=>s(6+g(n)*2),paddingInline:n=>s(g(n)*1),"&::-webkit-file-upload-button":{marginTop:n=>s(g(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>a(n,"shift-11",t.get(n)),backgroundColor:n=>a(n,"shift-1",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`,backgroundColor:n=>a(n,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>a(n,"shift-8","neutral"),backgroundColor:n=>a(n,"shift-3","neutral")}}}}function qr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),l.type="search"},style:{fontFamily:"inherit",fontSize:n=>y(n,"inherit"),lineHeight:"inherit",color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,borderRadius:n=>s(g(n)*1),minWidth:s(32),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*1),"&::placeholder":{color:n=>a(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral"),backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`}}}}function Gr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),l.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*1),fontSize:n=>y(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),"&::placeholder":{color:n=>a(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>a(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`,color:n=>a(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${a(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${a(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${a(n,"shift-6","warning")}`}}}}function Yr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>a(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:n=>a(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>a(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Xr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),l.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(g(n)*3),paddingInlineEnd:n=>s(g(n)*1.5),paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*1),fontSize:n=>y(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`,color:n=>a(n,"shift-8","neutral")}}}}function Jr(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${a(o,"shift-4",t.get(o))}`}}}function Zr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>y(n,"inherit"),color:n=>a(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>a(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral")}}}}function Qr(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>y(n,"inherit"),backgroundColor:n=>a(n),color:n=>a(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>a(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>a(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral")}}}}function ei(e={}){var r;let t=f((r=e.accentColor)!=null?r:"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=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function ti(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function oi(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*3),borderRadius:o=>s(g(o)*2)}}}function ni(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:n=>a(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>a(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>a(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}function ri(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>y(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(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:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>a(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${a(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>a(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>a(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>a(n,"shift-4","neutral"),pointerEvents:"none"}}}}function ii(e={}){let{color:t="neutral",accentColor:r="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=>a(o,"shift-9",t),backgroundColor:o=>a(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${a(o,"shift-4",t)}`,borderRadius:o=>s(g(o)*1),paddingBlock:o=>s(g(o)*1),paddingLeft:o=>s(g(o)*3),paddingRight:o=>s(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="${ut(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 ${s(2)} center`,backgroundSize:`${s(2.5)} ${s(1.5)}`,"&:not([multiple])":{height:o=>s(6+g(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${a(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${a(o,"shift-6",r)}`},"& optgroup":{color:o=>a(o,"shift-11",t)},"& option[disabled]":{color:o=>a(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>a(o,"shift-8","neutral"),outline:o=>`1px solid ${a(o,"shift-4","neutral")}`,backgroundColor:o=>a(o,"shift-2","neutral")}}}}function li(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=ce(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>y(n),color:n=>a(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>a(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}var $o={to:{transform:"rotate(360deg)"}},Po=ce(JSON.stringify($o));function ai(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o),color:o=>a(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${a(o,"shift-4",t.get(o))}`,borderTopColor:o=>a(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${Po} 0.7s linear infinite`,[`@keyframes ${Po}`]:$o}}}function si(e={}){var l;let{color:t="neutral",multiple:r=!1}=e,o=f((l=e.value)!=null?l:r?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(h=>({input:null,name:e.name,value:h||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_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=>s(g(c)*2),paddingInline:c=>s(g(c)*2),fontSize:c=>y(c,"inherit"),backgroundColor:c=>a(c,"inherit",t)}}}function ci(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let l=n.getContext("select");if(l){let c=l.value;n.attributes.set("ariaSelected",u=>{let m=c.get(u);return l.multiple?m.includes(o):m==o}),n.addEvent("click",()=>{let u=c.get();l.multiple?u.includes(o)?c.set(u.filter(m=>m!==o)):c.set(u.concat([o])):u!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>y(n,"inherit"),height:n=>s(6+g(n)*2),paddingInline:n=>s(g(n)*3),border:"none",outline:"none",color:n=>a(n,"shift-9",r),backgroundColor:n=>a(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>a(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>a(n,"shift-6",t),color:n=>a(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function ui(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,l=f(e.value),c=f(i),{show:u,hide:m,anchorPartial:h}=Y({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&m()};T(e.content,d);let p={div:v=>{let C=l.get(v),S=Array.isArray(C)?C:[C];return t.filter(w=>S.includes(w.value)).map(w=>({span:w.label,$:[xe({color:o,removable:n})],_key:w.value,_onRemove:k=>{let E=l.get(),P=(Array.isArray(E)?E:[E]).filter(O=>O!==w.value);n?l.set(P):l.set(P[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(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()?m():u(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+g(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${a(v,"shift-4","neutral")}`,paddingInline:v=>s(g(v)*2),borderRadius:v=>s(g(v)*1),fontSize:v=>y(v,"inherit"),color:v=>a(v,"shift-9",o),backgroundColor:v=>a(v,"inherit",o)}};return T(h,b),h}function mi(e={}){var r;let t=f((r=e.accentColor)!=null?r:"primary","accentColor");return{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:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>a(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>a(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>y(o,"inherit"),lineHeight:1,backgroundColor:o=>a(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function hi(e={}){var n,l;let{checked:t=!1}=e,r=f(t),o=f((n=e.color)!=null?n:"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=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>y(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${a(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>a(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>a(c,"shift-9"),backgroundColor:c=>a(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>a(c,"increase-3",i.get(c)),outline:"none",color:c=>a(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function di(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o))}}}function fi(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-11",t.get(o)),backgroundColor:o=>a(o)}}}function pi(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o))}}}function gi(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o))}}}function yi(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>a(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${a(o,"shift-3",t.get(o))}`,fontSize:o=>y(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${a(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>a(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>a(o,"shift-2")+"!important"}}}}function bi(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=f((n=e.accentColor)!=null?n:"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()}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:l=>s(g(l)*2),paddingBlock:l=>s(g(l)*1.5),border:"none",borderRadius:l=>s(g(l)*1.5),fontSize:l=>y(l,"inherit"),color:l=>a(l,"shift-9",t.get(l)),outlineOffset:"-1px",outline:l=>`1px solid ${a(l,"shift-4",t.get(l))}`,backgroundColor:l=>a(l,"inherit",t.get(l)),"&::placeholder":{color:l=>a(l,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:l=>`${s(.5)} solid ${a(l,"shift-5",r.get(l))}`},"&:focus-visible":{outline:l=>`${s(.5)} solid ${a(l,"shift-6",r.get(l))}`},"&:invalid":{outline:l=>`${s(.5)} solid ${a(l,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>a(l,"shift-8","neutral"),outline:l=>`1px solid ${a(l,"shift-4","neutral")}`,backgroundColor:l=>a(l,"shift-2","neutral")}}}}function vi(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o),color:o=>a(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function Si(e={}){var r;let t=f((r=e.color)!=null?r:"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=>a(o),color:o=>a(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Ci(e,t){if(t<=7)return Array.from({length:t},(n,l)=>l+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function xi(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>s(6+g(u)*2),height:u=>s(6+g(u)*2),paddingInline:u=>s(g(u)*2),borderRadius:u=>s(g(u)*1),border:"none",cursor:"pointer",fontSize:u=>y(u,"inherit"),backgroundColor:"transparent",color:u=>a(u,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:u=>a(u,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},l=kt(Et({},n),{backgroundColor:u=>a(u,"shift-6",o),color:u=>a(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>a(u,"shift-6",o)}});return{_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let m={div:h=>{let d=i.get(h),p=[];p.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let b of Ci(d,t))if(b==="...")p.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(g(v)*2),color:v=>a(v,"shift-7",r)}});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:n})}return p.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),p},style:{display:"flex",alignItems:"center",gap:s(1)}};u.children.insert(m)},style:{display:"inline-flex"}}}function wi(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(2),fontSize:o=>y(o,"inherit"),backgroundColor:o=>a(o),color:o=>a(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>a(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>a(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Ro={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Ei={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},vt=e=>e==="left"||e==="right";function ki(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=f(r),l=vt(o)?s(80):s(64),c=i!=null?i:l;return{_onInsert:u=>{u.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(u,m)=>{u.target===m.domElement&&n.set(!1)},onTransitionEnd:(u,m)=>{let h=m.domElement;n.get()||(h.close(),document.body.style.overflow="")},_onMount:u=>{let m=u.domElement,h=p=>{p?(m.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{m.style.transform="translate(0, 0)"})):m.style.transform=Ro[o]};h(n.get());let d=n.addListener(h);u.addHook("Remove",()=>{d(),document.body.style.overflow=""})},style:{transform:Ro[o],transition:"transform 0.25s ease",fontSize:u=>y(u,"inherit"),color:u=>a(u,"shift-10",t),backgroundColor:u=>a(u,"inherit",t),border:"none",padding:u=>s(g(u)*3),margin:Ei[o],width:vt(o)?c:"100dvw",height:vt(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:u=>`0 ${s(4)} ${s(12)} ${a(u,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:u=>a(u,"shift-2","neutral"),opacity:.75}}}}function _i(e){var p;let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=f(t),l=f(r),{show:c,hide:u,anchorPartial:m}=Y({open:n,placement:l,content:e.content}),h={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(h),T(m,{ariaHaspopup:"dialog",ariaExpanded:b=>n.get(b),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),onClick:()=>{o==="click"&&(n.get()?u():c())},onFocus:()=>c(),onBlur:(b,v)=>{let C=b.relatedTarget,S=v.getRoot().domElement,x=i?S.querySelector(`#${CSS.escape(i)}`):null;C&&(x!=null&&x.contains(C))||u()},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),m}function Ti(e={}){let{position:t="top-center",color:r="neutral"}=e,o=f(!1),i=t.startsWith("top"),n=t.endsWith("center"),l=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":l?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:u=>{let m=u.domElement.querySelector(`#domphy-toast-${t}`);return m||(m=u.children.insert(c).domElement),m},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:u=>s(g(u)*2),paddingInline:u=>s(g(u)*4),borderRadius:u=>s(g(u)*2),fontSize:u=>y(u,"inherit"),color:u=>a(u,"shift-9",r),backgroundColor:u=>a(u,"inherit",r),boxShadow:u=>`0 ${s(2)} ${s(9)} ${a(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,m)=>{let h=d=>{d.propertyName==="transform"&&(u.domElement.removeEventListener("transitionend",h),m())};u.domElement.addEventListener("transitionend",h),o.set(!1)}}}function Oi(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=f(r),n=f(o),l=null,c={span:b=>n.get(b)},{show:u,hide:m,anchorPartial:h}=Y({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:b=>{let v=b.attributes.get("id");l=v||b.nodeId,!v&&b.attributes.set("id",l)},style:{paddingBlock:b=>s(g(b)*1),paddingInline:b=>s(g(b)*3),borderRadius:b=>s(g(b)*1),color:b=>a(b,"shift-9"),backgroundColor:b=>a(b),fontSize:b=>y(b,"inherit")},$:[bt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),T(h,{onMouseEnter:()=>u(),onMouseLeave:()=>m(),onFocus:()=>u(),onBlur:()=>m(),onKeyDown:b=>b.key==="Escape"&&m(),_onMount:b=>l&&b.attributes.set("ariaDescribedby",l)}),h}function Io(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Pi(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,l)=>{if(!(n instanceof $))return;let c=n.domElement;c&&o.set(Io(n,l),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,l)=>{if(!(n instanceof $))return;let c=n.domElement;if(!c)return;let u=Io(n,l),m=o.get(u);if(!m)return;let h=c.getBoundingClientRect(),d=m.left-h.left,p=m.top-h.top;if(Math.abs(d)<.5&&Math.abs(p)<.5)return;let b=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${d}px, ${p}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let C=()=>{c.style.transition=b,c.style.transform=v,c.removeEventListener("transitionend",S)},S=x=>{x.propertyName==="transform"&&C()};c.addEventListener("transitionend",S),setTimeout(C,t+r+34)}),o.clear()}}}function $i(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:f(e.activeKey||0)}}};T(o,i)}}}function Ri(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var m,h;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let l=(h=(m=i.parent)==null?void 0:m.children.items)!=null?h:[];l=l.filter(d=>d.type=="ElementNode"&&d.attributes.get("role")=="tab");let c=i.key!==null&&i.key!==void 0?i.key:l.findIndex(d=>d==i),u={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:d=>n.activeKey.get(d)==c,onClick:()=>n.activeKey.set(c),onKeyDown:d=>{var x,w,k,E;let p=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(p))return;d.preventDefault();let b=((w=(x=i.parent)==null?void 0:x.children.items)!=null?w:[]).filter(_=>_.type==="ElementNode"&&_.attributes.get("role")==="tab"),v=b.findIndex(_=>_===i),C=v;p==="ArrowRight"?C=(v+1)%b.length:p==="ArrowLeft"?C=(v-1+b.length)%b.length:p==="Home"?C=0:p==="End"&&(C=b.length-1);let S=b[C];n.activeKey.set((k=S.key)!=null?k:C),(E=S.domElement)==null||E.focus()}};i.merge(u)},style:{cursor:"pointer",fontSize:i=>y(i,"inherit"),height:i=>s(6+g(i)*2),paddingInline:i=>s(g(i)*4),border:"none",outline:"none",color:i=>a(i,"shift-9"),backgroundColor:i=>a(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-6",t)}`}}}}function Ii(){return{role:"tabpanel",style:{paddingBlock:t=>s(g(t)*2),paddingInline:t=>s(g(t)*2)},_onInsert:t=>{var l,c;let r=t.getContext("tabs");if(!r){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.findIndex(u=>u==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:u=>r.activeKey.get(u)!=i};t.merge(n)}}}function zi(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let l={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:r}}};T(n,l)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>s(g(i)*2),paddingInline:i=>s(g(i)*2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>a(i,"inherit",t)}}}function Li(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var u,m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu");if(!n){console.warn('"menuItem" patch must be used inside a "menu"');return}let l=(m=(u=i.parent)==null?void 0:u.children.items)!=null?m:[];l=l.filter(h=>h.type=="ElementNode"&&h.attributes.get("role")=="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:l.findIndex(h=>h==i);n.selectable&&(i.attributes.set("ariaCurrent",h=>n.activeKey.get(h)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var h,d,p,b;let l=i.key;if(l==="Enter"||l===" "){i.preventDefault(),(h=n.domElement)==null||h.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(l))return;i.preventDefault();let c=((p=(d=n.parent)==null?void 0:d.children.items)!=null?p:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem"),u=c.findIndex(v=>v===n),m=u;l==="ArrowDown"?m=(u+1)%c.length:l==="ArrowUp"?m=(u-1+c.length)%c.length:l==="Home"?m=0:l==="End"&&(m=c.length-1),(b=c[m].domElement)==null||b.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>s(2),width:"100%",fontSize:i=>y(i,"inherit"),height:i=>s(6+g(i)*2),paddingInline:i=>s(g(i)*3),border:"none",outline:"none",color:i=>a(i,"shift-9"),backgroundColor:i=>a(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>a(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>a(i,"shift-3",t),color:i=>a(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${a(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}var zo=e=>!!e&&typeof e.get=="function"&&e._isState===!0,fe=e=>{let t={},r=[];for(let o in e){let i=e[o];o==="x"?r.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?r.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?r.push(`scale(${i})`):o==="rotate"?r.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return r.length&&(t.transform=r.join(" ")),t};function Mi(e={}){var l,c,u,m;let{initial:t,animate:r,exit:o,transition:i={}}=e,n={duration:(l=i.duration)!=null?l:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(m=i.iterations)!=null?m:1,fill:"both"};return{_onMount:h=>{let d=h.domElement;if(!d||typeof d.animate!="function")return;let p=zo(r)?r.get():r;if(p?d.animate(t?[fe(t),fe(p)]:[fe(p)],n):t&&Object.assign(d.style,fe(t)),zo(r)){let b=r.addListener(v=>{d.animate([fe(v)],n)});h.setMetadata("motionRelease",b)}},_onBeforeRemove:(h,d)=>{let p=h.domElement;if(!p||!o||typeof p.animate!="function")return d();p.animate([fe(o)],n).finished.then(d,d)},_onRemove:h=>{let d=h.getMetadata("motionRelease");d==null||d()}}}return Ho(Ni);})();
4
+ ${i}}`}function Q(e){if(!_e[e])throw Error(`Theme "${e}" not found`);return _e[e]}function ir(e,t){nr(t),_e[e]||(_e[e]=It(Ne)),Oo(_e[e],t),Je=null,Pt.clear()}function ar(e){let t=It(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function Po(e){let t=Pt.get(e);if(t)return t;let r=Q(e),o=Lt(r),i={};for(let n in r){let a=r[n];if(n==="colors")for(let c in r.colors){let u={};[...Array(o).keys()].forEach(m=>u[m]=r.colors[c][m]),i[c]=u}else if(n==="fontSizes")i.fontSizes=r.fontSizes;else if(n==="densities")i.densities=r.densities;else if(n==="custom"&&(i.custom={},a&&typeof a=="object"))for(let c in a)i.custom[c]=a[c]}return Pt.set(e,i),i}function ze(){if(Je)return Je;let e=Q("light"),t=Lt(e),r={};for(let o in e){let i=e[o];if(o==="colors")for(let n in e.colors){let a={};[...Array(t).keys()].forEach(c=>a[c]=`var(--${n}-${c})`),r[n]=a}else if(o==="fontSizes")r.fontSizes=[...Array(8).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(r.custom={},i&&typeof i=="object"))for(let n in i)r.custom[n]=`var(--custom-${To(n)})`}return Je=r,r}function Dt(){return Object.entries(_e).map(([e,t])=>rr(e,t)).join(`
5
+ `)}function lr(e){var t;if(typeof document!="undefined")if(e){e.textContent=Dt();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Dt(),document.head.appendChild(e)}function s(e){return e/4+"em"}function Ze(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var $t=["inherit"];[...Array(5).keys()].forEach(e=>{$t.push(`decrease-${e}`),$t.push(`increase-${e}`)});function sr(e,t="inherit"){if(!$t.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function cr(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 r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=sr(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function b(e){let t=cr(e);return Q(e?Ze(e):"light").densities[t]}var Rt=["inherit"];[...Array(8).keys()].forEach(e=>{Rt.push(`decrease-${e}`),Rt.push(`increase-${e}`)});function Do(e,t="inherit"){if(!Rt.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function ur(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 r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Do(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function g(e,t="inherit"){let r=Do(ur(e),t);return ze().fontSizes[r]}var se=Ne.colors.neutral.length,Me=["inherit","base"];[...Array(se).keys()].forEach(e=>{Me.push(`decrease-${e}`),Me.push(`increase-${e}`),Me.push(`shift-${e}`)});function _o(e,t){if(e<0||e>se-1)return e;let r=e+t;return r=Math.max(0,Math.min(se-1,r)),r}function mr(e,t){if(e<0||e>se-1)return e;let r=Math.floor((se-1)/2),o=e<=r?e+t:e-t;return o=Math.max(0,Math.min(se-1,o)),o}function Ve(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!Me.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return _o(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return _o(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return mr(e,r)}else return e}function $o(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 r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=Ve(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Ro(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===se-1?se-1-r:e}function l(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return t=="base"?ze()[o][Q("light").baseTones[o]]:ze()[o][Ve(0,t)];let i=Ze(e),n;if(t=="base")n=Q(i).baseTones[o];else{let c=Q(i),u=Ro($o(e),c.direction,c.darkBias);n=Ve(u,t)}let a=ze()[o];if(!a)throw Error(`color "${o}" not found on theme "${i}"`);return a[n]}function zt(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r,i=e?Ze(e):"light",n=Po(i);if(!e)return t=="base"?n[o][Q("light").baseTones[o]]:n[o][Ve(0,t)];let a;if(t=="base")a=Q(i).baseTones[o];else{let c=Q(i),u=Ro($o(e),c.direction,c.darkBias);a=Ve(u,t)}return n[o][a]}var ht={};qe(ht,{abbreviation:()=>hr,alert:()=>dr,avatar:()=>fr,badge:()=>pr,blockquote:()=>gr,breadcrumb:()=>yr,breadcrumbEllipsis:()=>br,button:()=>vr,buttonSwitch:()=>Sr,card:()=>wr,code:()=>xr,combobox:()=>ui,command:()=>mi,commandItem:()=>di,commandSearch:()=>hi,datePicker:()=>pi,descriptionList:()=>bi,details:()=>vi,dialog:()=>Si,divider:()=>wi,drawer:()=>Ci,emphasis:()=>ki,figure:()=>Ei,formGroup:()=>_i,heading:()=>Oi,horizontalRule:()=>Pi,icon:()=>Di,image:()=>$i,inputCheckbox:()=>Ri,inputColor:()=>Ii,inputDateTime:()=>Li,inputFile:()=>zi,inputNumber:()=>Mi,inputOTP:()=>Ni,inputRadio:()=>Vi,inputRange:()=>Ai,inputSearch:()=>Bi,inputSwitch:()=>Hi,inputText:()=>ji,keyboard:()=>Fi,label:()=>Wi,link:()=>Ki,mark:()=>Ui,menu:()=>qi,menuItem:()=>Yi,motion:()=>Gi,orderedList:()=>Xi,pagination:()=>Zi,paragraph:()=>Qi,popover:()=>ea,popoverArrow:()=>qt,preformated:()=>ta,progress:()=>oa,select:()=>na,selectBox:()=>ra,selectItem:()=>ia,selectList:()=>aa,skeleton:()=>la,small:()=>sa,spinner:()=>ca,splitter:()=>ua,splitterHandle:()=>ha,splitterPanel:()=>ma,strong:()=>da,subscript:()=>fa,superscript:()=>pa,tab:()=>ga,tabPanel:()=>ba,table:()=>ya,tabs:()=>va,tag:()=>He,textarea:()=>Sa,toast:()=>wa,toggle:()=>xa,toggleGroup:()=>Ca,tooltip:()=>ka,transitionGroup:()=>Ea,unorderedList:()=>_a});function hr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>g(n),backgroundColor:n=>l(n),color:n=>l(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>l(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>l(n,"shift-11",r.get(n)),textDecorationColor:n=>l(n,"shift-9",r.get(n))}}}}function dr(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(b(o)*2),paddingInline:o=>s(b(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>g(o,"inherit")}}}function fr(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>g(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function pr(e={}){var i;let{label:t=999}=e,r=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>g(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function gr(e={}){var r;let t=f((r=e.color)!=null?r:"inherit","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(b(o)*2),paddingInline:o=>s(b(o)*4),margin:0}}}function yr(e={}){var o;let{separator:t="/"}=e,r=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=>g(i,"inherit"),gap:s(1),color:i=>l(i,"shift-9",r.get(i)),backgroundColor:i=>l(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function br(e={}){var r;let t=f((r=e.color)!=null?r:"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=>g(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}function vr(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>g(o,"inherit"),paddingBlock:o=>s(b(o)*1),paddingInline:o=>s(b(o)*3),borderRadius:o=>s(b(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(b(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Sr(e={}){var n,a;let{checked:t=!1}=e,r=f(t),o=f((n=e.color)!=null?n:"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=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>g(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${l(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>l(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>l(c,"shift-9"),backgroundColor:c=>l(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>l(c,"increase-3",i.get(c)),outline:"none",color:c=>l(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function wr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(b(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(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=>s(b(o)*2),paddingInline:o=>s(b(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(b(o)*4),color:o=>l(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(b(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(b(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(b(o)*2),paddingInline:o=>s(b(o)*4),borderTop:o=>`1px solid ${l(o,"shift-3",t.get(o))}`}}}}function xr(e={}){var r;let t=f((r=e.color)!=null?r:"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=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}var Cr=Object.defineProperty,kr=Object.defineProperties,Er=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,Wo=Object.prototype.propertyIsEnumerable,Io=(e,t,r)=>t in e?Cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))Fo.call(t,r)&&Io(e,r,t[r]);if(tt)for(var r of tt(t))Wo.call(t,r)&&Io(e,r,t[r]);return e},ye=(e,t)=>kr(e,Er(t)),Ko=(e,t)=>{var r={};for(var o in e)Fo.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&tt)for(var o of tt(e))t.indexOf(o)<0&&Wo.call(e,o)&&(r[o]=e[o]);return r},Se=(e,t,r)=>new Promise((o,i)=>{var n=u=>{try{c(r.next(u))}catch(m){i(m)}},a=u=>{try{c(r.throw(u))}catch(m){i(m)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(n,a);c((r=r.apply(e,t)).next())}),_r=["top","right","bottom","left"],Lo=["start","end"],vl=_r.reduce((e,t)=>e.concat(t,`${t}-${Lo[0]}`,`${t}-${Lo[1]}`),[]),ot=Math.min,ge=Math.max,nt=Math.round,et=Math.floor,ee=e=>({x:e,y:e}),Tr={left:"right",right:"left",bottom:"top",top:"bottom"};function zo(e,t,r){return ge(e,ot(t,r))}function at(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function lt(e){return e.split("-")[1]}function Uo(e){return e==="x"?"y":"x"}function qo(e){return e==="y"?"height":"width"}function ce(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Yo(e){return Uo(ce(e))}function Or(e,t,r=!1){let o=lt(e),i=Yo(e),n=qo(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=rt(a)),[a,rt(a)]}function Pr(e){let t=rt(e);return[Vt(e),t,Vt(t)]}function Vt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Mo=["left","right"],No=["right","left"],Dr=["top","bottom"],$r=["bottom","top"];function Rr(e,t,r){switch(e){case"top":case"bottom":return r?t?No:Mo:t?Mo:No;case"left":case"right":return t?Dr:$r;default:return[]}}function Ir(e,t,r,o){let i=lt(e),n=Rr(be(e),r==="start",o);return i&&(n=n.map(a=>`${a}-${i}`),t&&(n=n.concat(n.map(Vt)))),n}function rt(e){let t=be(e);return Tr[t]+e.slice(t.length)}function Lr(e){return Y({top:0,right:0,bottom:0,left:0},e)}function zr(e){return typeof e!="number"?Lr(e):{top:e,right:e,bottom:e,left:e}}function it(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Vo({reference:e,floating:t},r,o){let i=ce(r),n=Yo(r),a=qo(n),c=be(r),u=i==="y",m=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,d=e[a]/2-t[a]/2,p;switch(c){case"top":p={x:m,y:e.y-t.height};break;case"bottom":p={x:m,y:e.y+e.height};break;case"right":p={x:e.x+e.width,y:h};break;case"left":p={x:e.x-t.width,y:h};break;default:p={x:e.x,y:e.y}}switch(lt(r)){case"start":p[n]-=d*(o&&u?-1:1);break;case"end":p[n]+=d*(o&&u?-1:1);break;default:}return p}function Mr(e){return Se(this,arguments,function*(t,r={}){var o,i,n,a,c,u;let{x:m,y:h,platform:d,rects:p,elements:y,strategy:v}=t,{boundary:x="clippingAncestors",rootBoundary:w="viewport",elementContext:C="floating",altBoundary:E=!1,padding:O=0}=at(r,t),T=zr(O),D=y[E?C==="floating"?"reference":"floating":C],M=it(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,D))==null||i?D:D.contextElement||(yield(n=d.getDocumentElement)==null?void 0:n.call(d,y.floating)),boundary:x,rootBoundary:w,strategy:v})),I=C==="floating"?{x:m,y:h,width:p.floating.width,height:p.floating.height}:p.reference,ie=yield(a=d.getOffsetParent)==null?void 0:a.call(d,y.floating),V=(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},U=it(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:y,rect:I,offsetParent:ie,strategy:v}):I);return{top:(M.top-U.top+T.top)/V.y,bottom:(U.bottom-M.bottom+T.bottom)/V.y,left:(M.left-U.left+T.left)/V.x,right:(U.right-M.right+T.right)/V.x}})}var Nr=50,Vr=(e,t,r)=>Se(null,null,function*(){var o;let{placement:i="bottom",strategy:n="absolute",middleware:a=[],platform:c}=r,u=c.detectOverflow?c:ye(Y({},c),{detectOverflow:Mr}),m=yield(o=c.isRTL)==null?void 0:o.call(c,t),h=yield c.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:p}=Vo(h,i,m),y=i,v=0,x={};for(let w=0;w<a.length;w++){let C=a[w];if(!C)continue;let{name:E,fn:O}=C,{x:T,y:D,data:M,reset:I}=yield O({x:d,y:p,initialPlacement:i,placement:y,strategy:n,middlewareData:x,rects:h,platform:u,elements:{reference:e,floating:t}});d=T!=null?T:d,p=D!=null?D:p,x[E]=Y(Y({},x[E]),M),I&&v<Nr&&(v++,typeof I=="object"&&(I.placement&&(y=I.placement),I.rects&&(h=I.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:n}):I.rects),{x:d,y:p}=Vo(h,y,m)),w=-1)}return{x:d,y:p,placement:y,strategy:n,middlewareData:x}});var Ar=(e={})=>({name:"flip",options:e,fn(t){return Se(this,null,function*(){var r,o,i,n,a,c;let{placement:u,middlewareData:m,rects:h,initialPlacement:d,platform:p,elements:y}=t,v=at(e,t),{mainAxis:x=!0,crossAxis:w=!0,fallbackPlacements:C,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:T=!0}=v,D=Ko(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=m.arrow)!=null&&r.alignmentOffset)return{};let M=be(u),I=ce(d),ie=be(d)===d,V=yield(o=p.isRTL)==null?void 0:o.call(p,y.floating),U=C||(ie||!T?[rt(d)]:Pr(d)),Fe=O!=="none";!C&&Fe&&U.push(...Ir(d,T,O,V));let We=[d,...U],j=yield p.detectOverflow(t,D),me=[],ae=((i=m.flip)==null?void 0:i.overflows)||[];if(x&&me.push(j[M]),w){let ne=Or(u,h,V);me.push(j[ne[0]],j[ne[1]])}if(ae=[...ae,{placement:u,overflows:me}],!me.every(ne=>ne<=0)){let ne=(((n=m.flip)==null?void 0:n.index)||0)+1,$e=We[ne];if($e&&(!(w==="alignment"&&I!==ce($e))||ae.every(F=>ce(F.placement)===I?F.overflows[0]>0:!0)))return{data:{index:ne,overflows:ae},reset:{placement:$e}};let J=(a=ae.filter(F=>F.overflows[0]<=0).sort((F,q)=>F.overflows[1]-q.overflows[1])[0])==null?void 0:a.placement;if(!J)switch(E){case"bestFit":{let F=(c=ae.filter(q=>{if(Fe){let W=ce(q.placement);return W===I||W==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(W=>W>0).reduce((W,dt)=>W+dt,0)]).sort((q,W)=>q[1]-W[1])[0])==null?void 0:c[0];F&&(J=F);break}case"initialPlacement":J=d;break;default:}if(u!==J)return{reset:{placement:J}}}return{}})}});var Br=new Set(["left","top"]);function Hr(e,t){return Se(this,null,function*(){var r;let{placement:o,platform:i,elements:n}=e,a=yield(r=i.isRTL)==null?void 0:r.call(i,n.floating),c=be(o),u=lt(o),m=ce(o)==="y",h=Br.has(c)?-1:1,d=a&&m?-1:1,p=at(t,e),{mainAxis:y,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),m?{x:v*d,y:y*h}:{x:y*h,y:v*d}})}var jr=(e=0)=>({name:"offset",options:e,fn(t){return Se(this,null,function*(){var r,o;let{x:i,y:n,placement:a,middlewareData:c}=t,u=yield Hr(t,e);return a===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:n+u.y,data:ye(Y({},u),{placement:a})}})}}),Fr=(e={})=>({name:"shift",options:e,fn(t){return Se(this,null,function*(){let{x:r,y:o,placement:i,platform:n}=t,a=at(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:m={fn:({x:E,y:O})=>({x:E,y:O})}}=a,h=Ko(a,["mainAxis","crossAxis","limiter"]),d={x:r,y:o},p=yield n.detectOverflow(t,h),y=ce(be(i)),v=Uo(y),x=d[v],w=d[y];if(c){let E=v==="y"?"top":"left",O=v==="y"?"bottom":"right",T=x+p[E],D=x-p[O];x=zo(T,x,D)}if(u){let E=y==="y"?"top":"left",O=y==="y"?"bottom":"right",T=w+p[E],D=w-p[O];w=zo(T,w,D)}let C=m.fn(ye(Y({},t),{[v]:x,[y]:w}));return ye(Y({},C),{data:{x:C.x-r,y:C.y-o,enabled:{[v]:c,[y]:u}}})})}});function st(){return typeof window!="undefined"}function Pe(e){return Go(e)?(e.nodeName||"").toLowerCase():"#document"}function H(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function te(e){var t;return(t=(Go(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Go(e){return st()?e instanceof Node||e instanceof H(e).Node:!1}function G(e){return st()?e instanceof Element||e instanceof H(e).Element:!1}function re(e){return st()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Ao(e){return!st()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Be(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function Wr(e){return/^(table|td|th)$/.test(Pe(e))}function ct(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Kr=/transform|translate|scale|rotate|perspective|filter/,Ur=/paint|layout|strict|content/,pe=e=>!!e&&e!=="none",Mt;function Bt(e){let t=G(e)?X(e):e;return pe(t.transform)||pe(t.translate)||pe(t.scale)||pe(t.rotate)||pe(t.perspective)||!Ht()&&(pe(t.backdropFilter)||pe(t.filter))||Kr.test(t.willChange||"")||Ur.test(t.contain||"")}function qr(e){let t=ue(e);for(;re(t)&&!Oe(t);){if(Bt(t))return t;if(ct(t))return null;t=ue(t)}return null}function Ht(){return Mt==null&&(Mt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mt}function Oe(e){return/^(html|body|#document)$/.test(Pe(e))}function X(e){return H(e).getComputedStyle(e)}function ut(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ue(e){if(Pe(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ao(e)&&e.host||te(e);return Ao(t)?t.host:t}function Xo(e){let t=ue(e);return Oe(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&Be(t)?t:Xo(t)}function Ae(e,t=[],r=!0){var o;let i=Xo(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=H(i);if(n){let c=At(a);return t.concat(a,a.visualViewport||[],Be(i)?i:[],c&&r?Ae(c):[])}else return t.concat(i,Ae(i,[],r))}function At(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jo(e){let t=X(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=re(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=nt(r)!==n||nt(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function jt(e){return G(e)?e:e.contextElement}function Te(e){let t=jt(e);if(!re(t))return ee(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=Jo(t),a=(n?nt(r.width):r.width)/o,c=(n?nt(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var Yr=ee(0);function Zo(e){let t=H(e);return!Ht()||!t.visualViewport?Yr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gr(e,t=!1,r){return!r||t&&r!==H(e)?!1:t}function ve(e,t=!1,r=!1,o){let i=e.getBoundingClientRect(),n=jt(e),a=ee(1);t&&(o?G(o)&&(a=Te(o)):a=Te(e));let c=Gr(n,r,o)?Zo(n):ee(0),u=(i.left+c.x)/a.x,m=(i.top+c.y)/a.y,h=i.width/a.x,d=i.height/a.y;if(n){let p=H(n),y=o&&G(o)?H(o):o,v=p,x=At(v);for(;x&&o&&y!==v;){let w=Te(x),C=x.getBoundingClientRect(),E=X(x),O=C.left+(x.clientLeft+parseFloat(E.paddingLeft))*w.x,T=C.top+(x.clientTop+parseFloat(E.paddingTop))*w.y;u*=w.x,m*=w.y,h*=w.x,d*=w.y,u+=O,m+=T,v=H(x),x=At(v)}}return it({width:h,height:d,x:u,y:m})}function mt(e,t){let r=ut(e).scrollLeft;return t?t.left+r:ve(te(e)).left+r}function Qo(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-mt(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function Xr({elements:e,rect:t,offsetParent:r,strategy:o}){let i=o==="fixed",n=te(r),a=e?ct(e.floating):!1;if(r===n||a&&i)return t;let c={scrollLeft:0,scrollTop:0},u=ee(1),m=ee(0),h=re(r);if((h||!h&&!i)&&((Pe(r)!=="body"||Be(n))&&(c=ut(r)),h)){let p=ve(r);u=Te(r),m.x=p.x+r.clientLeft,m.y=p.y+r.clientTop}let d=n&&!h&&!i?Qo(n,c):ee(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+m.x+d.x,y:t.y*u.y-c.scrollTop*u.y+m.y+d.y}}function Jr(e){return Array.from(e.getClientRects())}function Zr(e){let t=te(e),r=ut(e),o=e.ownerDocument.body,i=ge(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=ge(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+mt(e),c=-r.scrollTop;return X(o).direction==="rtl"&&(a+=ge(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var Bo=25;function Qr(e,t){let r=H(e),o=te(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){n=i.width,a=i.height;let h=Ht();(!h||h&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let m=mt(o);if(m<=0){let h=o.ownerDocument,d=h.body,p=getComputedStyle(d),y=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-y);v<=Bo&&(n-=v)}else m<=Bo&&(n+=m);return{width:n,height:a,x:c,y:u}}function ei(e,t){let r=ve(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=re(e)?Te(e):ee(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,u=i*n.x,m=o*n.y;return{width:a,height:c,x:u,y:m}}function Ho(e,t,r){let o;if(t==="viewport")o=Qr(e,r);else if(t==="document")o=Zr(te(e));else if(G(t))o=ei(t,r);else{let i=Zo(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return it(o)}function en(e,t){let r=ue(e);return r===t||!G(r)||Oe(r)?!1:X(r).position==="fixed"||en(r,t)}function ti(e,t){let r=t.get(e);if(r)return r;let o=Ae(e,[],!1).filter(c=>G(c)&&Pe(c)!=="body"),i=null,n=X(e).position==="fixed",a=n?ue(e):e;for(;G(a)&&!Oe(a);){let c=X(a),u=Bt(a);!u&&c.position==="fixed"&&(i=null),(n?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Be(a)&&!u&&en(e,a))?o=o.filter(m=>m!==a):i=c,a=ue(a)}return t.set(e,o),o}function oi({element:e,boundary:t,rootBoundary:r,strategy:o}){let i=[...t==="clippingAncestors"?ct(e)?[]:ti(e,this._c):[].concat(t),r],n=Ho(e,i[0],o),a=n.top,c=n.right,u=n.bottom,m=n.left;for(let h=1;h<i.length;h++){let d=Ho(e,i[h],o);a=ge(d.top,a),c=ot(d.right,c),u=ot(d.bottom,u),m=ge(d.left,m)}return{width:c-m,height:u-a,x:m,y:a}}function ni(e){let{width:t,height:r}=Jo(e);return{width:t,height:r}}function ri(e,t,r){let o=re(t),i=te(t),n=r==="fixed",a=ve(e,!0,n,t),c={scrollLeft:0,scrollTop:0},u=ee(0);function m(){u.x=mt(i)}if(o||!o&&!n)if((Pe(t)!=="body"||Be(i))&&(c=ut(t)),o){let y=ve(t,!0,n,t);u.x=y.x+t.clientLeft,u.y=y.y+t.clientTop}else i&&m();n&&!o&&i&&m();let h=i&&!o&&!n?Qo(i,c):ee(0),d=a.left+c.scrollLeft-u.x-h.x,p=a.top+c.scrollTop-u.y-h.y;return{x:d,y:p,width:a.width,height:a.height}}function Nt(e){return X(e).position==="static"}function jo(e,t){if(!re(e)||X(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return te(e)===r&&(r=r.ownerDocument.body),r}function tn(e,t){let r=H(e);if(ct(e))return r;if(!re(e)){let i=ue(e);for(;i&&!Oe(i);){if(G(i)&&!Nt(i))return i;i=ue(i)}return r}let o=jo(e,t);for(;o&&Wr(o)&&Nt(o);)o=jo(o,t);return o&&Oe(o)&&Nt(o)&&!Bt(o)?r:o||qr(e)||r}var ii=function(e){return Se(this,null,function*(){let t=this.getOffsetParent||tn,r=this.getDimensions,o=yield r(e.floating);return{reference:ri(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function ai(e){return X(e).direction==="rtl"}var li={convertOffsetParentRelativeRectToViewportRelativeRect:Xr,getDocumentElement:te,getClippingRect:oi,getOffsetParent:tn,getElementRects:ii,getClientRects:Jr,getDimensions:ni,getScale:Te,isElement:G,isRTL:ai};function on(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function si(e,t){let r=null,o,i=te(e);function n(){clearTimeout(o),r==null||r.disconnect(),r=null}function a(c=!1,u=1){n();let m=e.getBoundingClientRect(),{left:h,top:d,width:p,height:y}=m;if(c||t(),!p||!y)return;let v=et(d),x=et(i.clientWidth-(h+p)),w=et(i.clientHeight-(d+y)),C=et(h),E={rootMargin:`${-v}px ${-x}px ${-w}px ${-C}px`,threshold:ge(0,ot(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&&!on(m,e.getBoundingClientRect())&&a(),O=!1}try{r=new IntersectionObserver(T,ye(Y({},E),{root:i.ownerDocument}))}catch(D){r=new IntersectionObserver(T,E)}r.observe(e)}return a(!0),n}function nn(e,t,r,o={}){let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,m=jt(e),h=i||n?[...m?Ae(m):[],...t?Ae(t):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),n&&C.addEventListener("resize",r)});let d=m&&c?si(m,r):null,p=-1,y=null;a&&(y=new ResizeObserver(([C])=>{C&&C.target===m&&y&&t&&(y.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{y==null||y.observe(t)})),r()}),m&&!u&&y.observe(m),t&&y.observe(t));let v,x=u?ve(e):null;u&&w();function w(){let C=ve(e);x&&!on(x,C)&&r(),x=C,v=requestAnimationFrame(w)}return r(),()=>{h.forEach(C=>{i&&C.removeEventListener("scroll",r),n&&C.removeEventListener("resize",r)}),d==null||d(),y==null||y.disconnect(),y=null,u&&cancelAnimationFrame(v)}}var rn=jr;var an=Fr,ln=Ar;var sn=(e,t,r)=>{let o=new Map,i=Y({platform:li},r),n=ye(Y({},i.platform),{_c:o});return Vr(e,t,ye(Y({},i),{platform:n}))};function oe(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,a=null,c=null,u=null,m=!1,h=f(t),d=()=>{m||!u||(m=!0,c=u.children.insert(e.content))},p=()=>{d(),n&&a&&(i&&i(),i=nn(n,a,()=>{sn(n,a,{placement:r.get(),middleware:[rn(12),ln(),an()],strategy:"fixed"}).then(({x:E,y:O,placement:T})=>{Object.assign(a.style,{left:`${E}px`,top:`${O}px`}),r.set(T)})}),h.set(!0))},y=()=>{i&&i(),i=null,h.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(p,100)},x=()=>{o&&clearTimeout(o),o=setTimeout(y,100)},w={style:{position:"fixed",pointerEvents:"auto",visibility:E=>h.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 R(e.content,w),{show:v,hide:x,anchorPartial:{onKeyDown:E=>E.key==="Escape"&&x(),_onMount:E=>{u=E.getRoot(),n=E.domElement;let O=T=>{if(!h.get()||!n||!a)return;let D=T.target;!n.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 ci='<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 He(e={}){var o;let{removable:t=!1}=e,r=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:ci,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>l(i,"inherit",r.get(i)),color:i=>l(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-4",r.get(i))}`}}}function ui(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:m,anchorPartial:h}=oe({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&m()};R(e.content,d);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:w=>g(w,"inherit"),color:w=>l(w,"shift-9",o),backgroundColor:w=>l(w,"inherit",o)},y;e.input?(R(e.input,{onFocus:()=>u(),style:p,_key:"combobox-input"}),y=e.input):y={input:null,onFocus:()=>u(),value:w=>(a.get(w),""),style:p,_key:"combobox-input"};let v={div:w=>{let C=a.get(w),E=Array.isArray(C)?C:[C],T=t.filter(D=>E.includes(D.value)).map(D=>({span:D.label,$:[He({color:o,removable:!0})],_key:D.value,_onRemove:M=>{let I=a.get(),V=(Array.isArray(I)?I:[I]).filter(U=>U!==D.value);n?a.set(V):a.set(V[0])}}));return T.push(y),T},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},x={_onInsert:w=>{w.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:w=>w.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:w=>`1px solid ${l(w,"shift-4","neutral")}`,paddingBlock:w=>s(b(w)*1),paddingInline:w=>s(b(w)*1),borderRadius:w=>s(b(w)*1),fontSize:w=>g(w,"inherit"),color:w=>l(w,"shift-9",o),backgroundColor:w=>l(w,"inherit",o)}};return R(h,x),h}function mi(){return{_onSchedule:(e,t)=>{R(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function hi(e={}){let{color:t="neutral",accentColor:r="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 n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>g(o,"inherit"),paddingInline:o=>s(b(o)*3),paddingBlock:o=>s(b(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-3",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",r)}}}}function di(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var u,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,a=(m=(u=n.textContent)==null?void 0:u.toLowerCase())!=null?m:"",c=i.query.addListener(h=>{n.hidden=h.length>0&&!a.includes(h.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>g(o,"inherit"),height:o=>s(6+b(o)*2),paddingInline:o=>s(b(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}var N=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),we=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Ft=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),je=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Wt=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Kt=(e,t)=>we(e,-((e.getDay()-t+7)%7));function fi(e){var t,r;try{let o=new Intl.Locale(e),i=(r=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?r:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function pi(e={}){var Yt,Gt,Xt,Jt;let{mode:t="single",time:r=!1,min:o,max:i,disabledDate:n,locale:a=typeof navigator!="undefined"?navigator.language:"en-US",format:c,onChange:u}=e,m=(Yt=e.weekStartsOn)!=null?Yt:fi(a),h=f((Gt=e.accentColor)!=null?Gt:"primary","accentColor"),d=f((Xt=e.placement)!=null?Xt:"bottom-start"),p=f((Jt=e.value)!=null?Jt:t==="range"?[null,null]:null);u&&p.addListener(S=>u(S));let y=(()=>{let S=p.get(),k=t==="range"?S==null?void 0:S[0]:S;return k instanceof Date?k:new Date})(),v=f(y.getFullYear(),"viewYear"),x=f(y.getMonth(),"viewMonth"),w=f(N(y),"focused"),C=f(null,"hovered"),E=f(y.getHours(),"hour"),O=f(y.getMinutes(),"minute"),T=null,D=new Intl.DateTimeFormat(a,Ue({dateStyle:"medium"},r?{timeStyle:"short"}:{})),M=new Intl.DateTimeFormat(a,{month:"long",year:"numeric"}),I=new Intl.DateTimeFormat(a,{weekday:"short"}),ie=new Intl.DateTimeFormat(a,{dateStyle:"full"}),V=S=>S?D.format(S):"",U=S=>{if(c)return c(S);if(t==="range"){let[k,_]=S!=null?S:[null,null];return k?`${V(k)} \u2013 ${V(_)}`:""}return V(S)},Fe=Array.from({length:7},(S,k)=>I.format(new Date(2023,0,1+(k+m)%7))),We=S=>!!o&&N(S)<N(o)||!!i&&N(S)>N(i)||!!n&&n(S),j=S=>{if(!r)return N(S);let k=N(S);return k.setHours(E.get(),O.get(),0,0),k},me=S=>{var P;if(We(S))return;if(t==="single"){p.set(j(S)),r||pt();return}let[k,_]=(P=p.get())!=null?P:[null,null];!k||k&&_?p.set([j(S),null]):N(S)<N(k)?(p.set([j(S),j(k)]),r||pt()):(p.set([k,j(S)]),r||pt())},ae=()=>{var S;if(r)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(_)])}},ne=(S,k)=>{var xe;if(t!=="range")return!1;let[_,P]=(xe=p.get(k))!=null?xe:[null,null],L=P!=null?P:C.get(k);if(!_||!L)return!1;let $=N(_)<=N(L)?_:L,K=N(_)<=N(L)?L:_,A=N(S);return A>=N($)&&A<=N(K)},$e=(S,k)=>{let _=p.get(k);if(t==="range"){let[P,L]=_!=null?_:[null,null];return je(S,P)||je(S,L)}return je(S,_)},J=S=>{v.set(S.getFullYear()),x.set(S.getMonth())},F=S=>{let k=Ft(new Date(v.get(),x.get(),1),S);J(k)},q=S=>v.set(v.get()+S),W=()=>{setTimeout(()=>{var S;(S=T==null?void 0:T.querySelector(`[data-date="${Wt(w.get())}"]`))==null||S.focus()},0)},dt=vn(),{show:pn,hide:gn,anchorPartial:ft}=oe({open:!1,placement:d,content:dt});function pt(){gn()}ft.onClick=()=>{};let yn={type:"text",readonly:!0,value:S=>U(p.get(S)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:()=>{gt()},onFocus:()=>{gt()},onKeyDown:S=>{let k=S.key;(k==="ArrowDown"||k==="Enter")&&(S.preventDefault(),gt())}};function gt(){var k;let S=(k=bn())!=null?k:new Date;w.set(N(S)),J(S),pn(),W()}function bn(){var k;let S=p.get();return t==="range"?(k=S==null?void 0:S[0])!=null?k:null:S!=null?S:null}return R(ft,yn),ft;function vn(){let S=($,K,A)=>({button:$,type:"button",ariaLabel:K,onClick:A,style:gi()}),k={div:[S("\xAB","Previous year",()=>q(-1)),S("\u2039","Previous month",()=>F(-1)),{div:$=>M.format(new Date(v.get($),x.get($),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:$=>g($)}},S("\u203A","Next month",()=>F(1)),S("\xBB","Next year",()=>q(1))],style:{display:"flex",alignItems:"center",gap:s(1),marginBottom:s(2)}},_={div:Fe.map(($,K)=>({div:$,style:{textAlign:"center",fontSize:A=>g(A,"decrease-1"),fontWeight:"600",color:A=>l(A,"shift-7"),paddingBlock:s(1)},_key:K})),role:"row",style:cn()},P={div:$=>Sn($),role:"grid",ariaLabel:"Calendar",onKeyDown:kn,onMouseLeave:()=>t==="range"&&C.set(null),style:{display:"flex",flexDirection:"column",gap:s(.5)}},L=[k,_,P];return r&&L.push(xn()),L.push(Cn()),{div:L,role:"dialog",ariaModal:"false",_onMount:$=>{T=$.domElement},style:{minWidth:s(70),padding:s(3),borderRadius:s(2),backgroundColor:$=>l($,"base"),color:$=>l($,"shift-10"),border:$=>`1px solid ${l($,"shift-4")}`,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"}}}function Sn(S){let k=new Date(v.get(S),x.get(S),1),_=x.get(S),P=Kt(k,m),L=[];for(let $=0;$<6;$++){let K=[];for(let A=0;A<7;A++){let xe=we(P,$*7+A);K.push(wn(xe,_,S))}L.push({div:K,role:"row",style:cn(),_key:$})}return L}function wn(S,k,_){let P=We(S),L=$e(S,_),$=ne(S,_),K=S.getMonth()!==k,A=je(S,w.get(_)),xe=je(S,new Date);return{button:String(S.getDate()),type:"button",role:"gridcell",tabIndex:A?0:-1,ariaSelected:L,ariaDisabled:P,disabled:P,ariaLabel:ie.format(S),dataDate:Wt(S),onClick:()=>me(S),onMouseEnter:()=>t==="range"&&C.set(S),style:{appearance:"none",border:"none",cursor:P?"not-allowed":"pointer",aspectRatio:"1",borderRadius:s(1),fontSize:z=>g(z),fontFamily:"inherit",opacity:P?.35:K?.5:1,backgroundColor:z=>L?l(z,"shift-7",h.get(z)):$?l(z,"shift-2",h.get(z)):"transparent",color:z=>L?l(z,"shift-0",h.get(z)):l(z,"shift-9"),outline:xe?z=>`1px solid ${l(z,"shift-6",h.get(z))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:z=>L?l(z,"shift-7",h.get(z)):l(z,"shift-3",h.get(z))},"&:focus-visible":{outline:z=>`2px solid ${l(z,"shift-6",h.get(z))}`}},_key:Wt(S)}}function xn(){let S=(k,_,P)=>({select:Array.from({length:k},(L,$)=>({option:String($).padStart(2,"0"),value:String($),selected:K=>_.get(K)===$,_key:$})),ariaLabel:P,onChange:L=>{_.set(Number(L.target.value)),ae()},style:yi()});return{div:[S(24,E,"Hour"),{span:":",style:{fontWeight:"600"}},S(60,O,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:s(1),marginTop:s(3)}}}function Cn(){let S=(k,_)=>({button:k,type:"button",onClick:_,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:P=>g(P,"decrease-1"),color:P=>l(P,"shift-8",h.get(P)),padding:s(1)}});return{div:[S("Today",()=>{let k=new Date;w.set(N(k)),J(k),W()}),S("Clear",()=>{p.set(t==="range"?[null,null]:null),C.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:s(2),paddingTop:s(2),borderTop:k=>`1px solid ${l(k,"shift-3")}`}}}function kn(S){let k=S,_=w.get(),P=null;switch(k.key){case"ArrowLeft":P=we(_,-1);break;case"ArrowRight":P=we(_,1);break;case"ArrowUp":P=we(_,-7);break;case"ArrowDown":P=we(_,7);break;case"Home":P=Kt(_,m);break;case"End":P=we(Kt(_,m),6);break;case"PageUp":P=Ft(_,k.shiftKey?-12:-1);break;case"PageDown":P=Ft(_,k.shiftKey?12:1);break;case"Enter":case" ":k.preventDefault(),me(_);return;default:return}k.preventDefault(),w.set(P),J(P),W()}}function cn(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:s(.5)}}function gi(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>g(e),color:e=>l(e,"shift-8"),width:s(7),height:s(7),borderRadius:s(1),"&:hover":{backgroundColor:e=>l(e,"shift-3")}}}function yi(){return{fontFamily:"inherit",fontSize:e=>g(e),padding:s(1),borderRadius:s(1),border:e=>`1px solid ${l(e,"shift-4")}`,backgroundColor:e=>l(e,"base"),color:e=>l(e,"shift-9")}}function bi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function vi(e={}){var i,n;let{duration:t=240}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:a=>{a.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>g(a,"inherit"),color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",r.get(a)),color:a=>l(a,"shift-10",r.get(a)),fontSize:a=>g(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(b(a)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(b(a)*2),outlineOffset:`-${s(.5)}`,outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>s(b(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:a=>s(b(a)*1),paddingBottom:a=>s(b(a)*3)}}}}function Si(e={}){let{color:t="neutral",open:r=!1}=e,o=f(r);return{_onInsert:i=>{i.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,a=u=>{u?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let m=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):n.style.opacity="0"};a(o.get());let c=o.addListener(a);i.addHook("Remove",()=>{c(),document.body.style.overflow=""})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>g(i,"inherit"),color:i=>l(i,"shift-10",t),backgroundColor:i=>l(i,"inherit",t),border:"none",padding:i=>s(b(i)*3),boxShadow:i=>`0 ${s(9)} ${s(16)} ${l(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>l(i,"shift-2","neutral"),opacity:.75}}}}function wi(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(2),fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var un={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},xi={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},Ut=e=>e==="left"||e==="right";function Ci(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=f(r),a=Ut(o)?s(80):s(64),c=i!=null?i:a;return{_onInsert:u=>{u.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(u,m)=>{u.target===m.domElement&&n.set(!1)},onTransitionEnd:(u,m)=>{let h=m.domElement;n.get()||(h.close(),document.body.style.overflow="")},_onMount:u=>{let m=u.domElement,h=p=>{p?(m.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{m.style.transform="translate(0, 0)"})):m.style.transform=un[o]};h(n.get());let d=n.addListener(h);u.addHook("Remove",()=>{d(),document.body.style.overflow=""})},style:{transform:un[o],transition:"transform 0.25s ease",fontSize:u=>g(u,"inherit"),color:u=>l(u,"shift-10",t),backgroundColor:u=>l(u,"inherit",t),border:"none",padding:u=>s(b(u)*3),margin:xi[o],width:Ut(o)?c:"100dvw",height:Ut(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:u=>`0 ${s(4)} ${s(12)} ${l(u,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:u=>l(u,"shift-2","neutral"),opacity:.75}}}}function ki(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>g(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function Ei(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>l(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>g(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function _i(e={}){var i;let{layout:t="horizontal"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(b(n)*3),paddingBlock:n=>s(b(n)*3),border:"none",borderRadius:n=>s(b(n)*2),fontSize:n=>g(n,"inherit"),backgroundColor:n=>l(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>g(n,"inherit"),fontWeight:600,paddingBlock:n=>s(b(n)*1),borderRadius:n=>s(b(n)*2),color:n=>l(n,"shift-9",r.get(n)),backgroundColor:n=>l(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(b(n)*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(${s(2)} * -1)`,fontSize:n=>g(n,"decrease-1"),color:n=>l(n,"shift-9",r.get(n))}}}}var Ti={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Oi(e={}){var r;let t=f((r=e.color)!=null?r:"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=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=Ti[o.elementNode.tagName]||"inherit";return g(o,i)}}}}function Pi(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(3),marginBottom:s(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function Di(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(4),height:s(4),flexShrink:"0",fontSize:o=>g(o),backgroundColor:"transparent",color:o=>l(o,"shift-9",t.get(o))}}}function $i(e={}){var r;let t=f((r=e.color)!=null?r:"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:s(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function Ri(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>g(n,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${l(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Ii(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>g(n,"inherit"),paddingBlock:n=>s(b(n)*1),paddingInline:n=>s(b(n)*1),blockSize:n=>s(6+b(n)*2),inlineSize:n=>s(6+b(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>s(b(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function Li(e={}){var i,n;let{mode:t="datetime-local"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"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=>g(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,borderRadius:a=>s(b(a)*1),paddingInline:a=>s(b(a)*3),height:a=>s(6+b(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-6","error")}`}}}}function zi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(b(n)*1),height:n=>s(6+b(n)*2),paddingInline:n=>s(b(n)*1),"&::-webkit-file-upload-button":{marginTop:n=>s(b(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-11",t.get(n)),backgroundColor:n=>l(n,"shift-1",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-3","neutral")}}}}function Mi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(b(n)*3),paddingInlineEnd:n=>s(b(n)*1.5),paddingBlock:n=>s(b(n)*1),borderRadius:n=>s(b(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")}}}}function Ni(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),u=a.target,m=c.indexOf(u);u.value&&m<c.length-1&&c[m+1].focus()},i=a=>{let c=r(),u=a.target,m=c.indexOf(u);a.key==="Backspace"&&!u.value&&m>0&&c[m-1].focus(),a.key==="ArrowLeft"&&m>0&&c[m-1].focus(),a.key==="ArrowRight"&&m<c.length-1&&c[m+1].focus()},n=a=>{var d,p,y;a.preventDefault();let c=(p=(d=a.clipboardData)==null?void 0:d.getData("text"))!=null?p:"",u=r(),m=u.indexOf(a.target);[...c].forEach((v,x)=>{u[m+x]&&(u[m+x].value=v)});let h=Math.min(m+c.length-1,u.length-1);(y=u[h])==null||y.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function Vi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>g(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(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:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Ai(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Bi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(b(n)*1),minWidth:s(32),paddingInline:n=>s(b(n)*3),paddingBlock:n=>s(b(n)*1),"&::placeholder":{color:n=>l(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function Hi(e={}){var r;let t=f((r=e.accentColor)!=null?r:"primary","accentColor");return{dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>g(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>g(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ji(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(b(n)*3),paddingBlock:n=>s(b(n)*1),borderRadius:n=>s(b(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>l(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","warning")}`}}}}function Fi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`}}}function Wi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>g(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function Ki(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>g(n,"inherit"),backgroundColor:n=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>l(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function Ui(e={}){var r;let t=f((r=e.accentColor)!=null?r:"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=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function qi(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let a={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:r}}};R(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>s(b(i)*2),paddingInline:i=>s(b(i)*2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>l(i,"inherit",t)}}}function Yi(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var u,m;i.tagName!=="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu");if(!n){console.warn('"menuItem" patch must be used inside a "menu"');return}let a=(m=(u=i.parent)==null?void 0:u.children.items)!=null?m:[];a=a.filter(h=>h.type=="ElementNode"&&h.attributes.get("role")=="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:a.findIndex(h=>h==i);n.selectable&&(i.attributes.set("ariaCurrent",h=>n.activeKey.get(h)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var h,d,p,y;let a=i.key;if(a==="Enter"||a===" "){i.preventDefault(),(h=n.domElement)==null||h.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((p=(d=n.parent)==null?void 0:d.children.items)!=null?p:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem"),u=c.findIndex(v=>v===n),m=u;a==="ArrowDown"?m=(u+1)%c.length:a==="ArrowUp"?m=(u-1+c.length)%c.length:a==="Home"?m=0:a==="End"&&(m=c.length-1),(y=c[m].domElement)==null||y.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>s(2),width:"100%",fontSize:i=>g(i,"inherit"),height:i=>s(6+b(i)*2),paddingInline:i=>s(b(i)*3),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>l(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>l(i,"shift-3",t),color:i=>l(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}var mn=e=>!!e&&typeof e.get=="function"&&e._isState===!0,De=e=>{let t={},r=[];for(let o in e){let i=e[o];o==="x"?r.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?r.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?r.push(`scale(${i})`):o==="rotate"?r.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return r.length&&(t.transform=r.join(" ")),t};function Gi(e={}){var a,c,u,m;let{initial:t,animate:r,exit:o,transition:i={}}=e,n={duration:(a=i.duration)!=null?a:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(m=i.iterations)!=null?m:1,fill:"both"};return{_onMount:h=>{let d=h.domElement;if(!d||typeof d.animate!="function")return;let p=mn(r)?r.get():r;if(p?d.animate(t?[De(t),De(p)]:[De(p)],n):t&&Object.assign(d.style,De(t)),mn(r)){let y=r.addListener(v=>{d.animate([De(v)],n)});h.setMetadata("motionRelease",y)}},_onBeforeRemove:(h,d)=>{let p=h.domElement;if(!p||!o||typeof p.animate!="function")return d();p.animate([De(o)],n).finished.then(d,d)},_onRemove:h=>{let d=h.getMetadata("motionRelease");d==null||d()}}}function Xi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Ji(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function Zi(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>s(6+b(u)*2),height:u=>s(6+b(u)*2),paddingInline:u=>s(b(u)*2),borderRadius:u=>s(b(u)*1),border:"none",cursor:"pointer",fontSize:u=>g(u,"inherit"),backgroundColor:"transparent",color:u=>l(u,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=to(Ue({},n),{backgroundColor:u=>l(u,"shift-6",o),color:u=>l(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-6",o)}});return{_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let m={div:h=>{let d=i.get(h),p=[];p.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let y of Ji(d,t))if(y==="...")p.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(b(v)*2),color:v=>l(v,"shift-7",r)}});else{let v=y===d;p.push({button:String(y),type:"button",ariaLabel:`Page ${y}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(y),style:v?a:n})}return p.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),p},style:{display:"flex",alignItems:"center",gap:s(1)}};u.children.insert(m)},style:{display:"inline-flex"}}}function Qi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function ea(e){var p;let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=f(t),a=f(r),{show:c,hide:u,anchorPartial:m}=oe({open:n,placement:a,content:e.content}),h={role:"dialog",dataTone:"shift-11",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),_onInsert:y=>{let v=y.attributes.get("id");i=v||y.nodeId,!v&&y.attributes.set("id",i)}};return(p=e.content).$||(p.$=[]),e.content.$.push(h),R(m,{ariaHaspopup:"dialog",ariaExpanded:y=>n.get(y),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),onClick:()=>{o==="click"&&(n.get()?u():c())},onFocus:()=>c(),onBlur:(y,v)=>{let x=y.relatedTarget,w=v.getRoot().domElement,C=i?w.querySelector(`#${CSS.escape(i)}`):null;x&&(C!=null&&C.contains(x))||u()},_onMount:y=>i&&y.attributes.set("ariaControls",i)}),m}function qt(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=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=h=>{var d;return(d=a[n.get(h)])!=null?d:a["bottom-end"]},u=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",m=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>g(h),backgroundColor:h=>l(h),color:h=>l(h,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:h=>l(h,"inherit",r),borderWidth:i?"1px":"0px",borderColor:h=>l(h,"inherit",r),borderTopStyle:h=>{let d=c(h);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:h=>{let d=c(h);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:h=>{let d=c(h);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:h=>{let d=c(h);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:h=>{let d=c(h);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:h=>{let d=c(h);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:h=>{let d=c(h),p=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",y=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${p},${y}) rotate(45deg)`}}}}}function ta(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(b(o)*2),paddingInline:o=>s(b(o)*3),borderRadius:o=>s(b(o)*2)}}}function oa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:n=>l(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>l(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}function na(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>g(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",t)}`,borderRadius:o=>s(b(o)*1),paddingBlock:o=>s(b(o)*1),paddingLeft:o=>s(b(o)*3),paddingRight:o=>s(b(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="${zt(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 ${s(2)} center`,backgroundSize:`${s(2.5)} ${s(1.5)}`,"&:not([multiple])":{height:o=>s(6+b(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-8","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function ra(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:m,anchorPartial:h}=oe({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&m()};R(e.content,d);let p={div:v=>{let x=a.get(v),w=Array.isArray(x)?x:[x];return t.filter(E=>w.includes(E.value)).map(E=>({span:E.label,$:[He({color:o,removable:n})],_key:E.value,_onRemove:O=>{let T=a.get(),M=(Array.isArray(T)?T:[T]).filter(I=>I!==E.value);n?a.set(M):a.set(M[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},y={_onInsert:v=>{v.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(p),onClick:()=>c.get()?m():u(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+b(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(b(v)*2),borderRadius:v=>s(b(v)*1),fontSize:v=>g(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return R(h,y),h}function ia(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!=="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",u=>{let m=c.get(u);return a.multiple?m.includes(o):m==o}),n.addEvent("click",()=>{let u=c.get();a.multiple?u.includes(o)?c.set(u.filter(m=>m!==o)):c.set(u.concat([o])):u!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>g(n,"inherit"),height:n=>s(6+b(n)*2),paddingInline:n=>s(b(n)*3),border:"none",outline:"none",color:n=>l(n,"shift-9",r),backgroundColor:n=>l(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>l(n,"shift-6",t),color:n=>l(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function aa(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=f((a=e.value)!=null?a:r?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(h=>({input:null,name:e.name,value:h||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_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=>s(b(c)*2),paddingInline:c=>s(b(c)*2),fontSize:c=>g(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function la(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=Ee(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>g(n),color:n=>l(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>l(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}function sa(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!=="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}var dn={to:{transform:"rotate(360deg)"}},hn=Ee(JSON.stringify(dn));function ca(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>g(o),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${l(o,"shift-4",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${hn} 0.7s linear infinite`,[`@keyframes ${hn}`]:dn}}}function ua(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{R(a,{_context:{splitter:{direction:t,size:f(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function ma(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function ha(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let a=r.parentElement,c=m=>{let h=a.getBoundingClientRect(),d=o?(m.clientX-h.left)/h.width*100:(m.clientY-h.top)/h.height*100;t.size.set(Math.min(Math.max(d,t.min),t.max))},u=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&::after":{content:'""',borderRadius:s(999),backgroundColor:e=>l(e,"shift-4")}}}}function da(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>g(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function fa(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function pa(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function ga(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var m,h;i.tagName!=="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let a=(h=(m=i.parent)==null?void 0:m.children.items)!=null?h:[];a=a.filter(d=>d.type=="ElementNode"&&d.attributes.get("role")=="tab");let c=i.key!==null&&i.key!==void 0?i.key:a.findIndex(d=>d==i),u={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:d=>n.activeKey.get(d)==c,onClick:()=>n.activeKey.set(c),onKeyDown:d=>{var C,E,O,T;let p=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(p))return;d.preventDefault();let y=((E=(C=i.parent)==null?void 0:C.children.items)!=null?E:[]).filter(D=>D.type==="ElementNode"&&D.attributes.get("role")==="tab"),v=y.findIndex(D=>D===i),x=v;p==="ArrowRight"?x=(v+1)%y.length:p==="ArrowLeft"?x=(v-1+y.length)%y.length:p==="Home"?x=0:p==="End"&&(x=y.length-1);let w=y[x];n.activeKey.set((O=w.key)!=null?O:x),(T=w.domElement)==null||T.focus()}};i.merge(u)},style:{cursor:"pointer",fontSize:i=>g(i,"inherit"),height:i=>s(6+b(i)*2),paddingInline:i=>s(b(i)*4),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`}}}}function ya(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(b(o)*3),paddingBlock:o=>s(b(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(b(o)*3),paddingBlock:o=>s(b(o)*1),color:o=>l(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-3",t.get(o))}`,fontSize:o=>g(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(b(o)*3),paddingBlock:o=>s(b(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>l(o,"shift-2")+"!important"}}}}function ba(){return{role:"tabpanel",style:{paddingBlock:t=>s(b(t)*2),paddingInline:t=>s(b(t)*2)},_onInsert:t=>{var a,c;let r=t.getContext("tabs");if(!r){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.findIndex(u=>u==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:u=>r.activeKey.get(u)!=i};t.merge(n)}}}function va(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:f(e.activeKey||0)}}};R(o,i)}}}function Sa(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=f((n=e.accentColor)!=null?n:"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()}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>s(b(a)*2),paddingBlock:a=>s(b(a)*1.5),border:"none",borderRadius:a=>s(b(a)*1.5),fontSize:a=>g(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",t.get(a))}`,backgroundColor:a=>l(a,"inherit",t.get(a)),"&::placeholder":{color:a=>l(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${s(.5)} solid ${l(a,"shift-5",r.get(a))}`},"&:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",r.get(a))}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`,backgroundColor:a=>l(a,"shift-2","neutral")}}}}function wa(e={}){let{position:t="top-center",color:r="neutral"}=e,o=f(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:u=>{let m=u.domElement.querySelector(`#domphy-toast-${t}`);return m||(m=u.children.insert(c).domElement),m},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:u=>s(b(u)*2),paddingInline:u=>s(b(u)*4),borderRadius:u=>s(b(u)*2),fontSize:u=>g(u,"inherit"),color:u=>l(u,"shift-9",r),backgroundColor:u=>l(u,"inherit",r),boxShadow:u=>`0 ${s(2)} ${s(9)} ${l(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,m)=>{let h=d=>{d.propertyName==="transform"&&(u.domElement.removeEventListener("transitionend",h),m())};u.domElement.addEventListener("transitionend",h),o.set(!1)}}}function xa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var h,d;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup");if(!a){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let u=((d=(h=n.parent)==null?void 0:h.children.items)!=null?d:[]).filter(p=>p.type==="ElementNode"&&p.attributes.get("role")==="button"),m=n.key!==null&&n.key!==void 0?String(n.key):String(u.indexOf(n));n.attributes.set("ariaPressed",p=>{let y=a.value.get(p);return Array.isArray(y)?y.includes(m):y===m}),n.addEvent("click",()=>{let p=a.value.get();if(a.multiple){let y=Array.isArray(p)?[...p]:[];a.value.set(y.includes(m)?y.filter(v=>v!==m):[...y,m])}else a.value.set(p===m?"":m)})},style:{cursor:"pointer",fontSize:n=>g(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>l(n,"shift-3",r.get(n)),color:n=>l(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ca(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>l(i,"inherit",r),outline:i=>`1px solid ${l(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function ka(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=f(r),n=f(o),a=null,c={span:y=>n.get(y)},{show:u,hide:m,anchorPartial:h}=oe({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:y=>{let v=y.attributes.get("id");a=v||y.nodeId,!v&&y.attributes.set("id",a)},style:{paddingBlock:y=>s(b(y)*1),paddingInline:y=>s(b(y)*3),borderRadius:y=>s(b(y)*1),color:y=>l(y,"shift-9"),backgroundColor:y=>l(y),fontSize:y=>g(y,"inherit")},$:[qt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),R(h,{onMouseEnter:()=>u(),onMouseLeave:()=>m(),onFocus:()=>u(),onBlur:()=>m(),onKeyDown:y=>y.key==="Escape"&&m(),_onMount:y=>a&&y.attributes.set("ariaDescribedby",a)}),h}function fn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Ea(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,a)=>{if(!(n instanceof B))return;let c=n.domElement;c&&o.set(fn(n,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,a)=>{if(!(n instanceof B))return;let c=n.domElement;if(!c)return;let u=fn(n,a),m=o.get(u);if(!m)return;let h=c.getBoundingClientRect(),d=m.left-h.left,p=m.top-h.top;if(Math.abs(d)<.5&&Math.abs(p)<.5)return;let y=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${d}px, ${p}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=y,c.style.transform=v,c.removeEventListener("transitionend",w)},w=C=>{C.propertyName==="transform"&&x()};c.addEventListener("transitionend",w),setTimeout(x,t+r+34)}),o.clear()}}}function _a(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}return $n(Ta);})();
6
6
  //# sourceMappingURL=core-theme-ui.global.js.map