@domphy/ui 0.6.0 → 0.8.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 Pe=Object.defineProperty,To=Object.defineProperties,_o=Object.getOwnPropertyDescriptor,Oo=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertyNames,Oe=Object.getOwnPropertySymbols;var Fe=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable;var bt=(e,t,i)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,P=(e,t)=>{for(var i in t||(t={}))Fe.call(t,i)&&bt(e,i,t[i]);if(Oe)for(var i of Oe(t))vt.call(t,i)&&bt(e,i,t[i]);return e},N=(e,t)=>To(e,Oo(t));var Ue=(e,t)=>{var i={};for(var o in e)Fe.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(e!=null&&Oe)for(var o of Oe(e))t.indexOf(o)<0&&vt.call(e,o)&&(i[o]=e[o]);return i};var Re=(e,t)=>{for(var i in t)Pe(e,i,{get:t[i],enumerable:!0})},Ro=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Po(t))!Fe.call(e,r)&&r!==i&&Pe(e,r,{get:()=>t[r],enumerable:!(o=_o(t,r))||o.enumerable});return e};var $o=e=>Ro(Pe({},"__esModule",{value:!0}),e);var j=(e,t,i)=>new Promise((o,r)=>{var n=m=>{try{c(i.next(m))}catch(u){r(u)}},a=m=>{try{c(i.throw(m))}catch(u){r(u)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(n,a);c((i=i.apply(e,t)).next())});var Qi={};Re(Qi,{core:()=>Ie,theme:()=>Ae,ui:()=>je});var Ie={};Re(Ie,{AttributeList:()=>zt,BooleanAttributes:()=>Je,CamelAttributes:()=>It,ElementList:()=>Lt,ElementNode:()=>R,HtmlTags:()=>Xe,Notifier:()=>$e,PrefixCSS:()=>ee,RecordState:()=>Ko,State:()=>Ke,SvgTags:()=>$t,VoidTags:()=>Rt,hashString:()=>me,merge:()=>_,r:()=>Vo,toState:()=>f});var Io=Object.defineProperty,St=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Ct=(e,t,i)=>t in e?Io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,xt=(e,t)=>{for(var i in t||(t={}))zo.call(t,i)&&Ct(e,i,t[i]);if(St)for(var i of St(t))Lo.call(t,i)&&Ct(e,i,t[i]);return e},Ao=["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"],No=Ao.reduce((e,t)=>{let i=t.slice(2).toLowerCase();return e[i]=t,e},{}),Xe=["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"],D=[],Mo=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},wt=100,$e=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 i=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(i)),i}removeListener(e,t){if(!this._listeners)return;let i=this._listeners[e];i&&i.has(t)&&(i.delete(t),i.size===0&&delete this._listeners[e])}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let i=D.length?D[D.length-1]:null;if(i&&i[0]===this&&i[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=wt){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${wt} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...D]})}this._scheduled||(this._scheduled=!0,Mo(()=>this._flushAll()))}_isCircular(e){let t=D.findIndex(([o,r])=>o===this&&r===e);if(t===-1)return!1;let i=[...D.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
- ${i.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:i,chain:o}]of e)D=o,this._flush(t,i);D=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let i=this._listeners[e];if(i){D.push([this,e]),this._flushing.set(e,t);for(let o of[...i])if(i.has(o))try{o(...t)}catch(r){console.error(r)}this._flushing.delete(e),D.pop()}}},Ke=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new $e,this.initialValue=e,this._value=e}get(e){return e&&this.addListener(e),this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function _(e={},t={}){let i=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],r=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=q(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]=_(e[n],a):e[n]=a;else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[u,h].filter(d=>d).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(r.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[u,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]=m=>{let u=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[u,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();Bo(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");Do(e,c,a)}else e[n]=a}return e}function me(e=""){let t=2166136261;for(let i=0;i<e.length;i++)t^=e.charCodeAt(i),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof Ke||e!=null&&e._isState?e:new Ke(e,t)}function Vo(e){return e}function Do(e,t,i){let o=`_on${t}`,r=e[o];typeof r=="function"?e[o]=(...n)=>{r(...n),i(...n)}:e[o]=i}function Bo(e,t,i){let o=No[t];if(!o)throw Error(`invalid event name "${t}"`);let r=e[o];typeof r=="function"?e[o]=(n,a)=>{r(n,a),i(n,a)}:e[o]=i}function q(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let r of e)o.push(q(r,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[r,n]of e)o.set(q(r,t),q(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let r of e)o.add(q(r,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(i),t.set(e,o);for(let r of Reflect.ownKeys(e))o[r]=q(e[r],t);return o}function kt(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let i=Object.keys(e);for(let o=0;o<i.length;o++){let r=i[o],n=e[r];if(o==0&&!Xe.includes(r)&&!r.includes("-")&&!t)throw Error(`key ${r} is not valid HTML tag name`);if(r=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(r=="$")e.$.forEach(a=>kt(a,!0));else{if(r.startsWith("_on")&&typeof n!="function")throw Error(`hook ${r} value "${n}" must be a function `);if(r.startsWith("on")&&typeof n!="function")throw Error(`event ${r} value "${n}" must be a function `);if(r=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(r=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(r=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(r=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function Et(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function Tt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function _t(e){return Object.keys(e).find(t=>Xe.includes(t))}function Ot(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ho(e){if(e.indexOf("@")===0)return[e];for(var t=[],i=0,o=0,r="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")i+=1;else if(c===")")i-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!i&&!o){t.push(r.trim()),r="";continue}r+=c}return t.push(r.trim()),t}function qe(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 jo(e,t){for(let i=0;i<e.length;i++){let o=e[i],r=null;typeof o.selectorText=="string"?r=qe(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(r=qe(o.cssText.split("{")[0])),r&&!t.has(r)&&t.set(r,o)}return t}function Pt(e){var t;let i=e.querySelector("#domphy-style");return i||(i=document.createElement("style"),i.id="domphy-style",e.appendChild(i)),i.dataset.domphyBase!=="true"&&((t=i.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),i.dataset.domphyBase="true"),i}var Ge=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(i=>_(t,Ge(i))),delete e.$,_(t,e),t}else return e},Rt=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],$t=["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"],Je=["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"],ee={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"]},It=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Wo=class{constructor(e,t,i){this._notifier=new $e,this._releases=[],this.parent=i,this.isBoolean=Je.includes(e),It.includes(e)?this.name=e:this.name=Ot(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,i;let o=this.value;if(this._releases.length){for(let r of this._releases)r();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let r=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e(r):e(r),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};r.elementNode=this.parent,r.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(i=this.parent)==null?void 0:i.nodeId} attribute:${this.name}`,r.onSubscribe=n=>{this._releases.push(n),this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),r=null})},this.value=this.isBoolean?!!e(r):e(r)}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=i=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",i)},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 i=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${Tt(String(i))}"`}}},zt=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 Wo(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(!Je.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,r)=>{let n=(o||"").split(" ").filter(a=>a);return!n.includes(r)&&n.push(e),n.join(" ")},i=this.get("class");typeof i=="function"?this.set("class",()=>t(i(),e)):this.set("class",t(i,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(i=>i).filter(i=>i!==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))}},Fo=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Et(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;":Et(this.text)?this.text:Tt(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},Lt=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new R(e,this.owner,this._nextKey++):new Fo(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let i=this.owner.domElement,o=e instanceof R?e.domElement:e.domText;if(o){let r=i.childNodes[t]||null;o!==r&&i.insertBefore(o,r)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let i=this.owner.domElement,o=e instanceof R?e.domElement:e.domText,r=t instanceof R?t.domElement:t.domText;if(!o||!r)return;let n=o.nextSibling,a=r.nextSibling;i.insertBefore(o,a),i.insertBefore(r,n)}update(e,t=!0,i=!1){var o,r,n,a;let c=this.items.slice(),m=new Map;for(let b of c)b instanceof R&&b.key!==null&&b.key!==void 0&&m.set(b.key,b);!i&&this.owner.domElement&&((r=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||r.call(o,this.owner,e));let u=new Set(c),h=new Set;for(let b=0;b<e.length;b++){let p=e[b],v=typeof p=="object"&&p!==null,C=v?p._key:void 0,S=v?_t(p):void 0;if(C!==void 0){let x=m.get(C);if(x instanceof R&&x.tagName===S){m.delete(C);let w=this.items.indexOf(x);if(w!==b&&w>=0){let E=!!x._portal;this.move(w,b,E?!1:t,!0)}x.parent=this.owner,x.patch(p),h.add(x);continue}}else if(v){let x=this.items[b];if(x instanceof R&&x.key==null&&x.tagName===S&&u.has(x)&&!h.has(x)){x.parent=this.owner,x.patch(p),h.add(x);continue}}h.add(this.insert(p,b,t,!0))}let d=this.items.slice(e.length);for(let b of d)this.remove(b,t,!0);m.forEach(b=>this.remove(b,t,!0)),i||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,i=!0,o=!1){var r,n;let a=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>a?a:t,m=this._createNode(e);if(this.items.splice(c,0,m),m instanceof R){m._hooks.Insert&&m._hooks.Insert(m);let u=this.owner.domElement;if(i&&u)if(m._portal){let h=m._portal(this.owner.getRoot());h&&m.render(h)}else{let h=m._createDOMNode(),d=(r=u.childNodes[c])!=null?r:null;u.insertBefore(h,d);let b=u.getRootNode(),p=b instanceof ShadowRoot?b:document.head,v=Pt(p);m.styles.render(v),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(C=>{if(C instanceof R&&C._portal){let S=C._portal(C.getRoot());S&&C.render(S)}else C.render(h)})}}else{let u=this.owner.domElement;if(i&&u){let h=m._createDOMNode(),d=(n=u.childNodes[c])!=null?n:null;u.insertBefore(h,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(e,t=!0,i=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof R){if(e._beforeRemoveFired)return;let r=()=>{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,r())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,a),e._hooks.BeforeRemove.length<2&&!n&&a()}else r()}else{let r=e.domText;this.items.splice(o,1),t&&r&&r.remove(),e._dispose()}!i&&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 i=this.items.slice();for(let o of i)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,i=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let r=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=r,i&&this._swapDomElement(r,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,i=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let r=this.items[e];this.items.splice(e,1),this.items.splice(t,0,r),i&&this._moveDomElement(r,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}},Uo=class{constructor(e,t,i){this.value="",this.name=e,this.cssName=Ot(e),this.parentRule=i,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)),ee[this.name]&&ee[this.name].forEach(i=>{t.setProperty(`-${i}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,i,o,r;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:${(i=(t=this.parentRule)==null?void 0:t.root)==null?void 0:i.tagName}_${(r=(o=this.parentRule)==null?void 0:o.root)==null?void 0:r.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),ee[this.name]&&ee[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 ee[this.name]&&ee[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},Q=class Ye{constructor(t,i){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new At(this),this.parent=i}_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 Ye;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Ye;)t=t.parent;return t}insertStyle(t,i){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(i):this.styleBlock[t]=new Uo(t,i,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(";"),i=this.styleList.cssText();return`${this.selectorText} { ${t} ${i} } `}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,i=t.cssRules;for(let o=0;o<i.length;o++)if(i[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let i=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),r=t.cssRules[o];"cssRules"in r&&(this.mount(r),this.styleList.render(r))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),r=t.insertRule(o,t.cssRules.length),n=t.cssRules[r];this.mount(n)}}else{let o=`${this.selectorText} { ${i} }`,r=t.insertRule(o,t.cssRules.length),n=t.cssRules[r];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},At=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof Q;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let i={};function o(r,n){return r.startsWith("&")?`${n}${r.slice(1)}`:`${n} ${r}`}for(let r in e){let n=e[r],a=Ho(r);for(let c of a){let m=o(c,t);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof n=="object"&&n!=null){let u=new Q(c,this.parent);u.styleList.addCSS(n,t),this.items.push(u)}}else if(c.startsWith("@keyframes")){let u=new Q(c,this.parent);u.styleList.addCSS(n,""),this.items.push(u)}else if(c.startsWith("@font-face")){let u=new Q(c,this.parent);for(let h in n)u.insertStyle(h,n[h]);this.items.push(u)}else if(typeof n=="object"&&n!=null){let u=new Q(m,this.parent);this.items.push(u);for(let[h,d]of Object.entries(n))if(typeof d=="object"&&d!=null){let b=o(h,m);h.startsWith("&")?this.addCSS(d,b):u.styleList.insertRule(b).styleList.addCSS(d,b)}else u.insertStyle(h,d)}else i[c]=n}}if(Object.keys(i).length){let r=new Q(t,this.parent);for(let n in i)r.insertStyle(n,i[n]);this.items.push(r)}}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(i=>i.selectorText===e);return t||(t=new Q(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let i=e.get(qe(t.selectorText));i&&t.mount(i)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,i=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,r)=>{let n=r-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==i(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}},R=class ce{constructor(t,i=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new Lt(this),this.styles=new At(this),this.attributes=new zt(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var r,n;t=q(t),kt(t),t.style=t.style||{},this.parent=i,this.tagName=_t(t),t=Ge(t),this.key=(r=t._key)!=null?r: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||{},(u,h)=>typeof h=="function"?a:h);this.nodeId=me(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let m=t[this.tagName];if(m!=null&&m!=null)if(typeof m=="function"){let u=()=>{if(this._disposed)return;let h=m(u);this.children.update(Array.isArray(h)?h:[h])};u.elementNode=this,u.debug=`class:${this.tagName}_${this.nodeId} children`,u.onSubscribe=h=>this.addHook("BeforeRemove",()=>{h(),u=null}),u&&u()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=$t.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 i in this._events)this._bindEvent(i);return this.attributes&&Object.values(this.attributes.items).forEach(i=>i.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let i=o=>{var r,n;return(n=(r=this._events)==null?void 0:r[t])==null?void 0:n.call(r,o,this)};this.domElement.addEventListener(t,i),this.addHook("BeforeRemove",o=>{var r;(r=o.domElement)==null||r.removeEventListener(t,i),i=null})}_dispose(){var t,i,o,r;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(i=(t=this._hooks).BeforeRemove)==null||i.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(),(r=(o=this._hooks).Remove)==null||r.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){_(this._context,t._context),_(this._metadata,t._metadata);let i=Object.keys(t);for(let o=0;o<i.length;o++){let r=i[o],n=t[r];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(r)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(r)?this.addHook(r.substring(3),n):r.startsWith("on")?this.addEvent(r.substring(2).toLowerCase(),n):r=="_portal"?this._portal=n:r=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(r,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){let i=q(t);i.style=i.style||{},i=Ge(i);let o=i[this.tagName];if(typeof o!="function"){let u=o==null?[]:Array.isArray(o)?o:[o];this.children.update(u,!!this.domElement,!0)}i._context&&_(this._context,i._context),i._metadata&&_(this._metadata,i._metadata);let r=`${this.tagName}_${this.nodeId}`,n=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],a=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"],c=new Set(["class"]),m=null;this._events={};for(let u of Object.keys(i)){if(n.includes(u)||a.includes(u)||u==="_portal")continue;let h=i[u];u.startsWith("on")&&typeof h=="function"?this.addEvent(u.substring(2).toLowerCase(),h):u==="class"&&typeof h=="string"?m=h:(this.attributes.set(u,h),c.add(u))}if(this.attributes.set("class",m?`${r} ${m}`:r),this.attributes.items)for(let u of Object.keys(this.attributes.items))c.has(u)||this.attributes.remove(u);if(this._events)for(let u in this._events)this._bindEvent(u)}addEvent(t,i){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(r,n)=>{o(r,n),i(r,n)}:this._events[t]=i}addHook(t,i){let o=this._hooks[t];if(typeof o=="function"){let r=((...n)=>{o(...n),i(...n)});try{Object.defineProperty(r,"length",{value:Math.max(o.length,i.length),configurable:!0})}catch(n){}this._hooks[t]=r}else this._hooks[t]=i}getRoot(){let t=this;for(;t&&t instanceof ce&&t.parent;)t=t.parent;return t}getContext(t){let i=this;for(;i&&(!i._context||!Object.prototype.hasOwnProperty.call(i._context,t));)i=i.parent;return i&&i._context?i._context[t]:void 0}setContext(t,i){this._context=this._context||{},this._context[t]=i}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,i){this._metadata=this._metadata||{},this._metadata[t]=i}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(i=>i instanceof ce?i.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(Rt.includes(this.tagName))return`<${this.tagName}${t}>`;let i=this.children.generateHTML();return`<${this.tagName}${t}>${i}</${this.tagName}>`}mount(t,i){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,r)=>{let n=t.childNodes[r];n&&(o instanceof ce?o.mount(n):o.domText=n)}),i){let o=i.sheet;o&&this._hydrateStyles(jo(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var i;if((i=this.styles)==null||i.hydrate(t),this.children)for(let o of this.children.items)o instanceof ce&&o._hydrateStyles(t)}render(t){let i=this._createDOMNode();t.appendChild(i),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,r=t.getRootNode(),n=r instanceof ShadowRoot?r:document.head;return o||(o=Pt(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(i)}),i}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var i;(i=this.domElement)==null||i.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let i=!1,o=()=>{i||(i=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!i&&o()}else t()}}},Ko=class{constructor(e){this._notifier=new $e,this.initialRecord=xt({},e),this._record=xt({},e)}get(e,t){return t&&this._notifier.addListener(e,t),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 Ae={};Re(Ae,{getTheme:()=>B,setTheme:()=>Xo,themeApply:()=>Zo,themeCSS:()=>Ze,themeColor:()=>l,themeColorToken:()=>nt,themeDensity:()=>g,themeName:()=>Le,themeSize:()=>y,themeSpacing:()=>s,themeTokens:()=>Dt,themeVars:()=>ye});var qo={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},be=qo,tt=e=>JSON.parse(JSON.stringify(e)),Mt=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),ue={light:tt(be),dark:Jo(be)};function ot(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Go(e){for(let t in e)if(!Object.keys(be).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}}function Vt(e,t){var i;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((i=e[o])!=null||(e[o]={}),Vt(e[o],t[o])):e[o]=t[o]}function Yo(e,t){let i={},o=ot(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(m=>i[`--${c}-${m}`]=t.colors[c][m]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>i[`--fontSize-${c}`]=t.fontSizes[c]);else if(n==="custom"&&a&&typeof a=="object")for(let c in a)i[`--custom-${Mt(c)}`]=a[c]}let r="";for(let n in i)r+=` ${n}: ${i[n]};
1
+ "use strict";var Domphy=(()=>{var Re=Object.defineProperty,Oo=Object.defineProperties,Po=Object.getOwnPropertyDescriptor,Ro=Object.getOwnPropertyDescriptors,$o=Object.getOwnPropertyNames,Pe=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable;var vt=(e,t,i)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,P=(e,t)=>{for(var i in t||(t={}))Ke.call(t,i)&&vt(e,i,t[i]);if(Pe)for(var i of Pe(t))St.call(t,i)&&vt(e,i,t[i]);return e},M=(e,t)=>Oo(e,Ro(t));var Ue=(e,t)=>{var i={};for(var o in e)Ke.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(e!=null&&Pe)for(var o of Pe(e))t.indexOf(o)<0&&St.call(e,o)&&(i[o]=e[o]);return i};var $e=(e,t)=>{for(var i in t)Re(e,i,{get:t[i],enumerable:!0})},Io=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $o(t))!Ke.call(e,r)&&r!==i&&Re(e,r,{get:()=>t[r],enumerable:!(o=Po(t,r))||o.enumerable});return e};var Lo=e=>Io(Re({},"__esModule",{value:!0}),e);var j=(e,t,i)=>new Promise((o,r)=>{var n=m=>{try{c(i.next(m))}catch(u){r(u)}},a=m=>{try{c(i.throw(m))}catch(u){r(u)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(n,a);c((i=i.apply(e,t)).next())});var or={};$e(or,{core:()=>Le,theme:()=>Me,ui:()=>We});var Le={};$e(Le,{AttributeList:()=>zt,BooleanAttributes:()=>Ze,CamelAttributes:()=>Lt,ElementList:()=>At,ElementNode:()=>R,HtmlTags:()=>Je,Notifier:()=>Ie,PrefixCSS:()=>ee,RecordState:()=>Go,State:()=>qe,SvgTags:()=>It,VoidTags:()=>$t,hashString:()=>me,merge:()=>_,r:()=>Bo,toState:()=>d});var zo=Object.defineProperty,xt=Object.getOwnPropertySymbols,Ao=Object.prototype.hasOwnProperty,Mo=Object.prototype.propertyIsEnumerable,Ct=(e,t,i)=>t in e?zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,wt=(e,t)=>{for(var i in t||(t={}))Ao.call(t,i)&&Ct(e,i,t[i]);if(xt)for(var i of xt(t))Mo.call(t,i)&&Ct(e,i,t[i]);return e},No=["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"],Vo=No.reduce((e,t)=>{let i=t.slice(2).toLowerCase();return e[i]=t,e},{}),Je=["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"],D=[],Do=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},Et=100,Ie=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 i=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(i)),i}removeListener(e,t){if(!this._listeners)return;let i=this._listeners[e];i&&i.has(t)&&(i.delete(t),i.size===0&&delete this._listeners[e])}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let i=D.length?D[D.length-1]:null;if(i&&i[0]===this&&i[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=Et){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${Et} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...D]})}this._scheduled||(this._scheduled=!0,Do(()=>this._flushAll()))}_isCircular(e){let t=D.findIndex(([o,r])=>o===this&&r===e);if(t===-1)return!1;let i=[...D.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
+ ${i.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:i,chain:o}]of e)D=o,this._flush(t,i);D=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let i=this._listeners[e];if(i){D.push([this,e]),this._flushing.set(e,t);for(let o of[...i])if(i.has(o))try{o(...t)}catch(r){console.error(r)}this._flushing.delete(e),D.pop()}}},qe=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Ie,this.initialValue=e,this._value=e}get(e){return e&&this.addListener(e),this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function _(e={},t={}){let i=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],r=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=q(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]=_(e[n],a):e[n]=a;else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[u,h].filter(f=>f).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(r.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[u,h].filter(f=>f).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]=m=>{let u=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[u,h].filter(f=>f).join(" ")}}else e[n]=[e[n],a].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();jo(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");Ho(e,c,a)}else e[n]=a}return e}function me(e=""){let t=2166136261;for(let i=0;i<e.length;i++)t^=e.charCodeAt(i),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function d(e,t){return e instanceof qe||e!=null&&e._isState?e:new qe(e,t)}function Bo(e){return e}function Ho(e,t,i){let o=`_on${t}`,r=e[o];typeof r=="function"?e[o]=(...n)=>{r(...n),i(...n)}:e[o]=i}function jo(e,t,i){let o=Vo[t];if(!o)throw Error(`invalid event name "${t}"`);let r=e[o];typeof r=="function"?e[o]=(n,a)=>{r(n,a),i(n,a)}:e[o]=i}function q(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let r of e)o.push(q(r,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[r,n]of e)o.set(q(r,t),q(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let r of e)o.add(q(r,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(i),t.set(e,o);for(let r of Reflect.ownKeys(e))o[r]=q(e[r],t);return o}function Tt(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let i=Object.keys(e);for(let o=0;o<i.length;o++){let r=i[o],n=e[r];if(o==0&&!Je.includes(r)&&!r.includes("-")&&!t)throw Error(`key ${r} is not valid HTML tag name`);if(r=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(r=="$")e.$.forEach(a=>Tt(a,!0));else{if(r.startsWith("_on")&&typeof n!="function")throw Error(`hook ${r} value "${n}" must be a function `);if(r.startsWith("on")&&typeof n!="function")throw Error(`event ${r} value "${n}" must be a function `);if(r=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(r=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(r=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(r=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function kt(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function _t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ot(e){return Object.keys(e).find(t=>Je.includes(t))}function Pt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Wo(e){if(e.indexOf("@")===0)return[e];for(var t=[],i=0,o=0,r="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")i+=1;else if(c===")")i-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!i&&!o){t.push(r.trim()),r="";continue}r+=c}return t.push(r.trim()),t}function Ge(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 Fo(e,t){for(let i=0;i<e.length;i++){let o=e[i],r=null;typeof o.selectorText=="string"?r=Ge(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(r=Ge(o.cssText.split("{")[0])),r&&!t.has(r)&&t.set(r,o)}return t}function Rt(e){var t;let i=e.querySelector("#domphy-style");return i||(i=document.createElement("style"),i.id="domphy-style",e.appendChild(i)),i.dataset.domphyBase!=="true"&&((t=i.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),i.dataset.domphyBase="true"),i}var Ye=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(i=>_(t,Ye(i))),delete e.$,_(t,e),t}else return e},$t=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],It=["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"],Ze=["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"],ee={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"]},Lt=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Ko=class{constructor(e,t,i){this._notifier=new Ie,this._releases=[],this.parent=i,this.isBoolean=Ze.includes(e),Lt.includes(e)?this.name=e:this.name=Pt(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,i;let o=this.value;if(this._releases.length){for(let r of this._releases)r();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let r=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e(r):e(r),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};r.elementNode=this.parent,r.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(i=this.parent)==null?void 0:i.nodeId} attribute:${this.name}`,r.onSubscribe=n=>{this._releases.push(n),this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),r=null})},this.value=this.isBoolean?!!e(r):e(r)}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=i=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",i)},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 i=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${_t(String(i))}"`}}},zt=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 Ko(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(!Ze.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,r)=>{let n=(o||"").split(" ").filter(a=>a);return!n.includes(r)&&n.push(e),n.join(" ")},i=this.get("class");typeof i=="function"?this.set("class",()=>t(i(),e)):this.set("class",t(i,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(i=>i).filter(i=>i!==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))}},Uo=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(kt(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;":kt(this.text)?this.text:_t(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},At=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new R(e,this.owner,this._nextKey++):new Uo(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let i=this.owner.domElement,o=e instanceof R?e.domElement:e.domText;if(o){let r=i.childNodes[t]||null;o!==r&&i.insertBefore(o,r)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let i=this.owner.domElement,o=e instanceof R?e.domElement:e.domText,r=t instanceof R?t.domElement:t.domText;if(!o||!r)return;let n=o.nextSibling,a=r.nextSibling;i.insertBefore(o,a),i.insertBefore(r,n)}update(e,t=!0,i=!1){var o,r,n,a;let c=this.items.slice(),m=new Map;for(let b of c)b instanceof R&&b.key!==null&&b.key!==void 0&&m.set(b.key,b);!i&&this.owner.domElement&&((r=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||r.call(o,this.owner,e));let u=new Set(c),h=new Set;for(let b=0;b<e.length;b++){let p=e[b],v=typeof p=="object"&&p!==null,x=v?p._key:void 0,S=v?Ot(p):void 0;if(x!==void 0){let C=m.get(x);if(C instanceof R&&C.tagName===S){m.delete(x);let w=this.items.indexOf(C);if(w!==b&&w>=0){let E=!!C._portal;this.move(w,b,E?!1:t,!0)}C.parent=this.owner,C.patch(p),h.add(C);continue}}else if(v){let C=this.items[b];if(C instanceof R&&C.key==null&&C.tagName===S&&u.has(C)&&!h.has(C)){C.parent=this.owner,C.patch(p),h.add(C);continue}}h.add(this.insert(p,b,t,!0))}let f=this.items.slice(e.length);for(let b of f)this.remove(b,t,!0);m.forEach(b=>this.remove(b,t,!0)),i||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,i=!0,o=!1){var r,n;let a=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>a?a:t,m=this._createNode(e);if(this.items.splice(c,0,m),m instanceof R){m._hooks.Insert&&m._hooks.Insert(m);let u=this.owner.domElement;if(i&&u)if(m._portal){let h=m._portal(this.owner.getRoot());h&&m.render(h)}else{let h=m._createDOMNode(),f=(r=u.childNodes[c])!=null?r:null;u.insertBefore(h,f);let b=u.getRootNode(),p=b instanceof ShadowRoot?b:document.head,v=Rt(p);m.styles.render(v),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(x=>{if(x instanceof R&&x._portal){let S=x._portal(x.getRoot());S&&x.render(S)}else x.render(h)})}}else{let u=this.owner.domElement;if(i&&u){let h=m._createDOMNode(),f=(n=u.childNodes[c])!=null?n:null;u.insertBefore(h,f)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(e,t=!0,i=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof R){if(e._beforeRemoveFired)return;let r=()=>{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,r())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,a),e._hooks.BeforeRemove.length<2&&!n&&a()}else r()}else{let r=e.domText;this.items.splice(o,1),t&&r&&r.remove(),e._dispose()}!i&&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 i=this.items.slice();for(let o of i)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,i=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let r=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=r,i&&this._swapDomElement(r,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,i=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let r=this.items[e];this.items.splice(e,1),this.items.splice(t,0,r),i&&this._moveDomElement(r,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}},qo=class{constructor(e,t,i){this.value="",this.name=e,this.cssName=Pt(e),this.parentRule=i,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)),ee[this.name]&&ee[this.name].forEach(i=>{t.setProperty(`-${i}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,i,o,r;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:${(i=(t=this.parentRule)==null?void 0:t.root)==null?void 0:i.tagName}_${(r=(o=this.parentRule)==null?void 0:o.root)==null?void 0:r.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),ee[this.name]&&ee[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 ee[this.name]&&ee[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},Q=class Xe{constructor(t,i){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new Mt(this),this.parent=i}_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 Xe;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Xe;)t=t.parent;return t}insertStyle(t,i){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(i):this.styleBlock[t]=new qo(t,i,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(";"),i=this.styleList.cssText();return`${this.selectorText} { ${t} ${i} } `}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,i=t.cssRules;for(let o=0;o<i.length;o++)if(i[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let i=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),r=t.cssRules[o];"cssRules"in r&&(this.mount(r),this.styleList.render(r))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),r=t.insertRule(o,t.cssRules.length),n=t.cssRules[r];this.mount(n)}}else{let o=`${this.selectorText} { ${i} }`,r=t.insertRule(o,t.cssRules.length),n=t.cssRules[r];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Mt=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof Q;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let i={};function o(r,n){return r.startsWith("&")?`${n}${r.slice(1)}`:`${n} ${r}`}for(let r in e){let n=e[r],a=Wo(r);for(let c of a){let m=o(c,t);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof n=="object"&&n!=null){let u=new Q(c,this.parent);u.styleList.addCSS(n,t),this.items.push(u)}}else if(c.startsWith("@keyframes")){let u=new Q(c,this.parent);u.styleList.addCSS(n,""),this.items.push(u)}else if(c.startsWith("@font-face")){let u=new Q(c,this.parent);for(let h in n)u.insertStyle(h,n[h]);this.items.push(u)}else if(typeof n=="object"&&n!=null){let u=new Q(m,this.parent);this.items.push(u);for(let[h,f]of Object.entries(n))if(typeof f=="object"&&f!=null){let b=o(h,m);h.startsWith("&")?this.addCSS(f,b):u.styleList.insertRule(b).styleList.addCSS(f,b)}else u.insertStyle(h,f)}else i[c]=n}}if(Object.keys(i).length){let r=new Q(t,this.parent);for(let n in i)r.insertStyle(n,i[n]);this.items.push(r)}}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(i=>i.selectorText===e);return t||(t=new Q(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let i=e.get(Ge(t.selectorText));i&&t.mount(i)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,i=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,r)=>{let n=r-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==i(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}},R=class ce{constructor(t,i=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new At(this),this.styles=new Mt(this),this.attributes=new zt(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var r,n;t=q(t),Tt(t),t.style=t.style||{},this.parent=i,this.tagName=Ot(t),t=Ye(t),this.key=(r=t._key)!=null?r: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||{},(u,h)=>typeof h=="function"?a:h);this.nodeId=me(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let m=t[this.tagName];if(m!=null&&m!=null)if(typeof m=="function"){let u=()=>{if(this._disposed)return;let h=m(u);this.children.update(Array.isArray(h)?h:[h])};u.elementNode=this,u.debug=`class:${this.tagName}_${this.nodeId} children`,u.onSubscribe=h=>this.addHook("BeforeRemove",()=>{h(),u=null}),u&&u()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=It.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 i in this._events)this._bindEvent(i);return this.attributes&&Object.values(this.attributes.items).forEach(i=>i.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let i=o=>{var r,n;return(n=(r=this._events)==null?void 0:r[t])==null?void 0:n.call(r,o,this)};this.domElement.addEventListener(t,i),this.addHook("BeforeRemove",o=>{var r;(r=o.domElement)==null||r.removeEventListener(t,i),i=null})}_dispose(){var t,i,o,r;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(i=(t=this._hooks).BeforeRemove)==null||i.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(),(r=(o=this._hooks).Remove)==null||r.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){_(this._context,t._context),_(this._metadata,t._metadata);let i=Object.keys(t);for(let o=0;o<i.length;o++){let r=i[o],n=t[r];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(r)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(r)?this.addHook(r.substring(3),n):r.startsWith("on")?this.addEvent(r.substring(2).toLowerCase(),n):r=="_portal"?this._portal=n:r=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(r,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){let i=q(t);i.style=i.style||{},i=Ye(i);let o=i[this.tagName];if(typeof o!="function"){let u=o==null?[]:Array.isArray(o)?o:[o];this.children.update(u,!!this.domElement,!0)}i._context&&_(this._context,i._context),i._metadata&&_(this._metadata,i._metadata);let r=`${this.tagName}_${this.nodeId}`,n=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],a=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"],c=new Set(["class"]),m=null;this._events={};for(let u of Object.keys(i)){if(n.includes(u)||a.includes(u)||u==="_portal")continue;let h=i[u];u.startsWith("on")&&typeof h=="function"?this.addEvent(u.substring(2).toLowerCase(),h):u==="class"&&typeof h=="string"?m=h:(this.attributes.set(u,h),c.add(u))}if(this.attributes.set("class",m?`${r} ${m}`:r),this.attributes.items)for(let u of Object.keys(this.attributes.items))c.has(u)||this.attributes.remove(u);if(this._events)for(let u in this._events)this._bindEvent(u)}addEvent(t,i){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(r,n)=>{o(r,n),i(r,n)}:this._events[t]=i}addHook(t,i){let o=this._hooks[t];if(typeof o=="function"){let r=((...n)=>{o(...n),i(...n)});try{Object.defineProperty(r,"length",{value:Math.max(o.length,i.length),configurable:!0})}catch(n){}this._hooks[t]=r}else this._hooks[t]=i}getRoot(){let t=this;for(;t&&t instanceof ce&&t.parent;)t=t.parent;return t}getContext(t){let i=this;for(;i&&(!i._context||!Object.prototype.hasOwnProperty.call(i._context,t));)i=i.parent;return i&&i._context?i._context[t]:void 0}setContext(t,i){this._context=this._context||{},this._context[t]=i}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,i){this._metadata=this._metadata||{},this._metadata[t]=i}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(i=>i instanceof ce?i.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if($t.includes(this.tagName))return`<${this.tagName}${t}>`;let i=this.children.generateHTML();return`<${this.tagName}${t}>${i}</${this.tagName}>`}mount(t,i){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,r)=>{let n=t.childNodes[r];n&&(o instanceof ce?o.mount(n):o.domText=n)}),i){let o=i.sheet;o&&this._hydrateStyles(Fo(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var i;if((i=this.styles)==null||i.hydrate(t),this.children)for(let o of this.children.items)o instanceof ce&&o._hydrateStyles(t)}render(t){let i=this._createDOMNode();t.appendChild(i),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,r=t.getRootNode(),n=r instanceof ShadowRoot?r:document.head;return o||(o=Rt(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(i)}),i}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var i;(i=this.domElement)==null||i.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let i=!1,o=()=>{i||(i=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!i&&o()}else t()}}},Go=class{constructor(e){this._notifier=new Ie,this.initialRecord=wt({},e),this._record=wt({},e)}get(e,t){return t&&this._notifier.addListener(e,t),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 Me={};$e(Me,{getTheme:()=>B,setTheme:()=>Zo,themeApply:()=>en,themeCSS:()=>Qe,themeColor:()=>l,themeColorToken:()=>it,themeDensity:()=>g,themeName:()=>Ae,themeSize:()=>y,themeSpacing:()=>s,themeTokens:()=>Bt,themeVars:()=>be});var Yo={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:{}},ve=Yo,ot=e=>JSON.parse(JSON.stringify(e)),Vt=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),ue={light:ot(ve),dark:Qo(ve)};function nt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Xo(e){for(let t in e)if(!Object.keys(ve).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 Dt(e,t){var i;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((i=e[o])!=null||(e[o]={}),Dt(e[o],t[o])):e[o]=t[o]}function Jo(e,t){let i={},o=nt(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(m=>i[`--${c}-${m}`]=t.colors[c][m]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>i[`--fontSize-${c}`]=t.fontSizes[c]);else if(n==="custom"&&a&&typeof a=="object")for(let c in a)i[`--custom-${Vt(c)}`]=a[c]}let r="";for(let n in i)r+=` ${n}: ${i[n]};
3
3
  `;return`[data-theme="${e}"] {
4
- ${r}}`}function B(e){if(!ue[e])throw Error(`Theme "${e}" not found`);return ue[e]}function Xo(e,t){Go(t),ue[e]||(ue[e]=tt(be)),Vt(ue[e],t)}function Jo(e){let t=tt(e);t.direction="lighten";for(let i in t.colors)t.colors[i].reverse(),t.baseTones[i]=t.colors[i].length-1-t.baseTones[i];return t}function Dt(e){let t=B(e),i=ot(t),o={};for(let r in t){let n=t[r];if(r==="colors")for(let a in t.colors){let c={};[...Array(i).keys()].forEach(m=>c[m]=t.colors[a][m]),o[a]=c}else if(r==="fontSizes")o.fontSizes=t.fontSizes;else if(r==="densities")o.densities=t.densities;else if(r==="custom"&&(o.custom={},n&&typeof n=="object"))for(let a in n)o.custom[a]=n[a]}return o}function ye(){let e=B("light"),t=ot(e),i={};for(let o in e){let r=e[o];if(o==="colors")for(let n in e.colors){let a={};[...Array(t).keys()].forEach(c=>a[c]=`var(--${n}-${c})`),i[n]=a}else if(o==="fontSizes")i.fontSizes=[...Array(8).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(i.custom={},r&&typeof r=="object"))for(let n in r)i.custom[n]=`var(--custom-${Mt(n)})`}return i}function Ze(){return Object.entries(ue).map(([e,t])=>Yo(e,t)).join(`
5
- `)}function Zo(e){var t;if(typeof document!="undefined")if(e){e.textContent=Ze();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Ze(),document.head.appendChild(e)}function s(e){return e/4+"em"}function Le(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let i="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(i=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),i}var Qe=["inherit"];[...Array(8).keys()].forEach(e=>{Qe.push(`decrease-${e}`),Qe.push(`increase-${e}`)});function Bt(e,t="inherit"){if(!Qe.includes(t))throw Error(`size name "${t}" invalid`);let i;if(t=="inherit")i=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);i=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);i=e-o}else i=e;return Math.max(0,Math.min(8,i))}function Qo(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 i=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(i=Bt(i,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),i}function y(e,t="inherit"){let i=Bt(Qo(e),t);return ye().fontSizes[i]}var et=["inherit"];[...Array(5).keys()].forEach(e=>{et.push(`decrease-${e}`),et.push(`increase-${e}`)});function en(e,t="inherit"){if(!et.includes(t))throw Error(`density name "${t}" invalid`);let i;if(t=="inherit")i=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);i=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);i=e-o}else i=e;return Math.max(0,Math.min(4,i))}function tn(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 i=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(i=en(i,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),i}function g(e){let t=tn(e);return B(e?Le(e):"light").densities[t]}var G=be.colors.neutral.length,ze=["inherit","base"];[...Array(G).keys()].forEach(e=>{ze.push(`decrease-${e}`),ze.push(`increase-${e}`),ze.push(`shift-${e}`)});function Nt(e,t){if(e<0||e>G-1)return e;let i=e+t;return i=Math.max(0,Math.min(G-1,i)),i}function on(e,t){if(e<0||e>G-1)return e;let i=Math.floor((G-1)/2),o=e<=i?e+t:e-t;return o=Math.max(0,Math.min(G-1,o)),o}function ve(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!ze.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let i=parseInt(t.replace("increase-",""),10);return Nt(e,i)}else if(t.startsWith("decrease-")){let i=parseInt(t.replace("decrease-",""),10);return Nt(e,-i)}else if(t.startsWith("shift-")){let i=parseInt(t.replace("shift-",""),10);return on(e,i)}else return e}function Ht(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 i=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(i=ve(i,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),i}function jt(e,t,i){return i<=0?e:t==="lighten"&&e===0?i:t==="darken"&&e===G-1?G-1-i:e}function l(e,t="inherit",i="inherit"){let o=i=="inherit"?"neutral":i;if(!e)return t=="base"?ye()[o][B("light").baseTones[o]]:ye()[o][ve(0,t)];let r=Le(e),n;if(t=="base")n=B(r).baseTones[o];else{let c=B(r),m=jt(Ht(e),c.direction,c.darkBias);n=ve(m,t)}let a=ye()[o];if(!a)throw Error(`color "${o}" not found on theme "${r}"`);return a[n]}function nt(e,t="inherit",i="inherit"){let o=i=="inherit"?"neutral":i,r=e?Le(e):"light",n=Dt(r);if(!e)return t=="base"?n[o][B("light").baseTones[o]]:n[o][ve(0,t)];let a;if(t=="base")a=B(r).baseTones[o];else{let c=B(r),m=jt(Ht(e),c.direction,c.darkBias);a=ve(m,t)}return n[o][a]}var je={};Re(je,{abbreviation:()=>nn,alert:()=>pn,avatar:()=>gn,badge:()=>yn,blockquote:()=>qn,breadcrumb:()=>bn,breadcrumbEllipsis:()=>vn,button:()=>Gn,buttonSwitch:()=>Ri,card:()=>rn,code:()=>Xn,combobox:()=>Kn,command:()=>cn,commandItem:()=>un,commandSearch:()=>mn,descriptionList:()=>Zn,details:()=>Jn,dialog:()=>Qn,divider:()=>Hi,drawer:()=>Wi,emphasis:()=>ei,figure:()=>ti,formGroup:()=>oi,heading:()=>ii,horizontalRule:()=>ri,icon:()=>li,image:()=>ai,inputCheckbox:()=>Yn,inputColor:()=>si,inputDateTime:()=>ci,inputFile:()=>mi,inputNumber:()=>di,inputOTP:()=>dn,inputRadio:()=>xi,inputRange:()=>fi,inputSearch:()=>ui,inputSwitch:()=>Pi,inputText:()=>hi,keyboard:()=>pi,label:()=>gi,link:()=>yi,mark:()=>bi,menu:()=>Ji,menuItem:()=>Zi,orderedList:()=>Vi,pagination:()=>Bi,paragraph:()=>vi,popover:()=>Fi,popoverArrow:()=>ut,preformated:()=>Si,progress:()=>Ci,select:()=>wi,selectBox:()=>Oi,selectItem:()=>_i,selectList:()=>Ti,skeleton:()=>Ei,small:()=>$i,spinner:()=>ki,splitter:()=>an,splitterHandle:()=>sn,splitterPanel:()=>ln,strong:()=>Ii,subscript:()=>zi,superscript:()=>Li,tab:()=>Yi,tabPanel:()=>Xi,table:()=>Ai,tabs:()=>Gi,tag:()=>Se,textarea:()=>Ni,toast:()=>Ui,toggle:()=>hn,toggleGroup:()=>fn,tooltip:()=>Ki,transitionGroup:()=>qi,unorderedList:()=>Mi});function nn(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>y(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",i.get(n)),textDecorationColor:n=>l(n,"shift-9",i.get(n))}}}}function rn(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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(g(o)*2),paddingInline:o=>s(g(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(g(o)*4),color:o=>l(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=>l(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 ${l(o,"shift-3",t.get(o))}`}}}}function an(e={}){let{direction:t="horizontal",defaultSize:i=50,min:o=10,max:r=90}=e;return{_onSchedule:(n,a)=>{_(a,{_context:{splitter:{direction:t,size:f(i),min:o,max:r}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function ln(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let i=e.domElement,o=t.direction==="horizontal"?"width":"height";i.style[o]=`${t.size.get()}%`,i.style.flexShrink="0",i.style.overflow="auto";let r=t.size.addListener(n=>{i.style[o]=`${n}%`});e.addHook("Remove",r)}}}function sn(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let i=e.domElement,o=t.direction==="horizontal";i.style.cursor=o?"col-resize":"row-resize";let r=n=>{n.preventDefault();let a=i.parentElement,c=u=>{let h=a.getBoundingClientRect(),d=o?(u.clientX-h.left)/h.width*100:(u.clientY-h.top)/h.height*100;t.size.set(Math.min(Math.max(d,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};i.addEventListener("mousedown",r),e.addHook("Remove",()=>i.removeEventListener("mousedown",r))},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 cn(){return{_onSchedule:(e,t)=>{_(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function mn(e={}){let{color:t="neutral",accentColor:i="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let r=o.getContext("command");if(!r){console.warn('"commandSearch" patch must be used inside a "command"');return}let n=o.domElement,a=()=>r.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},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 ${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",i)}}}}function un(e={}){let{color:t="neutral",accentColor:i="primary"}=e;return{role:"option",_onMount:o=>{var m,u;let r=o.getContext("command");if(!r){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,a=(u=(m=n.textContent)==null?void 0:m.toLowerCase())!=null?u:"",c=r.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=>y(o,"inherit"),height:o=>s(6+g(o)*2),paddingInline:o=>s(g(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",i)}`,outlineOffset:`-${s(.5)}`}}}}function hn(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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 m=((d=(h=n.parent)==null?void 0:h.children.items)!=null?d:[]).filter(b=>b.type==="ElementNode"&&b.attributes.get("role")==="button"),u=n.key!==null&&n.key!==void 0?String(n.key):String(m.findIndex(b=>b===n));n.attributes.set("ariaPressed",b=>{let p=a.value.get(b);return Array.isArray(p)?p.includes(u):p===u}),n.addEvent("click",()=>{let b=a.value.get();if(a.multiple){let p=Array.isArray(b)?[...b]:[];a.value.set(p.includes(u)?p.filter(v=>v!==u):[...p,u])}else a.value.set(b===u?"":u)})},style:{cursor:"pointer",fontSize:n=>y(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",i.get(n)),color:n=>l(n,"shift-12",i.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function fn(e={}){var o;let{multiple:t=!1,color:i="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:r=>y(r,"inherit"),backgroundColor:r=>l(r,"inherit",i),outline:r=>`1px solid ${l(r,"shift-3",i)}`,outlineOffset:"-1px"}}}function dn(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,i=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=i(),m=a.target,u=c.indexOf(m);m.value&&u<c.length-1&&c[u+1].focus()},r=a=>{let c=i(),m=a.target,u=c.indexOf(m);a.key==="Backspace"&&!m.value&&u>0&&c[u-1].focus(),a.key==="ArrowLeft"&&u>0&&c[u-1].focus(),a.key==="ArrowRight"&&u<c.length-1&&c[u+1].focus()},n=a=>{var d,b,p;a.preventDefault();let c=(b=(d=a.clipboardData)==null?void 0:d.getData("text"))!=null?b:"",m=i(),u=m.indexOf(a.target);[...c].forEach((v,C)=>{m[u+C]&&(m[u+C].value=v)});let h=Math.min(u+c.length-1,m.length-1);(p=m[h])==null||p.focus()};t.addEventListener("input",o),t.addEventListener("keydown",r),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",r),t.removeEventListener("paste",n)})}}}function pn(e={}){var i;let t=f((i=e.color)!=null?i:"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 ${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=>y(o,"inherit")}}}function gn(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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 yn(e={}){var r;let{label:t=999}=e,i=f(t),o=f((r=e.color)!=null?r:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${i.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=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function bn(e={}){var o;let{separator:t="/"}=e,i=f((o=e.color)!=null?o:"neutral","color");return{_onInsert:r=>{r.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:r=>y(r,"inherit"),gap:s(1),color:r=>l(r,"shift-9",i.get(r)),backgroundColor:r=>l(r,"inherit",i.get(r)),"& > *":{display:"inline-flex",alignItems:"center",color:r=>l(r,"shift-8",i.get(r))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:r=>l(r,"shift-4",i.get(r)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:r=>l(r,"shift-10",i.get(r)),pointerEvents:"none"}}}}function vn(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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)}}}}var Sn='<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 Se(e={}){var o;let{removable:t=!1}=e,i=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:r=>{let n={span:Sn,onClick:a=>{a.stopPropagation(),r.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",i.get(a))}}};t&&r.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:r=>y(r,"inherit"),backgroundColor:r=>l(r,"inherit",i.get(r)),color:r=>l(r,"shift-9",i.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"shift-4",i.get(r))}`}}}var he=Math.min,W=Math.max,xe=Math.round,we=Math.floor,M=e=>({x:e,y:e}),Cn={left:"right",right:"left",bottom:"top",top:"bottom"};function it(e,t,i){return W(e,he(t,i))}function Ee(e,t){return typeof e=="function"?e(t):e}function Y(e){return e.split("-")[0]}function ke(e){return e.split("-")[1]}function rt(e){return e==="x"?"y":"x"}function at(e){return e==="y"?"height":"width"}function F(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function lt(e){return rt(F(e))}function Ut(e,t,i){i===void 0&&(i=!1);let o=ke(e),r=lt(e),n=at(r),a=r==="x"?o===(i?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=Ce(a)),[a,Ce(a)]}function Kt(e){let t=Ce(e);return[Ne(e),t,Ne(t)]}function Ne(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Wt=["left","right"],Ft=["right","left"],xn=["top","bottom"],wn=["bottom","top"];function En(e,t,i){switch(e){case"top":case"bottom":return i?t?Ft:Wt:t?Wt:Ft;case"left":case"right":return t?xn:wn;default:return[]}}function qt(e,t,i,o){let r=ke(e),n=En(Y(e),i==="start",o);return r&&(n=n.map(a=>a+"-"+r),t&&(n=n.concat(n.map(Ne)))),n}function Ce(e){let t=Y(e);return Cn[t]+e.slice(t.length)}function kn(e){return P({top:0,right:0,bottom:0,left:0},e)}function Gt(e){return typeof e!="number"?kn(e):{top:e,right:e,bottom:e,left:e}}function te(e){let{x:t,y:i,width:o,height:r}=e;return{width:o,height:r,top:i,left:t,right:t+o,bottom:i+r,x:t,y:i}}function Yt(e,t,i){let{reference:o,floating:r}=e,n=F(t),a=lt(t),c=at(a),m=Y(t),u=n==="y",h=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,b=o[c]/2-r[c]/2,p;switch(m){case"top":p={x:h,y:o.y-r.height};break;case"bottom":p={x:h,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(ke(t)){case"start":p[a]-=b*(i&&u?-1:1);break;case"end":p[a]+=b*(i&&u?-1:1);break}return p}function Xt(e,t){return j(this,null,function*(){var i;t===void 0&&(t={});let{x:o,y:r,platform:n,rects:a,elements:c,strategy:m}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:b=!1,padding:p=0}=Ee(t,e),v=Gt(p),S=c[b?d==="floating"?"reference":"floating":d],x=te(yield n.getClippingRect({element:(i=yield n.isElement==null?void 0:n.isElement(S))==null||i?S:S.contextElement||(yield n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:u,rootBoundary:h,strategy:m})),w=d==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,E=yield n.getOffsetParent==null?void 0:n.getOffsetParent(c.floating),k=(yield n.isElement==null?void 0:n.isElement(E))?(yield n.getScale==null?void 0:n.getScale(E))||{x:1,y:1}:{x:1,y:1},T=te(n.convertOffsetParentRelativeRectToViewportRelativeRect?yield n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:E,strategy:m}):w);return{top:(x.top-T.top+v.top)/k.y,bottom:(T.bottom-x.bottom+v.bottom)/k.y,left:(x.left-T.left+v.left)/k.x,right:(T.right-x.right+v.right)/k.x}})}var Tn=50,Jt=(e,t,i)=>j(null,null,function*(){let{placement:o="bottom",strategy:r="absolute",middleware:n=[],platform:a}=i,c=a.detectOverflow?a:N(P({},a),{detectOverflow:Xt}),m=yield a.isRTL==null?void 0:a.isRTL(t),u=yield a.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=Yt(u,o,m),b=o,p=0,v={};for(let C=0;C<n.length;C++){let S=n[C];if(!S)continue;let{name:x,fn:w}=S,{x:E,y:k,data:T,reset:O}=yield w({x:h,y:d,initialPlacement:o,placement:b,strategy:r,middlewareData:v,rects:u,platform:c,elements:{reference:e,floating:t}});h=E!=null?E:h,d=k!=null?k:d,v[x]=P(P({},v[x]),T),O&&p<Tn&&(p++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(u=O.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:r}):O.rects),{x:h,y:d}=Yt(u,b,m)),C=-1)}return{x:h,y:d,placement:b,strategy:r,middlewareData:v}});var Zt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(i){return j(this,null,function*(){var o,r;let{placement:n,middlewareData:a,rects:c,initialPlacement:m,platform:u,elements:h}=i,yt=Ee(e,i),{mainAxis:d=!0,crossAxis:b=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0}=yt,x=Ue(yt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let w=Y(n),E=F(m),k=Y(m)===m,T=yield u.isRTL==null?void 0:u.isRTL(h.floating),O=p||(k||!S?[Ce(m)]:Kt(m)),I=C!=="none";!p&&I&&O.push(...qt(m,S,C,T));let ft=[m,...O],ae=yield u.detectOverflow(i,x),le=[],se=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&le.push(ae[w]),b){let J=Ut(n,c,T);le.push(ae[J[0]],ae[J[1]])}if(se=[...se,{placement:n,overflows:le}],!le.every(J=>J<=0)){var dt,pt;let J=(((dt=a.flip)==null?void 0:dt.index)||0)+1,We=ft[J];if(We&&(!(b==="alignment"?E!==F(We):!1)||se.every(A=>F(A.placement)===E?A.overflows[0]>0:!0)))return{data:{index:J,overflows:se},reset:{placement:We}};let ge=(pt=se.filter(Z=>Z.overflows[0]<=0).sort((Z,A)=>Z.overflows[1]-A.overflows[1])[0])==null?void 0:pt.placement;if(!ge)switch(v){case"bestFit":{var gt;let Z=(gt=se.filter(A=>{if(I){let K=F(A.placement);return K===E||K==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(K=>K>0).reduce((K,ko)=>K+ko,0)]).sort((A,K)=>A[1]-K[1])[0])==null?void 0:gt[0];Z&&(ge=Z);break}case"initialPlacement":ge=m;break}if(n!==ge)return{reset:{placement:ge}}}return{}})}}};var _n=new Set(["left","top"]);function On(e,t){return j(this,null,function*(){let{placement:i,platform:o,elements:r}=e,n=yield o.isRTL==null?void 0:o.isRTL(r.floating),a=Y(i),c=ke(i),m=F(i)==="y",u=_n.has(a)?-1:1,h=n&&m?-1:1,d=Ee(t,e),{mainAxis:b,crossAxis:p,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof v=="number"&&(p=c==="end"?v*-1:v),m?{x:p*h,y:b*u}:{x:b*u,y:p*h}})}var Qt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(i){return j(this,null,function*(){var o,r;let{x:n,y:a,placement:c,middlewareData:m}=i,u=yield On(i,e);return c===((o=m.offset)==null?void 0:o.placement)&&(r=m.arrow)!=null&&r.alignmentOffset?{}:{x:n+u.x,y:a+u.y,data:N(P({},u),{placement:c})}})}}},eo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(i){return j(this,null,function*(){let{x:o,y:r,placement:n,platform:a}=i,w=Ee(e,i),{mainAxis:c=!0,crossAxis:m=!1,limiter:u={fn:E=>{let{x:k,y:T}=E;return{x:k,y:T}}}}=w,h=Ue(w,["mainAxis","crossAxis","limiter"]),d={x:o,y:r},b=yield a.detectOverflow(i,h),p=F(Y(n)),v=rt(p),C=d[v],S=d[p];if(c){let E=v==="y"?"top":"left",k=v==="y"?"bottom":"right",T=C+b[E],O=C-b[k];C=it(T,C,O)}if(m){let E=p==="y"?"top":"left",k=p==="y"?"bottom":"right",T=S+b[E],O=S-b[k];S=it(T,S,O)}let x=u.fn(N(P({},i),{[v]:C,[p]:S}));return N(P({},x),{data:{x:x.x-o,y:x.y-r,enabled:{[v]:c,[p]:m}}})})}}};function Me(){return typeof window!="undefined"}function ne(e){return oo(e)?(e.nodeName||"").toLowerCase():"#document"}function $(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(oo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oo(e){return Me()?e instanceof Node||e instanceof $(e).Node:!1}function z(e){return Me()?e instanceof Element||e instanceof $(e).Element:!1}function H(e){return Me()?e instanceof HTMLElement||e instanceof $(e).HTMLElement:!1}function to(e){return!Me()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof $(e).ShadowRoot}function de(e){let{overflow:t,overflowX:i,overflowY:o,display:r}=L(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+i)&&r!=="inline"&&r!=="contents"}function no(e){return/^(table|td|th)$/.test(ne(e))}function Te(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Pn=/transform|translate|scale|rotate|perspective|filter/,Rn=/paint|layout|strict|content/,oe=e=>!!e&&e!=="none",st;function Ve(e){let t=z(e)?L(e):e;return oe(t.transform)||oe(t.translate)||oe(t.scale)||oe(t.rotate)||oe(t.perspective)||!De()&&(oe(t.backdropFilter)||oe(t.filter))||Pn.test(t.willChange||"")||Rn.test(t.contain||"")}function io(e){let t=U(e);for(;H(t)&&!ie(t);){if(Ve(t))return t;if(Te(t))return null;t=U(t)}return null}function De(){return st==null&&(st=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),st}function ie(e){return/^(html|body|#document)$/.test(ne(e))}function L(e){return $(e).getComputedStyle(e)}function _e(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function U(e){if(ne(e)==="html")return e;let t=e.assignedSlot||e.parentNode||to(e)&&e.host||V(e);return to(t)?t.host:t}function ro(e){let t=U(e);return ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&de(t)?t:ro(t)}function fe(e,t,i){var o;t===void 0&&(t=[]),i===void 0&&(i=!0);let r=ro(e),n=r===((o=e.ownerDocument)==null?void 0:o.body),a=$(r);if(n){let c=Be(a);return t.concat(a,a.visualViewport||[],de(r)?r:[],c&&i?fe(c):[])}else return t.concat(r,fe(r,[],i))}function Be(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function co(e){let t=L(e),i=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=H(e),n=r?e.offsetWidth:i,a=r?e.offsetHeight:o,c=xe(i)!==n||xe(o)!==a;return c&&(i=n,o=a),{width:i,height:o,$:c}}function mt(e){return z(e)?e:e.contextElement}function pe(e){let t=mt(e);if(!H(t))return M(1);let i=t.getBoundingClientRect(),{width:o,height:r,$:n}=co(t),a=(n?xe(i.width):i.width)/o,c=(n?xe(i.height):i.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var $n=M(0);function mo(e){let t=$(e);return!De()||!t.visualViewport?$n:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function In(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==$(e)?!1:t}function re(e,t,i,o){t===void 0&&(t=!1),i===void 0&&(i=!1);let r=e.getBoundingClientRect(),n=mt(e),a=M(1);t&&(o?z(o)&&(a=pe(o)):a=pe(e));let c=In(n,i,o)?mo(n):M(0),m=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,h=r.width/a.x,d=r.height/a.y;if(n){let b=$(n),p=o&&z(o)?$(o):o,v=b,C=Be(v);for(;C&&o&&p!==v;){let S=pe(C),x=C.getBoundingClientRect(),w=L(C),E=x.left+(C.clientLeft+parseFloat(w.paddingLeft))*S.x,k=x.top+(C.clientTop+parseFloat(w.paddingTop))*S.y;m*=S.x,u*=S.y,h*=S.x,d*=S.y,m+=E,u+=k,v=$(C),C=Be(v)}}return te({width:h,height:d,x:m,y:u})}function He(e,t){let i=_e(e).scrollLeft;return t?t.left+i:re(V(e)).left+i}function uo(e,t){let i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-He(e,i),r=i.top+t.scrollTop;return{x:o,y:r}}function zn(e){let{elements:t,rect:i,offsetParent:o,strategy:r}=e,n=r==="fixed",a=V(o),c=t?Te(t.floating):!1;if(o===a||c&&n)return i;let m={scrollLeft:0,scrollTop:0},u=M(1),h=M(0),d=H(o);if((d||!d&&!n)&&((ne(o)!=="body"||de(a))&&(m=_e(o)),d)){let p=re(o);u=pe(o),h.x=p.x+o.clientLeft,h.y=p.y+o.clientTop}let b=a&&!d&&!n?uo(a,m):M(0);return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-m.scrollLeft*u.x+h.x+b.x,y:i.y*u.y-m.scrollTop*u.y+h.y+b.y}}function Ln(e){return Array.from(e.getClientRects())}function An(e){let t=V(e),i=_e(e),o=e.ownerDocument.body,r=W(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=W(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-i.scrollLeft+He(e),c=-i.scrollTop;return L(o).direction==="rtl"&&(a+=W(t.clientWidth,o.clientWidth)-r),{width:r,height:n,x:a,y:c}}var ao=25;function Nn(e,t){let i=$(e),o=V(e),r=i.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,m=0;if(r){n=r.width,a=r.height;let h=De();(!h||h&&t==="fixed")&&(c=r.offsetLeft,m=r.offsetTop)}let u=He(o);if(u<=0){let h=o.ownerDocument,d=h.body,b=getComputedStyle(d),p=h.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-p);v<=ao&&(n-=v)}else u<=ao&&(n+=u);return{width:n,height:a,x:c,y:m}}function Mn(e,t){let i=re(e,!0,t==="fixed"),o=i.top+e.clientTop,r=i.left+e.clientLeft,n=H(e)?pe(e):M(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,m=r*n.x,u=o*n.y;return{width:a,height:c,x:m,y:u}}function lo(e,t,i){let o;if(t==="viewport")o=Nn(e,i);else if(t==="document")o=An(V(e));else if(z(t))o=Mn(t,i);else{let r=mo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return te(o)}function ho(e,t){let i=U(e);return i===t||!z(i)||ie(i)?!1:L(i).position==="fixed"||ho(i,t)}function Vn(e,t){let i=t.get(e);if(i)return i;let o=fe(e,[],!1).filter(c=>z(c)&&ne(c)!=="body"),r=null,n=L(e).position==="fixed",a=n?U(e):e;for(;z(a)&&!ie(a);){let c=L(a),m=Ve(a);!m&&c.position==="fixed"&&(r=null),(n?!m&&!r:!m&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||de(a)&&!m&&ho(e,a))?o=o.filter(h=>h!==a):r=c,a=U(a)}return t.set(e,o),o}function Dn(e){let{element:t,boundary:i,rootBoundary:o,strategy:r}=e,a=[...i==="clippingAncestors"?Te(t)?[]:Vn(t,this._c):[].concat(i),o],c=lo(t,a[0],r),m=c.top,u=c.right,h=c.bottom,d=c.left;for(let b=1;b<a.length;b++){let p=lo(t,a[b],r);m=W(p.top,m),u=he(p.right,u),h=he(p.bottom,h),d=W(p.left,d)}return{width:u-d,height:h-m,x:d,y:m}}function Bn(e){let{width:t,height:i}=co(e);return{width:t,height:i}}function Hn(e,t,i){let o=H(t),r=V(t),n=i==="fixed",a=re(e,!0,n,t),c={scrollLeft:0,scrollTop:0},m=M(0);function u(){m.x=He(r)}if(o||!o&&!n)if((ne(t)!=="body"||de(r))&&(c=_e(t)),o){let p=re(t,!0,n,t);m.x=p.x+t.clientLeft,m.y=p.y+t.clientTop}else r&&u();n&&!o&&r&&u();let h=r&&!o&&!n?uo(r,c):M(0),d=a.left+c.scrollLeft-m.x-h.x,b=a.top+c.scrollTop-m.y-h.y;return{x:d,y:b,width:a.width,height:a.height}}function ct(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 i=e.offsetParent;return V(e)===i&&(i=i.ownerDocument.body),i}function fo(e,t){let i=$(e);if(Te(e))return i;if(!H(e)){let r=U(e);for(;r&&!ie(r);){if(z(r)&&!ct(r))return r;r=U(r)}return i}let o=so(e,t);for(;o&&no(o)&&ct(o);)o=so(o,t);return o&&ie(o)&&ct(o)&&!Ve(o)?i:o||io(e)||i}var jn=function(e){return j(this,null,function*(){let t=this.getOffsetParent||fo,i=this.getDimensions,o=yield i(e.floating);return{reference:Hn(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Wn(e){return L(e).direction==="rtl"}var Fn={convertOffsetParentRelativeRectToViewportRelativeRect:zn,getDocumentElement:V,getClippingRect:Dn,getOffsetParent:fo,getElementRects:jn,getClientRects:Ln,getDimensions:Bn,getScale:pe,isElement:z,isRTL:Wn};function po(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Un(e,t){let i=null,o,r=V(e);function n(){var c;clearTimeout(o),(c=i)==null||c.disconnect(),i=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),n();let u=e.getBoundingClientRect(),{left:h,top:d,width:b,height:p}=u;if(c||t(),!b||!p)return;let v=we(d),C=we(r.clientWidth-(h+b)),S=we(r.clientHeight-(d+p)),x=we(h),E={rootMargin:-v+"px "+-C+"px "+-S+"px "+-x+"px",threshold:W(0,he(1,m))||1},k=!0;function T(O){let I=O[0].intersectionRatio;if(I!==m){if(!k)return a();I?a(!1,I):o=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!po(u,e.getBoundingClientRect())&&a(),k=!1}try{i=new IntersectionObserver(T,N(P({},E),{root:r.ownerDocument}))}catch(O){i=new IntersectionObserver(T,E)}i.observe(e)}return a(!0),n}function go(e,t,i,o){o===void 0&&(o={});let{ancestorScroll:r=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=mt(e),h=r||n?[...u?fe(u):[],...t?fe(t):[]]:[];h.forEach(x=>{r&&x.addEventListener("scroll",i,{passive:!0}),n&&x.addEventListener("resize",i)});let d=u&&c?Un(u,i):null,b=-1,p=null;a&&(p=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),i()}),u&&!m&&p.observe(u),t&&p.observe(t));let v,C=m?re(e):null;m&&S();function S(){let x=re(e);C&&!po(C,x)&&i(),C=x,v=requestAnimationFrame(S)}return i(),()=>{var x;h.forEach(w=>{r&&w.removeEventListener("scroll",i),n&&w.removeEventListener("resize",i)}),d==null||d(),(x=p)==null||x.disconnect(),p=null,m&&cancelAnimationFrame(v)}}var yo=Qt;var bo=eo,vo=Zt;var So=(e,t,i)=>{let o=new Map,r=P({platform:Fn},i),n=N(P({},r.platform),{_c:o});return Jt(e,t,N(P({},r),{platform:n}))};function X(e){let{open:t=!1,placement:i}=e,o=null,r=null,n=null,a=null,c=null,m=null,u=!1,h=f(t),d=()=>{u||!m||(u=!0,c=m.children.insert(e.content))},b=()=>{d(),n&&a&&(r&&r(),r=go(n,a,()=>{So(n,a,{placement:i.get(),middleware:[yo(12),vo(),bo()],strategy:"fixed"}).then(({x:w,y:E,placement:k})=>{Object.assign(a.style,{left:`${w}px`,top:`${E}px`}),i.set(k)})}),h.set(!0))},p=()=>{r&&r(),r=null,h.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},C=()=>{o&&clearTimeout(o),o=setTimeout(p,100)},S={style:{position:"fixed",pointerEvents:"auto",visibility:w=>h.get(w)?"visible":"hidden"},_onMount:w=>a=w.domElement,_portal:w=>{let E=w.domElement.querySelector("#domphy-floating");if(!E){let k={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};E=w.children.insert(k).domElement}return E}};return _(e.content,S),{show:v,hide:C,anchorPartial:{onKeyDown:w=>w.key==="Escape"&&C(),_onMount:w=>{m=w.getRoot(),n=w.domElement;let E=k=>{if(!h.get()||!n||!a)return;let T=k.target;!n.contains(T)&&!a.contains(T)&&C()};w.getRoot().domElement.addEventListener("click",E),w.addHook("BeforeRemove",()=>{o&&clearTimeout(o),r&&(r(),r=null),c&&c.remove(),w.getRoot().domElement.removeEventListener("click",E)})}}}}function Kn(e){let{options:t=[],placement:i="bottom",color:o="neutral",open:r=!1,multiple:n=!1}=e,a=f(e.value),c=f(r),{show:m,hide:u,anchorPartial:h}=X({open:c,placement:f(i),content:e.content}),d={onClick:()=>!n&&u()};_(e.content,d);let b={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:S=>y(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)},p;e.input?(_(e.input,{onFocus:()=>m(),style:b,_key:"combobox-input"}),p=e.input):p={input:null,onFocus:()=>m(),value:S=>(a.get(S),""),style:b,_key:"combobox-input"};let v={div:S=>{let x=a.get(S),w=Array.isArray(x)?x:[x],k=t.filter(T=>w.includes(T.value)).map(T=>({span:T.label,$:[Se({color:o,removable:!0})],_key:T.value,_onRemove:O=>{let I=a.get(),ae=(Array.isArray(I)?I:[I]).filter(le=>le!==T.value);n?a.set(ae):a.set(ae[0])}}));return k.push(p),k},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 ${l(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=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)}};return _(h,C),h}function ut(e={}){let{placement:t="bottom-end",color:i="neutral",sideOffset:o=s(6),bordered:r=!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"]},m=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",u=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>y(h),backgroundColor:h=>l(h),color:h=>l(h,"shift-9",i),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:h=>l(h,"inherit",i),borderWidth:r?"1px":"0px",borderColor:h=>l(h,"inherit",i),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":m(d)},right:h=>{let d=c(h);return d.includes("right")?0:d.includes("left")?"auto":u(d)},bottom:h=>{let d=c(h);return d.includes("bottom")?0:d.includes("top")?"auto":u(d)},left:h=>{let d=c(h);return d.includes("left")?0:d.includes("right")?"auto":m(d)},transform:h=>{let d=c(h),b=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",p=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${b},${p}) rotate(45deg)`}}}}}function qn(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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(g(o)*2),paddingInline:o=>s(g(o)*4),margin:0}}}function Gn(e={}){var i;let t=f((i=e.color)!=null?i:"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 ${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 Yn(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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 ${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",i.get(n))}`,backgroundColor:n=>l(n,"shift-8",i.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",i.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",i.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",i.get(n))}`,backgroundColor:n=>l(n,"shift-3",i.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",i.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",i.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Xn(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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)}}}function Jn(e={}){var r,n;let{duration:t=240}=e,i=f((r=e.color)!=null?r:"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=>y(a,"inherit"),color:a=>l(a,"shift-9",i.get(a)),backgroundColor:a=>l(a,"inherit",i.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",i.get(a)),color:a=>l(a,"shift-10",i.get(a)),fontSize:a=>y(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(g(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",i.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",i.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",i.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(g(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(g(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(g(a)*1),paddingBottom:a=>s(g(a)*3)}}}}function Zn(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function Qn(e={}){let{color:t="neutral",open:i=!1}=e,o=f(i);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,n)=>{if(r.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();r.clientX>=a.left&&r.clientX<=a.right&&r.clientY>=a.top&&r.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(r,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:r=>{let n=r.domElement,a=m=>{m?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let u=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');u==null||u.focus()})):n.style.opacity="0"};a(o.get());let c=o.addListener(a);r.addHook("Remove",()=>{c(),document.body.style.overflow=""})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>y(r,"inherit"),color:r=>l(r,"shift-10",t),backgroundColor:r=>l(r,"inherit",t),border:"none",padding:r=>s(g(r)*3),boxShadow:r=>`0 ${s(9)} ${s(16)} ${l(r,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:r=>l(r,"shift-2","neutral"),opacity:.75}}}}function ei(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-10",t.get(o))}}}function ti(e={}){var i;let t=f((i=e.color)!=null?i:"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=>y(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function oi(e={}){var r;let{layout:t="horizontal"}=e,i=f((r=e.color)!=null?r:"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=>l(n,"inherit",i.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=>l(n,"shift-9",i.get(n)),backgroundColor:n=>l(n,"inherit",i.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=>l(n,"shift-9",i.get(n))}}}}var ni={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function ii(e={}){var i;let t=f((i=e.color)!=null?i:"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 r=ni[o.elementNode.tagName]||"inherit";return y(o,r)}}}}function ri(e={}){var i;let t=f((i=e.color)!=null?i:"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 ai(e={}){var i;let t=f((i=e.color)!=null?i:"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 li(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function si(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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=>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=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function ci(e={}){var r,n;let{mode:t="datetime-local"}=e,i=f((r=e.color)!=null?r:"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=>y(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",i.get(a)),backgroundColor:a=>l(a,"inherit",i.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",i.get(a))}`,borderRadius:a=>s(g(a)*1),paddingInline:a=>s(g(a)*3),height:a=>s(6+g(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 mi(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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=>y(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(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=>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",i.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 ui(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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=>y(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(g(n)*1),minWidth:s(32),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(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",i.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 o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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(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 ${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",i.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 o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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",i.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",i.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function di(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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(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 ${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",i.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 pi(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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 gi(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",i.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function yi(e={}){var o,r;let t=f((o=e.color)!=null?o:"primary","color"),i=f((r=e.accentColor)!=null?r:"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=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",i.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",i.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function bi(e={}){var i;let t=f((i=e.accentColor)!=null?i:"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=>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 vi(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Si(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(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 Ci(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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",i.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}function xi(e={}){var o,r;let t=f((o=e.color)!=null?o:"neutral","color"),i=f((r=e.accentColor)!=null?r:"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 ${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",i.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",i.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",i.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function wi(e={}){let{color:t="neutral",accentColor:i="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=>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(g(o)*1),paddingBlock:o=>s(g(o)*1),paddingLeft:o=>s(g(o)*3),paddingRight:o=>s(g(o)*5),backgroundImage:o=>{let r=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${nt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(r)}")`},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 ${l(o,"shift-5",i)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",i)}`},"& 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 Ei(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color"),i={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=me(JSON.stringify(i));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>y(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}`]:i}}}var xo={to:{transform:"rotate(360deg)"}},Co=me(JSON.stringify(xo));function ki(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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:`${Co} 0.7s linear infinite`,[`@keyframes ${Co}`]:xo}}}function Ti(e={}){var a;let{color:t="neutral",multiple:i=!1}=e,o=f((a=e.value)!=null?a:i?[]:null),r={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(h=>({input:null,name:e.name,value:h||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:i}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(g(c)*2),paddingInline:c=>s(g(c)*2),fontSize:c=>y(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function _i(e={}){let{accentColor:t="primary",color:i="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",m=>{let u=c.get(m);return a.multiple?u.includes(o):u==o}),n.addEvent("click",()=>{let m=c.get();a.multiple?m.includes(o)?c.set(m.filter(u=>u!==o)):c.set(m.concat([o])):m!=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=>l(n,"shift-9",i),backgroundColor:n=>l(n,"inherit",i),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",i)},"&[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 Oi(e){let{options:t=[],placement:i="bottom",color:o="neutral",open:r=!1,multiple:n=!1}=e,a=f(e.value),c=f(r),{show:m,hide:u,anchorPartial:h}=X({open:c,placement:f(i),content:e.content}),d={onClick:()=>!n&&u()};_(e.content,d);let b={div:v=>{let C=a.get(v),S=Array.isArray(C)?C:[C];return t.filter(w=>S.includes(w.value)).map(w=>({span:w.label,$:[Se({color:o,removable:n})],_key:w.value,_onRemove:E=>{let k=a.get(),O=(Array.isArray(k)?k:[k]).filter(I=>I!==w.value);n?a.set(O):a.set(O[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},p={_onInsert:v=>{v.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(b),onClick:()=>c.get()?u():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+g(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(g(v)*2),borderRadius:v=>s(g(v)*1),fontSize:v=>y(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return _(h,p),h}function Pi(e={}){var i;let t=f((i=e.accentColor)!=null?i:"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=>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=>y(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ri(e={}){var n,a;let{checked:t=!1}=e,i=f(t),o=f((n=e.color)!=null?n:"neutral","color"),r=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=>i.get(c),dataTone:"shift-2",onClick:()=>i.set(!i.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>y(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",r.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 $i(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function Ii(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function zi(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function Li(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function Ai(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(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=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(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=>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=>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 Ni(e={}){var r,n;let t=f((r=e.color)!=null?r:"neutral","color"),i=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 m=()=>{c.style.height="auto",c.style.height=c.scrollHeight+"px"};c.addEventListener("input",m),m()}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>s(g(a)*2),paddingBlock:a=>s(g(a)*1.5),border:"none",borderRadius:a=>s(g(a)*1.5),fontSize:a=>y(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",i.get(a))}`},"&:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",i.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 Mi(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function Vi(e={}){var i;let t=f((i=e.color)!=null?i:"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=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Di(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let i=[1];e>3&&i.push("...");let o=Math.max(2,e-1),r=Math.min(t-1,e+1);for(let n=o;n<=r;n++)i.push(n);return e<t-2&&i.push("..."),i.push(t),i}function Bi(e){var c;let{total:t,color:i="neutral",accentColor:o="primary"}=e,r=f((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>s(6+g(m)*2),height:m=>s(6+g(m)*2),paddingInline:m=>s(g(m)*2),borderRadius:m=>s(g(m)*1),border:"none",cursor:"pointer",fontSize:m=>y(m,"inherit"),backgroundColor:"transparent",color:m=>l(m,"shift-9",i),"&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-2",i)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=N(P({},n),{backgroundColor:m=>l(m,"shift-6",o),color:m=>l(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let u={div:h=>{let d=r.get(h),b=[];b.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&r.set(d-1),style:n});for(let p of Di(d,t))if(p==="...")b.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(g(v)*2),color:v=>l(v,"shift-7",i)}});else{let v=p===d;b.push({button:String(p),type:"button",ariaLabel:`Page ${p}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>r.set(p),style:v?a:n})}return b.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&r.set(d+1),style:n}),b},style:{display:"flex",alignItems:"center",gap:s(1)}};m.children.insert(u)},style:{display:"inline-flex"}}}function Hi(e={}){var i;let t=f((i=e.color)!=null?i:"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=>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 wo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},ji={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},ht=e=>e==="left"||e==="right";function Wi(e={}){let{color:t="neutral",open:i=!1,placement:o="right",size:r}=e,n=f(i),a=ht(o)?s(80):s(64),c=r!=null?r:a;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,u)=>{m.target===u.domElement&&n.set(!1)},onTransitionEnd:(m,u)=>{let h=u.domElement;n.get()||(h.close(),document.body.style.overflow="")},_onMount:m=>{let u=m.domElement,h=b=>{b?(u.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{u.style.transform="translate(0, 0)"})):u.style.transform=wo[o]};h(n.get());let d=n.addListener(h);m.addHook("Remove",()=>{d(),document.body.style.overflow=""})},style:{transform:wo[o],transition:"transform 0.25s ease",fontSize:m=>y(m,"inherit"),color:m=>l(m,"shift-10",t),backgroundColor:m=>l(m,"inherit",t),border:"none",padding:m=>s(g(m)*3),margin:ji[o],width:ht(o)?c:"100dvw",height:ht(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${l(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>l(m,"shift-2","neutral"),opacity:.75}}}}function Fi(e){var b;let{open:t=!1,placement:i="bottom",openOn:o="click"}=e,r=null,n=f(t),a=f(i),{show:c,hide:m,anchorPartial:u}=X({open:n,placement:a,content:e.content}),h={role:"dialog",dataTone:"shift-11",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),_onInsert:p=>{let v=p.attributes.get("id");r=v||p.nodeId,!v&&p.attributes.set("id",r)}};return(b=e.content).$||(b.$=[]),e.content.$.push(h),_(u,{ariaHaspopup:"dialog",ariaExpanded:p=>n.get(p),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),onClick:()=>{o==="click"&&(n.get()?m():c())},onFocus:()=>c(),onBlur:(p,v)=>{let C=p.relatedTarget,S=v.getRoot().domElement,x=r?S.querySelector(`#${CSS.escape(r)}`):null;C&&(x!=null&&x.contains(C))||m()},_onMount:p=>r&&p.attributes.set("ariaControls",r)}),u}function Ui(e={}){let{position:t="top-center",color:i="neutral"}=e,o=f(!1),r=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:m=>{let u=m.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=m.children.insert(c).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:m=>s(g(m)*2),paddingInline:m=>s(g(m)*4),borderRadius:m=>s(g(m)*2),fontSize:m=>y(m,"inherit"),color:m=>l(m,"shift-9",i),backgroundColor:m=>l(m,"inherit",i),boxShadow:m=>`0 ${s(2)} ${s(9)} ${l(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,u)=>{let h=d=>{d.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",h),u())};m.domElement.addEventListener("transitionend",h),o.set(!1)}}}function Ki(e={}){let{open:t=!1,placement:i="top",content:o="Tooltip Content"}=e,r=f(i),n=f(o),a=null,c={span:p=>n.get(p)},{show:m,hide:u,anchorPartial:h}=X({open:t,placement:r,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:p=>{let v=p.attributes.get("id");a=v||p.nodeId,!v&&p.attributes.set("id",a)},style:{paddingBlock:p=>s(g(p)*1),paddingInline:p=>s(g(p)*3),borderRadius:p=>s(g(p)*1),color:p=>l(p,"shift-9"),backgroundColor:p=>l(p),fontSize:p=>y(p,"inherit")},$:[ut({placement:r,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),_(h,{onMouseEnter:()=>m(),onMouseLeave:()=>u(),onFocus:()=>m(),onBlur:()=>u(),onKeyDown:p=>p.key==="Escape"&&u(),_onMount:p=>a&&p.attributes.set("ariaDescribedby",a)}),h}function Eo(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function qi(e={}){let{duration:t=300,delay:i=0}=e,o=new Map;return{_onBeforeUpdate:r=>{o=new Map,r.children.items.forEach((n,a)=>{if(!(n instanceof R))return;let c=n.domElement;c&&o.set(Eo(n,a),c.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((n,a)=>{if(!(n instanceof R))return;let c=n.domElement;if(!c)return;let m=Eo(n,a),u=o.get(m);if(!u)return;let h=c.getBoundingClientRect(),d=u.left-h.left,b=u.top-h.top;if(Math.abs(d)<.5&&Math.abs(b)<.5)return;let p=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${d}px, ${b}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${i}ms`,c.style.transform="translate(0px, 0px)"});let C=()=>{c.style.transition=p,c.style.transform=v,c.removeEventListener("transitionend",S)},S=x=>{x.propertyName==="transform"&&C()};c.addEventListener("transitionend",S),setTimeout(C,t+i+34)}),o.clear()}}}function Gi(e={}){return{role:"tablist",_onSchedule:(i,o)=>{let r={_context:{tabs:{activeKey:f(e.activeKey||0)}}};_(o,r)}}}function Yi(e={}){let{accentColor:t="primary",color:i="neutral"}=e;return{role:"tab",_onInsert:r=>{var u,h;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=r.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let a=(h=(u=r.parent)==null?void 0:u.children.items)!=null?h:[];a=a.filter(d=>d.type=="ElementNode"&&d.attributes.get("role")=="tab");let c=r.key!==null&&r.key!==void 0?r.key:a.findIndex(d=>d==r),m={id:"tab"+r.parent.nodeId+c,ariaControls:"tabpanel"+r.parent.nodeId+c,ariaSelected:d=>n.activeKey.get(d)==c,onClick:()=>n.activeKey.set(c),onKeyDown:d=>{var x,w,E,k;let b=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(b))return;d.preventDefault();let p=((w=(x=r.parent)==null?void 0:x.children.items)!=null?w:[]).filter(T=>T.type==="ElementNode"&&T.attributes.get("role")==="tab"),v=p.findIndex(T=>T===r),C=v;b==="ArrowRight"?C=(v+1)%p.length:b==="ArrowLeft"?C=(v-1+p.length)%p.length:b==="Home"?C=0:b==="End"&&(C=p.length-1);let S=p[C];n.activeKey.set((E=S.key)!=null?E:C),(k=S.domElement)==null||k.focus()}};r.merge(m)},style:{cursor:"pointer",fontSize:r=>y(r,"inherit"),height:r=>s(6+g(r)*2),paddingInline:r=>s(g(r)*4),border:"none",outline:"none",color:r=>l(r,"shift-9"),backgroundColor:r=>l(r,"inherit"),boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-1",i)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-2",i)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-6",t)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-6",t)}`}}}}function Xi(){return{role:"tabpanel",style:{paddingBlock:t=>s(g(t)*2),paddingInline:t=>s(g(t)*2)},_onInsert:t=>{var a,c;let i=t.getContext("tabs");if(!i){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(m=>m.type=="ElementNode"&&m.attributes.get("role")=="tabpanel");let r=t.key!==null&&t.key!==void 0?t.key:o.findIndex(m=>m==t),n={id:"tabpanel"+t.parent.nodeId+r,ariaLabelledby:"tab"+t.parent.nodeId+r,hidden:m=>i.activeKey.get(m)!=r};t.merge(n)}}}function Ji(e={}){let{color:t="neutral",selectable:i=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(r,n)=>{var c;let a={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:i}}};_(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:r=>s(g(r)*2),paddingInline:r=>s(g(r)*2),fontSize:r=>y(r,"inherit"),backgroundColor:r=>l(r,"inherit",t)}}}function Zi(e={}){let{accentColor:t="primary",color:i="neutral"}=e;return{role:"menuitem",_onInsert:r=>{var m,u;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=r.getContext("menu");if(!n){console.warn('"menuItem" patch must be used inside a "menu"');return}let a=(u=(m=r.parent)==null?void 0:m.children.items)!=null?u:[];a=a.filter(h=>h.type=="ElementNode"&&h.attributes.get("role")=="menuitem");let c=r.key!==null&&r.key!==void 0?r.key:a.findIndex(h=>h==r);n.selectable&&(r.attributes.set("ariaCurrent",h=>n.activeKey.get(h)==c||void 0),r.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(r,n)=>{var h,d,b,p;let a=r.key;if(a==="Enter"||a===" "){r.preventDefault(),(h=n.domElement)==null||h.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;r.preventDefault();let c=((b=(d=n.parent)==null?void 0:d.children.items)!=null?b:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem"),m=c.findIndex(v=>v===n),u=m;a==="ArrowDown"?u=(m+1)%c.length:a==="ArrowUp"?u=(m-1+c.length)%c.length:a==="Home"?u=0:a==="End"&&(u=c.length-1),(p=c[u].domElement)==null||p.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:r=>s(2),width:"100%",fontSize:r=>y(r,"inherit"),height:r=>s(6+g(r)*2),paddingInline:r=>s(g(r)*3),border:"none",outline:"none",color:r=>l(r,"shift-9"),backgroundColor:r=>l(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>l(r,"shift-2")},"&[aria-current=true]":{backgroundColor:r=>l(r,"shift-3",t),color:r=>l(r,"shift-10")},"&:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}return $o(Qi);})();
4
+ ${r}}`}function B(e){if(!ue[e])throw Error(`Theme "${e}" not found`);return ue[e]}function Zo(e,t){Xo(t),ue[e]||(ue[e]=ot(ve)),Dt(ue[e],t)}function Qo(e){let t=ot(e);t.direction="lighten";for(let i in t.colors)t.colors[i].reverse(),t.baseTones[i]=t.colors[i].length-1-t.baseTones[i];return t}function Bt(e){let t=B(e),i=nt(t),o={};for(let r in t){let n=t[r];if(r==="colors")for(let a in t.colors){let c={};[...Array(i).keys()].forEach(m=>c[m]=t.colors[a][m]),o[a]=c}else if(r==="fontSizes")o.fontSizes=t.fontSizes;else if(r==="densities")o.densities=t.densities;else if(r==="custom"&&(o.custom={},n&&typeof n=="object"))for(let a in n)o.custom[a]=n[a]}return o}function be(){let e=B("light"),t=nt(e),i={};for(let o in e){let r=e[o];if(o==="colors")for(let n in e.colors){let a={};[...Array(t).keys()].forEach(c=>a[c]=`var(--${n}-${c})`),i[n]=a}else if(o==="fontSizes")i.fontSizes=[...Array(8).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(i.custom={},r&&typeof r=="object"))for(let n in r)i.custom[n]=`var(--custom-${Vt(n)})`}return i}function Qe(){return Object.entries(ue).map(([e,t])=>Jo(e,t)).join(`
5
+ `)}function en(e){var t;if(typeof document!="undefined")if(e){e.textContent=Qe();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Qe(),document.head.appendChild(e)}function s(e){return e/4+"em"}function Ae(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let i="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(i=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),i}var et=["inherit"];[...Array(8).keys()].forEach(e=>{et.push(`decrease-${e}`),et.push(`increase-${e}`)});function Ht(e,t="inherit"){if(!et.includes(t))throw Error(`size name "${t}" invalid`);let i;if(t=="inherit")i=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);i=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);i=e-o}else i=e;return Math.max(0,Math.min(8,i))}function tn(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 i=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(i=Ht(i,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),i}function y(e,t="inherit"){let i=Ht(tn(e),t);return be().fontSizes[i]}var tt=["inherit"];[...Array(5).keys()].forEach(e=>{tt.push(`decrease-${e}`),tt.push(`increase-${e}`)});function on(e,t="inherit"){if(!tt.includes(t))throw Error(`density name "${t}" invalid`);let i;if(t=="inherit")i=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);i=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);i=e-o}else i=e;return Math.max(0,Math.min(4,i))}function nn(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 i=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(i=on(i,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),i}function g(e){let t=nn(e);return B(e?Ae(e):"light").densities[t]}var G=ve.colors.neutral.length,ze=["inherit","base"];[...Array(G).keys()].forEach(e=>{ze.push(`decrease-${e}`),ze.push(`increase-${e}`),ze.push(`shift-${e}`)});function Nt(e,t){if(e<0||e>G-1)return e;let i=e+t;return i=Math.max(0,Math.min(G-1,i)),i}function rn(e,t){if(e<0||e>G-1)return e;let i=Math.floor((G-1)/2),o=e<=i?e+t:e-t;return o=Math.max(0,Math.min(G-1,o)),o}function Se(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!ze.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let i=parseInt(t.replace("increase-",""),10);return Nt(e,i)}else if(t.startsWith("decrease-")){let i=parseInt(t.replace("decrease-",""),10);return Nt(e,-i)}else if(t.startsWith("shift-")){let i=parseInt(t.replace("shift-",""),10);return rn(e,i)}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 i=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(i=Se(i,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),i}function Wt(e,t,i){return i<=0?e:t==="lighten"&&e===0?i:t==="darken"&&e===G-1?G-1-i:e}function l(e,t="inherit",i="inherit"){let o=i=="inherit"?"neutral":i;if(!e)return t=="base"?be()[o][B("light").baseTones[o]]:be()[o][Se(0,t)];let r=Ae(e),n;if(t=="base")n=B(r).baseTones[o];else{let c=B(r),m=Wt(jt(e),c.direction,c.darkBias);n=Se(m,t)}let a=be()[o];if(!a)throw Error(`color "${o}" not found on theme "${r}"`);return a[n]}function it(e,t="inherit",i="inherit"){let o=i=="inherit"?"neutral":i,r=e?Ae(e):"light",n=Bt(r);if(!e)return t=="base"?n[o][B("light").baseTones[o]]:n[o][Se(0,t)];let a;if(t=="base")a=B(r).baseTones[o];else{let c=B(r),m=Wt(jt(e),c.direction,c.darkBias);a=Se(m,t)}return n[o][a]}var We={};$e(We,{abbreviation:()=>an,alert:()=>yn,avatar:()=>bn,badge:()=>vn,blockquote:()=>Yn,breadcrumb:()=>Sn,breadcrumbEllipsis:()=>xn,button:()=>Xn,buttonSwitch:()=>Ii,card:()=>ln,code:()=>Zn,combobox:()=>Gn,command:()=>un,commandItem:()=>fn,commandSearch:()=>hn,descriptionList:()=>ei,details:()=>Qn,dialog:()=>ti,divider:()=>Wi,drawer:()=>Ki,emphasis:()=>oi,figure:()=>ni,formGroup:()=>ii,heading:()=>ai,horizontalRule:()=>li,icon:()=>ci,image:()=>si,inputCheckbox:()=>Jn,inputColor:()=>mi,inputDateTime:()=>ui,inputFile:()=>hi,inputNumber:()=>gi,inputOTP:()=>gn,inputRadio:()=>Ei,inputRange:()=>pi,inputSearch:()=>fi,inputSwitch:()=>$i,inputText:()=>di,keyboard:()=>yi,label:()=>bi,link:()=>vi,mark:()=>Si,menu:()=>Qi,menuItem:()=>er,motion:()=>tr,orderedList:()=>Bi,pagination:()=>ji,paragraph:()=>xi,popover:()=>Ui,popoverArrow:()=>ht,preformated:()=>Ci,progress:()=>wi,select:()=>ki,selectBox:()=>Ri,selectItem:()=>Pi,selectList:()=>Oi,skeleton:()=>Ti,small:()=>Li,spinner:()=>_i,splitter:()=>sn,splitterHandle:()=>mn,splitterPanel:()=>cn,strong:()=>zi,subscript:()=>Ai,superscript:()=>Mi,tab:()=>Ji,tabPanel:()=>Zi,table:()=>Ni,tabs:()=>Xi,tag:()=>xe,textarea:()=>Vi,toast:()=>qi,toggle:()=>dn,toggleGroup:()=>pn,tooltip:()=>Gi,transitionGroup:()=>Yi,unorderedList:()=>Di});function an(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>y(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",i.get(n)),textDecorationColor:n=>l(n,"shift-9",i.get(n))}}}}function ln(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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(g(o)*2),paddingInline:o=>s(g(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(g(o)*4),color:o=>l(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=>l(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 ${l(o,"shift-3",t.get(o))}`}}}}function sn(e={}){let{direction:t="horizontal",defaultSize:i=50,min:o=10,max:r=90}=e;return{_onSchedule:(n,a)=>{_(a,{_context:{splitter:{direction:t,size:d(i),min:o,max:r}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function cn(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let i=e.domElement,o=t.direction==="horizontal"?"width":"height";i.style[o]=`${t.size.get()}%`,i.style.flexShrink="0",i.style.overflow="auto";let r=t.size.addListener(n=>{i.style[o]=`${n}%`});e.addHook("Remove",r)}}}function mn(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let i=e.domElement,o=t.direction==="horizontal";i.style.cursor=o?"col-resize":"row-resize";let r=n=>{n.preventDefault();let a=i.parentElement,c=u=>{let h=a.getBoundingClientRect(),f=o?(u.clientX-h.left)/h.width*100:(u.clientY-h.top)/h.height*100;t.size.set(Math.min(Math.max(f,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};i.addEventListener("mousedown",r),e.addHook("Remove",()=>i.removeEventListener("mousedown",r))},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 un(){return{_onSchedule:(e,t)=>{_(t,{_context:{command:{query:d("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function hn(e={}){let{color:t="neutral",accentColor:i="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let r=o.getContext("command");if(!r){console.warn('"commandSearch" patch must be used inside a "command"');return}let n=o.domElement,a=()=>r.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},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 ${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",i)}}}}function fn(e={}){let{color:t="neutral",accentColor:i="primary"}=e;return{role:"option",_onMount:o=>{var m,u;let r=o.getContext("command");if(!r){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,a=(u=(m=n.textContent)==null?void 0:m.toLowerCase())!=null?u:"",c=r.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=>y(o,"inherit"),height:o=>s(6+g(o)*2),paddingInline:o=>s(g(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",i)}`,outlineOffset:`-${s(.5)}`}}}}function dn(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"primary","accentColor");return{role:"button",_onInsert:n=>{var h,f;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 m=((f=(h=n.parent)==null?void 0:h.children.items)!=null?f:[]).filter(b=>b.type==="ElementNode"&&b.attributes.get("role")==="button"),u=n.key!==null&&n.key!==void 0?String(n.key):String(m.findIndex(b=>b===n));n.attributes.set("ariaPressed",b=>{let p=a.value.get(b);return Array.isArray(p)?p.includes(u):p===u}),n.addEvent("click",()=>{let b=a.value.get();if(a.multiple){let p=Array.isArray(b)?[...b]:[];a.value.set(p.includes(u)?p.filter(v=>v!==u):[...p,u])}else a.value.set(b===u?"":u)})},style:{cursor:"pointer",fontSize:n=>y(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",i.get(n)),color:n=>l(n,"shift-12",i.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function pn(e={}){var o;let{multiple:t=!1,color:i="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:d((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:r=>y(r,"inherit"),backgroundColor:r=>l(r,"inherit",i),outline:r=>`1px solid ${l(r,"shift-3",i)}`,outlineOffset:"-1px"}}}function gn(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,i=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=i(),m=a.target,u=c.indexOf(m);m.value&&u<c.length-1&&c[u+1].focus()},r=a=>{let c=i(),m=a.target,u=c.indexOf(m);a.key==="Backspace"&&!m.value&&u>0&&c[u-1].focus(),a.key==="ArrowLeft"&&u>0&&c[u-1].focus(),a.key==="ArrowRight"&&u<c.length-1&&c[u+1].focus()},n=a=>{var f,b,p;a.preventDefault();let c=(b=(f=a.clipboardData)==null?void 0:f.getData("text"))!=null?b:"",m=i(),u=m.indexOf(a.target);[...c].forEach((v,x)=>{m[u+x]&&(m[u+x].value=v)});let h=Math.min(u+c.length-1,m.length-1);(p=m[h])==null||p.focus()};t.addEventListener("input",o),t.addEventListener("keydown",r),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",r),t.removeEventListener("paste",n)})}}}function yn(e={}){var i;let t=d((i=e.color)!=null?i:"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 ${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=>y(o,"inherit")}}}function bn(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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 vn(e={}){var r;let{label:t=999}=e,i=d(t),o=d((r=e.color)!=null?r:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${i.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=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function Sn(e={}){var o;let{separator:t="/"}=e,i=d((o=e.color)!=null?o:"neutral","color");return{_onInsert:r=>{r.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:r=>y(r,"inherit"),gap:s(1),color:r=>l(r,"shift-9",i.get(r)),backgroundColor:r=>l(r,"inherit",i.get(r)),"& > *":{display:"inline-flex",alignItems:"center",color:r=>l(r,"shift-8",i.get(r))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:r=>l(r,"shift-4",i.get(r)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:r=>l(r,"shift-10",i.get(r)),pointerEvents:"none"}}}}function xn(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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)}}}}var Cn='<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,i=d((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:r=>{let n={span:Cn,onClick:a=>{a.stopPropagation(),r.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",i.get(a))}}};t&&r.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:r=>y(r,"inherit"),backgroundColor:r=>l(r,"inherit",i.get(r)),color:r=>l(r,"shift-9",i.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"shift-4",i.get(r))}`}}}var he=Math.min,W=Math.max,we=Math.round,Ee=Math.floor,N=e=>({x:e,y:e}),wn={left:"right",right:"left",bottom:"top",top:"bottom"};function rt(e,t,i){return W(e,he(t,i))}function ke(e,t){return typeof e=="function"?e(t):e}function Y(e){return e.split("-")[0]}function Te(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function lt(e){return e==="y"?"height":"width"}function F(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function st(e){return at(F(e))}function Ut(e,t,i){i===void 0&&(i=!1);let o=Te(e),r=st(e),n=lt(r),a=r==="x"?o===(i?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=Ce(a)),[a,Ce(a)]}function qt(e){let t=Ce(e);return[Ne(e),t,Ne(t)]}function Ne(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Ft=["left","right"],Kt=["right","left"],En=["top","bottom"],kn=["bottom","top"];function Tn(e,t,i){switch(e){case"top":case"bottom":return i?t?Kt:Ft:t?Ft:Kt;case"left":case"right":return t?En:kn;default:return[]}}function Gt(e,t,i,o){let r=Te(e),n=Tn(Y(e),i==="start",o);return r&&(n=n.map(a=>a+"-"+r),t&&(n=n.concat(n.map(Ne)))),n}function Ce(e){let t=Y(e);return wn[t]+e.slice(t.length)}function _n(e){return P({top:0,right:0,bottom:0,left:0},e)}function Yt(e){return typeof e!="number"?_n(e):{top:e,right:e,bottom:e,left:e}}function te(e){let{x:t,y:i,width:o,height:r}=e;return{width:o,height:r,top:i,left:t,right:t+o,bottom:i+r,x:t,y:i}}function Xt(e,t,i){let{reference:o,floating:r}=e,n=F(t),a=st(t),c=lt(a),m=Y(t),u=n==="y",h=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,b=o[c]/2-r[c]/2,p;switch(m){case"top":p={x:h,y:o.y-r.height};break;case"bottom":p={x:h,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(Te(t)){case"start":p[a]-=b*(i&&u?-1:1);break;case"end":p[a]+=b*(i&&u?-1:1);break}return p}function Jt(e,t){return j(this,null,function*(){var i;t===void 0&&(t={});let{x:o,y:r,platform:n,rects:a,elements:c,strategy:m}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:b=!1,padding:p=0}=ke(t,e),v=Yt(p),S=c[b?f==="floating"?"reference":"floating":f],C=te(yield n.getClippingRect({element:(i=yield n.isElement==null?void 0:n.isElement(S))==null||i?S:S.contextElement||(yield n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:u,rootBoundary:h,strategy:m})),w=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,E=yield n.getOffsetParent==null?void 0:n.getOffsetParent(c.floating),k=(yield n.isElement==null?void 0:n.isElement(E))?(yield n.getScale==null?void 0:n.getScale(E))||{x:1,y:1}:{x:1,y:1},T=te(n.convertOffsetParentRelativeRectToViewportRelativeRect?yield n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:E,strategy:m}):w);return{top:(C.top-T.top+v.top)/k.y,bottom:(T.bottom-C.bottom+v.bottom)/k.y,left:(C.left-T.left+v.left)/k.x,right:(T.right-C.right+v.right)/k.x}})}var On=50,Zt=(e,t,i)=>j(null,null,function*(){let{placement:o="bottom",strategy:r="absolute",middleware:n=[],platform:a}=i,c=a.detectOverflow?a:M(P({},a),{detectOverflow:Jt}),m=yield a.isRTL==null?void 0:a.isRTL(t),u=yield a.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:f}=Xt(u,o,m),b=o,p=0,v={};for(let x=0;x<n.length;x++){let S=n[x];if(!S)continue;let{name:C,fn:w}=S,{x:E,y:k,data:T,reset:O}=yield w({x:h,y:f,initialPlacement:o,placement:b,strategy:r,middlewareData:v,rects:u,platform:c,elements:{reference:e,floating:t}});h=E!=null?E:h,f=k!=null?k:f,v[C]=P(P({},v[C]),T),O&&p<On&&(p++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(u=O.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:r}):O.rects),{x:h,y:f}=Xt(u,b,m)),x=-1)}return{x:h,y:f,placement:b,strategy:r,middlewareData:v}});var Qt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(i){return j(this,null,function*(){var o,r;let{placement:n,middlewareData:a,rects:c,initialPlacement:m,platform:u,elements:h}=i,bt=ke(e,i),{mainAxis:f=!0,crossAxis:b=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0}=bt,C=Ue(bt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let w=Y(n),E=F(m),k=Y(m)===m,T=yield u.isRTL==null?void 0:u.isRTL(h.floating),O=p||(k||!S?[Ce(m)]:qt(m)),I=x!=="none";!p&&I&&O.push(...Gt(m,S,x,T));let dt=[m,...O],ae=yield u.detectOverflow(i,C),le=[],se=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&le.push(ae[w]),b){let J=Ut(n,c,T);le.push(ae[J[0]],ae[J[1]])}if(se=[...se,{placement:n,overflows:le}],!le.every(J=>J<=0)){var pt,gt;let J=(((pt=a.flip)==null?void 0:pt.index)||0)+1,Fe=dt[J];if(Fe&&(!(b==="alignment"?E!==F(Fe):!1)||se.every(A=>F(A.placement)===E?A.overflows[0]>0:!0)))return{data:{index:J,overflows:se},reset:{placement:Fe}};let ye=(gt=se.filter(Z=>Z.overflows[0]<=0).sort((Z,A)=>Z.overflows[1]-A.overflows[1])[0])==null?void 0:gt.placement;if(!ye)switch(v){case"bestFit":{var yt;let Z=(yt=se.filter(A=>{if(I){let U=F(A.placement);return U===E||U==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(U=>U>0).reduce((U,_o)=>U+_o,0)]).sort((A,U)=>A[1]-U[1])[0])==null?void 0:yt[0];Z&&(ye=Z);break}case"initialPlacement":ye=m;break}if(n!==ye)return{reset:{placement:ye}}}return{}})}}};var Pn=new Set(["left","top"]);function Rn(e,t){return j(this,null,function*(){let{placement:i,platform:o,elements:r}=e,n=yield o.isRTL==null?void 0:o.isRTL(r.floating),a=Y(i),c=Te(i),m=F(i)==="y",u=Pn.has(a)?-1:1,h=n&&m?-1:1,f=ke(t,e),{mainAxis:b,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof v=="number"&&(p=c==="end"?v*-1:v),m?{x:p*h,y:b*u}:{x:b*u,y:p*h}})}var eo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(i){return j(this,null,function*(){var o,r;let{x:n,y:a,placement:c,middlewareData:m}=i,u=yield Rn(i,e);return c===((o=m.offset)==null?void 0:o.placement)&&(r=m.arrow)!=null&&r.alignmentOffset?{}:{x:n+u.x,y:a+u.y,data:M(P({},u),{placement:c})}})}}},to=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(i){return j(this,null,function*(){let{x:o,y:r,placement:n,platform:a}=i,w=ke(e,i),{mainAxis:c=!0,crossAxis:m=!1,limiter:u={fn:E=>{let{x:k,y:T}=E;return{x:k,y:T}}}}=w,h=Ue(w,["mainAxis","crossAxis","limiter"]),f={x:o,y:r},b=yield a.detectOverflow(i,h),p=F(Y(n)),v=at(p),x=f[v],S=f[p];if(c){let E=v==="y"?"top":"left",k=v==="y"?"bottom":"right",T=x+b[E],O=x-b[k];x=rt(T,x,O)}if(m){let E=p==="y"?"top":"left",k=p==="y"?"bottom":"right",T=S+b[E],O=S-b[k];S=rt(T,S,O)}let C=u.fn(M(P({},i),{[v]:x,[p]:S}));return M(P({},C),{data:{x:C.x-o,y:C.y-r,enabled:{[v]:c,[p]:m}}})})}}};function Ve(){return typeof window!="undefined"}function ne(e){return no(e)?(e.nodeName||"").toLowerCase():"#document"}function $(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(no(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function no(e){return Ve()?e instanceof Node||e instanceof $(e).Node:!1}function L(e){return Ve()?e instanceof Element||e instanceof $(e).Element:!1}function H(e){return Ve()?e instanceof HTMLElement||e instanceof $(e).HTMLElement:!1}function oo(e){return!Ve()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof $(e).ShadowRoot}function de(e){let{overflow:t,overflowX:i,overflowY:o,display:r}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+i)&&r!=="inline"&&r!=="contents"}function io(e){return/^(table|td|th)$/.test(ne(e))}function _e(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var $n=/transform|translate|scale|rotate|perspective|filter/,In=/paint|layout|strict|content/,oe=e=>!!e&&e!=="none",ct;function De(e){let t=L(e)?z(e):e;return oe(t.transform)||oe(t.translate)||oe(t.scale)||oe(t.rotate)||oe(t.perspective)||!Be()&&(oe(t.backdropFilter)||oe(t.filter))||$n.test(t.willChange||"")||In.test(t.contain||"")}function ro(e){let t=K(e);for(;H(t)&&!ie(t);){if(De(t))return t;if(_e(t))return null;t=K(t)}return null}function Be(){return ct==null&&(ct=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ct}function ie(e){return/^(html|body|#document)$/.test(ne(e))}function z(e){return $(e).getComputedStyle(e)}function Oe(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function K(e){if(ne(e)==="html")return e;let t=e.assignedSlot||e.parentNode||oo(e)&&e.host||V(e);return oo(t)?t.host:t}function ao(e){let t=K(e);return ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&de(t)?t:ao(t)}function fe(e,t,i){var o;t===void 0&&(t=[]),i===void 0&&(i=!0);let r=ao(e),n=r===((o=e.ownerDocument)==null?void 0:o.body),a=$(r);if(n){let c=He(a);return t.concat(a,a.visualViewport||[],de(r)?r:[],c&&i?fe(c):[])}else return t.concat(r,fe(r,[],i))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mo(e){let t=z(e),i=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=H(e),n=r?e.offsetWidth:i,a=r?e.offsetHeight:o,c=we(i)!==n||we(o)!==a;return c&&(i=n,o=a),{width:i,height:o,$:c}}function ut(e){return L(e)?e:e.contextElement}function pe(e){let t=ut(e);if(!H(t))return N(1);let i=t.getBoundingClientRect(),{width:o,height:r,$:n}=mo(t),a=(n?we(i.width):i.width)/o,c=(n?we(i.height):i.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var Ln=N(0);function uo(e){let t=$(e);return!Be()||!t.visualViewport?Ln:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zn(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==$(e)?!1:t}function re(e,t,i,o){t===void 0&&(t=!1),i===void 0&&(i=!1);let r=e.getBoundingClientRect(),n=ut(e),a=N(1);t&&(o?L(o)&&(a=pe(o)):a=pe(e));let c=zn(n,i,o)?uo(n):N(0),m=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,h=r.width/a.x,f=r.height/a.y;if(n){let b=$(n),p=o&&L(o)?$(o):o,v=b,x=He(v);for(;x&&o&&p!==v;){let S=pe(x),C=x.getBoundingClientRect(),w=z(x),E=C.left+(x.clientLeft+parseFloat(w.paddingLeft))*S.x,k=C.top+(x.clientTop+parseFloat(w.paddingTop))*S.y;m*=S.x,u*=S.y,h*=S.x,f*=S.y,m+=E,u+=k,v=$(x),x=He(v)}}return te({width:h,height:f,x:m,y:u})}function je(e,t){let i=Oe(e).scrollLeft;return t?t.left+i:re(V(e)).left+i}function ho(e,t){let i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-je(e,i),r=i.top+t.scrollTop;return{x:o,y:r}}function An(e){let{elements:t,rect:i,offsetParent:o,strategy:r}=e,n=r==="fixed",a=V(o),c=t?_e(t.floating):!1;if(o===a||c&&n)return i;let m={scrollLeft:0,scrollTop:0},u=N(1),h=N(0),f=H(o);if((f||!f&&!n)&&((ne(o)!=="body"||de(a))&&(m=Oe(o)),f)){let p=re(o);u=pe(o),h.x=p.x+o.clientLeft,h.y=p.y+o.clientTop}let b=a&&!f&&!n?ho(a,m):N(0);return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-m.scrollLeft*u.x+h.x+b.x,y:i.y*u.y-m.scrollTop*u.y+h.y+b.y}}function Mn(e){return Array.from(e.getClientRects())}function Nn(e){let t=V(e),i=Oe(e),o=e.ownerDocument.body,r=W(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=W(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-i.scrollLeft+je(e),c=-i.scrollTop;return z(o).direction==="rtl"&&(a+=W(t.clientWidth,o.clientWidth)-r),{width:r,height:n,x:a,y:c}}var lo=25;function Vn(e,t){let i=$(e),o=V(e),r=i.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,m=0;if(r){n=r.width,a=r.height;let h=Be();(!h||h&&t==="fixed")&&(c=r.offsetLeft,m=r.offsetTop)}let u=je(o);if(u<=0){let h=o.ownerDocument,f=h.body,b=getComputedStyle(f),p=h.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,v=Math.abs(o.clientWidth-f.clientWidth-p);v<=lo&&(n-=v)}else u<=lo&&(n+=u);return{width:n,height:a,x:c,y:m}}function Dn(e,t){let i=re(e,!0,t==="fixed"),o=i.top+e.clientTop,r=i.left+e.clientLeft,n=H(e)?pe(e):N(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,m=r*n.x,u=o*n.y;return{width:a,height:c,x:m,y:u}}function so(e,t,i){let o;if(t==="viewport")o=Vn(e,i);else if(t==="document")o=Nn(V(e));else if(L(t))o=Dn(t,i);else{let r=uo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return te(o)}function fo(e,t){let i=K(e);return i===t||!L(i)||ie(i)?!1:z(i).position==="fixed"||fo(i,t)}function Bn(e,t){let i=t.get(e);if(i)return i;let o=fe(e,[],!1).filter(c=>L(c)&&ne(c)!=="body"),r=null,n=z(e).position==="fixed",a=n?K(e):e;for(;L(a)&&!ie(a);){let c=z(a),m=De(a);!m&&c.position==="fixed"&&(r=null),(n?!m&&!r:!m&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||de(a)&&!m&&fo(e,a))?o=o.filter(h=>h!==a):r=c,a=K(a)}return t.set(e,o),o}function Hn(e){let{element:t,boundary:i,rootBoundary:o,strategy:r}=e,a=[...i==="clippingAncestors"?_e(t)?[]:Bn(t,this._c):[].concat(i),o],c=so(t,a[0],r),m=c.top,u=c.right,h=c.bottom,f=c.left;for(let b=1;b<a.length;b++){let p=so(t,a[b],r);m=W(p.top,m),u=he(p.right,u),h=he(p.bottom,h),f=W(p.left,f)}return{width:u-f,height:h-m,x:f,y:m}}function jn(e){let{width:t,height:i}=mo(e);return{width:t,height:i}}function Wn(e,t,i){let o=H(t),r=V(t),n=i==="fixed",a=re(e,!0,n,t),c={scrollLeft:0,scrollTop:0},m=N(0);function u(){m.x=je(r)}if(o||!o&&!n)if((ne(t)!=="body"||de(r))&&(c=Oe(t)),o){let p=re(t,!0,n,t);m.x=p.x+t.clientLeft,m.y=p.y+t.clientTop}else r&&u();n&&!o&&r&&u();let h=r&&!o&&!n?ho(r,c):N(0),f=a.left+c.scrollLeft-m.x-h.x,b=a.top+c.scrollTop-m.y-h.y;return{x:f,y:b,width:a.width,height:a.height}}function mt(e){return z(e).position==="static"}function co(e,t){if(!H(e)||z(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return V(e)===i&&(i=i.ownerDocument.body),i}function po(e,t){let i=$(e);if(_e(e))return i;if(!H(e)){let r=K(e);for(;r&&!ie(r);){if(L(r)&&!mt(r))return r;r=K(r)}return i}let o=co(e,t);for(;o&&io(o)&&mt(o);)o=co(o,t);return o&&ie(o)&&mt(o)&&!De(o)?i:o||ro(e)||i}var Fn=function(e){return j(this,null,function*(){let t=this.getOffsetParent||po,i=this.getDimensions,o=yield i(e.floating);return{reference:Wn(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Kn(e){return z(e).direction==="rtl"}var Un={convertOffsetParentRelativeRectToViewportRelativeRect:An,getDocumentElement:V,getClippingRect:Hn,getOffsetParent:po,getElementRects:Fn,getClientRects:Mn,getDimensions:jn,getScale:pe,isElement:L,isRTL:Kn};function go(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qn(e,t){let i=null,o,r=V(e);function n(){var c;clearTimeout(o),(c=i)==null||c.disconnect(),i=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),n();let u=e.getBoundingClientRect(),{left:h,top:f,width:b,height:p}=u;if(c||t(),!b||!p)return;let v=Ee(f),x=Ee(r.clientWidth-(h+b)),S=Ee(r.clientHeight-(f+p)),C=Ee(h),E={rootMargin:-v+"px "+-x+"px "+-S+"px "+-C+"px",threshold:W(0,he(1,m))||1},k=!0;function T(O){let I=O[0].intersectionRatio;if(I!==m){if(!k)return a();I?a(!1,I):o=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!go(u,e.getBoundingClientRect())&&a(),k=!1}try{i=new IntersectionObserver(T,M(P({},E),{root:r.ownerDocument}))}catch(O){i=new IntersectionObserver(T,E)}i.observe(e)}return a(!0),n}function yo(e,t,i,o){o===void 0&&(o={});let{ancestorScroll:r=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=ut(e),h=r||n?[...u?fe(u):[],...t?fe(t):[]]:[];h.forEach(C=>{r&&C.addEventListener("scroll",i,{passive:!0}),n&&C.addEventListener("resize",i)});let f=u&&c?qn(u,i):null,b=-1,p=null;a&&(p=new ResizeObserver(C=>{let[w]=C;w&&w.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),i()}),u&&!m&&p.observe(u),t&&p.observe(t));let v,x=m?re(e):null;m&&S();function S(){let C=re(e);x&&!go(x,C)&&i(),x=C,v=requestAnimationFrame(S)}return i(),()=>{var C;h.forEach(w=>{r&&w.removeEventListener("scroll",i),n&&w.removeEventListener("resize",i)}),f==null||f(),(C=p)==null||C.disconnect(),p=null,m&&cancelAnimationFrame(v)}}var bo=eo;var vo=to,So=Qt;var xo=(e,t,i)=>{let o=new Map,r=P({platform:Un},i),n=M(P({},r.platform),{_c:o});return Zt(e,t,M(P({},r),{platform:n}))};function X(e){let{open:t=!1,placement:i}=e,o=null,r=null,n=null,a=null,c=null,m=null,u=!1,h=d(t),f=()=>{u||!m||(u=!0,c=m.children.insert(e.content))},b=()=>{f(),n&&a&&(r&&r(),r=yo(n,a,()=>{xo(n,a,{placement:i.get(),middleware:[bo(12),So(),vo()],strategy:"fixed"}).then(({x:w,y:E,placement:k})=>{Object.assign(a.style,{left:`${w}px`,top:`${E}px`}),i.set(k)})}),h.set(!0))},p=()=>{r&&r(),r=null,h.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},x=()=>{o&&clearTimeout(o),o=setTimeout(p,100)},S={style:{position:"fixed",pointerEvents:"auto",visibility:w=>h.get(w)?"visible":"hidden"},_onMount:w=>a=w.domElement,_portal:w=>{let E=w.domElement.querySelector("#domphy-floating");if(!E){let k={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};E=w.children.insert(k).domElement}return E}};return _(e.content,S),{show:v,hide:x,anchorPartial:{onKeyDown:w=>w.key==="Escape"&&x(),_onMount:w=>{m=w.getRoot(),n=w.domElement;let E=k=>{if(!h.get()||!n||!a)return;let T=k.target;!n.contains(T)&&!a.contains(T)&&x()};w.getRoot().domElement.addEventListener("click",E),w.addHook("BeforeRemove",()=>{o&&clearTimeout(o),r&&(r(),r=null),c&&c.remove(),w.getRoot().domElement.removeEventListener("click",E)})}}}}function Gn(e){let{options:t=[],placement:i="bottom",color:o="neutral",open:r=!1,multiple:n=!1}=e,a=d(e.value),c=d(r),{show:m,hide:u,anchorPartial:h}=X({open:c,placement:d(i),content:e.content}),f={onClick:()=>!n&&u()};_(e.content,f);let b={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:S=>y(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)},p;e.input?(_(e.input,{onFocus:()=>m(),style:b,_key:"combobox-input"}),p=e.input):p={input:null,onFocus:()=>m(),value:S=>(a.get(S),""),style:b,_key:"combobox-input"};let v={div:S=>{let C=a.get(S),w=Array.isArray(C)?C:[C],k=t.filter(T=>w.includes(T.value)).map(T=>({span:T.label,$:[xe({color:o,removable:!0})],_key:T.value,_onRemove:O=>{let I=a.get(),ae=(Array.isArray(I)?I:[I]).filter(le=>le!==T.value);n?a.set(ae):a.set(ae[0])}}));return k.push(p),k},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},x={_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 ${l(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=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)}};return _(h,x),h}function ht(e={}){let{placement:t="bottom-end",color:i="neutral",sideOffset:o=s(6),bordered:r=!0}=e,n=d(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 f;return(f=a[n.get(h)])!=null?f:a["bottom-end"]},m=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",u=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>y(h),backgroundColor:h=>l(h),color:h=>l(h,"shift-9",i),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:h=>l(h,"inherit",i),borderWidth:r?"1px":"0px",borderColor:h=>l(h,"inherit",i),borderTopStyle:h=>{let f=c(h);return f.includes("top")||f.includes("right")?"solid":"none"},borderBottomStyle:h=>{let f=c(h);return f.includes("bottom")||f.includes("left")?"solid":"none"},borderLeftStyle:h=>{let f=c(h);return f.includes("top")||f.includes("left")?"solid":"none"},borderRightStyle:h=>{let f=c(h);return f.includes("bottom")||f.includes("right")?"solid":"none"},top:h=>{let f=c(h);return f.includes("top")?0:f.includes("bottom")?"auto":m(f)},right:h=>{let f=c(h);return f.includes("right")?0:f.includes("left")?"auto":u(f)},bottom:h=>{let f=c(h);return f.includes("bottom")?0:f.includes("top")?"auto":u(f)},left:h=>{let f=c(h);return f.includes("left")?0:f.includes("right")?"auto":m(f)},transform:h=>{let f=c(h),b=f.includes("right")||f.includes("end")&&!f.includes("left")?"50%":"-50%",p=f.includes("bottom")||f.includes("end")&&!f.includes("top")?"50%":"-50%";return`translate(${b},${p}) rotate(45deg)`}}}}}function Yn(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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(g(o)*2),paddingInline:o=>s(g(o)*4),margin:0}}}function Xn(e={}){var i;let t=d((i=e.color)!=null?i:"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 ${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 Jn(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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 ${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",i.get(n))}`,backgroundColor:n=>l(n,"shift-8",i.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",i.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",i.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",i.get(n))}`,backgroundColor:n=>l(n,"shift-3",i.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",i.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",i.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Zn(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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)}}}function Qn(e={}){var r,n;let{duration:t=240}=e,i=d((r=e.color)!=null?r:"neutral","color"),o=d((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=>y(a,"inherit"),color:a=>l(a,"shift-9",i.get(a)),backgroundColor:a=>l(a,"inherit",i.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",i.get(a)),color:a=>l(a,"shift-10",i.get(a)),fontSize:a=>y(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(g(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",i.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",i.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",i.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(g(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(g(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(g(a)*1),paddingBottom:a=>s(g(a)*3)}}}}function ei(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function ti(e={}){let{color:t="neutral",open:i=!1}=e,o=d(i);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,n)=>{if(r.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();r.clientX>=a.left&&r.clientX<=a.right&&r.clientY>=a.top&&r.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(r,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:r=>{let n=r.domElement,a=m=>{m?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let u=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');u==null||u.focus()})):n.style.opacity="0"};a(o.get());let c=o.addListener(a);r.addHook("Remove",()=>{c(),document.body.style.overflow=""})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>y(r,"inherit"),color:r=>l(r,"shift-10",t),backgroundColor:r=>l(r,"inherit",t),border:"none",padding:r=>s(g(r)*3),boxShadow:r=>`0 ${s(9)} ${s(16)} ${l(r,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:r=>l(r,"shift-2","neutral"),opacity:.75}}}}function oi(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-10",t.get(o))}}}function ni(e={}){var i;let t=d((i=e.color)!=null?i:"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=>y(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function ii(e={}){var r;let{layout:t="horizontal"}=e,i=d((r=e.color)!=null?r:"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=>l(n,"inherit",i.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=>l(n,"shift-9",i.get(n)),backgroundColor:n=>l(n,"inherit",i.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=>l(n,"shift-9",i.get(n))}}}}var ri={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function ai(e={}){var i;let t=d((i=e.color)!=null?i:"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 r=ri[o.elementNode.tagName]||"inherit";return y(o,r)}}}}function li(e={}){var i;let t=d((i=e.color)!=null?i:"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 si(e={}){var i;let t=d((i=e.color)!=null?i:"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 ci(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function mi(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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=>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=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function ui(e={}){var r,n;let{mode:t="datetime-local"}=e,i=d((r=e.color)!=null?r:"neutral","color"),o=d((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=>y(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",i.get(a)),backgroundColor:a=>l(a,"inherit",i.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",i.get(a))}`,borderRadius:a=>s(g(a)*1),paddingInline:a=>s(g(a)*3),height:a=>s(6+g(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 hi(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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=>y(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(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=>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",i.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 fi(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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=>y(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(g(n)*1),minWidth:s(32),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(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",i.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 di(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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(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 ${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",i.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 pi(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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",i.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",i.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function gi(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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(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 ${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",i.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 yi(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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 bi(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",i.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function vi(e={}){var o,r;let t=d((o=e.color)!=null?o:"primary","color"),i=d((r=e.accentColor)!=null?r:"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=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",i.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",i.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function Si(e={}){var i;let t=d((i=e.accentColor)!=null?i:"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=>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 xi(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Ci(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(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 wi(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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",i.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}function Ei(e={}){var o,r;let t=d((o=e.color)!=null?o:"neutral","color"),i=d((r=e.accentColor)!=null?r:"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 ${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",i.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",i.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",i.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",i.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function ki(e={}){let{color:t="neutral",accentColor:i="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=>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(g(o)*1),paddingBlock:o=>s(g(o)*1),paddingLeft:o=>s(g(o)*3),paddingRight:o=>s(g(o)*5),backgroundImage:o=>{let r=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${it(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(r)}")`},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 ${l(o,"shift-5",i)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",i)}`},"& 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 Ti(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color"),i={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=me(JSON.stringify(i));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>y(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}`]:i}}}var wo={to:{transform:"rotate(360deg)"}},Co=me(JSON.stringify(wo));function _i(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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:`${Co} 0.7s linear infinite`,[`@keyframes ${Co}`]:wo}}}function Oi(e={}){var a;let{color:t="neutral",multiple:i=!1}=e,o=d((a=e.value)!=null?a:i?[]:null),r={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(h=>({input:null,name:e.name,value:h||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:i}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(g(c)*2),paddingInline:c=>s(g(c)*2),fontSize:c=>y(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function Pi(e={}){let{accentColor:t="primary",color:i="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",m=>{let u=c.get(m);return a.multiple?u.includes(o):u==o}),n.addEvent("click",()=>{let m=c.get();a.multiple?m.includes(o)?c.set(m.filter(u=>u!==o)):c.set(m.concat([o])):m!=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=>l(n,"shift-9",i),backgroundColor:n=>l(n,"inherit",i),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",i)},"&[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 Ri(e){let{options:t=[],placement:i="bottom",color:o="neutral",open:r=!1,multiple:n=!1}=e,a=d(e.value),c=d(r),{show:m,hide:u,anchorPartial:h}=X({open:c,placement:d(i),content:e.content}),f={onClick:()=>!n&&u()};_(e.content,f);let b={div:v=>{let x=a.get(v),S=Array.isArray(x)?x:[x];return t.filter(w=>S.includes(w.value)).map(w=>({span:w.label,$:[xe({color:o,removable:n})],_key:w.value,_onRemove:E=>{let k=a.get(),O=(Array.isArray(k)?k:[k]).filter(I=>I!==w.value);n?a.set(O):a.set(O[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},p={_onInsert:v=>{v.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(b),onClick:()=>c.get()?u():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+g(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(g(v)*2),borderRadius:v=>s(g(v)*1),fontSize:v=>y(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return _(h,p),h}function $i(e={}){var i;let t=d((i=e.accentColor)!=null?i:"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=>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=>y(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ii(e={}){var n,a;let{checked:t=!1}=e,i=d(t),o=d((n=e.color)!=null?n:"neutral","color"),r=d((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=>i.get(c),dataTone:"shift-2",onClick:()=>i.set(!i.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>y(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",r.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 Li(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function zi(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Ai(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function Mi(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o,"shift-9",t.get(o))}}}function Ni(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(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=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(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=>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=>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 Vi(e={}){var r,n;let t=d((r=e.color)!=null?r:"neutral","color"),i=d((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 m=()=>{c.style.height="auto",c.style.height=c.scrollHeight+"px"};c.addEventListener("input",m),m()}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>s(g(a)*2),paddingBlock:a=>s(g(a)*1.5),border:"none",borderRadius:a=>s(g(a)*1.5),fontSize:a=>y(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",i.get(a))}`},"&:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",i.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 Di(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function Bi(e={}){var i;let t=d((i=e.color)!=null?i:"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=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Hi(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let i=[1];e>3&&i.push("...");let o=Math.max(2,e-1),r=Math.min(t-1,e+1);for(let n=o;n<=r;n++)i.push(n);return e<t-2&&i.push("..."),i.push(t),i}function ji(e){var c;let{total:t,color:i="neutral",accentColor:o="primary"}=e,r=d((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>s(6+g(m)*2),height:m=>s(6+g(m)*2),paddingInline:m=>s(g(m)*2),borderRadius:m=>s(g(m)*1),border:"none",cursor:"pointer",fontSize:m=>y(m,"inherit"),backgroundColor:"transparent",color:m=>l(m,"shift-9",i),"&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-2",i)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=M(P({},n),{backgroundColor:m=>l(m,"shift-6",o),color:m=>l(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let u={div:h=>{let f=r.get(h),b=[];b.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:f<=1,onClick:()=>f>1&&r.set(f-1),style:n});for(let p of Hi(f,t))if(p==="...")b.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(g(v)*2),color:v=>l(v,"shift-7",i)}});else{let v=p===f;b.push({button:String(p),type:"button",ariaLabel:`Page ${p}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>r.set(p),style:v?a:n})}return b.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:f>=t,onClick:()=>f<t&&r.set(f+1),style:n}),b},style:{display:"flex",alignItems:"center",gap:s(1)}};m.children.insert(u)},style:{display:"inline-flex"}}}function Wi(e={}){var i;let t=d((i=e.color)!=null?i:"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=>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 Eo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Fi={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},ft=e=>e==="left"||e==="right";function Ki(e={}){let{color:t="neutral",open:i=!1,placement:o="right",size:r}=e,n=d(i),a=ft(o)?s(80):s(64),c=r!=null?r:a;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,u)=>{m.target===u.domElement&&n.set(!1)},onTransitionEnd:(m,u)=>{let h=u.domElement;n.get()||(h.close(),document.body.style.overflow="")},_onMount:m=>{let u=m.domElement,h=b=>{b?(u.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{u.style.transform="translate(0, 0)"})):u.style.transform=Eo[o]};h(n.get());let f=n.addListener(h);m.addHook("Remove",()=>{f(),document.body.style.overflow=""})},style:{transform:Eo[o],transition:"transform 0.25s ease",fontSize:m=>y(m,"inherit"),color:m=>l(m,"shift-10",t),backgroundColor:m=>l(m,"inherit",t),border:"none",padding:m=>s(g(m)*3),margin:Fi[o],width:ft(o)?c:"100dvw",height:ft(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${l(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>l(m,"shift-2","neutral"),opacity:.75}}}}function Ui(e){var b;let{open:t=!1,placement:i="bottom",openOn:o="click"}=e,r=null,n=d(t),a=d(i),{show:c,hide:m,anchorPartial:u}=X({open:n,placement:a,content:e.content}),h={role:"dialog",dataTone:"shift-11",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),_onInsert:p=>{let v=p.attributes.get("id");r=v||p.nodeId,!v&&p.attributes.set("id",r)}};return(b=e.content).$||(b.$=[]),e.content.$.push(h),_(u,{ariaHaspopup:"dialog",ariaExpanded:p=>n.get(p),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),onClick:()=>{o==="click"&&(n.get()?m():c())},onFocus:()=>c(),onBlur:(p,v)=>{let x=p.relatedTarget,S=v.getRoot().domElement,C=r?S.querySelector(`#${CSS.escape(r)}`):null;x&&(C!=null&&C.contains(x))||m()},_onMount:p=>r&&p.attributes.set("ariaControls",r)}),u}function qi(e={}){let{position:t="top-center",color:i="neutral"}=e,o=d(!1),r=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:m=>{let u=m.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=m.children.insert(c).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:m=>s(g(m)*2),paddingInline:m=>s(g(m)*4),borderRadius:m=>s(g(m)*2),fontSize:m=>y(m,"inherit"),color:m=>l(m,"shift-9",i),backgroundColor:m=>l(m,"inherit",i),boxShadow:m=>`0 ${s(2)} ${s(9)} ${l(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,u)=>{let h=f=>{f.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",h),u())};m.domElement.addEventListener("transitionend",h),o.set(!1)}}}function Gi(e={}){let{open:t=!1,placement:i="top",content:o="Tooltip Content"}=e,r=d(i),n=d(o),a=null,c={span:p=>n.get(p)},{show:m,hide:u,anchorPartial:h}=X({open:t,placement:r,content:c}),f={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:p=>{let v=p.attributes.get("id");a=v||p.nodeId,!v&&p.attributes.set("id",a)},style:{paddingBlock:p=>s(g(p)*1),paddingInline:p=>s(g(p)*3),borderRadius:p=>s(g(p)*1),color:p=>l(p,"shift-9"),backgroundColor:p=>l(p),fontSize:p=>y(p,"inherit")},$:[ht({placement:r,bordered:!1})]};return c.$||(c.$=[]),c.$.push(f),_(h,{onMouseEnter:()=>m(),onMouseLeave:()=>u(),onFocus:()=>m(),onBlur:()=>u(),onKeyDown:p=>p.key==="Escape"&&u(),_onMount:p=>a&&p.attributes.set("ariaDescribedby",a)}),h}function ko(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Yi(e={}){let{duration:t=300,delay:i=0}=e,o=new Map;return{_onBeforeUpdate:r=>{o=new Map,r.children.items.forEach((n,a)=>{if(!(n instanceof R))return;let c=n.domElement;c&&o.set(ko(n,a),c.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((n,a)=>{if(!(n instanceof R))return;let c=n.domElement;if(!c)return;let m=ko(n,a),u=o.get(m);if(!u)return;let h=c.getBoundingClientRect(),f=u.left-h.left,b=u.top-h.top;if(Math.abs(f)<.5&&Math.abs(b)<.5)return;let p=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${f}px, ${b}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${i}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=p,c.style.transform=v,c.removeEventListener("transitionend",S)},S=C=>{C.propertyName==="transform"&&x()};c.addEventListener("transitionend",S),setTimeout(x,t+i+34)}),o.clear()}}}function Xi(e={}){return{role:"tablist",_onSchedule:(i,o)=>{let r={_context:{tabs:{activeKey:d(e.activeKey||0)}}};_(o,r)}}}function Ji(e={}){let{accentColor:t="primary",color:i="neutral"}=e;return{role:"tab",_onInsert:r=>{var u,h;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=r.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let a=(h=(u=r.parent)==null?void 0:u.children.items)!=null?h:[];a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="tab");let c=r.key!==null&&r.key!==void 0?r.key:a.findIndex(f=>f==r),m={id:"tab"+r.parent.nodeId+c,ariaControls:"tabpanel"+r.parent.nodeId+c,ariaSelected:f=>n.activeKey.get(f)==c,onClick:()=>n.activeKey.set(c),onKeyDown:f=>{var C,w,E,k;let b=f.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(b))return;f.preventDefault();let p=((w=(C=r.parent)==null?void 0:C.children.items)!=null?w:[]).filter(T=>T.type==="ElementNode"&&T.attributes.get("role")==="tab"),v=p.findIndex(T=>T===r),x=v;b==="ArrowRight"?x=(v+1)%p.length:b==="ArrowLeft"?x=(v-1+p.length)%p.length:b==="Home"?x=0:b==="End"&&(x=p.length-1);let S=p[x];n.activeKey.set((E=S.key)!=null?E:x),(k=S.domElement)==null||k.focus()}};r.merge(m)},style:{cursor:"pointer",fontSize:r=>y(r,"inherit"),height:r=>s(6+g(r)*2),paddingInline:r=>s(g(r)*4),border:"none",outline:"none",color:r=>l(r,"shift-9"),backgroundColor:r=>l(r,"inherit"),boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-1",i)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-2",i)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-6",t)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${s(.5)} 0 0 ${l(r,"shift-6",t)}`}}}}function Zi(){return{role:"tabpanel",style:{paddingBlock:t=>s(g(t)*2),paddingInline:t=>s(g(t)*2)},_onInsert:t=>{var a,c;let i=t.getContext("tabs");if(!i){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(m=>m.type=="ElementNode"&&m.attributes.get("role")=="tabpanel");let r=t.key!==null&&t.key!==void 0?t.key:o.findIndex(m=>m==t),n={id:"tabpanel"+t.parent.nodeId+r,ariaLabelledby:"tab"+t.parent.nodeId+r,hidden:m=>i.activeKey.get(m)!=r};t.merge(n)}}}function Qi(e={}){let{color:t="neutral",selectable:i=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(r,n)=>{var c;let a={_context:{menu:{activeKey:d((c=e.activeKey)!=null?c:null),selectable:i}}};_(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:r=>s(g(r)*2),paddingInline:r=>s(g(r)*2),fontSize:r=>y(r,"inherit"),backgroundColor:r=>l(r,"inherit",t)}}}function er(e={}){let{accentColor:t="primary",color:i="neutral"}=e;return{role:"menuitem",_onInsert:r=>{var m,u;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=r.getContext("menu");if(!n){console.warn('"menuItem" patch must be used inside a "menu"');return}let a=(u=(m=r.parent)==null?void 0:m.children.items)!=null?u:[];a=a.filter(h=>h.type=="ElementNode"&&h.attributes.get("role")=="menuitem");let c=r.key!==null&&r.key!==void 0?r.key:a.findIndex(h=>h==r);n.selectable&&(r.attributes.set("ariaCurrent",h=>n.activeKey.get(h)==c||void 0),r.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(r,n)=>{var h,f,b,p;let a=r.key;if(a==="Enter"||a===" "){r.preventDefault(),(h=n.domElement)==null||h.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;r.preventDefault();let c=((b=(f=n.parent)==null?void 0:f.children.items)!=null?b:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem"),m=c.findIndex(v=>v===n),u=m;a==="ArrowDown"?u=(m+1)%c.length:a==="ArrowUp"?u=(m-1+c.length)%c.length:a==="Home"?u=0:a==="End"&&(u=c.length-1),(p=c[u].domElement)==null||p.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:r=>s(2),width:"100%",fontSize:r=>y(r,"inherit"),height:r=>s(6+g(r)*2),paddingInline:r=>s(g(r)*3),border:"none",outline:"none",color:r=>l(r,"shift-9"),backgroundColor:r=>l(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>l(r,"shift-2")},"&[aria-current=true]":{backgroundColor:r=>l(r,"shift-3",t),color:r=>l(r,"shift-10")},"&:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}var To=e=>!!e&&typeof e.get=="function"&&e._isState===!0,ge=e=>{let t={},i=[];for(let o in e){let r=e[o];o==="x"?i.push(`translateX(${typeof r=="number"?`${r}px`:r})`):o==="y"?i.push(`translateY(${typeof r=="number"?`${r}px`:r})`):o==="scale"?i.push(`scale(${r})`):o==="rotate"?i.push(`rotate(${typeof r=="number"?`${r}deg`:r})`):t[o]=r}return i.length&&(t.transform=i.join(" ")),t};function tr(e={}){var a,c,m,u;let{initial:t,animate:i,exit:o,transition:r={}}=e,n={duration:(a=r.duration)!=null?a:300,delay:(c=r.delay)!=null?c:0,easing:(m=r.easing)!=null?m:"ease",iterations:(u=r.iterations)!=null?u:1,fill:"both"};return{_onMount:h=>{let f=h.domElement;if(!f||typeof f.animate!="function")return;let b=To(i)?i.get():i;if(b?f.animate(t?[ge(t),ge(b)]:[ge(b)],n):t&&Object.assign(f.style,ge(t)),To(i)){let p=i.addListener(v=>{f.animate([ge(v)],n)});h.setMetadata("motionRelease",p)}},_onBeforeRemove:(h,f)=>{let b=h.domElement;if(!b||!o||typeof b.animate!="function")return f();b.animate([ge(o)],n).finished.then(f,f)},_onRemove:h=>{let f=h.getMetadata("motionRelease");f==null||f()}}}return Lo(or);})();
6
6
  //# sourceMappingURL=core-theme-ui.global.js.map