@domphy/ui 0.1.39 → 0.1.41
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.
- package/dist/core-theme-ui.global.js +2 -2
- package/dist/core-theme-ui.global.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";var Domphy=(()=>{var $e=Object.defineProperty,Co=Object.defineProperties,wo=Object.getOwnPropertyDescriptor,Eo=Object.getOwnPropertyDescriptors,ko=Object.getOwnPropertyNames,Re=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable;var bt=(e,t,r)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))Ke.call(t,r)&&bt(e,r,t[r]);if(Re)for(var r of Re(t))vt.call(t,r)&&bt(e,r,t[r]);return e},M=(e,t)=>Co(e,Eo(t));var qe=(e,t)=>{var r={};for(var o in e)Ke.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Re)for(var o of Re(e))t.indexOf(o)<0&&vt.call(e,o)&&(r[o]=e[o]);return r};var Le=(e,t)=>{for(var r in t)$e(e,r,{get:t[r],enumerable:!0})},_o=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ko(t))!Ke.call(e,i)&&i!==r&&$e(e,i,{get:()=>t[i],enumerable:!(o=wo(t,i))||o.enumerable});return e};var To=e=>_o($e({},"__esModule",{value:!0}),e);var B=(e,t,r)=>new Promise((o,i)=>{var n=m=>{try{c(r.next(m))}catch(u){i(u)}},a=m=>{try{c(r.throw(m))}catch(u){i(u)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(n,a);c((r=r.apply(e,t)).next())});var ei={};Le(ei,{core:()=>Ie,theme:()=>Me,ui:()=>We});var Ie={};Le(Ie,{AttributeList:()=>Rt,BooleanAttributes:()=>Je,CamelAttributes:()=>Pt,ElementList:()=>$t,ElementNode:()=>L,HtmlTags:()=>Xe,Notifier:()=>ce,PrefixCSS:()=>Q,RecordState:()=>jo,State:()=>Ge,SvgTags:()=>Ot,VoidTags:()=>Do,hashString:()=>me,merge:()=>_,r:()=>Io,toState:()=>d});var Oo=Object.defineProperty,St=Object.getOwnPropertySymbols,Po=Object.prototype.hasOwnProperty,Ro=Object.prototype.propertyIsEnumerable,xt=(e,t,r)=>t in e?Oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ct=(e,t)=>{for(var r in t||(t={}))Po.call(t,r)&&xt(e,r,t[r]);if(St)for(var r of St(t))Ro.call(t,r)&&xt(e,r,t[r]);return e},$o=["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"],Lo=$o.reduce((e,t)=>{let r=t.slice(2).toLowerCase();return e[r]=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"],J=[],ce=class{constructor(){this._listeners={},this._pending=new Map,this._scheduled=!1}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let r=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(r)),r}removeListener(e,t){if(!this._listeners)return;let r=this._listeners[e];r&&r.has(t)&&(r.delete(t),r.size===0&&delete this._listeners[e])}notify(e,...t){this._listeners&&this._listeners[e]&&(this._isCircular(e)||(this._pending.set(e,{args:t,chain:[...J]}),this._scheduled||(this._scheduled=!0,queueMicrotask(()=>this._flushAll()))))}_isCircular(e){let t=J.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let r=[...J.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
|
|
2
|
-
${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)J=o,this._flush(t,r);J=[]}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){J.push([this,e]);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}J.pop()}}},Ge=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new ce,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 r=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=ee(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(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,f=typeof a=="function"?a(m):a;return[u,f].filter(h=>h).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,f=typeof a=="function"?a(m):a;return[u,f].filter(h=>h).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,f=typeof a=="function"?a(m):a;return[u,f].filter(h=>h).join(" ")}}else e[n]=[e[n],a].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();Ao(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");zo(e,c,a)}else e[n]=a}return e}function me(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function d(e,t){return e instanceof Ge||e!=null&&e._isState?e:new Ge(e,t)}function Io(e){return e}function zo(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function Ao(e,t,r){let o=Lo[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,a)=>{i(n,a),r(n,a)}:e[o]=r}function ee(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(ee(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,n]of e)o.set(ee(i,t),ee(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(ee(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=ee(e[i],t);return o}function Et(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o==0&&!Xe.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")e.$.forEach(a=>Et(a,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function Mo(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function wt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vo(e){return Object.keys(e).find(t=>Xe.includes(t))}function kt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function No(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function _t(e){var t;let r=e.querySelector("#domphy-style");return r||(r=document.createElement("style"),r.id="domphy-style",e.appendChild(r)),r.dataset.domphyBase!=="true"&&((t=r.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),r.dataset.domphyBase="true"),r}var Tt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>_(t,Tt(r))),delete e.$,_(t,e),t}else return e},Do=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Ot=["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"],Q={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"]},Pt=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Bo=class{constructor(e,t,r){this._notifier=new ce,this.parent=r,this.isBoolean=Je.includes(e),Pt.includes(e)?this.name=e:this.name=kt(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,r;let o=this.value;if(e==null)this.value=null;else if(typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e))this.value=wt(e);else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e():e(),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,i.onSubscribe=n=>{this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),i=null})},this.value=this.isBoolean?!!e(i):e(i)}else this.value=this.isBoolean?!!e:e;this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=r=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",r)},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${wt(String(r))}"`}}},Rt=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 Bo(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,i)=>{let n=(o||"").split(" ").filter(a=>a);return!n.includes(i)&&n.push(e),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(r=>r).filter(r=>r!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},Ho=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Mo(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"?"​":this.text}render(e){let t=this._createDOMNode();e.appendChild(t)}},$t=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new L(e,this.owner,this._nextKey++):new Ho(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof L?e.domElement:e.domText;if(o){let i=r.childNodes[t]||null;o!==i&&r.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof L?e.domElement:e.domText,i=t instanceof L?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,a=i.nextSibling;r.insertBefore(o,a),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,a;let c=this.items.slice(),m=new Map;for(let u of c)u instanceof L&&u.key!==null&&u.key!==void 0&&m.set(u.key,u);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));for(let u=0;u<e.length;u++){let f=e[u],h=typeof f=="object"&&f!==null?f._key:void 0;if(h!==void 0){let v=m.get(h);if(v){m.delete(h);let y=this.items.indexOf(v);if(y!==u&&y>=0){let b=v instanceof L&&!!v._portal;this.move(y,u,b?!1:t,!0)}v.parent=this.owner;continue}}this.insert(f,u,t,!0)}for(;this.items.length>e.length;)this.remove(this.items[this.items.length-1],t,!0);m.forEach(u=>this.remove(u,t,!0)),r||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let a=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>a?a:t,m=this._createNode(e);if(this.items.splice(c,0,m),m instanceof L){m._hooks.Insert&&m._hooks.Insert(m);let u=this.owner.domElement;if(r&&u)if(m._portal){let f=m._portal(this.owner.getRoot());f&&m.render(f)}else{let f=m._createDOMNode(),h=(i=u.childNodes[c])!=null?i:null;u.insertBefore(f,h);let v=u.getRootNode(),y=v instanceof ShadowRoot?v:document.head,b=_t(y);m.styles.render(b),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(x=>{if(x instanceof L&&x._portal){let S=x._portal(x.getRoot());S&&x.render(S)}else x.render(f)})}}else{let u=this.owner.domElement;if(r&&u){let f=m._createDOMNode(),h=(n=u.childNodes[c])!=null?n:null;u.insertBefore(f,h)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof L){let i=()=>{var n,a;let c=e.domElement;this.items.splice(o,1),t&&c&&c.remove(),(a=(n=e._hooks)==null?void 0:n.Remove)==null||a.call(n,e),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,a=()=>{n||(n=!0,i())};e._hooks.BeforeRemove(e,a),n||a()}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!r&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let r=this.items.slice();for(let o of r)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),r&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},Fo=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=kt(e),this.parentRule=r,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),Q[this.name]&&Q[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=a=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{a(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),Q[this.name]&&Q[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 Q[this.name]&&Q[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},Z=class Ye{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new Lt(this),this.parent=r}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof Ye;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Ye;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new Fo(t,r,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Lt=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof Z;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={};function o(i,n){return i.startsWith("&")?`${n}${i.slice(1)}`:`${n} ${i}`}for(let i in e){let n=e[i],a=No(i);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 Z(c,this.parent);u.styleList.addCSS(n,t),this.items.push(u)}}else if(c.startsWith("@keyframes")){let u=new Z(c,this.parent);u.styleList.addCSS(n,""),this.items.push(u)}else if(c.startsWith("@font-face")){let u=new Z(c,this.parent);for(let f in n)u.insertStyle(f,n[f]);this.items.push(u)}else if(typeof n=="object"&&n!=null){let u=new Z(m,this.parent);this.items.push(u);for(let[f,h]of Object.entries(n))if(typeof h=="object"&&h!=null){let v=o(f,m);f.startsWith("&")?this.addCSS(h,v):u.styleList.insertRule(v).styleList.addCSS(h,v)}else u.insertStyle(f,h)}else r[c]=n}}if(Object.keys(r).length){let i=new Z(t,this.parent);for(let n in r)i.insertStyle(n,r[n]);this.items.push(i)}}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(r=>r.selectorText===e);return t||(t=new Z(e,this.parent),this.items.push(t)),t}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==r(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},L=class be{constructor(t,r=null,o=0){this._disposed=!1,this.type="ElementNode",this.parent=null,this.children=new $t(this),this.styles=new Lt(this),this.attributes=new Rt(this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.key=null;var i,n;t=ee(t),Et(t),t.style=t.style||{},this.parent=r,this.tagName=Vo(t),t=Tt(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(u,f)=>typeof f=="function"?a:f);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 f=m(u);this.children.update(Array.isArray(f)?f:[f])};u.elementNode=this,u.debug=`class:${this.tagName}_${this.nodeId} children`,u.onSubscribe=f=>this.addHook("BeforeRemove",()=>{f(),u=null}),u&&u()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=Ot.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let r in this._events){let o=r,i=this._events[o],n=a=>i(a,this);t.addEventListener(o,n),this.addHook("BeforeRemove",a=>{a.domElement.removeEventListener(o,n),n=null})}return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_dispose(){this._disposed=!0,this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(t=>t.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),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 r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i=="_portal"?this._portal=n:i=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];typeof o=="function"?this._hooks[t]=((...i)=>{o(...i),r(...i)}):this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof be&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.prototype.hasOwnProperty.call(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof be?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.children.generateHTML(),r=this.attributes.generateHTML();return`<${this.tagName}${r}>${t}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(this.domElement=t,this._events)for(let o in this._events){let i=o,n=this._events[i],a=c=>n(c,this);t.addEventListener(i,a),this.addHook("BeforeRemove",c=>{c.domElement.removeEventListener(i,a),a=null})}this.children&&this.children.items.forEach((o,i)=>{let n=t.childNodes[i];n instanceof Node&&o instanceof be&&o.mount(n,r)}),this._hooks.Mount&&this._hooks.Mount(this)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=_t(n)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof be&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(r)}),r}remove(){var t;this.parent?this.parent.children.remove(this):((t=this.domElement)==null||t.remove(),this._dispose())}},jo=class{constructor(e){this._notifier=new ce,this.initialRecord=Ct({},e),this._record=Ct({},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={};Le(Me,{getTheme:()=>K,setTheme:()=>qo,themeApply:()=>Yo,themeCSS:()=>Ze,themeColor:()=>s,themeColorToken:()=>ot,themeDensity:()=>p,themeName:()=>fe,themeSize:()=>g,themeSpacing:()=>l,themeTokens:()=>At,themeVars:()=>Ae});var Wo={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=Wo,ue={light:JSON.parse(JSON.stringify(ve)),dark:Go(ve)};function tt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Uo(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 zt(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),zt(e[o],t[o])):e[o]=t[o]}function Ko(e,t){let r={},o=tt(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(m=>r[`--${c}-${m}`]=t.colors[c][m]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else{if(n==="densities")continue;if(typeof a=="object"&&a!==null)for(let c in a)r[`--${n}-${c.replace("/","_")}`]=a[c]}}let i="";for(let n in r)i+=` ${n}: ${r[n]};
|
|
2
|
+
${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)J=o,this._flush(t,r);J=[]}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){J.push([this,e]);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}J.pop()}}},Ge=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new ce,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 r=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=ee(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(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,f=typeof a=="function"?a(m):a;return[u,f].filter(h=>h).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,f=typeof a=="function"?a(m):a;return[u,f].filter(h=>h).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,f=typeof a=="function"?a(m):a;return[u,f].filter(h=>h).join(" ")}}else e[n]=[e[n],a].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();Ao(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");zo(e,c,a)}else e[n]=a}return e}function me(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function d(e,t){return e instanceof Ge||e!=null&&e._isState?e:new Ge(e,t)}function Io(e){return e}function zo(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function Ao(e,t,r){let o=Lo[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,a)=>{i(n,a),r(n,a)}:e[o]=r}function ee(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(ee(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,n]of e)o.set(ee(i,t),ee(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(ee(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=ee(e[i],t);return o}function Et(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o==0&&!Xe.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")e.$.forEach(a=>Et(a,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function Mo(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function wt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vo(e){return Object.keys(e).find(t=>Xe.includes(t))}function kt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function No(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function _t(e){var t;let r=e.querySelector("#domphy-style");return r||(r=document.createElement("style"),r.id="domphy-style",e.appendChild(r)),r.dataset.domphyBase!=="true"&&((t=r.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),r.dataset.domphyBase="true"),r}var Tt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>_(t,Tt(r))),delete e.$,_(t,e),t}else return e},Do=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Ot=["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"],Q={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"]},Pt=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Bo=class{constructor(e,t,r){this._notifier=new ce,this.parent=r,this.isBoolean=Je.includes(e),Pt.includes(e)?this.name=e:this.name=kt(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,r;let o=this.value;if(e==null)this.value=null;else if(typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e))this.value=wt(e);else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e():e(),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,i.onSubscribe=n=>{this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),i=null})},this.value=this.isBoolean?!!e(i):e(i)}else this.value=this.isBoolean?!!e:e;this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=r=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",r)},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${wt(String(r))}"`}}},Rt=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 Bo(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,i)=>{let n=(o||"").split(" ").filter(a=>a);return!n.includes(i)&&n.push(e),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(r=>r).filter(r=>r!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},Ho=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Mo(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"?"​":this.text}render(e){let t=this._createDOMNode();e.appendChild(t)}},$t=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new L(e,this.owner,this._nextKey++):new Ho(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof L?e.domElement:e.domText;if(o){let i=r.childNodes[t]||null;o!==i&&r.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof L?e.domElement:e.domText,i=t instanceof L?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,a=i.nextSibling;r.insertBefore(o,a),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,a;let c=this.items.slice(),m=new Map;for(let u of c)u instanceof L&&u.key!==null&&u.key!==void 0&&m.set(u.key,u);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));for(let u=0;u<e.length;u++){let f=e[u],h=typeof f=="object"&&f!==null?f._key:void 0;if(h!==void 0){let b=m.get(h);if(b){m.delete(h);let y=this.items.indexOf(b);if(y!==u&&y>=0){let v=b instanceof L&&!!b._portal;this.move(y,u,v?!1:t,!0)}b.parent=this.owner;continue}}this.insert(f,u,t,!0)}for(;this.items.length>e.length;)this.remove(this.items[this.items.length-1],t,!0);m.forEach(u=>this.remove(u,t,!0)),r||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let a=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>a?a:t,m=this._createNode(e);if(this.items.splice(c,0,m),m instanceof L){m._hooks.Insert&&m._hooks.Insert(m);let u=this.owner.domElement;if(r&&u)if(m._portal){let f=m._portal(this.owner.getRoot());f&&m.render(f)}else{let f=m._createDOMNode(),h=(i=u.childNodes[c])!=null?i:null;u.insertBefore(f,h);let b=u.getRootNode(),y=b instanceof ShadowRoot?b:document.head,v=_t(y);m.styles.render(v),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(x=>{if(x instanceof L&&x._portal){let S=x._portal(x.getRoot());S&&x.render(S)}else x.render(f)})}}else{let u=this.owner.domElement;if(r&&u){let f=m._createDOMNode(),h=(n=u.childNodes[c])!=null?n:null;u.insertBefore(f,h)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof L){let i=()=>{var n,a;let c=e.domElement;this.items.splice(o,1),t&&c&&c.remove(),(a=(n=e._hooks)==null?void 0:n.Remove)==null||a.call(n,e),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,a=()=>{n||(n=!0,i())};e._hooks.BeforeRemove(e,a),n||a()}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!r&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let r=this.items.slice();for(let o of r)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),r&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},Fo=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=kt(e),this.parentRule=r,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),Q[this.name]&&Q[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=a=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{a(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),Q[this.name]&&Q[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 Q[this.name]&&Q[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},Z=class Ye{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new Lt(this),this.parent=r}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof Ye;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Ye;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new Fo(t,r,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Lt=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof Z;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={};function o(i,n){return i.startsWith("&")?`${n}${i.slice(1)}`:`${n} ${i}`}for(let i in e){let n=e[i],a=No(i);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 Z(c,this.parent);u.styleList.addCSS(n,t),this.items.push(u)}}else if(c.startsWith("@keyframes")){let u=new Z(c,this.parent);u.styleList.addCSS(n,""),this.items.push(u)}else if(c.startsWith("@font-face")){let u=new Z(c,this.parent);for(let f in n)u.insertStyle(f,n[f]);this.items.push(u)}else if(typeof n=="object"&&n!=null){let u=new Z(m,this.parent);this.items.push(u);for(let[f,h]of Object.entries(n))if(typeof h=="object"&&h!=null){let b=o(f,m);f.startsWith("&")?this.addCSS(h,b):u.styleList.insertRule(b).styleList.addCSS(h,b)}else u.insertStyle(f,h)}else r[c]=n}}if(Object.keys(r).length){let i=new Z(t,this.parent);for(let n in r)i.insertStyle(n,r[n]);this.items.push(i)}}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(r=>r.selectorText===e);return t||(t=new Z(e,this.parent),this.items.push(t)),t}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==r(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},L=class be{constructor(t,r=null,o=0){this._disposed=!1,this.type="ElementNode",this.parent=null,this.children=new $t(this),this.styles=new Lt(this),this.attributes=new Rt(this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.key=null;var i,n;t=ee(t),Et(t),t.style=t.style||{},this.parent=r,this.tagName=Vo(t),t=Tt(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(u,f)=>typeof f=="function"?a:f);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 f=m(u);this.children.update(Array.isArray(f)?f:[f])};u.elementNode=this,u.debug=`class:${this.tagName}_${this.nodeId} children`,u.onSubscribe=f=>this.addHook("BeforeRemove",()=>{f(),u=null}),u&&u()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=Ot.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let r in this._events){let o=r,i=this._events[o],n=a=>i(a,this);t.addEventListener(o,n),this.addHook("BeforeRemove",a=>{a.domElement.removeEventListener(o,n),n=null})}return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_dispose(){this._disposed=!0,this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(t=>t.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),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 r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i=="_portal"?this._portal=n:i=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];typeof o=="function"?this._hooks[t]=((...i)=>{o(...i),r(...i)}):this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof be&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.prototype.hasOwnProperty.call(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof be?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.children.generateHTML(),r=this.attributes.generateHTML();return`<${this.tagName}${r}>${t}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(this.domElement=t,this._events)for(let o in this._events){let i=o,n=this._events[i],a=c=>n(c,this);t.addEventListener(i,a),this.addHook("BeforeRemove",c=>{c.domElement.removeEventListener(i,a),a=null})}this.children&&this.children.items.forEach((o,i)=>{let n=t.childNodes[i];n instanceof Node&&o instanceof be&&o.mount(n,r)}),this._hooks.Mount&&this._hooks.Mount(this)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=_t(n)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof be&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(r)}),r}remove(){var t;this.parent?this.parent.children.remove(this):((t=this.domElement)==null||t.remove(),this._dispose())}},jo=class{constructor(e){this._notifier=new ce,this.initialRecord=Ct({},e),this._record=Ct({},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={};Le(Me,{getTheme:()=>K,setTheme:()=>qo,themeApply:()=>Yo,themeCSS:()=>Ze,themeColor:()=>s,themeColorToken:()=>ot,themeDensity:()=>p,themeName:()=>fe,themeSize:()=>g,themeSpacing:()=>l,themeTokens:()=>At,themeVars:()=>Ae});var Wo={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=Wo,ue={light:JSON.parse(JSON.stringify(ve)),dark:Go(ve)};function tt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Uo(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 zt(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),zt(e[o],t[o])):e[o]=t[o]}function Ko(e,t){let r={},o=tt(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(m=>r[`--${c}-${m}`]=t.colors[c][m]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else{if(n==="densities")continue;if(typeof a=="object"&&a!==null)for(let c in a)r[`--${n}-${c.replace("/","_")}`]=a[c]}}let i="";for(let n in r)i+=` ${n}: ${r[n]};
|
|
3
3
|
`;return`[data-theme="${e}"] {
|
|
4
4
|
${i}}`}function K(e){if(!ue[e])throw Error(`Theme "${e}" not found`);return ue[e]}function qo(e,t){Uo(t),ue[e]||(ue[e]=structuredClone(ve)),zt(ue[e],t)}function Go(e){let t=structuredClone(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function At(e){let t=K(e),r=tt(t),o={};for(let i in t){let n=t[i];if(i==="colors")for(let a in t.colors){let c={};[...Array(r).keys()].forEach(m=>c[m]=t.colors[a][m]),o[a]=c}else if(i==="fontSizes")o.fontSizes=t.fontSizes;else if(i==="densities")o.densities=t.densities;else if(o[i]={},typeof n=="object"&&n!==null)for(let a in n)o[i][a]=n[a]}return o}function Ae(){let e=K("light"),t=tt(e),r={};for(let o in e){let i=o,n=e[o];if(o==="colors")for(let a in e.colors){let c={};[...Array(t).keys()].forEach(m=>c[m]=`var(--${a}-${m})`),r[a]=c}else if(o==="fontSizes")r.fontSizes=[...Array(8).keys()].map(a=>`var(--fontSize-${a})`);else{if(o==="densities")continue;if(r[i]={},typeof n=="object"&&n!==null)for(let a in n)r[i][a]=`var(--${i}-${a.replace("/","_")})`}}return r}function Ze(){return Object.entries(ue).map(([e,t])=>Ko(e,t)).join(`
|
|
5
|
-
`)}function Yo(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 l(e){return e/4+"em"}function fe(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var Qe=["inherit"];[...Array(8).keys()].forEach(e=>{Qe.push(`decrease-${e}`),Qe.push(`increase-${e}`)});function Mt(e,t="inherit"){if(!Qe.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function Xo(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Mt(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function g(e,t="inherit"){let r=Mt(Xo(e),t);return Ae().fontSizes[r]}var et=["inherit"];[...Array(5).keys()].forEach(e=>{et.push(`decrease-${e}`),et.push(`increase-${e}`)});function Jo(e,t="inherit"){if(!et.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function Zo(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=Jo(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function p(e){let t=Zo(e);return K(e?fe(e):"light").densities[t]}var H=ve.colors.neutral.length,ze=["inherit","base"];[...Array(H).keys()].forEach(e=>{ze.push(`decrease-${e}`),ze.push(`increase-${e}`),ze.push(`shift-${e}`)});function It(e,t){if(e<0||e>H-1)return e;let r=e+t;return r=Math.max(0,Math.min(H-1,r)),r}function Qo(e,t){if(e<0||e>H-1)return e;let r=Math.floor((H-1)/2),o=e<=r?e+t:e-t;return o=o<0||o>H-1?-o:o,o=Math.max(0,Math.min(H-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 r=parseInt(t.replace("increase-",""),10);return It(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return It(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return Qo(e,r)}else return e}function Vt(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=Se(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Nt(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===H-1?H-1-r:e}function s(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return Ae()[o][Se(0,t)];let i;if(t=="base")i=K(fe(e)).baseTones[o];else{let a=K(fe(e)),c=Nt(Vt(e),a.direction,a.darkBias);i=Se(c,t)}let n=Ae()[o];if(!n)throw Error(`color "${JSON.stringify(o)}" not found on theme "${fe(e)}`);return n[i]}function ot(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r,i=e?fe(e):"light",n=At(i);if(!e)return n[o][Se(0,t)];let a;if(t=="base")a=K(i).baseTones[o];else{let c=K(i),m=Nt(Vt(e),c.direction,c.darkBias);a=Se(m,t)}return n[o][a]}var We={};Le(We,{FieldState:()=>Pe,FormState:()=>ft,abbreviation:()=>en,alert:()=>fn,avatar:()=>dn,badge:()=>hn,blockquote:()=>Wn,breadcrumb:()=>pn,breadcrumbEllipsis:()=>gn,button:()=>Un,buttonSwitch:()=>Tr,card:()=>tn,code:()=>qn,combobox:()=>jn,command:()=>an,commandItem:()=>sn,commandSearch:()=>ln,descriptionList:()=>Yn,details:()=>Gn,dialog:()=>Xn,divider:()=>Nr,drawer:()=>Br,emphasis:()=>Jn,field:()=>Jr,figure:()=>Zn,form:()=>Xr,formGroup:()=>Qn,heading:()=>tr,horizontalRule:()=>or,icon:()=>rr,image:()=>nr,inputCheckbox:()=>Kn,inputColor:()=>ir,inputDateTime:()=>ar,inputFile:()=>lr,inputNumber:()=>ur,inputOTP:()=>un,inputRadio:()=>vr,inputRange:()=>mr,inputSearch:()=>sr,inputSwitch:()=>_r,inputText:()=>cr,keyboard:()=>fr,label:()=>dr,link:()=>hr,mark:()=>pr,menu:()=>Gr,menuItem:()=>Yr,orderedList:()=>Ar,pagination:()=>Vr,paragraph:()=>gr,popover:()=>Hr,popoverArrow:()=>mt,preformated:()=>yr,progress:()=>br,select:()=>Sr,selectBox:()=>kr,selectItem:()=>Er,selectList:()=>wr,skeleton:()=>xr,small:()=>Or,spinner:()=>Cr,splitter:()=>on,splitterHandle:()=>rn,splitterPanel:()=>nn,strong:()=>Pr,subscript:()=>Rr,superscript:()=>$r,tab:()=>Kr,tabPanel:()=>qr,table:()=>Lr,tabs:()=>Ur,tag:()=>xe,textarea:()=>Ir,toast:()=>Fr,toggle:()=>cn,toggleGroup:()=>mn,tooltip:()=>jr,transitionGroup:()=>Wr,unorderedList:()=>zr});function en(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>g(n),backgroundColor:n=>s(n),color:n=>s(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>s(n,"shift-7",t.get(n)),textUnderlineOffset:l(.72),cursor:"help","&:hover":{color:n=>s(n,"shift-11",r.get(n)),textDecorationColor:n=>s(n,"shift-9",r.get(n))}}}}function tn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>l(p(o)*2),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>l(p(o)*4),color:o=>s(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>l(p(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>l(p(o)*4),color:o=>s(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:l(2),paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),borderTop:o=>`1px solid ${s(o,"shift-3",t.get(o))}`}}}}function on(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{_(a,{_context:{splitter:{direction:t,size:d(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function nn(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function rn(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let a=r.parentElement,c=u=>{let f=a.getBoundingClientRect(),h=o?(u.clientX-f.left)/f.width*100:(u.clientY-f.top)/f.height*100;t.size.set(Math.min(Math.max(h,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>s(e,"shift-2"),"&:hover":{backgroundColor:e=>s(e,"shift-3")},"&::after":{content:'""',borderRadius:l(999),backgroundColor:e=>s(e,"shift-4")}}}}function an(){return{_onSchedule:(e,t)=>{_(t,{_context:{command:{query:d("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function ln(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command"),n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>g(o,"inherit"),paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*2),border:"none",borderBottom:o=>`1px solid ${s(o,"shift-3",t)}`,outline:"none",color:o=>s(o,"shift-10",t),backgroundColor:o=>s(o,"inherit",t),"&::placeholder":{color:o=>s(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>s(o,"shift-6",r)}}}}function sn(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var m,u;let i=o.getContext("command"),n=o.domElement,a=(u=(m=n.textContent)==null?void 0:m.toLowerCase())!=null?u:"",c=i.query.addListener(f=>{n.hidden=f.length>0&&!a.includes(f.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>g(o,"inherit"),height:o=>l(6+p(o)*2),paddingInline:o=>l(p(o)*3),border:"none",outline:"none",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",r)}`,outlineOffset:`-${l(.5)}`}}}}function cn(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var f;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup"),m=((f=n.parent)==null?void 0:f.children.items).filter(h=>h.type==="ElementNode"&&h.attributes.get("role")==="button"),u=n.key!==void 0?String(n.key):String(m.findIndex(h=>h===n));n.attributes.set("ariaPressed",h=>{let v=a.value.get(h);return Array.isArray(v)?v.includes(u):v===u}),n.addEvent("click",()=>{let h=a.value.get();if(a.multiple){let v=Array.isArray(h)?[...h]:[];a.value.set(v.includes(u)?v.filter(y=>y!==u):[...v,u])}else a.value.set(h===u?"":u)})},style:{cursor:"pointer",fontSize:n=>g(n,"inherit"),height:l(6),paddingBlock:l(1),paddingInline:l(2),border:"none",borderRadius:l(1),color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>s(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>s(n,"shift-3",r.get(n)),color:n=>s(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`,outlineOffset:`-${l(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function mn(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:d((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:l(1),paddingInline:l(1),gap:l(1),borderRadius:l(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>s(i,"inherit",r),outline:i=>`1px solid ${s(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function un(){return{style:{display:"flex",alignItems:"center",gap:l(2),"& > *":{minWidth:l(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),m=a.target,u=c.indexOf(m);m.value&&u<c.length-1&&c[u+1].focus()},i=a=>{let c=r(),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 h,v,y;a.preventDefault();let c=(v=(h=a.clipboardData)==null?void 0:h.getData("text"))!=null?v:"",m=r(),u=m.indexOf(a.target);[...c].forEach((b,x)=>{m[u+x]&&(m[u+x].value=b)});let f=Math.min(u+c.length-1,m.length-1);(y=m[f])==null||y.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function fn(e={}){var r;let t=d((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:l(3),paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),boxShadow:o=>`inset ${l(1)} 0 0 0 ${s(o,"shift-8",t.get(o))}`,backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),fontSize:o=>g(o,"inherit")}}}function dn(e={}){var r;let t=d((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:l(9),height:l(9),fontSize:o=>g(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function hn(e={}){var i;let{label:t=999}=e,r=d(t),o=d((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:l(1),minWidth:l(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>g(n,"decrease-1"),borderRadius:l(999),backgroundColor:n=>s(n,"shift-9",o.get(n)),color:n=>s(n,"shift-0",o.get(n))}}}}function pn(e={}){var o;let{separator:t="/"}=e,r=d((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>g(i,"inherit"),gap:l(1),color:i=>s(i,"shift-9",r.get(i)),backgroundColor:i=>s(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>s(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>s(i,"shift-4",r.get(i)),paddingInlineStart:l(1)},"& > [aria-current=page]":{color:i=>s(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function gn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>g(o,"inherit"),paddingInline:l(1),border:"none",background:"none",cursor:"pointer",color:o=>s(o,"shift-8",t.get(o)),borderRadius:l(1),"&:hover":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",t.get(o))}`,outlineOffset:l(.5)}}}}var yn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function xe(e={}){var o;let{removable:t=!1}=e,r=d((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:yn,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:l(1),width:l(4),height:l(4),flexShrink:0,"&:hover":{backgroundColor:a=>s(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:l(6),paddingBlock:"0px",borderRadius:l(1),paddingInlineStart:l(2),paddingInlineEnd:t?l(1):l(2),gap:l(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>s(i,"inherit",r.get(i)),color:i=>s(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"shift-4",r.get(i))}`}}}var de=Math.min,F=Math.max,we=Math.round,Ee=Math.floor,V=e=>({x:e,y:e}),bn={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(e,t,r){return F(e,de(t,r))}function ke(e,t){return typeof e=="function"?e(t):e}function q(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function rt(e){return e==="x"?"y":"x"}function it(e){return e==="y"?"height":"width"}function j(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function at(e){return rt(j(e))}function Ht(e,t,r){r===void 0&&(r=!1);let o=_e(e),i=at(e),n=it(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=Ce(a)),[a,Ce(a)]}function Ft(e){let t=Ce(e);return[Ve(e),t,Ve(t)]}function Ve(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Dt=["left","right"],Bt=["right","left"],vn=["top","bottom"],Sn=["bottom","top"];function xn(e,t,r){switch(e){case"top":case"bottom":return r?t?Bt:Dt:t?Dt:Bt;case"left":case"right":return t?vn:Sn;default:return[]}}function jt(e,t,r,o){let i=_e(e),n=xn(q(e),r==="start",o);return i&&(n=n.map(a=>a+"-"+i),t&&(n=n.concat(n.map(Ve)))),n}function Ce(e){let t=q(e);return bn[t]+e.slice(t.length)}function Cn(e){return P({top:0,right:0,bottom:0,left:0},e)}function Wt(e){return typeof e!="number"?Cn(e):{top:e,right:e,bottom:e,left:e}}function te(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Ut(e,t,r){let{reference:o,floating:i}=e,n=j(t),a=at(t),c=it(a),m=q(t),u=n==="y",f=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,v=o[c]/2-i[c]/2,y;switch(m){case"top":y={x:f,y:o.y-i.height};break;case"bottom":y={x:f,y:o.y+o.height};break;case"right":y={x:o.x+o.width,y:h};break;case"left":y={x:o.x-i.width,y:h};break;default:y={x:o.x,y:o.y}}switch(_e(t)){case"start":y[a]-=v*(r&&u?-1:1);break;case"end":y[a]+=v*(r&&u?-1:1);break}return y}function Kt(e,t){return B(this,null,function*(){var r;t===void 0&&(t={});let{x:o,y:i,platform:n,rects:a,elements:c,strategy:m}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=ke(t,e),b=Wt(y),S=c[v?h==="floating"?"reference":"floating":h],C=te(yield n.getClippingRect({element:(r=yield n.isElement==null?void 0:n.isElement(S))==null||r?S:S.contextElement||(yield n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:m})),w=h==="floating"?{x:o,y:i,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+b.top)/k.y,bottom:(T.bottom-C.bottom+b.bottom)/k.y,left:(C.left-T.left+b.left)/k.x,right:(T.right-C.right+b.right)/k.x}})}var wn=50,qt=(e,t,r)=>B(null,null,function*(){let{placement:o="bottom",strategy:i="absolute",middleware:n=[],platform:a}=r,c=a.detectOverflow?a:M(P({},a),{detectOverflow:Kt}),m=yield a.isRTL==null?void 0:a.isRTL(t),u=yield a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:h}=Ut(u,o,m),v=o,y=0,b={};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:f,y:h,initialPlacement:o,placement:v,strategy:i,middlewareData:b,rects:u,platform:c,elements:{reference:e,floating:t}});f=E!=null?E:f,h=k!=null?k:h,b[C]=P(P({},b[C]),T),O&&y<wn&&(y++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(u=O.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:f,y:h}=Ut(u,v,m)),x=-1)}return{x:f,y:h,placement:v,strategy:i,middlewareData:b}});var Gt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(r){return B(this,null,function*(){var o,i;let{placement:n,middlewareData:a,rects:c,initialPlacement:m,platform:u,elements:f}=r,yt=ke(e,r),{mainAxis:h=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0}=yt,C=qe(yt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let w=q(n),E=j(m),k=q(m)===m,T=yield u.isRTL==null?void 0:u.isRTL(f.floating),O=y||(k||!S?[Ce(m)]:Ft(m)),$=x!=="none";!y&&$&&O.push(...jt(m,S,x,T));let dt=[m,...O],ae=yield u.detectOverflow(r,C),le=[],se=((i=a.flip)==null?void 0:i.overflows)||[];if(h&&le.push(ae[w]),v){let Y=Ht(n,c,T);le.push(ae[Y[0]],ae[Y[1]])}if(se=[...se,{placement:n,overflows:le}],!le.every(Y=>Y<=0)){var ht,pt;let Y=(((ht=a.flip)==null?void 0:ht.index)||0)+1,Ue=dt[Y];if(Ue&&(!(v==="alignment"?E!==j(Ue):!1)||se.every(A=>j(A.placement)===E?A.overflows[0]>0:!0)))return{data:{index:Y,overflows:se},reset:{placement:Ue}};let ye=(pt=se.filter(X=>X.overflows[0]<=0).sort((X,A)=>X.overflows[1]-A.overflows[1])[0])==null?void 0:pt.placement;if(!ye)switch(b){case"bestFit":{var gt;let X=(gt=se.filter(A=>{if($){let U=j(A.placement);return U===E||U==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(U=>U>0).reduce((U,xo)=>U+xo,0)]).sort((A,U)=>A[1]-U[1])[0])==null?void 0:gt[0];X&&(ye=X);break}case"initialPlacement":ye=m;break}if(n!==ye)return{reset:{placement:ye}}}return{}})}}};var En=new Set(["left","top"]);function kn(e,t){return B(this,null,function*(){let{placement:r,platform:o,elements:i}=e,n=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=q(r),c=_e(r),m=j(r)==="y",u=En.has(a)?-1:1,f=n&&m?-1:1,h=ke(t,e),{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),m?{x:y*f,y:v*u}:{x:v*u,y:y*f}})}var Yt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(r){return B(this,null,function*(){var o,i;let{x:n,y:a,placement:c,middlewareData:m}=r,u=yield kn(r,e);return c===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:n+u.x,y:a+u.y,data:M(P({},u),{placement:c})}})}}},Xt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(r){return B(this,null,function*(){let{x:o,y:i,placement:n,platform:a}=r,w=ke(e,r),{mainAxis:c=!0,crossAxis:m=!1,limiter:u={fn:E=>{let{x:k,y:T}=E;return{x:k,y:T}}}}=w,f=qe(w,["mainAxis","crossAxis","limiter"]),h={x:o,y:i},v=yield a.detectOverflow(r,f),y=j(q(n)),b=rt(y),x=h[b],S=h[y];if(c){let E=b==="y"?"top":"left",k=b==="y"?"bottom":"right",T=x+v[E],O=x-v[k];x=nt(T,x,O)}if(m){let E=y==="y"?"top":"left",k=y==="y"?"bottom":"right",T=S+v[E],O=S-v[k];S=nt(T,S,O)}let C=u.fn(M(P({},r),{[b]:x,[y]:S}));return M(P({},C),{data:{x:C.x-o,y:C.y-i,enabled:{[b]:c,[y]:m}}})})}}};function Ne(){return typeof window!="undefined"}function ne(e){return Zt(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){var t;return(t=(Zt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zt(e){return Ne()?e instanceof Node||e instanceof R(e).Node:!1}function I(e){return Ne()?e instanceof Element||e instanceof R(e).Element:!1}function D(e){return Ne()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function Jt(e){return!Ne()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function pe(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function Qt(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 _n=/transform|translate|scale|rotate|perspective|filter/,Tn=/paint|layout|strict|content/,oe=e=>!!e&&e!=="none",lt;function De(e){let t=I(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||"")||Tn.test(t.contain||"")}function eo(e){let t=W(e);for(;D(t)&&!re(t);){if(De(t))return t;if(Te(t))return null;t=W(t)}return null}function Be(){return lt==null&&(lt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),lt}function re(e){return/^(html|body|#document)$/.test(ne(e))}function z(e){return R(e).getComputedStyle(e)}function Oe(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function W(e){if(ne(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Jt(e)&&e.host||N(e);return Jt(t)?t.host:t}function to(e){let t=W(e);return re(t)?e.ownerDocument?e.ownerDocument.body:e.body:D(t)&&pe(t)?t:to(t)}function he(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=to(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=R(i);if(n){let c=He(a);return t.concat(a,a.visualViewport||[],pe(i)?i:[],c&&r?he(c):[])}else return t.concat(i,he(i,[],r))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function io(e){let t=z(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=D(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=we(r)!==n||we(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function ct(e){return I(e)?e:e.contextElement}function ge(e){let t=ct(e);if(!D(t))return V(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=io(t),a=(n?we(r.width):r.width)/o,c=(n?we(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var On=V(0);function ao(e){let t=R(e);return!Be()||!t.visualViewport?On:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pn(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==R(e)?!1:t}function ie(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),n=ct(e),a=V(1);t&&(o?I(o)&&(a=ge(o)):a=ge(e));let c=Pn(n,r,o)?ao(n):V(0),m=(i.left+c.x)/a.x,u=(i.top+c.y)/a.y,f=i.width/a.x,h=i.height/a.y;if(n){let v=R(n),y=o&&I(o)?R(o):o,b=v,x=He(b);for(;x&&o&&y!==b;){let S=ge(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,f*=S.x,h*=S.y,m+=E,u+=k,b=R(x),x=He(b)}}return te({width:f,height:h,x:m,y:u})}function Fe(e,t){let r=Oe(e).scrollLeft;return t?t.left+r:ie(N(e)).left+r}function lo(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Fe(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function Rn(e){let{elements:t,rect:r,offsetParent:o,strategy:i}=e,n=i==="fixed",a=N(o),c=t?Te(t.floating):!1;if(o===a||c&&n)return r;let m={scrollLeft:0,scrollTop:0},u=V(1),f=V(0),h=D(o);if((h||!h&&!n)&&((ne(o)!=="body"||pe(a))&&(m=Oe(o)),h)){let y=ie(o);u=ge(o),f.x=y.x+o.clientLeft,f.y=y.y+o.clientTop}let v=a&&!h&&!n?lo(a,m):V(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-m.scrollLeft*u.x+f.x+v.x,y:r.y*u.y-m.scrollTop*u.y+f.y+v.y}}function $n(e){return Array.from(e.getClientRects())}function Ln(e){let t=N(e),r=Oe(e),o=e.ownerDocument.body,i=F(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=F(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+Fe(e),c=-r.scrollTop;return z(o).direction==="rtl"&&(a+=F(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var oo=25;function In(e,t){let r=R(e),o=N(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){n=i.width,a=i.height;let f=Be();(!f||f&&t==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let u=Fe(o);if(u<=0){let f=o.ownerDocument,h=f.body,v=getComputedStyle(h),y=f.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(o.clientWidth-h.clientWidth-y);b<=oo&&(n-=b)}else u<=oo&&(n+=u);return{width:n,height:a,x:c,y:m}}function zn(e,t){let r=ie(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=D(e)?ge(e):V(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,m=i*n.x,u=o*n.y;return{width:a,height:c,x:m,y:u}}function no(e,t,r){let o;if(t==="viewport")o=In(e,r);else if(t==="document")o=Ln(N(e));else if(I(t))o=zn(t,r);else{let i=ao(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return te(o)}function so(e,t){let r=W(e);return r===t||!I(r)||re(r)?!1:z(r).position==="fixed"||so(r,t)}function An(e,t){let r=t.get(e);if(r)return r;let o=he(e,[],!1).filter(c=>I(c)&&ne(c)!=="body"),i=null,n=z(e).position==="fixed",a=n?W(e):e;for(;I(a)&&!re(a);){let c=z(a),m=De(a);!m&&c.position==="fixed"&&(i=null),(n?!m&&!i:!m&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||pe(a)&&!m&&so(e,a))?o=o.filter(f=>f!==a):i=c,a=W(a)}return t.set(e,o),o}function Mn(e){let{element:t,boundary:r,rootBoundary:o,strategy:i}=e,a=[...r==="clippingAncestors"?Te(t)?[]:An(t,this._c):[].concat(r),o],c=no(t,a[0],i),m=c.top,u=c.right,f=c.bottom,h=c.left;for(let v=1;v<a.length;v++){let y=no(t,a[v],i);m=F(y.top,m),u=de(y.right,u),f=de(y.bottom,f),h=F(y.left,h)}return{width:u-h,height:f-m,x:h,y:m}}function Vn(e){let{width:t,height:r}=io(e);return{width:t,height:r}}function Nn(e,t,r){let o=D(t),i=N(t),n=r==="fixed",a=ie(e,!0,n,t),c={scrollLeft:0,scrollTop:0},m=V(0);function u(){m.x=Fe(i)}if(o||!o&&!n)if((ne(t)!=="body"||pe(i))&&(c=Oe(t)),o){let y=ie(t,!0,n,t);m.x=y.x+t.clientLeft,m.y=y.y+t.clientTop}else i&&u();n&&!o&&i&&u();let f=i&&!o&&!n?lo(i,c):V(0),h=a.left+c.scrollLeft-m.x-f.x,v=a.top+c.scrollTop-m.y-f.y;return{x:h,y:v,width:a.width,height:a.height}}function st(e){return z(e).position==="static"}function ro(e,t){if(!D(e)||z(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return N(e)===r&&(r=r.ownerDocument.body),r}function co(e,t){let r=R(e);if(Te(e))return r;if(!D(e)){let i=W(e);for(;i&&!re(i);){if(I(i)&&!st(i))return i;i=W(i)}return r}let o=ro(e,t);for(;o&&Qt(o)&&st(o);)o=ro(o,t);return o&&re(o)&&st(o)&&!De(o)?r:o||eo(e)||r}var Dn=function(e){return B(this,null,function*(){let t=this.getOffsetParent||co,r=this.getDimensions,o=yield r(e.floating);return{reference:Nn(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Bn(e){return z(e).direction==="rtl"}var Hn={convertOffsetParentRelativeRectToViewportRelativeRect:Rn,getDocumentElement:N,getClippingRect:Mn,getOffsetParent:co,getElementRects:Dn,getClientRects:$n,getDimensions:Vn,getScale:ge,isElement:I,isRTL:Bn};function mo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fn(e,t){let r=null,o,i=N(e);function n(){var c;clearTimeout(o),(c=r)==null||c.disconnect(),r=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),n();let u=e.getBoundingClientRect(),{left:f,top:h,width:v,height:y}=u;if(c||t(),!v||!y)return;let b=Ee(h),x=Ee(i.clientWidth-(f+v)),S=Ee(i.clientHeight-(h+y)),C=Ee(f),E={rootMargin:-b+"px "+-x+"px "+-S+"px "+-C+"px",threshold:F(0,de(1,m))||1},k=!0;function T(O){let $=O[0].intersectionRatio;if($!==m){if(!k)return a();$?a(!1,$):o=setTimeout(()=>{a(!1,1e-7)},1e3)}$===1&&!mo(u,e.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(T,M(P({},E),{root:i.ownerDocument}))}catch(O){r=new IntersectionObserver(T,E)}r.observe(e)}return a(!0),n}function uo(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=ct(e),f=i||n?[...u?he(u):[],...t?he(t):[]]:[];f.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),n&&C.addEventListener("resize",r)});let h=u&&c?Fn(u,r):null,v=-1,y=null;a&&(y=new ResizeObserver(C=>{let[w]=C;w&&w.target===u&&y&&t&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(t)})),r()}),u&&!m&&y.observe(u),t&&y.observe(t));let b,x=m?ie(e):null;m&&S();function S(){let C=ie(e);x&&!mo(x,C)&&r(),x=C,b=requestAnimationFrame(S)}return r(),()=>{var C;f.forEach(w=>{i&&w.removeEventListener("scroll",r),n&&w.removeEventListener("resize",r)}),h==null||h(),(C=y)==null||C.disconnect(),y=null,m&&cancelAnimationFrame(b)}}var fo=Yt;var ho=Xt,po=Gt;var go=(e,t,r)=>{let o=new Map,i=P({platform:Hn},r),n=M(P({},i.platform),{_c:o});return qt(e,t,M(P({},i),{platform:n}))};function G(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,a=null,c=d(t),m=()=>{n&&a&&(i&&i(),i=uo(n,a,()=>{go(n,a,{placement:r.get(),middleware:[fo(12),po(),ho()],strategy:"fixed"}).then(({x:b,y:x,placement:S})=>{Object.assign(a.style,{left:`${b}px`,top:`${x}px`}),r.set(S)})}),c.set(!0))},u=()=>{i&&i(),i=null,c.set(!1)},f=()=>{o&&clearTimeout(o),o=setTimeout(m,100)},h=()=>{o&&clearTimeout(o),o=setTimeout(u,100)},v={style:{position:"fixed",pointerEvents:"auto",visibility:b=>c.get(b)?"visible":"hidden"},_onMount:b=>a=b.domElement,_portal:b=>{let x=b.domElement.querySelector("#domphy-floating");if(!x){let S={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};x=b.children.insert(S).domElement}return x}};return _(e.content,v),{show:f,hide:h,anchorPartial:{onKeyDown:b=>b.key==="Escape"&&h(),_onMount:b=>{let x=b.getRoot();n=b.domElement;let S=x.children.insert(e.content),C=w=>{if(!c.get()||!n||!a)return;let E=w.target;!n.contains(E)&&!a.contains(E)&&h()};b.getRoot().domElement.addEventListener("click",C),b.addHook("BeforeRemove",()=>{o&&clearTimeout(o),S&&S.remove(),b.getRoot().domElement.removeEventListener("click",C)})}}}}function jn(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=d(e.value),c=d(i),{show:m,hide:u,anchorPartial:f}=G({open:c,placement:d(r),content:e.content}),h={onClick:()=>!n&&u()};_(e.content,h);let v={border:"none",outline:"none",padding:0,margin:0,flex:1,height:l(6),marginInlineStart:l(2),fontSize:S=>g(S,"inherit"),color:S=>s(S,"shift-9",o),backgroundColor:S=>s(S,"inherit",o)},y;e.input?(_(e.input,{onFocus:()=>m(),style:v,_key:"combobox-input"}),y=e.input):y={input:null,onFocus:()=>m(),value:S=>(a.get(S),""),style:v,_key:"combobox-input"};let b={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 $=a.get(),ae=(Array.isArray($)?$:[$]).filter(le=>le!==T.value);n?a.set(ae):a.set(ae[0])}}));return k.push(y),k},style:{display:"flex",flexWrap:"wrap",gap:l(1)}},x={_onInsert:S=>{S.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(b),style:{minWidth:l(32),outlineOffset:"-1px",outline:S=>`1px solid ${s(S,"shift-4","neutral")}`,paddingBlock:S=>l(p(S)*1),paddingInline:S=>l(p(S)*1),borderRadius:S=>l(p(S)*1),fontSize:S=>g(S,"inherit"),color:S=>s(S,"shift-9",o),backgroundColor:S=>s(S,"inherit",o)}};return _(f,x),f}function mt(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=l(6),bordered:i=!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=f=>{var h;return(h=a[n.get(f)])!=null?h:a["bottom-end"]},m=f=>f.includes("start")?o:f.includes("end")?"auto":"50%",u=f=>f.includes("end")?o:f.includes("start")?"auto":"50%";return{style:{fontSize:f=>g(f),backgroundColor:f=>s(f),color:f=>s(f,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:l(1.5),height:l(1.5),backgroundColor:f=>s(f,"inherit",r),borderWidth:i?"1px":"0px",borderColor:f=>s(f,"inherit",r),borderTopStyle:f=>{let h=c(f);return h.includes("top")||h.includes("right")?"solid":"none"},borderBottomStyle:f=>{let h=c(f);return h.includes("bottom")||h.includes("left")?"solid":"none"},borderLeftStyle:f=>{let h=c(f);return h.includes("top")||h.includes("left")?"solid":"none"},borderRightStyle:f=>{let h=c(f);return h.includes("bottom")||h.includes("right")?"solid":"none"},top:f=>{let h=c(f);return h.includes("top")?0:h.includes("bottom")?"auto":m(h)},right:f=>{let h=c(f);return h.includes("right")?0:h.includes("left")?"auto":u(h)},bottom:f=>{let h=c(f);return h.includes("bottom")?0:h.includes("top")?"auto":u(h)},left:f=>{let h=c(f);return h.includes("left")?0:h.includes("right")?"auto":m(h)},transform:f=>{let h=c(f),v=h.includes("right")||h.includes("end")&&!h.includes("left")?"50%":"-50%",y=h.includes("bottom")||h.includes("end")&&!h.includes("top")?"50%":"-50%";return`translate(${v},${y}) rotate(45deg)`}}}}}function Wn(e={}){var r;let t=d((r=e.color)!=null?r:"inherit","color");return{_onInsert:o=>{o.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o,"inherit",t.get(o)),boxShadow:o=>`inset ${l(1)} 0 0 0 ${s(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),margin:0}}}function Un(e={}){var r;let t=d((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>g(o,"inherit"),paddingBlock:o=>l(p(o)*1),paddingInline:o=>l(p(o)*3),borderRadius:o=>l(p(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>l(p(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${l(.5)} ${s(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,color:o=>s(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Kn(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>g(n,"inherit"),display:"inline-flex",position:"relative",width:l(6),height:l(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:l(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:n=>s(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`,backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${l(.5)} solid ${s(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`,backgroundColor:n=>s(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:l(1.5),outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>s(n,"shift-4","neutral"),pointerEvents:"none"}}}}function qn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:l(6),paddingInline:l(1.5),borderRadius:l(1)}}}function Gn(e={}){var i,n;let{duration:t=240}=e,r=d((i=e.color)!=null?i:"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=>g(a,"inherit"),color:a=>s(a,"shift-9",r.get(a)),backgroundColor:a=>s(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>s(a,"shift-2",r.get(a)),color:a=>s(a,"shift-10",r.get(a)),fontSize:a=>g(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:l(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>l(p(a)*4),height:l(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:l(2),height:l(2),flexShrink:0,marginTop:`-${l(.5)}`,borderInlineEnd:a=>`${l(.5)} solid ${s(a,"shift-9",r.get(a))}`,borderBottom:a=>`${l(.5)} solid ${s(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>s(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>l(p(a)*2),outlineOffset:`-${l(.5)}`,outline:a=>`${l(.5)} solid ${s(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>l(p(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:l(250),opacity:1,paddingTop:a=>l(p(a)*1),paddingBottom:a=>l(p(a)*3)}}}}function Yn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${l(24)}, max-content) 1fr`,columnGap:l(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}}function Xn(e={}){let{color:t="neutral",open:r=!1}=e,o=d(r);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,a=c=>{c?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let m=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):n.style.opacity="0"};a(o.get()),o.addListener(a)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>g(i,"inherit"),color:i=>s(i,"shift-10",t),backgroundColor:i=>s(i,"inherit",t),border:"none",padding:i=>l(p(i)*3),boxShadow:i=>`0 ${l(9)} ${l(16)} ${s(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>s(i,"shift-2","neutral"),opacity:.75}}}}function Jn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>g(o,"inherit"),fontStyle:"italic",color:o=>s(o,"shift-10",t.get(o))}}}function Zn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:l(2),marginInline:0,marginTop:l(3),marginBottom:l(3),color:o=>s(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:l(2)},"& figcaption":{fontSize:o=>g(o,"decrease-1"),color:o=>s(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Qn(e={}){var i;let{layout:t="horizontal"}=e,r=d((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*3),border:"none",borderRadius:n=>l(p(n)*2),fontSize:n=>g(n,"inherit"),backgroundColor:n=>s(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:l(4),rowGap:l(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>g(n,"inherit"),fontWeight:600,paddingBlock:n=>l(p(n)*1),borderRadius:n=>l(p(n)*2),color:n=>s(n,"shift-9",r.get(n)),backgroundColor:n=>s(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":l(p(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(${l(2)} * -1)`,fontSize:n=>g(n,"decrease-1"),color:n=>s(n,"shift-9",r.get(n))}}}}var er={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function tr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>s(o,"shift-11",t.get(o)),marginTop:0,marginBottom:l(2),fontSize:o=>{let i=er[o.elementNode.tagName]||"inherit";return g(o,i)}}}}function or(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:l(3),marginBottom:l(3),backgroundColor:o=>s(o,"shift-4",t.get(o))}}}function nr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:l(2),backgroundColor:o=>s(o,"inherit",t.get(o))}}}function rr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:l(4),height:l(4),flexShrink:"0",fontSize:o=>g(o),backgroundColor:"transparent",color:o=>s(o,"shift-9",t.get(o))}}}function ir(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>g(n,"inherit"),paddingBlock:n=>l(p(n)*1),paddingInline:n=>l(p(n)*1),blockSize:n=>l(6+p(n)*2),inlineSize:n=>l(6+p(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>l(p(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`}}}}function ar(e={}){var i,n;let{mode:t="datetime-local"}=e,r=d((i=e.color)!=null?i:"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=>g(a,"inherit"),lineHeight:"inherit",color:a=>s(a,"shift-9",r.get(a)),backgroundColor:a=>s(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${s(a,"shift-4",r.get(a))}`,borderRadius:a=>l(p(a)*1),paddingInline:a=>l(p(a)*3),height:a=>l(6+p(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${l(.5)} solid ${s(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>s(a,"shift-8","neutral"),backgroundColor:a=>s(a,"shift-2","neutral"),outline:a=>`1px solid ${s(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${l(.5)} solid ${s(a,"shift-6","error")}`}}}}function lr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,borderRadius:n=>l(p(n)*1),height:n=>l(6+p(n)*2),paddingInline:n=>l(p(n)*1),"&::file-selector-button":{marginTop:n=>l(p(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:n=>s(n,"shift-10",r.get(n)),backgroundColor:n=>s(n,"shift-2",r.get(n))},"&::-webkit-file-upload-button":{marginTop:n=>l(p(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:n=>s(n,"shift-10",t.get(n)),backgroundColor:n=>s(n,"shift-2",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`,backgroundColor:n=>s(n,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>s(n,"shift-8","neutral"),backgroundColor:n=>s(n,"shift-3","neutral")}}}}function sr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,borderRadius:n=>l(p(n)*1),minWidth:l(32),paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*1),"&::placeholder":{color:n=>s(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=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral"),backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`}}}}function cr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(10),paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*1),borderRadius:n=>l(p(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),"&::placeholder":{color:n=>s(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>s(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`,color:n=>s(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${l(.5)} solid ${s(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${l(.5)} solid ${s(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${l(.5)} solid ${s(n,"shift-6","warning")}`}}}}function mr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:l(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:l(1.5),borderRadius:l(999),backgroundColor:n=>s(n,"shift-3",t.get(n))},"&::-moz-range-track":{height:l(1.5),borderRadius:l(999),backgroundColor:n=>s(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:l(4),height:l(4),borderRadius:l(999),border:"none",marginTop:`calc((${l(1.5)} - ${l(4)}) / 2)`,backgroundColor:n=>s(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>s(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`,outlineOffset:l(1),borderRadius:l(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ur(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(10),paddingInlineStart:n=>l(p(n)*3),paddingInlineEnd:n=>l(p(n)*1.5),paddingBlock:n=>l(p(n)*1),borderRadius:n=>l(p(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(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=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`,color:n=>s(n,"shift-8","neutral")}}}}function fr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),paddingBlock:l(.5),paddingInline:l(1.5),borderRadius:l(1),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`}}}function dr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:l(2),fontSize:n=>g(n,"inherit"),color:n=>s(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>s(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral")}}}}function hr(e={}){var o,i;let t=d((o=e.color)!=null?o:"primary","color"),r=d((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>g(n,"inherit"),backgroundColor:n=>s(n),color:n=>s(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>s(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>s(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:l(1),outlineOffset:l(1),outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral")}}}}function pr(e={}){var r;let t=d((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:l(6),borderRadius:l(1),paddingInline:l(1.5)}}}function gr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function yr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*3),borderRadius:o=>l(p(o)*2)}}}function br(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:l(2),border:0,borderRadius:l(999),overflow:"hidden",backgroundColor:n=>s(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>s(n,"shift-3",t.get(n)),borderRadius:l(999)},"&::-webkit-progress-value":{backgroundColor:n=>s(n,"shift-9",r.get(n)),borderRadius:l(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:n=>s(n,"shift-9",r.get(n)),borderRadius:l(999)}}}}function vr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>g(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:l(6),height:l(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:n=>s(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>s(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Sr(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>g(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",t)}`,borderRadius:o=>l(p(o)*1),paddingBlock:o=>l(p(o)*1),paddingLeft:o=>l(p(o)*3),paddingRight:o=>l(p(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${ot(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${l(2)} center`,backgroundSize:`${l(2.5)} ${l(1.5)}`,"&:not([multiple])":{height:o=>l(6+p(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",r)}`},"& optgroup":{color:o=>s(o,"shift-11",t)},"& option[disabled]":{color:o=>s(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")}}}}function xr(e={}){var i;let t=d((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=me(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>g(n),color:n=>s(n,"shift-9",t.get(n)),height:l(6),display:"block",borderRadius:l(1),backgroundColor:n=>s(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}var bo={to:{transform:"rotate(360deg)"}},yo=me(JSON.stringify(bo));function Cr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>g(o),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:l(6),height:l(6),borderRadius:"50%",border:o=>`${l(.5)} solid ${s(o,"shift-4",t.get(o))}`,borderTopColor:o=>s(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${yo} 0.7s linear infinite`,[`@keyframes ${yo}`]:bo}}}function wr(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=d((a=e.value)!=null?a:r?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(f=>({input:null,name:e.name,value:f||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>l(p(c)*2),paddingInline:c=>l(p(c)*2),fontSize:c=>g(c,"inherit"),backgroundColor:c=>s(c,"inherit",t)}}}function Er(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",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=>g(n,"inherit"),height:n=>l(6+p(n)*2),paddingInline:n=>l(p(n)*3),border:"none",outline:"none",color:n=>s(n,"shift-9",r),backgroundColor:n=>s(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>s(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>s(n,"shift-6",t),color:n=>s(n,"shift-11")},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",t)}`,outlineOffset:`-${l(.5)}`}}}}function kr(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=d(e.value),c=d(i),{show:m,hide:u,anchorPartial:f}=G({open:c,placement:d(r),content:e.content}),h={onClick:()=>!n&&u()};_(e.content,h);let v={div:b=>{let x=a.get(b),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($=>$!==w.value);n?a.set(O):a.set(O[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:l(1),flex:1}},y={_onInsert:b=>{b.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:b=>b.children.insert(v),onClick:()=>c.get()?u():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:b=>l(6+p(b)*2),minWidth:l(32),outlineOffset:"-1px",outline:b=>`1px solid ${s(b,"shift-4","neutral")}`,paddingInline:b=>l(p(b)*2),borderRadius:b=>l(p(b)*1),fontSize:b=>g(b,"inherit"),color:b=>s(b,"shift-9",o),backgroundColor:b=>s(b,"inherit",o)}};return _(f,y),f}function _r(e={}){var r;let t=d((r=e.accentColor)!=null?r:"primary","accentColor");return{dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>g(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:l(9),height:l(6),cursor:"pointer",margin:"0",paddingBlock:l(1),"&:checked":{"&::before":{backgroundColor:o=>s(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${l(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:l(3),height:l(3),borderRadius:l(999),left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>s(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:l(999),display:"inline-block",fontSize:o=>g(o,"inherit"),lineHeight:1,backgroundColor:o=>s(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Tr(e={}){var n,a;let{checked:t=!1}=e,r=d(t),o=d((n=e.color)!=null?n:"neutral","color"),i=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=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>g(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${s(c,"shift-3",o.get(c))}`,minWidth:l(12),minHeight:l(6),borderRadius:l(999),paddingLeft:l(7),paddingRight:l(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>s(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:l(5),height:l(5),borderRadius:l(999),color:c=>s(c,"shift-9"),backgroundColor:c=>s(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>s(c,"increase-3",i.get(c)),outline:"none",color:c=>s(c,"decrease-2"),paddingLeft:l(2),paddingRight:l(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${l(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Or(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}function Pr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>g(o,"inherit"),fontWeight:700,color:o=>s(o,"shift-11",t.get(o)),backgroundColor:o=>s(o)}}}function Rr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function $r(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function Lr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),color:o=>s(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${s(o,"shift-3",t.get(o))}`,fontSize:o=>g(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${s(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>s(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>s(o,"shift-2")+"!important"}}}}function Ir(e={}){var i,n;let t=d((i=e.color)!=null?i:"neutral","color"),r=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=>l(p(a)*2),paddingBlock:a=>l(p(a)*1.5),border:"none",borderRadius:a=>l(p(a)*1.5),fontSize:a=>g(a,"inherit"),color:a=>s(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${s(a,"shift-4",t.get(a))}`,backgroundColor:a=>s(a,"inherit",t.get(a)),"&::placeholder":{color:a=>s(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${l(.5)} solid ${s(a,"shift-5",r.get(a))}`},"&:focus-visible":{outline:a=>`${l(.5)} solid ${s(a,"shift-6",r.get(a))}`},"&:invalid":{outline:a=>`${l(.5)} solid ${s(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>s(a,"shift-8","neutral"),outline:a=>`1px solid ${s(a,"shift-4","neutral")}`,backgroundColor:a=>s(a,"shift-2","neutral")}}}}function zr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"disc",listStylePosition:"outside"}}}function Ar(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Mr(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function Vr(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=d((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>l(6+p(m)*2),height:m=>l(6+p(m)*2),paddingInline:m=>l(p(m)*2),borderRadius:m=>l(p(m)*1),border:"none",cursor:"pointer",fontSize:m=>g(m,"inherit"),backgroundColor:"transparent",color:m=>s(m,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=M(P({},n),{backgroundColor:m=>s(m,"shift-6",o),color:m=>s(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let u={div:f=>{let h=i.get(f),v=[];v.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:h<=1,onClick:()=>h>1&&i.set(h-1),style:n});for(let y of Mr(h,t))if(y==="...")v.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:b=>l(p(b)*2),color:b=>s(b,"shift-7",r)}});else{let b=y===h;v.push({button:String(y),type:"button",ariaLabel:`Page ${y}`,ariaCurrent:b?"page":void 0,disabled:b,onClick:()=>i.set(y),style:b?a:n})}return v.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:h>=t,onClick:()=>h<t&&i.set(h+1),style:n}),v},style:{display:"flex",alignItems:"center",gap:l(1)}};m.children.insert(u)},style:{display:"inline-flex"}}}function Nr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:l(2),fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var vo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Dr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},ut=e=>e==="left"||e==="right";function Br(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=d(r),a=ut(o)?l(80):l(64),c=i!=null?i: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 f=u.domElement;n.get()||(f.close(),document.body.style.overflow="")},_onMount:m=>{let u=m.domElement,f=h=>{h?(u.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{u.style.transform="translate(0, 0)"})):u.style.transform=vo[o]};f(n.get()),n.addListener(f)},style:{transform:vo[o],transition:"transform 0.25s ease",fontSize:m=>g(m,"inherit"),color:m=>s(m,"shift-10",t),backgroundColor:m=>s(m,"inherit",t),border:"none",padding:m=>l(p(m)*3),margin:Dr[o],width:ut(o)?c:"100dvw",height:ut(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${l(4)} ${l(12)} ${s(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>s(m,"shift-2","neutral"),opacity:.75}}}}function Hr(e){let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=d(t),a=d(r),{show:c,hide:m,anchorPartial:u}=G({open:n,placement:a,content:e.content}),f={role:"dialog",dataTone:"shift-17",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),_onInsert:v=>{let y=v.attributes.get("id");i=y||v.nodeId,!y&&v.attributes.set("id",i)}};return _(e.content,f),_(u,{ariaHaspopup:"dialog",ariaExpanded:v=>n.get(v),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),onClick:()=>{o==="click"&&(n.get()?m():c())},onFocus:()=>c(),onBlur:(v,y)=>{let b=v.relatedTarget,x=y.getRoot().domElement,S=i?x.querySelector(`#${CSS.escape(i)}`):null;b&&(S!=null&&S.contains(b))||m()},_onMount:v=>i&&v.attributes.set("ariaControls",i)}),u}function Fr(e={}){let{position:t="top-center",color:r="neutral"}=e,o=d(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:l(4),zIndex:30,padding:l(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:l(32),pointerEvents:"auto",paddingBlock:m=>l(p(m)*2),paddingInline:m=>l(p(m)*4),borderRadius:m=>l(p(m)*2),fontSize:m=>g(m,"inherit"),color:m=>s(m,"shift-9",r),backgroundColor:m=>s(m,"inherit",r),boxShadow:m=>`0 ${l(2)} ${l(9)} ${s(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,u)=>{let f=h=>{h.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",f),u())};m.domElement.addEventListener("transitionend",f),o.set(!1)}}}function jr(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=d(r),n=d(o),a=null,c={span:y=>n.get(y)},{show:m,hide:u,anchorPartial:f}=G({open:t,placement:i,content:c}),h={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:y=>{let b=y.attributes.get("id");a=b||y.nodeId,!b&&y.attributes.set("id",a)},style:{paddingBlock:y=>l(p(y)*1),paddingInline:y=>l(p(y)*3),borderRadius:y=>l(p(y)*1),color:y=>s(y,"shift-9"),backgroundColor:y=>s(y),fontSize:y=>g(y,"inherit")},$:[mt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(h),_(f,{onMouseEnter:()=>m(),onMouseLeave:()=>u(),onFocus:()=>m(),onBlur:()=>u(),onKeyDown:y=>y.key==="Escape"&&u(),_onMount:y=>a&&y.attributes.set("ariaDescribedby",a)}),f}function So(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Wr(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;c&&o.set(So(n,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;if(!c)return;let m=So(n,a),u=o.get(m);if(!u)return;let f=c.getBoundingClientRect(),h=u.left-f.left,v=u.top-f.top;if(Math.abs(h)<.5&&Math.abs(v)<.5)return;let y=c.style.transition,b=c.style.transform;c.style.transition="none",c.style.transform=`translate(${h}px, ${v}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=y,c.style.transform=b,c.removeEventListener("transitionend",S)},S=C=>{C.propertyName==="transform"&&x()};c.addEventListener("transitionend",S),setTimeout(x,t+r+34)}),o.clear()}}}function Ur(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:d(e.activeKey||0)}}};_(o,i)}}}function Kr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var u;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs"),a=(u=i.parent)==null?void 0:u.children.items;a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="tab");let c=i.key||a.findIndex(f=>f==i),m={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:f=>n.activeKey.get(f)==c,onClick:()=>n.activeKey.set(c),onKeyDown:f=>{var S,C,w,E;let h=f.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(h))return;f.preventDefault();let v=((C=(S=i.parent)==null?void 0:S.children.items)!=null?C:[]).filter(k=>k.type==="ElementNode"&&k.attributes.get("role")==="tab"),y=v.findIndex(k=>k===i),b=y;h==="ArrowRight"?b=(y+1)%v.length:h==="ArrowLeft"?b=(y-1+v.length)%v.length:h==="Home"?b=0:h==="End"&&(b=v.length-1);let x=v[b];n.activeKey.set((w=x.key)!=null?w:b),(E=x.domElement)==null||E.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>g(i,"inherit"),height:i=>l(6+p(i)*2),paddingInline:i=>l(p(i)*4),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",t)}`}}}}function qr(){return{role:"tabpanel",style:{paddingBlock:t=>l(p(t)*2),paddingInline:t=>l(p(t)*2)},_onInsert:t=>{var a;let r=t.getContext("tabs"),o=(a=t.parent)==null?void 0:a.children.items;o=o.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tabpanel");let i=t.key||o.findIndex(c=>c==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:c=>r.activeKey.get(c)!=i};t.merge(n)}}}function Gr(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let a={_context:{menu:{activeKey:d((c=e.activeKey)!=null?c:null),selectable:r}}};_(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>l(p(i)*2),paddingInline:i=>l(p(i)*2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>s(i,"inherit",t)}}}function Yr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu"),a=(m=i.parent)==null?void 0:m.children.items;a=a.filter(u=>u.type=="ElementNode"&&u.attributes.get("role")=="menuitem");let c=i.key||a.findIndex(u=>u==i);n.selectable&&(i.attributes.set("ariaCurrent",u=>n.activeKey.get(u)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var f,h,v,y;let a=i.key;if(a==="Enter"||a===" "){i.preventDefault(),(f=n.domElement)==null||f.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((v=(h=n.parent)==null?void 0:h.children.items)!=null?v:[]).filter(b=>b.type==="ElementNode"&&b.attributes.get("role")==="menuitem"),m=c.findIndex(b=>b===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),(y=c[u].domElement)==null||y.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>g(i,"inherit"),height:i=>l(6+p(i)*2),paddingInline:i=>l(p(i)*3),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>s(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>s(i,"shift-3",t),color:i=>s(i,"shift-10")},"&:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-6",t)}`,outlineOffset:`-${l(.5)}`}}}}function Xr(e){return{_onSchedule:(t,r)=>{_(r,{_context:{form:e}})}}}function Jr(e,t){return{_onInsert:r=>{let i=r.getContext("form").setField(e,void 0,t),n=r.tagName,a=r.attributes.get("type");["input","select","textarea"].includes(n)||console.warn('"field" patch must use input, select, or textarea tag');let c={onBlur:()=>i.setTouched(),ariaInvalid:m=>!!i.message("error",m)||void 0,dataStatus:m=>i.status(m)};n==="input"&&a==="checkbox"?(c.checked=i.value(),c.onChange=m=>i.setValue(m.target.checked)):n==="input"&&a==="radio"?c.onChange=m=>i.setValue(m.target.value):n==="select"?(c.value=i.value(),c.onChange=m=>i.setValue(m.target.value)):n==="textarea"?(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)):(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)),r.merge(c)}}}function Zr(e){return!!e&&typeof e.then=="function"}var Pe=class{constructor(t,r){this._notifier=new ce;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=t,this._initValue=t,this._validator=r,r&&this.validate()}value(t){return t&&this._notifier.addListener("value",t),this._value}setValue(t){this._value=t,this._notifier.notify("value",t),this._notifier.notify("dirty",t!==this._initValue),this.validate()}dirty(t){return t&&this._notifier.addListener("dirty",t),this._value!==this._initValue}touched(t){return t&&this._notifier.addListener("touched",t),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(t,r){let o=!1;t!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=t,this._initValue=t,this._notifier.notify("value",t),this._notifier.notify("dirty",!1),o=!0),r!==void 0&&r!==this._validator&&(this._validator=r,o=!0),o&&this.validate()}message(t,r){return r&&this._notifier.addListener(t,r),this._messages[t]}status(t){return t&&this._notifier.addListener("status",t),je(this._messages)}setMessages(t){let r=this._messages;this._messages=t;for(let o of["error","warning","success"])r[o]!==t[o]&&this._notifier.notify(o,t[o]);je(r)!==je(t)&&this._notifier.notify("status",je(t))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let t=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let r=this._validator(this._value);Zr(r)?(this._pending=!0,Promise.resolve(r).then(o=>{t===this._validationToken&&(this._pending=!1,this.setMessages(o!=null?o:{}))}).catch(o=>{t===this._validationToken&&(this._pending=!1,console.error(o))})):(this._pending=!1,this.setMessages(r!=null?r:{}))}catch(r){t===this._validationToken&&(this._pending=!1),console.error(r)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function je(e){if(e.error)return"error";if(e.warning)return"warning";if(e.success)return"success"}var ft=class{constructor(){this.fields=new Map}setField(t,r,o){let i=this.fields.get(t);return i?i.configure(r,o):(i=new Pe(r,o),this.fields.set(t,i)),i}getField(t){return this.setField(t)}removeField(t){var r;(r=this.fields.get(t))==null||r._dispose(),this.fields.delete(t)}get valid(){for(let t of this.fields.values())if(t._pending||t._messages.error)return!1;return!0}reset(){for(let t of this.fields.values())t.reset()}snapshot(){let t={};for(let[r,o]of this.fields)Qr(t,r,o._value);return t}_dispose(){for(let t of this.fields.values())t._dispose();this.fields.clear()}};function Qr(e,t,r){let o=t.split("."),i=e;for(let n=0;n<o.length-1;n++){let a=o[n];i[a]==null&&(i[a]=isNaN(Number(o[n+1]))?{}:[]),i=i[a]}i[o[o.length-1]]=r}return To(ei);})();
|
|
5
|
+
`)}function Yo(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 l(e){return e/4+"em"}function fe(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var Qe=["inherit"];[...Array(8).keys()].forEach(e=>{Qe.push(`decrease-${e}`),Qe.push(`increase-${e}`)});function Mt(e,t="inherit"){if(!Qe.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function Xo(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Mt(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function g(e,t="inherit"){let r=Mt(Xo(e),t);return Ae().fontSizes[r]}var et=["inherit"];[...Array(5).keys()].forEach(e=>{et.push(`decrease-${e}`),et.push(`increase-${e}`)});function Jo(e,t="inherit"){if(!et.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function Zo(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=Jo(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function p(e){let t=Zo(e);return K(e?fe(e):"light").densities[t]}var H=ve.colors.neutral.length,ze=["inherit","base"];[...Array(H).keys()].forEach(e=>{ze.push(`decrease-${e}`),ze.push(`increase-${e}`),ze.push(`shift-${e}`)});function It(e,t){if(e<0||e>H-1)return e;let r=e+t;return r=Math.max(0,Math.min(H-1,r)),r}function Qo(e,t){if(e<0||e>H-1)return e;let r=Math.floor((H-1)/2),o=e<=r?e+t:e-t;return o=o<0||o>H-1?-o:o,o=Math.max(0,Math.min(H-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 r=parseInt(t.replace("increase-",""),10);return It(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return It(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return Qo(e,r)}else return e}function Vt(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=Se(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Nt(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===H-1?H-1-r:e}function s(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return Ae()[o][Se(0,t)];let i;if(t=="base")i=K(fe(e)).baseTones[o];else{let a=K(fe(e)),c=Nt(Vt(e),a.direction,a.darkBias);i=Se(c,t)}let n=Ae()[o];if(!n)throw Error(`color "${JSON.stringify(o)}" not found on theme "${fe(e)}`);return n[i]}function ot(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r,i=e?fe(e):"light",n=At(i);if(!e)return n[o][Se(0,t)];let a;if(t=="base")a=K(i).baseTones[o];else{let c=K(i),m=Nt(Vt(e),c.direction,c.darkBias);a=Se(m,t)}return n[o][a]}var We={};Le(We,{FieldState:()=>Pe,FormState:()=>ft,abbreviation:()=>en,alert:()=>fn,avatar:()=>dn,badge:()=>hn,blockquote:()=>Wn,breadcrumb:()=>pn,breadcrumbEllipsis:()=>gn,button:()=>Un,buttonSwitch:()=>Tr,card:()=>tn,code:()=>qn,combobox:()=>jn,command:()=>an,commandItem:()=>sn,commandSearch:()=>ln,descriptionList:()=>Yn,details:()=>Gn,dialog:()=>Xn,divider:()=>Nr,drawer:()=>Br,emphasis:()=>Jn,field:()=>Jr,figure:()=>Zn,form:()=>Xr,formGroup:()=>Qn,heading:()=>tr,horizontalRule:()=>or,icon:()=>rr,image:()=>nr,inputCheckbox:()=>Kn,inputColor:()=>ir,inputDateTime:()=>ar,inputFile:()=>lr,inputNumber:()=>ur,inputOTP:()=>un,inputRadio:()=>vr,inputRange:()=>mr,inputSearch:()=>sr,inputSwitch:()=>_r,inputText:()=>cr,keyboard:()=>fr,label:()=>dr,link:()=>hr,mark:()=>pr,menu:()=>Gr,menuItem:()=>Yr,orderedList:()=>Ar,pagination:()=>Vr,paragraph:()=>gr,popover:()=>Hr,popoverArrow:()=>mt,preformated:()=>yr,progress:()=>br,select:()=>Sr,selectBox:()=>kr,selectItem:()=>Er,selectList:()=>wr,skeleton:()=>xr,small:()=>Or,spinner:()=>Cr,splitter:()=>on,splitterHandle:()=>rn,splitterPanel:()=>nn,strong:()=>Pr,subscript:()=>Rr,superscript:()=>$r,tab:()=>Kr,tabPanel:()=>qr,table:()=>Lr,tabs:()=>Ur,tag:()=>xe,textarea:()=>Ir,toast:()=>Fr,toggle:()=>cn,toggleGroup:()=>mn,tooltip:()=>jr,transitionGroup:()=>Wr,unorderedList:()=>zr});function en(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>g(n),backgroundColor:n=>s(n),color:n=>s(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>s(n,"shift-7",t.get(n)),textUnderlineOffset:l(.72),cursor:"help","&:hover":{color:n=>s(n,"shift-11",r.get(n)),textDecorationColor:n=>s(n,"shift-9",r.get(n))}}}}function tn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>l(p(o)*2),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>l(p(o)*4),color:o=>s(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>l(p(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>l(p(o)*4),color:o=>s(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:l(2),paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),borderTop:o=>`1px solid ${s(o,"shift-3",t.get(o))}`}}}}function on(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{_(a,{_context:{splitter:{direction:t,size:d(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function nn(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function rn(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let a=r.parentElement,c=u=>{let f=a.getBoundingClientRect(),h=o?(u.clientX-f.left)/f.width*100:(u.clientY-f.top)/f.height*100;t.size.set(Math.min(Math.max(h,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>s(e,"shift-2"),"&:hover":{backgroundColor:e=>s(e,"shift-3")},"&::after":{content:'""',borderRadius:l(999),backgroundColor:e=>s(e,"shift-4")}}}}function an(){return{_onSchedule:(e,t)=>{_(t,{_context:{command:{query:d("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function ln(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command"),n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>g(o,"inherit"),paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*2),border:"none",borderBottom:o=>`1px solid ${s(o,"shift-3",t)}`,outline:"none",color:o=>s(o,"shift-10",t),backgroundColor:o=>s(o,"inherit",t),"&::placeholder":{color:o=>s(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>s(o,"shift-6",r)}}}}function sn(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var m,u;let i=o.getContext("command"),n=o.domElement,a=(u=(m=n.textContent)==null?void 0:m.toLowerCase())!=null?u:"",c=i.query.addListener(f=>{n.hidden=f.length>0&&!a.includes(f.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>g(o,"inherit"),height:o=>l(6+p(o)*2),paddingInline:o=>l(p(o)*3),border:"none",outline:"none",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",r)}`,outlineOffset:`-${l(.5)}`}}}}function cn(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var f;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup"),m=((f=n.parent)==null?void 0:f.children.items).filter(h=>h.type==="ElementNode"&&h.attributes.get("role")==="button"),u=n.key!==void 0?String(n.key):String(m.findIndex(h=>h===n));n.attributes.set("ariaPressed",h=>{let b=a.value.get(h);return Array.isArray(b)?b.includes(u):b===u}),n.addEvent("click",()=>{let h=a.value.get();if(a.multiple){let b=Array.isArray(h)?[...h]:[];a.value.set(b.includes(u)?b.filter(y=>y!==u):[...b,u])}else a.value.set(h===u?"":u)})},style:{cursor:"pointer",fontSize:n=>g(n,"inherit"),height:l(6),paddingBlock:l(1),paddingInline:l(2),border:"none",borderRadius:l(1),color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>s(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>s(n,"shift-3",r.get(n)),color:n=>s(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`,outlineOffset:`-${l(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function mn(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:d((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:l(1),paddingInline:l(1),gap:l(1),borderRadius:l(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>s(i,"inherit",r),outline:i=>`1px solid ${s(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function un(){return{style:{display:"flex",alignItems:"center",gap:l(2),"& > *":{minWidth:l(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),m=a.target,u=c.indexOf(m);m.value&&u<c.length-1&&c[u+1].focus()},i=a=>{let c=r(),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 h,b,y;a.preventDefault();let c=(b=(h=a.clipboardData)==null?void 0:h.getData("text"))!=null?b:"",m=r(),u=m.indexOf(a.target);[...c].forEach((v,x)=>{m[u+x]&&(m[u+x].value=v)});let f=Math.min(u+c.length-1,m.length-1);(y=m[f])==null||y.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function fn(e={}){var r;let t=d((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:l(3),paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),boxShadow:o=>`inset ${l(1)} 0 0 0 ${s(o,"shift-8",t.get(o))}`,backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),fontSize:o=>g(o,"inherit")}}}function dn(e={}){var r;let t=d((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:l(9),height:l(9),fontSize:o=>g(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function hn(e={}){var i;let{label:t=999}=e,r=d(t),o=d((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:l(1),minWidth:l(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>g(n,"decrease-1"),borderRadius:l(999),backgroundColor:n=>s(n,"shift-9",o.get(n)),color:n=>s(n,"shift-0",o.get(n))}}}}function pn(e={}){var o;let{separator:t="/"}=e,r=d((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>g(i,"inherit"),gap:l(1),color:i=>s(i,"shift-9",r.get(i)),backgroundColor:i=>s(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>s(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>s(i,"shift-4",r.get(i)),paddingInlineStart:l(1)},"& > [aria-current=page]":{color:i=>s(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function gn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>g(o,"inherit"),paddingInline:l(1),border:"none",background:"none",cursor:"pointer",color:o=>s(o,"shift-8",t.get(o)),borderRadius:l(1),"&:hover":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",t.get(o))}`,outlineOffset:l(.5)}}}}var yn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function xe(e={}){var o;let{removable:t=!1}=e,r=d((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:yn,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:l(1),width:l(4),height:l(4),flexShrink:0,"&:hover":{backgroundColor:a=>s(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:l(6),paddingBlock:"0px",borderRadius:l(1),paddingInlineStart:l(2),paddingInlineEnd:t?l(1):l(2),gap:l(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>s(i,"inherit",r.get(i)),color:i=>s(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"shift-4",r.get(i))}`}}}var de=Math.min,F=Math.max,we=Math.round,Ee=Math.floor,V=e=>({x:e,y:e}),bn={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(e,t,r){return F(e,de(t,r))}function ke(e,t){return typeof e=="function"?e(t):e}function q(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function rt(e){return e==="x"?"y":"x"}function it(e){return e==="y"?"height":"width"}function j(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function at(e){return rt(j(e))}function Ht(e,t,r){r===void 0&&(r=!1);let o=_e(e),i=at(e),n=it(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=Ce(a)),[a,Ce(a)]}function Ft(e){let t=Ce(e);return[Ve(e),t,Ve(t)]}function Ve(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Dt=["left","right"],Bt=["right","left"],vn=["top","bottom"],Sn=["bottom","top"];function xn(e,t,r){switch(e){case"top":case"bottom":return r?t?Bt:Dt:t?Dt:Bt;case"left":case"right":return t?vn:Sn;default:return[]}}function jt(e,t,r,o){let i=_e(e),n=xn(q(e),r==="start",o);return i&&(n=n.map(a=>a+"-"+i),t&&(n=n.concat(n.map(Ve)))),n}function Ce(e){let t=q(e);return bn[t]+e.slice(t.length)}function Cn(e){return P({top:0,right:0,bottom:0,left:0},e)}function Wt(e){return typeof e!="number"?Cn(e):{top:e,right:e,bottom:e,left:e}}function te(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Ut(e,t,r){let{reference:o,floating:i}=e,n=j(t),a=at(t),c=it(a),m=q(t),u=n==="y",f=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,b=o[c]/2-i[c]/2,y;switch(m){case"top":y={x:f,y:o.y-i.height};break;case"bottom":y={x:f,y:o.y+o.height};break;case"right":y={x:o.x+o.width,y:h};break;case"left":y={x:o.x-i.width,y:h};break;default:y={x:o.x,y:o.y}}switch(_e(t)){case"start":y[a]-=b*(r&&u?-1:1);break;case"end":y[a]+=b*(r&&u?-1:1);break}return y}function Kt(e,t){return B(this,null,function*(){var r;t===void 0&&(t={});let{x:o,y:i,platform:n,rects:a,elements:c,strategy:m}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:b=!1,padding:y=0}=ke(t,e),v=Wt(y),S=c[b?h==="floating"?"reference":"floating":h],w=te(yield n.getClippingRect({element:(r=yield n.isElement==null?void 0:n.isElement(S))==null||r?S:S.contextElement||(yield n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:m})),C=h==="floating"?{x:o,y:i,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:C,offsetParent:E,strategy:m}):C);return{top:(w.top-T.top+v.top)/k.y,bottom:(T.bottom-w.bottom+v.bottom)/k.y,left:(w.left-T.left+v.left)/k.x,right:(T.right-w.right+v.right)/k.x}})}var wn=50,qt=(e,t,r)=>B(null,null,function*(){let{placement:o="bottom",strategy:i="absolute",middleware:n=[],platform:a}=r,c=a.detectOverflow?a:M(P({},a),{detectOverflow:Kt}),m=yield a.isRTL==null?void 0:a.isRTL(t),u=yield a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:h}=Ut(u,o,m),b=o,y=0,v={};for(let x=0;x<n.length;x++){let S=n[x];if(!S)continue;let{name:w,fn:C}=S,{x:E,y:k,data:T,reset:O}=yield C({x:f,y:h,initialPlacement:o,placement:b,strategy:i,middlewareData:v,rects:u,platform:c,elements:{reference:e,floating:t}});f=E!=null?E:f,h=k!=null?k:h,v[w]=P(P({},v[w]),T),O&&y<wn&&(y++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(u=O.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:f,y:h}=Ut(u,b,m)),x=-1)}return{x:f,y:h,placement:b,strategy:i,middlewareData:v}});var Gt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(r){return B(this,null,function*(){var o,i;let{placement:n,middlewareData:a,rects:c,initialPlacement:m,platform:u,elements:f}=r,yt=ke(e,r),{mainAxis:h=!0,crossAxis:b=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0}=yt,w=qe(yt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let C=q(n),E=j(m),k=q(m)===m,T=yield u.isRTL==null?void 0:u.isRTL(f.floating),O=y||(k||!S?[Ce(m)]:Ft(m)),$=x!=="none";!y&&$&&O.push(...jt(m,S,x,T));let dt=[m,...O],ae=yield u.detectOverflow(r,w),le=[],se=((i=a.flip)==null?void 0:i.overflows)||[];if(h&&le.push(ae[C]),b){let Y=Ht(n,c,T);le.push(ae[Y[0]],ae[Y[1]])}if(se=[...se,{placement:n,overflows:le}],!le.every(Y=>Y<=0)){var ht,pt;let Y=(((ht=a.flip)==null?void 0:ht.index)||0)+1,Ue=dt[Y];if(Ue&&(!(b==="alignment"?E!==j(Ue):!1)||se.every(A=>j(A.placement)===E?A.overflows[0]>0:!0)))return{data:{index:Y,overflows:se},reset:{placement:Ue}};let ye=(pt=se.filter(X=>X.overflows[0]<=0).sort((X,A)=>X.overflows[1]-A.overflows[1])[0])==null?void 0:pt.placement;if(!ye)switch(v){case"bestFit":{var gt;let X=(gt=se.filter(A=>{if($){let U=j(A.placement);return U===E||U==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(U=>U>0).reduce((U,xo)=>U+xo,0)]).sort((A,U)=>A[1]-U[1])[0])==null?void 0:gt[0];X&&(ye=X);break}case"initialPlacement":ye=m;break}if(n!==ye)return{reset:{placement:ye}}}return{}})}}};var En=new Set(["left","top"]);function kn(e,t){return B(this,null,function*(){let{placement:r,platform:o,elements:i}=e,n=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=q(r),c=_e(r),m=j(r)==="y",u=En.has(a)?-1:1,f=n&&m?-1:1,h=ke(t,e),{mainAxis:b,crossAxis:y,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof v=="number"&&(y=c==="end"?v*-1:v),m?{x:y*f,y:b*u}:{x:b*u,y:y*f}})}var Yt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(r){return B(this,null,function*(){var o,i;let{x:n,y:a,placement:c,middlewareData:m}=r,u=yield kn(r,e);return c===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:n+u.x,y:a+u.y,data:M(P({},u),{placement:c})}})}}},Xt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(r){return B(this,null,function*(){let{x:o,y:i,placement:n,platform:a}=r,C=ke(e,r),{mainAxis:c=!0,crossAxis:m=!1,limiter:u={fn:E=>{let{x:k,y:T}=E;return{x:k,y:T}}}}=C,f=qe(C,["mainAxis","crossAxis","limiter"]),h={x:o,y:i},b=yield a.detectOverflow(r,f),y=j(q(n)),v=rt(y),x=h[v],S=h[y];if(c){let E=v==="y"?"top":"left",k=v==="y"?"bottom":"right",T=x+b[E],O=x-b[k];x=nt(T,x,O)}if(m){let E=y==="y"?"top":"left",k=y==="y"?"bottom":"right",T=S+b[E],O=S-b[k];S=nt(T,S,O)}let w=u.fn(M(P({},r),{[v]:x,[y]:S}));return M(P({},w),{data:{x:w.x-o,y:w.y-i,enabled:{[v]:c,[y]:m}}})})}}};function Ne(){return typeof window!="undefined"}function ne(e){return Zt(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){var t;return(t=(Zt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zt(e){return Ne()?e instanceof Node||e instanceof R(e).Node:!1}function I(e){return Ne()?e instanceof Element||e instanceof R(e).Element:!1}function D(e){return Ne()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function Jt(e){return!Ne()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function pe(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function Qt(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 _n=/transform|translate|scale|rotate|perspective|filter/,Tn=/paint|layout|strict|content/,oe=e=>!!e&&e!=="none",lt;function De(e){let t=I(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||"")||Tn.test(t.contain||"")}function eo(e){let t=W(e);for(;D(t)&&!re(t);){if(De(t))return t;if(Te(t))return null;t=W(t)}return null}function Be(){return lt==null&&(lt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),lt}function re(e){return/^(html|body|#document)$/.test(ne(e))}function z(e){return R(e).getComputedStyle(e)}function Oe(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function W(e){if(ne(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Jt(e)&&e.host||N(e);return Jt(t)?t.host:t}function to(e){let t=W(e);return re(t)?e.ownerDocument?e.ownerDocument.body:e.body:D(t)&&pe(t)?t:to(t)}function he(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=to(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=R(i);if(n){let c=He(a);return t.concat(a,a.visualViewport||[],pe(i)?i:[],c&&r?he(c):[])}else return t.concat(i,he(i,[],r))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function io(e){let t=z(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=D(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=we(r)!==n||we(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function ct(e){return I(e)?e:e.contextElement}function ge(e){let t=ct(e);if(!D(t))return V(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=io(t),a=(n?we(r.width):r.width)/o,c=(n?we(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var On=V(0);function ao(e){let t=R(e);return!Be()||!t.visualViewport?On:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pn(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==R(e)?!1:t}function ie(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),n=ct(e),a=V(1);t&&(o?I(o)&&(a=ge(o)):a=ge(e));let c=Pn(n,r,o)?ao(n):V(0),m=(i.left+c.x)/a.x,u=(i.top+c.y)/a.y,f=i.width/a.x,h=i.height/a.y;if(n){let b=R(n),y=o&&I(o)?R(o):o,v=b,x=He(v);for(;x&&o&&y!==v;){let S=ge(x),w=x.getBoundingClientRect(),C=z(x),E=w.left+(x.clientLeft+parseFloat(C.paddingLeft))*S.x,k=w.top+(x.clientTop+parseFloat(C.paddingTop))*S.y;m*=S.x,u*=S.y,f*=S.x,h*=S.y,m+=E,u+=k,v=R(x),x=He(v)}}return te({width:f,height:h,x:m,y:u})}function Fe(e,t){let r=Oe(e).scrollLeft;return t?t.left+r:ie(N(e)).left+r}function lo(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Fe(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function Rn(e){let{elements:t,rect:r,offsetParent:o,strategy:i}=e,n=i==="fixed",a=N(o),c=t?Te(t.floating):!1;if(o===a||c&&n)return r;let m={scrollLeft:0,scrollTop:0},u=V(1),f=V(0),h=D(o);if((h||!h&&!n)&&((ne(o)!=="body"||pe(a))&&(m=Oe(o)),h)){let y=ie(o);u=ge(o),f.x=y.x+o.clientLeft,f.y=y.y+o.clientTop}let b=a&&!h&&!n?lo(a,m):V(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-m.scrollLeft*u.x+f.x+b.x,y:r.y*u.y-m.scrollTop*u.y+f.y+b.y}}function $n(e){return Array.from(e.getClientRects())}function Ln(e){let t=N(e),r=Oe(e),o=e.ownerDocument.body,i=F(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=F(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+Fe(e),c=-r.scrollTop;return z(o).direction==="rtl"&&(a+=F(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var oo=25;function In(e,t){let r=R(e),o=N(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){n=i.width,a=i.height;let f=Be();(!f||f&&t==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let u=Fe(o);if(u<=0){let f=o.ownerDocument,h=f.body,b=getComputedStyle(h),y=f.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,v=Math.abs(o.clientWidth-h.clientWidth-y);v<=oo&&(n-=v)}else u<=oo&&(n+=u);return{width:n,height:a,x:c,y:m}}function zn(e,t){let r=ie(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=D(e)?ge(e):V(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,m=i*n.x,u=o*n.y;return{width:a,height:c,x:m,y:u}}function no(e,t,r){let o;if(t==="viewport")o=In(e,r);else if(t==="document")o=Ln(N(e));else if(I(t))o=zn(t,r);else{let i=ao(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return te(o)}function so(e,t){let r=W(e);return r===t||!I(r)||re(r)?!1:z(r).position==="fixed"||so(r,t)}function An(e,t){let r=t.get(e);if(r)return r;let o=he(e,[],!1).filter(c=>I(c)&&ne(c)!=="body"),i=null,n=z(e).position==="fixed",a=n?W(e):e;for(;I(a)&&!re(a);){let c=z(a),m=De(a);!m&&c.position==="fixed"&&(i=null),(n?!m&&!i:!m&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||pe(a)&&!m&&so(e,a))?o=o.filter(f=>f!==a):i=c,a=W(a)}return t.set(e,o),o}function Mn(e){let{element:t,boundary:r,rootBoundary:o,strategy:i}=e,a=[...r==="clippingAncestors"?Te(t)?[]:An(t,this._c):[].concat(r),o],c=no(t,a[0],i),m=c.top,u=c.right,f=c.bottom,h=c.left;for(let b=1;b<a.length;b++){let y=no(t,a[b],i);m=F(y.top,m),u=de(y.right,u),f=de(y.bottom,f),h=F(y.left,h)}return{width:u-h,height:f-m,x:h,y:m}}function Vn(e){let{width:t,height:r}=io(e);return{width:t,height:r}}function Nn(e,t,r){let o=D(t),i=N(t),n=r==="fixed",a=ie(e,!0,n,t),c={scrollLeft:0,scrollTop:0},m=V(0);function u(){m.x=Fe(i)}if(o||!o&&!n)if((ne(t)!=="body"||pe(i))&&(c=Oe(t)),o){let y=ie(t,!0,n,t);m.x=y.x+t.clientLeft,m.y=y.y+t.clientTop}else i&&u();n&&!o&&i&&u();let f=i&&!o&&!n?lo(i,c):V(0),h=a.left+c.scrollLeft-m.x-f.x,b=a.top+c.scrollTop-m.y-f.y;return{x:h,y:b,width:a.width,height:a.height}}function st(e){return z(e).position==="static"}function ro(e,t){if(!D(e)||z(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return N(e)===r&&(r=r.ownerDocument.body),r}function co(e,t){let r=R(e);if(Te(e))return r;if(!D(e)){let i=W(e);for(;i&&!re(i);){if(I(i)&&!st(i))return i;i=W(i)}return r}let o=ro(e,t);for(;o&&Qt(o)&&st(o);)o=ro(o,t);return o&&re(o)&&st(o)&&!De(o)?r:o||eo(e)||r}var Dn=function(e){return B(this,null,function*(){let t=this.getOffsetParent||co,r=this.getDimensions,o=yield r(e.floating);return{reference:Nn(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Bn(e){return z(e).direction==="rtl"}var Hn={convertOffsetParentRelativeRectToViewportRelativeRect:Rn,getDocumentElement:N,getClippingRect:Mn,getOffsetParent:co,getElementRects:Dn,getClientRects:$n,getDimensions:Vn,getScale:ge,isElement:I,isRTL:Bn};function mo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fn(e,t){let r=null,o,i=N(e);function n(){var c;clearTimeout(o),(c=r)==null||c.disconnect(),r=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),n();let u=e.getBoundingClientRect(),{left:f,top:h,width:b,height:y}=u;if(c||t(),!b||!y)return;let v=Ee(h),x=Ee(i.clientWidth-(f+b)),S=Ee(i.clientHeight-(h+y)),w=Ee(f),E={rootMargin:-v+"px "+-x+"px "+-S+"px "+-w+"px",threshold:F(0,de(1,m))||1},k=!0;function T(O){let $=O[0].intersectionRatio;if($!==m){if(!k)return a();$?a(!1,$):o=setTimeout(()=>{a(!1,1e-7)},1e3)}$===1&&!mo(u,e.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(T,M(P({},E),{root:i.ownerDocument}))}catch(O){r=new IntersectionObserver(T,E)}r.observe(e)}return a(!0),n}function uo(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=ct(e),f=i||n?[...u?he(u):[],...t?he(t):[]]:[];f.forEach(w=>{i&&w.addEventListener("scroll",r,{passive:!0}),n&&w.addEventListener("resize",r)});let h=u&&c?Fn(u,r):null,b=-1,y=null;a&&(y=new ResizeObserver(w=>{let[C]=w;C&&C.target===u&&y&&t&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(t)})),r()}),u&&!m&&y.observe(u),t&&y.observe(t));let v,x=m?ie(e):null;m&&S();function S(){let w=ie(e);x&&!mo(x,w)&&r(),x=w,v=requestAnimationFrame(S)}return r(),()=>{var w;f.forEach(C=>{i&&C.removeEventListener("scroll",r),n&&C.removeEventListener("resize",r)}),h==null||h(),(w=y)==null||w.disconnect(),y=null,m&&cancelAnimationFrame(v)}}var fo=Yt;var ho=Xt,po=Gt;var go=(e,t,r)=>{let o=new Map,i=P({platform:Hn},r),n=M(P({},i.platform),{_c:o});return qt(e,t,M(P({},i),{platform:n}))};function G(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,a=null,c=null,m=null,u=!1,f=d(t),h=()=>{u||!m||(u=!0,c=m.children.insert(e.content))},b=()=>{h(),n&&a&&(i&&i(),i=uo(n,a,()=>{go(n,a,{placement:r.get(),middleware:[fo(12),po(),ho()],strategy:"fixed"}).then(({x:C,y:E,placement:k})=>{Object.assign(a.style,{left:`${C}px`,top:`${E}px`}),r.set(k)})}),f.set(!0))},y=()=>{i&&i(),i=null,f.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},x=()=>{o&&clearTimeout(o),o=setTimeout(y,100)},S={style:{position:"fixed",pointerEvents:"auto",visibility:C=>f.get(C)?"visible":"hidden"},_onMount:C=>a=C.domElement,_portal:C=>{let E=C.domElement.querySelector("#domphy-floating");if(!E){let k={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};E=C.children.insert(k).domElement}return E}};return _(e.content,S),{show:v,hide:x,anchorPartial:{onKeyDown:C=>C.key==="Escape"&&x(),_onMount:C=>{m=C.getRoot(),n=C.domElement;let E=k=>{if(!f.get()||!n||!a)return;let T=k.target;!n.contains(T)&&!a.contains(T)&&x()};C.getRoot().domElement.addEventListener("click",E),C.addHook("BeforeRemove",()=>{o&&clearTimeout(o),c&&c.remove(),C.getRoot().domElement.removeEventListener("click",E)})}}}}function jn(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=d(e.value),c=d(i),{show:m,hide:u,anchorPartial:f}=G({open:c,placement:d(r),content:e.content}),h={onClick:()=>!n&&u()};_(e.content,h);let b={border:"none",outline:"none",padding:0,margin:0,flex:1,height:l(6),marginInlineStart:l(2),fontSize:S=>g(S,"inherit"),color:S=>s(S,"shift-9",o),backgroundColor:S=>s(S,"inherit",o)},y;e.input?(_(e.input,{onFocus:()=>m(),style:b,_key:"combobox-input"}),y=e.input):y={input:null,onFocus:()=>m(),value:S=>(a.get(S),""),style:b,_key:"combobox-input"};let v={div:S=>{let w=a.get(S),C=Array.isArray(w)?w:[w],k=t.filter(T=>C.includes(T.value)).map(T=>({span:T.label,$:[xe({color:o,removable:!0})],_key:T.value,_onRemove:O=>{let $=a.get(),ae=(Array.isArray($)?$:[$]).filter(le=>le!==T.value);n?a.set(ae):a.set(ae[0])}}));return k.push(y),k},style:{display:"flex",flexWrap:"wrap",gap:l(1)}},x={_onInsert:S=>{S.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(v),style:{minWidth:l(32),outlineOffset:"-1px",outline:S=>`1px solid ${s(S,"shift-4","neutral")}`,paddingBlock:S=>l(p(S)*1),paddingInline:S=>l(p(S)*1),borderRadius:S=>l(p(S)*1),fontSize:S=>g(S,"inherit"),color:S=>s(S,"shift-9",o),backgroundColor:S=>s(S,"inherit",o)}};return _(f,x),f}function mt(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=l(6),bordered:i=!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=f=>{var h;return(h=a[n.get(f)])!=null?h:a["bottom-end"]},m=f=>f.includes("start")?o:f.includes("end")?"auto":"50%",u=f=>f.includes("end")?o:f.includes("start")?"auto":"50%";return{style:{fontSize:f=>g(f),backgroundColor:f=>s(f),color:f=>s(f,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:l(1.5),height:l(1.5),backgroundColor:f=>s(f,"inherit",r),borderWidth:i?"1px":"0px",borderColor:f=>s(f,"inherit",r),borderTopStyle:f=>{let h=c(f);return h.includes("top")||h.includes("right")?"solid":"none"},borderBottomStyle:f=>{let h=c(f);return h.includes("bottom")||h.includes("left")?"solid":"none"},borderLeftStyle:f=>{let h=c(f);return h.includes("top")||h.includes("left")?"solid":"none"},borderRightStyle:f=>{let h=c(f);return h.includes("bottom")||h.includes("right")?"solid":"none"},top:f=>{let h=c(f);return h.includes("top")?0:h.includes("bottom")?"auto":m(h)},right:f=>{let h=c(f);return h.includes("right")?0:h.includes("left")?"auto":u(h)},bottom:f=>{let h=c(f);return h.includes("bottom")?0:h.includes("top")?"auto":u(h)},left:f=>{let h=c(f);return h.includes("left")?0:h.includes("right")?"auto":m(h)},transform:f=>{let h=c(f),b=h.includes("right")||h.includes("end")&&!h.includes("left")?"50%":"-50%",y=h.includes("bottom")||h.includes("end")&&!h.includes("top")?"50%":"-50%";return`translate(${b},${y}) rotate(45deg)`}}}}}function Wn(e={}){var r;let t=d((r=e.color)!=null?r:"inherit","color");return{_onInsert:o=>{o.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o,"inherit",t.get(o)),boxShadow:o=>`inset ${l(1)} 0 0 0 ${s(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*4),margin:0}}}function Un(e={}){var r;let t=d((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>g(o,"inherit"),paddingBlock:o=>l(p(o)*1),paddingInline:o=>l(p(o)*3),borderRadius:o=>l(p(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>l(p(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`,color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${l(.5)} ${s(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,color:o=>s(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Kn(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>g(n,"inherit"),display:"inline-flex",position:"relative",width:l(6),height:l(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:l(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:n=>s(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`,backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${l(.5)} solid ${s(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`,backgroundColor:n=>s(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:l(1.5),outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>s(n,"shift-4","neutral"),pointerEvents:"none"}}}}function qn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:l(6),paddingInline:l(1.5),borderRadius:l(1)}}}function Gn(e={}){var i,n;let{duration:t=240}=e,r=d((i=e.color)!=null?i:"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=>g(a,"inherit"),color:a=>s(a,"shift-9",r.get(a)),backgroundColor:a=>s(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>s(a,"shift-2",r.get(a)),color:a=>s(a,"shift-10",r.get(a)),fontSize:a=>g(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:l(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>l(p(a)*4),height:l(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:l(2),height:l(2),flexShrink:0,marginTop:`-${l(.5)}`,borderInlineEnd:a=>`${l(.5)} solid ${s(a,"shift-9",r.get(a))}`,borderBottom:a=>`${l(.5)} solid ${s(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>s(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>l(p(a)*2),outlineOffset:`-${l(.5)}`,outline:a=>`${l(.5)} solid ${s(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>l(p(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:l(250),opacity:1,paddingTop:a=>l(p(a)*1),paddingBottom:a=>l(p(a)*3)}}}}function Yn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${l(24)}, max-content) 1fr`,columnGap:l(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}}function Xn(e={}){let{color:t="neutral",open:r=!1}=e,o=d(r);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,a=c=>{c?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let m=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):n.style.opacity="0"};a(o.get()),o.addListener(a)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>g(i,"inherit"),color:i=>s(i,"shift-10",t),backgroundColor:i=>s(i,"inherit",t),border:"none",padding:i=>l(p(i)*3),boxShadow:i=>`0 ${l(9)} ${l(16)} ${s(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>s(i,"shift-2","neutral"),opacity:.75}}}}function Jn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>g(o,"inherit"),fontStyle:"italic",color:o=>s(o,"shift-10",t.get(o))}}}function Zn(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:l(2),marginInline:0,marginTop:l(3),marginBottom:l(3),color:o=>s(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:l(2)},"& figcaption":{fontSize:o=>g(o,"decrease-1"),color:o=>s(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Qn(e={}){var i;let{layout:t="horizontal"}=e,r=d((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*3),border:"none",borderRadius:n=>l(p(n)*2),fontSize:n=>g(n,"inherit"),backgroundColor:n=>s(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:l(4),rowGap:l(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>g(n,"inherit"),fontWeight:600,paddingBlock:n=>l(p(n)*1),borderRadius:n=>l(p(n)*2),color:n=>s(n,"shift-9",r.get(n)),backgroundColor:n=>s(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":l(p(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(${l(2)} * -1)`,fontSize:n=>g(n,"decrease-1"),color:n=>s(n,"shift-9",r.get(n))}}}}var er={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function tr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>s(o,"shift-11",t.get(o)),marginTop:0,marginBottom:l(2),fontSize:o=>{let i=er[o.elementNode.tagName]||"inherit";return g(o,i)}}}}function or(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:l(3),marginBottom:l(3),backgroundColor:o=>s(o,"shift-4",t.get(o))}}}function nr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:l(2),backgroundColor:o=>s(o,"inherit",t.get(o))}}}function rr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:l(4),height:l(4),flexShrink:"0",fontSize:o=>g(o),backgroundColor:"transparent",color:o=>s(o,"shift-9",t.get(o))}}}function ir(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>g(n,"inherit"),paddingBlock:n=>l(p(n)*1),paddingInline:n=>l(p(n)*1),blockSize:n=>l(6+p(n)*2),inlineSize:n=>l(6+p(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>l(p(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`}}}}function ar(e={}){var i,n;let{mode:t="datetime-local"}=e,r=d((i=e.color)!=null?i:"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=>g(a,"inherit"),lineHeight:"inherit",color:a=>s(a,"shift-9",r.get(a)),backgroundColor:a=>s(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${s(a,"shift-4",r.get(a))}`,borderRadius:a=>l(p(a)*1),paddingInline:a=>l(p(a)*3),height:a=>l(6+p(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${l(.5)} solid ${s(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>s(a,"shift-8","neutral"),backgroundColor:a=>s(a,"shift-2","neutral"),outline:a=>`1px solid ${s(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${l(.5)} solid ${s(a,"shift-6","error")}`}}}}function lr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,borderRadius:n=>l(p(n)*1),height:n=>l(6+p(n)*2),paddingInline:n=>l(p(n)*1),"&::file-selector-button":{marginTop:n=>l(p(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:n=>s(n,"shift-10",r.get(n)),backgroundColor:n=>s(n,"shift-2",r.get(n))},"&::-webkit-file-upload-button":{marginTop:n=>l(p(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:n=>s(n,"shift-10",t.get(n)),backgroundColor:n=>s(n,"shift-2",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`,backgroundColor:n=>s(n,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>s(n,"shift-8","neutral"),backgroundColor:n=>s(n,"shift-3","neutral")}}}}function sr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,borderRadius:n=>l(p(n)*1),minWidth:l(32),paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*1),"&::placeholder":{color:n=>s(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=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral"),backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`}}}}function cr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(10),paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*1),borderRadius:n=>l(p(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),"&::placeholder":{color:n=>s(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>s(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`,color:n=>s(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${l(.5)} solid ${s(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${l(.5)} solid ${s(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${l(.5)} solid ${s(n,"shift-6","warning")}`}}}}function mr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:l(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:l(1.5),borderRadius:l(999),backgroundColor:n=>s(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:l(4),height:l(4),borderRadius:l(999),border:"none",marginTop:`calc((${l(1.5)} - ${l(4)}) / 2)`,backgroundColor:n=>s(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>s(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`,outlineOffset:l(1),borderRadius:l(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ur(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(10),paddingInlineStart:n=>l(p(n)*3),paddingInlineEnd:n=>l(p(n)*1.5),paddingBlock:n=>l(p(n)*1),borderRadius:n=>l(p(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),backgroundColor:n=>s(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=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`,color:n=>s(n,"shift-8","neutral")}}}}function fr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),paddingBlock:l(.5),paddingInline:l(1.5),borderRadius:l(1),outline:o=>`1px solid ${s(o,"shift-4",t.get(o))}`}}}function dr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:l(2),fontSize:n=>g(n,"inherit"),color:n=>s(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>s(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral")}}}}function hr(e={}){var o,i;let t=d((o=e.color)!=null?o:"primary","color"),r=d((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>g(n,"inherit"),backgroundColor:n=>s(n),color:n=>s(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>s(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>s(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:l(1),outlineOffset:l(1),outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"shift-8","neutral")}}}}function pr(e={}){var r;let t=d((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:l(6),borderRadius:l(1),paddingInline:l(1.5)}}}function gr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function yr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*3),borderRadius:o=>l(p(o)*2)}}}function br(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:l(2),border:0,borderRadius:l(999),overflow:"hidden",backgroundColor:n=>s(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>s(n,"shift-3",t.get(n)),borderRadius:l(999)},"&::-webkit-progress-value":{backgroundColor:n=>s(n,"shift-9",r.get(n)),borderRadius:l(999),transition:"width 220ms ease"}}}}function vr(e={}){var o,i;let t=d((o=e.color)!=null?o:"neutral","color"),r=d((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>g(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:l(6),height:l(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"shift-4",t.get(n))}`,color:n=>s(n,"shift-9",t.get(n)),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:n=>s(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${l(.5)} solid ${s(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>s(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Sr(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>g(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-9",t),backgroundColor:o=>s(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",t)}`,borderRadius:o=>l(p(o)*1),paddingBlock:o=>l(p(o)*1),paddingLeft:o=>l(p(o)*3),paddingRight:o=>l(p(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${ot(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${l(2)} center`,backgroundSize:`${l(2.5)} ${l(1.5)}`,"&:not([multiple])":{height:o=>l(6+p(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",r)}`},"& optgroup":{color:o=>s(o,"shift-11",t)},"& option[disabled]":{color:o=>s(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")}}}}function xr(e={}){var i;let t=d((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=me(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>g(n),color:n=>s(n,"shift-9",t.get(n)),height:l(6),display:"block",borderRadius:l(1),backgroundColor:n=>s(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}var bo={to:{transform:"rotate(360deg)"}},yo=me(JSON.stringify(bo));function Cr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>g(o),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:l(6),height:l(6),borderRadius:"50%",border:o=>`${l(.5)} solid ${s(o,"shift-4",t.get(o))}`,borderTopColor:o=>s(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${yo} 0.7s linear infinite`,[`@keyframes ${yo}`]:bo}}}function wr(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=d((a=e.value)!=null?a:r?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(f=>({input:null,name:e.name,value:f||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>l(p(c)*2),paddingInline:c=>l(p(c)*2),fontSize:c=>g(c,"inherit"),backgroundColor:c=>s(c,"inherit",t)}}}function Er(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",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=>g(n,"inherit"),height:n=>l(6+p(n)*2),paddingInline:n=>l(p(n)*3),border:"none",outline:"none",color:n=>s(n,"shift-9",r),backgroundColor:n=>s(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>s(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>s(n,"shift-6",t),color:n=>s(n,"shift-11")},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",t)}`,outlineOffset:`-${l(.5)}`}}}}function kr(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=d(e.value),c=d(i),{show:m,hide:u,anchorPartial:f}=G({open:c,placement:d(r),content:e.content}),h={onClick:()=>!n&&u()};_(e.content,h);let b={div:v=>{let x=a.get(v),S=Array.isArray(x)?x:[x];return t.filter(C=>S.includes(C.value)).map(C=>({span:C.label,$:[xe({color:o,removable:n})],_key:C.value,_onRemove:E=>{let k=a.get(),O=(Array.isArray(k)?k:[k]).filter($=>$!==C.value);n?a.set(O):a.set(O[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:l(1),flex:1}},y={_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=>l(6+p(v)*2),minWidth:l(32),outlineOffset:"-1px",outline:v=>`1px solid ${s(v,"shift-4","neutral")}`,paddingInline:v=>l(p(v)*2),borderRadius:v=>l(p(v)*1),fontSize:v=>g(v,"inherit"),color:v=>s(v,"shift-9",o),backgroundColor:v=>s(v,"inherit",o)}};return _(f,y),f}function _r(e={}){var r;let t=d((r=e.accentColor)!=null?r:"primary","accentColor");return{dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>g(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:l(9),height:l(6),cursor:"pointer",margin:"0",paddingBlock:l(1),"&:checked":{"&::before":{backgroundColor:o=>s(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${l(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:l(3),height:l(3),borderRadius:l(999),left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>s(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:l(999),display:"inline-block",fontSize:o=>g(o,"inherit"),lineHeight:1,backgroundColor:o=>s(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Tr(e={}){var n,a;let{checked:t=!1}=e,r=d(t),o=d((n=e.color)!=null?n:"neutral","color"),i=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=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>g(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${s(c,"shift-3",o.get(c))}`,minWidth:l(12),minHeight:l(6),borderRadius:l(999),paddingLeft:l(7),paddingRight:l(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>s(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:l(5),height:l(5),borderRadius:l(999),color:c=>s(c,"shift-9"),backgroundColor:c=>s(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>s(c,"increase-3",i.get(c)),outline:"none",color:c=>s(c,"decrease-2"),paddingLeft:l(2),paddingRight:l(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${l(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Or(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o))}}}function Pr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>g(o,"inherit"),fontWeight:700,color:o=>s(o,"shift-11",t.get(o)),backgroundColor:o=>s(o)}}}function Rr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function $r(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>s(o,"shift-9",t.get(o))}}}function Lr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>s(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),color:o=>s(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${s(o,"shift-3",t.get(o))}`,fontSize:o=>g(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${s(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>s(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>s(o,"shift-2")+"!important"}}}}function Ir(e={}){var i,n;let t=d((i=e.color)!=null?i:"neutral","color"),r=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=>l(p(a)*2),paddingBlock:a=>l(p(a)*1.5),border:"none",borderRadius:a=>l(p(a)*1.5),fontSize:a=>g(a,"inherit"),color:a=>s(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${s(a,"shift-4",t.get(a))}`,backgroundColor:a=>s(a,"inherit",t.get(a)),"&::placeholder":{color:a=>s(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${l(.5)} solid ${s(a,"shift-5",r.get(a))}`},"&:focus-visible":{outline:a=>`${l(.5)} solid ${s(a,"shift-6",r.get(a))}`},"&:invalid":{outline:a=>`${l(.5)} solid ${s(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>s(a,"shift-8","neutral"),outline:a=>`1px solid ${s(a,"shift-4","neutral")}`,backgroundColor:a=>s(a,"shift-2","neutral")}}}}function zr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"disc",listStylePosition:"outside"}}}function Ar(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Mr(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function Vr(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=d((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>l(6+p(m)*2),height:m=>l(6+p(m)*2),paddingInline:m=>l(p(m)*2),borderRadius:m=>l(p(m)*1),border:"none",cursor:"pointer",fontSize:m=>g(m,"inherit"),backgroundColor:"transparent",color:m=>s(m,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=M(P({},n),{backgroundColor:m=>s(m,"shift-6",o),color:m=>s(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let u={div:f=>{let h=i.get(f),b=[];b.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:h<=1,onClick:()=>h>1&&i.set(h-1),style:n});for(let y of Mr(h,t))if(y==="...")b.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>l(p(v)*2),color:v=>s(v,"shift-7",r)}});else{let v=y===h;b.push({button:String(y),type:"button",ariaLabel:`Page ${y}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(y),style:v?a:n})}return b.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:h>=t,onClick:()=>h<t&&i.set(h+1),style:n}),b},style:{display:"flex",alignItems:"center",gap:l(1)}};m.children.insert(u)},style:{display:"inline-flex"}}}function Nr(e={}){var r;let t=d((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:l(2),fontSize:o=>g(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>s(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var vo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Dr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},ut=e=>e==="left"||e==="right";function Br(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=d(r),a=ut(o)?l(80):l(64),c=i!=null?i: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 f=u.domElement;n.get()||(f.close(),document.body.style.overflow="")},_onMount:m=>{let u=m.domElement,f=h=>{h?(u.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{u.style.transform="translate(0, 0)"})):u.style.transform=vo[o]};f(n.get()),n.addListener(f)},style:{transform:vo[o],transition:"transform 0.25s ease",fontSize:m=>g(m,"inherit"),color:m=>s(m,"shift-10",t),backgroundColor:m=>s(m,"inherit",t),border:"none",padding:m=>l(p(m)*3),margin:Dr[o],width:ut(o)?c:"100dvw",height:ut(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${l(4)} ${l(12)} ${s(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>s(m,"shift-2","neutral"),opacity:.75}}}}function Hr(e){let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=d(t),a=d(r),{show:c,hide:m,anchorPartial:u}=G({open:n,placement:a,content:e.content}),f={role:"dialog",dataTone:"shift-17",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),_onInsert:b=>{let y=b.attributes.get("id");i=y||b.nodeId,!y&&b.attributes.set("id",i)}};return _(e.content,f),_(u,{ariaHaspopup:"dialog",ariaExpanded:b=>n.get(b),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),onClick:()=>{o==="click"&&(n.get()?m():c())},onFocus:()=>c(),onBlur:(b,y)=>{let v=b.relatedTarget,x=y.getRoot().domElement,S=i?x.querySelector(`#${CSS.escape(i)}`):null;v&&(S!=null&&S.contains(v))||m()},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),u}function Fr(e={}){let{position:t="top-center",color:r="neutral"}=e,o=d(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:l(4),zIndex:30,padding:l(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:l(32),pointerEvents:"auto",paddingBlock:m=>l(p(m)*2),paddingInline:m=>l(p(m)*4),borderRadius:m=>l(p(m)*2),fontSize:m=>g(m,"inherit"),color:m=>s(m,"shift-9",r),backgroundColor:m=>s(m,"inherit",r),boxShadow:m=>`0 ${l(2)} ${l(9)} ${s(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,u)=>{let f=h=>{h.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",f),u())};m.domElement.addEventListener("transitionend",f),o.set(!1)}}}function jr(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=d(r),n=d(o),a=null,c={span:y=>n.get(y)},{show:m,hide:u,anchorPartial:f}=G({open:t,placement:i,content:c}),h={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:y=>{let v=y.attributes.get("id");a=v||y.nodeId,!v&&y.attributes.set("id",a)},style:{paddingBlock:y=>l(p(y)*1),paddingInline:y=>l(p(y)*3),borderRadius:y=>l(p(y)*1),color:y=>s(y,"shift-9"),backgroundColor:y=>s(y),fontSize:y=>g(y,"inherit")},$:[mt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(h),_(f,{onMouseEnter:()=>m(),onMouseLeave:()=>u(),onFocus:()=>m(),onBlur:()=>u(),onKeyDown:y=>y.key==="Escape"&&u(),_onMount:y=>a&&y.attributes.set("ariaDescribedby",a)}),f}function So(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Wr(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;c&&o.set(So(n,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;if(!c)return;let m=So(n,a),u=o.get(m);if(!u)return;let f=c.getBoundingClientRect(),h=u.left-f.left,b=u.top-f.top;if(Math.abs(h)<.5&&Math.abs(b)<.5)return;let y=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${h}px, ${b}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=y,c.style.transform=v,c.removeEventListener("transitionend",S)},S=w=>{w.propertyName==="transform"&&x()};c.addEventListener("transitionend",S),setTimeout(x,t+r+34)}),o.clear()}}}function Ur(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:d(e.activeKey||0)}}};_(o,i)}}}function Kr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var u;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs"),a=(u=i.parent)==null?void 0:u.children.items;a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="tab");let c=i.key||a.findIndex(f=>f==i),m={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:f=>n.activeKey.get(f)==c,onClick:()=>n.activeKey.set(c),onKeyDown:f=>{var S,w,C,E;let h=f.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(h))return;f.preventDefault();let b=((w=(S=i.parent)==null?void 0:S.children.items)!=null?w:[]).filter(k=>k.type==="ElementNode"&&k.attributes.get("role")==="tab"),y=b.findIndex(k=>k===i),v=y;h==="ArrowRight"?v=(y+1)%b.length:h==="ArrowLeft"?v=(y-1+b.length)%b.length:h==="Home"?v=0:h==="End"&&(v=b.length-1);let x=b[v];n.activeKey.set((C=x.key)!=null?C:v),(E=x.domElement)==null||E.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>g(i,"inherit"),height:i=>l(6+p(i)*2),paddingInline:i=>l(p(i)*4),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",t)}`}}}}function qr(){return{role:"tabpanel",style:{paddingBlock:t=>l(p(t)*2),paddingInline:t=>l(p(t)*2)},_onInsert:t=>{var a;let r=t.getContext("tabs"),o=(a=t.parent)==null?void 0:a.children.items;o=o.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tabpanel");let i=t.key||o.findIndex(c=>c==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:c=>r.activeKey.get(c)!=i};t.merge(n)}}}function Gr(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let a={_context:{menu:{activeKey:d((c=e.activeKey)!=null?c:null),selectable:r}}};_(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>l(p(i)*2),paddingInline:i=>l(p(i)*2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>s(i,"inherit",t)}}}function Yr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu"),a=(m=i.parent)==null?void 0:m.children.items;a=a.filter(u=>u.type=="ElementNode"&&u.attributes.get("role")=="menuitem");let c=i.key||a.findIndex(u=>u==i);n.selectable&&(i.attributes.set("ariaCurrent",u=>n.activeKey.get(u)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var f,h,b,y;let a=i.key;if(a==="Enter"||a===" "){i.preventDefault(),(f=n.domElement)==null||f.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((b=(h=n.parent)==null?void 0:h.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),(y=c[u].domElement)==null||y.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>g(i,"inherit"),height:i=>l(6+p(i)*2),paddingInline:i=>l(p(i)*3),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>s(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>s(i,"shift-3",t),color:i=>s(i,"shift-10")},"&:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-6",t)}`,outlineOffset:`-${l(.5)}`}}}}function Xr(e){return{_onSchedule:(t,r)=>{_(r,{_context:{form:e}})}}}function Jr(e,t){return{_onInsert:r=>{let i=r.getContext("form").setField(e,void 0,t),n=r.tagName,a=r.attributes.get("type");["input","select","textarea"].includes(n)||console.warn('"field" patch must use input, select, or textarea tag');let c={onBlur:()=>i.setTouched(),ariaInvalid:m=>!!i.message("error",m)||void 0,dataStatus:m=>i.status(m)};n==="input"&&a==="checkbox"?(c.checked=i.value(),c.onChange=m=>i.setValue(m.target.checked)):n==="input"&&a==="radio"?c.onChange=m=>i.setValue(m.target.value):n==="select"?(c.value=i.value(),c.onChange=m=>i.setValue(m.target.value)):n==="textarea"?(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)):(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)),r.merge(c)}}}function Zr(e){return!!e&&typeof e.then=="function"}var Pe=class{constructor(t,r){this._notifier=new ce;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=t,this._initValue=t,this._validator=r,r&&this.validate()}value(t){return t&&this._notifier.addListener("value",t),this._value}setValue(t){this._value=t,this._notifier.notify("value",t),this._notifier.notify("dirty",t!==this._initValue),this.validate()}dirty(t){return t&&this._notifier.addListener("dirty",t),this._value!==this._initValue}touched(t){return t&&this._notifier.addListener("touched",t),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(t,r){let o=!1;t!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=t,this._initValue=t,this._notifier.notify("value",t),this._notifier.notify("dirty",!1),o=!0),r!==void 0&&r!==this._validator&&(this._validator=r,o=!0),o&&this.validate()}message(t,r){return r&&this._notifier.addListener(t,r),this._messages[t]}status(t){return t&&this._notifier.addListener("status",t),je(this._messages)}setMessages(t){let r=this._messages;this._messages=t;for(let o of["error","warning","success"])r[o]!==t[o]&&this._notifier.notify(o,t[o]);je(r)!==je(t)&&this._notifier.notify("status",je(t))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let t=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let r=this._validator(this._value);Zr(r)?(this._pending=!0,Promise.resolve(r).then(o=>{t===this._validationToken&&(this._pending=!1,this.setMessages(o!=null?o:{}))}).catch(o=>{t===this._validationToken&&(this._pending=!1,console.error(o))})):(this._pending=!1,this.setMessages(r!=null?r:{}))}catch(r){t===this._validationToken&&(this._pending=!1),console.error(r)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function je(e){if(e.error)return"error";if(e.warning)return"warning";if(e.success)return"success"}var ft=class{constructor(){this.fields=new Map}setField(t,r,o){let i=this.fields.get(t);return i?i.configure(r,o):(i=new Pe(r,o),this.fields.set(t,i)),i}getField(t){return this.setField(t)}removeField(t){var r;(r=this.fields.get(t))==null||r._dispose(),this.fields.delete(t)}get valid(){for(let t of this.fields.values())if(t._pending||t._messages.error)return!1;return!0}reset(){for(let t of this.fields.values())t.reset()}snapshot(){let t={};for(let[r,o]of this.fields)Qr(t,r,o._value);return t}_dispose(){for(let t of this.fields.values())t._dispose();this.fields.clear()}};function Qr(e,t,r){let o=t.split("."),i=e;for(let n=0;n<o.length-1;n++){let a=o[n];i[a]==null&&(i[a]=isNaN(Number(o[n+1]))?{}:[]),i=i[a]}i[o[o.length-1]]=r}return To(ei);})();
|
|
6
6
|
//# sourceMappingURL=core-theme-ui.global.js.map
|