@domphy/ui 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var to=Object.defineProperty,oo=Object.defineProperties;var ro=Object.getOwnPropertyDescriptors;var at=Object.getOwnPropertySymbols;var no=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable;var st=(n,o,t)=>o in n?to(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,mt=(n,o)=>{for(var t in o||(o={}))no.call(o,t)&&st(n,t,o[t]);if(at)for(var t of at(o))io.call(o,t)&&st(n,t,o[t]);return n},ct=(n,o)=>oo(n,ro(o));import{themeColor as xe,themeSpacing as lo}from"@domphy/theme";function cn(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{color:e=>xe(e,"shift-7",o),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:e=>xe(e,"shift-4",o),textUnderlineOffset:lo(.72),cursor:"help","&:hover":{color:e=>xe(e,"shift-8",t),textDecorationColor:e=>xe(e,"shift-6",t)}}}}import{themeColor as U,themeSpacing as z}from"@domphy/theme";function pn(n={}){let{color:o="neutral"}=n;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:z(2),backgroundColor:t=>U(t,"inherit",o),color:t=>U(t,"shift-7",o),outline:t=>`1px solid ${U(t,"shift-3",o)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:z(2),paddingInline:z(4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:z(4),color:t=>U(t,"shift-6",o),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:z(2),height:"auto"},"& > div":{gridArea:"content",padding:z(4),color:t=>U(t,"shift-7",o)},"& > footer":{gridArea:"footer",display:"flex",gap:z(2),paddingBlock:z(2),paddingInline:z(4),borderTop:t=>`1px solid ${U(t,"shift-2",o)}`}}}}import{merge as ao,toState as so}from"@domphy/core";import{themeColor as De,themeSpacing as mo}from"@domphy/theme";function bn(n={}){let{direction:o="horizontal",defaultSize:t=50,min:e=10,max:r=90}=n;return{_onSchedule:(i,s)=>{ao(s,{_context:{splitter:{direction:o,size:so(t),min:e,max:r}}})},style:{display:"flex",flexDirection:o==="horizontal"?"row":"column",overflow:"hidden"}}}function yn(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal"?"width":"height";t.style[e]=`${o.size.get()}%`,t.style.flexShrink="0",t.style.overflow="auto";let r=o.size.onChange(i=>{t.style[e]=`${i}%`});n.addHook("Remove",r)}}}function Cn(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal";t.style.cursor=e?"col-resize":"row-resize";let r=i=>{i.preventDefault();let s=t.parentElement,l=m=>{let c=s.getBoundingClientRect(),d=e?(m.clientX-c.left)/c.width*100:(m.clientY-c.top)/c.height*100;o.size.set(Math.min(Math.max(d,o.min),o.max))},a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)};t.addEventListener("mousedown",r),n.addHook("Remove",()=>t.removeEventListener("mousedown",r))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n=>De(n,"shift-2"),"&:hover":{backgroundColor:n=>De(n,"shift-3")},"&::after":{content:'""',borderRadius:mo(999),backgroundColor:n=>De(n,"shift-4")}}}}import{merge as co,toState as uo}from"@domphy/core";import{themeColor as $,themeSize as dt,themeSpacing as X}from"@domphy/theme";function Sn(){return{_onSchedule:(n,o)=>{co(o,{_context:{command:{query:uo("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function kn(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:e=>{let r=e.getContext("command"),i=e.domElement,s=()=>r.query.set(i.value);i.addEventListener("input",s),e.addHook("Remove",()=>i.removeEventListener("input",s))},style:{fontFamily:"inherit",fontSize:e=>dt(e,"inherit"),paddingInline:X(3),paddingBlock:X(2),border:"none",borderBottom:e=>`1px solid ${$(e,"shift-2",o)}`,outline:"none",color:e=>$(e,"shift-7",o),backgroundColor:e=>$(e,"inherit",o),"&::placeholder":{color:e=>$(e,"shift-4")},"&:focus-visible":{borderBottomColor:e=>$(e,"shift-5",t)}}}}function Tn(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"option",_onMount:e=>{var a,m;let r=e.getContext("command"),i=e.domElement,s=(m=(a=i.textContent)==null?void 0:a.toLowerCase())!=null?m:"",l=r.query.onChange(c=>{i.hidden=c.length>0&&!s.includes(c.toLowerCase())});e.addHook("Remove",l)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:e=>dt(e,"inherit"),height:X(8),paddingInline:X(3),border:"none",outline:"none",color:e=>$(e,"shift-6",o),backgroundColor:e=>$(e,"inherit",o),"&:hover:not([disabled])":{backgroundColor:e=>$(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${X(.5)} solid ${$(e,"shift-5",t)}`,outlineOffset:`-${X(.5)}`}}}}import{themeColor as me,themeSize as po,themeSpacing as J}from"@domphy/theme";function In(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"button",_onInsert:e=>{var a;e.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let r=e.getContext("toggleGroup"),s=((a=e.parent)==null?void 0:a.children.items).filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="button"),l=String(s.findIndex(m=>m===e));e.attributes.set("ariaPressed",m=>{let c=r.value.get(m);return Array.isArray(c)?c.includes(l):c===l}),e.addEvent("click",()=>{let m=r.value.get();if(r.multiple){let c=Array.isArray(m)?[...m]:[];r.value.set(c.includes(l)?c.filter(d=>d!==l):[...c,l])}else r.value.set(m===l?"":l)})},style:{cursor:"pointer",fontSize:e=>po(e,"inherit"),height:J(6),paddingBlock:J(1),paddingInline:J(2),border:"none",borderRadius:J(1),color:e=>me(e,"shift-6",o),backgroundColor:e=>me(e,"inherit",o),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:e=>me(e,"shift-1",o)},"&[aria-pressed=true]":{backgroundColor:e=>me(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${J(.5)} solid ${me(e,"shift-5",t)}`,outlineOffset:`-${J(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as ho}from"@domphy/core";import{themeSpacing as Ee,themeColor as ut,themeSize as fo}from"@domphy/theme";function Nn(n={}){var e;let{multiple:o=!1,color:t="neutral"}=n;return{role:"group",dataTone:"shift-1",_context:{toggleGroup:{value:ho((e=n.value)!=null?e:o?[]:""),multiple:o}},style:{display:"flex",paddingBlock:Ee(1),paddingInline:Ee(1),gap:Ee(1),borderRadius:Ee(2),fontSize:r=>fo(r,"inherit"),backgroundColor:r=>ut(r,"inherit",t),outline:r=>`1px solid ${ut(r,"shift-1",t)}`,outlineOffset:"-1px"}}}import{themeSpacing as pt}from"@domphy/theme";function Hn(){return{style:{display:"flex",alignItems:"center",gap:pt(2),"& > *":{minWidth:pt(8)+"!important"}},_onMount:n=>{let o=n.domElement,t=()=>Array.from(o.querySelectorAll("input")),e=s=>{let l=t(),a=s.target,m=l.indexOf(a);a.value&&m<l.length-1&&l[m+1].focus()},r=s=>{let l=t(),a=s.target,m=l.indexOf(a);s.key==="Backspace"&&!a.value&&m>0&&l[m-1].focus(),s.key==="ArrowLeft"&&m>0&&l[m-1].focus(),s.key==="ArrowRight"&&m<l.length-1&&l[m+1].focus()},i=s=>{var d,u,g;s.preventDefault();let l=(u=(d=s.clipboardData)==null?void 0:d.getData("text"))!=null?u:"",a=t(),m=a.indexOf(s.target);[...l].forEach((h,f)=>{a[m+f]&&(a[m+f].value=h)});let c=Math.min(m+l.length-1,a.length-1);(g=a[c])==null||g.focus()};o.addEventListener("input",e),o.addEventListener("keydown",r),o.addEventListener("paste",i),n.addHook("Remove",()=>{o.removeEventListener("input",e),o.removeEventListener("keydown",r),o.removeEventListener("paste",i)})}}}import{themeColor as Fe,themeSize as go,themeSpacing as Se}from"@domphy/theme";function Dn(n={}){let{color:o="primary"}=n;return{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:Se(3),paddingBlock:Se(2),paddingInline:Se(4),boxShadow:t=>`inset ${Se(1)} 0 0 0 ${Fe(t,"shift-5",o)}`,backgroundColor:t=>Fe(t,"shift-1",o),color:t=>Fe(t,"shift-7",o),fontSize:t=>go(t,"inherit")}}}import{themeColor as ht,themeSize as bo,themeSpacing as ft}from"@domphy/theme";function An(n={}){let{color:o="primary"}=n;return{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:ft(8),height:ft(8),fontSize:t=>bo(t,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:t=>ht(t,"shift-3",o),color:t=>ht(t,"shift-8",o),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}import{toState as yo}from"@domphy/core";import{themeSpacing as Ve,themeColor as gt,themeSize as Co}from"@domphy/theme";function Yn(n={}){let{color:o="danger",label:t=999}=n,e=yo(t);return{style:{position:"relative","&::after":{content:r=>`"${e.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:Ve(1),minWidth:Ve(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>Co(r,"decrease-1"),borderRadius:Ve(999),backgroundColor:r=>gt(r,"shift-6",o),color:r=>gt(r,"shift-0",o)}}}}import{themeColor as ce,themeSize as vo,themeSpacing as bt}from"@domphy/theme";function Xn(n={}){let{color:o="neutral",separator:t="/"}=n;return{_onInsert:e=>{e.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:e=>vo(e,"inherit"),gap:bt(1),color:e=>ce(e,"shift-6",o),backgroundColor:e=>ce(e,"inherit",o),"& > *":{display:"inline-flex",alignItems:"center",color:e=>ce(e,"shift-5",o)},"& > *:not(:last-child)::after":{content:`"${t}"`,color:e=>ce(e,"shift-3",o),paddingInlineStart:bt(1)},"& > [aria-current=page]":{color:e=>ce(e,"shift-7",o),pointerEvents:"none"}}}}import{themeColor as ke,themeSize as xo,themeSpacing as Te}from"@domphy/theme";function Zn(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:t=>xo(t,"inherit"),paddingInline:Te(1),border:"none",background:"none",cursor:"pointer",color:t=>ke(t,"shift-5",o),borderRadius:Te(1),"&:hover":{color:t=>ke(t,"shift-7",o),backgroundColor:t=>ke(t,"shift-1",o)},"&:focus-visible":{outline:t=>`${Te(.5)} solid ${ke(t,"shift-5",o)}`,outlineOffset:Te(.5)}}}}import{toState as Ct,merge as Ae}from"@domphy/core";import{themeSpacing as K,themeColor as de,themeSize as vt}from"@domphy/theme";import{themeColor as Pe,themeSize as Eo,themeSpacing as M}from"@domphy/theme";var So='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function we(n={}){let{color:o="neutral",removable:t=!1}=n;return{dataTone:"shift-1",_onInit:e=>{let r={span:So,onClick:i=>{i.stopPropagation(),e.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:M(1),width:M(4),height:M(4),flexShrink:0,"&:hover":{backgroundColor:i=>Pe(i,"shift-3",o)}}};t&&e.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:M(6),paddingBlock:"0px",borderRadius:M(1),paddingInlineStart:M(2),paddingInlineEnd:t?M(1):M(2),gap:M(2),fontSize:e=>Eo(e,"inherit"),backgroundColor:e=>Pe(e,"inherit",o),color:e=>Pe(e,"shift-6",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${Pe(e,"shift-3",o)}`}}}import{toState as yt,merge as ko}from"@domphy/core";import{computePosition as To,autoUpdate as Po,offset as wo,flip as Io,shift as _o}from"@floating-ui/dom";function H(n){let{open:o=!1,placement:t="bottom"}=n,e=null,r=null,i=null,s=null,l=yt(o),a=yt(t),m=()=>{i&&s&&(r&&r(),r=Po(i,s,()=>{To(i,s,{placement:a.get(),middleware:[wo(12),Io(),_o()],strategy:"fixed"}).then(({x:f,y:p,placement:b})=>{var y;Object.assign(s.style,{left:`${f}px`,top:`${p}px`}),b!==a.get()&&a.set(b),(y=n.onPlacement)==null||y.call(n,i,s,b)})}),l.set(!0))},c=()=>{r&&r(),r=null,l.set(!1)},d=()=>{e&&clearTimeout(e),e=setTimeout(m,100)},u=()=>{e&&clearTimeout(e),e=setTimeout(c,100)},g={style:{position:"fixed",pointerEvents:"auto",visibility:f=>l.get(f)?"visible":"hidden"},_onMount:f=>s=f.domElement,_portal:f=>{let p=f.domElement.querySelector("#domphy-floating");if(!p){let b={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};p=f.children.insert(b).domElement}return p}};return ko(n.content,g),{show:d,hide:u,anchorPartial:{onKeyDown:f=>f.key==="Escape"&&u(),_onSchedule:f=>{let p=null;f.getRoot().addHook("Init",b=>{p=b.children.insert(n.content)}),f.addHook("BeforeRemove",()=>{u(),e&&clearTimeout(e),p&&p.remove()})},_onMount:f=>{i=f.domElement;let p=b=>{if(!l.get()||!i||!s)return;let y=b.target;!i.contains(y)&&!s.contains(y)&&u()};f.getRoot().domElement.addEventListener("click",p),f.addHook("BeforeRemove",()=>f.getRoot().domElement.removeEventListener("click",p))}}}}function hi(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=Ct(n.value),l=Ct(r),{show:a,hide:m,anchorPartial:c}=H({open:l,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};Ae(n.content,d);let u={border:"none",outline:"none",padding:0,margin:0,flex:1,height:K(6),marginInlineStart:K(2),fontSize:p=>vt(p,"inherit"),color:p=>de(p,"shift-6",e),backgroundColor:p=>de(p,"inherit",e)},g;n.input?(Ae(n.input,{onFocus:()=>a(),style:u,_key:"combobox-input"}),g=n.input):g={input:null,onFocus:()=>a(),value:p=>(s.get(p),""),style:u,_key:"combobox-input"};let h={div:p=>{let b=s.get(p),y=Array.isArray(b)?b:[b],T=o.filter(G=>y.includes(G.value)).map(G=>({span:G.label,$:[we({color:e,removable:!0})],_key:G.value,_onRemove:Be=>{let se=s.get(),lt=(Array.isArray(se)?se:[se]).filter(eo=>eo!==G.value);i?s.set(lt):s.set(lt[0])}}));return T.push(g),T},style:{display:"flex",flexWrap:"wrap",gap:K(1)}},f={_onInsert:p=>{p.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:p=>p.children.insert(h),style:{minWidth:K(32),outlineOffset:"-1px",outline:p=>`1px solid ${de(p,"shift-3","neutral")}`,paddingBlock:K(1),paddingInline:K(1),borderRadius:K(2),fontSize:p=>vt(p,"inherit"),color:p=>de(p,"shift-6",e),backgroundColor:p=>de(p,"inherit",e)}};return Ae(c,f),c}import{toState as xt}from"@domphy/core";import{themeSpacing as We,themeColor as Et}from"@domphy/theme";function St(n={}){let{placement:o="bottom-end",color:t="neutral",sideOffset:e=We(6),bordered:r=!0}=n,i=xt(o),s={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"},l=xt(s[i.get()]);i.onChange(c=>l.set(s[c]));let a=c=>c.includes("start")?e:c.includes("end")?"auto":"50%",m=c=>c.includes("end")?e:c.includes("start")?"auto":"50%";return{style:{position:"relative","&::after":{content:'""',position:"absolute",width:We(1.5),height:We(1.5),backgroundColor:c=>Et(c,"inherit",t),borderWidth:r?"0px":"1px",borderColor:c=>Et(c,"inherit",t),borderTopStyle:c=>{let d=l.get(c);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:c=>{let d=l.get(c);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:c=>{let d=l.get(c);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:c=>{let d=l.get(c);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:c=>{let d=l.get(c);return d.includes("top")?0:d.includes("bottom")?"auto":a(d)},right:c=>{let d=l.get(c);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:c=>{let d=l.get(c);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:c=>{let d=l.get(c);return d.includes("left")?0:d.includes("right")?"auto":a(d)},transform:c=>{let d=l.get(c),u=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",g=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${u},${g}) rotate(45deg)`}}}}}import{themeSpacing as Ke,themeColor as kt,themeSize as zo}from"@domphy/theme";function Si(n={}){let{color:o="inherit"}=n;return{_onInsert:t=>{t.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-1",style:{fontSize:t=>zo(t,"inherit"),backgroundColor:t=>kt(t,"inherit",o),boxShadow:t=>`inset ${Ke(1)} 0 0 0 ${kt(t,"shift-3",o)}`,border:"none",paddingBlock:Ke(2),paddingInline:Ke(4),margin:0}}}import{themeSpacing as Ie,themeColor as N,themeSize as $o}from"@domphy/theme";function Pi(n={}){let{color:o="primary"}=n;return{_onInsert:t=>{t.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:t=>$o(t,"inherit"),paddingBlock:Ie(1),paddingInline:Ie(3),borderRadius:Ie(2),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:t=>`1px solid ${N(t,"shift-3",o)}`,color:t=>N(t,"shift-6",o),backgroundColor:t=>N(t,"inherit",o),"&:hover:not([disabled]):not([aria-busy=true])":{color:t=>N(t,"shift-7",o),backgroundColor:t=>N(t,"shift-1",o)},"&:focus-visible":{boxShadow:t=>`inset 0 0 0 ${Ie(.5)} ${N(t,"shift-6",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>N(t,"shift-1","neutral"),outline:t=>`1px solid ${N(t,"shift-3","neutral")}`,color:t=>N(t,"shift-5","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}import{themeColor as x,themeSpacing as O,themeSize as Mo}from"@domphy/theme";function zi(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"checkbox",_onInsert:e=>{e.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:e=>Mo(e,"inherit"),display:"inline-flex",position:"relative",width:O(6),height:O(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:O(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${x(e,"shift-4",o)}`,color:e=>x(e,"shift-6",o),width:O(4),height:O(4)},"&:hover::before":{backgroundColor:e=>x(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${x(e,"shift-5",t)}`,backgroundColor:e=>x(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>x(e,"shift-4",t)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:e=>`${O(.5)} solid ${x(e,"inherit",t)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:e=>`1px solid ${x(e,"shift-4",t)}`,backgroundColor:e=>x(e,"inherit",t)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:e=>x(e,"shift-5",t)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:e=>x(e,"shift-4",t)},"&:focus-visible":{borderRadius:O(1.5),outline:e=>`${O(.5)} solid ${x(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>x(e,"shift-3","neutral"),pointerEvents:"none"}}}}import{themeSpacing as je,themeColor as Tt,themeSize as No}from"@domphy/theme";function Ri(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:t=>No(t,"inherit"),color:t=>Tt(t,"shift-6",o),backgroundColor:t=>Tt(t,"inherit",o),height:je(6),paddingInline:je(1.5),borderRadius:je(1)}}}import{themeColor as B,themeSize as Pt,themeSpacing as v}from"@domphy/theme";function Bi(n={}){let{color:o="neutral",accentColor:t="primary",duration:e=240}=n;return{_onInsert:r=>{r.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:r=>Pt(r,"inherit"),color:r=>B(r,"shift-6",o),backgroundColor:r=>B(r,"inherit",o),overflow:"hidden","& > summary":{backgroundColor:r=>B(r,"shift-1",o),color:r=>B(r,"shift-7",o),fontSize:r=>Pt(r,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:v(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:v(4),height:v(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:v(2),height:v(2),flexShrink:0,marginTop:`-${v(.5)}`,borderInlineEnd:r=>`${v(.5)} solid ${B(r,"shift-6",o)}`,borderBottom:r=>`${v(.5)} solid ${B(r,"shift-6",o)}`,transform:"rotate(45deg)",transition:`transform ${e}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:r=>B(r,"shift-2",o)},"& > summary:focus-visible":{borderRadius:v(2),outlineOffset:`-${v(.5)}`,outline:r=>`${v(.5)} solid ${B(r,"shift-5",t)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:v(3),paddingTop:0,paddingBottom:0,transition:`max-height ${e}ms ease, opacity ${e}ms ease, padding ${e}ms ease`},"&[open] > :not(summary)":{maxHeight:v(250),opacity:1,paddingTop:v(1),paddingBottom:v(3)}}}}import{themeColor as wt,themeSpacing as It,themeSize as _t}from"@domphy/theme";function Ai(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${It(24)}, max-content) 1fr`,columnGap:It(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:t=>_t(t,"inherit"),color:t=>wt(t,"shift-7",o)},"& dd":{margin:0,fontSize:t=>_t(t,"inherit"),color:t=>wt(t,"shift-6",o)}}}}import{toState as Ro}from"@domphy/core";import{themeColor as _e,themeSize as Lo,themeSpacing as qe}from"@domphy/theme";function Yi(n={}){let{color:o="neutral",open:t=!1}=n,e=Ro(t);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,i)=>{if(r.target!==i.domElement)return;let s=i.domElement.getBoundingClientRect();r.clientX>=s.left&&r.clientX<=s.right&&r.clientY>=s.top&&r.clientY<=s.bottom||e.set(!1)},onTransitionEnd:(r,i)=>{let s=i.domElement;s.style.opacity==="0"&&(s.close(),document.body.style.overflow="")},_onMount:r=>{let i=r.domElement,s=l=>{l?(i.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{i.style.opacity="1";let a=i.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');a==null||a.focus()})):i.style.opacity="0"};s(e.get()),e.onChange(s)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>Lo(r,"inherit"),color:r=>_e(r,"shift-7",o),backgroundColor:r=>_e(r,"inherit",o),border:"none",padding:qe(3),boxShadow:r=>`0 ${qe(8)} ${qe(16)} ${_e(r,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:r=>_e(r,"shift-1","neutral"),opacity:.75}}}}import{themeColor as Ho,themeSize as Oo}from"@domphy/theme";function Ji(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:t=>Oo(t,"inherit"),fontStyle:"italic",color:t=>Ho(t,"shift-7",o)}}}import{themeColor as zt,themeSize as Bo,themeSpacing as ze}from"@domphy/theme";function tl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:ze(2),marginInline:0,marginTop:ze(3),marginBottom:ze(3),color:t=>zt(t,"shift-6",o),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:ze(2)},"& figcaption":{fontSize:t=>Bo(t,"decrease-1"),color:t=>zt(t,"shift-5",o),lineHeight:1.45}}}}import{themeColor as $e,themeSpacing as R,themeSize as Ye}from"@domphy/theme";function nl(n={}){let{color:o="neutral",layout:t="horizontal"}=n,e=t==="vertical";return{_onInsert:r=>{r.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:R(3),paddingBlock:R(3),border:"none",borderRadius:R(2),fontSize:r=>Ye(r,"inherit"),backgroundColor:r=>$e(r,"inherit",o),display:"grid",gridTemplateColumns:e?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:R(4),rowGap:R(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>Ye(r,"inherit"),fontWeight:600,paddingBlock:R(1),borderRadius:R(2),color:r=>$e(r,"shift-6",o),backgroundColor:r=>$e(r,"inherit",o)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:e?0:R(1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:e?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:e?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:e?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${R(2)} * -1)`,fontSize:r=>Ye(r,"decrease-1"),color:r=>$e(r,"shift-6",o)}}}}import{themeColor as Do,themeSize as Fo,themeSpacing as Vo}from"@domphy/theme";var Ao={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function sl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{["h1","h2","h3","h4","h5","h6"].includes(t.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:t=>Do(t,"shift-8",o),marginTop:0,marginBottom:Vo(2),fontSize:t=>{let e=Ao[t.elementNode.tagName]||"inherit";return Fo(t,e)}}}}import{themeColor as Wo,themeSpacing as $t}from"@domphy/theme";function ul(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:$t(3),marginBottom:$t(3),backgroundColor:t=>Wo(t,"shift-3",o)}}}import{themeColor as Ko,themeSpacing as jo}from"@domphy/theme";function gl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:jo(2),backgroundColor:t=>Ko(t,"shift-1",o)}}}import{themeSpacing as Mt}from"@domphy/theme";function Cl(){return{_onInsert:n=>{n.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:Mt(6),height:Mt(6)}}}import{themeColor as Nt,themeSpacing as Q,themeSize as qo}from"@domphy/theme";function El(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"color",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:e=>qo(e,"inherit"),paddingBlock:Q(1),paddingInline:Q(1),blockSize:Q(8),inlineSize:Q(8),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:Q(1)},"&::-moz-color-swatch":{borderRadius:Q(1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>Nt(e,"shift-1","neutral"),outline:e=>`1px solid ${Nt(e,"shift-3","neutral")}`}}}}import{themeColor as D,themeSpacing as ue,themeSize as Yo}from"@domphy/theme";function Pl(n={}){let{mode:o="datetime-local",color:t="neutral",accentColor:e="primary"}=n;return{type:o,_onSchedule:(r,i)=>{r.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),i.type=o},style:{fontFamily:"inherit",fontSize:r=>Yo(r,"inherit"),lineHeight:"inherit",color:r=>D(r,"shift-6",t),backgroundColor:r=>D(r,"inherit",t),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${D(r,"shift-3",t)}`,borderRadius:ue(2),paddingInline:ue(3),height:ue(8),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${ue(.5)} solid ${D(r,"shift-5",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>D(r,"shift-5","neutral"),backgroundColor:r=>D(r,"shift-1","neutral"),outline:r=>`1px solid ${D(r,"shift-3","neutral")}`},"&:invalid":{outline:r=>`${ue(.5)} solid ${D(r,"shift-5","error")}`}}}}import{themeColor as E,themeSpacing as P,themeSize as Go}from"@domphy/theme";function zl(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"file",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),r.type="file"},style:{fontFamily:"inherit",fontSize:e=>Go(e,"inherit"),lineHeight:"inherit",color:e=>E(e,"shift-6",o),backgroundColor:e=>E(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${E(e,"shift-3",o)}`,borderRadius:P(2),height:P(8),paddingInline:P(1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>E(e,"shift-7",t),backgroundColor:e=>E(e,"shift-2",t)},"&::-webkit-file-upload-button":{marginTop:P(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>E(e,"shift-7",o),backgroundColor:e=>E(e,"shift-2",o)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${P(.5)} solid ${E(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>E(e,"shift-5","neutral"),outline:e=>`1px solid ${E(e,"shift-3","neutral")}`,backgroundColor:e=>E(e,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:e=>E(e,"shift-5","neutral"),backgroundColor:e=>E(e,"shift-2","neutral")}}}}import{themeColor as F,themeSpacing as pe,themeSize as Uo}from"@domphy/theme";function Rl(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"search",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),r.type="search"},style:{fontFamily:"inherit",fontSize:e=>Uo(e,"inherit"),lineHeight:"inherit",color:e=>F(e,"shift-6",o),backgroundColor:e=>F(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${F(e,"shift-3",o)}`,borderRadius:pe(2),minWidth:pe(32),paddingInline:pe(3),paddingBlock:pe(1),"&::placeholder":{color:e=>F(e,"shift-4",o)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${pe(.5)} solid ${F(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>F(e,"shift-5","neutral"),backgroundColor:e=>F(e,"shift-1","neutral"),outline:e=>`1px solid ${F(e,"shift-3","neutral")}`}}}}import{themeColor as S,themeSpacing as V,themeSize as Xo}from"@domphy/theme";function Bl(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"text",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),r.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:V(32),paddingInline:V(3),paddingBlock:V(1),borderRadius:V(2),fontSize:e=>Xo(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${S(e,"shift-3",o)}`,color:e=>S(e,"shift-6",o),backgroundColor:e=>S(e,"inherit",o),"&::placeholder":{color:e=>S(e,"shift-4")},"&:not(:placeholder-shown)":{color:e=>S(e,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${V(.5)} solid ${S(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>S(e,"shift-1","neutral"),outline:e=>`1px solid ${S(e,"shift-3","neutral")}`,color:e=>S(e,"shift-5","neutral")},"&:invalid:not(:placeholder-shown)":{outline:e=>`${V(.5)} solid ${S(e,"shift-5","error")}`},"&[data-status=error]":{outline:e=>`${V(.5)} solid ${S(e,"shift-5","error")}`},"&[data-status=warning]":{outline:e=>`${V(.5)} solid ${S(e,"shift-5","warning")}`}}}}import{themeColor as j,themeSpacing as C}from"@domphy/theme";function Al(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"range",_onInsert:e=>{e.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:C(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>j(e,"shift-2",o)},"&::-moz-range-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>j(e,"shift-2",o)},"&::-webkit-slider-thumb":{appearance:"none",width:C(4),height:C(4),borderRadius:C(999),border:"none",marginTop:`calc((${C(1.5)} - ${C(4)}) / 2)`,backgroundColor:e=>j(e,"shift-6",t)},"&::-moz-range-thumb":{width:C(4),height:C(4),borderRadius:C(999),border:"none",backgroundColor:e=>j(e,"shift-6",t)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:e=>j(e,"shift-7",t)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:e=>j(e,"shift-7",t)},"&:focus-visible":{outline:e=>`${C(.5)} solid ${j(e,"shift-4",t)}`,outlineOffset:C(1),borderRadius:C(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as q,themeSpacing as he,themeSize as Jo}from"@domphy/theme";function ql(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"number",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),r.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:he(32),paddingInline:he(3),paddingBlock:he(1),borderRadius:he(2),fontSize:e=>Jo(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${q(e,"shift-3",o)}`,color:e=>q(e,"shift-6",o),backgroundColor:e=>q(e,"inherit",o),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${he(.5)} solid ${q(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>q(e,"shift-1","neutral"),outline:e=>`1px solid ${q(e,"shift-3","neutral")}`,color:e=>q(e,"shift-5","neutral")}}}}import{themeColor as Ge,themeSize as Qo,themeSpacing as Ue}from"@domphy/theme";function Xl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:t=>Qo(t,"inherit"),color:t=>Ge(t,"shift-6",o),backgroundColor:t=>Ge(t,"inherit",o),paddingBlock:Ue(.5),paddingInline:Ue(1.5),borderRadius:Ue(1),outline:t=>`1px solid ${Ge(t,"shift-3",o)}`}}}import{themeColor as Xe,themeSize as Zo,themeSpacing as er}from"@domphy/theme";function ea(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:er(2),fontSize:e=>Zo(e,"inherit"),color:e=>Xe(e,"shift-6",o),cursor:"pointer","&:focus-within":{color:e=>Xe(e,"shift-7",t)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:e=>Xe(e,"shift-5","neutral")}}}}import{themeColor as fe,themeSize as tr,themeSpacing as Je}from"@domphy/theme";function ra(n={}){let{color:o="primary",accentColor:t="secondary"}=n;return{_onInsert:e=>{e.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:e=>tr(e,"inherit"),color:e=>fe(e,"shift-6",o),textDecoration:"none","&:visited":{color:e=>fe(e,"shift-6",t)},"&:hover:not([disabled])":{color:e=>fe(e,"shift-7",o),textDecoration:"underline"},"&:focus-visible":{borderRadius:Je(1),outlineOffset:Je(1),outline:e=>`${Je(.5)} solid ${fe(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>fe(e,"shift-5","neutral")}}}}import{themeSpacing as Qe,themeSize as or,themeColor as Rt}from"@domphy/theme";function sa(n={}){let{accentColor:o="highlight",tone:t="shift-1"}=n;return{_onInsert:e=>{e.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:t,style:{display:"inline-flex",alignItems:"center",fontSize:e=>or(e,"inherit"),color:e=>Rt(e,"shift-6",o),backgroundColor:e=>Rt(e,"inherit",o),height:Qe(6),borderRadius:Qe(1),paddingInline:Qe(1.5)}}}import{themeColor as rr,themeSize as nr}from"@domphy/theme";function pa(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:t=>nr(t,"inherit"),color:t=>rr(t,"shift-6",o),lineHeight:1.5,marginTop:0,marginBottom:0}}}import{themeColor as Lt,themeSpacing as Ze,themeSize as ir}from"@domphy/theme";function ba(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:t=>ir(t,"inherit"),color:t=>Lt(t,"shift-6",o),backgroundColor:t=>Lt(t,"shift-1",o),border:"none",paddingBlock:Ze(2),paddingInline:Ze(3),borderRadius:Ze(2)}}}import{themeColor as Me,themeSpacing as ge}from"@domphy/theme";function xa(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:ge(2),border:0,borderRadius:ge(999),overflow:"hidden",backgroundColor:e=>Me(e,"shift-2",o),"&::-webkit-progress-bar":{backgroundColor:e=>Me(e,"shift-2",o),borderRadius:ge(999)},"&::-webkit-progress-value":{backgroundColor:e=>Me(e,"shift-6",t),borderRadius:ge(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:e=>Me(e,"shift-6",t),borderRadius:ge(999)}}}}import{themeColor as A,themeSize as lr,themeSpacing as be}from"@domphy/theme";function Ta(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"radio",_onInsert:e=>{if(e.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:e=>lr(e,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:be(6),height:be(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:e=>`1px solid ${A(e,"shift-4",o)}`,color:e=>A(e,"shift-6",o),width:be(4),height:be(4)},"&:hover::before":{backgroundColor:e=>A(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${A(e,"shift-5",t)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:e=>A(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>A(e,"shift-4",t)},"&:focus-visible":{borderRadius:"50%",outline:e=>`${be(.5)} solid ${A(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>A(e,"shift-3","neutral"),pointerEvents:"none"}}}}import{themeColor as w,themeSize as ar,themeSpacing as Y}from"@domphy/theme";function Ia(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:e=>ar(e,"inherit"),lineHeight:"inherit",color:e=>w(e,"shift-6",o),backgroundColor:e=>w(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${w(e,"shift-3",o)}`,borderRadius:Y(2),paddingBlock:Y(1),paddingLeft:Y(3),paddingRight:Y(1),"&:not([multiple])":{height:Y(8)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${Y(.5)} solid ${w(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${Y(.5)} solid ${w(e,"shift-5",t)}`},"& optgroup":{color:e=>w(e,"shift-8",o)},"& option[disabled]":{color:e=>w(e,"shift-4","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>w(e,"shift-5","neutral"),outline:e=>`1px solid ${w(e,"shift-3","neutral")}`,backgroundColor:e=>w(e,"shift-1","neutral")}}}}import{hashString as sr}from"@domphy/core";import{themeColor as mr,themeSpacing as Ht}from"@domphy/theme";function Ma(n={}){let{color:o="neutral"}=n,t={"0%,100%":{opacity:1},"50%":{opacity:.4}},e=sr(JSON.stringify(t));return{ariaHidden:"true",style:{height:Ht(6),display:"block",borderRadius:Ht(1),backgroundColor:r=>mr(r,"shift-2",o),animation:`${e} 1.5s ease-in-out infinite`,[`@keyframes ${e}`]:t}}}import{hashString as cr}from"@domphy/core";import{themeColor as Ot,themeSpacing as et}from"@domphy/theme";var Dt={to:{transform:"rotate(360deg)"}},Bt=cr(JSON.stringify(Dt));function Ha(n={}){let{color:o="neutral"}=n;return{role:"status",ariaLabel:"loading",_onInsert:t=>{t.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{display:"inline-block",margin:0,flexShrink:0,width:et(6),height:et(6),borderRadius:"50%",border:t=>`${et(.5)} solid ${Ot(t,"shift-3",o)}`,borderTopColor:t=>Ot(t,"shift-6",o),boxSizing:"border-box",padding:0,animation:`${Bt} 0.7s linear infinite`,[`@keyframes ${Bt}`]:Dt}}}import{toState as dr}from"@domphy/core";import{themeColor as ur,themeSize as pr,themeSpacing as Ft}from"@domphy/theme";function Va(n={}){var s;let{color:o="neutral",multiple:t=!1}=n,e=dr((s=n.value)!=null?s:t?[]:null),r={div:l=>{let a=e.get(l);return(Array.isArray(a)?a:[a]).map(c=>({input:null,name:n.name,value:c||""}))},hidden:!0};return{dataTone:"shift-11",_context:{select:{value:e,multiple:t}},_onInit:l=>{l.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),l.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:Ft(2),paddingInline:Ft(2),fontSize:l=>pr(l,"inherit"),backgroundColor:l=>ur(l,"inherit",o)}}}import{themeSpacing as Ne,themeColor as Z,themeSize as hr}from"@domphy/theme";function ja(n={}){let{accentColor:o="primary",color:t="neutral",value:e=null}=n;return{role:"option",_onInit:i=>{i.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let s=i.getContext("select");if(s){let l=s.value;i.attributes.set("ariaSelected",a=>{let m=l.get(a);return s.multiple?m.includes(e):m==e}),i.addEvent("click",()=>{let a=l.get();s.multiple?a.includes(e)?l.set(a.filter(m=>m!==e)):l.set(a.concat([e])):a!=e&&l.set(e)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:i=>hr(i,"inherit"),height:Ne(8),paddingInline:Ne(3),border:"none",outline:"none",color:i=>Z(i,"shift-6",t),backgroundColor:i=>Z(i,"inherit",t),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:i=>Z(i,"shift-1",t)},"&[aria-selected=true]":{backgroundColor:i=>Z(i,"shift-2",o),color:i=>Z(i,"shift-8")},"&:focus-visible":{outline:i=>`${Ne(.5)} solid ${Z(i,"shift-5",o)}`,outlineOffset:`-${Ne(.5)}`}}}}import{toState as Vt,merge as At}from"@domphy/core";import{themeSpacing as ye,themeColor as tt,themeSize as fr}from"@domphy/theme";function Ja(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=Vt(n.value),l=Vt(r),{show:a,hide:m,anchorPartial:c}=H({open:l,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};At(n.content,d);let u={div:h=>{let f=s.get(h),p=Array.isArray(f)?f:[f];return o.filter(y=>p.includes(y.value)).map(y=>({span:y.label,$:[we({color:e,removable:i})],_key:y.value,_onRemove:ve=>{let T=s.get(),Be=(Array.isArray(T)?T:[T]).filter(se=>se!==y.value);i?s.set(Be):s.set(Be[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:ye(1),flex:1}},g={_onInsert:h=>{h.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:h=>h.children.insert(u),onClick:()=>l.get()?m():a(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:ye(8),minWidth:ye(32),outlineOffset:"-1px",outline:h=>`1px solid ${tt(h,"shift-3","neutral")}`,paddingInline:ye(2),borderRadius:ye(2),fontSize:h=>fr(h,"inherit"),color:h=>tt(h,"shift-6",e),backgroundColor:h=>tt(h,"inherit",e)}};return At(c,g),c}import{themeColor as ot,themeSize as Wt,themeSpacing as L}from"@domphy/theme";function ts(n={}){let{accentColor:o="primary"}=n;return{dataTone:"increase-2",type:"checkbox",_onSchedule:t=>{if(t.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:t=>Wt(t,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:L(8),height:L(6),cursor:"pointer",margin:"0",paddingBlock:L(1),"&:checked":{"&::before":{backgroundColor:t=>ot(t,"increase-3",o)},"&::after":{left:`calc(100% - ${L(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:L(3),height:L(3),borderRadius:L(999),left:L(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:t=>ot(t,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:L(999),display:"inline-block",fontSize:t=>Wt(t,"inherit"),lineHeight:1,backgroundColor:t=>ot(t)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as gr}from"@domphy/core";import{themeColor as ee,themeSize as br,themeSpacing as k}from"@domphy/theme";function is(n={}){let{checked:o=!1,accentColor:t="primary",color:e="neutral"}=n,r=gr(o);return{_onSchedule:i=>{i.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:i=>r.get(i),dataTone:"increase-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:i=>br(i),border:"none",outlineWidth:"1px",outline:i=>`1px solid ${ee(i,"shift-2",e)}`,minWidth:k(12),minHeight:k(6),borderRadius:k(999),paddingLeft:k(7),paddingRight:k(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:i=>ee(i,"inherit",e),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:k(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:k(5),height:k(5),borderRadius:k(999),color:i=>ee(i,"shift-6"),backgroundColor:i=>ee(i,"decrease-2",e)},"&[aria-checked=true]":{backgroundColor:i=>ee(i,"increase-3",t),outline:"none",color:i=>ee(i,"decrease-2"),paddingLeft:k(2),paddingRight:k(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${k(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as yr,themeSize as Cr}from"@domphy/theme";function ms(n={}){let{color:o="neutral"}=n;return{dataSize:"decrease-1",_onInsert:t=>{t.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:t=>Cr(t,"inherit"),color:t=>yr(t,"shift-6",o)}}}import{themeColor as vr,themeSize as xr}from"@domphy/theme";function ps(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:t=>xr(t,"inherit"),fontWeight:700,color:t=>vr(t,"shift-8",o)}}}import{themeColor as Er,themeSize as Sr}from"@domphy/theme";function bs(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:t=>Sr(t,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:t=>Er(t,"shift-6",o)}}}import{themeColor as kr,themeSize as Tr}from"@domphy/theme";function xs(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:t=>Tr(t,"decrease-1"),verticalAlign:"super",lineHeight:0,color:t=>kr(t,"shift-6",o)}}}import{themeColor as I,themeSpacing as te,themeSize as Kt}from"@domphy/theme";function ks(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:t=>Kt(t,"inherit"),color:t=>I(t,"shift-6",o),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:te(3),paddingBlock:te(1),color:t=>I(t,"shift-7",o),backgroundColor:t=>I(t,"inherit")},"& td":{textAlign:"left",paddingInline:te(3),paddingBlock:te(1),color:t=>I(t,"shift-6",o),boxShadow:t=>`inset 0 1px 0 ${I(t,"shift-3",o)}`,fontSize:t=>Kt(t,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:te(3),paddingBlock:te(1),color:t=>I(t,"shift-7",o),backgroundColor:t=>I(t,"inherit"),boxShadow:t=>`inset 0 -1px 0 ${I(t,"shift-3",o)}`},"& tr":{backgroundColor:t=>I(t,"inherit")},"& tbody tr:hover":{backgroundColor:t=>I(t,"shift-2")+"!important"}}}}import{themeColor as _,themeSpacing as oe,themeSize as Pr}from"@domphy/theme";function Is(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:oe(4),paddingBlock:oe(2),border:"none",borderRadius:oe(2),fontSize:e=>Pr(e,"inherit"),color:e=>_(e,"shift-6",o),outlineOffset:"-1px",outline:e=>`1px solid ${_(e,"shift-3",o)}`,backgroundColor:e=>_(e,"inherit",o),"&::placeholder":{color:e=>_(e,"shift-4")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${oe(.5)} solid ${_(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${oe(.5)} solid ${_(e,"shift-5",t)}`},"&:invalid":{outline:e=>`${oe(.5)} solid ${_(e,"shift-4","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>_(e,"shift-5","neutral"),outline:e=>`1px solid ${_(e,"shift-3","neutral")}`,backgroundColor:e=>_(e,"shift-1","neutral")}}}}import{themeColor as wr,themeSize as Ir,themeSpacing as _r}from"@domphy/theme";function Ms(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:t=>Ir(t,"inherit"),color:t=>wr(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:_r(3),listStyleType:"disc",listStylePosition:"outside"}}}import{themeColor as zr,themeSize as $r,themeSpacing as Mr}from"@domphy/theme";function Hs(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:t=>$r(t,"inherit"),color:t=>zr(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:Mr(3),listStyleType:"decimal",listStylePosition:"outside"}}}import{toState as Nr}from"@domphy/core";import{themeColor as re,themeSize as Rr,themeSpacing as ne}from"@domphy/theme";function Lr(n,o){if(o<=7)return Array.from({length:o},(i,s)=>s+1);let t=[1];n>3&&t.push("...");let e=Math.max(2,n-1),r=Math.min(o-1,n+1);for(let i=e;i<=r;i++)t.push(i);return n<o-2&&t.push("..."),t.push(o),t}function Fs(n){var l;let{total:o,color:t="neutral",accentColor:e="primary"}=n,r=Nr((l=n.value)!=null?l:1),i={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:ne(8),height:ne(8),paddingInline:ne(2),borderRadius:ne(2),border:"none",cursor:"pointer",fontSize:a=>Rr(a,"inherit"),backgroundColor:"transparent",color:a=>re(a,"shift-6",t),"&:hover:not([disabled])":{backgroundColor:a=>re(a,"shift-1",t)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},s=ct(mt({},i),{backgroundColor:a=>re(a,"shift-2",e),color:a=>re(a,"shift-8",e),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:a=>re(a,"shift-2",e)}});return{_onInsert:a=>{a.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:a=>{let m={div:c=>{let d=r.get(c),u=[];u.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&r.set(d-1),style:i});for(let g of Lr(d,o))if(g==="...")u.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:ne(2),color:h=>re(h,"shift-4",t)}});else{let h=g===d;u.push({button:String(g),type:"button",ariaLabel:`Page ${g}`,ariaCurrent:h?"page":void 0,disabled:h,onClick:()=>r.set(g),style:h?s:i})}return u.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=o,onClick:()=>d<o&&r.set(d+1),style:i}),u},style:{display:"flex",alignItems:"center",gap:ne(1)}};a.children.insert(m)},style:{display:"inline-flex"}}}import{themeColor as jt,themeSize as Hr,themeSpacing as Or}from"@domphy/theme";function Ks(n={}){let{color:o="neutral"}=n;return{role:"separator",_onInsert:t=>{t.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:Or(2),fontSize:t=>Hr(t,"inherit"),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:t=>jt(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:t=>jt(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"}}}}import{toState as Br}from"@domphy/core";import{themeColor as Re,themeSize as Dr,themeSpacing as Ce}from"@domphy/theme";var qt={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Fr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},rt=n=>n==="left"||n==="right";function Gs(n={}){let{color:o="neutral",open:t=!1,placement:e="right",size:r}=n,i=Br(t),s=rt(e)?Ce(80):Ce(64),l=r!=null?r:s;return{_onInsert:a=>{a.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(a,m)=>{a.target===m.domElement&&i.set(!1)},onTransitionEnd:(a,m)=>{let c=m.domElement;i.get()||(c.close(),document.body.style.overflow="")},_onMount:a=>{let m=a.domElement,c=d=>{d?(m.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{m.style.transform="translate(0, 0)"})):m.style.transform=qt[e]};c(i.get()),i.onChange(c)},style:{transform:qt[e],transition:"transform 0.25s ease",fontSize:a=>Dr(a,"inherit"),color:a=>Re(a,"shift-7",o),backgroundColor:a=>Re(a,"inherit",o),border:"none",padding:Ce(3),margin:Fr[e],width:rt(e)?l:"100dvw",height:rt(e)?"100dvh":l,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:a=>`0 ${Ce(4)} ${Ce(12)} ${Re(a,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:a=>Re(a,"shift-1","neutral"),opacity:.75}}}}import{toState as Vr,merge as Yt}from"@domphy/core";function tm(n){let{open:o=!1,placement:t="bottom",openOn:e="click"}=n,r=null,i=Vr(o),{show:s,hide:l,anchorPartial:a}=H({open:i,placement:t,content:n.content,onPlacement:n.onPlacement}),m={role:"dialog",dataTone:"shift-6",onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&l(),_onInsert:d=>{let u=d.attributes.get("id");r=u||d.nodeId,!u&&d.attributes.set("id",r)}};return Yt(n.content,m),Yt(a,{ariaHaspopup:"dialog",ariaExpanded:d=>i.get(d),onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&l(),onClick:()=>e==="click"&&(i.get()?l():s()),onFocus:()=>s(),onBlur:()=>l(),_onMount:d=>r&&d.attributes.set("ariaControls",r)}),a}import{toState as Ar}from"@domphy/core";import{themeColor as nt,themeSize as Wr,themeSpacing as W}from"@domphy/theme";function im(n={}){let{position:o="top-center",color:t="neutral"}=n,e=Ar(!1),r=o.startsWith("top"),i=o.endsWith("center"),s=o.endsWith("right"),l={div:[],id:`domphy-toast-${o}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":s?"end":"start",inset:0,gap:W(4),zIndex:30,padding:W(6),pointerEvents:"none"}};return{_portal:a=>{let m=a.domElement.querySelector(`#domphy-toast-${o}`);return m||(m=a.children.insert(l).domElement),m},role:"status",ariaAtomic:"true",style:{minWidth:W(32),pointerEvents:"auto",paddingBlock:W(2),paddingInline:W(4),borderRadius:W(2),fontSize:a=>Wr(a,"inherit"),color:a=>nt(a,"shift-1",t),backgroundColor:a=>nt(a,"shift-9",t),boxShadow:a=>`0 ${W(2)} ${W(8)} ${nt(a,"shift-3","neutral")}`,opacity:a=>Number(e.get(a)),transform:a=>e.get(a)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>e.set(!0)),_onBeforeRemove:(a,m)=>{let c=d=>{d.propertyName==="transform"&&(a.domElement.removeEventListener("transitionend",c),m())};a.domElement.addEventListener("transitionend",c),e.set(!1)}}}import{toState as Kr,merge as jr}from"@domphy/core";import{themeSpacing as it,themeColor as Gt,themeSize as qr}from"@domphy/theme";function fm(n={}){let{open:o=!1,placement:t="top",content:e="Tooltip Content"}=n,r=null,i=Kr(t),s=typeof e=="string"?{span:e}:e,{show:l,hide:a,anchorPartial:m}=H({open:o,placement:t,content:s}),c={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-11",_onInsert:u=>{let g=u.attributes.get("id");r=g||u.nodeId,!g&&u.attributes.set("id",r)},style:{paddingBlock:it(1),paddingInline:it(3),borderRadius:it(2),color:u=>Gt(u,"shift-6"),backgroundColor:u=>Gt(u),fontSize:u=>qr(u,"inherit")},$:[St({placement:t,bordered:!1})]};return s.$||(s.$=[]),s.$.push(c),jr(m,{onMouseEnter:()=>l(),onMouseLeave:()=>a(),onFocus:()=>l(),onBlur:()=>a(),onKeyDown:u=>u.key==="Escape"&&a(),_onMount:u=>r&&u.attributes.set("ariaDescribedby",r)}),m}import{ElementNode as Ut}from"@domphy/core";function Xt(n,o){return n.key!==void 0&&n.key!==null?String(n.key):`index-${o}`}function Cm(n={}){let{duration:o=300,delay:t=0}=n,e=new Map;return{_onBeforeUpdate:r=>{e=new Map,r.children.items.forEach((i,s)=>{if(!(i instanceof Ut))return;let l=i.domElement;l&&e.set(Xt(i,s),l.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((i,s)=>{if(!(i instanceof Ut))return;let l=i.domElement;if(!l)return;let a=Xt(i,s),m=e.get(a);if(!m)return;let c=l.getBoundingClientRect(),d=m.left-c.left,u=m.top-c.top;if(Math.abs(d)<.5&&Math.abs(u)<.5)return;let g=l.style.transition,h=l.style.transform;l.style.transition="none",l.style.transform=`translate(${d}px, ${u}px)`,l.getBoundingClientRect(),requestAnimationFrame(()=>{l.style.transition=`transform ${o}ms ease ${t}ms`,l.style.transform="translate(0px, 0px)"});let f=()=>{l.style.transition=g,l.style.transform=h,l.removeEventListener("transitionend",p)},p=b=>{b.propertyName==="transform"&&f()};l.addEventListener("transitionend",p),setTimeout(f,o+t+34)}),e.clear()}}}import{merge as Yr}from"@domphy/core";import{toState as Gr}from"@domphy/core";function Tm(n={}){return{role:"tablist",_onSchedule:(t,e)=>{let r={_context:{tabs:{activeKey:Gr(n.activeKey||0)}}};Yr(e,r)}}}import{themeSpacing as ie,themeColor as le,themeSize as Ur}from"@domphy/theme";function _m(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"tab",_onInsert:r=>{var m;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let i=r.getContext("tabs"),s=(m=r.parent)==null?void 0:m.children.items;s=s.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tab");let l=r.key||s.findIndex(c=>c==r),a={id:"tab"+r.parent.nodeId+l,ariaControls:"tabpanel"+r.parent.nodeId+l,ariaSelected:c=>i.activeKey.get(c)==l,onClick:()=>i.activeKey.set(l),onKeyDown:c=>{var p,b,y,ve;let d=c.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;c.preventDefault();let u=((b=(p=r.parent)==null?void 0:p.children.items)!=null?b:[]).filter(T=>T.type==="ElementNode"&&T.attributes.get("role")==="tab"),g=u.findIndex(T=>T===r),h=g;d==="ArrowRight"?h=(g+1)%u.length:d==="ArrowLeft"?h=(g-1+u.length)%u.length:d==="Home"?h=0:d==="End"&&(h=u.length-1);let f=u[h];i.activeKey.set((y=f.key)!=null?y:h),(ve=f.domElement)==null||ve.focus()}};r.merge(a)},style:{cursor:"pointer",fontSize:r=>Ur(r,"inherit"),height:ie(8),paddingInline:ie(4),border:"none",outline:"none",color:r=>le(r,"shift-6"),backgroundColor:r=>le(r,"inherit"),boxShadow:r=>`inset 0 -${ie(.5)} 0 0 ${le(r,"shift-2",t)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${ie(.5)} 0 0 ${le(r,"shift-3",t)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${ie(.5)} 0 0 ${le(r,"shift-4",o)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${ie(.5)} 0 0 ${le(r,"shift-6",o)}`}}}}import{themeSpacing as Jt}from"@domphy/theme";function Nm(){return{role:"tabpanel",style:{paddingBlock:Jt(2),paddingInline:Jt(2)},_onInsert:o=>{var s;let t=o.getContext("tabs"),e=(s=o.parent)==null?void 0:s.children.items;e=e.filter(l=>l.type=="ElementNode"&&l.attributes.get("role")=="tabpanel");let r=o.key||e.findIndex(l=>l==o),i={id:"tabpanel"+o.parent.nodeId+r,ariaLabelledby:"tab"+o.parent.nodeId+r,hidden:l=>t.activeKey.get(l)!=r};o.merge(i)}}}import{merge as Xr}from"@domphy/core";import{toState as Jr}from"@domphy/core";import{themeColor as Qr,themeSize as Zr,themeSpacing as Qt}from"@domphy/theme";function Fm(n={}){let{color:o="neutral"}=n;return{role:"menu",dataTone:"shift-11",_onSchedule:(e,r)=>{let i={_context:{menu:{activeKey:Jr(n.activeKey||0)}}};Xr(r,i)},style:{display:"flex",flexDirection:"column",paddingBlock:Qt(2),paddingInline:Qt(2),fontSize:e=>Zr(e,"inherit"),backgroundColor:e=>Qr(e,"inherit",o)}}}import{themeSpacing as Le,themeColor as ae,themeSize as en}from"@domphy/theme";function Km(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"menuitem",_onInsert:r=>{var a;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let i=r.getContext("menu"),s=(a=r.parent)==null?void 0:a.children.items;s=s.filter(m=>m.type=="ElementNode"&&m.attributes.get("role")=="menuitem");let l=r.key||s.findIndex(m=>m==r);r.attributes.set("ariaCurrent",m=>i.activeKey.get(m)==l||void 0),r.addEvent("click",()=>i.activeKey.set(l))},onKeyDown:(r,i)=>{var c,d,u;let s=r.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(s))return;r.preventDefault();let l=((d=(c=i.parent)==null?void 0:c.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="menuitem"),a=l.findIndex(g=>g===i),m=a;s==="ArrowDown"?m=(a+1)%l.length:s==="ArrowUp"?m=(a-1+l.length)%l.length:s==="Home"?m=0:s==="End"&&(m=l.length-1),(u=l[m].domElement)==null||u.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:r=>en(r,"inherit"),height:Le(8),paddingInline:Le(3),border:"none",outline:"none",color:r=>ae(r,"shift-6"),backgroundColor:r=>ae(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>ae(r,"shift-1")},"&[aria-current=true]":{backgroundColor:r=>ae(r,"shift-1",o),color:r=>ae(r,"shift-7")},"&:focus-visible":{outline:r=>`${Le(.5)} solid ${ae(r,"shift-5",o)}`,outlineOffset:`-${Le(.5)}`}}}}import{merge as tn}from"@domphy/core";function Gm(n){return{_onSchedule:(o,t)=>{tn(t,{_context:{form:n}})}}}function Xm(n,o){return{_onInsert:t=>{let r=t.getContext("form").setField(n,void 0,o),i=t.tagName,s=t.attributes.get("type");["input","select","textarea"].includes(i)||console.warn('"field" patch must use input, select, or textarea tag');let l={onBlur:()=>r.setTouched(),ariaInvalid:a=>!!r.message("error",a)||void 0,dataStatus:a=>r.status(a)};i==="input"&&s==="checkbox"?(l.checked=r.value(),l.onChange=a=>r.setValue(a.target.checked)):i==="input"&&s==="radio"?l.onChange=a=>r.setValue(a.target.value):i==="select"?(l.value=r.value(),l.onChange=a=>r.setValue(a.target.value)):i==="textarea"?(l.value=r.value(),l.onInput=a=>r.setValue(a.target.value)):(l.value=r.value(),l.onInput=a=>r.setValue(a.target.value)),t.merge(l)}}}import{Notifier as on}from"@domphy/core";function rn(n){return!!n&&typeof n.then=="function"}var Oe=class{constructor(o,t){this._notifier=new on;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=o,this._initValue=o,this._validator=t,t&&this.validate()}value(o){return o&&this._notifier.addListener("value",o),this._value}setValue(o){this._value=o,this._notifier.notify("value",o),this._notifier.notify("dirty",o!==this._initValue),this.validate()}dirty(o){return o&&this._notifier.addListener("dirty",o),this._value!==this._initValue}touched(o){return o&&this._notifier.addListener("touched",o),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(o,t){let e=!1;o!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=o,this._initValue=o,this._notifier.notify("value",o),this._notifier.notify("dirty",!1),e=!0),t!==void 0&&t!==this._validator&&(this._validator=t,e=!0),e&&this.validate()}message(o,t){return t&&this._notifier.addListener(o,t),this._messages[o]}status(o){return o&&this._notifier.addListener("status",o),He(this._messages)}setMessages(o){let t=this._messages;this._messages=o;for(let e of["error","warning","success"])t[e]!==o[e]&&this._notifier.notify(e,o[e]);He(t)!==He(o)&&this._notifier.notify("status",He(o))}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 o=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let t=this._validator(this._value);rn(t)?(this._pending=!0,Promise.resolve(t).then(e=>{o===this._validationToken&&(this._pending=!1,this.setMessages(e!=null?e:{}))}).catch(e=>{o===this._validationToken&&(this._pending=!1,console.error(e))})):(this._pending=!1,this.setMessages(t!=null?t:{}))}catch(t){o===this._validationToken&&(this._pending=!1),console.error(t)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function He(n){if(n.error)return"error";if(n.warning)return"warning";if(n.success)return"success"}var Zt=class{constructor(){this.fields=new Map}setField(o,t,e){let r=this.fields.get(o);return r?r.configure(t,e):(r=new Oe(t,e),this.fields.set(o,r)),r}getField(o){return this.setField(o)}removeField(o){var t;(t=this.fields.get(o))==null||t._dispose(),this.fields.delete(o)}get valid(){for(let o of this.fields.values())if(o._pending||o._messages.error)return!1;return!0}reset(){for(let o of this.fields.values())o.reset()}snapshot(){let o={};for(let[t,e]of this.fields)nn(o,t,e._value);return o}_dispose(){for(let o of this.fields.values())o._dispose();this.fields.clear()}};function nn(n,o,t){let e=o.split("."),r=n;for(let i=0;i<e.length-1;i++){let s=e[i];r[s]==null&&(r[s]=isNaN(Number(e[i+1]))?{}:[]),r=r[s]}r[e[e.length-1]]=t}export{Oe as FieldState,Zt as FormState,cn as abbreviation,Dn as alert,An as avatar,Yn as badge,Si as blockquote,Xn as breadcrumb,Zn as breadcrumbEllipsis,Pi as button,is as buttonSwitch,pn as card,Ri as code,hi as combobox,Sn as command,Tn as commandItem,kn as commandSearch,Ai as descriptionList,Bi as details,Yi as dialog,Ks as divider,Gs as drawer,Ji as emphasis,Xm as field,tl as figure,Gm as form,nl as formGroup,sl as heading,ul as horizontalRule,Cl as icon,gl as image,zi as inputCheckbox,El as inputColor,Pl as inputDateTime,zl as inputFile,ql as inputNumber,Hn as inputOTP,Ta as inputRadio,Al as inputRange,Rl as inputSearch,ts as inputSwitch,Bl as inputText,Xl as keyboard,ea as label,ra as link,sa as mark,Fm as menu,Km as menuItem,Hs as orderedList,Fs as pagination,pa as paragraph,tm as popover,St as popoverArrow,ba as preformated,xa as progress,Ia as select,Ja as selectBox,ja as selectItem,Va as selectList,Ma as skeleton,ms as small,Ha as spinner,bn as splitter,Cn as splitterHandle,yn as splitterPanel,ps as strong,bs as subscript,xs as superscript,_m as tab,Nm as tabPanel,ks as table,Tm as tabs,we as tag,Is as textarea,im as toast,In as toggle,Nn as toggleGroup,fm as tooltip,Cm as transitionGroup,Ms as unorderedList};
1
+ var zo=Object.defineProperty,$o=Object.defineProperties;var Mo=Object.getOwnPropertyDescriptors;var wt=Object.getOwnPropertySymbols;var No=Object.prototype.hasOwnProperty,Ro=Object.prototype.propertyIsEnumerable;var It=(n,o,t)=>o in n?zo(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,_t=(n,o)=>{for(var t in o||(o={}))No.call(o,t)&&It(n,t,o[t]);if(wt)for(var t of wt(o))Ro.call(o,t)&&It(n,t,o[t]);return n},zt=(n,o)=>$o(n,Mo(o));import{themeColor as Ie,themeSpacing as Lo}from"@domphy/theme";function Fn(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{color:e=>Ie(e,"shift-7",o),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:e=>Ie(e,"shift-4",o),textUnderlineOffset:Lo(.72),cursor:"help","&:hover":{color:e=>Ie(e,"shift-8",t),textDecorationColor:e=>Ie(e,"shift-6",t)}}}}import{themeColor as X,themeDensity as D,themeSpacing as z}from"@domphy/theme";function Wn(n={}){let{color:o="neutral"}=n;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:t=>z(D(t)*2),backgroundColor:t=>X(t,"inherit",o),color:t=>X(t,"shift-7",o),outline:t=>`1px solid ${X(t,"shift-3",o)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:t=>z(D(t)*2),paddingInline:t=>z(D(t)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:t=>z(D(t)*4),color:t=>X(t,"shift-6",o),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:t=>z(D(t)*2),height:"auto"},"& > div":{gridArea:"content",padding:t=>z(D(t)*4),color:t=>X(t,"shift-7",o)},"& > footer":{gridArea:"footer",display:"flex",gap:z(2),paddingBlock:t=>z(D(t)*2),paddingInline:t=>z(D(t)*4),borderTop:t=>`1px solid ${X(t,"shift-2",o)}`}}}}import{merge as Do,toState as Ho}from"@domphy/core";import{themeColor as Ye,themeSpacing as Oo}from"@domphy/theme";function Yn(n={}){let{direction:o="horizontal",defaultSize:t=50,min:e=10,max:r=90}=n;return{_onSchedule:(i,s)=>{Do(s,{_context:{splitter:{direction:o,size:Ho(t),min:e,max:r}}})},style:{display:"flex",flexDirection:o==="horizontal"?"row":"column",overflow:"hidden"}}}function Gn(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal"?"width":"height";t.style[e]=`${o.size.get()}%`,t.style.flexShrink="0",t.style.overflow="auto";let r=o.size.onChange(i=>{t.style[e]=`${i}%`});n.addHook("Remove",r)}}}function Un(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal";t.style.cursor=e?"col-resize":"row-resize";let r=i=>{i.preventDefault();let s=t.parentElement,a=m=>{let c=s.getBoundingClientRect(),d=e?(m.clientX-c.left)/c.width*100:(m.clientY-c.top)/c.height*100;o.size.set(Math.min(Math.max(d,o.min),o.max))},l=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)};t.addEventListener("mousedown",r),n.addHook("Remove",()=>t.removeEventListener("mousedown",r))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n=>Ye(n,"shift-2"),"&:hover":{backgroundColor:n=>Ye(n,"shift-3")},"&::after":{content:'""',borderRadius:Oo(999),backgroundColor:n=>Ye(n,"shift-4")}}}}import{merge as Bo,toState as Fo}from"@domphy/core";import{themeColor as $,themeDensity as _e,themeSize as $t,themeSpacing as J}from"@domphy/theme";function Zn(){return{_onSchedule:(n,o)=>{Bo(o,{_context:{command:{query:Fo("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function ei(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:e=>{let r=e.getContext("command"),i=e.domElement,s=()=>r.query.set(i.value);i.addEventListener("input",s),e.addHook("Remove",()=>i.removeEventListener("input",s))},style:{fontFamily:"inherit",fontSize:e=>$t(e,"inherit"),paddingInline:e=>J(_e(e)*3),paddingBlock:e=>J(_e(e)*2),border:"none",borderBottom:e=>`1px solid ${$(e,"shift-2",o)}`,outline:"none",color:e=>$(e,"shift-7",o),backgroundColor:e=>$(e,"inherit",o),"&::placeholder":{color:e=>$(e,"shift-4")},"&:focus-visible":{borderBottomColor:e=>$(e,"shift-5",t)}}}}function ti(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"option",_onMount:e=>{var l,m;let r=e.getContext("command"),i=e.domElement,s=(m=(l=i.textContent)==null?void 0:l.toLowerCase())!=null?m:"",a=r.query.onChange(c=>{i.hidden=c.length>0&&!s.includes(c.toLowerCase())});e.addHook("Remove",a)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:e=>$t(e,"inherit"),height:e=>J(6+_e(e)*2),paddingInline:e=>J(_e(e)*3),border:"none",outline:"none",color:e=>$(e,"shift-6",o),backgroundColor:e=>$(e,"inherit",o),"&:hover:not([disabled])":{backgroundColor:e=>$(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${J(.5)} solid ${$(e,"shift-5",t)}`,outlineOffset:`-${J(.5)}`}}}}import{themeColor as pe,themeSize as Vo,themeSpacing as Q}from"@domphy/theme";function ni(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"button",_onInsert:e=>{var l;e.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let r=e.getContext("toggleGroup"),s=((l=e.parent)==null?void 0:l.children.items).filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="button"),a=String(s.findIndex(m=>m===e));e.attributes.set("ariaPressed",m=>{let c=r.value.get(m);return Array.isArray(c)?c.includes(a):c===a}),e.addEvent("click",()=>{let m=r.value.get();if(r.multiple){let c=Array.isArray(m)?[...m]:[];r.value.set(c.includes(a)?c.filter(d=>d!==a):[...c,a])}else r.value.set(m===a?"":a)})},style:{cursor:"pointer",fontSize:e=>Vo(e,"inherit"),height:Q(6),paddingBlock:Q(1),paddingInline:Q(2),border:"none",borderRadius:Q(1),color:e=>pe(e,"shift-6",o),backgroundColor:e=>pe(e,"inherit",o),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:e=>pe(e,"shift-1",o)},"&[aria-pressed=true]":{backgroundColor:e=>pe(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${Q(.5)} solid ${pe(e,"shift-5",t)}`,outlineOffset:`-${Q(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as Ao}from"@domphy/core";import{themeSpacing as ze,themeColor as Mt,themeSize as Wo}from"@domphy/theme";function mi(n={}){var e;let{multiple:o=!1,color:t="neutral"}=n;return{role:"group",dataTone:"shift-1",_context:{toggleGroup:{value:Ao((e=n.value)!=null?e:o?[]:""),multiple:o}},style:{display:"flex",paddingBlock:ze(1),paddingInline:ze(1),gap:ze(1),borderRadius:ze(2),fontSize:r=>Wo(r,"inherit"),backgroundColor:r=>Mt(r,"inherit",t),outline:r=>`1px solid ${Mt(r,"shift-1",t)}`,outlineOffset:"-1px"}}}import{themeSpacing as Nt}from"@domphy/theme";function ui(){return{style:{display:"flex",alignItems:"center",gap:Nt(2),"& > *":{minWidth:Nt(8)+"!important"}},_onMount:n=>{let o=n.domElement,t=()=>Array.from(o.querySelectorAll("input")),e=s=>{let a=t(),l=s.target,m=a.indexOf(l);l.value&&m<a.length-1&&a[m+1].focus()},r=s=>{let a=t(),l=s.target,m=a.indexOf(l);s.key==="Backspace"&&!l.value&&m>0&&a[m-1].focus(),s.key==="ArrowLeft"&&m>0&&a[m-1].focus(),s.key==="ArrowRight"&&m<a.length-1&&a[m+1].focus()},i=s=>{var d,u,g;s.preventDefault();let a=(u=(d=s.clipboardData)==null?void 0:d.getData("text"))!=null?u:"",l=t(),m=l.indexOf(s.target);[...a].forEach((h,f)=>{l[m+f]&&(l[m+f].value=h)});let c=Math.min(m+a.length-1,l.length-1);(g=l[c])==null||g.focus()};o.addEventListener("input",e),o.addEventListener("keydown",r),o.addEventListener("paste",i),n.addHook("Remove",()=>{o.removeEventListener("input",e),o.removeEventListener("keydown",r),o.removeEventListener("paste",i)})}}}import{themeColor as Ge,themeDensity as Rt,themeSize as Ko,themeSpacing as $e}from"@domphy/theme";function fi(n={}){let{color:o="primary"}=n;return{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:$e(3),paddingBlock:t=>$e(Rt(t)*2),paddingInline:t=>$e(Rt(t)*4),boxShadow:t=>`inset ${$e(1)} 0 0 0 ${Ge(t,"shift-5",o)}`,backgroundColor:t=>Ge(t,"shift-1",o),color:t=>Ge(t,"shift-7",o),fontSize:t=>Ko(t,"inherit")}}}import{themeColor as Lt,themeSize as jo,themeSpacing as Dt}from"@domphy/theme";function yi(n={}){let{color:o="primary"}=n;return{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:Dt(8),height:Dt(8),fontSize:t=>jo(t,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:t=>Lt(t,"shift-3",o),color:t=>Lt(t,"shift-8",o),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}import{toState as qo}from"@domphy/core";import{themeSpacing as Ue,themeColor as Ht,themeSize as Yo}from"@domphy/theme";function Si(n={}){let{color:o="danger",label:t=999}=n,e=qo(t);return{style:{position:"relative","&::after":{content:r=>`"${e.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:Ue(1),minWidth:Ue(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>Yo(r,"decrease-1"),borderRadius:Ue(999),backgroundColor:r=>Ht(r,"shift-6",o),color:r=>Ht(r,"shift-0",o)}}}}import{themeColor as he,themeSize as Go,themeSpacing as Ot}from"@domphy/theme";function Pi(n={}){let{color:o="neutral",separator:t="/"}=n;return{_onInsert:e=>{e.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:e=>Go(e,"inherit"),gap:Ot(1),color:e=>he(e,"shift-6",o),backgroundColor:e=>he(e,"inherit",o),"& > *":{display:"inline-flex",alignItems:"center",color:e=>he(e,"shift-5",o)},"& > *:not(:last-child)::after":{content:`"${t}"`,color:e=>he(e,"shift-3",o),paddingInlineStart:Ot(1)},"& > [aria-current=page]":{color:e=>he(e,"shift-7",o),pointerEvents:"none"}}}}import{themeColor as Me,themeSize as Uo,themeSpacing as Ne}from"@domphy/theme";function _i(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:t=>Uo(t,"inherit"),paddingInline:Ne(1),border:"none",background:"none",cursor:"pointer",color:t=>Me(t,"shift-5",o),borderRadius:Ne(1),"&:hover":{color:t=>Me(t,"shift-7",o),backgroundColor:t=>Me(t,"shift-1",o)},"&:focus-visible":{outline:t=>`${Ne(.5)} solid ${Me(t,"shift-5",o)}`,outlineOffset:Ne(.5)}}}}import{toState as Ft,merge as Xe}from"@domphy/core";import{themeSpacing as j,themeColor as fe,themeDensity as Je,themeSize as Vt}from"@domphy/theme";import{themeColor as Re,themeSize as Xo,themeSpacing as M}from"@domphy/theme";var Jo='<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 Le(n={}){let{color:o="neutral",removable:t=!1}=n;return{dataTone:"shift-1",_onInit:e=>{let r={span:Jo,onClick:i=>{i.stopPropagation(),e.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:M(1),width:M(4),height:M(4),flexShrink:0,"&:hover":{backgroundColor:i=>Re(i,"shift-3",o)}}};t&&e.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:M(6),paddingBlock:"0px",borderRadius:M(1),paddingInlineStart:M(2),paddingInlineEnd:t?M(1):M(2),gap:M(2),fontSize:e=>Xo(e,"inherit"),backgroundColor:e=>Re(e,"inherit",o),color:e=>Re(e,"shift-6",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${Re(e,"shift-3",o)}`}}}import{toState as Bt,merge as Qo}from"@domphy/core";import{computePosition as Zo,autoUpdate as er,offset as tr,flip as or,shift as rr}from"@floating-ui/dom";function H(n){let{open:o=!1,placement:t="bottom"}=n,e=null,r=null,i=null,s=null,a=Bt(o),l=Bt(t),m=()=>{i&&s&&(r&&r(),r=er(i,s,()=>{Zo(i,s,{placement:l.get(),middleware:[tr(12),or(),rr()],strategy:"fixed"}).then(({x:f,y:p,placement:b})=>{var y;Object.assign(s.style,{left:`${f}px`,top:`${p}px`}),b!==l.get()&&l.set(b),(y=n.onPlacement)==null||y.call(n,i,s,b)})}),a.set(!0))},c=()=>{r&&r(),r=null,a.set(!1)},d=()=>{e&&clearTimeout(e),e=setTimeout(m,100)},u=()=>{e&&clearTimeout(e),e=setTimeout(c,100)},g={style:{position:"fixed",pointerEvents:"auto",visibility:f=>a.get(f)?"visible":"hidden"},_onMount:f=>s=f.domElement,_portal:f=>{let p=f.domElement.querySelector("#domphy-floating");if(!p){let b={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};p=f.children.insert(b).domElement}return p}};return Qo(n.content,g),{show:d,hide:u,anchorPartial:{onKeyDown:f=>f.key==="Escape"&&u(),_onSchedule:f=>{let p=null;f.getRoot().addHook("Init",b=>{p=b.children.insert(n.content)}),f.addHook("BeforeRemove",()=>{u(),e&&clearTimeout(e),p&&p.remove()})},_onMount:f=>{i=f.domElement;let p=b=>{if(!a.get()||!i||!s)return;let y=b.target;!i.contains(y)&&!s.contains(y)&&u()};f.getRoot().domElement.addEventListener("click",p),f.addHook("BeforeRemove",()=>f.getRoot().domElement.removeEventListener("click",p))}}}}function Ki(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=Ft(n.value),a=Ft(r),{show:l,hide:m,anchorPartial:c}=H({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};Xe(n.content,d);let u={border:"none",outline:"none",padding:0,margin:0,flex:1,height:j(6),marginInlineStart:j(2),fontSize:p=>Vt(p,"inherit"),color:p=>fe(p,"shift-6",e),backgroundColor:p=>fe(p,"inherit",e)},g;n.input?(Xe(n.input,{onFocus:()=>l(),style:u,_key:"combobox-input"}),g=n.input):g={input:null,onFocus:()=>l(),value:p=>(s.get(p),""),style:u,_key:"combobox-input"};let h={div:p=>{let b=s.get(p),y=Array.isArray(b)?b:[b],T=o.filter(U=>y.includes(U.value)).map(U=>({span:U.label,$:[Le({color:e,removable:!0})],_key:U.value,_onRemove:qe=>{let ue=s.get(),Pt=(Array.isArray(ue)?ue:[ue]).filter(_o=>_o!==U.value);i?s.set(Pt):s.set(Pt[0])}}));return T.push(g),T},style:{display:"flex",flexWrap:"wrap",gap:j(1)}},f={_onInsert:p=>{p.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:p=>p.children.insert(h),style:{minWidth:j(32),outlineOffset:"-1px",outline:p=>`1px solid ${fe(p,"shift-3","neutral")}`,paddingBlock:p=>j(Je(p)*1),paddingInline:p=>j(Je(p)*1),borderRadius:p=>j(Je(p)*1),fontSize:p=>Vt(p,"inherit"),color:p=>fe(p,"shift-6",e),backgroundColor:p=>fe(p,"inherit",e)}};return Xe(c,f),c}import{toState as At}from"@domphy/core";import{themeSpacing as Qe,themeColor as Wt}from"@domphy/theme";function Kt(n={}){let{placement:o="bottom-end",color:t="neutral",sideOffset:e=Qe(6),bordered:r=!0}=n,i=At(o),s={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"},a=At(s[i.get()]);i.onChange(c=>a.set(s[c]));let l=c=>c.includes("start")?e:c.includes("end")?"auto":"50%",m=c=>c.includes("end")?e:c.includes("start")?"auto":"50%";return{style:{position:"relative","&::after":{content:'""',position:"absolute",width:Qe(1.5),height:Qe(1.5),backgroundColor:c=>Wt(c,"inherit",t),borderWidth:r?"0px":"1px",borderColor:c=>Wt(c,"inherit",t),borderTopStyle:c=>{let d=a.get(c);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:c=>{let d=a.get(c);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:c=>{let d=a.get(c);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:c=>{let d=a.get(c);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:c=>{let d=a.get(c);return d.includes("top")?0:d.includes("bottom")?"auto":l(d)},right:c=>{let d=a.get(c);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:c=>{let d=a.get(c);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:c=>{let d=a.get(c);return d.includes("left")?0:d.includes("right")?"auto":l(d)},transform:c=>{let d=a.get(c),u=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",g=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${u},${g}) rotate(45deg)`}}}}}import{themeSpacing as Ze,themeColor as jt,themeDensity as qt,themeSize as nr}from"@domphy/theme";function Zi(n={}){let{color:o="inherit"}=n;return{_onInsert:t=>{t.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-1",style:{fontSize:t=>nr(t,"inherit"),backgroundColor:t=>jt(t,"inherit",o),boxShadow:t=>`inset ${Ze(1)} 0 0 0 ${jt(t,"shift-3",o)}`,border:"none",paddingBlock:t=>Ze(qt(t)*2),paddingInline:t=>Ze(qt(t)*4),margin:0}}}import{themeColor as N,themeDensity as et,themeSize as ir,themeSpacing as De}from"@domphy/theme";function ol(n={}){let{color:o="primary"}=n;return{_onInsert:t=>{t.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:t=>ir(t,"inherit"),paddingBlock:t=>De(et(t)*1),paddingInline:t=>De(et(t)*3),borderRadius:t=>De(et(t)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:t=>`1px solid ${N(t,"shift-3",o)}`,color:t=>N(t,"shift-6",o),backgroundColor:t=>N(t,"inherit",o),"&:hover:not([disabled]):not([aria-busy=true])":{color:t=>N(t,"shift-7",o),backgroundColor:t=>N(t,"shift-1",o)},"&:focus-visible":{boxShadow:t=>`inset 0 0 0 ${De(.5)} ${N(t,"shift-6",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>N(t,"shift-1","neutral"),outline:t=>`1px solid ${N(t,"shift-3","neutral")}`,color:t=>N(t,"shift-5","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}import{themeColor as x,themeSpacing as O,themeSize as lr}from"@domphy/theme";function ll(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"checkbox",_onInsert:e=>{e.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:e=>lr(e,"inherit"),display:"inline-flex",position:"relative",width:O(6),height:O(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:O(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${x(e,"shift-4",o)}`,color:e=>x(e,"shift-6",o),width:O(4),height:O(4)},"&:hover::before":{backgroundColor:e=>x(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${x(e,"shift-5",t)}`,backgroundColor:e=>x(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>x(e,"shift-4",t)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:e=>`${O(.5)} solid ${x(e,"inherit",t)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:e=>`1px solid ${x(e,"shift-4",t)}`,backgroundColor:e=>x(e,"inherit",t)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:e=>x(e,"shift-5",t)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:e=>x(e,"shift-4",t)},"&:focus-visible":{borderRadius:O(1.5),outline:e=>`${O(.5)} solid ${x(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>x(e,"shift-3","neutral"),pointerEvents:"none"}}}}import{themeSpacing as tt,themeColor as Yt,themeSize as ar}from"@domphy/theme";function cl(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:t=>ar(t,"inherit"),color:t=>Yt(t,"shift-6",o),backgroundColor:t=>Yt(t,"inherit",o),height:tt(6),paddingInline:tt(1.5),borderRadius:tt(1)}}}import{themeColor as B,themeDensity as ge,themeSize as Gt,themeSpacing as v}from"@domphy/theme";function hl(n={}){let{color:o="neutral",accentColor:t="primary",duration:e=240}=n;return{_onInsert:r=>{r.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:r=>Gt(r,"inherit"),color:r=>B(r,"shift-6",o),backgroundColor:r=>B(r,"inherit",o),overflow:"hidden","& > summary":{backgroundColor:r=>B(r,"shift-1",o),color:r=>B(r,"shift-7",o),fontSize:r=>Gt(r,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:v(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:r=>v(ge(r)*4),height:v(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:v(2),height:v(2),flexShrink:0,marginTop:`-${v(.5)}`,borderInlineEnd:r=>`${v(.5)} solid ${B(r,"shift-6",o)}`,borderBottom:r=>`${v(.5)} solid ${B(r,"shift-6",o)}`,transform:"rotate(45deg)",transition:`transform ${e}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:r=>B(r,"shift-2",o)},"& > summary:focus-visible":{borderRadius:r=>v(ge(r)*2),outlineOffset:`-${v(.5)}`,outline:r=>`${v(.5)} solid ${B(r,"shift-5",t)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:r=>v(ge(r)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${e}ms ease, opacity ${e}ms ease, padding ${e}ms ease`},"&[open] > :not(summary)":{maxHeight:v(250),opacity:1,paddingTop:r=>v(ge(r)*1),paddingBottom:r=>v(ge(r)*3)}}}}import{themeColor as Ut,themeSpacing as Xt,themeSize as Jt}from"@domphy/theme";function yl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${Xt(24)}, max-content) 1fr`,columnGap:Xt(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:t=>Jt(t,"inherit"),color:t=>Ut(t,"shift-7",o)},"& dd":{margin:0,fontSize:t=>Jt(t,"inherit"),color:t=>Ut(t,"shift-6",o)}}}}import{toState as sr}from"@domphy/core";import{themeColor as He,themeDensity as mr,themeSize as cr,themeSpacing as ot}from"@domphy/theme";function Sl(n={}){let{color:o="neutral",open:t=!1}=n,e=sr(t);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,i)=>{if(r.target!==i.domElement)return;let s=i.domElement.getBoundingClientRect();r.clientX>=s.left&&r.clientX<=s.right&&r.clientY>=s.top&&r.clientY<=s.bottom||e.set(!1)},onTransitionEnd:(r,i)=>{let s=i.domElement;s.style.opacity==="0"&&(s.close(),document.body.style.overflow="")},_onMount:r=>{let i=r.domElement,s=a=>{a?(i.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{i.style.opacity="1";let l=i.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');l==null||l.focus()})):i.style.opacity="0"};s(e.get()),e.onChange(s)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>cr(r,"inherit"),color:r=>He(r,"shift-7",o),backgroundColor:r=>He(r,"inherit",o),border:"none",padding:r=>ot(mr(r)*3),boxShadow:r=>`0 ${ot(8)} ${ot(16)} ${He(r,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:r=>He(r,"shift-1","neutral"),opacity:.75}}}}import{themeColor as dr,themeSize as ur}from"@domphy/theme";function wl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:t=>ur(t,"inherit"),fontStyle:"italic",color:t=>dr(t,"shift-7",o)}}}import{themeColor as Qt,themeSize as pr,themeSpacing as Oe}from"@domphy/theme";function $l(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:Oe(2),marginInline:0,marginTop:Oe(3),marginBottom:Oe(3),color:t=>Qt(t,"shift-6",o),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:Oe(2)},"& figcaption":{fontSize:t=>pr(t,"decrease-1"),color:t=>Qt(t,"shift-5",o),lineHeight:1.45}}}}import{themeColor as Be,themeDensity as Z,themeSpacing as R,themeSize as rt}from"@domphy/theme";function Rl(n={}){let{color:o="neutral",layout:t="horizontal"}=n,e=t==="vertical";return{_onInsert:r=>{r.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>R(Z(r)*3),paddingBlock:r=>R(Z(r)*3),border:"none",borderRadius:r=>R(Z(r)*2),fontSize:r=>rt(r,"inherit"),backgroundColor:r=>Be(r,"inherit",o),display:"grid",gridTemplateColumns:e?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:R(4),rowGap:R(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>rt(r,"inherit"),fontWeight:600,paddingBlock:r=>R(Z(r)*1),borderRadius:r=>R(Z(r)*2),color:r=>Be(r,"shift-6",o),backgroundColor:r=>Be(r,"inherit",o)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>e?"0px":R(Z(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:e?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:e?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:e?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${R(2)} * -1)`,fontSize:r=>rt(r,"decrease-1"),color:r=>Be(r,"shift-6",o)}}}}import{themeColor as hr,themeSize as fr,themeSpacing as gr}from"@domphy/theme";var br={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Ol(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{["h1","h2","h3","h4","h5","h6"].includes(t.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:t=>hr(t,"shift-8",o),marginTop:0,marginBottom:gr(2),fontSize:t=>{let e=br[t.elementNode.tagName]||"inherit";return fr(t,e)}}}}import{themeColor as yr,themeSpacing as Zt}from"@domphy/theme";function Al(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:Zt(3),marginBottom:Zt(3),backgroundColor:t=>yr(t,"shift-3",o)}}}import{themeColor as Cr,themeSpacing as vr}from"@domphy/theme";function ql(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:vr(2),backgroundColor:t=>Cr(t,"shift-1",o)}}}import{themeSpacing as eo}from"@domphy/theme";function Ul(){return{_onInsert:n=>{n.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:eo(6),height:eo(6)}}}import{themeColor as to,themeDensity as ee,themeSpacing as te,themeSize as xr}from"@domphy/theme";function Ql(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"color",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:e=>xr(e,"inherit"),paddingBlock:e=>te(ee(e)*1),paddingInline:e=>te(ee(e)*1),blockSize:e=>te(6+ee(e)*2),inlineSize:e=>te(6+ee(e)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:e=>te(ee(e)*1)},"&::-moz-color-swatch":{borderRadius:e=>te(ee(e)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>to(e,"shift-1","neutral"),outline:e=>`1px solid ${to(e,"shift-3","neutral")}`}}}}import{themeColor as F,themeDensity as nt,themeSpacing as be,themeSize as Er}from"@domphy/theme";function oa(n={}){let{mode:o="datetime-local",color:t="neutral",accentColor:e="primary"}=n;return{type:o,_onSchedule:(r,i)=>{r.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),i.type=o},style:{fontFamily:"inherit",fontSize:r=>Er(r,"inherit"),lineHeight:"inherit",color:r=>F(r,"shift-6",t),backgroundColor:r=>F(r,"inherit",t),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${F(r,"shift-3",t)}`,borderRadius:r=>be(nt(r)*1),paddingInline:r=>be(nt(r)*3),height:r=>be(6+nt(r)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${be(.5)} solid ${F(r,"shift-5",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>F(r,"shift-5","neutral"),backgroundColor:r=>F(r,"shift-1","neutral"),outline:r=>`1px solid ${F(r,"shift-3","neutral")}`},"&:invalid":{outline:r=>`${be(.5)} solid ${F(r,"shift-5","error")}`}}}}import{themeColor as E,themeDensity as it,themeSpacing as P,themeSize as Sr}from"@domphy/theme";function la(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"file",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),r.type="file"},style:{fontFamily:"inherit",fontSize:e=>Sr(e,"inherit"),lineHeight:"inherit",color:e=>E(e,"shift-6",o),backgroundColor:e=>E(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${E(e,"shift-3",o)}`,borderRadius:e=>P(it(e)*1),height:e=>P(6+it(e)*2),paddingInline:e=>P(it(e)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>E(e,"shift-7",t),backgroundColor:e=>E(e,"shift-2",t)},"&::-webkit-file-upload-button":{marginTop:P(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>E(e,"shift-7",o),backgroundColor:e=>E(e,"shift-2",o)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${P(.5)} solid ${E(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>E(e,"shift-5","neutral"),outline:e=>`1px solid ${E(e,"shift-3","neutral")}`,backgroundColor:e=>E(e,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:e=>E(e,"shift-5","neutral"),backgroundColor:e=>E(e,"shift-2","neutral")}}}}import{themeColor as V,themeDensity as lt,themeSpacing as ye,themeSize as kr}from"@domphy/theme";function ca(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"search",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),r.type="search"},style:{fontFamily:"inherit",fontSize:e=>kr(e,"inherit"),lineHeight:"inherit",color:e=>V(e,"shift-6",o),backgroundColor:e=>V(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${V(e,"shift-3",o)}`,borderRadius:e=>ye(lt(e)*1),minWidth:ye(32),paddingInline:e=>ye(lt(e)*3),paddingBlock:e=>ye(lt(e)*1),"&::placeholder":{color:e=>V(e,"shift-4",o)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${ye(.5)} solid ${V(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>V(e,"shift-5","neutral"),backgroundColor:e=>V(e,"shift-1","neutral"),outline:e=>`1px solid ${V(e,"shift-3","neutral")}`}}}}import{themeColor as S,themeDensity as at,themeSpacing as A,themeSize as Tr}from"@domphy/theme";function ha(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"text",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),r.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:A(32),paddingInline:e=>A(at(e)*3),paddingBlock:e=>A(at(e)*1),borderRadius:e=>A(at(e)*1),fontSize:e=>Tr(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${S(e,"shift-3",o)}`,color:e=>S(e,"shift-6",o),backgroundColor:e=>S(e,"inherit",o),"&::placeholder":{color:e=>S(e,"shift-4")},"&:not(:placeholder-shown)":{color:e=>S(e,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${A(.5)} solid ${S(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>S(e,"shift-1","neutral"),outline:e=>`1px solid ${S(e,"shift-3","neutral")}`,color:e=>S(e,"shift-5","neutral")},"&:invalid:not(:placeholder-shown)":{outline:e=>`${A(.5)} solid ${S(e,"shift-5","error")}`},"&[data-status=error]":{outline:e=>`${A(.5)} solid ${S(e,"shift-5","error")}`},"&[data-status=warning]":{outline:e=>`${A(.5)} solid ${S(e,"shift-5","warning")}`}}}}import{themeColor as q,themeSpacing as C}from"@domphy/theme";function ya(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"range",_onInsert:e=>{e.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:C(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>q(e,"shift-2",o)},"&::-moz-range-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>q(e,"shift-2",o)},"&::-webkit-slider-thumb":{appearance:"none",width:C(4),height:C(4),borderRadius:C(999),border:"none",marginTop:`calc((${C(1.5)} - ${C(4)}) / 2)`,backgroundColor:e=>q(e,"shift-6",t)},"&::-moz-range-thumb":{width:C(4),height:C(4),borderRadius:C(999),border:"none",backgroundColor:e=>q(e,"shift-6",t)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:e=>q(e,"shift-7",t)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:e=>q(e,"shift-7",t)},"&:focus-visible":{outline:e=>`${C(.5)} solid ${q(e,"shift-4",t)}`,outlineOffset:C(1),borderRadius:C(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as Y,themeDensity as st,themeSpacing as Ce,themeSize as Pr}from"@domphy/theme";function Ea(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"number",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),r.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:Ce(32),paddingInline:e=>Ce(st(e)*3),paddingBlock:e=>Ce(st(e)*1),borderRadius:e=>Ce(st(e)*1),fontSize:e=>Pr(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${Y(e,"shift-3",o)}`,color:e=>Y(e,"shift-6",o),backgroundColor:e=>Y(e,"inherit",o),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${Ce(.5)} solid ${Y(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>Y(e,"shift-1","neutral"),outline:e=>`1px solid ${Y(e,"shift-3","neutral")}`,color:e=>Y(e,"shift-5","neutral")}}}}import{themeColor as mt,themeSize as wr,themeSpacing as ct}from"@domphy/theme";function Pa(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:t=>wr(t,"inherit"),color:t=>mt(t,"shift-6",o),backgroundColor:t=>mt(t,"inherit",o),paddingBlock:ct(.5),paddingInline:ct(1.5),borderRadius:ct(1),outline:t=>`1px solid ${mt(t,"shift-3",o)}`}}}import{themeColor as dt,themeSize as Ir,themeSpacing as _r}from"@domphy/theme";function za(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:_r(2),fontSize:e=>Ir(e,"inherit"),color:e=>dt(e,"shift-6",o),cursor:"pointer","&:focus-within":{color:e=>dt(e,"shift-7",t)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:e=>dt(e,"shift-5","neutral")}}}}import{themeColor as ve,themeSize as zr,themeSpacing as ut}from"@domphy/theme";function Na(n={}){let{color:o="primary",accentColor:t="secondary"}=n;return{_onInsert:e=>{e.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:e=>zr(e,"inherit"),color:e=>ve(e,"shift-6",o),textDecoration:"none","&:visited":{color:e=>ve(e,"shift-6",t)},"&:hover:not([disabled])":{color:e=>ve(e,"shift-7",o),textDecoration:"underline"},"&:focus-visible":{borderRadius:ut(1),outlineOffset:ut(1),outline:e=>`${ut(.5)} solid ${ve(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>ve(e,"shift-5","neutral")}}}}import{themeSpacing as pt,themeSize as $r,themeColor as oo}from"@domphy/theme";function Oa(n={}){let{accentColor:o="highlight",tone:t="shift-1"}=n;return{_onInsert:e=>{e.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:t,style:{display:"inline-flex",alignItems:"center",fontSize:e=>$r(e,"inherit"),color:e=>oo(e,"shift-6",o),backgroundColor:e=>oo(e,"inherit",o),height:pt(6),borderRadius:pt(1),paddingInline:pt(1.5)}}}import{themeColor as Mr,themeSize as Nr}from"@domphy/theme";function Wa(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:t=>Nr(t,"inherit"),color:t=>Mr(t,"shift-6",o),lineHeight:1.5,marginTop:0,marginBottom:0}}}import{themeColor as ro,themeDensity as ht,themeSpacing as ft,themeSize as Rr}from"@domphy/theme";function Ya(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:t=>Rr(t,"inherit"),color:t=>ro(t,"shift-6",o),backgroundColor:t=>ro(t,"shift-1",o),border:"none",paddingBlock:t=>ft(ht(t)*2),paddingInline:t=>ft(ht(t)*3),borderRadius:t=>ft(ht(t)*2)}}}import{themeColor as Fe,themeSpacing as xe}from"@domphy/theme";function Ja(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:xe(2),border:0,borderRadius:xe(999),overflow:"hidden",backgroundColor:e=>Fe(e,"shift-2",o),"&::-webkit-progress-bar":{backgroundColor:e=>Fe(e,"shift-2",o),borderRadius:xe(999)},"&::-webkit-progress-value":{backgroundColor:e=>Fe(e,"shift-6",t),borderRadius:xe(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:e=>Fe(e,"shift-6",t),borderRadius:xe(999)}}}}import{themeColor as W,themeSize as Lr,themeSpacing as Ee}from"@domphy/theme";function ts(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"radio",_onInsert:e=>{if(e.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:e=>Lr(e,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:Ee(6),height:Ee(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:e=>`1px solid ${W(e,"shift-4",o)}`,color:e=>W(e,"shift-6",o),width:Ee(4),height:Ee(4)},"&:hover::before":{backgroundColor:e=>W(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${W(e,"shift-5",t)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:e=>W(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>W(e,"shift-4",t)},"&:focus-visible":{borderRadius:"50%",outline:e=>`${Ee(.5)} solid ${W(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>W(e,"shift-3","neutral"),pointerEvents:"none"}}}}import{themeColor as w,themeDensity as Se,themeSize as Dr,themeSpacing as G}from"@domphy/theme";function ns(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:e=>Dr(e,"inherit"),lineHeight:"inherit",color:e=>w(e,"shift-6",o),backgroundColor:e=>w(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${w(e,"shift-3",o)}`,borderRadius:e=>G(Se(e)*1),paddingBlock:e=>G(Se(e)*1),paddingLeft:e=>G(Se(e)*3),paddingRight:e=>G(Se(e)*1),"&:not([multiple])":{height:e=>G(6+Se(e)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${G(.5)} solid ${w(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${G(.5)} solid ${w(e,"shift-5",t)}`},"& optgroup":{color:e=>w(e,"shift-8",o)},"& option[disabled]":{color:e=>w(e,"shift-4","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>w(e,"shift-5","neutral"),outline:e=>`1px solid ${w(e,"shift-3","neutral")}`,backgroundColor:e=>w(e,"shift-1","neutral")}}}}import{hashString as Hr}from"@domphy/core";import{themeColor as Or,themeSpacing as no}from"@domphy/theme";function ss(n={}){let{color:o="neutral"}=n,t={"0%,100%":{opacity:1},"50%":{opacity:.4}},e=Hr(JSON.stringify(t));return{ariaHidden:"true",style:{height:no(6),display:"block",borderRadius:no(1),backgroundColor:r=>Or(r,"shift-2",o),animation:`${e} 1.5s ease-in-out infinite`,[`@keyframes ${e}`]:t}}}import{hashString as Br}from"@domphy/core";import{themeColor as io,themeSpacing as gt}from"@domphy/theme";var ao={to:{transform:"rotate(360deg)"}},lo=Br(JSON.stringify(ao));function us(n={}){let{color:o="neutral"}=n;return{role:"status",ariaLabel:"loading",_onInsert:t=>{t.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{display:"inline-block",margin:0,flexShrink:0,width:gt(6),height:gt(6),borderRadius:"50%",border:t=>`${gt(.5)} solid ${io(t,"shift-3",o)}`,borderTopColor:t=>io(t,"shift-6",o),boxSizing:"border-box",padding:0,animation:`${lo} 0.7s linear infinite`,[`@keyframes ${lo}`]:ao}}}import{toState as Fr}from"@domphy/core";import{themeColor as Vr,themeDensity as so,themeSize as Ar,themeSpacing as mo}from"@domphy/theme";function bs(n={}){var s;let{color:o="neutral",multiple:t=!1}=n,e=Fr((s=n.value)!=null?s:t?[]:null),r={div:a=>{let l=e.get(a);return(Array.isArray(l)?l:[l]).map(c=>({input:null,name:n.name,value:c||""}))},hidden:!0};return{dataTone:"shift-11",_context:{select:{value:e,multiple:t}},_onInit:a=>{a.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),a.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:a=>mo(so(a)*2),paddingInline:a=>mo(so(a)*2),fontSize:a=>Ar(a,"inherit"),backgroundColor:a=>Vr(a,"inherit",o)}}}import{themeSpacing as Ve,themeColor as oe,themeDensity as co,themeSize as Wr}from"@domphy/theme";function xs(n={}){let{accentColor:o="primary",color:t="neutral",value:e=null}=n;return{role:"option",_onInit:i=>{i.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let s=i.getContext("select");if(s){let a=s.value;i.attributes.set("ariaSelected",l=>{let m=a.get(l);return s.multiple?m.includes(e):m==e}),i.addEvent("click",()=>{let l=a.get();s.multiple?l.includes(e)?a.set(l.filter(m=>m!==e)):a.set(l.concat([e])):l!=e&&a.set(e)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:i=>Wr(i,"inherit"),height:i=>Ve(6+co(i)*2),paddingInline:i=>Ve(co(i)*3),border:"none",outline:"none",color:i=>oe(i,"shift-6",t),backgroundColor:i=>oe(i,"inherit",t),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:i=>oe(i,"shift-1",t)},"&[aria-selected=true]":{backgroundColor:i=>oe(i,"shift-2",o),color:i=>oe(i,"shift-8")},"&:focus-visible":{outline:i=>`${Ve(.5)} solid ${oe(i,"shift-5",o)}`,outlineOffset:`-${Ve(.5)}`}}}}import{toState as uo,merge as po}from"@domphy/core";import{themeSpacing as ke,themeColor as bt,themeDensity as yt,themeSize as Kr}from"@domphy/theme";function ws(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=uo(n.value),a=uo(r),{show:l,hide:m,anchorPartial:c}=H({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};po(n.content,d);let u={div:h=>{let f=s.get(h),p=Array.isArray(f)?f:[f];return o.filter(y=>p.includes(y.value)).map(y=>({span:y.label,$:[Le({color:e,removable:i})],_key:y.value,_onRemove:we=>{let T=s.get(),qe=(Array.isArray(T)?T:[T]).filter(ue=>ue!==y.value);i?s.set(qe):s.set(qe[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:ke(1),flex:1}},g={_onInsert:h=>{h.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:h=>h.children.insert(u),onClick:()=>a.get()?m():l(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:h=>ke(6+yt(h)*2),minWidth:ke(32),outlineOffset:"-1px",outline:h=>`1px solid ${bt(h,"shift-3","neutral")}`,paddingInline:h=>ke(yt(h)*2),borderRadius:h=>ke(yt(h)*1),fontSize:h=>Kr(h,"inherit"),color:h=>bt(h,"shift-6",e),backgroundColor:h=>bt(h,"inherit",e)}};return po(c,g),c}import{themeColor as Ct,themeSize as ho,themeSpacing as L}from"@domphy/theme";function $s(n={}){let{accentColor:o="primary"}=n;return{dataTone:"increase-2",type:"checkbox",_onSchedule:t=>{if(t.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:t=>ho(t,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:L(8),height:L(6),cursor:"pointer",margin:"0",paddingBlock:L(1),"&:checked":{"&::before":{backgroundColor:t=>Ct(t,"increase-3",o)},"&::after":{left:`calc(100% - ${L(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:L(3),height:L(3),borderRadius:L(999),left:L(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:t=>Ct(t,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:L(999),display:"inline-block",fontSize:t=>ho(t,"inherit"),lineHeight:1,backgroundColor:t=>Ct(t)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as jr}from"@domphy/core";import{themeColor as re,themeSize as qr,themeSpacing as k}from"@domphy/theme";function Ls(n={}){let{checked:o=!1,accentColor:t="primary",color:e="neutral"}=n,r=jr(o);return{_onSchedule:i=>{i.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:i=>r.get(i),dataTone:"increase-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:i=>qr(i),border:"none",outlineWidth:"1px",outline:i=>`1px solid ${re(i,"shift-2",e)}`,minWidth:k(12),minHeight:k(6),borderRadius:k(999),paddingLeft:k(7),paddingRight:k(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:i=>re(i,"inherit",e),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:k(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:k(5),height:k(5),borderRadius:k(999),color:i=>re(i,"shift-6"),backgroundColor:i=>re(i,"decrease-2",e)},"&[aria-checked=true]":{backgroundColor:i=>re(i,"increase-3",t),outline:"none",color:i=>re(i,"decrease-2"),paddingLeft:k(2),paddingRight:k(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${k(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as Yr,themeSize as Gr}from"@domphy/theme";function Bs(n={}){let{color:o="neutral"}=n;return{dataSize:"decrease-1",_onInsert:t=>{t.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:t=>Gr(t,"inherit"),color:t=>Yr(t,"shift-6",o)}}}import{themeColor as Ur,themeSize as Xr}from"@domphy/theme";function Ws(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:t=>Xr(t,"inherit"),fontWeight:700,color:t=>Ur(t,"shift-8",o)}}}import{themeColor as Jr,themeSize as Qr}from"@domphy/theme";function Ys(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:t=>Qr(t,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:t=>Jr(t,"shift-6",o)}}}import{themeColor as Zr,themeSize as en}from"@domphy/theme";function Js(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:t=>en(t,"decrease-1"),verticalAlign:"super",lineHeight:0,color:t=>Zr(t,"shift-6",o)}}}import{themeColor as I,themeDensity as ne,themeSpacing as ie,themeSize as fo}from"@domphy/theme";function em(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:t=>fo(t,"inherit"),color:t=>I(t,"shift-6",o),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-7",o),backgroundColor:t=>I(t,"inherit")},"& td":{textAlign:"left",paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-6",o),boxShadow:t=>`inset 0 1px 0 ${I(t,"shift-3",o)}`,fontSize:t=>fo(t,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-7",o),backgroundColor:t=>I(t,"inherit"),boxShadow:t=>`inset 0 -1px 0 ${I(t,"shift-3",o)}`},"& tr":{backgroundColor:t=>I(t,"inherit")},"& tbody tr:hover":{backgroundColor:t=>I(t,"shift-2")+"!important"}}}}import{themeColor as _,themeDensity as vt,themeSpacing as le,themeSize as tn}from"@domphy/theme";function nm(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:e=>le(vt(e)*4),paddingBlock:e=>le(vt(e)*2),border:"none",borderRadius:e=>le(vt(e)*2),fontSize:e=>tn(e,"inherit"),color:e=>_(e,"shift-6",o),outlineOffset:"-1px",outline:e=>`1px solid ${_(e,"shift-3",o)}`,backgroundColor:e=>_(e,"inherit",o),"&::placeholder":{color:e=>_(e,"shift-4")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${le(.5)} solid ${_(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${le(.5)} solid ${_(e,"shift-5",t)}`},"&:invalid":{outline:e=>`${le(.5)} solid ${_(e,"shift-4","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>_(e,"shift-5","neutral"),outline:e=>`1px solid ${_(e,"shift-3","neutral")}`,backgroundColor:e=>_(e,"shift-1","neutral")}}}}import{themeColor as on,themeSize as rn,themeSpacing as nn}from"@domphy/theme";function sm(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:t=>rn(t,"inherit"),color:t=>on(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:nn(3),listStyleType:"disc",listStylePosition:"outside"}}}import{themeColor as ln,themeSize as an,themeSpacing as sn}from"@domphy/theme";function um(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:t=>an(t,"inherit"),color:t=>ln(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:sn(3),listStyleType:"decimal",listStylePosition:"outside"}}}import{toState as mn}from"@domphy/core";import{themeColor as ae,themeDensity as Te,themeSize as cn,themeSpacing as se}from"@domphy/theme";function dn(n,o){if(o<=7)return Array.from({length:o},(i,s)=>s+1);let t=[1];n>3&&t.push("...");let e=Math.max(2,n-1),r=Math.min(o-1,n+1);for(let i=e;i<=r;i++)t.push(i);return n<o-2&&t.push("..."),t.push(o),t}function gm(n){var a;let{total:o,color:t="neutral",accentColor:e="primary"}=n,r=mn((a=n.value)!=null?a:1),i={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:l=>se(6+Te(l)*2),height:l=>se(6+Te(l)*2),paddingInline:l=>se(Te(l)*2),borderRadius:l=>se(Te(l)*1),border:"none",cursor:"pointer",fontSize:l=>cn(l,"inherit"),backgroundColor:"transparent",color:l=>ae(l,"shift-6",t),"&:hover:not([disabled])":{backgroundColor:l=>ae(l,"shift-1",t)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},s=zt(_t({},i),{backgroundColor:l=>ae(l,"shift-2",e),color:l=>ae(l,"shift-8",e),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:l=>ae(l,"shift-2",e)}});return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:l=>{let m={div:c=>{let d=r.get(c),u=[];u.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&r.set(d-1),style:i});for(let g of dn(d,o))if(g==="...")u.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:h=>se(Te(h)*2),color:h=>ae(h,"shift-4",t)}});else{let h=g===d;u.push({button:String(g),type:"button",ariaLabel:`Page ${g}`,ariaCurrent:h?"page":void 0,disabled:h,onClick:()=>r.set(g),style:h?s:i})}return u.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=o,onClick:()=>d<o&&r.set(d+1),style:i}),u},style:{display:"flex",alignItems:"center",gap:se(1)}};l.children.insert(m)},style:{display:"inline-flex"}}}import{themeColor as go,themeSize as un,themeSpacing as pn}from"@domphy/theme";function vm(n={}){let{color:o="neutral"}=n;return{role:"separator",_onInsert:t=>{t.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:pn(2),fontSize:t=>un(t,"inherit"),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:t=>go(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:t=>go(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"}}}}import{toState as hn}from"@domphy/core";import{themeColor as Ae,themeDensity as fn,themeSize as gn,themeSpacing as Pe}from"@domphy/theme";var bo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},bn={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},xt=n=>n==="left"||n==="right";function km(n={}){let{color:o="neutral",open:t=!1,placement:e="right",size:r}=n,i=hn(t),s=xt(e)?Pe(80):Pe(64),a=r!=null?r:s;return{_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(l,m)=>{l.target===m.domElement&&i.set(!1)},onTransitionEnd:(l,m)=>{let c=m.domElement;i.get()||(c.close(),document.body.style.overflow="")},_onMount:l=>{let m=l.domElement,c=d=>{d?(m.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{m.style.transform="translate(0, 0)"})):m.style.transform=bo[e]};c(i.get()),i.onChange(c)},style:{transform:bo[e],transition:"transform 0.25s ease",fontSize:l=>gn(l,"inherit"),color:l=>Ae(l,"shift-7",o),backgroundColor:l=>Ae(l,"inherit",o),border:"none",padding:l=>Pe(fn(l)*3),margin:bn[e],width:xt(e)?a:"100dvw",height:xt(e)?"100dvh":a,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:l=>`0 ${Pe(4)} ${Pe(12)} ${Ae(l,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:l=>Ae(l,"shift-1","neutral"),opacity:.75}}}}import{toState as yn,merge as yo}from"@domphy/core";function $m(n){let{open:o=!1,placement:t="bottom",openOn:e="click"}=n,r=null,i=yn(o),{show:s,hide:a,anchorPartial:l}=H({open:i,placement:t,content:n.content,onPlacement:n.onPlacement}),m={role:"dialog",dataTone:"shift-6",onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),_onInsert:d=>{let u=d.attributes.get("id");r=u||d.nodeId,!u&&d.attributes.set("id",r)}};return yo(n.content,m),yo(l,{ariaHaspopup:"dialog",ariaExpanded:d=>i.get(d),onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),onClick:()=>e==="click"&&(i.get()?a():s()),onFocus:()=>s(),onBlur:()=>a(),_onMount:d=>r&&d.attributes.set("ariaControls",r)}),l}import{toState as Cn}from"@domphy/core";import{themeColor as Et,themeDensity as St,themeSize as vn,themeSpacing as K}from"@domphy/theme";function Lm(n={}){let{position:o="top-center",color:t="neutral"}=n,e=Cn(!1),r=o.startsWith("top"),i=o.endsWith("center"),s=o.endsWith("right"),a={div:[],id:`domphy-toast-${o}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":s?"end":"start",inset:0,gap:K(4),zIndex:30,padding:K(6),pointerEvents:"none"}};return{_portal:l=>{let m=l.domElement.querySelector(`#domphy-toast-${o}`);return m||(m=l.children.insert(a).domElement),m},role:"status",ariaAtomic:"true",style:{minWidth:K(32),pointerEvents:"auto",paddingBlock:l=>K(St(l)*2),paddingInline:l=>K(St(l)*4),borderRadius:l=>K(St(l)*2),fontSize:l=>vn(l,"inherit"),color:l=>Et(l,"shift-1",t),backgroundColor:l=>Et(l,"shift-9",t),boxShadow:l=>`0 ${K(2)} ${K(8)} ${Et(l,"shift-3","neutral")}`,opacity:l=>Number(e.get(l)),transform:l=>e.get(l)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>e.set(!0)),_onBeforeRemove:(l,m)=>{let c=d=>{d.propertyName==="transform"&&(l.domElement.removeEventListener("transitionend",c),m())};l.domElement.addEventListener("transitionend",c),e.set(!1)}}}import{toState as xn,merge as En}from"@domphy/core";import{themeSpacing as kt,themeColor as Co,themeDensity as Tt,themeSize as Sn}from"@domphy/theme";function jm(n={}){let{open:o=!1,placement:t="top",content:e="Tooltip Content"}=n,r=null,i=xn(t),s=typeof e=="string"?{span:e}:e,{show:a,hide:l,anchorPartial:m}=H({open:o,placement:t,content:s}),c={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-11",_onInsert:u=>{let g=u.attributes.get("id");r=g||u.nodeId,!g&&u.attributes.set("id",r)},style:{paddingBlock:u=>kt(Tt(u)*1),paddingInline:u=>kt(Tt(u)*3),borderRadius:u=>kt(Tt(u)*1),color:u=>Co(u,"shift-6"),backgroundColor:u=>Co(u),fontSize:u=>Sn(u,"inherit")},$:[Kt({placement:t,bordered:!1})]};return s.$||(s.$=[]),s.$.push(c),En(m,{onMouseEnter:()=>a(),onMouseLeave:()=>l(),onFocus:()=>a(),onBlur:()=>l(),onKeyDown:u=>u.key==="Escape"&&l(),_onMount:u=>r&&u.attributes.set("ariaDescribedby",r)}),m}import{ElementNode as vo}from"@domphy/core";function xo(n,o){return n.key!==void 0&&n.key!==null?String(n.key):`index-${o}`}function Um(n={}){let{duration:o=300,delay:t=0}=n,e=new Map;return{_onBeforeUpdate:r=>{e=new Map,r.children.items.forEach((i,s)=>{if(!(i instanceof vo))return;let a=i.domElement;a&&e.set(xo(i,s),a.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((i,s)=>{if(!(i instanceof vo))return;let a=i.domElement;if(!a)return;let l=xo(i,s),m=e.get(l);if(!m)return;let c=a.getBoundingClientRect(),d=m.left-c.left,u=m.top-c.top;if(Math.abs(d)<.5&&Math.abs(u)<.5)return;let g=a.style.transition,h=a.style.transform;a.style.transition="none",a.style.transform=`translate(${d}px, ${u}px)`,a.getBoundingClientRect(),requestAnimationFrame(()=>{a.style.transition=`transform ${o}ms ease ${t}ms`,a.style.transform="translate(0px, 0px)"});let f=()=>{a.style.transition=g,a.style.transform=h,a.removeEventListener("transitionend",p)},p=b=>{b.propertyName==="transform"&&f()};a.addEventListener("transitionend",p),setTimeout(f,o+t+34)}),e.clear()}}}import{merge as kn}from"@domphy/core";import{toState as Tn}from"@domphy/core";function tc(n={}){return{role:"tablist",_onSchedule:(t,e)=>{let r={_context:{tabs:{activeKey:Tn(n.activeKey||0)}}};kn(e,r)}}}import{themeSpacing as me,themeColor as ce,themeDensity as Eo,themeSize as Pn}from"@domphy/theme";function ic(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"tab",_onInsert:r=>{var m;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let i=r.getContext("tabs"),s=(m=r.parent)==null?void 0:m.children.items;s=s.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tab");let a=r.key||s.findIndex(c=>c==r),l={id:"tab"+r.parent.nodeId+a,ariaControls:"tabpanel"+r.parent.nodeId+a,ariaSelected:c=>i.activeKey.get(c)==a,onClick:()=>i.activeKey.set(a),onKeyDown:c=>{var p,b,y,we;let d=c.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;c.preventDefault();let u=((b=(p=r.parent)==null?void 0:p.children.items)!=null?b:[]).filter(T=>T.type==="ElementNode"&&T.attributes.get("role")==="tab"),g=u.findIndex(T=>T===r),h=g;d==="ArrowRight"?h=(g+1)%u.length:d==="ArrowLeft"?h=(g-1+u.length)%u.length:d==="Home"?h=0:d==="End"&&(h=u.length-1);let f=u[h];i.activeKey.set((y=f.key)!=null?y:h),(we=f.domElement)==null||we.focus()}};r.merge(l)},style:{cursor:"pointer",fontSize:r=>Pn(r,"inherit"),height:r=>me(6+Eo(r)*2),paddingInline:r=>me(Eo(r)*4),border:"none",outline:"none",color:r=>ce(r,"shift-6"),backgroundColor:r=>ce(r,"inherit"),boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-2",t)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-3",t)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-4",o)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-6",o)}`}}}}import{themeSpacing as So,themeDensity as ko}from"@domphy/theme";function mc(){return{role:"tabpanel",style:{paddingBlock:o=>So(ko(o)*2),paddingInline:o=>So(ko(o)*2)},_onInsert:o=>{var s;let t=o.getContext("tabs"),e=(s=o.parent)==null?void 0:s.children.items;e=e.filter(a=>a.type=="ElementNode"&&a.attributes.get("role")=="tabpanel");let r=o.key||e.findIndex(a=>a==o),i={id:"tabpanel"+o.parent.nodeId+r,ariaLabelledby:"tab"+o.parent.nodeId+r,hidden:a=>t.activeKey.get(a)!=r};o.merge(i)}}}import{merge as wn}from"@domphy/core";import{toState as In}from"@domphy/core";import{themeColor as _n,themeDensity as To,themeSize as zn,themeSpacing as Po}from"@domphy/theme";function gc(n={}){let{color:o="neutral"}=n;return{role:"menu",dataTone:"shift-11",_onSchedule:(e,r)=>{let i={_context:{menu:{activeKey:In(n.activeKey||0)}}};wn(r,i)},style:{display:"flex",flexDirection:"column",paddingBlock:e=>Po(To(e)*2),paddingInline:e=>Po(To(e)*2),fontSize:e=>zn(e,"inherit"),backgroundColor:e=>_n(e,"inherit",o)}}}import{themeSpacing as We,themeColor as de,themeDensity as wo,themeSize as $n}from"@domphy/theme";function vc(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"menuitem",_onInsert:r=>{var l;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let i=r.getContext("menu"),s=(l=r.parent)==null?void 0:l.children.items;s=s.filter(m=>m.type=="ElementNode"&&m.attributes.get("role")=="menuitem");let a=r.key||s.findIndex(m=>m==r);r.attributes.set("ariaCurrent",m=>i.activeKey.get(m)==a||void 0),r.addEvent("click",()=>i.activeKey.set(a))},onKeyDown:(r,i)=>{var c,d,u;let s=r.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(s))return;r.preventDefault();let a=((d=(c=i.parent)==null?void 0:c.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="menuitem"),l=a.findIndex(g=>g===i),m=l;s==="ArrowDown"?m=(l+1)%a.length:s==="ArrowUp"?m=(l-1+a.length)%a.length:s==="Home"?m=0:s==="End"&&(m=a.length-1),(u=a[m].domElement)==null||u.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:r=>$n(r,"inherit"),height:r=>We(6+wo(r)*2),paddingInline:r=>We(wo(r)*3),border:"none",outline:"none",color:r=>de(r,"shift-6"),backgroundColor:r=>de(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>de(r,"shift-1")},"&[aria-current=true]":{backgroundColor:r=>de(r,"shift-1",o),color:r=>de(r,"shift-7")},"&:focus-visible":{outline:r=>`${We(.5)} solid ${de(r,"shift-5",o)}`,outlineOffset:`-${We(.5)}`}}}}import{merge as Mn}from"@domphy/core";function kc(n){return{_onSchedule:(o,t)=>{Mn(t,{_context:{form:n}})}}}function Pc(n,o){return{_onInsert:t=>{let r=t.getContext("form").setField(n,void 0,o),i=t.tagName,s=t.attributes.get("type");["input","select","textarea"].includes(i)||console.warn('"field" patch must use input, select, or textarea tag');let a={onBlur:()=>r.setTouched(),ariaInvalid:l=>!!r.message("error",l)||void 0,dataStatus:l=>r.status(l)};i==="input"&&s==="checkbox"?(a.checked=r.value(),a.onChange=l=>r.setValue(l.target.checked)):i==="input"&&s==="radio"?a.onChange=l=>r.setValue(l.target.value):i==="select"?(a.value=r.value(),a.onChange=l=>r.setValue(l.target.value)):i==="textarea"?(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)):(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)),t.merge(a)}}}import{Notifier as Nn}from"@domphy/core";function Rn(n){return!!n&&typeof n.then=="function"}var je=class{constructor(o,t){this._notifier=new Nn;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=o,this._initValue=o,this._validator=t,t&&this.validate()}value(o){return o&&this._notifier.addListener("value",o),this._value}setValue(o){this._value=o,this._notifier.notify("value",o),this._notifier.notify("dirty",o!==this._initValue),this.validate()}dirty(o){return o&&this._notifier.addListener("dirty",o),this._value!==this._initValue}touched(o){return o&&this._notifier.addListener("touched",o),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(o,t){let e=!1;o!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=o,this._initValue=o,this._notifier.notify("value",o),this._notifier.notify("dirty",!1),e=!0),t!==void 0&&t!==this._validator&&(this._validator=t,e=!0),e&&this.validate()}message(o,t){return t&&this._notifier.addListener(o,t),this._messages[o]}status(o){return o&&this._notifier.addListener("status",o),Ke(this._messages)}setMessages(o){let t=this._messages;this._messages=o;for(let e of["error","warning","success"])t[e]!==o[e]&&this._notifier.notify(e,o[e]);Ke(t)!==Ke(o)&&this._notifier.notify("status",Ke(o))}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 o=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let t=this._validator(this._value);Rn(t)?(this._pending=!0,Promise.resolve(t).then(e=>{o===this._validationToken&&(this._pending=!1,this.setMessages(e!=null?e:{}))}).catch(e=>{o===this._validationToken&&(this._pending=!1,console.error(e))})):(this._pending=!1,this.setMessages(t!=null?t:{}))}catch(t){o===this._validationToken&&(this._pending=!1),console.error(t)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function Ke(n){if(n.error)return"error";if(n.warning)return"warning";if(n.success)return"success"}var Io=class{constructor(){this.fields=new Map}setField(o,t,e){let r=this.fields.get(o);return r?r.configure(t,e):(r=new je(t,e),this.fields.set(o,r)),r}getField(o){return this.setField(o)}removeField(o){var t;(t=this.fields.get(o))==null||t._dispose(),this.fields.delete(o)}get valid(){for(let o of this.fields.values())if(o._pending||o._messages.error)return!1;return!0}reset(){for(let o of this.fields.values())o.reset()}snapshot(){let o={};for(let[t,e]of this.fields)Ln(o,t,e._value);return o}_dispose(){for(let o of this.fields.values())o._dispose();this.fields.clear()}};function Ln(n,o,t){let e=o.split("."),r=n;for(let i=0;i<e.length-1;i++){let s=e[i];r[s]==null&&(r[s]=isNaN(Number(e[i+1]))?{}:[]),r=r[s]}r[e[e.length-1]]=t}export{je as FieldState,Io as FormState,Fn as abbreviation,fi as alert,yi as avatar,Si as badge,Zi as blockquote,Pi as breadcrumb,_i as breadcrumbEllipsis,ol as button,Ls as buttonSwitch,Wn as card,cl as code,Ki as combobox,Zn as command,ti as commandItem,ei as commandSearch,yl as descriptionList,hl as details,Sl as dialog,vm as divider,km as drawer,wl as emphasis,Pc as field,$l as figure,kc as form,Rl as formGroup,Ol as heading,Al as horizontalRule,Ul as icon,ql as image,ll as inputCheckbox,Ql as inputColor,oa as inputDateTime,la as inputFile,Ea as inputNumber,ui as inputOTP,ts as inputRadio,ya as inputRange,ca as inputSearch,$s as inputSwitch,ha as inputText,Pa as keyboard,za as label,Na as link,Oa as mark,gc as menu,vc as menuItem,um as orderedList,gm as pagination,Wa as paragraph,$m as popover,Kt as popoverArrow,Ya as preformated,Ja as progress,ns as select,ws as selectBox,xs as selectItem,bs as selectList,ss as skeleton,Bs as small,us as spinner,Yn as splitter,Un as splitterHandle,Gn as splitterPanel,Ws as strong,Ys as subscript,Js as superscript,ic as tab,mc as tabPanel,em as table,tc as tabs,Le as tag,nm as textarea,Lm as toast,ni as toggle,mi as toggleGroup,jm as tooltip,Um as transitionGroup,sm as unorderedList};
2
2
  //# sourceMappingURL=index.js.map