@domphy/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +69 -0
- package/dist/core-theme-ui.global.js +5 -0
- package/dist/core-theme-ui.global.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +422 -0
- package/dist/index.d.ts +422 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 domphy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @domphy/ui
|
|
2
|
+
|
|
3
|
+
~60 ready-to-use patches for Domphy — buttons, inputs, dialogs, tooltips, tabs, and more. Includes `@domphy/core` and `@domphy/theme`.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @domphy/ui
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## What is a Patch?
|
|
10
|
+
|
|
11
|
+
A Patch is a function that returns a partial element descriptor. It augments a native HTML element without wrapping or owning it. The element's own properties always win.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { ElementNode } from "@domphy/core"
|
|
15
|
+
import { themeApply } from "@domphy/theme"
|
|
16
|
+
import { button, tooltip, tabs } from "@domphy/ui"
|
|
17
|
+
|
|
18
|
+
themeApply()
|
|
19
|
+
|
|
20
|
+
const App = {
|
|
21
|
+
div: [
|
|
22
|
+
{
|
|
23
|
+
button: "Save",
|
|
24
|
+
$: [button(), tooltip({ content: "Save changes" })]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
dataTheme: "light"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
new ElementNode(App).render(document.body)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Customization via ownership
|
|
34
|
+
|
|
35
|
+
Every patch ships as readable source. To fully customize, copy the patch into your project and modify it directly — no configuration API to work around.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { toState, merge } from "@domphy/core"
|
|
39
|
+
import { themeColor, themeSpacing, themeSize } from "@domphy/theme"
|
|
40
|
+
|
|
41
|
+
// your own patch — full control
|
|
42
|
+
function myButton() {
|
|
43
|
+
return (base) => merge(base, {
|
|
44
|
+
style: {
|
|
45
|
+
fontSize: (l) => themeSize(l, "inherit"),
|
|
46
|
+
padding: `${themeSpacing(1)} ${themeSpacing(3)}`,
|
|
47
|
+
borderRadius: themeSpacing(2),
|
|
48
|
+
backgroundColor: (l) => themeColor(l, "inherit", "primary"),
|
|
49
|
+
color: (l) => themeColor(l, "shift-6", "primary"),
|
|
50
|
+
"&:hover": {
|
|
51
|
+
backgroundColor: (l) => themeColor(l, "increase-1", "primary"),
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## CDN
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<script src="https://unpkg.com/@domphy/ui/dist/core-theme-ui.global.js"></script>
|
|
62
|
+
<script>
|
|
63
|
+
const { core, theme, ui } = Domphy
|
|
64
|
+
</script>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
**[Full documentation →](https://domphy.dev/ui/)**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var Domphy=(()=>{var mt=Object.defineProperty,ao=Object.defineProperties;var co=Object.getOwnPropertyDescriptors;var ke=Object.getOwnPropertySymbols;var ft=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable;var ct=(t,e,n)=>e in t?mt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,P=(t,e)=>{for(var n in e||(e={}))ft.call(e,n)&&ct(t,n,e[n]);if(ke)for(var n of ke(e))ut.call(e,n)&&ct(t,n,e[n]);return t},L=(t,e)=>ao(t,co(e));var Ne=(t,e)=>{var n={};for(var o in t)ft.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&ke)for(var o of ke(t))e.indexOf(o)<0&&ut.call(t,o)&&(n[o]=t[o]);return n};var Be=(t,e)=>{for(var n in e)mt(t,n,{get:e[n],enumerable:!0})};var D=(t,e,n)=>new Promise((o,i)=>{var r=m=>{try{c(n.next(m))}catch(f){i(f)}},a=m=>{try{c(n.throw(m))}catch(f){i(f)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(r,a);c((n=n.apply(t,e)).next())});var nt={};Be(nt,{FieldState:()=>Ee,FormState:()=>ot,abbreviation:()=>wo,alert:()=>Vo,avatar:()=>Wo,badge:()=>Uo,blockquote:()=>Rn,breadcrumb:()=>Ko,breadcrumbEllipsis:()=>qo,button:()=>$n,buttonSwitch:()=>ui,card:()=>Co,code:()=>Ln,combobox:()=>Pn,command:()=>No,commandItem:()=>Do,commandSearch:()=>Bo,descriptionList:()=>zn,details:()=>In,dialog:()=>Mn,divider:()=>Si,drawer:()=>ki,emphasis:()=>An,field:()=>Ni,figure:()=>Nn,form:()=>Ai,formGroup:()=>Bn,heading:()=>Hn,horizontalRule:()=>Fn,icon:()=>Vn,image:()=>jn,inputCheckbox:()=>On,inputColor:()=>Wn,inputDateTime:()=>Un,inputFile:()=>Kn,inputNumber:()=>Xn,inputOTP:()=>jo,inputRadio:()=>ii,inputRange:()=>Yn,inputSearch:()=>qn,inputSwitch:()=>fi,inputText:()=>Gn,keyboard:()=>Jn,label:()=>Qn,link:()=>Zn,mark:()=>ei,menu:()=>zi,menuItem:()=>Mi,orderedList:()=>xi,pagination:()=>Ci,paragraph:()=>ti,popover:()=>Ti,popoverArrow:()=>et,preformated:()=>oi,progress:()=>ni,select:()=>ri,selectBox:()=>mi,selectItem:()=>ci,selectList:()=>ai,skeleton:()=>li,small:()=>hi,spinner:()=>si,splitter:()=>zo,splitterHandle:()=>Ao,splitterPanel:()=>Mo,strong:()=>di,subscript:()=>pi,superscript:()=>gi,tab:()=>Li,tabPanel:()=>Ii,table:()=>yi,tabs:()=>Oi,tag:()=>ge,textarea:()=>bi,toast:()=>_i,toggle:()=>Ho,toggleGroup:()=>Fo,tooltip:()=>Ri,transitionGroup:()=>$i,unorderedList:()=>vi});var je={};Be(je,{contextColor:()=>xo,createDark:()=>pt,getTheme:()=>he,setTheme:()=>ho,themeApply:()=>go,themeCSS:()=>De,themeColor:()=>s,themeName:()=>Fe,themeSize:()=>d,themeSpacing:()=>l,themeTokens:()=>po,themeVars:()=>ue});var mo={direction:"darken",colors:{highlight:["#ffffff","#fcf4d6","#fddc69","#f1c21b","#d2a106","#b28600","#8e6a00","#684e00","#483700","#302400","#1c1500","#000000"],warning:["#ffffff","#fff2e8","#ffd9be","#ffb784","#ff832b","#eb6200","#ba4e00","#8a3800","#5e2900","#3e1a00","#231000","#000000"],error:["#ffffff","#fff1f1","#ffd7d9","#ffb3b8","#ff8389","#fa4d56","#da1e28","#a2191f","#750e13","#520408","#2d0709","#000000"],danger:["#ffffff","#fff1f1","#ffd7d9","#ffb3b8","#ff8389","#fa4d56","#da1e28","#a2191f","#750e13","#520408","#2d0709","#000000"],secondary:["#ffffff","#fff0f7","#ffd6e8","#ffafd2","#ff7eb6","#ee5396","#d02670","#9f1853","#740937","#510224","#2a0a18","#000000"],primary:["#ffffff","#edf5ff","#d0e2ff","#a6c8ff","#78a9ff","#4589ff","#0f62fe","#0043ce","#002d9c","#001d6c","#001141","#000000"],info:["#ffffff","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d","#012749","#061727","#000000"],success:["#ffffff","#defbe6","#a7f0ba","#6fdc8c","#42be65","#24a148","#198038","#0e6027","#044317","#022d0d","#071908","#000000"],neutral:["#ffffff","#f4f4f4","#e0e0e0","#c6c6c6","#a8a8a8","#8d8d8d","#6f6f6f","#525252","#393939","#262626","#161616","#000000"]},baseTones:{highlight:3,warning:4,error:5,secondary:5,primary:6,info:5,success:5,neutral:5},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],custom:{}},_e=mo,re={light:JSON.parse(JSON.stringify(_e)),dark:pt(_e)};function fo(t){for(let e in t)if(!Object.keys(_e).includes(e))throw new Error(`Invalid key: ${e}`);if(t.fontSizes&&!Array.isArray(t.fontSizes))throw new Error("fontSize must be array of string");if("custom"in t){let e=t.custom;if(typeof e!="object"||e===null)throw new Error("Invalid custom property: must be an object")}}function dt(t,e){var n;for(let o in e)e[o]&&typeof e[o]=="object"&&!Array.isArray(e[o])?((n=t[o])!=null||(t[o]={}),dt(t[o],e[o])):t[o]=e[o]}function uo(t,e){let n={};for(let i in e){let r=e[i];if(i==="colors")for(let a in e.colors)[...Array(12).keys()].forEach(c=>n[`--${a}-${c}`]=e.colors[a][c]);else if(i==="fontSizes")[...Array(8).keys()].forEach(a=>n[`--fontSize-${a}`]=e.fontSizes[a]);else if(typeof r=="object"&&r!==null)for(let a in r)n[`--${i}-${a.replace("/","_")}`]=r[a]}let o="";for(let i in n)o+=` ${i}: ${n[i]};
|
|
2
|
+
`;return`[data-theme="${t}"] {
|
|
3
|
+
${o}}`}function he(t){if(!re[t])throw Error(`Theme "${t}" not found`);return re[t]}function ho(t,e){fo(e),re[t]||(re[t]=structuredClone(_e)),dt(re[t],e)}function pt(t){let e=structuredClone(t);e.direction="lighten";for(let n in e.colors)e.colors[n].reverse(),e.baseTones[n]=11-e.baseTones[n];return e}function po(t){let e=he(t),n={};for(let o in e){let i=e[o];if(o==="colors")for(let r in e.colors){let a={};[...Array(12).keys()].forEach(c=>a[c]=e.colors[r][c]),n[r]=a}else if(o==="fontSizes")n.fontSizes=e.fontSizes;else if(n[o]={},typeof i=="object"&&i!==null)for(let r in i)n[o][r]=i[r]}return n}function ue(){let t=he("light"),e={};for(let n in t){let o=n,i=t[n];if(n==="colors")for(let r in t.colors){let a={};[...Array(12).keys()].forEach(c=>a[c]=`var(--${r}-${c})`),e[r]=a}else if(n==="fontSizes")e.fontSizes=[...Array(8).keys()].map(r=>`var(--fontSize-${r})`);else if(e[o]={},typeof i=="object"&&i!==null)for(let r in i)e[o][r]=`var(--${o}-${r.replace("/","_")})`}return e}function De(){return Object.entries(re).map(([t,e])=>uo(t,e)).join(`
|
|
4
|
+
`)}function go(t){var e;if(typeof document!="undefined")if(t){t.textContent=De();return}else t=(e=document.getElementById("domphy-themes"))!=null?e:Object.assign(document.createElement("style"),{id:"domphy-themes"}),t.textContent=De(),document.head.appendChild(t)}function l(t){return t/4+"em"}function Fe(t){let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataTheme"));)e=e.parent;let n="light";return e.attributes&&e.attributes.has("dataTheme")&&(n=e.attributes.get("dataTheme"),typeof t=="function"&&e.attributes.onChange("dataTheme",t)),n}var He=["inherit"];[...Array(8).keys()].forEach(t=>{He.push(`decrease-${t}`),He.push(`increase-${t}`)});function gt(t,e="inherit"){if(!He.includes(e))throw Error(`size name "${e}" invalid`);let n;if(e=="inherit")n=t;else if(e!=null&&e.startsWith("increase-")){let o=parseInt(e.replace("increase-",""),10);n=t+o}else if(e!=null&&e.startsWith("decrease-")){let o=parseInt(e.replace("decrease-",""),10);n=t-o}else n=t;return Math.max(0,Math.min(8,n))}function yo(t){if(!t)return 2;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataSize"));)e=e.parent;let n=2;return e&&e.attributes&&e.attributes.has("dataSize")&&(n=gt(n,e.attributes.get("dataSize")),typeof t=="function"&&e.attributes.onChange("dataSize",t)),n}function d(t,e="inherit"){let n=gt(yo(t),e);return ue().fontSizes[n]}var le=12,Te=["inherit","base"];[...Array(le).keys()].forEach(t=>{Te.push(`decrease-${t}`),Te.push(`increase-${t}`),Te.push(`shift-${t}`)});function ht(t,e){if(t<0||t>le-1)return t;let n=t+e;return n=Math.max(0,Math.min(le-1,n)),n}function bo(t,e){if(t<0||t>le-1)return t;let n=t<=5?t+e:t-e;return n=n<0||n>le-1?-n:n,n=Math.max(0,Math.min(le-1,n)),n}function Pe(t,e="inherit"){if(typeof e=="number")return e;if(e=="inherit")return t;if(!Te.includes(e))throw Error(`tone name "${e}" invalid`);if(e.startsWith("increase-")){let n=parseInt(e.replace("increase-",""),10);return ht(t,n)}else if(e.startsWith("decrease-")){let n=parseInt(e.replace("decrease-",""),10);return ht(t,-n)}else if(e.startsWith("shift-")){let n=parseInt(e.replace("shift-",""),10);return bo(t,n)}else return t}function yt(t){if(!t)return 0;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataTone"));)e=e.parent;let n=0;return e&&e.attributes&&e.attributes.has("dataTone")&&(n=Pe(n,e.attributes.get("dataTone")),typeof t=="function"&&e.attributes.onChange("dataTone",t)),n}function vo(t,e="inherit"){return Pe(yt(t),e)}function xo(t,e="inherit",n="inherit"){let o=typeof t=="function"?t.elementNode:t,i=n=="inherit"?o.getContext("themeColor")||"neutral":n,r;return e=="base"?r=he(Fe(t)).baseTones[i]:r=Pe(yt(t),e),ue()[i][r]}function s(t,e="inherit",n="inherit"){let o=n=="inherit"?"neutral":n;if(!t)return ue()[o][Pe(0,e)];let i;return e=="base"?i=he(Fe(t)).baseTones[o]:i=vo(t,e),ue()[o][i]}function wo(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{color:o=>s(o,"shift-7",e),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:o=>s(o,"shift-4",e),textUnderlineOffset:l(.72),cursor:"help","&:hover":{color:o=>s(o,"shift-8",n),textDecorationColor:o=>s(o,"shift-6",n)}}}}function Co(t={}){let{color:e="neutral"}=t;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:l(2),backgroundColor:n=>s(n,"inherit",e),color:n=>s(n,"shift-7",e),outline:n=>`1px solid ${s(n,"shift-3",e)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:l(2),paddingInline:l(4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:l(4),color:n=>s(n,"shift-6",e),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:l(2),height:"auto"},"& > div":{gridArea:"content",padding:l(4),color:n=>s(n,"shift-7",e)},"& > footer":{gridArea:"footer",display:"flex",gap:l(2),paddingBlock:l(2),paddingInline:l(4),borderTop:n=>`1px solid ${s(n,"shift-2",e)}`}}}}var qe={};Be(qe,{AttributeList:()=>St,BooleanAttributes:()=>Ke,CamelAttributes:()=>Ct,ElementList:()=>Et,ElementNode:()=>O,HtmlTags:()=>Ue,Notifier:()=>pe,PrefixCSS:()=>Y,State:()=>Ve,VoidTags:()=>$o,hashString:()=>J,merge:()=>E,toState:()=>w});var So=["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"],Eo=So.reduce((t,e)=>{let n=e.slice(2).toLowerCase();return t[n]=e,t},{}),Ue=["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"],pe=class{constructor(){this._listeners={}}_dispose(){if(this._listeners)for(let t in this._listeners)this._listeners[t].clear();this._listeners=null}addListener(t,e){if(!this._listeners)return()=>{};if(typeof t!="string"||typeof e!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[t]||(this._listeners[t]=new Set);let n=()=>this.removeListener(t,e);return this._listeners[t].has(e)||(this._listeners[t].add(e),typeof e.onSubscribe=="function"&&e.onSubscribe(n)),n}removeListener(t,e){if(!this._listeners)return;let n=this._listeners[t];n&&n.has(e)&&(n.delete(e),n.size===0&&delete this._listeners[t])}notify(t,...e){if(!this._listeners)return;let n=this._listeners[t];if(n)for(let o of[...n])try{o(...e)}catch(i){console.error(i)}}},Ve=class{constructor(t){this._notifier=new pe,this.initialValue=t,this._value=t}get(t){return t&&this.onChange(t),this._value}set(t){this._notifier&&(this._value=t,this._notifier.notify("change",t))}reset(){this.set(this.initialValue)}onChange(t){return this._notifier?this._notifier.addListener("change",t):()=>{}}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function E(t={},e={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(e)==="[object Object]"&&Object.getPrototypeOf(e)===Object.prototype&&(e=X(e));for(let r in e){let a=e[r];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof t[r]=="object"?t[r]=E(t[r],a):t[r]=a;else if(n.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,u=typeof a=="function"?a(m):a;return[f,u].filter(h=>h).join(", ")}}else t[r]=[t[r],a].filter(c=>c).join(", ");else if(i.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,u=typeof a=="function"?a(m):a;return[f,u].filter(h=>h).join("")}}else t[r]=[t[r],a].filter(c=>c).join("");else if(o.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,u=typeof a=="function"?a(m):a;return[f,u].filter(h=>h).join(" ")}}else t[r]=[t[r],a].filter(c=>c).join(" ");else if(r.startsWith("on")){let c=r.replace("on","").toLowerCase();To(t,c,a)}else if(r.startsWith("_on")){let c=r.replace("_on","");ko(t,c,a)}else t[r]=a}return t}function w(t){return t instanceof Ve?t:new Ve(t)}function J(t=""){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=e*16777619>>>0;return String.fromCharCode(97+e%26)+e.toString(16)}function ko(t,e,n){let o=`_on${e}`,i=t[o];typeof i=="function"?t[o]=(...r)=>{i(...r),n(...r)}:t[o]=n}function To(t,e,n){let o=Eo[e];if(!o)throw Error(`invalid event name "${e}"`);let i=t[o];typeof i=="function"?t[o]=(r,a)=>{i(r,a),n(r,a)}:t[o]=n}function X(t,e=new WeakMap){if(t===null||typeof t!="object"||typeof t=="function")return t;if(e.has(t))return e.get(t);let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&!Array.isArray(t))return t;let o;if(Array.isArray(t)){o=[],e.set(t,o);for(let i of t)o.push(X(i,e));return o}if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if(t instanceof Map){o=new Map,e.set(t,o);for(let[i,r]of t)o.set(X(i,e),X(r,e));return o}if(t instanceof Set){o=new Set,e.set(t,o);for(let i of t)o.add(X(i,e));return o}if(ArrayBuffer.isView(t))return new t.constructor(t);if(t instanceof ArrayBuffer)return t.slice(0);o=Object.create(n),e.set(t,o);for(let i of Reflect.ownKeys(t))o[i]=X(t[i],e);return o}function vt(t,e=!1){if(Object.prototype.toString.call(t)!=="[object Object]")throw Error(`typeof ${t} is invalid DomphyElement`);let n=Object.keys(t);for(let o=0;o<n.length;o++){let i=n[o],r=t[i];if(o==0&&!Ue.includes(i)&&!i.includes("-")&&!e)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")t.$.forEach(a=>vt(a,!0));else{if(i.startsWith("_on")&&typeof r!="function")throw Error(`hook ${i} value "${r}" must be a function `);if(i.startsWith("on")&&typeof r!="function")throw Error(`event ${i} value "${r}" must be a function `);if(i=="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function _o(t){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(t.trim())}function bt(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Po(t){return Object.keys(t).find(e=>Ue.includes(e))}function xt(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ro(t){if(t.indexOf("@")===0)return[t];for(var e=[],n=0,o=0,i="",r=0,a=t.length;r<a;r++){var c=t[r];if(c==="(")n+=1;else if(c===")")n-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!n&&!o){e.push(i.trim()),i="";continue}i+=c}return e.push(i.trim()),e}var wt=t=>{if(Array.isArray(t.$)){let e={};return t.$.forEach(n=>E(e,wt(n))),delete t.$,E(e,t),e}else return t},$o=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Ke=["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"],Y={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"]},Ct=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Oo=class{constructor(t,e,n){this.parent=n,this.isBoolean=Ke.includes(t),Ct.includes(t)?this.name=t:this.name=xt(t),this.value=void 0,this.set(e)}render(){if(!this.parent||!this.parent.domElement)return;let t=this.parent.domElement,e=["value"];this.isBoolean?this.value===!1||this.value==null?t.removeAttribute(this.name):t.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?t.removeAttribute(this.name):e.includes(this.name)?t[this.name]=this.value:t.setAttribute(this.name,this.value)}set(t){if(t==null){this.value=null,this.render();return}if(typeof t=="string"&&/<\/?[a-z][\s\S]*>/i.test(t))this.value=bt(t);else if(typeof t=="function"){let e=()=>{e&&(this.value=this.isBoolean?!!t():t(),this.render())};e.elementNode=this.parent,e.onSubscribe=n=>{this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),e=null})},this.value=this.isBoolean?!!t(e):t(e)}else this.value=this.isBoolean?!!t:t;this.render()}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this.value=null,this.parent=null}generateHTML(){let{name:t,value:e}=this;if(this.isBoolean)return e?`${t}`:"";{let n=Array.isArray(e)?JSON.stringify(e):e;return`${t}="${bt(String(n))}"`}}},St=class{constructor(t){this._notifier=new pe,this.items={},this.parent=t}generateHTML(){if(!this.items)return"";let t=Object.values(this.items).map(e=>e.generateHTML()).join(" ");return t?` ${t}`:""}get(t){var e;if(this.items)return(e=this.items[t])==null?void 0:e.value}set(t,e){!this.items||!this.parent||(this.items[t]?(this.items[t].set(e),this.parent.domElement&&this._notifier.notify(t,this.items[t].value)):this.items[t]=new Oo(t,e,this.parent))}onChange(t,e){var n;if(this.has(t)&&(n=this.parent)!=null&&n.domElement){let o=e;o.onSubscribe=i=>{var r;return(r=this.parent)==null?void 0:r.addHook("BeforeRemove",i)},this._notifier.addListener(t,o)}}has(t){return this.items?Object.prototype.hasOwnProperty.call(this.items,t):!1}remove(t){this.items&&(this.items[t]&&(this.items[t]._dispose(),delete this.items[t]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(t))}_dispose(){if(this.items)for(let t in this.items)this.items[t]._dispose();this._notifier._dispose(),this.items=null,this.parent=null}toggle(t,e){if(!Ke.includes(t))throw Error(`${t} is not a boolean attribute`);e===!0?this.set(t,!0):e===!1?this.remove(t):this.has(t)?this.remove(t):this.set(t,!0)}addClass(t){if(!t||typeof t!="string")return;let e=(o,i)=>{let r=(o||"").split(" ").filter(a=>a);return!r.includes(i)&&r.push(t),r.join(" ")},n=this.get("class");typeof n=="function"?this.set("class",()=>e(n(),t)):this.set("class",e(n,t))}hasClass(t){return!t||typeof t!="string"?!1:(this.get("class")||"").split(" ").filter(e=>e).includes(t)}toggleClass(t){!t||typeof t!="string"||(this.hasClass(t)?this.removeClass(t):this.addClass(t))}removeClass(t){if(!t||typeof t!="string")return;let e=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==t);e.length>0?this.set("class",e.join(" ")):this.remove("class")}replaceClass(t,e){!t||!e||typeof t!="string"||typeof e!="string"||this.hasClass(t)&&(this.removeClass(t),this.addClass(e))}},Lo=class{constructor(t,e){this.type="TextNode",this.parent=e,this.text=t===""?"\u200B":String(t)}_createDOMNode(){let t;if(_o(this.text)){let e=document.createElement("template");e.innerHTML=this.text.trim(),t=e.content.firstChild||document.createTextNode("")}else t=document.createTextNode(this.text);return this.domText=t,t}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"​":this.text}render(t){let e=this._createDOMNode();t.appendChild(e)}},Et=class{constructor(t){this.items=[],this.owner=t}_createNode(t,e=0){return typeof t=="object"&&t!==null?new O(t,this.owner,e):new Lo(t==null?"":String(t),this.owner)}_moveDomElement(t,e){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=t instanceof O?t.domElement:t.domText;if(o){let i=n.childNodes[e]||null;o!==i&&n.insertBefore(o,i)}}_swapDomElement(t,e){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=t instanceof O?t.domElement:t.domText,i=e instanceof O?e.domElement:e.domText;if(!o||!i)return;let r=o.nextSibling,a=i.nextSibling;n.insertBefore(o,a),n.insertBefore(i,r)}update(t,e=!0,n=!1){var o,i,r,a;let c=this.items.slice(),m=new Map;for(let f of c)f instanceof O&&f.key!==null&&f.key!==void 0&&m.set(f.key,f);!n&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,t));for(let f=0;f<t.length;f++){let u=t[f],h=typeof u=="object"&&u!==null?u._key:void 0;if(h!==void 0){let p=m.get(h);if(p){m.delete(h);let g=this.items.indexOf(p);if(g!==f&&g>=0){let y=p instanceof O&&!!p._portal;this.move(g,f,y?!1:e,!0)}p.parent=this.owner;continue}}this.insert(u,f,e,!0)}for(;this.items.length>t.length;)this.remove(this.items[this.items.length-1],e,!0);m.forEach(f=>this.remove(f,e,!0)),n||(a=(r=this.owner._hooks)==null?void 0:r.Update)==null||a.call(r,this.owner)}insert(t,e,n=!0,o=!1){var i,r;let a=this.items.length,c=typeof e!="number"||isNaN(e)||e<0||e>a?a:e,m=this._createNode(t,c);if(this.items.splice(c,0,m),m instanceof O){m._hooks.Insert&&m._hooks.Insert(m);let f=this.owner.domElement;if(n&&f)if(m._portal){let u=m._portal(this.owner.getRoot());u&&m.render(u)}else{let u=m._createDOMNode(),h=(i=f.childNodes[c])!=null?i:null;f.insertBefore(u,h);let p=f.getRootNode(),g=(p instanceof ShadowRoot?p:document.head).querySelector("#domphy-style");m.styles.render(g),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(y=>{if(y instanceof O&&y._portal){let v=y._portal(y.getRoot());v&&y.render(v)}else y.render(u)})}}else{let f=this.owner.domElement;if(n&&f){let u=m._createDOMNode(),h=(r=f.childNodes[c])!=null?r:null;f.insertBefore(u,h)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(t,e=!0,n=!1){let o=this.items.indexOf(t);if(!(o<0)){if(t instanceof O){let i=()=>{var r,a;let c=t.domElement;this.items.splice(o,1),e&&c&&c.remove(),(a=(r=t._hooks)==null?void 0:r.Remove)==null||a.call(r,t),t._dispose()};t._hooks&&t._hooks.BeforeRemove&&t.domElement?t._hooks.BeforeRemove(t,i):i()}else{let i=t.domText;this.items.splice(o,1),e&&i&&i.remove(),t._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(t=!0,e=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,t,!0);!e&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items=[]}swap(t,e,n=!0,o=!1){if(t<0||e<0||t>=this.items.length||e>=this.items.length||t===e)return;let i=this.items[t],r=this.items[e];this.items[t]=r,this.items[e]=i,n&&this._swapDomElement(i,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(t,e,n=!0,o=!1){if(t<0||t>=this.items.length||e<0||e>=this.items.length||t===e)return;let i=this.items[t];this.items.splice(t,1),this.items.splice(e,0,i),n&&this._moveDomElement(i,e),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let t="";for(let e of this.items)t+=e.generateHTML();return t}},Io=class{constructor(t,e,n){this.value="",this.name=t,this.cssName=xt(t),this.parentRule=n,this.set(e)}_domUpdate(){if(!this.parentRule)return;let t=this.parentRule.domRule;if(t&&t.style){let e=t.style;e.setProperty(this.cssName,String(this.value)),Y[this.name]&&Y[this.name].forEach(n=>{e.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(t){if(typeof t=="function"){let e=()=>{e&&(this.value=t(e),this._domUpdate())};e.onSubscribe=n=>{var o;(o=this.parentRule.parentNode)==null||o.addHook("BeforeRemove",()=>{n(),e=null})},e.elementNode=this.parentRule.root,this.value=t(e)}else this.value=t;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let t=this.parentRule.domRule.style;t.removeProperty(this.cssName),Y[this.name]&&Y[this.name].forEach(e=>{t.removeProperty(`-${e}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let t=`${this.cssName}: ${this.value}`;return Y[this.name]&&Y[this.name].forEach(e=>{t+=`; -${e}-${this.cssName}: ${this.value}`}),t}},G=class We{constructor(e,n){this.domRule=null,this.styleBlock={},this.selectorText=e,this.styleList=new kt(this),this.parent=n}_dispose(){if(this.styleBlock)for(let e of Object.values(this.styleBlock))e._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let e=this.parent;for(;e instanceof We;)e=e.parent;return e}get parentNode(){let e=this.parent;for(;e&&e instanceof We;)e=e.parent;return e}insertStyle(e,n){this.styleBlock&&(this.styleBlock[e]?this.styleBlock[e].set(n):this.styleBlock[e]=new Io(e,n,this))}removeStyle(e){this.styleBlock&&this.styleBlock[e]&&this.styleBlock[e].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let e=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${e} ${n} } `}mount(e){!e||!this.styleList||(this.domRule=e,"cssRules"in e&&this.styleList.mount(e.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let e=this.domRule.parentStyleSheet,n=e.cssRules;for(let o=0;o<n.length;o++)if(n[o]===this.domRule){e.deleteRule(o);break}}this._dispose()}render(e){if(!this.styleBlock||!this.styleList)return;let n=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=e.insertRule(`${this.selectorText} {}`,e.cssRules.length),i=e.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=e.insertRule(o,e.cssRules.length),r=e.cssRules[i];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,i=e.insertRule(o,e.cssRules.length),r=e.cssRules[i];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},kt=class{constructor(t){this.items=[],this.domStyle=null,this.parent=t}get parentNode(){let t=this.parent;for(;t&&t instanceof G;)t=t.parent;return t}addCSS(t,e=""){if(!this.items||!this.parent)return;let n={};function o(i,r){return i.startsWith("&")?`${r}${i.slice(1)}`:`${r} ${i}`}for(let i in t){let r=t[i],a=Ro(i);for(let c of a){let m=o(c,e);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof r=="object"&&r!=null){let f=new G(c,this.parent);f.styleList.addCSS(r,e),this.items.push(f)}}else if(c.startsWith("@keyframes")){let f=new G(c,this.parent);f.styleList.addCSS(r,""),this.items.push(f)}else if(c.startsWith("@font-face")){let f=new G(c,this.parent);for(let u in r)f.insertStyle(u,r[u]);this.items.push(f)}else if(typeof r=="object"&&r!=null){let f=new G(m,this.parent);this.items.push(f);for(let[u,h]of Object.entries(r))if(typeof h=="object"&&h!=null){let p=o(u,m);u.startsWith("&")?this.addCSS(h,p):f.styleList.insertRule(p).styleList.addCSS(h,p)}else f.insertStyle(u,h)}else n[c]=r}}if(Object.keys(n).length){let i=new G(e,this.parent);for(let r in n)i.insertStyle(r,n[r]);this.items.push(i)}}cssText(){return this.items?this.items.map(t=>t.cssText()).join(""):""}insertRule(t){if(!this.items||!this.parent)return null;let e=this.items.find(n=>n.selectorText===t);return e||(e=new G(t,this.parent),this.items.push(e)),e}mount(t){if(!this.items)return;if(!t)throw Error("Require domRuleList argument");let e=0,n=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let r=i-e,a=t[r];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==n(o.selectorText)?e+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(t){t instanceof HTMLStyleElement?(this.domStyle=t,this.items.forEach(e=>e.render(t.sheet))):t instanceof CSSGroupingRule&&this.items.forEach(e=>e.render(t))}_dispose(){if(this.items)for(let t=0;t<this.items.length;t++)this.items[t]._dispose();this.items=[],this.parent=null,this.domStyle=null}},O=class de{constructor(e,n=null,o=0){this.type="ElementNode",this.parent=null,this.children=new Et(this),this.styles=new kt(this),this.attributes=new St(this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.key=null;var i,r;e=X(e),vt(e),e.style=e.style||{},this.parent=n,this.tagName=Po(e),e=wt(e),this.key=(i=e._key)!=null?i:null,this._context=e._context||{},this._metadata=e._metadata||{};let a=`${(r=this.parent)==null?void 0:r.getPath()}.${o}`,c=JSON.stringify(e.style||{},(f,u)=>typeof u=="function"?a:u);this.nodeId=J(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),e._onSchedule&&e._onSchedule(this,e),this.merge(e);let m=e[this.tagName];if(m!=null&&m!=null)if(typeof m=="function"){let f=()=>{let u=m(f);this.children.update(Array.isArray(u)?u:[u])};f.elementNode=this,f.onSubscribe=u=>this.addHook("BeforeRemove",()=>{u(),f=null}),f&&f()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let e=["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"].includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=e,this._events)for(let n in this._events){let o=n,i=this._events[o],r=a=>i(a,this);e.addEventListener(o,r),this.addHook("BeforeRemove",a=>{a.domElement.removeEventListener(o,r),r=null})}return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),e}_dispose(){this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(e=>e.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null}get pathId(){return J(this.getPath())}merge(e){E(this._context,e._context),E(this._metadata,e._metadata);let n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],r=e[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),r):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),r):i=="_portal"?this._portal=r:i=="class"&&typeof r=="string"?this.attributes.addClass(r):this.attributes.set(i,r))}e.style&&this.styles.addCSS(e.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}getPath(){let e=[],n=this;for(;n&&n.parent;){let o=n.parent,i=o.children.items.indexOf(n);e.push(i),n=o}return e.reverse().join(".")}addEvent(e,n){this._events=this._events||{};let o=this._events[e];typeof o=="function"?this._events[e]=(i,r)=>{o(i,r),n(i,r)}:this._events[e]=n}addHook(e,n){let o=this._hooks[e];typeof o=="function"?this._hooks[e]=((...i)=>{o(...i),n(...i)}):this._hooks[e]=n}getRoot(){let e=this;for(;e&&e instanceof de&&e.parent;)e=e.parent;return e}getContext(e){let n=this;for(;n&&(!n._context||!Object.prototype.hasOwnProperty.call(n._context,e));)n=n.parent;return n&&n._context?n._context[e]:void 0}setContext(e,n){this._context=this._context||{},this._context[e]=n}getMetadata(e){return this._metadata?this._metadata[e]:void 0}setMetadata(e,n){this._metadata=this._metadata||{},this._metadata[e]=n}generateCSS(){if(!this.styles||!this.children)return"";let e=this.styles.cssText();return e+=this.children.items.map(n=>n instanceof de?n.generateCSS():"").join(""),e}generateHTML(){if(!this.children||!this.attributes)return"";let e=this.children.generateHTML(),n=this.attributes.generateHTML();return`<${this.tagName}${n}>${e}</${this.tagName}>`}mount(e,n){if(!e)throw new Error("Missing dom node on bind");if(this.domElement=e,this._events)for(let o in this._events){let i=o,r=this._events[i],a=c=>r(c,this);e.addEventListener(i,a),this.addHook("BeforeRemove",c=>{c.domElement.removeEventListener(i,a),a=null})}this.children&&this.children.items.forEach((o,i)=>{let r=e.childNodes[i];r instanceof Node&&o instanceof de&&o.mount(r,n)}),this._hooks.Mount&&this._hooks.Mount(this)}render(e,n=null){let o=this._createDOMNode();e.appendChild(o),this._hooks.Mount&&this._hooks.Mount(this),n||(n=this.getRoot().styles.domStyle);let i=e.getRootNode(),r=i instanceof ShadowRoot?i:document.head;return n||(n=r.querySelector("#domphy-style")),n||(n=document.createElement("style"),n.id="domphy-style",r.appendChild(n)),this.styles.render(n),this.children.items.forEach(a=>{if(a instanceof de&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(o)}),o}remove(){var e;this.parent?this.parent.children.remove(this):((e=this.domElement)==null||e.remove(),this._dispose())}};function zo(t={}){let{direction:e="horizontal",defaultSize:n=50,min:o=10,max:i=90}=t;return{_onSchedule:(r,a)=>{E(a,{_context:{splitter:{direction:e,size:w(n),min:o,max:i}}})},style:{display:"flex",flexDirection:e==="horizontal"?"row":"column",overflow:"hidden"}}}function Mo(){return{_onMount:t=>{let e=t.getContext("splitter"),n=t.domElement,o=e.direction==="horizontal"?"width":"height";n.style[o]=`${e.size.get()}%`,n.style.flexShrink="0",n.style.overflow="auto";let i=e.size.onChange(r=>{n.style[o]=`${r}%`});t.addHook("Remove",i)}}}function Ao(){return{_onMount:t=>{let e=t.getContext("splitter"),n=t.domElement,o=e.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize";let i=r=>{r.preventDefault();let a=n.parentElement,c=f=>{let u=a.getBoundingClientRect(),h=o?(f.clientX-u.left)/u.width*100:(f.clientY-u.top)/u.height*100;e.size.set(Math.min(Math.max(h,e.min),e.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};n.addEventListener("mousedown",i),t.addHook("Remove",()=>n.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t=>s(t,"shift-2"),"&:hover":{backgroundColor:t=>s(t,"shift-3")},"&::after":{content:'""',borderRadius:l(999),backgroundColor:t=>s(t,"shift-4")}}}}function No(){return{_onSchedule:(t,e)=>{E(e,{_context:{command:{query:w("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Bo(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command"),r=o.domElement,a=()=>i.query.set(r.value);r.addEventListener("input",a),o.addHook("Remove",()=>r.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),paddingInline:l(3),paddingBlock:l(2),border:"none",borderBottom:o=>`1px solid ${s(o,"shift-2",e)}`,outline:"none",color:o=>s(o,"shift-7",e),backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-4")},"&:focus-visible":{borderBottomColor:o=>s(o,"shift-5",n)}}}}function Do(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{role:"option",_onMount:o=>{var m,f;let i=o.getContext("command"),r=o.domElement,a=(f=(m=r.textContent)==null?void 0:m.toLowerCase())!=null?f:"",c=i.query.onChange(u=>{r.hidden=u.length>0&&!a.includes(u.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>d(o,"inherit"),height:l(8),paddingInline:l(3),border:"none",outline:"none",color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),"&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-1",e)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`,outlineOffset:`-${l(.5)}`}}}}function Ho(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{role:"button",_onInsert:o=>{var m;o.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let i=o.getContext("toggleGroup"),a=((m=o.parent)==null?void 0:m.children.items).filter(f=>f.type==="ElementNode"&&f.attributes.get("role")==="button"),c=String(a.findIndex(f=>f===o));o.attributes.set("ariaPressed",f=>{let u=i.value.get(f);return Array.isArray(u)?u.includes(c):u===c}),o.addEvent("click",()=>{let f=i.value.get();if(i.multiple){let u=Array.isArray(f)?[...f]:[];i.value.set(u.includes(c)?u.filter(h=>h!==c):[...u,c])}else i.value.set(f===c?"":c)})},style:{cursor:"pointer",fontSize:o=>d(o,"inherit"),height:l(6),paddingBlock:l(1),paddingInline:l(2),border:"none",borderRadius:l(1),color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-1",e)},"&[aria-pressed=true]":{backgroundColor:o=>s(o,"shift-1",e)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`,outlineOffset:`-${l(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Fo(t={}){var o;let{multiple:e=!1,color:n="neutral"}=t;return{role:"group",dataTone:"shift-1",_context:{toggleGroup:{value:w((o=t.value)!=null?o:e?[]:""),multiple:e}},style:{display:"flex",paddingBlock:l(1),paddingInline:l(1),gap:l(1),borderRadius:l(2),fontSize:i=>d(i,"inherit"),backgroundColor:i=>s(i,"inherit",n),outline:i=>`1px solid ${s(i,"shift-1",n)}`,outlineOffset:"-1px"}}}function jo(){return{style:{display:"flex",alignItems:"center",gap:l(2),"& > *":{minWidth:l(8)+"!important"}},_onMount:t=>{let e=t.domElement,n=()=>Array.from(e.querySelectorAll("input")),o=a=>{let c=n(),m=a.target,f=c.indexOf(m);m.value&&f<c.length-1&&c[f+1].focus()},i=a=>{let c=n(),m=a.target,f=c.indexOf(m);a.key==="Backspace"&&!m.value&&f>0&&c[f-1].focus(),a.key==="ArrowLeft"&&f>0&&c[f-1].focus(),a.key==="ArrowRight"&&f<c.length-1&&c[f+1].focus()},r=a=>{var h,p,g;a.preventDefault();let c=(p=(h=a.clipboardData)==null?void 0:h.getData("text"))!=null?p:"",m=n(),f=m.indexOf(a.target);[...c].forEach((y,v)=>{m[f+v]&&(m[f+v].value=y)});let u=Math.min(f+c.length-1,m.length-1);(g=m[u])==null||g.focus()};e.addEventListener("input",o),e.addEventListener("keydown",i),e.addEventListener("paste",r),t.addHook("Remove",()=>{e.removeEventListener("input",o),e.removeEventListener("keydown",i),e.removeEventListener("paste",r)})}}}function Vo(t={}){let{color:e="primary"}=t;return{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:l(3),paddingBlock:l(2),paddingInline:l(4),boxShadow:n=>`inset ${l(1)} 0 0 0 ${s(n,"shift-5",e)}`,backgroundColor:n=>s(n,"shift-1",e),color:n=>s(n,"shift-7",e),fontSize:n=>d(n,"inherit")}}}function Wo(t={}){let{color:e="primary"}=t;return{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:l(8),height:l(8),fontSize:n=>d(n,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:n=>s(n,"shift-3",e),color:n=>s(n,"shift-8",e),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function Uo(t={}){let{color:e="danger",label:n=999}=t,o=w(n);return{style:{position:"relative","&::after":{content:i=>`"${o.get(i)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:l(1),minWidth:l(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:i=>d(i,"decrease-1"),borderRadius:l(999),backgroundColor:i=>s(i,"shift-6",e),color:i=>s(i,"shift-0",e)}}}}function Ko(t={}){let{color:e="neutral",separator:n="/"}=t;return{_onInsert:o=>{o.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:o=>d(o,"inherit"),gap:l(1),color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),"& > *":{display:"inline-flex",alignItems:"center",color:o=>s(o,"shift-5",e)},"& > *:not(:last-child)::after":{content:`"${n}"`,color:o=>s(o,"shift-3",e),paddingInlineStart:l(1)},"& > [aria-current=page]":{color:o=>s(o,"shift-7",e),pointerEvents:"none"}}}}function qo(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>d(n,"inherit"),paddingInline:l(1),border:"none",background:"none",cursor:"pointer",color:n=>s(n,"shift-5",e),borderRadius:l(1),"&:hover":{color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"shift-1",e)},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-5",e)}`,outlineOffset:l(.5)}}}}var Go='<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 ge(t={}){let{color:e="neutral",removable:n=!1}=t;return{dataTone:"shift-1",_onInit:o=>{let i={span:Go,onClick:r=>{r.stopPropagation(),o.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:l(1),width:l(4),height:l(4),flexShrink:0,"&:hover":{backgroundColor:r=>s(r,"shift-3",e)}}};n&&o.children.insert(i)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:l(6),paddingBlock:"0px",borderRadius:l(1),paddingInlineStart:l(2),paddingInlineEnd:n?l(1):l(2),gap:l(2),fontSize:o=>d(o,"inherit"),backgroundColor:o=>s(o,"inherit",e),color:o=>s(o,"shift-6",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`}}}var se=Math.min,H=Math.max,be=Math.round,ve=Math.floor,A=t=>({x:t,y:t}),Yo={left:"right",right:"left",bottom:"top",top:"bottom"},Xo={start:"end",end:"start"};function Ge(t,e,n){return H(t,se(e,n))}function xe(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function we(t){return t.split("-")[1]}function Ye(t){return t==="x"?"y":"x"}function Xe(t){return t==="y"?"height":"width"}var Jo=new Set(["top","bottom"]);function F(t){return Jo.has(W(t))?"y":"x"}function Je(t){return Ye(F(t))}function Pt(t,e,n){n===void 0&&(n=!1);let o=we(t),i=Je(t),r=Xe(i),a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=ye(a)),[a,ye(a)]}function Rt(t){let e=ye(t);return[Re(t),e,Re(e)]}function Re(t){return t.replace(/start|end/g,e=>Xo[e])}var Tt=["left","right"],_t=["right","left"],Qo=["top","bottom"],Zo=["bottom","top"];function en(t,e,n){switch(t){case"top":case"bottom":return n?e?_t:Tt:e?Tt:_t;case"left":case"right":return e?Qo:Zo;default:return[]}}function $t(t,e,n,o){let i=we(t),r=en(W(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(Re)))),r}function ye(t){return t.replace(/left|right|bottom|top/g,e=>Yo[e])}function tn(t){return P({top:0,right:0,bottom:0,left:0},t)}function Ot(t){return typeof t!="number"?tn(t):{top:t,right:t,bottom:t,left:t}}function Q(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Lt(t,e,n){let{reference:o,floating:i}=t,r=F(e),a=Je(e),c=Xe(a),m=W(e),f=r==="y",u=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,p=o[c]/2-i[c]/2,g;switch(m){case"top":g={x:u,y:o.y-i.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:h};break;case"left":g={x:o.x-i.width,y:h};break;default:g={x:o.x,y:o.y}}switch(we(e)){case"start":g[a]-=p*(n&&f?-1:1);break;case"end":g[a]+=p*(n&&f?-1:1);break}return g}function It(t,e){return D(this,null,function*(){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:a,elements:c,strategy:m}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=xe(e,t),y=Ot(g),b=c[p?h==="floating"?"reference":"floating":h],x=Q(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(b))==null||n?b:b.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:m})),C=h==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,k=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),S=(yield r.isElement==null?void 0:r.isElement(k))?(yield r.getScale==null?void 0:r.getScale(k))||{x:1,y:1}:{x:1,y:1},T=Q(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:k,strategy:m}):C);return{top:(x.top-T.top+y.top)/S.y,bottom:(T.bottom-x.bottom+y.bottom)/S.y,left:(x.left-T.left+y.left)/S.x,right:(T.right-x.right+y.right)/S.x}})}var zt=(t,e,n)=>D(null,null,function*(){let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,c=r.filter(Boolean),m=yield a.isRTL==null?void 0:a.isRTL(e),f=yield a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:h}=Lt(f,o,m),p=o,g={},y=0;for(let b=0;b<c.length;b++){var v;let{name:x,fn:C}=c[b],{x:k,y:S,data:T,reset:_}=yield C({x:u,y:h,initialPlacement:o,placement:p,strategy:i,middlewareData:g,rects:f,platform:L(P({},a),{detectOverflow:(v=a.detectOverflow)!=null?v:It}),elements:{reference:t,floating:e}});u=k!=null?k:u,h=S!=null?S:h,g=L(P({},g),{[x]:P(P({},g[x]),T)}),_&&y<=50&&(y++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(f=_.rects===!0?yield a.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:h}=Lt(f,p,m)),b=-1)}return{x:u,y:h,placement:p,strategy:i,middlewareData:g}});var Mt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,fn(n){return D(this,null,function*(){var o,i;let{placement:r,middlewareData:a,rects:c,initialPlacement:m,platform:f,elements:u}=n,at=xe(t,n),{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0}=at,x=Ne(at,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let C=W(r),k=F(m),S=W(m)===m,T=yield f.isRTL==null?void 0:f.isRTL(u.floating),_=g||(S||!b?[ye(m)]:Rt(m)),$=v!=="none";!g&&$&&_.push(...$t(m,b,v,T));let it=[m,..._],oe=yield f.detectOverflow(n,x),ne=[],ie=((i=a.flip)==null?void 0:i.overflows)||[];if(h&&ne.push(oe[C]),p){let K=Pt(r,c,T);ne.push(oe[K[0]],oe[K[1]])}if(ie=[...ie,{placement:r,overflows:ne}],!ne.every(K=>K<=0)){var rt,lt;let K=(((rt=a.flip)==null?void 0:rt.index)||0)+1,Ae=it[K];if(Ae&&(!(p==="alignment"?k!==F(Ae):!1)||ie.every(M=>F(M.placement)===k?M.overflows[0]>0:!0)))return{data:{index:K,overflows:ie},reset:{placement:Ae}};let fe=(lt=ie.filter(q=>q.overflows[0]<=0).sort((q,M)=>q.overflows[1]-M.overflows[1])[0])==null?void 0:lt.placement;if(!fe)switch(y){case"bestFit":{var st;let q=(st=ie.filter(M=>{if($){let V=F(M.placement);return V===k||V==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(V=>V>0).reduce((V,so)=>V+so,0)]).sort((M,V)=>M[1]-V[1])[0])==null?void 0:st[0];q&&(fe=q);break}case"initialPlacement":fe=m;break}if(r!==fe)return{reset:{placement:fe}}}return{}})}}};var on=new Set(["left","top"]);function nn(t,e){return D(this,null,function*(){let{placement:n,platform:o,elements:i}=t,r=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=W(n),c=we(n),m=F(n)==="y",f=on.has(a)?-1:1,u=r&&m?-1:1,h=xe(e,t),{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof y=="number"&&(g=c==="end"?y*-1:y),m?{x:g*u,y:p*f}:{x:p*f,y:g*u}})}var At=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(n){return D(this,null,function*(){var o,i;let{x:r,y:a,placement:c,middlewareData:m}=n,f=yield nn(n,t);return c===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:r+f.x,y:a+f.y,data:L(P({},f),{placement:c})}})}}},Nt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,fn(n){return D(this,null,function*(){let{x:o,y:i,placement:r,platform:a}=n,C=xe(t,n),{mainAxis:c=!0,crossAxis:m=!1,limiter:f={fn:k=>{let{x:S,y:T}=k;return{x:S,y:T}}}}=C,u=Ne(C,["mainAxis","crossAxis","limiter"]),h={x:o,y:i},p=yield a.detectOverflow(n,u),g=F(W(r)),y=Ye(g),v=h[y],b=h[g];if(c){let k=y==="y"?"top":"left",S=y==="y"?"bottom":"right",T=v+p[k],_=v-p[S];v=Ge(T,v,_)}if(m){let k=g==="y"?"top":"left",S=g==="y"?"bottom":"right",T=b+p[k],_=b-p[S];b=Ge(T,b,_)}let x=f.fn(L(P({},n),{[y]:v,[g]:b}));return L(P({},x),{data:{x:x.x-o,y:x.y-i,enabled:{[y]:c,[g]:m}}})})}}};function $e(){return typeof window!="undefined"}function Z(t){return Dt(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Dt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Dt(t){return $e()?t instanceof Node||t instanceof R(t).Node:!1}function I(t){return $e()?t instanceof Element||t instanceof R(t).Element:!1}function B(t){return $e()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Bt(t){return!$e()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}var rn=new Set(["inline","contents"]);function ce(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!rn.has(i)}var ln=new Set(["table","td","th"]);function Ht(t){return ln.has(Z(t))}var sn=[":popover-open",":modal"];function Ce(t){return sn.some(e=>{try{return t.matches(e)}catch(n){return!1}})}var an=["transform","translate","scale","rotate","perspective"],cn=["transform","translate","scale","rotate","perspective","filter"],mn=["paint","layout","strict","content"];function Oe(t){let e=Le(),n=I(t)?z(t):t;return an.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||cn.some(o=>(n.willChange||"").includes(o))||mn.some(o=>(n.contain||"").includes(o))}function Ft(t){let e=j(t);for(;B(e)&&!ee(e);){if(Oe(e))return e;if(Ce(e))return null;e=j(e)}return null}function Le(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var fn=new Set(["html","body","#document"]);function ee(t){return fn.has(Z(t))}function z(t){return R(t).getComputedStyle(t)}function Se(t){return I(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function j(t){if(Z(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Bt(t)&&t.host||N(t);return Bt(e)?e.host:e}function jt(t){let e=j(t);return ee(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&ce(e)?e:jt(e)}function ae(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=jt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=R(i);if(r){let c=Ie(a);return e.concat(a,a.visualViewport||[],ce(i)?i:[],c&&n?ae(c):[])}return e.concat(i,ae(i,[],n))}function Ie(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Kt(t){let e=z(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=B(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,c=be(n)!==r||be(o)!==a;return c&&(n=r,o=a),{width:n,height:o,$:c}}function Ze(t){return I(t)?t:t.contextElement}function me(t){let e=Ze(t);if(!B(e))return A(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Kt(e),a=(r?be(n.width):n.width)/o,c=(r?be(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var un=A(0);function qt(t){let e=R(t);return!Le()||!e.visualViewport?un:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function hn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==R(t)?!1:e}function te(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Ze(t),a=A(1);e&&(o?I(o)&&(a=me(o)):a=me(t));let c=hn(r,n,o)?qt(r):A(0),m=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,u=i.width/a.x,h=i.height/a.y;if(r){let p=R(r),g=o&&I(o)?R(o):o,y=p,v=Ie(y);for(;v&&o&&g!==y;){let b=me(v),x=v.getBoundingClientRect(),C=z(v),k=x.left+(v.clientLeft+parseFloat(C.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(C.paddingTop))*b.y;m*=b.x,f*=b.y,u*=b.x,h*=b.y,m+=k,f+=S,y=R(v),v=Ie(y)}}return Q({width:u,height:h,x:m,y:f})}function ze(t,e){let n=Se(t).scrollLeft;return e?e.left+n:te(N(t)).left+n}function Gt(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ze(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function dn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",a=N(o),c=e?Ce(e.floating):!1;if(o===a||c&&r)return n;let m={scrollLeft:0,scrollTop:0},f=A(1),u=A(0),h=B(o);if((h||!h&&!r)&&((Z(o)!=="body"||ce(a))&&(m=Se(o)),B(o))){let g=te(o);f=me(o),u.x=g.x+o.clientLeft,u.y=g.y+o.clientTop}let p=a&&!h&&!r?Gt(a,m):A(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-m.scrollLeft*f.x+u.x+p.x,y:n.y*f.y-m.scrollTop*f.y+u.y+p.y}}function pn(t){return Array.from(t.getClientRects())}function gn(t){let e=N(t),n=Se(t),o=t.ownerDocument.body,i=H(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=H(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+ze(t),c=-n.scrollTop;return z(o).direction==="rtl"&&(a+=H(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:c}}var Vt=25;function yn(t,e){let n=R(t),o=N(t),i=n.visualViewport,r=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){r=i.width,a=i.height;let u=Le();(!u||u&&e==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let f=ze(o);if(f<=0){let u=o.ownerDocument,h=u.body,p=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,y=Math.abs(o.clientWidth-h.clientWidth-g);y<=Vt&&(r-=y)}else f<=Vt&&(r+=f);return{width:r,height:a,x:c,y:m}}var bn=new Set(["absolute","fixed"]);function vn(t,e){let n=te(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?me(t):A(1),a=t.clientWidth*r.x,c=t.clientHeight*r.y,m=i*r.x,f=o*r.y;return{width:a,height:c,x:m,y:f}}function Wt(t,e,n){let o;if(e==="viewport")o=yn(t,n);else if(e==="document")o=gn(N(t));else if(I(e))o=vn(e,n);else{let i=qt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Q(o)}function Yt(t,e){let n=j(t);return n===e||!I(n)||ee(n)?!1:z(n).position==="fixed"||Yt(n,e)}function xn(t,e){let n=e.get(t);if(n)return n;let o=ae(t,[],!1).filter(c=>I(c)&&Z(c)!=="body"),i=null,r=z(t).position==="fixed",a=r?j(t):t;for(;I(a)&&!ee(a);){let c=z(a),m=Oe(a);!m&&c.position==="fixed"&&(i=null),(r?!m&&!i:!m&&c.position==="static"&&!!i&&bn.has(i.position)||ce(a)&&!m&&Yt(t,a))?o=o.filter(u=>u!==a):i=c,a=j(a)}return e.set(t,o),o}function wn(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,a=[...n==="clippingAncestors"?Ce(e)?[]:xn(e,this._c):[].concat(n),o],c=a[0],m=a.reduce((f,u)=>{let h=Wt(e,u,i);return f.top=H(h.top,f.top),f.right=se(h.right,f.right),f.bottom=se(h.bottom,f.bottom),f.left=H(h.left,f.left),f},Wt(e,c,i));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function Cn(t){let{width:e,height:n}=Kt(t);return{width:e,height:n}}function Sn(t,e,n){let o=B(e),i=N(e),r=n==="fixed",a=te(t,!0,r,e),c={scrollLeft:0,scrollTop:0},m=A(0);function f(){m.x=ze(i)}if(o||!o&&!r)if((Z(e)!=="body"||ce(i))&&(c=Se(e)),o){let g=te(e,!0,r,e);m.x=g.x+e.clientLeft,m.y=g.y+e.clientTop}else i&&f();r&&!o&&i&&f();let u=i&&!o&&!r?Gt(i,c):A(0),h=a.left+c.scrollLeft-m.x-u.x,p=a.top+c.scrollTop-m.y-u.y;return{x:h,y:p,width:a.width,height:a.height}}function Qe(t){return z(t).position==="static"}function Ut(t,e){if(!B(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return N(t)===n&&(n=n.ownerDocument.body),n}function Xt(t,e){let n=R(t);if(Ce(t))return n;if(!B(t)){let i=j(t);for(;i&&!ee(i);){if(I(i)&&!Qe(i))return i;i=j(i)}return n}let o=Ut(t,e);for(;o&&Ht(o)&&Qe(o);)o=Ut(o,e);return o&&ee(o)&&Qe(o)&&!Oe(o)?n:o||Ft(t)||n}var En=function(t){return D(this,null,function*(){let e=this.getOffsetParent||Xt,n=this.getDimensions,o=yield n(t.floating);return{reference:Sn(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function kn(t){return z(t).direction==="rtl"}var Tn={convertOffsetParentRelativeRectToViewportRelativeRect:dn,getDocumentElement:N,getClippingRect:wn,getOffsetParent:Xt,getElementRects:En,getClientRects:pn,getDimensions:Cn,getScale:me,isElement:I,isRTL:kn};function Jt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _n(t,e){let n=null,o,i=N(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),r();let f=t.getBoundingClientRect(),{left:u,top:h,width:p,height:g}=f;if(c||e(),!p||!g)return;let y=ve(h),v=ve(i.clientWidth-(u+p)),b=ve(i.clientHeight-(h+g)),x=ve(u),k={rootMargin:-y+"px "+-v+"px "+-b+"px "+-x+"px",threshold:H(0,se(1,m))||1},S=!0;function T(_){let $=_[0].intersectionRatio;if($!==m){if(!S)return a();$?a(!1,$):o=setTimeout(()=>{a(!1,1e-7)},1e3)}$===1&&!Jt(f,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(T,L(P({},k),{root:i.ownerDocument}))}catch(_){n=new IntersectionObserver(T,k)}n.observe(t)}return a(!0),r}function Qt(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,f=Ze(t),u=i||r?[...f?ae(f):[],...ae(e)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),r&&x.addEventListener("resize",n)});let h=f&&c?_n(f,n):null,p=-1,g=null;a&&(g=new ResizeObserver(x=>{let[C]=x;C&&C.target===f&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(e)})),n()}),f&&!m&&g.observe(f),g.observe(e));let y,v=m?te(t):null;m&&b();function b(){let x=te(t);v&&!Jt(v,x)&&n(),v=x,y=requestAnimationFrame(b)}return n(),()=>{var x;u.forEach(C=>{i&&C.removeEventListener("scroll",n),r&&C.removeEventListener("resize",n)}),h==null||h(),(x=g)==null||x.disconnect(),g=null,m&&cancelAnimationFrame(y)}}var Zt=At;var eo=Nt,to=Mt;var oo=(t,e,n)=>{let o=new Map,i=P({platform:Tn},n),r=L(P({},i.platform),{_c:o});return zt(t,e,L(P({},i),{platform:r}))};function U(t){let{open:e=!1,placement:n="bottom"}=t,o=null,i=null,r=null,a=null,c=w(e),m=w(n),f=()=>{r&&a&&(i&&i(),i=Qt(r,a,()=>{oo(r,a,{placement:m.get(),middleware:[Zt(12),to(),eo()],strategy:"fixed"}).then(({x:v,y:b,placement:x})=>{var C;Object.assign(a.style,{left:`${v}px`,top:`${b}px`}),x!==m.get()&&m.set(x),(C=t.onPlacement)==null||C.call(t,r,a,x)})}),c.set(!0))},u=()=>{i&&i(),i=null,c.set(!1)},h=()=>{o&&clearTimeout(o),o=setTimeout(f,100)},p=()=>{o&&clearTimeout(o),o=setTimeout(u,100)},g={style:{position:"fixed",pointerEvents:"auto",visibility:v=>c.get(v)?"visible":"hidden"},_onMount:v=>a=v.domElement,_portal:v=>{let b=v.domElement.querySelector("#domphy-floating");if(!b){let x={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};b=v.children.insert(x).domElement}return b}};return E(t.content,g),{show:h,hide:p,anchorPartial:{onKeyDown:v=>v.key==="Escape"&&p(),_onSchedule:v=>{let b=null;v.getRoot().addHook("Init",x=>{b=x.children.insert(t.content)}),v.addHook("BeforeRemove",()=>{p(),o&&clearTimeout(o),b&&b.remove()})},_onMount:v=>{r=v.domElement;let b=x=>{if(!c.get()||!r||!a)return;let C=x.target;!r.contains(C)&&!a.contains(C)&&p()};v.getRoot().domElement.addEventListener("click",b),v.addHook("BeforeRemove",()=>v.getRoot().domElement.removeEventListener("click",b))}}}}function Pn(t){let{options:e=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=t,a=w(t.value),c=w(i),{show:m,hide:f,anchorPartial:u}=U({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),h={onClick:()=>!r&&f()};E(t.content,h);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:l(6),marginInlineStart:l(2),fontSize:b=>d(b,"inherit"),color:b=>s(b,"shift-6",o),backgroundColor:b=>s(b,"inherit",o)},g;t.input?(E(t.input,{onFocus:()=>m(),style:p,_key:"combobox-input"}),g=t.input):g={input:null,onFocus:()=>m(),value:b=>(a.get(b),""),style:p,_key:"combobox-input"};let y={div:b=>{let x=a.get(b),C=Array.isArray(x)?x:[x],S=e.filter(T=>C.includes(T.value)).map(T=>({span:T.label,$:[ge({color:o,removable:!0})],_key:T.value,_onRemove:_=>{let $=a.get(),oe=(Array.isArray($)?$:[$]).filter(ne=>ne!==T.value);r?a.set(oe):a.set(oe[0])}}));return S.push(g),S},style:{display:"flex",flexWrap:"wrap",gap:l(1)}},v={_onInsert:b=>{b.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:b=>b.children.insert(y),style:{minWidth:l(32),outlineOffset:"-1px",outline:b=>`1px solid ${s(b,"shift-3","neutral")}`,paddingBlock:l(1),paddingInline:l(1),borderRadius:l(2),fontSize:b=>d(b,"inherit"),color:b=>s(b,"shift-6",o),backgroundColor:b=>s(b,"inherit",o)}};return E(u,v),u}function et(t={}){let{placement:e="bottom-end",color:n="neutral",sideOffset:o=l(6),bordered:i=!0}=t,r=w(e),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=w(a[r.get()]);r.onChange(u=>c.set(a[u]));let m=u=>u.includes("start")?o:u.includes("end")?"auto":"50%",f=u=>u.includes("end")?o:u.includes("start")?"auto":"50%";return{style:{position:"relative","&::after":{content:'""',position:"absolute",width:l(1.5),height:l(1.5),backgroundColor:u=>s(u,"inherit",n),borderWidth:i?"0px":"1px",borderColor:u=>s(u,"inherit",n),borderTopStyle:u=>{let h=c.get(u);return h.includes("top")||h.includes("right")?"solid":"none"},borderBottomStyle:u=>{let h=c.get(u);return h.includes("bottom")||h.includes("left")?"solid":"none"},borderLeftStyle:u=>{let h=c.get(u);return h.includes("top")||h.includes("left")?"solid":"none"},borderRightStyle:u=>{let h=c.get(u);return h.includes("bottom")||h.includes("right")?"solid":"none"},top:u=>{let h=c.get(u);return h.includes("top")?0:h.includes("bottom")?"auto":m(h)},right:u=>{let h=c.get(u);return h.includes("right")?0:h.includes("left")?"auto":f(h)},bottom:u=>{let h=c.get(u);return h.includes("bottom")?0:h.includes("top")?"auto":f(h)},left:u=>{let h=c.get(u);return h.includes("left")?0:h.includes("right")?"auto":m(h)},transform:u=>{let h=c.get(u),p=h.includes("right")||h.includes("end")&&!h.includes("left")?"50%":"-50%",g=h.includes("bottom")||h.includes("end")&&!h.includes("top")?"50%":"-50%";return`translate(${p},${g}) rotate(45deg)`}}}}}function Rn(t={}){let{color:e="inherit"}=t;return{_onInsert:n=>{n.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-1",style:{fontSize:n=>d(n,"inherit"),backgroundColor:n=>s(n,"inherit",e),boxShadow:n=>`inset ${l(1)} 0 0 0 ${s(n,"shift-3",e)}`,border:"none",paddingBlock:l(2),paddingInline:l(4),margin:0}}}function $n(t={}){let{color:e="primary"}=t;return{_onInsert:n=>{n.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:n=>d(n,"inherit"),paddingBlock:l(1),paddingInline:l(3),borderRadius:l(2),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:n=>`1px solid ${s(n,"shift-3",e)}`,color:n=>s(n,"shift-6",e),backgroundColor:n=>s(n,"inherit",e),"&:hover:not([disabled]):not([aria-busy=true])":{color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"shift-1",e)},"&:focus-visible":{boxShadow:n=>`inset 0 0 0 ${l(.5)} ${s(n,"shift-6",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-1","neutral"),outline:n=>`1px solid ${s(n,"shift-3","neutral")}`,color:n=>s(n,"shift-5","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function On(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"checkbox",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:o=>d(o,"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:o=>`1px solid ${s(o,"shift-4",e)}`,color:o=>s(o,"shift-6",e),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:o=>s(o,"shift-2",e)},"&:checked::before":{outline:o=>`1px solid ${s(o,"shift-5",n)}`,backgroundColor:o=>s(o,"shift-5",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>s(o,"shift-4",n)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:o=>`${l(.5)} solid ${s(o,"inherit",n)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:o=>`1px solid ${s(o,"shift-4",n)}`,backgroundColor:o=>s(o,"inherit",n)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:o=>s(o,"shift-5",n)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:o=>s(o,"shift-4",n)},"&:focus-visible":{borderRadius:l(1.5),outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>s(o,"shift-3","neutral"),pointerEvents:"none"}}}}function Ln(t={}){let{color:e="neutral"}=t;return{dataTone:"shift-2",_onInsert:n=>{n.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e),backgroundColor:n=>s(n,"inherit",e),height:l(6),paddingInline:l(1.5),borderRadius:l(1)}}}function In(t={}){let{color:e="neutral",accentColor:n="primary",duration:o=240}=t;return{_onInsert:i=>{i.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:i=>d(i,"inherit"),color:i=>s(i,"shift-6",e),backgroundColor:i=>s(i,"inherit",e),overflow:"hidden","& > summary":{backgroundColor:i=>s(i,"shift-1",e),color:i=>s(i,"shift-7",e),fontSize:i=>d(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:l(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:l(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:i=>`${l(.5)} solid ${s(i,"shift-6",e)}`,borderBottom:i=>`${l(.5)} solid ${s(i,"shift-6",e)}`,transform:"rotate(45deg)",transition:`transform ${o}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>s(i,"shift-2",e)},"& > summary:focus-visible":{borderRadius:l(2),outlineOffset:`-${l(.5)}`,outline:i=>`${l(.5)} solid ${s(i,"shift-5",n)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:l(3),paddingTop:0,paddingBottom:0,transition:`max-height ${o}ms ease, opacity ${o}ms ease, padding ${o}ms ease`},"&[open] > :not(summary)":{maxHeight:l(250),opacity:1,paddingTop:l(1),paddingBottom:l(3)}}}}function zn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.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:n=>d(n,"inherit"),color:n=>s(n,"shift-7",e)},"& dd":{margin:0,fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e)}}}}function Mn(t={}){let{color:e="neutral",open:n=!1}=t,o=w(n);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,r)=>{if(i.target!==r.domElement)return;let a=r.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,r)=>{let a=r.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let r=i.domElement,a=c=>{c?(r.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{r.style.opacity="1";let m=r.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):r.style.opacity="0"};a(o.get()),o.onChange(a)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>d(i,"inherit"),color:i=>s(i,"shift-7",e),backgroundColor:i=>s(i,"inherit",e),border:"none",padding:l(3),boxShadow:i=>`0 ${l(8)} ${l(16)} ${s(i,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:i=>s(i,"shift-1","neutral"),opacity:.75}}}}function An(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:n=>d(n,"inherit"),fontStyle:"italic",color:n=>s(n,"shift-7",e)}}}function Nn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.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:n=>s(n,"shift-6",e),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:l(2)},"& figcaption":{fontSize:n=>d(n,"decrease-1"),color:n=>s(n,"shift-5",e),lineHeight:1.45}}}}function Bn(t={}){let{color:e="neutral",layout:n="horizontal"}=t,o=n==="vertical";return{_onInsert:i=>{i.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:l(3),paddingBlock:l(3),border:"none",borderRadius:l(2),fontSize:i=>d(i,"inherit"),backgroundColor:i=>s(i,"inherit",e),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:i=>d(i,"inherit"),fontWeight:600,paddingBlock:l(1),borderRadius:l(2),color:i=>s(i,"shift-6",e),backgroundColor:i=>s(i,"inherit",e)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:o?0:l(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:i=>d(i,"decrease-1"),color:i=>s(i,"shift-6",e)}}}}var Dn={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Hn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{["h1","h2","h3","h4","h5","h6"].includes(n.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:n=>s(n,"shift-8",e),marginTop:0,marginBottom:l(2),fontSize:n=>{let o=Dn[n.elementNode.tagName]||"inherit";return d(n,o)}}}}function Fn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.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:n=>s(n,"shift-3",e)}}}function jn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.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:n=>s(n,"shift-1",e)}}}function Vn(){return{_onInsert:t=>{t.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:l(6),height:l(6)}}}function Wn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"color",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),i.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>d(o,"inherit"),paddingBlock:l(1),paddingInline:l(1),blockSize:l(8),inlineSize:l(8),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:l(1)},"&::-moz-color-swatch":{borderRadius:l(1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`}}}}function Un(t={}){let{mode:e="datetime-local",color:n="neutral",accentColor:o="primary"}=t;return{type:e,_onSchedule:(i,r)=>{i.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),r.type=e},style:{fontFamily:"inherit",fontSize:i=>d(i,"inherit"),lineHeight:"inherit",color:i=>s(i,"shift-6",n),backgroundColor:i=>s(i,"inherit",n),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"shift-3",n)}`,borderRadius:l(2),paddingInline:l(3),height:l(8),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-5",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>s(i,"shift-5","neutral"),backgroundColor:i=>s(i,"shift-1","neutral"),outline:i=>`1px solid ${s(i,"shift-3","neutral")}`},"&:invalid":{outline:i=>`${l(.5)} solid ${s(i,"shift-5","error")}`}}}}function Kn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"file",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),i.type="file"},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,borderRadius:l(2),height:l(8),paddingInline:l(1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:o=>s(o,"shift-7",n),backgroundColor:o=>s(o,"shift-2",n)},"&::-webkit-file-upload-button":{marginTop:l(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:o=>s(o,"shift-7",e),backgroundColor:o=>s(o,"shift-2",e)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,backgroundColor:o=>s(o,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),backgroundColor:o=>s(o,"shift-2","neutral")}}}}function qn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"search",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),i.type="search"},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,borderRadius:l(2),minWidth:l(32),paddingInline:l(3),paddingBlock:l(1),"&::placeholder":{color:o=>s(o,"shift-4",e)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`}}}}function Gn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"text",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),i.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(32),paddingInline:l(3),paddingBlock:l(1),borderRadius:l(2),fontSize:o=>d(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-4")},"&:not(:placeholder-shown)":{color:o=>s(o,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,color:o=>s(o,"shift-5","neutral")},"&:invalid:not(:placeholder-shown)":{outline:o=>`${l(.5)} solid ${s(o,"shift-5","error")}`},"&[data-status=error]":{outline:o=>`${l(.5)} solid ${s(o,"shift-5","error")}`},"&[data-status=warning]":{outline:o=>`${l(.5)} solid ${s(o,"shift-5","warning")}`}}}}function Yn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"range",_onInsert:o=>{o.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:o=>s(o,"shift-2",e)},"&::-moz-range-track":{height:l(1.5),borderRadius:l(999),backgroundColor:o=>s(o,"shift-2",e)},"&::-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:o=>s(o,"shift-6",n)},"&::-moz-range-thumb":{width:l(4),height:l(4),borderRadius:l(999),border:"none",backgroundColor:o=>s(o,"shift-6",n)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:o=>s(o,"shift-7",n)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:o=>s(o,"shift-7",n)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-4",n)}`,outlineOffset:l(1),borderRadius:l(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Xn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"number",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),i.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(32),paddingInline:l(3),paddingBlock:l(1),borderRadius:l(2),fontSize:o=>d(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,color:o=>s(o,"shift-5","neutral")}}}}function Jn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e),backgroundColor:n=>s(n,"inherit",e),paddingBlock:l(.5),paddingInline:l(1.5),borderRadius:l(1),outline:n=>`1px solid ${s(n,"shift-3",e)}`}}}function Qn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:l(2),fontSize:o=>d(o,"inherit"),color:o=>s(o,"shift-6",e),cursor:"pointer","&:focus-within":{color:o=>s(o,"shift-7",n)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral")}}}}function Zn(t={}){let{color:e="primary",accentColor:n="secondary"}=t;return{_onInsert:o=>{o.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:o=>d(o,"inherit"),color:o=>s(o,"shift-6",e),textDecoration:"none","&:visited":{color:o=>s(o,"shift-6",n)},"&:hover:not([disabled])":{color:o=>s(o,"shift-7",e),textDecoration:"underline"},"&:focus-visible":{borderRadius:l(1),outlineOffset:l(1),outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral")}}}}function ei(t={}){let{accentColor:e="highlight",tone:n="shift-1"}=t;return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:n,style:{display:"inline-flex",alignItems:"center",fontSize:o=>d(o,"inherit"),color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),height:l(6),borderRadius:l(1),paddingInline:l(1.5)}}}function ti(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e),lineHeight:1.5,marginTop:0,marginBottom:0}}}function oi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e),backgroundColor:n=>s(n,"shift-1",e),border:"none",paddingBlock:l(2),paddingInline:l(3),borderRadius:l(2)}}}function ni(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.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:o=>s(o,"shift-2",e),"&::-webkit-progress-bar":{backgroundColor:o=>s(o,"shift-2",e),borderRadius:l(999)},"&::-webkit-progress-value":{backgroundColor:o=>s(o,"shift-6",n),borderRadius:l(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:o=>s(o,"shift-6",n),borderRadius:l(999)}}}}function ii(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"radio",_onInsert:o=>{if(o.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:o=>d(o,"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:o=>`1px solid ${s(o,"shift-4",e)}`,color:o=>s(o,"shift-6",e),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:o=>s(o,"shift-2",e)},"&:checked::before":{outline:o=>`1px solid ${s(o,"shift-5",n)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:o=>s(o,"shift-5",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>s(o,"shift-4",n)},"&:focus-visible":{borderRadius:"50%",outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>s(o,"shift-3","neutral"),pointerEvents:"none"}}}}function ri(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,borderRadius:l(2),paddingBlock:l(1),paddingLeft:l(3),paddingRight:l(1),"&:not([multiple])":{height:l(8)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-4",n)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"& optgroup":{color:o=>s(o,"shift-8",e)},"& option[disabled]":{color:o=>s(o,"shift-4","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,backgroundColor:o=>s(o,"shift-1","neutral")}}}}function li(t={}){let{color:e="neutral"}=t,n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=J(JSON.stringify(n));return{ariaHidden:"true",style:{height:l(6),display:"block",borderRadius:l(1),backgroundColor:i=>s(i,"shift-2",e),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}var io={to:{transform:"rotate(360deg)"}},no=J(JSON.stringify(io));function si(t={}){let{color:e="neutral"}=t;return{role:"status",ariaLabel:"loading",_onInsert:n=>{n.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{display:"inline-block",margin:0,flexShrink:0,width:l(6),height:l(6),borderRadius:"50%",border:n=>`${l(.5)} solid ${s(n,"shift-3",e)}`,borderTopColor:n=>s(n,"shift-6",e),boxSizing:"border-box",padding:0,animation:`${no} 0.7s linear infinite`,[`@keyframes ${no}`]:io}}}function ai(t={}){var a;let{color:e="neutral",multiple:n=!1}=t,o=w((a=t.value)!=null?a:n?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(u=>({input:null,name:t.name,value:u||""}))},hidden:!0};return{dataTone:"shift-11",_context:{select:{value:o,multiple:n}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:l(2),paddingInline:l(2),fontSize:c=>d(c,"inherit"),backgroundColor:c=>s(c,"inherit",e)}}}function ci(t={}){let{accentColor:e="primary",color:n="neutral",value:o=null}=t;return{role:"option",_onInit:r=>{r.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=r.getContext("select");if(a){let c=a.value;r.attributes.set("ariaSelected",m=>{let f=c.get(m);return a.multiple?f.includes(o):f==o}),r.addEvent("click",()=>{let m=c.get();a.multiple?m.includes(o)?c.set(m.filter(f=>f!==o)):c.set(m.concat([o])):m!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>d(r,"inherit"),height:l(8),paddingInline:l(3),border:"none",outline:"none",color:r=>s(r,"shift-6",n),backgroundColor:r=>s(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>s(r,"shift-1",n)},"&[aria-selected=true]":{backgroundColor:r=>s(r,"shift-2",e),color:r=>s(r,"shift-8")},"&:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-5",e)}`,outlineOffset:`-${l(.5)}`}}}}function mi(t){let{options:e=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=t,a=w(t.value),c=w(i),{show:m,hide:f,anchorPartial:u}=U({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),h={onClick:()=>!r&&f()};E(t.content,h);let p={div:y=>{let v=a.get(y),b=Array.isArray(v)?v:[v];return e.filter(C=>b.includes(C.value)).map(C=>({span:C.label,$:[ge({color:o,removable:r})],_key:C.value,_onRemove:k=>{let S=a.get(),_=(Array.isArray(S)?S:[S]).filter($=>$!==C.value);r?a.set(_):a.set(_[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:l(1),flex:1}},g={_onInsert:y=>{y.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:y=>y.children.insert(p),onClick:()=>c.get()?f():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:l(8),minWidth:l(32),outlineOffset:"-1px",outline:y=>`1px solid ${s(y,"shift-3","neutral")}`,paddingInline:l(2),borderRadius:l(2),fontSize:y=>d(y,"inherit"),color:y=>s(y,"shift-6",o),backgroundColor:y=>s(y,"inherit",o)}};return E(u,g),u}function fi(t={}){let{accentColor:e="primary"}=t;return{dataTone:"increase-2",type:"checkbox",_onSchedule:n=>{if(n.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:n=>d(n,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:l(8),height:l(6),cursor:"pointer",margin:"0",paddingBlock:l(1),"&:checked":{"&::before":{backgroundColor:n=>s(n,"increase-3",e)},"&::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:n=>s(n,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:l(999),display:"inline-block",fontSize:n=>d(n,"inherit"),lineHeight:1,backgroundColor:n=>s(n)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ui(t={}){let{checked:e=!1,accentColor:n="primary",color:o="neutral"}=t,i=w(e);return{_onSchedule:r=>{r.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:r=>i.get(r),dataTone:"increase-2",onClick:()=>i.set(!i.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:r=>d(r),border:"none",outlineWidth:"1px",outline:r=>`1px solid ${s(r,"shift-2",o)}`,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:r=>s(r,"inherit",o),"& > :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:r=>s(r,"shift-6"),backgroundColor:r=>s(r,"decrease-2",o)},"&[aria-checked=true]":{backgroundColor:r=>s(r,"increase-3",n),outline:"none",color:r=>s(r,"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 hi(t={}){let{color:e="neutral"}=t;return{dataSize:"decrease-1",_onInsert:n=>{n.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e)}}}function di(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:n=>d(n,"inherit"),fontWeight:700,color:n=>s(n,"shift-8",e)}}}function pi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:n=>d(n,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:n=>s(n,"shift-6",e)}}}function gi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:n=>d(n,"decrease-1"),verticalAlign:"super",lineHeight:0,color:n=>s(n,"shift-6",e)}}}function yi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:l(3),paddingBlock:l(1),color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"inherit")},"& td":{textAlign:"left",paddingInline:l(3),paddingBlock:l(1),color:n=>s(n,"shift-6",e),boxShadow:n=>`inset 0 1px 0 ${s(n,"shift-3",e)}`,fontSize:n=>d(n,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:l(3),paddingBlock:l(1),color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"inherit"),boxShadow:n=>`inset 0 -1px 0 ${s(n,"shift-3",e)}`},"& tr":{backgroundColor:n=>s(n,"inherit")},"& tbody tr:hover":{backgroundColor:n=>s(n,"shift-2")+"!important"}}}}function bi(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:l(4),paddingBlock:l(2),border:"none",borderRadius:l(2),fontSize:o=>d(o,"inherit"),color:o=>s(o,"shift-6",e),outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-4")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-4",n)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&:invalid":{outline:o=>`${l(.5)} solid ${s(o,"shift-4","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,backgroundColor:o=>s(o,"shift-1","neutral")}}}}function vi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"disc",listStylePosition:"outside"}}}function xi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"decimal",listStylePosition:"outside"}}}function wi(t,e){if(e<=7)return Array.from({length:e},(r,a)=>a+1);let n=[1];t>3&&n.push("...");let o=Math.max(2,t-1),i=Math.min(e-1,t+1);for(let r=o;r<=i;r++)n.push(r);return t<e-2&&n.push("..."),n.push(e),n}function Ci(t){var c;let{total:e,color:n="neutral",accentColor:o="primary"}=t,i=w((c=t.value)!=null?c:1),r={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:l(8),height:l(8),paddingInline:l(2),borderRadius:l(2),border:"none",cursor:"pointer",fontSize:m=>d(m,"inherit"),backgroundColor:"transparent",color:m=>s(m,"shift-6",n),"&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-1",n)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=L(P({},r),{backgroundColor:m=>s(m,"shift-2",o),color:m=>s(m,"shift-8",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-2",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let f={div:u=>{let h=i.get(u),p=[];p.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:h<=1,onClick:()=>h>1&&i.set(h-1),style:r});for(let g of wi(h,e))if(g==="...")p.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:l(2),color:y=>s(y,"shift-4",n)}});else{let y=g===h;p.push({button:String(g),type:"button",ariaLabel:`Page ${g}`,ariaCurrent:y?"page":void 0,disabled:y,onClick:()=>i.set(g),style:y?a:r})}return p.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:h>=e,onClick:()=>h<e&&i.set(h+1),style:r}),p},style:{display:"flex",alignItems:"center",gap:l(1)}};m.children.insert(f)},style:{display:"inline-flex"}}}function Si(t={}){let{color:e="neutral"}=t;return{role:"separator",_onInsert:n=>{n.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:l(2),fontSize:n=>d(n,"inherit"),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:n=>s(n,"shift-3",e),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:n=>s(n,"shift-3",e),borderWidth:"1px",borderBottomStyle:"solid"}}}}var ro={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Ei={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},tt=t=>t==="left"||t==="right";function ki(t={}){let{color:e="neutral",open:n=!1,placement:o="right",size:i}=t,r=w(n),a=tt(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,f)=>{m.target===f.domElement&&r.set(!1)},onTransitionEnd:(m,f)=>{let u=f.domElement;r.get()||(u.close(),document.body.style.overflow="")},_onMount:m=>{let f=m.domElement,u=h=>{h?(f.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{f.style.transform="translate(0, 0)"})):f.style.transform=ro[o]};u(r.get()),r.onChange(u)},style:{transform:ro[o],transition:"transform 0.25s ease",fontSize:m=>d(m,"inherit"),color:m=>s(m,"shift-7",e),backgroundColor:m=>s(m,"inherit",e),border:"none",padding:l(3),margin:Ei[o],width:tt(o)?c:"100dvw",height:tt(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${l(4)} ${l(12)} ${s(m,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:m=>s(m,"shift-1","neutral"),opacity:.75}}}}function Ti(t){let{open:e=!1,placement:n="bottom",openOn:o="click"}=t,i=null,r=w(e),{show:a,hide:c,anchorPartial:m}=U({open:r,placement:n,content:t.content,onPlacement:t.onPlacement}),f={role:"dialog",dataTone:"shift-6",onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),_onInsert:h=>{let p=h.attributes.get("id");i=p||h.nodeId,!p&&h.attributes.set("id",i)}};return E(t.content,f),E(m,{ariaHaspopup:"dialog",ariaExpanded:h=>r.get(h),onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),onClick:()=>o==="click"&&(r.get()?c():a()),onFocus:()=>a(),onBlur:()=>c(),_onMount:h=>i&&h.attributes.set("ariaControls",i)}),m}function _i(t={}){let{position:e="top-center",color:n="neutral"}=t,o=w(!1),i=e.startsWith("top"),r=e.endsWith("center"),a=e.endsWith("right"),c={div:[],id:`domphy-toast-${e}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:r?"center":a?"end":"start",inset:0,gap:l(4),zIndex:30,padding:l(6),pointerEvents:"none"}};return{_portal:m=>{let f=m.domElement.querySelector(`#domphy-toast-${e}`);return f||(f=m.children.insert(c).domElement),f},role:"status",ariaAtomic:"true",style:{minWidth:l(32),pointerEvents:"auto",paddingBlock:l(2),paddingInline:l(4),borderRadius:l(2),fontSize:m=>d(m,"inherit"),color:m=>s(m,"shift-1",n),backgroundColor:m=>s(m,"shift-9",n),boxShadow:m=>`0 ${l(2)} ${l(8)} ${s(m,"shift-3","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,f)=>{let u=h=>{h.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",u),f())};m.domElement.addEventListener("transitionend",u),o.set(!1)}}}function Pi(t,e){return{span:t,dataSize:"decrease-1",dataTone:"shift-6",style:{paddingBlock:l(1),paddingInline:l(3),borderRadius:l(2),color:n=>s(n,"shift-6"),backgroundColor:n=>s(n),fontSize:n=>d(n,"inherit")},$:[et({placement:e,bordered:!1})]}}function Ri(t={}){let{open:e=!1,placement:n="top",content:o="Tooltip Content"}=t,i=null,r=w(n),a=typeof o=="string"?Pi(o,r):o,{show:c,hide:m,anchorPartial:f}=U({open:e,placement:n,content:a});return E(a,{role:"tooltip",_onInsert:p=>{let g=p.attributes.get("id");i=g||p.nodeId,!g&&p.attributes.set("id",i)}}),E(f,{onMouseEnter:()=>c(),onMouseLeave:()=>m(),onFocus:()=>c(),onBlur:()=>m(),onKeyDown:p=>p.key==="Escape"&&m(),_onMount:p=>i&&p.attributes.set("ariaDescribedby",i)}),f}function lo(t,e){return t.key!==void 0&&t.key!==null?String(t.key):`index-${e}`}function $i(t={}){let{duration:e=300,delay:n=0}=t,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((r,a)=>{if(!(r instanceof O))return;let c=r.domElement;c&&o.set(lo(r,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((r,a)=>{if(!(r instanceof O))return;let c=r.domElement;if(!c)return;let m=lo(r,a),f=o.get(m);if(!f)return;let u=c.getBoundingClientRect(),h=f.left-u.left,p=f.top-u.top;if(Math.abs(h)<.5&&Math.abs(p)<.5)return;let g=c.style.transition,y=c.style.transform;c.style.transition="none",c.style.transform=`translate(${h}px, ${p}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${e}ms ease ${n}ms`,c.style.transform="translate(0px, 0px)"});let v=()=>{c.style.transition=g,c.style.transform=y,c.removeEventListener("transitionend",b)},b=x=>{x.propertyName==="transform"&&v()};c.addEventListener("transitionend",b),setTimeout(v,e+n+34)}),o.clear()}}}function Oi(t={}){return{role:"tablist",_onSchedule:(n,o)=>{let i={_context:{tabs:{activeKey:w(t.activeKey||0),path:n.key}}};E(o,i)}}}function Li(t={}){let{accentColor:e="primary",color:n="neutral"}=t;return{role:"tab",_onInsert:i=>{var f;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let r=i.getContext("tabs"),a=(f=i.parent)==null?void 0:f.children.items;a=a.filter(u=>u.type=="ElementNode"&&u.attributes.get("role")=="tab");let c=i.key||a.findIndex(u=>u==i),m={id:"tab"+r.path+c,ariaControls:"tabpanel"+r.path+c,ariaSelected:u=>r.activeKey.get(u)==c,onClick:()=>r.activeKey.set(c),onKeyDown:u=>{var b,x,C,k;let h=u.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(h))return;u.preventDefault();let p=((x=(b=i.parent)==null?void 0:b.children.items)!=null?x:[]).filter(S=>S.type==="ElementNode"&&S.attributes.get("role")==="tab"),g=p.findIndex(S=>S===i),y=g;h==="ArrowRight"?y=(g+1)%p.length:h==="ArrowLeft"?y=(g-1+p.length)%p.length:h==="Home"?y=0:h==="End"&&(y=p.length-1);let v=p[y];r.activeKey.set((C=v.key)!=null?C:y),(k=v.domElement)==null||k.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>d(i,"inherit"),height:l(8),paddingInline:l(4),border:"none",outline:"none",color:i=>s(i,"shift-6"),backgroundColor:i=>s(i,"inherit"),boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-2",n)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-3",n)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-4",e)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",e)}`}}}}function Ii(){return{role:"tabpanel",style:{paddingBlock:l(2),paddingInline:l(2)},_onInsert:e=>{var a;let n=e.getContext("tabs"),o=(a=e.parent)==null?void 0:a.children.items;o=o.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tabpanel");let i=e.key||o.findIndex(c=>c==e),r={id:"tabpanel"+n.path+i,ariaLabelledby:"tab"+n.path+i,hidden:c=>n.activeKey.get(c)!=i};e.merge(r)}}}function zi(t={}){let{color:e="neutral"}=t;return{role:"menu",dataTone:"shift-11",_onSchedule:(o,i)=>{let r={_context:{menu:{activeKey:w(t.activeKey||0)}}};E(i,r)},style:{display:"flex",flexDirection:"column",paddingBlock:l(2),paddingInline:l(2),fontSize:o=>d(o,"inherit"),backgroundColor:o=>s(o,"inherit",e)}}}function Mi(t={}){let{accentColor:e="primary",color:n="neutral"}=t;return{role:"menuitem",_onInsert:i=>{var m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let r=i.getContext("menu"),a=(m=i.parent)==null?void 0:m.children.items;a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="menuitem");let c=i.key||a.findIndex(f=>f==i);i.attributes.set("ariaCurrent",f=>r.activeKey.get(f)==c||void 0),i.addEvent("click",()=>r.activeKey.set(c)),i.addEvent("keydown",f=>{var y,v,b;let u=f.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(u))return;f.preventDefault();let h=((v=(y=i.parent)==null?void 0:y.children.items)!=null?v:[]).filter(x=>x.type==="ElementNode"&&x.attributes.get("role")==="menuitem"),p=h.findIndex(x=>x===i),g=p;u==="ArrowDown"?g=(p+1)%h.length:u==="ArrowUp"?g=(p-1+h.length)%h.length:u==="Home"?g=0:u==="End"&&(g=h.length-1),(b=h[g].domElement)==null||b.focus()})},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>d(i,"inherit"),height:l(8),paddingInline:l(3),border:"none",outline:"none",color:i=>s(i,"shift-6"),backgroundColor:i=>s(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>s(i,"shift-1")},"&[aria-current=true]":{backgroundColor:i=>s(i,"shift-1",e),color:i=>s(i,"shift-7")},"&:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-5",e)}`,outlineOffset:`-${l(.5)}`}}}}function Ai(t){return{_onSchedule:(e,n)=>{E(n,{_context:{form:t}})}}}function Ni(t,e){return{_onInsert:n=>{let i=n.getContext("form").setField(t,void 0,e),r=n.tagName,a=n.attributes.get("type");["input","select","textarea"].includes(r)||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)};r==="input"&&a==="checkbox"?(c.checked=i.value(),c.onChange=m=>i.setValue(m.target.checked)):r==="input"&&a==="radio"?c.onChange=m=>i.setValue(m.target.value):r==="select"?(c.value=i.value(),c.onChange=m=>i.setValue(m.target.value)):r==="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)),n.merge(c)}}}function Bi(t){return!!t&&typeof t.then=="function"}var Ee=class{constructor(e,n){this._notifier=new pe;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=e,this._initValue=e,this._validator=n,n&&this.validate()}value(e){return e&&this._notifier.addListener("value",e),this._value}setValue(e){this._value=e,this._notifier.notify("value",e),this._notifier.notify("dirty",e!==this._initValue),this.validate()}dirty(e){return e&&this._notifier.addListener("dirty",e),this._value!==this._initValue}touched(e){return e&&this._notifier.addListener("touched",e),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(e,n){let o=!1;e!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=e,this._initValue=e,this._notifier.notify("value",e),this._notifier.notify("dirty",!1),o=!0),n!==void 0&&n!==this._validator&&(this._validator=n,o=!0),o&&this.validate()}message(e,n){return n&&this._notifier.addListener(e,n),this._messages[e]}status(e){return e&&this._notifier.addListener("status",e),Me(this._messages)}setMessages(e){let n=this._messages;this._messages=e;for(let o of["error","warning","success"])n[o]!==e[o]&&this._notifier.notify(o,e[o]);Me(n)!==Me(e)&&this._notifier.notify("status",Me(e))}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 e=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let n=this._validator(this._value);Bi(n)?(this._pending=!0,Promise.resolve(n).then(o=>{e===this._validationToken&&(this._pending=!1,this.setMessages(o!=null?o:{}))}).catch(o=>{e===this._validationToken&&(this._pending=!1,console.error(o))})):(this._pending=!1,this.setMessages(n!=null?n:{}))}catch(n){e===this._validationToken&&(this._pending=!1),console.error(n)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function Me(t){if(t.error)return"error";if(t.warning)return"warning";if(t.success)return"success"}var ot=class{constructor(){this.fields=new Map}setField(e,n,o){let i=this.fields.get(e);return i?i.configure(n,o):(i=new Ee(n,o),this.fields.set(e,i)),i}getField(e){return this.setField(e)}removeField(e){var n;(n=this.fields.get(e))==null||n._dispose(),this.fields.delete(e)}get valid(){for(let e of this.fields.values())if(e._pending||e._messages.error)return!1;return!0}reset(){for(let e of this.fields.values())e.reset()}snapshot(){let e={};for(let[n,o]of this.fields)Di(e,n,o._value);return e}_dispose(){for(let e of this.fields.values())e._dispose();this.fields.clear()}};function Di(t,e,n){let o=e.split("."),i=t;for(let r=0;r<o.length-1;r++){let a=o[r];i[a]==null&&(i[a]=isNaN(Number(o[r+1]))?{}:[]),i=i[a]}i[o[o.length-1]]=n}globalThis.Domphy={core:qe,theme:je,ui:nt};})();
|
|
5
|
+
//# sourceMappingURL=core-theme-ui.global.js.map
|