@domphy/ui 0.22.2 → 0.22.3

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.
@@ -6,5 +6,5 @@ ${n}`),`<${this.tagName}${t}>${n}</${this.tagName}>`}mount(t,n){var o;if(!t)thro
6
6
  [data-theme="light"]`:`[data-theme="${e}"]`} {
7
7
  ${i}}`}function $e(e){if(!Le[e])throw Error(`Theme "${e}" not found`);return Le[e]}function Na(e,t){_r(e),$a(t),Le[e]||(Le[e]=tn(Lt)),io(Le[e],t),e==="dark"&&io(Tr,t),(e==="light"||e==="dark")&&za(),ro=null,Yo.clear()}function Dr(e){let t=tn(e);t.direction="lighten";for(let n in t.colors)t.colors[n].reverse(),typeof t.baseTones[n]=="number"&&(t.baseTones[n]=t.colors[n].length-1-t.baseTones[n]);return t}function za(){Le.dark=Dr(Le.light),io(Le.dark,Tr)}function nn(e){let t=Yo.get(e);if(t)return t;let n=$e(e),o=on(n),a={};for(let r in n){let i=n[r];if(r==="colors")for(let l in n.colors){let c={};[...Array(o).keys()].forEach(m=>c[m]=n.colors[l][m]),a[l]=c}else if(r==="fontSizes")a.fontSizes=n.fontSizes;else if(It[r])a[r]=Ma({},i);else if(r==="densities")a.densities=n.densities;else if(r==="custom"&&(a.custom={},i&&typeof i=="object"))for(let l in i)a.custom[l]=i[l]}return Yo.set(e,a),a}function Pt(){if(ro)return ro;let e=$e("light"),t=on(e),n={};for(let o in e){let a=e[o];if(o==="colors")for(let r in e.colors){let i=ct(r),l={};[...Array(t).keys()].forEach(c=>l[c]=`var(--${i}-${c})`),n[r]=l}else if(o==="fontSizes")n.fontSizes=[...Array(lt).keys()].map(r=>`var(--fontSize-${r})`);else if(It[o]){let r={};for(let i in a)r[i]=`var(--${It[o]}-${ct(i)})`;n[o]=r}else if(o==="custom"&&(n.custom={},a&&typeof a=="object"))for(let r in a)n.custom[r]=`var(--custom-${ct(r)})`}return ro=n,n}var Ba="button,input,select,textarea,optgroup{font:inherit}";function Xo(){return`${Object.entries(Le).map(([e,t])=>Aa(e,t)).join(`
8
8
  `)}
9
- ${Ba}`}function Va(e){var t;if(typeof document!="undefined")if(e){e.textContent=Xo();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Xo(),document.head.appendChild(e)}function h(e){return`calc(${e/4}em)`}var Uo=16;function Ha(e,t,n=320,o=1280){let a=e/4,r=t/4,i=a*Uo,l=(r*Uo-i)/(o-n)*100,c=(i-l*n/100)/Uo,m=parseFloat(l.toFixed(4)),s=parseFloat(c.toFixed(4)),d=s===0?`${m}vw`:`${s}em + ${m}vw`;return`clamp(${a}em, ${d}, ${r}em)`}function Fa(e,t={}){if(typeof document=="undefined")throw new Error('applySystemTheme() requires a browser DOM \u2014 "document" is not defined. For SSR, call it only on the client (e.g. inside an _onMount lifecycle hook, or behind a typeof window !== "undefined" guard).');let n=e!=null?e:document.documentElement,{persist:o=!0,storageKey:a="dp-theme"}=t,r=()=>{try{return localStorage.getItem(a)}catch(m){return null}},i=()=>{if(o){let m=r();if(m==="light"||m==="dark")return m}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};n.setAttribute("data-theme",i());let l=window.matchMedia("(prefers-color-scheme: dark)"),c=m=>{(!o||!r())&&n.setAttribute("data-theme",m.matches?"dark":"light")};return l.addEventListener("change",c),()=>l.removeEventListener("change",c)}function dt(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let n="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(n=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),n}var ja=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],Zo=["inherit"];[...Array(5).keys()].forEach(e=>{Zo.push(`decrease-${e}`),Zo.push(`increase-${e}`)});function Wa(e,t="inherit"){if(!Zo.includes(t))throw Error(`density name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(4,n))}function Ka(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(n=Wa(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function b(e){let t=Ka(e);return $e(e?dt(e):"light").densities[t]}var qa=e=>{let t=n=>{let o=Math.max(0,Math.min(1,n)),a=o<=.0031308?12.92*o:1.055*W(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(a*255)))};return e.map(t)},Ua=e=>{let t=n=>n>.04045?W((n+.055)/1.055,2.4):n/12.92;return e.map(t)},xe=e=>{let[t,n,o]=qa(e);return t=t.toString(16).padStart(2,"0"),n=n.toString(16).padStart(2,"0"),o=o.toString(16).padStart(2,"0"),`#${t}${n}${o}`},Or=e=>typeof e=="string"&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e),rn=e=>{if(!Or(e))throw new Error(`Invalid hex color "${e}": expected "#rgb", "#rgba", "#rrggbb", or "#rrggbbaa" (hex digits 0-9, a-f, case-insensitive).`);let t=e.slice(1).toLowerCase();return t.length<=4&&(t=t.split("").map(n=>n+n).join("")),`#${t}`},ue=e=>{let t=rn(e),n=parseInt(t.slice(1,3),16)/255,o=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255;return Ua([n,o,a])},Mt=e=>{let t=.4122214708*e[0]+.5363325363*e[1]+.0514459929*e[2],n=.2119034982*e[0]+.6806995451*e[1]+.1073969566*e[2],o=.0883024619*e[0]+.2817188376*e[1]+.6299787005*e[2],a=Math.cbrt(t),r=Math.cbrt(n),i=Math.cbrt(o);return[.2104542553*a+.793617785*r-.0040720468*i,1.9779984951*a-2.428592205*r+.4505937099*i,.0259040371*a+.7827717662*r-.808675766*i]},so=e=>{let[t,n,o]=e,a=t+.3963377774*n+.2158037573*o,r=t-.1055613458*n-.0638541728*o,i=t-.0894841775*n-1.291485548*o,l=a*a*a,c=r*r*r,m=i*i*i;return[4.0767416621*l-3.3077115913*c+.2309699292*m,-1.2684380046*l+2.6097574011*c-.3413193965*m,-.0041960863*l-.7034186147*c+1.707614701*m]},Lr=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,c=.1307,m=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,d=0;return(r<=90||r>=270)&&(d=c*Math.abs(Math.cos(r*(Math.PI/180)))+m),t+(s+d)*a},Ga=(e,t)=>{let[,n,o]=t,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,c=.1307,m=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,d=0;return(r<=90||r>=270)&&(d=c*Math.abs(Math.cos(r*(Math.PI/180)))+m),Math.max(0,e-(s+d)*a)},Ya=e=>{let[t,n,o]=e,a=o*Math.PI/180;return[t,n*Math.cos(a),n*Math.sin(a)]},mt=e=>{let[t,n,o]=e,a=.4124564*t+.3575761*n+.1804375*o,r=.2126729*t+.7151522*n+.072175*o,i=.0193339*t+.119192*n+.9503041*o,l=.95047,c=1,m=1.08883,s=y=>y>.008856?Math.cbrt(y):7.787*y+16/116,d=s(a/l),f=s(r/c),p=s(i/m);return[116*f-16,500*(d-f),200*(f-p)]},Ir=e=>{let[t,n,o]=e,a=(t+16)/116,r=n/500+a,i=a-o/200,l=y=>W(y,3)>.008856?W(y,3):(y-16/116)/7.787,c=.95047,m=1,s=1.08883,d=l(r)*c,f=l(a)*m,p=l(i)*s;return[3.2404542*d-1.5371385*f-.4985314*p,-.969266*d+1.8760108*f+.041556*p,.0556434*d-.2040259*f+1.0572252*p]},Pr=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o);if(a<1e-4)return[t,0,0];let r=(Math.atan2(o,n)*180/Math.PI+360)%360;return r>=359.9999&&(r=0),[t,a,r]},an=(e,t)=>{let[n,o,a]=e,[r,i,l]=t,c=Math.hypot(o,a),m=Math.hypot(i,l),s=(c+m)/2,d=.5*(1-Math.sqrt(W(s,7)/(W(s,7)+W(25,7)))),f=o*(1+d),p=i*(1+d),y=Math.hypot(f,a),g=Math.hypot(p,l),S=(y+g)/2,E=(oe,se)=>{if(oe===0&&se===0)return 0;let ve=Math.atan2(se,oe)*180/Math.PI;return ve>=0?ve:ve+360},O=E(f,a),T=E(p,l),x=T-O,D=Math.abs(x),_=O+T,C=y*g===0,M;C?M=0:D<=180?M=x:x>180?M=x-360:M=x+360;let P;C?P=_:D<=180?P=_/2:_<360?P=(_+360)/2:P=(_-360)/2;let V=1-.17*Math.cos((P-30)*Math.PI/180)+.24*Math.cos(2*P*Math.PI/180)+.32*Math.cos((3*P+6)*Math.PI/180)-.2*Math.cos((4*P-63)*Math.PI/180),re=r-n,F=g-y,G=2*Math.sqrt(y*g)*Math.sin(M/2*Math.PI/180),ie=(n+r)/2,Y=1+.015*W(ie-50,2)/Math.sqrt(20+W(ie-50,2)),Q=1+.045*S,ae=1+.015*S*V,ee=30*Math.exp(-W((P-275)/25,2)),le=-(2*Math.sqrt(W(S,7)/(W(S,7)+W(25,7))))*Math.sin(2*ee*Math.PI/180);return Math.sqrt(W(re/Y,2)+W(F/Q,2)+W(G/ae,2)+le*(F/Q)*(G/ae))},Xa=e=>{let t=()=>new Error(`Invalid CSS rgb() "${e}": expected "rgb(r, g, b)" with channels 0-255 or 0%-100% (comma or space separated, optional alpha after "," or "/").`),n=/^\s*rgba?\(\s*(.+?)\s*\)\s*$/i.exec(e);if(!n)throw t();let o=n[1].split("/")[0],a=o.includes(",")?o.split(",").map(l=>l.trim()).slice(0,3):o.trim().split(/\s+/);if(a.length!==3)throw t();let r=a.map(l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l));if(r.some(l=>!Number.isFinite(l)))throw t();let i=l=>{let c=l/255;return c<=.04045?c/12.92:W((c+.055)/1.055,2.4)};return r.map(i)},ao=e=>{if(e.length<1)return m=>0;let t=[...e].sort((m,s)=>m[0]-s[0]),n=[];for(let m=0;m<t.length;m++)(m===0||t[m][0]!==t[m-1][0])&&n.push(t[m]);let o=n.length;if(o===1)return m=>n[0][1];let a=n.map(m=>m[0]),r=n.map(m=>m[1]),i=[],l=[];for(let m=0;m<o-1;m++)i[m]=a[m+1]-a[m],l[m]=(r[m+1]-r[m])/i[m];let c=new Array(o);c[0]=l[0],c[o-1]=l[o-2];for(let m=1;m<o-1;m++){let s=l[m-1],d=l[m];if(s*d<=0)c[m]=0;else{let f=(1+i[m]/(i[m-1]+i[m]))/3;c[m]=s*d/((1-f)*s+f*d)}}return m=>{if(m<=a[0])return r[0];if(m>=a[o-1])return r[o-1];let s=0,d=o-2,f=0;for(;s<=d;){let T=Math.floor((s+d)/2);if(m>=a[T]&&m<=a[T+1]){f=T;break}m<a[T]?d=T-1:s=T+1}let p=i[f],y=(m-a[f])/p,g=y*y,S=g*y,E=c[f]*p,O=c[f+1]*p;return(2*S-3*g+1)*r[f]+(S-2*g+y)*E+(-2*S+3*g)*r[f+1]+(S-g)*O}};function at(e){let t=e.length;if(t===0)return 0;let n=0;for(let o=0;o<t;o++)n+=e[o]*e[o];return Math.sqrt(n/t)}var Za=e=>{let t=e.length;if(t===0)return{min:0,max:0,avg:0};let n=e[0],o=e[0],a=0;for(let r=0;r<t;r++){let i=e[r];i<n&&(n=i),i>o&&(o=i),a+=i}return{min:n,max:o,avg:a/t}},ln=e=>{let t=e.length;if(t===0)return 0;let n=1e-6,o=e.reduce((i,l)=>i*(l+n),1),a=W(o,1/t),r=Math.max(0,Math.min(1,a));return parseFloat((r*100).toFixed(2))},Ja=(e,t)=>{let[n,o,a]=ue(e),[r,i,l]=ue(t),c=.2126*n+.7152*o+.0722*a,m=.2126*r+.7152*i+.0722*l,s=Math.max(c,m),d=Math.min(c,m);return(s+.05)/(d+.05)},Qa=(e,t,n=.5,o="oklab")=>{let a=Math.max(0,Math.min(1,n)),r=ue(e),i=ue(t);if(o==="rgb")return xe(r.map((m,s)=>m+a*(i[s]-m)));if(o==="lab"){let m=mt(r),s=mt(i);return xe(Ir(m.map((d,f)=>d+a*(s[f]-d))))}let l=Mt(r),c=Mt(i);return xe(so(l.map((m,s)=>m+a*(c[s]-m))))},el=(e,t)=>{if(e.length<2)throw new Error("scale() requires at least 2 colors");if(t<1)return[];if(t===1)return[xe(ue(e[0]))];let n=e.map(r=>Mt(ue(r))),o=n.length-1,a=[];for(let r=0;r<t;r++){let i=r/(t-1)*o,l=Math.min(Math.floor(i),o-1),c=i-l,m=n[l],s=n[l+1];a.push(xe(so(m.map((d,f)=>d+c*(s[f]-d)))))}return a},Jo=class{constructor(e){this.hex=e}get rgb(){return ue(this.hex)}get lab(){return mt(this.rgb)}get lch(){return Pr(this.lab)}get lightness(){return Lr(this.lab)}get chroma(){return this.lch[1]}get hue(){return this.lch[2]}get luminance(){let[e,t,n]=this.rgb;return .2126*e+.7152*t+.0722*n}},Mr=.501,Rr=class{constructor(e=[],t="brand"){this.swatches=e.map(n=>new Jo(n)),this.name=t}get colors(){return this.swatches.map(e=>e.hex)}get peakChroma(){let e=this.colors.slice(2,-2),t="",n=-1/0;for(let o of e){let a=new Jo(o);a.chroma>n&&(n=a.chroma,t=o)}return n<6?this.colors[Math.ceil(this.steps/2)]:t}get steps(){return this.colors.length}get baseColor(){return this.colors.length===0?"":this.peakChroma||this.colors[Math.floor(this.colors.length/2)]}get baseIndex(){return this.colors.length===0?-1:this.colors.findIndex(e=>e.toLowerCase()===this.baseColor.toLowerCase())}get wcag(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let a of[30,45,70])o[a]={efficiency:1,target:a/10,span:0,value:0};return o}for(let a of[30,45,70]){let r=a/10,i=n,l=0;for(let c=1;c<t;c++){let m=1/0;for(let s=0;s<t-c;s++){let d=e[s].luminance,f=e[s+c].luminance,p=(Math.max(d,f)+.05)/(Math.min(d,f)+.05);p<m&&(m=p)}if(m>=r){i=c,l=m;break}c===n&&(l=m)}o[a]={efficiency:i/n,target:r,span:i,value:l}}return o}get apca(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let r of[45,60,75])o[r]={efficiency:1,target:r,span:0,value:0};return o}let a=(r,i)=>{let l=Math.SQRT2,c=r<.022?r+W(.022-r,l):r,m=i<.022?i+W(.022-i,l):i,s=m>=c?(W(m,.56)-W(c,.57))*114:(W(m,.65)-W(c,.62))*114;return Math.abs(s)<10?0:(s=s>0?s-2.7:s+2.7,Math.round(s))};for(let r of[45,60,75]){let i=r,l=n,c=0;for(let m=1;m<t;m++){let s=1/0;for(let d=0;d<t-m;d++){let f=e[d].luminance>e[d+m].luminance?e[d].luminance:e[d+m].luminance,p=e[d].luminance>e[d+m].luminance?e[d+m].luminance:e[d].luminance,y=Math.abs(a(p,f));y<s&&(s=y)}if(s>=i){l=m,c=s;break}m===n&&(c=s)}o[r]={efficiency:l/n,target:i,span:l,value:c}}return o}get deltaECurve(){let e=[0];for(let t=1;t<this.swatches.length;t++){let n=an(this.swatches[t-1].lab,this.swatches[t].lab);e.push(e[t-1]+n)}return e}get unwrapHues(){let e=this.swatches.map(n=>n.hue).slice(1,-1);if(e.length===0)return[];let t=[e[0]];for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];o>180?o-=360:o<-180&&(o+=360),t.push(t[n-1]+o)}return t}get lightnessLinearity(){let e=this.swatches.map(d=>d.lightness),t=e.length;if(t<2)return 1;let n=0,o=0,a=0,r=0;for(let d=0;d<t;d++)n+=d,o+=e[d],a+=d*e[d],r+=d*d;let i=t*r-n*n;if(Math.abs(i)<1e-10)return 1;let l=(t*a-n*o)/i,c=(o-l*n)/t;if(Math.abs(l*(t-1))<.001)return 1;let m=0,s=0;for(let d=0;d<t;d++){let f=l*d+c,p=e[d]-f;m+=p*p;let y=Math.max(f-Math.min(c,l*(t-1)+c),Math.max(c,l*(t-1)+c)-f);s+=y*y}return Math.max(0,Math.min(1,1-Math.sqrt(m/t)/Math.sqrt(s/t)))}get chromaSmoothness(){let e=this.swatches.map(d=>d.chroma),t=e.length;if(t<3)return 1;let n=133.8,o=Math.max(...e);if(o<=.01)return 1;let a=e.map(d=>d/o*n),r=Math.min(...a),i=Math.max(...a),l=a.indexOf(i),c=ao([[0,a[0]],[l,i],[t-1,a[t-1]]]),m=0,s=0;for(let d=0;d<t;d++){let f=c(d),p=a[d]-f;m+=p*p,s+=W(Math.max(f-r,i-f),2)}return Math.max(0,Math.min(1,1-Math.sqrt(m/t)/Math.sqrt(s/t)))}get spacingUniformity(){let e=this.deltaECurve,t=e.length;if(t<2)return 1;let n=[];for(let i=1;i<t;i++){let l=e[i]-e[i-1];if(l<0)return 0;n.push(l)}let o=n.reduce((i,l)=>i+l,0)/n.length;if(o<=1e-6)return 0;let a=0;for(let i of n)a+=W(i-o,2);let r=Math.sqrt(a/n.length)/o;return Math.max(0,Math.min(1,1/(1+r)))}get hueStability(){var e,t,n;let o=this.unwrapHues,a=o.length;if(a<2)return 1;let r=(n=(t=o[this.baseIndex-1])!=null?t:(e=this.swatches[this.baseIndex])==null?void 0:e.hue)!=null?n:0,i=0,l=0;for(let c=0;c<a;c++){let m=Math.abs(o[c]-r)%360;m>180&&(m=360-m),i+=m*m;let s=c/(a-1)*180;l+=s*s}return Math.max(0,Math.min(1,1-Math.sqrt(i/a)/(Math.sqrt(l/a)||1)))}get contrastEfficiency(){let e=this.wcag[45].span,t=this.steps;if(t<=1)return 1;let n=Mr,o=e/(t-1);return o<=n?1:o>=1?0:1-(o-n)/(1-n)}get metrics(){return{lightnessLinearity:this.lightnessLinearity,chromaSmoothness:this.chromaSmoothness,spacingUniformity:this.spacingUniformity,hueStability:this.hueStability,contrastEfficiency:this.contrastEfficiency}}get score(){return ln(Object.values(this.metrics))}},$r=.605,Qo=.685;function tl(e){let t=W(e,$r);return t/(1+Qo*(1-t))}function ol(e){let t=e*(1+Qo)/(1+e*Qo);return W(t,1/$r)}function ut(e){let t=n=>n<0?0:n>1?1:n;return .2126*t(e[0])+.7152*t(e[1])+.0722*t(e[2])}var nl=21;function rl(e){let t=W(nl,-1/(e-1)),n=[];for(let o=e-1;o>=0;o--)n.push(1.05*W(t,o)-.05);return n}function il(e){return Math.ceil(Mr*(e-1))}var al=4.5,ll=.07,xr=Math.log(al+ll),Er=Math.log(1.02);function no(e){return Math.log(e+.05)}function sl(e){return Math.exp(e)-.05}var Ar=1e-10,cl=2e3;function ul(e,t){let n=(r,i)=>{if(i.low===i.high){if(r[i.low]===i.minGap)return r;let s=r.slice();return s[i.low]=i.minGap,s}let l=r[i.high]-r[i.low];if(l>=i.minGap)return r;let c=(i.minGap-l)/2,m=r.slice();return m[i.low]-=c,m[i.high]+=c,m},o=e.slice(),a=t.map(()=>new Array(e.length).fill(0));for(let r=0;r<cl;r++){let i=0;for(let l=0;l<t.length;l++){let c=o.map((s,d)=>s+a[l][d]),m=n(c,t[l]);for(let s=0;s<e.length;s++)a[l][s]=c[s]-m[s],i=Math.max(i,Math.abs(m[s]-o[s]));o=m}if(i<Ar)return o}throw new Error("generateRamp: the constrained luminance ladder did not converge \u2014 this is an internal solver failure, not an invalid input (infeasible anchor placements are rejected before the solve starts).")}function ml(e,t,n,o){let a=[...e].sort((r,i)=>r.index-i.index);for(let r=0;r<a.length;r++)for(let i=r+1;i<a.length;i++){let l=a[r],c=a[i];if(c.index===l.index){if(Math.abs(c.value-l.value)<Ar)continue;throw new Error(`generateRamp: ${l.label} and ${c.label} both land on ramp step ${l.index} but pin it to different luminances. Space these anchors further apart.`)}let m=c.index-l.index,s=Math.floor(m/t),d=m-s*t,f=s*n+d*o,p=c.value-l.value;if(p>=f)continue;let y=Math.exp(p),g=Math.exp(n),S=s>=1?`${s} full ${t}-step AA window${s>1?"s":""} (need >= ${g.toFixed(2)}:1 per window)`:"the ramp's own light-to-dark order";throw new Error(`generateRamp: ${l.label} and ${c.label} are ${m} ramp steps apart, spanning ${S}, but their own luminance only contrasts ${y.toFixed(2)}:1. Space these anchors further apart, or pick less similar luminances.`)}}var dl=32;function hl(e,t){let n=0,o=1;for(let a=0;a<dl;a++){let r=(n+o)/2;ut(e(r))<t?n=r:o=r}return(n+o)/2}function fl(e,t){return Math.sqrt(W(e[0]-t[0],2)+W(e[1]-t[1],2)+W(e[2]-t[2],2))}function pl(e){let t=[[0,0,0],...e,[1,1,1]].map(s=>Mt(s)),n=t.map(s=>s[0]),o=t.map(s=>s[1]),a=t.map(s=>s[2]),r=[0],i=0;for(let s=1;s<t.length;s++)i+=fl(t[s],t[s-1]),r.push(i);let l=r.map(s=>ol(i>0?s/i:0)),c=ao(l.map((s,d)=>[s,o[d]])),m=ao(l.map((s,d)=>[s,a[d]]));return{colorAtParam:s=>{let d=tl(s),f=0;for(let T=0;T<l.length-1;T++)if(d<=l[T+1]){f=T;break}let p=l[f],y=l[f+1],g=(d-p)/(y-p||1),S=n[f]+g*(n[f+1]-n[f]),E=c(d),O=m(d);return so([S,E,O])},parameters:l.slice(1,-1)}}var Go=512,Cr=512;function gl(e,t){let n=0,o=1/0;for(let l=0;l<=Go;l++){let c=l/Go,m=Math.abs(ut(e(c))-t);m<o&&(o=m,n=c)}let a=1/Go,r=Math.max(0,n-a),i=Math.min(1,n+a);for(let l=0;l<=Cr;l++){let c=r+(i-r)*l/Cr,m=Math.abs(ut(e(c))-t);m<o&&(o=m,n=c)}return e(n)}var yl=1e-9;function Nr(e,t){let n=Array.isArray(e)?e:[e];if(n.length===0)throw new Error("generateRamp requires at least one anchor color");if(t<=0)return[];if(t===1)return[xe(ue(n[0]))];let o=n.map(g=>xe(ue(g))).reverse(),{colorAtParam:a,parameters:r}=pl([...n.map(ue)].reverse()),i=[0,...r,1],l=i.map(g=>Math.round(g*(t-1))),c=[];if(n.length===1)for(let g of rl(t))c.push(xe(a(hl(a,g))));else{let g=0;for(let S=0;S<t;S++){for(;g<l.length-2&&S>l[g+1];)g++;let E=l[g],O=l[g+1],T=i[g],x=i[g+1],D;if(O<=E)D=T;else{let _=(S-E)/(O-E);D=T+_*(x-T)}c.push(xe(a(D)))}}let m=[{index:0,value:no(0),label:"the black edge"},{index:t-1,value:no(1),label:"the white edge"}],s=new Map;for(let g=0;g<o.length;g++){let S=l[g+1];if(S<=0||S>=t-1)continue;let E=no(ut(ue(o[g])));n.length>1?(c[S]=o[g],m.push({index:S,value:E,label:`anchor ${o[g]}`})):s.set(S,E)}let d=il(t);n.length>1&&d>=1&&d<t&&ml(m,d,xr,Er);let f=c.map((g,S)=>s.has(S)?s.get(S):no(ut(ue(g)))),p=m.map(({index:g,value:S})=>({low:g,high:g,minGap:S}));for(let g=1;g<t;g++)p.push({low:g-1,high:g,minGap:Er});if(d>=1)for(let g=0;g+d<t;g++)p.push({low:g,high:g+d,minGap:xr});let y=ul(f,p);return c.map((g,S)=>{let E=Math.max(0,Math.min(1,sl(y[S])));return Math.abs(E-ut(ue(g)))<yl?g:xe(gl(a,E))}).reverse()}var bl=class{constructor(e={},t="Collection 1"){this.ramps=Object.entries(e).map(([n,o])=>new Rr(o,n)),this.name=t}get colors(){return Object.fromEntries(this.ramps.map(e=>[e.name,e.colors]))}get steps(){var e;return((e=this.ramps[0])==null?void 0:e.steps)||0}get wcag(){let e={},t=this.steps;for(let n of[30,45,70]){let o=this.ramps.map(i=>i.wcag[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n/10,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get apca(){let e={},t=this.steps;for(let n of[45,60,75]){let o=this.ramps.map(i=>i.apca[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get contrastEfficiency(){return at(this.ramps.map(e=>e.contrastEfficiency))}get lightnessLinearity(){return at(this.ramps.map(e=>e.lightnessLinearity))}get chromaSmoothness(){return at(this.ramps.map(e=>e.chromaSmoothness))}get hueStability(){return at(this.ramps.map(e=>e.hueStability))}get spacingUniformity(){return at(this.ramps.map(e=>e.spacingUniformity))}get score(){return ln([this.contrastEfficiency,this.lightnessLinearity,this.chromaSmoothness,this.hueStability,this.spacingUniformity])}},vl=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],Sl=[.75,1,1.5,2,2.5];function wl(e,t){let n=mt(ue(t)),o=0,a=1/0;for(let r=0;r<e.length;r++){let i=an(n,mt(ue(e[r])));i<a&&(a=i,o=r)}return o}function xl(e,t={}){var n,o,a,r,i;if(t.steps!==void 0&&t.steps!==K)throw new Error(`generateTheme() steps must be ${K} (the tone model is fixed at shift-0\u2026shift-${K-1}), got ${t.steps}`);let l=K,c={},m={};for(let[s,d]of Object.entries(e)){let f;try{f=rn(d)}catch(y){throw new Error(`baseColors.${s}: ${y instanceof Error?y.message:String(y)}`)}let p=Nr(f,l);c[s]=p,m[s]=wl(p,f)}return{direction:(n=t.direction)!=null?n:"darken",colors:c,baseTones:m,fontSizes:(o=t.fontSizes)!=null?o:vl,densities:(a=t.densities)!=null?a:Sl,darkBias:(r=t.darkBias)!=null?r:1,custom:(i=t.custom)!=null?i:{}}}var en=["inherit"];[...Array(8).keys()].forEach(e=>{en.push(`decrease-${e}`),en.push(`increase-${e}`)});function zr(e,t="inherit"){if(!en.includes(t))throw Error(`size name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(7,n))}function El(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(n=zr(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function w(e,t="inherit"){let n=zr(El(e),t);return Pt().fontSizes[n]}var lo={surface:"shift-1",hover:"shift-2",border:"shift-3","border-strong":"shift-4",muted:"shift-8",text:"shift-9"},Ot=["inherit","base",...Object.keys(lo)];[...Array(K).keys()].forEach(e=>{Ot.push(`decrease-${e}`),Ot.push(`increase-${e}`),Ot.push(`shift-${e}`)});var st=9;function q(e,t=null){let n=Math.max(0,Math.min(K-1,Math.round(e)));if(!t){let c=n+st;return`shift-${c<=K-1?c:n-st}`}let o=$e(dt(t)),a=un(co(t),o.direction,o.darkBias),r=sn(a,n),i=r+st,l=r-st;return i<=K-1?i:l>=0?l:r<=(K-1)/2?K-1:0}function Cl(e,t=null){let n=/^shift-(\d+)$/.exec(e),o=`shift-${K-1}`;if(!n)return o;let a=Number(n[1]);if(!t)return a+st<=K-1?o:"shift-0";let r=$e(dt(t)),i=un(co(t),r.direction,r.darkBias),l=sn(i,a);return K-1-l>=l?K-1:0}function kr(e,t){if(e<0||e>K-1)return e;let n=e+t;return n=Math.max(0,Math.min(K-1,n)),n}function sn(e,t){if(e<0||e>K-1)return e;let n=Math.floor((K-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(K-1,o)),o}function cn(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!Ot.includes(t))throw Error(`tone name "${t}" invalid`);if(t in lo&&(t=lo[t]),t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return kr(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return kr(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return sn(e,n)}else return e}function co(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let n=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(n=cn(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function un(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===K-1?K-1-n:e}function Rt(e,t,n,o){if(n==="base")return kl(e,o);let a=$e(e);return cn(un(t,a.direction,a.darkBias),n)}function kl(e,t){let n=$e(e).baseTones[t];if(n===void 0)throw new Error(`baseTones.${t} is not defined on theme "${e}" \u2014 set a base tone index (0\u2013${K-1}) via setTheme("${e}", { baseTones: { ${t}: <index> } }) so themeColor(..., "base", "${t}") can resolve`);return n}function u(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e){let i=Pt()[o];if(!i)throw Error(`color "${o}" not found on theme "light"`);return i[Rt("light",0,t,o)]}let a=dt(e),r=Pt()[o];if(!r)throw Error(a==="light"?`color "${o}" not found on theme "light"`:`color "${o}" not found on the "light" theme (required by node theme "${a}") \u2014 themeColor() var references are keyed on the "light" theme structure; register the role on "light" as well (e.g. setTheme("light", { colors: { ${o}: \u2026 } })) so the shared CSS-var baseline includes it`);return r[Rt(a,co(e),t,o)]}function mn(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,a=e?dt(e):"light",r=nn(a)[o];if(!r)throw Error(`color "${o}" not found on theme "${a}"`);return e?r[Rt(a,co(e),t,o)]:r[Rt("light",0,t,o)]}function Tl(e={}){var t;let n=!e.color||e.color==="inherit"?"neutral":e.color,o=(t=e.theme)!=null?t:"light",a=nn(o)[n];if(!a)throw Error(`color "${n}" not found on theme "${o}"`);return a[Br(e)]}function Br(e={}){let{theme:t="light",surface:n="inherit",tone:o="inherit",color:a="inherit"}=e;return Rt(t,cn(0,n),o,a==="inherit"?"neutral":a)}var _l=["sans-serif","monospace"],Dl=["light","regular","medium","semibold","bold","extrabold","black"],Ol=["tighter","tight","normal","wide","wider","widest"];function dn(e,t,n){let o=Pt()[e],a=o==null?void 0:o[t];if(!a){let r=Object.keys(o!=null?o:{}).join(", ");throw Error(`${e}.${t} is not registered on the "light" theme \u2014 ${n}() resolves against the shared token baseline. Known names: ${r||"(none)"}. Register it with setTheme("light", { ${e}: { ${t}: \u2026 } }).`)}return a}function We(e="sans-serif"){return dn("fontFamilies",e,"themeFont")}function Z(e="regular"){return dn("fontWeights",e,"themeWeight")}function Ll(e="normal"){return dn("letterSpacings",e,"themeLetterSpacing")}var Do={};Wt(Do,{abbreviation:()=>Il,accordion:()=>Pl,alert:()=>Ml,avatar:()=>Rl,badge:()=>$l,blockquote:()=>Al,breadcrumb:()=>Nl,breadcrumbEllipsis:()=>zl,button:()=>Hl,buttonGhost:()=>hn,buttonSwitch:()=>Fl,card:()=>Wl,code:()=>Kl,combobox:()=>Hs,command:()=>Ws,commandItem:()=>qs,commandSearch:()=>Ks,datePicker:()=>Ys,descriptionList:()=>Js,details:()=>Qs,dialog:()=>tc,divider:()=>oc,drawer:()=>rc,elevation:()=>U,emphasis:()=>ic,empty:()=>ac,errorBoundary:()=>sc,fab:()=>uc,figure:()=>mc,focusRing:()=>L,formGroup:()=>dc,grid:()=>hc,heading:()=>pc,horizontalRule:()=>gc,icon:()=>yc,image:()=>bc,inputCheckbox:()=>vc,inputColor:()=>Sc,inputDateTime:()=>wc,inputFile:()=>xc,inputNumber:()=>Ec,inputOTP:()=>Cc,inputPassword:()=>Dc,inputRadio:()=>Oc,inputRange:()=>Lc,inputSearch:()=>Ic,inputSwitch:()=>Pc,inputText:()=>Mc,keyboard:()=>Rc,label:()=>$c,link:()=>Ac,linkButton:()=>Bc,list:()=>Vc,listItem:()=>Hc,listItemButton:()=>Fc,mark:()=>jc,menu:()=>Wc,motion:()=>qc,orderedList:()=>Uc,pagination:()=>Xc,panelSection:()=>Zc,paragraph:()=>Jc,popover:()=>ou,popoverArrow:()=>In,preformated:()=>nu,progress:()=>ru,rating:()=>su,ringProgress:()=>cu,row:()=>Rn,scrollArea:()=>uu,segmented:()=>du,select:()=>hu,selectBox:()=>gu,selectItem:()=>yu,selectList:()=>vu,skeleton:()=>Su,small:()=>wu,spinner:()=>xu,splitter:()=>Eu,splitterHandle:()=>Tu,splitterPanel:()=>ku,stack:()=>_u,steps:()=>Ou,strong:()=>Lu,subscript:()=>Iu,superscript:()=>Pu,table:()=>Mu,tabs:()=>Ru,tag:()=>zt,textarea:()=>$u,timeline:()=>Au,timelineItem:()=>Nu,toast:()=>Vu,toggleGroup:()=>ju,toolbar:()=>Wu,toolbarSpacer:()=>Ku,tooltip:()=>qu,transitionGroup:()=>Uu,unorderedList:()=>Gu,visuallyHidden:()=>Yu});function Il(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>w(r),backgroundColor:r=>u(r),color:r=>u(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>u(r,"shift-7",t.get(r)),textUnderlineOffset:h(.72),cursor:"help","&:hover":{color:r=>u(r,"shift-11",n.get(r)),textDecorationColor:r=>u(r,"shift-9",n.get(r))}}}}function L(e,t="primary"){let n=u(e,"surface"),o=u(e,"shift-9",t);return`0 0 0 2px ${n}, 0 0 0 4px ${o}`}function Pl(e={}){var a,r;let{type:t="single"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:i=>{let l=i.domElement;if(!l)return;if(t==="single"){let m=s=>{let d=s.target.closest("summary");if(!d)return;let f=d.closest("details");!f||f.parentElement!==l||f.open||Array.from(l.querySelectorAll(":scope > details")).forEach(p=>{p!==f&&(p.open=!1)})};l.addEventListener("click",m),i.addHook("Remove",()=>l.removeEventListener("click",m))}let c=m=>{var S;let s=m.key;if(!["ArrowUp","ArrowDown","Home","End"].includes(s))return;let d=m.target.closest("summary");if(!d)return;let f=d.closest("details");if(!f||f.parentElement!==l)return;let p=Array.from(l.querySelectorAll(":scope > details > summary")),y=p.indexOf(d);if(y===-1)return;let g=y;s==="ArrowDown"?g=(y+1)%p.length:s==="ArrowUp"?g=(y-1+p.length)%p.length:s==="Home"?g=0:s==="End"&&(g=p.length-1),m.preventDefault(),(S=p[g])==null||S.focus()};l.addEventListener("keydown",c),i.addHook("Remove",()=>l.removeEventListener("keydown",c))},style:{display:"flex",flexDirection:"column",borderRadius:i=>h(b(i)*1.5),outline:i=>`1px solid ${u(i,"border-strong",n.get(i))}`,outlineOffset:"-1px",color:i=>u(i,"text",n.get(i)),overflow:"hidden","& > details":{borderBottom:i=>`1px solid ${u(i,"border-strong",n.get(i))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{boxShadow:i=>L(i,o.get(i))}}}}function Ml(e={}){var n;let t=v((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:h(3),paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),borderRadius:o=>h(b(o)*1.5),boxShadow:o=>`inset ${h(1)} 0 0 0 ${u(o,"shift-8",t.get(o))}`,backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"shift-10",t.get(o)),fontSize:o=>w(o,"inherit")}}}function Rl(e={}){var n;let t=v((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:h(9),height:h(9),fontSize:o=>w(o,"inherit"),fontWeight:Z("semibold"),userSelect:"none",backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"shift-11",t.get(o)),boxShadow:o=>`0 0 0 1px ${u(o,"border",t.get(o))}`,"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function $l(e={}){var a;let{label:t=999}=e,n=v(t),o=v((a=e.color)!=null?a:"danger","color");return{style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%,-50%)",paddingInline:r=>h(b(r)*(1.5/1.5)),minWidth:h(5),height:r=>h(b(r)*(5/1.5)),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>w(r,"decrease-2"),fontWeight:Z("semibold"),lineHeight:1,borderRadius:r=>h(b(r)*999),backgroundColor:r=>u(r,"shift-9",o.get(r)),color:r=>u(r,"shift-0",o.get(r)),boxShadow:r=>`0 0 0 1px ${u(r,"shift-0",o.get(r))}`}}}}function Al(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"text",t.get(o)),boxShadow:o=>`inset ${h(1)} 0 0 0 ${u(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),margin:0}}}function Nl(e={}){var o;let{separator:t="/"}=e,n=v((o=e.color)!=null?o:"neutral","color");return{_onInsert:a=>{a.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},_doctorDisable:"low-contrast",ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:a=>w(a,"inherit"),gap:h(1),color:a=>u(a,"text",n.get(a)),backgroundColor:a=>u(a,"inherit",n.get(a)),"& > *":{display:"inline-flex",alignItems:"center"},"& > *:not(:last-child)::after":{content:`"${t}"`,color:a=>u(a,"muted",n.get(a)),paddingInlineStart:h(1)},"& > [aria-current=page]":{pointerEvents:"none"}}}}function zl(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{type:"button",_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>w(o,"inherit"),paddingInline:h(1),border:"none",background:"none",cursor:"pointer",color:o=>u(o,"text",t.get(o)),borderRadius:h(1),transition:"color 140ms ease, background-color 140ms ease, box-shadow 140ms ease","&:hover":{color:o=>u(o,q(2),t.get(o)),backgroundColor:o=>u(o,"hover",t.get(o))},"&:focus-visible":{boxShadow:o=>L(o,t.get(o))}}}}var ht={small:"decrease-1",medium:"inherit",large:"increase-1"};var Bl={small:.5,medium:1,large:1.5};function hn(e={}){var a,r,i;let t=v((a=e.color)!=null?a:"neutral","color"),n=Bl[(r=e.size)!=null?r:"medium"],o=ht[(i=e.size)!=null?i:"medium"];return{type:"button",_onInsert:l=>{l.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:l=>w(l,o),paddingBlock:l=>h(b(l)*n),paddingInline:l=>h(b(l)*n),borderRadius:l=>h(b(l)*1.5),display:"inline-flex",width:"fit-content",justifyContent:"center",alignItems:"center",gap:l=>h(b(l)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:l=>u(l,"text",t.get(l)),"&:hover:not([disabled]):not([aria-busy=true])":{color:l=>u(l,q(2),t.get(l)),backgroundColor:l=>u(l,"hover",t.get(l))},"&:active:not([disabled]):not([aria-busy=true])":{color:l=>u(l,q(2),t.get(l)),backgroundColor:l=>u(l,"increase-2",t.get(l))},"&:focus-visible":{boxShadow:l=>L(l,t.get(l))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>u(l,"border-strong","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var Vl={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}};function Hl(e={}){var i,l,c,m;let t=(i=e.variant)!=null?i:"outline";if(t==="ghost")return hn({color:e.color,size:e.size});let n=v((l=e.color)!=null?l:"primary","color"),o=t==="solid",a=Vl[(c=e.size)!=null?c:"medium"],r=ht[(m=e.size)!=null?m:"medium"];return A(I({type:"button",_onInsert:s=>{s.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')}},o?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{appearance:"none",fontSize:s=>w(s,r),paddingBlock:s=>h(b(s)*a.block),paddingInline:s=>h(b(s)*a.inline),borderRadius:s=>h(b(s)*1.5),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:s=>h(b(s)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o?"none":s=>`1px solid ${u(s,"border-strong",n.get(s))}`,color:s=>o?u(s,"shift-0","neutral"):u(s,"shift-13",n.get(s)),backgroundColor:s=>o?u(s,"shift-13",n.get(s)):u(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{color:s=>o?u(s,"shift-0","neutral"):u(s,"shift-14",n.get(s)),backgroundColor:s=>o?u(s,"shift-14",n.get(s)):u(s,"hover",n.get(s))},"&:active:not([disabled]):not([aria-busy=true])":{backgroundColor:s=>o?u(s,"shift-15",n.get(s)):u(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>L(s,n.get(s))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:s=>u(s,"shift-2","neutral"),outline:s=>`1px solid ${u(s,"border-strong","neutral")}`,color:s=>u(s,"muted","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}})}function Fl(e={}){var r,i;let{checked:t=!1}=e,n=v(t),o=v((r=e.color)!=null?r:"neutral","color"),a=v((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"button",_onSchedule:l=>{l.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaLabel:"Toggle",ariaChecked:l=>n.get(l),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:l=>w(l),border:"none",outlineWidth:"1px",outline:l=>`1px solid ${u(l,"shift-7",o.get(l))}`,minWidth:h(12),minHeight:h(6),width:"fit-content",flexShrink:0,borderRadius:h(999),paddingInlineStart:h(7),paddingInlineEnd:h(2),cursor:"pointer",transition:"padding-inline-start 0.3s, padding-inline-end 0.3s, background-color 140ms ease, box-shadow 140ms ease",backgroundColor:l=>u(l,"inherit",o.get(l)),color:l=>u(l,"text",o.get(l)),"&:focus-visible":{boxShadow:l=>L(l,a.get(l))},"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",insetInlineStart:h(.5),top:"50%",transform:"translateY(-50%)",transition:"inset-inline-start 0.3s",width:h(5),height:h(5),borderRadius:h(999),color:l=>u(l,"text"),backgroundColor:l=>u(l,"decrease-2",o.get(l)),outline:l=>`1px solid ${u(l,"shift-7",o.get(l))}`,outlineOffset:"-1px"},"&[aria-checked=true]":{backgroundColor:l=>u(l,"increase-3",a.get(l)),outline:"none",color:l=>u(l,q(3),a.get(l)),paddingInlineStart:h(2),paddingInlineEnd:h(7)},"&[aria-checked=true] > :first-child":{insetInlineStart:`calc(100% - ${h(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var jl={low:"0 1px 2px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.10)",medium:"0 2px 4px rgba(0,0,0,0.10), 0 10px 24px rgba(0,0,0,0.14)",high:"0 6px 12px rgba(0,0,0,0.14), 0 24px 48px rgba(0,0,0,0.20)"};function U(e){return jl[e]}function Wl(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>h(b(o)*2),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"shift-10",t.get(o)),outline:o=>`1px solid ${u(o,"border-strong",t.get(o))}`,outlineOffset:"-1px",boxShadow:U("low"),overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),fontWeight:Z("semibold"),color:o=>u(o,"shift-11",t.get(o)),margin:0},"& > p":{gridArea:"desc",paddingInline:o=>h(b(o)*4),paddingBottom:o=>h(b(o)*2),color:o=>u(o,"text",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>h(b(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>h(b(o)*4)},"& > footer":{gridArea:"footer",display:"flex",gap:h(2),paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),borderTop:o=>`1px solid ${u(o,"border",t.get(o))}`}}}}function Kl(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",fontSize:o=>w(o,"inherit"),fontFamily:We("monospace"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),height:o=>h(b(o)*(6/1.5)),paddingInline:o=>h(b(o)*(1.5/1.5)),borderRadius:o=>h(b(o)*(1/1.5))}}}var ql="text",fn="shift-11";function we(e="neutral"){let t=v(e,"color");return{color:n=>u(n,fn,t.get(n)),"&::placeholder":{color:n=>u(n,ql,t.get(n))}}}var Ul=Object.defineProperty,Gl=Object.defineProperties,Yl=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Yr=Object.prototype.propertyIsEnumerable,Vr=(e,t,n)=>t in e?Ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t)=>{for(var n in t||(t={}))Gr.call(t,n)&&Vr(e,n,t[n]);if(ho)for(var n of ho(t))Yr.call(t,n)&&Vr(e,n,t[n]);return e},Ue=(e,t)=>Gl(e,Yl(t)),Xr=(e,t)=>{var n={};for(var o in e)Gr.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&ho)for(var o of ho(e))t.indexOf(o)<0&&Yr.call(e,o)&&(n[o]=e[o]);return n},Xe=(e,t,n)=>new Promise((o,a)=>{var r=c=>{try{l(n.next(c))}catch(m){a(m)}},i=c=>{try{l(n.throw(c))}catch(m){a(m)}},l=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,i);l((n=n.apply(e,t)).next())}),Xl=["top","right","bottom","left"],Hr=["start","end"],pd=Xl.reduce((e,t)=>e.concat(t,`${t}-${Hr[0]}`,`${t}-${Hr[1]}`),[]),fo=Math.min,qe=Math.max,po=Math.round,mo=Math.floor,Ie=e=>({x:e,y:e}),Zl={left:"right",right:"left",bottom:"top",top:"bottom"};function Jl(e,t,n){return qe(e,fo(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function pt(e){return e.split("-")[0]}function vo(e){return e.split("-")[1]}function Zr(e){return e==="x"?"y":"x"}function Jr(e){return e==="y"?"height":"width"}function Ae(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Qr(e){return Zr(Ae(e))}function Ql(e,t,n=!1){let o=vo(e),a=Qr(e),r=Jr(a),i=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=go(i)),[i,go(i)]}function es(e){let t=go(e);return[yn(e),t,yn(t)]}function yn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Fr=["left","right"],jr=["right","left"],ts=["top","bottom"],os=["bottom","top"];function ns(e,t,n){switch(e){case"top":case"bottom":return n?t?jr:Fr:t?Fr:jr;case"left":case"right":return t?ts:os;default:return[]}}function rs(e,t,n,o){let a=vo(e),r=ns(pt(e),n==="start",o);return a&&(r=r.map(i=>`${i}-${a}`),t&&(r=r.concat(r.map(yn)))),r}function go(e){let t=pt(e);return Zl[t]+e.slice(t.length)}function is(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function as(e){return typeof e!="number"?is(e):{top:e,right:e,bottom:e,left:e}}function yo(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Wr({reference:e,floating:t},n,o){let a=Ae(n),r=Qr(n),i=Jr(r),l=pt(n),c=a==="y",m=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,d=e[i]/2-t[i]/2,f;switch(l){case"top":f={x:m,y:e.y-t.height};break;case"bottom":f={x:m,y:e.y+e.height};break;case"right":f={x:e.x+e.width,y:s};break;case"left":f={x:e.x-t.width,y:s};break;default:f={x:e.x,y:e.y}}let p=vo(n);return p&&(f[r]+=d*(p==="end"?1:-1)*(o&&c?-1:1)),f}function ls(e){return Xe(this,arguments,function*(t,n={}){var o,a,r,i,l,c;let{x:m,y:s,platform:d,rects:f,elements:p,strategy:y}=t,{boundary:g="clippingAncestors",rootBoundary:S="viewport",elementContext:E="floating",altBoundary:O=!1,padding:T=0}=bo(n,t),x=as(T),D=p[O?E==="floating"?"reference":"floating":E],_=yo(yield d.getClippingRect({element:(a=yield(o=d.isElement)==null?void 0:o.call(d,D))==null||a?D:D.contextElement||(yield(r=d.getDocumentElement)==null?void 0:r.call(d,p.floating)),boundary:g,rootBoundary:S,strategy:y})),C=E==="floating"?{x:m,y:s,width:f.floating.width,height:f.floating.height}:f.reference,M=yield(i=d.getOffsetParent)==null?void 0:i.call(d,p.floating),P=(yield(l=d.isElement)==null?void 0:l.call(d,M))&&(yield(c=d.getScale)==null?void 0:c.call(d,M))||{x:1,y:1},V=yo(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:C,offsetParent:M,strategy:y}):C);return{top:(_.top-V.top+x.top)/P.y,bottom:(V.bottom-_.bottom+x.bottom)/P.y,left:(_.left-V.left+x.left)/P.x,right:(V.right-_.right+x.right)/P.x}})}var ss=50,cs=(e,t,n)=>Xe(null,null,function*(){var o;let{placement:a="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=l.detectOverflow?l:Ue(Ce({},l),{detectOverflow:ls}),m=yield(o=l.isRTL)==null?void 0:o.call(l,t),s=yield l.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=Wr(s,a,m),p=a,y=0,g={};for(let S=0;S<i.length;S++){let E=i[S];if(!E)continue;let{name:O,fn:T}=E,{x,y:D,data:_,reset:C}=yield T({x:d,y:f,initialPlacement:a,placement:p,strategy:r,middlewareData:g,rects:s,platform:c,elements:{reference:e,floating:t}});d=x!=null?x:d,f=D!=null?D:f,g[O]=Ce(Ce({},g[O]),_),C&&y<ss&&(y++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(s=C.rects===!0?yield l.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:d,y:f}=Wr(s,p,m)),S=-1)}return{x:d,y:f,placement:p,strategy:r,middlewareData:g}});var us=(e={})=>({name:"flip",options:e,fn(t){return Xe(this,null,function*(){var n,o,a,r,i,l;let{placement:c,middlewareData:m,rects:s,initialPlacement:d,platform:f,elements:p}=t,y=bo(e,t),{mainAxis:g=!0,crossAxis:S=!0,fallbackPlacements:E,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:x=!0}=y,D=Xr(y,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=m.arrow)!=null&&n.alignmentOffset)return{};let _=pt(c),C=Ae(d),M=pt(d)===d,P=yield(o=f.isRTL)==null?void 0:o.call(f,p.floating),V=E||(M||!x?[go(d)]:es(d)),re=T!=="none";!E&&re&&V.push(...rs(d,x,T,P));let F=[d,...V],G=yield f.detectOverflow(t,D),ie=[],Y=((a=m.flip)==null?void 0:a.overflows)||[];if(g&&ie.push(G[_]),S){let Q=Ql(c,s,P);ie.push(G[Q[0]],G[Q[1]])}if(Y=[...Y,{placement:c,overflows:ie}],!ie.every(Q=>Q<=0)){let Q=(((r=m.flip)==null?void 0:r.index)||0)+1,ae=F[Q];if(ae&&(!(S==="alignment"&&C!==Ae(ae))||Y.every(le=>Ae(le.placement)===C?le.overflows[0]>0:!0)))return{data:{index:Q,overflows:Y},reset:{placement:ae}};let ee=(i=Y.filter(le=>le.overflows[0]<=0).sort((le,oe)=>le.overflows[1]-oe.overflows[1])[0])==null?void 0:i.placement;if(!ee)switch(O){case"bestFit":{let le=(l=Y.filter(oe=>{if(re){let se=Ae(oe.placement);return se===C||se==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(se=>se>0).reduce((se,ve)=>se+ve,0)]).sort((oe,se)=>oe[1]-se[1])[0])==null?void 0:l[0];le&&(ee=le);break}case"initialPlacement":ee=d;break;default:}if(c!==ee)return{reset:{placement:ee}}}return{}})}});var ms=new Set(["left","top"]);function ds(e,t){return Xe(this,null,function*(){var n;let{placement:o,platform:a,elements:r}=e,i=yield(n=a.isRTL)==null?void 0:n.call(a,r.floating),l=pt(o),c=vo(o),m=Ae(o)==="y",s=ms.has(l)?-1:1,d=i&&m?-1:1,f=bo(t,e),{mainAxis:p,crossAxis:y,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(y=c==="end"?g*-1:g),m?{x:y*d,y:p*s}:{x:p*s,y:y*d}})}var hs=(e=0)=>({name:"offset",options:e,fn(t){return Xe(this,null,function*(){var n,o;let{x:a,y:r,placement:i,middlewareData:l}=t,c=yield ds(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+c.x,y:r+c.y,data:Ue(Ce({},c),{placement:i})}})}}),fs=(e={})=>({name:"shift",options:e,fn(t){return Xe(this,null,function*(){let{x:n,y:o,placement:a,platform:r}=t,i=bo(e,t),{mainAxis:l=!0,crossAxis:c=!1,limiter:m={fn:({x:T,y:x})=>({x:T,y:x})}}=i,s=Xr(i,["mainAxis","crossAxis","limiter"]),d={x:n,y:o},f=yield r.detectOverflow(t,s),p=Ae(a),y=Zr(p),g=d[y],S=d[p],E=(T,x)=>Jl(x+f[T==="y"?"top":"left"],x,x-f[T==="y"?"bottom":"right"]);l&&(g=E(y,g)),c&&(S=E(p,S));let O=m.fn(Ue(Ce({},t),{[y]:g,[p]:S}));return Ue(Ce({},O),{data:{x:O.x-n,y:O.y-o,enabled:{[y]:l,[p]:c}}})})}});function So(){return typeof window!="undefined"}function gt(e){return ei(e)?(e.nodeName||"").toLowerCase():"#document"}function pe(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function Pe(e){var t;return(t=(ei(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ei(e){return So()?e instanceof Node||e instanceof pe(e).Node:!1}function ke(e){return So()?e instanceof Element||e instanceof pe(e).Element:!1}function Ne(e){return So()?e instanceof HTMLElement||e instanceof pe(e).HTMLElement:!1}function Kr(e){return!So()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof pe(e).ShadowRoot}function wo(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Te(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function ps(e){return/^(table|td|th)$/.test(gt(e))}function xo(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var gs=/transform|translate|scale|rotate|perspective|filter/,ys=/paint|layout|strict|content/,Ke=e=>!!e&&e!=="none",pn;function vn(e){let t=ke(e)?Te(e):e;return Ke(t.transform)||Ke(t.translate)||Ke(t.scale)||Ke(t.rotate)||Ke(t.perspective)||!Sn()&&(Ke(t.backdropFilter)||Ke(t.filter))||gs.test(t.willChange||"")||ys.test(t.contain||"")}function bs(e){let t=Ge(e);for(;Ne(t)&&!$t(t);){if(vn(t))return t;if(xo(t))return null;t=Ge(t)}return null}function Sn(){return pn==null&&(pn=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pn}function $t(e){return/^(html|body|#document)$/.test(gt(e))}function Te(e){return pe(e).getComputedStyle(e)}function Eo(e){return ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(gt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Kr(e)&&e.host||Pe(e);return Kr(t)?t.host:t}function ti(e){let t=Ge(e);return $t(t)?(e.ownerDocument||e).body:Ne(t)&&wo(t)?t:ti(t)}function At(e,t=[],n=!0){var o;let a=ti(e),r=a===((o=e.ownerDocument)==null?void 0:o.body),i=pe(a);if(r){let l=bn(i);return t.concat(i,i.visualViewport||[],wo(a)?a:[],l&&n?At(l):[])}else return t.concat(a,At(a,[],n))}function bn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oi(e){let t=Te(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Ne(e),r=a?e.offsetWidth:n,i=a?e.offsetHeight:o,l=po(n)!==r||po(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function wn(e){return ke(e)?e:e.contextElement}function ft(e){let t=wn(e);if(!Ne(t))return Ie(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:r}=oi(t),i=(r?po(n.width):n.width)/o,l=(r?po(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var vs=Ie(0);function ni(e){let t=pe(e);return!Sn()||!t.visualViewport?vs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ss(e,t=!1,n){return!!n&&t&&n===pe(e)}function Ye(e,t=!1,n=!1,o){let a=e.getBoundingClientRect(),r=wn(e),i=Ie(1);t&&(o?ke(o)&&(i=ft(o)):i=ft(e));let l=Ss(r,n,o)?ni(r):Ie(0),c=(a.left+l.x)/i.x,m=(a.top+l.y)/i.y,s=a.width/i.x,d=a.height/i.y;if(r&&o){let f=pe(r),p=ke(o)?pe(o):o,y=f,g=bn(y);for(;g&&p!==y;){let S=ft(g),E=g.getBoundingClientRect(),O=Te(g),T=E.left+(g.clientLeft+parseFloat(O.paddingLeft))*S.x,x=E.top+(g.clientTop+parseFloat(O.paddingTop))*S.y;c*=S.x,m*=S.y,s*=S.x,d*=S.y,c+=T,m+=x,y=pe(g),g=bn(y)}}return yo({width:s,height:d,x:c,y:m})}function Co(e,t){let n=Eo(e).scrollLeft;return t?t.left+n:Ye(Pe(e)).left+n}function ri(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Co(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function ws({elements:e,rect:t,offsetParent:n,strategy:o}){let a=o==="fixed",r=Pe(n),i=e?xo(e.floating):!1;if(n===r||i&&a)return t;let l={scrollLeft:0,scrollTop:0},c=Ie(1),m=Ie(0),s=Ne(n);if((s||!a)&&((gt(n)!=="body"||wo(r))&&(l=Eo(n)),s)){let f=Ye(n);c=ft(n),m.x=f.x+n.clientLeft,m.y=f.y+n.clientTop}let d=r&&!s&&!a?ri(r,l):Ie(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+m.x+d.x,y:t.y*c.y-l.scrollTop*c.y+m.y+d.y}}function xs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Es(e){let t=Eo(e),n=e.ownerDocument.body,o=qe(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=qe(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),r=-t.scrollLeft+Co(e),i=-t.scrollTop;return Te(n).direction==="rtl"&&(r+=qe(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:r,y:i}}var Cs=25;function ks(e,t,n="viewport"){let o=n==="layoutViewport",a=pe(e),r=Pe(e),i=a.visualViewport,l=r.clientWidth,c=r.clientHeight,m=0,s=0;if(i){let d=!Sn()||t==="fixed";o?d||(m=-i.offsetLeft,s=-i.offsetTop):(l=i.width,c=i.height,d&&(m=i.offsetLeft,s=i.offsetTop))}if(Co(r)<=0){let d=r.ownerDocument,f=d.body,p=getComputedStyle(f),y=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-y),S=getComputedStyle(r).scrollbarGutter==="stable both-edges"?g/2:g;S<=Cs&&(l-=S)}return{width:l,height:c,x:m,y:s}}function Ts(e,t){let n=Ye(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,r=ft(e),i=e.clientWidth*r.x,l=e.clientHeight*r.y,c=a*r.x,m=o*r.y;return{width:i,height:l,x:c,y:m}}function qr(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=ks(e,n,t);else if(t==="document")o=Es(Pe(e));else if(ke(t))o=Ts(t,n);else{let a=ni(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return yo(o)}function _s(e,t){let n=t.get(e);if(n)return n;let o=At(e,[],!1).filter(l=>ke(l)&&gt(l)!=="body"),a=null,r=Te(e).position==="fixed",i=r?Ge(e):e;for(;ke(i)&&!$t(i);){let l=Te(i),c=vn(i),m=a?a.position:r?"fixed":"";!c&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(s=>s!==i):a=l,i=Ge(i)}return t.set(e,o),o}function Ds({element:e,boundary:t,rootBoundary:n,strategy:o}){let a=[...t==="clippingAncestors"?xo(e)?[]:_s(e,this._c):[].concat(t),n],r=qr(e,a[0],o),i=r.top,l=r.right,c=r.bottom,m=r.left;for(let s=1;s<a.length;s++){let d=qr(e,a[s],o);i=qe(d.top,i),l=fo(d.right,l),c=fo(d.bottom,c),m=qe(d.left,m)}return{width:l-m,height:c-i,x:m,y:i}}function Os(e){let{width:t,height:n}=oi(e);return{width:t,height:n}}function Ls(e,t,n){let o=Ne(t),a=Pe(t),r=n==="fixed",i=Ye(e,!0,r,t),l={scrollLeft:0,scrollTop:0},c=Ie(0);if((o||!r)&&((gt(t)!=="body"||wo(a))&&(l=Eo(t)),o)){let f=Ye(t,!0,r,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}!o&&a&&(c.x=Co(a));let m=a&&!o&&!r?ri(a,l):Ie(0),s=i.left+l.scrollLeft-c.x-m.x,d=i.top+l.scrollTop-c.y-m.y;return{x:s,y:d,width:i.width,height:i.height}}function gn(e){return Te(e).position==="static"}function Ur(e,t){if(!Ne(e)||Te(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pe(e)===n&&(n=n.ownerDocument.body),n}function ii(e,t){let n=pe(e);if(xo(e))return n;if(!Ne(e)){let a=Ge(e);for(;a&&!$t(a);){if(ke(a)&&!gn(a))return a;a=Ge(a)}return n}let o=Ur(e,t);for(;o&&ps(o)&&gn(o);)o=Ur(o,t);return o&&$t(o)&&gn(o)&&!vn(o)?n:o||bs(e)||n}var Is=function(e){return Xe(this,null,function*(){let t=this.getOffsetParent||ii,n=this.getDimensions,o=yield n(e.floating);return{reference:Ls(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Ps(e){return Te(e).direction==="rtl"}var Ms={convertOffsetParentRelativeRectToViewportRelativeRect:ws,getDocumentElement:Pe,getClippingRect:Ds,getOffsetParent:ii,getElementRects:Is,getClientRects:xs,getDimensions:Os,getScale:ft,isElement:ke,isRTL:Ps};function ai(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rs(e,t,n){let o=null,a,r=Pe(e);function i(){clearTimeout(a),o==null||o.disconnect(),o=null}function l(s=!1,d=1){i();let f=e.getBoundingClientRect(),{left:p,top:y,width:g,height:S}=f;if(s||t(),!g||!S)return;let E=mo(y),O=mo(r.clientWidth-(p+g)),T=mo(r.clientHeight-(y+S)),x=mo(p),D={rootMargin:`${-E}px ${-O}px ${-T}px ${-x}px`,threshold:qe(0,fo(1,d))||1},_=!0;function C(M){let P=M[0].intersectionRatio;if(!ai(f,e.getBoundingClientRect()))return l();if(P!==d){if(!_)return l();P?l(!1,P):a=setTimeout(()=>{l(!1,1e-7)},1e3)}_=!1}try{o=new IntersectionObserver(C,Ue(Ce({},D),{root:r.ownerDocument}))}catch(M){o=new IntersectionObserver(C,D)}o.observe(e)}let c=pe(e),m=()=>l(n);return c.addEventListener("resize",m),l(!0),()=>{c.removeEventListener("resize",m),i()}}function li(e,t,n,o={}){let{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,m=wn(e),s=a||r?[...m?At(m):[],...t?At(t):[]]:[];s.forEach(E=>{a&&E.addEventListener("scroll",n),r&&E.addEventListener("resize",n)});let d=m&&l?Rs(m,n,r):null,f=-1,p=null;i&&(p=new ResizeObserver(([E])=>{E&&E.target===m&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p==null||p.observe(t)})),n()}),m&&!c&&p.observe(m),t&&p.observe(t));let y,g=c?Ye(e):null;c&&S();function S(){let E=Ye(e);g&&!ai(g,E)&&n(),g=E,y=requestAnimationFrame(S)}return n(),()=>{s.forEach(E=>{a&&E.removeEventListener("scroll",n),r&&E.removeEventListener("resize",n)}),d==null||d(),p==null||p.disconnect(),p=null,c&&cancelAnimationFrame(y)}}var si=hs;var ci=fs,ui=us;var mi=(e,t,n)=>{let o=new Map,a=n!=null?n:{},r=Ue(Ce(Ce({},Ms),a.platform),{_c:o});return cs(e,t,Ue(Ce({},a),{platform:r}))};function $s(e){return typeof e.set=="function"}function be(e,t,n=!0){if(typeof e.addListener=="function")return n&&t(e.get()),e.addListener(t);if(n)return Dt(()=>{t(e.get())});let o=!0,a=Dt(()=>{let r=e.get();o||t(r)});return o=!1,a}function xn(e,t){$s(e)&&e.set(t)}function ze(e,t){t==null||t(),xn(e,!1)}function yt(e){return v(e!=null?e:!1)}var di=100;function ge(e,t){return`domphy-${e}-${t.nodeId}`}var En="data-domphy-floating",Cn=`:scope > [${En}]`,hi="data-domphy-floating-kind";function ko(e){let t=e.querySelector(Cn);return t?Array.from(t.children).some(n=>n.getAttribute(hi)!=="tooltip"):!1}function As(e,t){var Ht,Qe,wt,Ft;let{openState:n,onDismiss:o,placement:a,content:r,keepOpenOnContentHover:i,openDelay:l,closeDelay:c}=t,{kind:m}=t,s=`floating:${m}`,d=null,f=null,p=null,y=null,g=!1,S=e.domElement,E=e.getRoot(),O=ge(m,e),T={style:{position:"fixed",pointerEvents:"auto",visibility:N=>n.get(N)?"visible":"hidden"},onKeyDown:N=>{N.key==="Escape"&&ie()&&(N.stopPropagation(),F())},onMouseEnter:()=>i&&re(),onMouseLeave:()=>i&&F(),_onMount:N=>{var te;if(p=N.domElement,p.id||(p.id=O),p.setAttribute(hi,m),S&&p&&!p.hasAttribute("data-theme")){let ye=(te=S.closest("[data-theme]"))==null?void 0:te.getAttribute("data-theme");ye&&p.setAttribute("data-theme",ye)}},_portal:N=>{let te=S.closest("dialog");if(te){let me=te.querySelector(Cn);return me||(me=te.ownerDocument.createElement("div"),me.setAttribute(En,""),Object.assign(me.style,{position:"fixed",inset:"0",zIndex:"20",pointerEvents:"none"}),te.appendChild(me)),me}let ye=N.domElement.querySelector(Cn);if(!ye){let me={div:[],[En]:"",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};ye=N.children.insert(me).domElement}return ye}},x=N=>X(N,T);x(r);let D=()=>{g||(g=!0,y=E.children.insert(r),y._behaviorInstances.set(s,se))},_=()=>{y&&(y._behaviorInstances.delete(s),y.remove(),y=null)},C=()=>{g&&(!p||!p.isConnected)&&(f==null||f(),f=null,y=null,p=null,g=!1),D(),S&&p&&(f==null||f(),f=li(S,p,()=>{mi(S,p,{placement:a.get(),middleware:[si(12),ui(),ci()],strategy:"fixed"}).then(({x:N,y:te,placement:ye})=>{p&&(Object.assign(p.style,{left:`${N}px`,top:`${te}px`}),a.set(ye))})}),xn(n,!0))},M=()=>{if(!p)return!1;let te=p.getRootNode().activeElement;return!!te&&p.contains(te)},P=()=>{var ye,me,xt;if(!S)return;(ye=S.focus)==null||ye.call(S);let te=S.getRootNode().activeElement;te&&S.contains(te)||(xt=(me=S.querySelector('input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'))==null?void 0:me.focus)==null||xt.call(me)},V=()=>{f==null||f(),f=null;let N=M();_(),p=null,g=!1,N&&P(),ze(n,o)},re=()=>{d&&clearTimeout(d),d=setTimeout(C,l)},F=()=>{d&&clearTimeout(d),d=setTimeout(V,c)},G=N=>{if(!n.get()||!S||!p)return;let te=N.target;!S.contains(te)&&!p.contains(te)&&F()};(Ht=E.domElement)==null||Ht.addEventListener("click",G);let ie=()=>{var N;return!!p&&((N=p.parentElement)==null?void 0:N.lastElementChild)===p},Y=N=>{N.key==="Escape"&&n.get()&&ie()&&F()},Q=(Ft=(wt=(Qe=E.domElement)==null?void 0:Qe.ownerDocument)!=null?wt:E.domElement)!=null?Ft:null;Q==null||Q.addEventListener("keydown",Y);let ae=N=>{N?g||C():g&&V()},ee=()=>{},le=!1,oe=!1,se,ve=N=>{var te;N._behaviors=A(I({},(te=N._behaviors)!=null?te:{}),{[s]:{attach:()=>se,props:{}}})};return se={show:re,hide:F,panelId:O,update(N){if(!oe&&(o=N.onDismiss,N.openState!==n&&(ee(),n=N.openState,ee=be(n,ae,!1),n.get()&&C()),a=N.placement,r=N.content,i=N.keepOpenOnContentHover,l=N.openDelay,c=N.closeDelay,x(r),ve(r),y)){oe=!0;try{y.patch(r)}finally{oe=!1}}},destroy(){var N;le||(le=!0,d&&clearTimeout(d),d=null,f==null||f(),f=null,_(),p=null,g=!1,ee(),ee=()=>{},(N=E.domElement)==null||N.removeEventListener("click",G),Q==null||Q.removeEventListener("keydown",Y))}},ve(r),ee=be(n,ae),se}function _e(e){var m,s;let{kind:t,placement:n,onDismiss:o}=e,a=yt(e.open),r=`floating:${t}`,i=d=>{var f;return(f=d==null?void 0:d.getBehavior(r))==null?void 0:f.show()},l=d=>{var f;return(f=d==null?void 0:d.getBehavior(r))==null?void 0:f.hide()},c=I({onKeyDown:(d,f)=>d.key==="Escape"&&l(f)},H(r,As,{kind:t,openState:a,onDismiss:o,placement:n,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover,openDelay:(m=e.openDelay)!=null?m:di,closeDelay:(s=e.closeDelay)!=null?s:di}));return{show:i,hide:l,anchorPartial:c,openState:a}}function Ze(e){return e?Array.from(e.querySelectorAll("[role=option]")).filter(t=>t.getAttribute("aria-disabled")!=="true"&&!t.hasAttribute("disabled")):[]}var Ns='<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>',Nt=1.5,zs=6/Nt,fi=2.5/Nt,Bs=1/Nt,pi=4/Nt,Vs=1/Nt;function zt(e={}){var o;let{removable:t=!1}=e,n=v((o=e.color)!=null?o:"neutral","color");return A(I({dataTone:"shift-2"},H("tag-remove",(a,r)=>{let i=()=>a.remove(),l=()=>({span:Fe(Ns),_key:"tag-remove",onClick:s=>{s.stopPropagation(),i()},onKeyDown:s=>{let d=s;d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),d.stopPropagation(),i())},tabindex:0,role:"button",ariaLabel:"Remove",style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s=>h(b(s)*Vs),width:s=>h(b(s)*pi),height:s=>h(b(s)*pi),flexShrink:0,transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover":{backgroundColor:s=>u(s,"shift-4",n.get(s))},"&:focus-visible":{boxShadow:s=>L(s,n.get(s))}}}),c=()=>{var s;return(s=a.children.items.find(d=>d instanceof ne&&d.key==="tag-remove"))!=null?s:null},m=s=>{let d=c();s.removable&&!d?a.children.insert(l()):!s.removable&&d&&a.children.remove(d)};return m(r),{update:m}},{removable:t})),{style:{display:"inline-flex",width:"fit-content",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:a=>h(b(a)*zs),paddingBlock:0,borderRadius:a=>h(b(a)*999),paddingInlineStart:a=>h(b(a)*fi),paddingInlineEnd:a=>h(b(a)*(t?Bs:fi)),gap:h(1.5),fontSize:a=>w(a,"decrease-1"),backgroundColor:a=>u(a,"inherit",n.get(a)),color:a=>u(a,"text",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${u(a,"border-strong",n.get(a))}`}})}function Hs(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=v(e.value),l=v(a),{show:c,hide:m,anchorPartial:s}=_e({kind:"combobox",open:l,onDismiss:e.onDismiss,placement:v(n),content:e.content}),d={onClick:(C,M)=>!r&&m(M),dataTone:"shift-0",style:{backgroundColor:C=>u(C,"inherit"),color:C=>u(C,"text"),borderRadius:C=>h(b(C)*2),outline:C=>`1px solid ${u(C,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}};X(e.content,d);let f=A(I({border:"none",outline:"none",padding:0,margin:0,flex:1,height:h(6),marginInlineStart:h(2),fontSize:C=>w(C,"inherit")},we(o)),{backgroundColor:C=>u(C,"inherit",o)}),p=C=>{var M,P;return(P=(M=C==null?void 0:C.elementNode)==null?void 0:M.getBehavior("comboboxInner"))==null?void 0:P.query},y=C=>{let M=C;for(;M;){if(M._behaviorInstances.has("floating:combobox"))return M;M=M.parent}return C},g=(C,M)=>{var ie,Y;let P=y(C),V=P.getRoot().domElement,re=(ie=V==null?void 0:V.querySelector(`#${ge("combobox",P)}`))!=null?ie:null,F=Ze(re);if(!F.length)return;let G=F[M?F.length-1:0];G.focus(),(Y=G.scrollIntoView)==null||Y.call(G,{block:"nearest"})},S=(C,M)=>{let P;P=be(l,V=>{V&&(P==null||P(),requestAnimationFrame(()=>g(C,M)))},!1),c(C)},O={role:"combobox",ariaHaspopup:"listbox",ariaAutocomplete:"list",ariaExpanded:C=>l.get(C),ariaControls:C=>C!=null&&C.elementNode?ge("combobox",y(C.elementNode)):void 0,onKeyDown:(C,M)=>{let P=C.key;if(!(P!=="ArrowDown"&&P!=="ArrowUp")){if(C.preventDefault(),l.get()){g(M,P==="ArrowUp");return}S(M,P==="ArrowUp")}}},T=C=>C?(X(C,I({onClick:(M,P)=>c(P),style:f,_key:"combobox-input"},O)),C):I({input:null,ariaLabel:"Filter options",onClick:(M,P)=>c(P),value:M=>{var P,V;return(V=(P=p(M))==null?void 0:P.get(M))!=null?V:""},onInput:(M,P)=>{var V;(V=P.getBehavior("comboboxInner"))==null||V.query.set(M.target.value),c(P)},style:f,_key:"combobox-input"},O),x=C=>({div:M=>{l.get(M);let P=C.state.get(M),V=Array.isArray(P)?P:[P],F=C.options.filter(G=>V.includes(G.value)).map(G=>({span:G.label,$:[zt({color:C.color,removable:!0})],_key:G.value,_onRemove:ie=>{let Y=C.state.get(),ae=(Array.isArray(Y)?Y:[Y]).filter(ee=>ee!==G.value);C.multiple?C.state.set(ae):C.state.set(ae[0])}}));return F.push(T(C.input)),F},_key:"comboboxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1)}}),_=A(I({_onInsert:C=>{C.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onSchedule:(C,M)=>{M[C.tagName]=[x({options:t,multiple:r,color:o,state:i,input:e.input})]}},H("comboboxInner",(C,M)=>{let P=C.getMetadata("comboboxQuery");return P||(P=v(""),C.setMetadata("comboboxQuery",P)),{query:P,update(V){C.children.update([x(V)])}}},{options:t,multiple:r,color:o,state:i,input:e.input})),{style:{minWidth:h(32),outlineOffset:"-1px",outline:C=>`1px solid ${u(C,"border-strong","neutral")}`,paddingBlock:C=>h(b(C)*1),paddingInline:C=>h(b(C)*1),borderRadius:C=>h(b(C)*1.5),fontSize:C=>w(C,"inherit"),color:C=>u(C,"text",o),backgroundColor:C=>u(C,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-within":{boxShadow:C=>L(C,o)}}});return X(s,_),s}function Fs(e){return Array.from(e.querySelectorAll("[data-command-item]")).filter(t=>!t.hidden&&!t.hasAttribute("disabled"))}function js(e,t){var m;let n=e.key,o=t.domElement;if(!o)return;let a=Fs(o);if(!a.length)return;let r=o.ownerDocument.activeElement,i=r?a.indexOf(r):-1;if(n==="Enter"){if(i===-1)return;e.preventDefault(),a[i].click();return}let l;if(n==="ArrowDown")l=(i+1)%a.length;else if(n==="ArrowUp")l=i<=0?a.length-1:i-1;else if(n==="Home")l=0;else if(n==="End")l=a.length-1;else return;e.preventDefault();let c=a[l];c.focus(),(m=c.scrollIntoView)==null||m.call(c,{block:"nearest"})}function Ws(){return{role:"group",ariaLabel:"Commands",onKeyDown:js,_onSchedule:(e,t)=>{X(t,{_context:{command:{query:v("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Ks(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,i=()=>a.query.set(r.value);r.addEventListener("input",i),o.addHook("Remove",()=>r.removeEventListener("input",i))},style:A(I({fontSize:o=>w(o,"inherit"),paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*2),border:"none",borderBottom:o=>`1px solid ${u(o,"border",t)}`,outline:"none"},we(t)),{backgroundColor:o=>u(o,"inherit",t),transition:"border-bottom-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{borderBottomColor:o=>u(o,"shift-6",n),boxShadow:o=>L(o,n)}})}}function qs(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{type:"button",dataCommandItem:"",_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,i=c=>{var s,d;if(c.length===0){r.hidden=!1;return}let m=(d=(s=r.textContent)==null?void 0:s.toLowerCase())!=null?d:"";r.hidden=!m.includes(c.toLowerCase())};i(a.query.get());let l=a.query.addListener(i);o.addHook("Remove",l)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>w(o,"inherit"),height:o=>h(6+b(o)*2),paddingInline:o=>h(b(o)*3),border:"none",outline:"none",color:o=>u(o,"shift-13",t),backgroundColor:o=>u(o,"inherit",t),transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:o=>u(o,"shift-13",t),backgroundColor:o=>u(o,"hover",t)},"&:focus-visible":{boxShadow:o=>L(o,n)}}}}var ce=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Je=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),kn=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Bt=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Tn=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,_n=(e,t)=>Je(e,-((e.getDay()-t+7)%7));function Us(e){var t,n;try{let o=new Intl.Locale(e),a=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(a!=null&&a.firstDay)return a.firstDay%7}catch(o){}return 0}function Gs(e,t){let n=t,o=null,a=i=>{o==null||o(),o=i.onChange?i.selection.addListener(l=>i.onChange(l)):null},r=(i,l)=>{i!==l&&i.set(l.get())};return a(n),{update(i){i.selectionIsCallerOwned||r(i.selection,n.selection),r(i.viewYear,n.viewYear),r(i.viewMonth,n.viewMonth),r(i.focused,n.focused),r(i.hovered,n.hovered),r(i.hour,n.hour),r(i.minute,n.minute),r(i.open,n.open),(i.selection!==n.selection||i.onChange!==n.onChange)&&a(i),n=i},destroy(){o==null||o(),o=null}}}function Ys(e={}){var An,Nn,zn,Bn;let{mode:t="single",time:n=!1,min:o,max:a,disabledDate:r,locale:i=typeof navigator!="undefined"?navigator.language:"en-US",format:l,onChange:c}=e,m=(An=e.weekStartsOn)!=null?An:Us(i),s=v((Nn=e.accentColor)!=null?Nn:"primary","accentColor"),d=v((zn=e.placement)!=null?zn:"bottom-start"),f=v((Bn=e.value)!=null?Bn:t==="range"?[null,null]:null),p=(()=>{let k=f.get(),R=t==="range"?k==null?void 0:k[0]:k;return R instanceof Date?R:new Date})(),y=v(p.getFullYear(),"viewYear"),g=v(p.getMonth(),"viewMonth"),S=v(ce(p),"focused"),E=v(null,"hovered"),O=v(p.getHours(),"hour"),T=v(p.getMinutes(),"minute"),x=new Intl.DateTimeFormat(i,I({dateStyle:"medium"},n?{timeStyle:"short"}:{})),D=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),_=new Intl.DateTimeFormat(i,{weekday:"short"}),C=new Intl.DateTimeFormat(i,{dateStyle:"full"}),M=k=>k?x.format(k):"",P=k=>{if(l)return l(k);if(t==="range"){let[R,$]=k!=null?k:[null,null];return R?`${M(R)} \u2013 ${M($)}`:""}return M(k)},V=Array.from({length:7},(k,R)=>_.format(new Date(2023,0,1+(R+m)%7))),re=k=>!!o&&ce(k)<ce(o)||!!a&&ce(k)>ce(a)||!!r&&r(k),F=k=>{if(!n)return ce(k);let R=ce(k);return R.setHours(O.get(),T.get(),0,0),R},G=(k,R)=>{var z;if(re(k))return;if(t==="single"){f.set(F(k)),n||Qe(R);return}let[$,B]=(z=f.get())!=null?z:[null,null];!$||$&&B?f.set([F(k),null]):ce(k)<ce($)?(f.set([F(k),F($)]),n||Qe(R)):(f.set([$,F(k)]),n||Qe(R))},ie=()=>{var k;if(n)if(t==="single"){let R=f.get();R&&f.set(F(R))}else{let[R,$]=(k=f.get())!=null?k:[null,null];f.set([R&&F(R),$&&F($)])}},Y=(k,R)=>{var et;if(t!=="range")return!1;let[$,B]=(et=f.get(R))!=null?et:[null,null],z=B!=null?B:E.get(R);if(!$||!z)return!1;let j=ce($)<=ce(z)?$:z,Se=ce($)<=ce(z)?z:$,fe=ce(k);return fe>=ce(j)&&fe<=ce(Se)},Q=(k,R)=>{let $=f.get(R);if(t==="range"){let[B,z]=$!=null?$:[null,null];return Bt(k,B)||Bt(k,z)}return Bt(k,$)},ae=k=>{y.set(k.getFullYear()),g.set(k.getMonth())},ee=k=>{let R=kn(new Date(y.get(),g.get(),1),k);ae(R)},le=k=>y.set(y.get()+k),oe=k=>{var $;let R=($=k==null?void 0:k.getRoot())==null?void 0:$.domElement;setTimeout(()=>{var B;(B=R==null?void 0:R.querySelector(`[data-date="${Tn(S.get())}"]`))==null||B.focus()},0)},se=ye(),ve=v(!1),{show:Ht,hide:Qe,anchorPartial:wt}=_e({kind:"datePicker",open:ve,placement:d,content:se}),Ft=I({type:"text",readonly:!0,value:k=>P(f.get(k)),role:"combobox",ariaHaspopup:"dialog",ariaExpanded:k=>ve.get(k),ariaControls:k=>k!=null&&k.elementNode?ge("datePicker",k.elementNode):void 0,ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(k,R)=>{N(R)},onKeyDown:(k,R)=>{let $=k.key;($==="ArrowDown"||$==="Enter")&&(k.preventDefault(),N(R))}},H("datePicker",Gs,{selection:f,selectionIsCallerOwned:e.value!==void 0,viewYear:y,viewMonth:g,focused:S,hovered:E,hour:O,minute:T,open:ve,onChange:c}));function N(k){var $;let R=($=te())!=null?$:new Date;S.set(ce(R)),ae(R),Ht(k),oe(k)}function te(){var R;let k=f.get();return t==="range"?(R=k==null?void 0:k[0])!=null?R:null:k!=null?k:null}return X(wt,Ft),wt;function ye(){let k=(j,Se,fe)=>({button:j,type:"button",ariaLabel:Se,onClick:fe,style:Xs()}),R={div:[k("\xAB","Previous year",()=>le(-1)),k("\u2039","Previous month",()=>ee(-1)),{div:j=>D.format(new Date(y.get(j),g.get(j),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:Z("bold"),fontSize:j=>w(j)}},k("\u203A","Next month",()=>ee(1)),k("\xBB","Next year",()=>le(1))],style:{display:"flex",alignItems:"center",gap:h(1),marginBottom:h(2)}},$={div:V.map((j,Se)=>({div:j,style:{textAlign:"center",fontSize:fe=>w(fe,"decrease-1"),fontWeight:Z("bold"),color:fe=>u(fe,"shift-7"),paddingBlock:h(1)},_key:Se})),role:"row",style:gi()},B={div:j=>me(j),role:"grid",ariaLabel:"Calendar",onKeyDown:zi,onMouseLeave:()=>t==="range"&&E.set(null),style:{display:"flex",flexDirection:"column",gap:h(.5)}},z=[R,$,B];return n&&z.push(Ai()),z.push(Ni()),{div:z,role:"dialog",ariaModal:"false",dataTone:"shift-0",style:{minWidth:h(70),padding:h(3),borderRadius:j=>h(b(j)*2),backgroundColor:j=>u(j,"inherit"),color:j=>u(j,"text"),outline:j=>`1px solid ${u(j,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}}}function me(k){let R=new Date(y.get(k),g.get(k),1),$=g.get(k),B=_n(R,m),z=[];for(let j=0;j<6;j++){let Se=[];for(let fe=0;fe<7;fe++){let et=Je(B,j*7+fe);Se.push(xt(et,$,k))}z.push({div:Se,role:"row",style:gi(),_key:j})}return z}function xt(k,R,$){let B=re(k),z=Q(k,$),j=Y(k,$),Se=k.getMonth()!==R,fe=Bt(k,S.get($)),et=Bt(k,new Date);return{button:String(k.getDate()),type:"button",role:"gridcell",tabIndex:fe?0:-1,ariaSelected:z,ariaDisabled:B,disabled:B,ariaLabel:C.format(k),dataDate:Tn(k),onClick:(J,Bi)=>G(k,Bi),onMouseEnter:()=>t==="range"&&E.set(k),style:{appearance:"none",border:"none",cursor:B?"not-allowed":"pointer",aspectRatio:"1",borderRadius:h(1),fontSize:J=>w(J),opacity:B?.35:Se?.5:1,backgroundColor:J=>z?u(J,"shift-13",s.get(J)):j?u(J,"hover",s.get(J)):"transparent",color:J=>z?u(J,"shift-0","neutral"):j?u(J,q(2)):u(J,"text"),outline:et?J=>`1px solid ${u(J,"shift-6",s.get(J))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":I({backgroundColor:J=>z?u(J,"shift-13",s.get(J)):u(J,"shift-3",s.get(J))},z?{}:{color:J=>u(J,q(3))}),transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:J=>L(J,s.get(J))}},_key:Tn(k)}}function Ai(){let k=(R,$,B)=>({select:Array.from({length:R},(z,j)=>({option:String(j).padStart(2,"0"),value:String(j),selected:Se=>$.get(Se)===j,_key:j})),ariaLabel:B,onChange:z=>{$.set(Number(z.target.value)),ie()},style:Zs()});return{div:[k(24,O,"Hour"),{span:":",style:{fontWeight:Z("bold")}},k(60,T,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:h(1),marginTop:h(3)}}}function Ni(){let k=(R,$)=>({button:R,type:"button",onClick:(B,z)=>$(z),style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontSize:B=>w(B,"decrease-1"),color:B=>u(B,"muted",s.get(B)),padding:h(1)}});return{div:[k("Today",R=>{let $=new Date;S.set(ce($)),ae($),oe(R)}),k("Clear",()=>{f.set(t==="range"?[null,null]:null),E.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:h(2),paddingTop:h(2),borderTop:R=>`1px solid ${u(R,"border")}`}}}function zi(k,R){let $=k,B=S.get(),z=null;switch($.key){case"ArrowLeft":z=Je(B,-1);break;case"ArrowRight":z=Je(B,1);break;case"ArrowUp":z=Je(B,-7);break;case"ArrowDown":z=Je(B,7);break;case"Home":z=_n(B,m);break;case"End":z=Je(_n(B,m),6);break;case"PageUp":z=kn(B,$.shiftKey?-12:-1);break;case"PageDown":z=kn(B,$.shiftKey?12:1);break;case"Enter":case" ":$.preventDefault(),G(B,R);return;default:return}$.preventDefault(),S.set(z),ae(z),oe(R)}}function gi(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:h(.5)}}function Xs(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontSize:e=>w(e),color:e=>u(e,"muted"),width:h(7),height:h(7),borderRadius:h(1),"&:hover":{backgroundColor:e=>u(e,"shift-3"),color:e=>u(e,q(3))}}}function Zs(){return{fontSize:e=>w(e),padding:h(1),borderRadius:h(1),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${u(e,"border-strong")}`,backgroundColor:e=>u(e,"inherit"),color:e=>u(e,"text")}}function Js(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${h(24)}, max-content) 1fr`,columnGap:h(4),margin:0,"& dt":{margin:0,fontWeight:Z("semibold"),fontSize:o=>w(o,"inherit"),color:o=>u(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o))}}}}function Qs(e={}){var a,r;let{duration:t=240}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:i=>{i.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:i=>w(i,"inherit"),color:i=>u(i,"text",n.get(i)),backgroundColor:i=>u(i,"inherit",n.get(i)),overflow:"hidden","& > summary":{backgroundColor:i=>u(i,"shift-2",n.get(i)),color:i=>u(i,"shift-11",n.get(i)),fontSize:i=>w(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:h(2),cursor:"pointer",userSelect:"none",fontWeight:Z("medium"),paddingInline:i=>h(b(i)*4),height:h(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:h(2),height:h(2),flexShrink:0,marginTop:h(-.5),borderInlineEnd:i=>`${h(.5)} solid ${u(i,"shift-9",n.get(i))}`,borderBottom:i=>`${h(.5)} solid ${u(i,"shift-9",n.get(i))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>u(i,"shift-3",n.get(i)),color:i=>u(i,q(3),n.get(i))},"& > summary:focus-visible":{borderRadius:i=>h(b(i)*2),boxShadow:i=>L(i,o.get(i))},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:i=>h(b(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:"none",opacity:1,paddingTop:i=>h(b(i)*1),paddingBottom:i=>h(b(i)*3)}}}}var Vt=0;function To(){Vt++,Vt===1&&(document.body.style.overflow="hidden")}function bt(){Vt=Math.max(0,Vt-1),Vt===0&&(document.body.style.overflow="")}var yi='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function ec(e,t){let{state:n,onDismiss:o}=t,a=null,r=!1,i=!1,l=null,c=e.domElement;c.setAttribute("aria-modal","true");let m=()=>{r=!1,typeof c.close=="function"&&c.close(),c.style.visibility="hidden",c.style.pointerEvents="none",c.style.display="none",i&&(bt(),i=!1),a==null||a.focus(),a=null},s=y=>{if(y.key!=="Tab")return;let g=Array.from(c.querySelectorAll(yi)).filter(O=>!O.closest("[aria-hidden='true']")&&O.getClientRects().length>0);if(!g.length){y.preventDefault();return}let S=g[0],E=g[g.length-1];y.shiftKey?(document.activeElement===S||document.activeElement===c)&&(y.preventDefault(),E.focus()):document.activeElement===E&&(y.preventDefault(),S.focus())},d=y=>{y.preventDefault(),!ko(c)&&ze(n,o)};c.addEventListener("cancel",d);let f=y=>{if(y)r=!1,l&&(clearTimeout(l),l=null),a=document.activeElement,c.style.visibility="visible",c.style.pointerEvents="auto",c.style.display="",typeof c.showModal=="function"&&!c.open&&c.showModal(),i||(To(),i=!0),c.addEventListener("keydown",s),requestAnimationFrame(()=>{var S;c.style.opacity="1";let g=(S=c.querySelector("[autofocus]:not([disabled])"))!=null?S:c.querySelector(yi);g==null||g.focus()});else{if(r=!0,c.style.opacity="0",c.removeEventListener("keydown",s),!c.open){m();return}l=setTimeout(()=>{l=null,r&&m()},350)}},p=be(n,f);return{requestClose:()=>ze(n,o),onTransitionEnd:y=>{r&&y.target===c&&y.propertyName==="opacity"&&m()},update(y){o=y.onDismiss,y.state!==n&&(p(),n=y.state,p=be(n,f,!1))},destroy(){l&&(clearTimeout(l),l=null),p(),c.removeEventListener("cancel",d),i&&(bt(),i=!1),c.removeEventListener("keydown",s),a==null||a.focus(),a=null}}}function tc(e={}){let{color:t="neutral",open:n=!1,labelledBy:o,describedBy:a,onDismiss:r}=e,i=yt(n);return A(I({_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')}},H("dialog",ec,{state:i,onDismiss:r})),{ariaLabelledby:o,ariaDescribedby:a,onClick:(l,c)=>{var d;if(l.target!==c.domElement)return;let m=c.domElement.getBoundingClientRect();l.clientX>=m.left&&l.clientX<=m.right&&l.clientY>=m.top&&l.clientY<=m.bottom||(d=c.getBehavior("dialog"))==null||d.requestClose()},onTransitionEnd:(l,c)=>{var m;return(m=c.getBehavior("dialog"))==null?void 0:m.onTransitionEnd(l)},style:{opacity:"0",visibility:"hidden",pointerEvents:"none",transition:"opacity 200ms ease",fontSize:l=>w(l,"inherit"),color:l=>u(l,"shift-10",t),backgroundColor:l=>u(l,"inherit",t),border:"none",borderRadius:l=>h(b(l)*2),padding:l=>h(b(l)*3),boxShadow:U("high"),"&::backdrop":{backgroundColor:l=>u(l,"shift-2","neutral"),opacity:.75}}})}function oc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:h(2),fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>u(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>u(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Dn={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},bi={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},vt=e=>e==="left"||e==="right";function vi(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function nc(e,t){let{state:n,onDismiss:o,placement:a,size:r}=t,i=e.domElement;i.setAttribute("aria-modal","true");let l=E=>{E.preventDefault(),!ko(i)&&ze(n,o)};i.addEventListener("cancel",l);let c=(E,O)=>{let x=(E==="start"||E==="end")&&(i.ownerDocument.documentElement.dir==="rtl"||i.ownerDocument.dir==="rtl"),D=vi(E,x),_=O!=null?O:vt(D)?h(80):h(64);return i.style.margin=bi[D],i.style.width=vt(D)?_:"100dvw",i.style.height=vt(D)?"100dvh":_,D},m=c(a,r),s=!1,d=!1,f=null,p=()=>{f=null,s&&(s=!1,typeof i.close=="function"&&i.close(),i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="none",d&&(bt(),d=!1))},y=E=>{E.target===i&&E.propertyName==="transform"&&p()};i.addEventListener("transitionend",y);let g=E=>{if(E)s=!1,f&&(clearTimeout(f),f=null),i.style.visibility="visible",i.style.pointerEvents="auto",i.style.display="",typeof i.showModal=="function"&&!i.open&&i.showModal(),d||(To(),d=!0),requestAnimationFrame(()=>{i.style.transform="translate(0, 0)"});else{if(s=!0,i.style.transform=Dn[m],!i.open){p();return}f=setTimeout(p,350)}},S=be(n,g);return{requestClose:()=>ze(n,o),update(E){o=E.onDismiss,E.state!==n&&(S(),n=E.state,S=be(n,g,!1)),(E.placement!==a||E.size!==r)&&(a=E.placement,r=E.size,m=c(a,r),n.get()||(i.style.transform=Dn[m]))},destroy(){f&&(clearTimeout(f),f=null),S(),i.removeEventListener("cancel",l),i.removeEventListener("transitionend",y),d&&(bt(),d=!1)}}}function rc(e={}){let{color:t="neutral",open:n=!1,onDismiss:o,placement:a="end",size:r}=e,i=yt(n),l=vi(a,!1),c=vt(l)?h(80):h(64),m=r!=null?r:c;return A(I({_onInsert:s=>{s.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')}},H("drawer",nc,{state:i,onDismiss:o,placement:a,size:r})),{onClick:(s,d)=>{var y;if(s.target!==d.domElement)return;let f=d.domElement.getBoundingClientRect();s.clientX>=f.left&&s.clientX<=f.right&&s.clientY>=f.top&&s.clientY<=f.bottom||(y=d.getBehavior("drawer"))==null||y.requestClose()},style:{transform:Dn[l],visibility:"hidden",pointerEvents:"none",transition:"transform 0.25s ease",fontSize:s=>w(s,"inherit"),color:s=>u(s,"shift-10",t),backgroundColor:s=>u(s,"inherit",t),border:"none",padding:s=>h(b(s)*3),margin:bi[l],width:vt(l)?m:"100dvw",height:vt(l)?"100dvh":m,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:U("high"),"&::backdrop":{backgroundColor:s=>u(s,"shift-2","neutral"),opacity:.75}}})}function ic(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>w(o,"inherit"),fontStyle:"italic",color:o=>u(o,"shift-10",t.get(o))}}}function ac(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:h(3),paddingBlock:h(12),paddingInline:h(6),textAlign:"center",color:o=>u(o,"muted",t.get(o)),"& > :first-child":{color:o=>u(o,"shift-5",t.get(o)),opacity:.9},"& > :nth-child(2)":{color:o=>u(o,"text",t.get(o))}}}}var On="errorBoundaryOriginal";function lc(e){var n;let t=e.getMetadata(On);if(typeof t=="function"){(n=e._childrenRelease)==null||n.call(e),e._setupFunctionChildren(t);return}if(t!=null){e.children.update(Array.isArray(t)?t:[t]);return}e.children.update([])}function sc(e={}){return{_onSchedule:(t,n)=>{t.getMetadata(On)===void 0&&t.setMetadata(On,n[t.tagName])},_onError:(t,n)=>{var r,i;(r=e.onError)==null||r.call(e,n);let o=()=>lc(t),a=typeof e.fallback=="function"?e.fallback(n,o):(i=e.fallback)!=null?i:{div:"An error occurred."};t.children.update([a])}}}var cc={small:8,medium:10,large:14};function uc(e={}){var o,a;let t=v((o=e.color)!=null?o:"primary","color"),n=h(cc[(a=e.size)!=null?a:"medium"]);return{type:"button",_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"],style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>w(r,"inherit"),backgroundColor:r=>u(r,"shift-13",t.get(r)),color:r=>u(r,"shift-0","neutral"),boxShadow:U("low"),transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>u(r,"shift-14",t.get(r)),boxShadow:U("medium")},"&:active:not([disabled])":{backgroundColor:r=>u(r,"shift-15",t.get(r)),boxShadow:U("low")},"&:focus-visible":{boxShadow:r=>`${U("medium")}, ${L(r,t.get(r))}`},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function mc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:h(2),marginInline:0,marginTop:h(3),marginBottom:h(3),color:o=>u(o,"text",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:h(2)},"& figcaption":{fontSize:o=>w(o,"decrease-1"),color:o=>u(o,"muted",t.get(o)),lineHeight:1.45}}}}function dc(e={}){var a;let{layout:t="horizontal"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>h(b(r)*3),paddingBlock:r=>h(b(r)*3),border:"none",borderRadius:r=>h(b(r)*2),fontSize:r=>w(r,"inherit"),backgroundColor:r=>u(r,"inherit",n.get(r)),color:r=>u(r,"text",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:h(4),rowGap:h(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>w(r,"inherit"),fontWeight:Z("semibold"),paddingBlock:r=>h(b(r)*1),borderRadius:r=>h(b(r)*2),color:r=>u(r,"text",n.get(r)),backgroundColor:r=>u(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?0:h(b(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p, input[type=checkbox], input[type=radio], input[type=color])":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > input[type=checkbox], & > input[type=radio], & > input[type=color]":{gridColumn:o?"1":"2",justifySelf:"start"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${h(2)} * -1)`,fontSize:r=>w(r,"decrease-1"),color:r=>u(r,"text",n.get(r))}}}}function hc(e={}){let{columns:t=1,gap:n=4,align:o}=e;return{style:I({display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, minmax(0, 1fr))`:t,gap:a=>h(b(a)*n)},o?{alignItems:o}:{})}}var fc={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function pc(e={}){var o;let t=v((o=e.color)!=null?o:"neutral","color"),n=e.size;return{_onInsert:a=>{["h1","h2","h3","h4","h5","h6"].includes(a.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:a=>u(a,"shift-11",t.get(a)),marginTop:0,marginBottom:h(2),fontSize:a=>{if(n!==void 0)return w(a,n);let r=fc[a.elementNode.tagName]||"inherit";return w(a,r)}}}}function gc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},dataTone:"shift-3",style:{border:0,height:"1px",marginInline:0,marginTop:h(3),marginBottom:h(3),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"text",t.get(o))}}}function yc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:h(4),height:h(4),flexShrink:"0",fontSize:o=>w(o),backgroundColor:"transparent",color:o=>u(o,"text",t.get(o))}}}function bc(e){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{alt:e.decorative?"":e.alt,dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:h(2),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"text",t.get(o))}}}function vc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>w(r,"inherit"),color:r=>u(r,"text",t.get(r)),display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:h(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,color:r=>u(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>u(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${u(r,"shift-6",n.get(r))}`,backgroundColor:r=>u(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>u(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${h(.5)} solid ${u(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${u(r,"shift-6",n.get(r))}`,backgroundColor:r=>u(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>u(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>u(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:h(1.5),boxShadow:r=>L(r,n.get(r))},"&[disabled]":{cursor:"not-allowed",opacity:.7},"&[disabled]::before":{pointerEvents:"none",outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,backgroundColor:r=>u(r,"inherit","neutral")},"&[disabled]:checked::before":{backgroundColor:r=>u(r,"shift-8","neutral")},"&[disabled]:indeterminate::before":{backgroundColor:r=>u(r,"shift-3","neutral")},"&[disabled]:checked::after":{pointerEvents:"none",borderColor:r=>u(r,"shift-0","neutral")},"&[disabled]:indeterminate::after":{pointerEvents:"none",backgroundColor:r=>u(r,"shift-8","neutral")}}}}function Sc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{type:"color",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag')},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),paddingBlock:o=>h(b(o)*1),paddingInline:o=>h(b(o)*1),blockSize:o=>h(6+b(o)*2),inlineSize:o=>h(6+b(o)*2),backgroundColor:"transparent",transition:"box-shadow 140ms ease",borderRadius:o=>h(b(o)*1.5),"&:focus-visible":{boxShadow:o=>L(o,t.get(o))},"&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>h(b(o)*1.5)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>u(o,"shift-2","neutral"),outline:o=>`1px solid ${u(o,"border-strong","neutral")}`}}}}function wc(e={}){var a,r;let{mode:t="datetime-local"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag')},style:{fontSize:i=>w(i,"inherit"),lineHeight:"inherit",color:i=>u(i,"text",n.get(i)),backgroundColor:i=>u(i,"inherit",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${u(i,"border-strong",n.get(i))}`,borderRadius:i=>h(b(i)*1.5),paddingInline:i=>h(b(i)*3),height:i=>h(6+b(i)*2),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${u(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>L(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>u(i,"muted","neutral"),backgroundColor:i=>u(i,"shift-2","neutral"),outline:i=>`1px solid ${u(i,"border-strong","neutral")}`},"&:invalid":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`}}}}function xc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"file",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag')},style:{display:"inline-flex",alignItems:"center",fontSize:r=>w(r,"inherit"),lineHeight:"inherit",color:r=>u(r,"text",t.get(r)),backgroundColor:r=>u(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,borderRadius:r=>h(b(r)*1.5),height:r=>h(6+b(r)*2),paddingInline:r=>h(b(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-file-upload-button":{marginTop:r=>h(b(r)),fontSize:"inherit",border:"none",borderRadius:h(1),height:h(6),paddingInline:h(2),cursor:"pointer",color:r=>u(r,"shift-11",t.get(r)),backgroundColor:r=>u(r,"surface",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${u(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>u(r,"muted","neutral"),outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,backgroundColor:r=>u(r,"surface","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>u(r,"muted","neutral"),backgroundColor:r=>u(r,"shift-3","neutral")}}}}function Ec(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"number",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag')},style:A(I({lineHeight:"inherit",minWidth:h(10),paddingInlineStart:r=>h(b(r)*3),paddingInlineEnd:r=>h(b(r)*1.5),paddingBlock:r=>h(b(r)*1),borderRadius:r=>h(b(r)*1.5),fontSize:r=>w(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`},we(t)),{backgroundColor:r=>u(r,"inherit",t.get(r)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${u(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>u(r,"shift-2","neutral"),outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,color:r=>u(r,"muted","neutral")}})}}function Cc(){return{role:"group",ariaLabel:"One-time password",style:{display:"flex",alignItems:"center",gap:h(2),"& > input":{minWidth:h(9)}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=i=>{if(i.isComposing)return;let l=n(),c=i.target,m=l.indexOf(c);c.value&&m<l.length-1&&l[m+1].focus()},a=i=>{if(i.isComposing)return;let l=n(),c=i.target,m=l.indexOf(c);i.key==="Backspace"&&!c.value&&m>0&&l[m-1].focus(),i.key==="ArrowLeft"&&m>0&&(i.preventDefault(),l[m-1].focus()),i.key==="ArrowRight"&&m<l.length-1&&(i.preventDefault(),l[m+1].focus())},r=i=>{var f,p,y;i.preventDefault();let l=(p=(f=i.clipboardData)==null?void 0:f.getData("text"))!=null?p:"",c=n(),m=c.indexOf(i.target),s=m===-1?0:m;[...l].forEach((g,S)=>{let E=c[s+S];E&&(E.value=g,E.dispatchEvent(new Event("input",{bubbles:!0})),E.dispatchEvent(new Event("change",{bubbles:!0})))});let d=Math.min(s+l.length-1,c.length-1);(y=c[d])==null||y.focus()};t.addEventListener("input",o),t.addEventListener("keydown",a),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",a),t.removeEventListener("paste",r)})}}}var kc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>',Tc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>',_c=["name","value","onInput","disabled","required"];function Si(e){if(e!=null)return typeof e=="function"?e:he(e)?t=>e.get(t):e}function Dc(e={}){var r,i;let t=v((r=e.color)!=null?r:"neutral","color"),n=v((i=e.accentColor)!=null?i:"primary","accentColor"),o=v(!1),a={};return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onSchedule:(l,c)=>{let m=c;for(let s of _c)m[s]!==void 0&&(a[s]=m[s],delete m[s])},_onInit:l=>{var g,S,E,O,T,x,D;let c=(g=e.name)!=null?g:a.name,m=Si((S=e.value)!=null?S:a.value),s=(E=e.onInput)!=null?E:a.onInput,d=Si((O=e.disabled)!=null?O:a.disabled),f=(T=e.required)!=null?T:a.required,p=A(I(I(I(I(I({input:null,type:_=>o.get(_)?"text":"password",ariaLabel:(x=e.ariaLabel)!=null?x:"Password",autocomplete:(D=e.autocomplete)!=null?D:"current-password"},c!=null?{name:c}:{}),m!=null?{value:m}:{}),s!=null?{onInput:s}:{}),d!=null?{disabled:d}:{}),f!=null?{required:f}:{}),{style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}}),y={button:_=>Fe(o.get(_)?Tc:kc),type:"button",ariaLabel:_=>o.get(_)?"Hide password":"Show password",onClick:()=>o.set(!o.get()),style:{background:"none",border:"none",padding:0,margin:0,cursor:"pointer",color:"inherit",fontSize:_=>w(_,"inherit"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,minWidth:h(6),minHeight:h(6),marginInlineEnd:_=>`calc(${h(b(_)*1)} * -1)`,opacity:.6}};l.children.insert(p),l.children.insert(y)},style:{display:"flex",alignItems:"center",gap:l=>h(b(l)*1),paddingBlock:l=>h(b(l)*1),paddingInline:l=>h(b(l)*3),borderRadius:l=>h(b(l)*1.5),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${u(l,"border-strong",t.get(l))}`,color:l=>u(l,fn,t.get(l)),backgroundColor:l=>u(l,"inherit",t.get(l)),fontSize:l=>w(l,"inherit"),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not(:has([disabled])):not(:focus-within)":{outline:l=>`1px solid ${u(l,"shift-5",n.get(l))}`},"&:focus-within":{boxShadow:l=>L(l,n.get(l))}}}}function Oc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"radio",_onInsert:r=>{if(r.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:r=>w(r,"inherit"),color:r=>u(r,"text",t.get(r)),appearance:"none",display:"inline-flex",position:"relative",width:h(6),height:h(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:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,color:r=>u(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>u(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${u(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>u(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>u(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",boxShadow:r=>L(r,n.get(r))},"&[disabled]":{cursor:"not-allowed",opacity:.7},"&[disabled]::before":{pointerEvents:"none",outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,backgroundColor:r=>u(r,"inherit","neutral")},"&[disabled]:checked::after":{pointerEvents:"none",backgroundColor:r=>u(r,"shift-8","neutral")}}}}function Lc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"range",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>w(r,"inherit"),width:"100%",margin:0,padding:0,height:h(6),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:h(1.5),borderRadius:h(999),backgroundColor:r=>u(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:h(4),height:h(4),borderRadius:h(999),border:"none",marginTop:`calc((${h(1.5)} - ${h(4)}) / 2)`,backgroundColor:r=>u(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>u(r,"shift-10",n.get(r))},"&::-moz-range-track":{height:h(1.5),borderRadius:h(999),backgroundColor:r=>u(r,"shift-3",t.get(r))},"&::-moz-range-thumb":{width:h(4),height:h(4),borderRadius:h(999),border:"none",backgroundColor:r=>u(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:r=>u(r,"shift-10",n.get(r))},borderRadius:h(2),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ic(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"search",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag')},style:A(I({fontSize:r=>w(r,"inherit"),lineHeight:"inherit"},we(t)),{backgroundColor:r=>u(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,borderRadius:r=>h(b(r)*1.5),minWidth:h(32),paddingInline:r=>h(b(r)*3),paddingBlock:r=>h(b(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${u(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>u(r,"muted","neutral"),backgroundColor:r=>u(r,"shift-2","neutral"),outline:r=>`1px solid ${u(r,"border-strong","neutral")}`}})}}function Pc(e={}){var n;let t=v((n=e.accentColor)!=null?n:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>w(o,"inherit"),backgroundColor:"transparent",color:o=>u(o,"text"),appearance:"none",position:"relative",display:"inline-flex",width:h(9),height:h(6),cursor:"pointer",margin:"0",paddingBlock:h(1),transition:"box-shadow 140ms ease",borderRadius:h(999),"&:focus-visible":{boxShadow:o=>L(o,t.get(o))},"&:checked":{"&::before":{backgroundColor:o=>u(o,"increase-3",t.get(o))},"&::after":{insetInlineStart:`calc(100% - ${h(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:h(3),height:h(3),borderRadius:h(999),insetInlineStart:h(.5),top:"50%",transform:"translateY(-50%)",transition:"inset-inline-start 0.3s",backgroundColor:o=>u(o,"decrease-3"),outline:o=>`1px solid ${u(o,"shift-7")}`,outlineOffset:"-1px"},"&::before":{content:'""',width:"100%",borderRadius:h(999),display:"inline-block",fontSize:o=>w(o,"inherit"),lineHeight:1,backgroundColor:o=>u(o,"inherit"),outline:o=>`1px solid ${u(o,"shift-7")}`,outlineOffset:"-1px"},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Mc(e={}){var a,r;let{type:t="text"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type')},style:A(I({lineHeight:"inherit",minWidth:h(10),paddingInline:i=>h(b(i)*3),paddingBlock:i=>h(b(i)*1),borderRadius:i=>h(b(i)*1.5),fontSize:i=>w(i,"inherit"),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${u(i,"border-strong",n.get(i))}`},we(n)),{backgroundColor:i=>u(i,"inherit",n.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${u(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>L(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:i=>u(i,"shift-2","neutral"),outline:i=>`1px solid ${u(i,"border-strong","neutral")}`,color:i=>u(i,"muted","neutral")},"&[placeholder]:invalid:not(:placeholder-shown)":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`},"&[data-status=error]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","warning")}`}})}}function Rc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>w(o,"inherit"),fontFamily:We("monospace"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),paddingBlock:o=>h(b(o)*(.5/1.5)),paddingInline:o=>h(b(o)*(1.5/1.5)),borderRadius:o=>h(b(o)*(1/1.5)),outline:o=>`1px solid ${u(o,"border-strong",t.get(o))}`}}}function $c(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:h(2),fontSize:r=>w(r,"inherit"),color:r=>u(r,"text",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>u(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>u(r,"muted","neutral")}}}}function Ac(e={}){var o,a;let t=v((o=e.color)!=null?o:"primary","color"),n=v((a=e.accentColor)!=null?a:"secondary","accentColor");return{role:"link",tabIndex:0,_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag'),r.attributes.has("href")&&(r.attributes.get("role")==="link"&&r.attributes.remove("role"),r.attributes.get("tabIndex")===0&&r.attributes.remove("tabIndex"))},onClick:(r,i)=>{let l=i.domElement;(l!=null&&l.hasAttribute("disabled")||(l==null?void 0:l.getAttribute("aria-disabled"))==="true")&&r.preventDefault()},onKeyDown:(r,i)=>{var c;if(i.attributes.has("href"))return;let l=r.key;l!=="Enter"&&l!==" "||(r.preventDefault(),(c=i.domElement)==null||c.click())},style:{fontSize:r=>w(r,"inherit"),backgroundColor:r=>u(r),color:r=>u(r,"shift-13",t.get(r)),textDecoration:"none","&:visited":{color:r=>u(r,"shift-13",n.get(r))},"&:hover:not([disabled])":{color:r=>u(r,"shift-14",t.get(r)),textDecoration:"underline"},borderRadius:h(1),outline:"none",transition:"color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled], &[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:r=>u(r,"muted","neutral")}}}}var Nc={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}},zc={small:.5,medium:1,large:1.5};function Bc(e={}){var l,c,m;let t=(l=e.variant)!=null?l:"outline",n=v((c=e.color)!=null?c:t==="ghost"?"neutral":"primary","color"),o=(m=e.size)!=null?m:"medium",a=ht[o];if(t==="ghost"){let s=zc[o];return{_onInsert:d=>{d.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:d=>w(d,a),textDecoration:"none",paddingBlock:d=>h(b(d)*s),paddingInline:d=>h(b(d)*s),borderRadius:d=>h(b(d)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:d=>h(b(d)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:d=>u(d,"text",n.get(d)),"&:hover:not([aria-disabled=true])":{color:d=>u(d,q(2),n.get(d)),backgroundColor:d=>u(d,"hover",n.get(d)),textDecoration:"none"},"&:active:not([aria-disabled=true])":{color:d=>u(d,q(2),n.get(d)),backgroundColor:d=>u(d,"increase-2",n.get(d))},"&:focus-visible":{boxShadow:d=>L(d,n.get(d))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:d=>u(d,"border-strong","neutral")}}}}let r=t==="solid",i=Nc[o];return A(I({_onInsert:s=>{s.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')}},r?{_doctorDisable:["tone-background-inherit"]}:{}),{style:{fontSize:s=>w(s,a),textDecoration:"none",paddingBlock:s=>h(b(s)*i.block),paddingInline:s=>h(b(s)*i.inline),borderRadius:s=>h(b(s)*1.5),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:s=>h(b(s)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:r?"none":s=>`1px solid ${u(s,"border-strong",n.get(s))}`,color:s=>r?u(s,"shift-0","neutral"):u(s,"shift-13",n.get(s)),backgroundColor:s=>r?u(s,"shift-13",n.get(s)):u(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([aria-disabled=true])":{textDecoration:"none",color:s=>r?u(s,"shift-0","neutral"):u(s,"shift-14",n.get(s)),backgroundColor:s=>r?u(s,"shift-14",n.get(s)):u(s,"hover",n.get(s))},"&:active:not([aria-disabled=true])":{backgroundColor:s=>r?u(s,"shift-15",n.get(s)):u(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>L(s,n.get(s))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:s=>u(s,"shift-2","neutral"),outline:s=>`1px solid ${u(s,"border-strong","neutral")}`,color:s=>u(s,"muted","neutral")}}})}function Vc(e={}){var n;let t=(n=e.color)!=null?n:"neutral";return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",backgroundColor:o=>u(o,"inherit",t),color:o=>u(o,"text",t)}}}function Hc(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>h(b(n)*2),paddingBlock:n=>h(t?1:b(n)*2),paddingInline:n=>h(b(n)*3),fontSize:n=>w(n,"inherit"),color:n=>u(n,"text")}}}function Fc(e={}){var a,r;let t=v((a=e.color)!=null?a:"neutral","color"),n=(r=e.accentColor)!=null?r:"primary",{dense:o=!1}=e;return{type:"button",style:{cursor:"pointer",appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"start",display:"flex",alignItems:"center",width:"100%",gap:i=>h(b(i)*2),paddingBlock:i=>h(o?1:b(i)*2),paddingInline:i=>h(b(i)*3),fontSize:i=>w(i,"inherit"),color:i=>u(i,"text",t.get(i)),borderRadius:i=>h(b(i)*1.5),transition:"background-color 150ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:i=>u(i,q(2),t.get(i)),backgroundColor:i=>u(i,"hover",t.get(i))},"&:active:not([disabled])":{color:i=>u(i,q(2),t.get(i)),backgroundColor:i=>u(i,"increase-2",t.get(i))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:i=>u(i,"shift-3",n),color:i=>u(i,"shift-12",n)},"&:focus-visible":{boxShadow:i=>L(i,n)},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function jc(e={}){var n;let t=v((n=e.accentColor)!=null?n:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),height:o=>h(b(o)*(6/1.5)),borderRadius:o=>h(b(o)*(1/1.5)),paddingInline:o=>h(b(o)*(1.5/1.5))}}}function Wc(e={items:[]}){var d;let{items:t=[],selectable:n=!0,color:o="neutral",accentColor:a="primary"}=e,r=v((d=e.activeKey)!=null?d:null),i=e.activeKey!==void 0,l=(f,p)=>{var E;let y=f.focusedKey.get(p);if(y!==null)return y;let g=f.selectable?f.activeKey.get(p):null;if(g!==null)return g;let S=f.items[0];return S?(E=S.key)!=null?E:0:null},c=(f,p)=>{let y=f.nodeId;return p.items.map((g,S)=>{var O;let E=(O=g.key)!=null?O:S;return A(I({button:typeof g.label=="string"?[{span:g.label}]:[g.label],_key:E,type:"button",id:`menuitem${y}${E}`,role:"menuitem",tabIndex:T=>l(p,T)===E?0:-1,onFocus:()=>p.focusedKey.set(E)},p.selectable?{ariaCurrent:T=>p.activeKey.get(T)===E||void 0}:{}),{onClick:()=>{var T;p.selectable&&p.activeKey.set(E),(T=g.onClick)==null||T.call(g)},onKeyDown:T=>{var P;let x=T.key;if(x==="Enter"||x===" "){T.preventDefault(),T.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(x))return;T.preventDefault();let D=p.items.map((V,re)=>{var F;return(F=V.key)!=null?F:re}),_=D.indexOf(E),C=_;x==="ArrowDown"?C=(_+1)%D.length:x==="ArrowUp"?C=(_-1+D.length)%D.length:x==="Home"?C=0:x==="End"&&(C=D.length-1);let M=T.target.closest("[role=menu]");(P=M==null?void 0:M.querySelectorAll("[role=menuitem]")[C])==null||P.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:h(2),width:"100%",fontSize:T=>w(T,"inherit"),height:T=>h(6+b(T)*2),paddingInline:T=>h(b(T)*3),border:"none",outline:"none",color:T=>u(T,"text",p.color),backgroundColor:T=>u(T,"inherit",p.color),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:T=>u(T,"hover",p.color),color:T=>u(T,q(2),p.color)},"&[aria-current=true]":{backgroundColor:T=>u(T,"shift-3",p.accentColor),color:T=>u(T,"shift-13",p.accentColor)},"&:focus-visible":{boxShadow:T=>L(T,p.accentColor)}}})})},m=(f,p)=>{p.focusedKey.set(null);let y=p;return{update(g){g.activeKey!==y.activeKey&&!g.activeKeyIsCallerOwned&&g.activeKey.set(y.activeKey.get()),g.focusedKey!==y.focusedKey&&g.focusedKey.set(y.focusedKey.get()),y=g,y.items.length!==0&&f.children.update(c(f,y))}}},s={items:t,activeKey:r,activeKeyIsCallerOwned:i,selectable:n,color:o,accentColor:a,focusedKey:v(null)};return A(I({role:"menu",dataTone:"shift-0",_onSchedule:(f,p)=>{t.length!==0&&(p[f.tagName]=c(f,s))}},H("menu",m,s)),{style:{display:"flex",flexDirection:"column",paddingBlock:f=>h(b(f)*2),paddingInline:f=>h(b(f)*2),fontSize:f=>w(f,"inherit"),backgroundColor:f=>u(f,"inherit",o),color:f=>u(f,"text",o),borderRadius:f=>h(b(f)*2),outline:f=>`1px solid ${u(f,"border-strong",o)}`,outlineOffset:"-1px",boxShadow:U("medium")}})}function St(){if(typeof matchMedia!="function")return!1;try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch(e){return!1}}var wi=e=>!!e&&typeof e.get=="function"&&e._isState===!0,De=e=>{let t={},n=[];for(let o in e){let a=e[o];o==="x"?n.push(`translateX(${typeof a=="number"?`${a}px`:a})`):o==="y"?n.push(`translateY(${typeof a=="number"?`${a}px`:a})`):o==="scale"?n.push(`scale(${a})`):o==="rotate"?n.push(`rotate(${typeof a=="number"?`${a}deg`:a})`):t[o]=a}return n.length&&(t.transform=n.join(" ")),t};function Ln(e={}){var t,n,o,a;return{duration:(t=e.duration)!=null?t:300,delay:(n=e.delay)!=null?n:0,easing:(o=e.easing)!=null?o:"ease",iterations:(a=e.iterations)!=null?a:1,fill:"both"}}function Kc(e,t){let n=e.domElement,o=t,a,r=l=>{a==null||a(),a=void 0,!(!n||!wi(l))&&(a=l.addListener(c=>{St()?Object.assign(n.style,De(c)):typeof n.animate=="function"&&n.animate([De(c)],Ln(o.transition))}))},i=(l,c)=>{if(!n)return;let m=wi(l.animate)?l.animate.get():l.animate;if(St()){m?Object.assign(n.style,De(m)):c==="enter"&&l.initial&&Object.assign(n.style,De(l.initial));return}if(typeof n.animate=="function")if(m){let s=c==="enter"&&l.initial?[De(l.initial),De(m)]:[De(m)];n.animate(s,Ln(l.transition))}else c==="enter"&&l.initial&&Object.assign(n.style,De(l.initial))};return i(t,"enter"),r(t.animate),{play:i,getExit:()=>o.exit,getTransition:()=>o.transition,update(l){o=l,i(l,"update"),r(l.animate)},destroy(){a==null||a()}}}function qc(e={}){return A(I({},H("motion",(t,n)=>Kc(t,n),e)),{_onBeforeRemove:(t,n)=>{var i,l;let o=t.domElement,a=t.getBehavior("motion"),r=(i=a==null?void 0:a.getExit())!=null?i:e.exit;if(!o||!r||typeof o.animate!="function")return n();if(St())return Object.assign(o.style,De(r)),n();o.animate([De(r)],Ln((l=a==null?void 0:a.getTransition())!=null?l:e.transition)).finished.then(n,n)}})}function Uc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingInlineStart:h(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Gc(e,t){if(t<=7)return Array.from({length:t},(r,i)=>i+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),a=Math.min(t-1,e+1);for(let r=o;r<=a;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function Yc(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function xi(e,t){let n=e.getMetadata("paginationTotal");return n||(n=v(t),e.setMetadata("paginationTotal",n)),n}function Xc(e){let{total:t,color:n="neutral",accentColor:o="primary"}=e,a={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:i=>h(6+b(i)*2),height:i=>h(6+b(i)*2),paddingInline:i=>h(b(i)*2),borderRadius:i=>h(b(i)*1.5),border:"none",cursor:"pointer",fontSize:i=>w(i,"inherit"),backgroundColor:"transparent",color:i=>u(i,"shift-13",n),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled])":{color:i=>u(i,"shift-13",n),backgroundColor:i=>u(i,"hover",n)},"&:focus-visible":{boxShadow:i=>L(i,o)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},r=A(I({},a),{backgroundColor:i=>u(i,"shift-13",o),color:i=>u(i,"shift-0","neutral"),fontWeight:Z("bold"),cursor:"default","&:hover:not([disabled])":{backgroundColor:i=>u(i,"shift-13",o)}});return A(I({role:"navigation",ariaLabel:"Pagination",_onInsert:i=>{i.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:i=>{let l=Yc(i,"paginationPage",e.value,1),c=xi(i,t),m={div:s=>{let d=l.get(s),f=c.get(s),p=[];p.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&l.set(d-1),style:a});let y=0;for(let g of Gc(d,f))if(g==="...")p.push({span:"\u2026",_key:`ellipsis-${y++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:S=>h(b(S)*2),color:S=>u(S,"shift-7",n)}});else{let S=g===d;p.push({button:String(g),_key:`page-${g}`,type:"button",ariaLabel:`Page ${g}`,ariaCurrent:S?"page":void 0,onClick:()=>l.set(g),style:S?r:a})}return p.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:d>=f,onClick:()=>d<f&&l.set(d+1),style:a}),p},style:{display:"flex",alignItems:"center",gap:h(1)}};i.children.insert(m)}},H("pagination-total",i=>({update(l){xi(i,l.total).set(l.total)}}),{total:t})),{style:{display:"inline-flex"}})}function Zc(e={}){var a;let{padding:t=4,divider:n=!1}=e,o=v((a=e.color)!=null?a:"neutral","color");return{style:I({padding:r=>h(b(r)*t)},n?{borderBottom:r=>`1px solid ${u(r,"border",o.get(r))}`,color:r=>u(r,"text")}:{})}}function Jc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}var Qc=new Set(["dialog","grid","listbox","menu","tree"]);function eu(e){var o;let t;for(let a of(o=e.$)!=null?o:[]){let r=a==null?void 0:a.role;typeof r=="string"&&(t=r)}let n=e.role;return typeof n=="string"&&(t=n),typeof t!="string"?"dialog":t==="alertdialog"||t==="menubar"?t==="menubar"?"menu":"dialog":t==="treegrid"?"grid":Qc.has(t)?t:"dialog"}function tu(e){if(typeof e.dataTone=="string")return!0;let n=e.$;return n?n.some(o=>o!=null&&typeof o.dataTone=="string"):!1}function ou(e){var d;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,a=v(t),r=v(n),{show:i,hide:l,anchorPartial:c}=_e({kind:"popover",open:a,onDismiss:e.onDismiss,placement:r,content:e.content,keepOpenOnContentHover:o==="hover"}),m={role:"dialog",dataTone:"shift-0",style:{backgroundColor:f=>u(f,"inherit"),color:f=>u(f,"text"),borderRadius:f=>h(b(f)*2),outline:f=>`1px solid ${u(f,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}};tu(e.content)||((d=e.content).$||(d.$=[]),e.content.$.push(m));let s={ariaHaspopup:eu(e.content),ariaExpanded:f=>a.get(f),ariaControls:f=>f!=null&&f.elementNode?ge("popover",f.elementNode):void 0,onMouseEnter:(f,p)=>o==="hover"&&i(p),onMouseLeave:(f,p)=>o==="hover"&&l(p),onClick:(f,p)=>{o==="click"&&(a.get()?l(p):i(p))},onKeyDown:(f,p)=>{f.key==="Escape"&&a.get()&&l(p)},onFocus:(f,p)=>o==="hover"&&i(p),onBlur:(f,p)=>{if(o!=="hover")return;let y=f.relatedTarget,S=p.getRoot().domElement.querySelector(`#${ge("popover",p)}`);y&&(S!=null&&S.contains(y))||l(p)}};return X(c,s),c}function In(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=h(6),bordered:a=!0}=e,r=v(t),i={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=s=>{var d;return(d=i[r.get(s)])!=null?d:i["bottom-end"]},c=s=>s.includes("start")?o:s.includes("end")?"auto":"50%",m=s=>s.includes("end")?o:s.includes("start")?"auto":"50%";return{style:{fontSize:s=>w(s),backgroundColor:s=>u(s),color:s=>u(s,"text",n),position:"relative","&::after":{content:'""',position:"absolute",width:h(1.5),height:h(1.5),backgroundColor:s=>u(s,"inherit",n),borderWidth:a?"1px":0,borderColor:s=>u(s,"border-strong",n),borderTopStyle:s=>{let d=l(s);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:s=>{let d=l(s);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:s=>{let d=l(s);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:s=>{let d=l(s);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:s=>{let d=l(s);return d.includes("top")?0:d.includes("bottom")?"auto":c(d)},right:s=>{let d=l(s);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:s=>{let d=l(s);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:s=>{let d=l(s);return d.includes("left")?0:d.includes("right")?"auto":c(d)},transform:s=>{let d=l(s),f=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",p=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${f},${p}) rotate(45deg)`}}}}}function nu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>w(o,"inherit"),fontFamily:We("monospace"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*3),borderRadius:o=>h(b(o)*2)}}}function ru(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},dataTone:"shift-3",style:{appearance:"none",width:"100%",height:h(2),border:0,borderRadius:h(999),overflow:"hidden",backgroundColor:r=>u(r,"inherit",t.get(r)),color:r=>u(r,"text",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>u(r,"inherit",t.get(r)),borderRadius:h(999)},"&::-webkit-progress-value":{backgroundColor:r=>u(r,"shift-9",n.get(r)),borderRadius:h(999),transition:"width 220ms ease"}}}}function Pn(e){return!e||typeof getComputedStyle!="function"?!1:getComputedStyle(e).direction==="rtl"}function Oe(e,t){return e!=="ArrowRight"&&e!=="ArrowLeft"?0:e==="ArrowRight"!==Pn(t)?1:-1}var iu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',au='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function Ei(e,t){var n,o,a;e.onChange=t.onChange,e.readOnly=(n=t.readOnly)!=null?n:!1,e.max=(o=t.max)!=null?o:5,e.color=(a=t.color)!=null?a:"warning",he(t.value)?t.value!==e.valueState&&e.valueState.set(t.value.get()):t.value!==void 0&&e.valueState.set(t.value)}function lu(e,t,n,o){let a=i=>{let l=o.get(i);return l>0?l:n.valueState.get(i)},r={button:i=>Fe(t<=a(i)?iu:au),_key:t,type:"button",ariaLabel:`${t} star${t>1?"s":""}`,role:"radio",ariaChecked:i=>n.valueState.get(i)===t,tabindex:i=>{let l=n.valueState.get(i);return(l===0?1:l)===t?0:-1},onClick:()=>{var l;if(n.readOnly)return;let i=t===n.valueState.get()?0:t;n.valueState.set(i),(l=n.onChange)==null||l.call(n,i),o.set(0)},onMouseEnter:()=>{n.readOnly||o.set(t)},onMouseLeave:()=>o.set(0),onKeyDown:i=>{var s,d,f;if(n.readOnly)return;let l=n.valueState.get(),c=l;if(i.key==="ArrowUp")c=Math.min(n.max,l+1),i.preventDefault();else if(i.key==="ArrowDown")c=Math.max(0,l-1),i.preventDefault();else if(i.key==="ArrowRight"||i.key==="ArrowLeft")c=Oe(i.key,i.target)>0?Math.min(n.max,l+1):Math.max(0,l-1),i.preventDefault();else if(i.key==="Home")c=1,i.preventDefault();else if(i.key==="End")c=n.max,i.preventDefault();else return;n.valueState.set(c),(s=n.onChange)==null||s.call(n,c);let m=c>0?c-1:0;(f=(d=e.domElement)==null?void 0:d.children[m])==null||f.focus()},style:{background:"none",border:"none",outline:"none",borderRadius:h(1),padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center",justifyContent:"center",minWidth:h(6),minHeight:h(6),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:i=>L(i,n.color)}}};e.children.insert(r)}function Mn(e,t,n){let o=e.children.items;for(;o.length>t.max;)e.children.remove(o[o.length-1]);for(let a=o.length+1;a<=t.max;a++)lu(e,a,t,n)}function su(e={}){var o,a,r,i,l,c,m;let t={valueState:v((o=e.value)!=null?o:0),onChange:e.onChange,readOnly:(a=e.readOnly)!=null?a:!1,max:(r=e.max)!=null?r:5,color:(i=e.color)!=null?i:"warning"},n=v(0);return A(I({role:"radiogroup",ariaLabel:"Rating",ariaReadonly:t.readOnly?"true":void 0,style:{display:"inline-flex",gap:h(.5),fontSize:s=>w(s,"increase-1"),cursor:t.readOnly?"default":"pointer",color:s=>u(s,"muted",t.color)}},H("rating",(s,d)=>(Ei(t,d),Mn(s,t,n),{update(f){Ei(t,f),Mn(s,t,n)}}),{value:e.value,max:(l=e.max)!=null?l:5,onChange:e.onChange,readOnly:(c=e.readOnly)!=null?c:!1,color:(m=e.color)!=null?m:"warning"})),{_onInit:s=>{Mn(s,t,n)}})}function cu(e={}){var c,m,s;let{size:t=16,thickness:n=.25}=e,o=v((c=e.value)!=null?c:0,"value"),a=v((m=e.color)!=null?m:"primary","color"),r=v((s=e.trackColor)!=null?s:"neutral","trackColor"),i=Math.round((1-n)*100),l=`radial-gradient(circle closest-side, transparent ${i}%, black ${i}%)`;return{role:"progressbar",ariaValuenow:d=>String(Math.round(o.get(d))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:d=>{d.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:h(t),height:h(t),borderRadius:"50%",color:d=>u(d,"shift-9",a.get(d)),background:d=>`conic-gradient(from -90deg, ${u(d,"shift-9",a.get(d))} ${o.get(d)}%, ${u(d,"shift-3",r.get(d))} 0%)`,WebkitMask:l,mask:l}}}function Rn(e={}){let{gap:t=4,align:n="center",justify:o,wrap:a=!1,density:r=!0}=e;return{style:I(I({display:"flex",alignItems:n,gap:r?i=>h(b(i)*t):()=>h(t)},o?{justifyContent:o}:{}),a?{flexWrap:"wrap"}:{})}}function uu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return A(I({},e.label?{role:"region",ariaLabel:e.label,tabIndex:0}:{}),{style:{overflow:"auto",color:o=>u(o,"text",t.get(o)),"&::-webkit-scrollbar":{width:h(2),height:h(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>u(o,"shift-5",t.get(o)),borderRadius:h(999),border:`${h(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>u(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${u(o,"shift-5",t.get(o))} transparent`}})}function Ci(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function mu(e,t,n,o){var m;let a=e.key;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(a))return;e.preventDefault();let r=t.map((s,d)=>{var f;return(f=s.key)!=null?f:String(d)}),i=r.indexOf(n),l=i;if(a==="ArrowDown")l=(i+1)%r.length;else if(a==="ArrowUp")l=(i-1+r.length)%r.length;else if(a==="ArrowRight"||a==="ArrowLeft"){let s=Oe(a,e.target);l=(i+s+r.length)%r.length}else a==="Home"?l=0:a==="End"&&(l=r.length-1);o.set(r[l]);let c=e.target.closest("[role=radiogroup]");(m=c==null?void 0:c.querySelectorAll("[role=radio]")[l])==null||m.focus()}function ki(e,t,n,o){return e.map((a,r)=>{var c;let i=(c=a.key)!=null?c:String(r);return{button:[typeof a.label=="string"?{span:a.label}:a.label],_key:i,type:"button",role:"radio",ariaChecked:m=>t.get(m)===i,tabIndex:m=>{var d,f;let s=t.get(m);return s===i||s===""&&i===((f=(d=e[0])==null?void 0:d.key)!=null?f:"")?0:-1},onClick:()=>t.set(i),onKeyDown:m=>mu(m,e,i,t),style:{cursor:"pointer",fontSize:m=>w(m,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(3),border:"none",borderRadius:h(10),color:m=>u(m,"text",n),backgroundColor:"transparent",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:m=>u(m,"shift-3",n),color:m=>u(m,q(3),n)},"&:active:not([disabled]):not([aria-checked=true])":{backgroundColor:m=>u(m,"increase-2",n),color:m=>u(m,q(3),n)},"&[aria-checked=true]":{backgroundColor:m=>u(m,"shift-0",o),color:m=>u(m,"shift-10",o),boxShadow:U("low")},"&:focus-visible":{boxShadow:m=>L(m,o)},"&[aria-checked=true]:focus-visible":{boxShadow:m=>`${U("low")}, ${L(m,o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function du(e={items:[]}){let{items:t=[],color:n="neutral",accentColor:o="primary"}=e;return A(I({role:"radiogroup",_onSchedule:(r,i)=>{var c,m;let l=Ci(r,"segmentedValue",e.value,(m=(c=t[0])==null?void 0:c.key)!=null?m:"");r.setContext("segmented",{value:l}),i[r.tagName]=ki(t,l,n,o)}},H("segmented-items",r=>({update(i){var c,m;let l=Ci(r,"segmentedValue",e.value,(m=(c=i.items[0])==null?void 0:c.key)!=null?m:"");r.children.update(ki(i.items,l,i.color,i.accentColor),!!r.domElement,!0)}}),{items:t,color:n,accentColor:o})),{dataTone:"shift-2",style:{display:"inline-flex",paddingBlock:h(1),paddingInline:h(1),gap:h(.5),borderRadius:h(10),backgroundColor:r=>u(r,"inherit",n),color:r=>u(r,"text",n)}})}function hu(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontSize:o=>w(o,"inherit"),lineHeight:"inherit",color:o=>u(o,"text",t),backgroundColor:o=>u(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${u(o,"border-strong",t)}`,borderRadius:o=>h(b(o)*1.5),paddingBlock:o=>h(b(o)*1),paddingInlineStart:o=>h(b(o)*3),paddingInlineEnd:o=>h(b(o)*5),backgroundImage:o=>{let a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${mn(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},backgroundRepeat:"no-repeat",backgroundPosition:o=>{var a;return`${Pn((a=o.elementNode)==null?void 0:a.domElement)?"left":"right"} ${h(2)} center`},backgroundSize:`${h(2.5)} ${h(1.5)}`,transition:"outline-color 140ms ease, box-shadow 140ms ease","&:not([multiple])":{height:o=>h(6+b(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`1px solid ${u(o,"shift-5",n)}`},"&:focus-visible":{boxShadow:o=>L(o,n)},"& optgroup":{color:o=>u(o,"shift-11",t)},"& option[disabled]":{color:o=>u(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>u(o,"muted","neutral"),outline:o=>`1px solid ${u(o,"border-strong","neutral")}`,backgroundColor:o=>u(o,"shift-2","neutral")}}}}var fu=1e3;function pu(e){let t=e.getMetadata("selectBoxTypeahead");return t||(t={buffer:"",timer:null},e.setMetadata("selectBoxTypeahead",t)),t}var Ti=(e,t)=>e.trim().toLowerCase().startsWith(t);function gu(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=v(e.value),l=v(a),{show:c,hide:m,anchorPartial:s}=_e({kind:"selectBox",open:l,onDismiss:e.onDismiss,placement:v(n),content:e.content}),d={onClick:(x,D)=>!r&&m(D),dataTone:"shift-0",style:{backgroundColor:x=>u(x,"inherit"),color:x=>u(x,"text"),borderRadius:x=>h(b(x)*2),outline:x=>`1px solid ${u(x,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}};X(e.content,d);let f=x=>({div:D=>{let _=x.state.get(D),C=Array.isArray(_)?_:[_];return x.options.filter(P=>C.includes(P.value)).map(P=>({span:P.label,$:[zt({color:x.color,removable:x.multiple})],_key:P.value,_onRemove:V=>{let re=x.state.get(),G=(Array.isArray(re)?re:[re]).filter(ie=>ie!==P.value);x.multiple?x.state.set(G):x.state.set(G[0])}}))},_key:"selectBoxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1),flex:1}}),p=(x,D)=>({update(_){x.children.update([f(_)])}}),y=x=>l.get()?m(x):c(x),g=x=>{var _;let D=x.getRoot().domElement;return(_=D==null?void 0:D.querySelector(`#${ge("selectBox",x)}`))!=null?_:null},S=(x,D)=>{var M;let _=Ze(g(x));if(!_.length)return;let C=_[D?_.length-1:0];C.focus(),(M=C.scrollIntoView)==null||M.call(C,{block:"nearest"})},E=(x,D)=>{let _;_=be(l,C=>{C&&(_==null||_(),requestAnimationFrame(()=>S(x,D)))},!1),c(x)},O=(x,D)=>{var F,G,ie;let _=pu(D);_.timer&&clearTimeout(_.timer),_.buffer+=x.toLowerCase(),_.timer=setTimeout(()=>{_.buffer=""},fu);let C=_.buffer.length>1&&new Set(_.buffer).size===1,M=C?_.buffer[0]:_.buffer;if(l.get()){let Y=Ze(g(D)).filter(le=>{var oe;return Ti((oe=le.textContent)!=null?oe:"",M)});if(!Y.length)return;let Q=(G=(F=D.domElement)==null?void 0:F.ownerDocument)==null?void 0:G.activeElement,ae=C&&Q?Y.indexOf(Q):-1,ee=Y[(ae+1)%Y.length];ee.focus(),(ie=ee.scrollIntoView)==null||ie.call(ee,{block:"nearest"});return}if(r)return;let P=t.filter(Y=>Ti(Y.label,M));if(!P.length)return;let V=C?P.findIndex(Y=>Y.value===i.get()):-1,re=P[(V+1)%P.length];i.set(re.value)},T=A(I({_onInsert:x=>{x.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onSchedule:(x,D)=>{D[x.tagName]=[f({options:t,multiple:r,color:o,state:i})]}},H("selectBoxInner",p,{options:t,multiple:r,color:o,state:i})),{onClick:(x,D)=>y(D),tabindex:0,role:"combobox",ariaLabel:"Select",ariaExpanded:x=>l.get(x),ariaHaspopup:"listbox",ariaControls:x=>x!=null&&x.elementNode?ge("selectBox",x.elementNode):void 0,onKeyDown:(x,D)=>{let _=x.key;if(_==="Escape"){m(D);return}if(_==="Enter"||_===" "){x.preventDefault(),y(D);return}if(_==="ArrowDown"||_==="ArrowUp"||_==="Home"||_==="End"){x.preventDefault();let M=_==="ArrowUp"||_==="End";l.get()?S(D,M):E(D,M);return}let C=x;_.length===1&&!C.ctrlKey&&!C.metaKey&&!C.altKey&&O(_,D)},style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:x=>h(6+b(x)*2),minWidth:h(32),outlineOffset:"-1px",outline:x=>`1px solid ${u(x,"border-strong","neutral")}`,paddingInline:x=>h(b(x)*2),borderRadius:x=>h(b(x)*1.5),fontSize:x=>w(x,"inherit"),color:x=>u(x,"text",o),backgroundColor:x=>u(x,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:x=>L(x,o)}}});return X(s,T),s}function yu(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",tabindex:-1,ariaSelected:r=>{var c;let i=(c=r==null?void 0:r.elementNode)==null?void 0:c.getContext("select");if(!i)return;let l=i.value.get(r);return i.multiple?l.includes(o):l===o},onClick:(r,i)=>{let l=i.getContext("select");if(!l)return;let c=l.value,m=c.get();l.multiple?m.includes(o)?c.set(m.filter(s=>s!==o)):c.set(m.concat([o])):m!==o&&c.set(o)},_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag')},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>w(r,"inherit"),height:r=>h(6+b(r)*2),paddingInline:r=>h(b(r)*3),border:"none",outline:"none",color:r=>u(r,"text",n),backgroundColor:r=>u(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>u(r,"hover",n),color:r=>u(r,q(2),n)},"&[aria-selected=true]":{backgroundColor:r=>u(r,"shift-13",t),color:r=>u(r,"shift-0","neutral")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>L(r,t)}}}}function bu(e,t){var m;let n=e.key,o=t.domElement;if(!o)return;let a=Ze(o);if(!a.length)return;let r=o.ownerDocument.activeElement,i=r?a.indexOf(r):-1;if(n==="Enter"||n===" "){if(i===-1)return;e.preventDefault(),a[i].click();return}let l;if(n==="ArrowDown")l=Math.min(a.length-1,i+1);else if(n==="ArrowUp")l=i<=0?0:i-1;else if(n==="Home")l=0;else if(n==="End")l=a.length-1;else return;e.preventDefault();let c=a[l];c.focus(),(m=c.scrollIntoView)==null||m.call(c,{block:"nearest"})}function vu(e={}){var i;let{color:t="neutral",multiple:n=!1}=e,o=v((i=e.value)!=null?i:n?[]:null),a={div:l=>{let c=o.get(l);return(Array.isArray(c)?c:[c]).map(s=>({input:null,type:"hidden",name:e.name,value:s==null?"":String(s)}))},ariaHidden:"true",hidden:!0};return{dataTone:"shift-0",role:"listbox",ariaLabel:"Options",ariaMultiselectable:n?"true":void 0,tabindex:0,onKeyDown:bu,_onSchedule:l=>{l.setContext("select",{value:o,multiple:n})},_onInit:l=>{l.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),l.children.insert(a)},style:{display:"flex",flexDirection:"column",paddingBlock:l=>h(b(l)*2),paddingInline:l=>h(b(l)*2),fontSize:l=>w(l,"inherit"),backgroundColor:l=>u(l,"inherit",t),color:l=>u(l,"text",t)}}}function Su(e={}){var a;let t=v((a=e.color)!=null?a:"neutral","color"),n={"0%":{backgroundPosition:"200% 0"},"100%":{backgroundPosition:"-200% 0"}},o=He(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-1",style:{fontSize:r=>w(r),color:r=>u(r,"text",t.get(r)),height:h(6),display:"block",borderRadius:h(1),backgroundColor:r=>u(r,"inherit",t.get(r)),backgroundImage:r=>`linear-gradient(90deg, ${u(r,"inherit",t.get(r))} 0%, ${u(r,"shift-2",t.get(r))} 50%, ${u(r,"inherit",t.get(r))} 100%)`,backgroundSize:"200% 100%",animation:`${o} 1.6s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function wu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="small"&&console.warn('"small" patch must use small tag')},dataSize:"decrease-1",style:{fontSize:o=>w(o,"inherit"),color:o=>u(o,"shift-10",t.get(o))}}}var Di={to:{transform:"rotate(360deg)"}},_i=He(JSON.stringify(Di));function xu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>w(o),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:h(6),height:h(6),borderRadius:"50%",border:o=>`${h(.5)} solid ${u(o,"border-strong",t.get(o))}`,borderTopColor:o=>u(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${_i} 0.7s linear infinite`,[`@keyframes ${_i}`]:Di}}}function Eu(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:a=90}=e;return{_onSchedule:(r,i)=>{X(i,{_context:{splitter:{direction:t,size:v(n),min:o,max:a,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function Cu(e){let t=e.parent;if(!t)return!0;for(let n of t.children.items)if(n instanceof ne&&n.getMetadata("splitterPanel"))return n===e;return!0}function ku(){return{_metadata:{splitterPanel:!0},_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal"?"width":"height",a=i=>{n.style[o]=`${Cu(e)?i:100-i}%`};a(t.size.get()),n.style.flexShrink="0",n.style.overflow="auto";let r=t.size.addListener(a);e.addHook("Remove",()=>{var i;t.panelCount=Math.max(0,((i=t.panelCount)!=null?i:1)-1),r()})}}}function Tu(e={}){let{label:t="Resize"}=e;return{role:"separator",tabindex:0,ariaLabel:t,_onMount:n=>{let o=n.getContext("splitter");if(!o){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let a=n.domElement,r=o.direction==="horizontal";a.style.cursor=r?"col-resize":"row-resize",a.setAttribute("aria-orientation",r?"vertical":"horizontal"),a.setAttribute("aria-valuemin",String(o.min)),a.setAttribute("aria-valuemax",String(o.max)),a.setAttribute("aria-valuenow",String(Math.round(o.size.get())));let i=o.size.addListener(s=>{a.setAttribute("aria-valuenow",String(Math.round(s)))}),l=s=>{let d=s.shiftKey?10:1,f=null;if(r){let p=Oe(s.key,a);p!==0&&(f=Math.min(Math.max(o.size.get()+p*d,o.min),o.max))}else s.key==="ArrowDown"?f=Math.min(o.size.get()+d,o.max):s.key==="ArrowUp"&&(f=Math.max(o.size.get()-d,o.min));s.key==="Home"?f=o.min:s.key==="End"&&(f=o.max),f!==null&&(s.preventDefault(),o.size.set(f))},c=null,m=s=>{var y;s.preventDefault();let d=a.parentElement;(y=a.setPointerCapture)==null||y.call(a,s.pointerId);let f=g=>{if(g.pointerId!==s.pointerId)return;let S=d.getBoundingClientRect(),E=r?(g.clientX-S.left)/S.width*100:(g.clientY-S.top)/S.height*100;o.size.set(Math.min(Math.max(E,o.min),o.max))};c=()=>{var g;document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p),c=null,(g=a.hasPointerCapture)!=null&&g.call(a,s.pointerId)&&a.releasePointerCapture(s.pointerId)};function p(g){g.pointerId===s.pointerId&&(c==null||c())}document.addEventListener("pointermove",f),document.addEventListener("pointerup",p),document.addEventListener("pointercancel",p)};a.addEventListener("keydown",l),a.addEventListener("pointerdown",m),n.addHook("Remove",()=>{c==null||c(),i(),a.removeEventListener("keydown",l),a.removeEventListener("pointerdown",m)})},dataTone:"shift-2",style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none",backgroundColor:n=>u(n,"inherit"),color:n=>u(n,"text"),"&:hover":{backgroundColor:n=>u(n,"increase-1")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:n=>L(n,"primary")},"&::after":{content:'""',width:h(1),height:h(1),borderRadius:h(999),backgroundColor:n=>u(n,"shift-4")}}}}function _u(e={}){let{gap:t=3,align:n,justify:o,density:a=!0}=e;return{style:I(I({display:"flex",flexDirection:"column",gap:a?r=>h(b(r)*t):()=>h(t)},n?{alignItems:n}:{}),o?{justifyContent:o}:{})}}function Oi(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function Du(e,t,n){return e==="vertical"?{"&:not(:last-child)::after":{content:'""',position:"absolute",insetInlineStart:h(3),top:h(6),bottom:`-${h(2)}`,width:"2px",height:"auto",insetInlineEnd:"auto",backgroundColor:o=>u(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:last-child)::after":{backgroundColor:o=>u(o,"shift-9",n)}}:{"&:not(:first-child)::after":{content:'""',position:"absolute",top:h(3),insetInlineEnd:`calc(50% + ${h(3)})`,insetInlineStart:`calc(-50% + ${h(3)})`,height:"2px",backgroundColor:o=>u(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:first-child)::after":{backgroundColor:o=>u(o,"shift-9",n)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:o=>u(o,"shift-9",n)}}}function Li(e,t,n,o,a){let r=n==="vertical",i=Du(n,o,a);return e.map((l,c)=>{var s;return{li:[typeof l.label=="string"?{span:l.label}:l.label],_key:(s=l.key)!=null?s:c,dataStep:String(c+1),dataStatus:d=>{let f=t.get(d);return c<f?"done":c===f?"active":"pending"},ariaCurrent:d=>t.get(d)===c?"step":void 0,style:A(I({position:"relative",display:"flex",flexDirection:r?"row":"column",alignItems:r?"flex-start":"center",gap:h(1),flex:r?"none":"1",fontSize:d=>w(d,"decrease-1"),textAlign:r?"start":"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:h(6),height:h(6),borderRadius:h(999),fontSize:d=>w(d,"decrease-1"),fontWeight:Z("bold"),flexShrink:"0",border:d=>`2px solid ${u(d,"border-strong",o)}`,backgroundColor:d=>u(d,"inherit"),color:d=>u(d,"muted"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"}},i),{"&[data-status=active]::before":{backgroundColor:d=>u(d,"shift-9",a),borderColor:d=>u(d,"shift-9",a),color:d=>u(d,"shift-0",a),boxShadow:d=>`0 0 0 3px ${u(d,"shift-3",a)}`},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:d=>u(d,"shift-9",a),borderColor:d=>u(d,"shift-9",a),color:d=>u(d,"shift-0",a)},"&[data-status=pending]":{color:d=>u(d,"muted")},"&[data-status=active]":{color:d=>u(d,"shift-11",a),fontWeight:Z("bold")},"&[data-status=done]":{color:d=>u(d,"text",o)}})}})}function Ou(e={items:[]}){var i;let{items:t=[],direction:n="horizontal",color:o="neutral",accentColor:a="primary"}=e,r={items:t,direction:n,color:o,accentColor:a};return A(I({_context:{steps:{current:v((i=e.current)!=null?i:0),direction:n,color:o,accentColor:a}},_onSchedule:(l,c)=>{let m=Oi(l,"stepsCurrent",e.current,0);c[l.tagName]=Li(t,m,n,o,a)}},H("steps-items",l=>({update(c){let m=Oi(l,"stepsCurrent",e.current,0);l.children.update(Li(c.items,m,c.direction,c.color,c.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",flexDirection:n==="vertical"?"column":"row",alignItems:n==="vertical"?"flex-start":"center",gap:h(2),listStyle:"none",margin:"0",padding:"0"}})}function Lu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>w(o,"inherit"),fontWeight:Z("bold"),color:o=>u(o,"shift-11",t.get(o)),backgroundColor:o=>u(o)}}}function Iu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>w(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>u(o,"text",t.get(o))}}}function Pu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>w(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>u(o,"text",t.get(o))}}}function Mu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"start",fontWeight:Z("medium"),paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*1),color:o=>u(o,"shift-10",t.get(o)),backgroundColor:o=>u(o,"inherit")},"& td":{textAlign:"start",paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*1),color:o=>u(o,"text",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${u(o,"shift-3",t.get(o))}`,fontSize:o=>w(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"start",fontWeight:Z("medium"),paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*1),color:o=>u(o,"shift-10",t.get(o)),backgroundColor:o=>u(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${u(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>u(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>u(o,"hover"),color:o=>u(o,q(2))},"& tbody tr:hover td, & tbody tr:hover th":{color:o=>u(o,q(2))}}}}function Ii(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function Pi(e,t,n,o,a){let r=e.nodeId,l={div:t.map((m,s)=>{var p;let d=(p=m.key)!=null?p:s;return{button:[typeof m.label=="string"?{span:m.label}:m.label],_key:d,type:"button",role:"tab",id:`tab${r}${d}`,ariaControls:`panel${r}${d}`,ariaSelected:y=>n.get(y)===d,tabIndex:y=>n.get(y)===d?0:-1,onClick:()=>n.set(d),onKeyDown:y=>{var x;let g=y.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(g))return;y.preventDefault();let S=t.map((D,_)=>{var C;return(C=D.key)!=null?C:_}),E=S.indexOf(d),O=E;if(g==="ArrowRight"||g==="ArrowLeft"){let D=Oe(g,y.target);O=(E+D+S.length)%S.length}else g==="Home"?O=0:g==="End"&&(O=S.length-1);n.set(S[O]);let T=y.target.closest("[role=tablist]");(x=T==null?void 0:T.querySelectorAll("[role=tab]")[O])==null||x.focus()},style:{cursor:"pointer",fontSize:y=>w(y,"inherit"),height:y=>h(6+b(y)*2),paddingInline:y=>h(b(y)*4),border:"none",outline:"none",color:y=>u(y,"shift-13"),backgroundColor:y=>u(y,"inherit"),boxShadow:y=>`inset 0 ${h(-.5)} 0 0 ${u(y,"shift-1",a)}`,transition:"box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-selected=true])":{color:y=>u(y,"shift-13"),boxShadow:y=>`inset 0 ${h(-.5)} 0 0 ${u(y,"shift-2",a)}`},"&[aria-selected=true]:not([disabled])":{color:y=>u(y,"shift-13",o),boxShadow:y=>`inset 0 ${h(-.5)} 0 0 ${u(y,"shift-8",o)}`},"&:focus-visible":{boxShadow:y=>L(y,o)},"&[aria-selected=true]:focus-visible":{boxShadow:y=>`${L(y,o)}, inset 0 ${h(-.5)} 0 0 ${u(y,"shift-6",o)}`}}}}),_key:"tablist",role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},c=t.map((m,s)=>{var f;let d=(f=m.key)!=null?f:s;return{div:[m.content],_key:d,role:"tabpanel",id:`panel${r}${d}`,ariaLabelledby:`tab${r}${d}`,tabIndex:0,hidden:p=>n.get(p)!==d,style:{paddingBlock:p=>h(b(p)*2),paddingInline:p=>h(b(p)*2)}}});return[l,...c]}function Ru(e={items:[]}){let{items:t=[],accentColor:n="primary",color:o="neutral"}=e;return I({_onSchedule:(r,i)=>{var c,m;let l=Ii(r,"tabsActiveKey",e.activeKey,(m=(c=t[0])==null?void 0:c.key)!=null?m:0);i[r.tagName]=Pi(r,t,l,n,o)}},H("tabs-items",r=>({update(i){var c,m;let l=Ii(r,"tabsActiveKey",e.activeKey,(m=(c=i.items[0])==null?void 0:c.key)!=null?m:0);r.children.update(Pi(r,i.items,l,i.accentColor,i.color),!!r.domElement,!0)}}),{items:t,accentColor:n,color:o}))}function $u(e={}){var a,r;let t=v((a=e.color)!=null?a:"neutral","color"),n=v((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return A(I({_onInsert:i=>{i.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')}},H("textarea-auto-resize",(i,l)=>{let c=i.domElement,m=l.autoResize,s=!1,d,f,p=()=>{!m||s||(s=!0,f==null||f.unobserve(c),c.style.overflow="hidden",c.style.height="auto",c.style.height=`${c.scrollHeight}px`,s=!1,m&&(f==null||f.observe(c)))},y=()=>{typeof IntersectionObserver!="undefined"&&(d||(d=new IntersectionObserver(S=>{S.some(E=>E.isIntersecting)&&p()})),d.observe(c)),typeof ResizeObserver!="undefined"&&(f||(f=new ResizeObserver(()=>{s||p()})),f.observe(c))},g=()=>{d==null||d.unobserve(c),f==null||f.unobserve(c)};return c.addEventListener("input",p),i.attributes.addListener("value",p),m&&(y(),p()),{resize:p,update(S){m=S.autoResize,i.attributes.addListener("value",p),m?(y(),p()):g()},destroy(){c.removeEventListener("input",p),d==null||d.disconnect(),f==null||f.disconnect()}}},{autoResize:o})),{_onUpdate:i=>{var l;(l=i.getBehavior("textarea-auto-resize"))==null||l.resize()},style:A(I({lineHeight:"inherit",resize:"vertical",paddingInline:i=>h(b(i)*2),paddingBlock:i=>h(b(i)*1.5),border:"none",borderRadius:i=>h(b(i)*1.5),fontSize:i=>w(i,"inherit")},we(t)),{outlineOffset:"-1px",outline:i=>`1px solid ${u(i,"border-strong",t.get(i))}`,backgroundColor:i=>u(i,"inherit",t.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${u(i,"shift-5",n.get(i))}`},"&:focus-visible":{boxShadow:i=>L(i,n.get(i))},"&[placeholder]:invalid:not(:placeholder-shown)":{outline:i=>`${h(.5)} solid ${u(i,"shift-5","error")}`},"&[data-status=error]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","warning")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>u(i,"muted","neutral"),outline:i=>`1px solid ${u(i,"border-strong","neutral")}`,backgroundColor:i=>u(i,"shift-2","neutral")}})})}function Au(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Nu(e={}){var r,i,l;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(i=e.accentColor)!=null?i:"primary",a=v((l=e.active)!=null?l:!1);return{style:I({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:c=>h(b(c)*2),paddingBottom:c=>t?"0":h(b(c)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:h(1),transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:c=>u(c,"shift-8",a.get(c)?o:n),opacity:c=>a.get(c)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",insetInlineStart:"calc(1rem - 1px)",top:"1.25rem",bottom:c=>h(b(c)*-4),width:"2px",backgroundColor:c=>u(c,"shift-3",n)}})}}function $n(e){let t=e.getMetadata("toastOpen");return t||(t=v(!1),e.setMetadata("toastOpen",t)),t}var Mi=e=>{let t=e==null?void 0:e.elementNode;return t?$n(t).get(e):!1},zu=5e3;function Bu(e,t){let{duration:n,onDismiss:o}=t,a=null,r=n,i=0,l=!1,c=()=>{a&&(clearTimeout(a),a=null)},m=()=>{l||(l=!0,c(),o==null||o(),e.remove())},s=y=>{c(),!(l||!Number.isFinite(y)||y<=0)&&(i=Date.now(),a=setTimeout(m,y))};s(n);let d=()=>{a&&(r-=Date.now()-i,c())},f=()=>{l||a||s(r)},p=e.domElement;return p==null||p.addEventListener("pointerenter",d),p==null||p.addEventListener("pointerleave",f),p==null||p.addEventListener("focusin",d),p==null||p.addEventListener("focusout",f),{pause:d,resume:f,update(y){n=y.duration,o=y.onDismiss,!a&&!l&&(r=n)},destroy(){c(),p==null||p.removeEventListener("pointerenter",d),p==null||p.removeEventListener("pointerleave",f),p==null||p.removeEventListener("focusin",d),p==null||p.removeEventListener("focusout",f)}}}function Vu(e={}){let{position:t="top-center",color:n="neutral",duration:o=zu,onDismiss:a}=e,r=t.startsWith("top"),i=t.endsWith("center"),l=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":l?"end":"start",inset:0,gap:h(4),zIndex:30,padding:h(6),pointerEvents:"none"}};return A(I({},H("toastAutoDismiss",Bu,{duration:o,onDismiss:a})),{_portal:m=>{let s=m.domElement.querySelector(`#domphy-toast-${t}`);return s||(s=m.children.insert(c).domElement),s},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:h(32),pointerEvents:"auto",paddingBlock:m=>h(b(m)*2),paddingInline:m=>h(b(m)*4),borderRadius:m=>h(b(m)*2),fontSize:m=>w(m,"inherit"),color:m=>u(m,"text",n),backgroundColor:m=>u(m,"inherit",n),boxShadow:U("medium"),opacity:m=>Number(Mi(m)),transform:m=>Mi(m)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:m=>requestAnimationFrame(()=>$n(m).set(!0)),_onBeforeRemove:(m,s)=>{var T,x;let d=!1,f=null,p=!1,y=m.getRoot(),g=(x=(T=m.domElement)==null?void 0:T.parentElement)!=null?x:null,S=()=>{var _;if(p||!g||g.id!==`domphy-toast-${t}`||g.childElementCount>0)return;p=!0;let D=(_=y.children)==null?void 0:_.items.find(C=>C.domElement===g);D?y.children.remove(D):g.remove()},E=()=>{d||(d=!0,f&&(clearTimeout(f),f=null),m.domElement.removeEventListener("transitionend",O),s(),S())},O=D=>{D.propertyName==="transform"&&E()};m.domElement.addEventListener("transitionend",O),f=setTimeout(E,350),m.addHook("Remove",()=>{var D;f&&(clearTimeout(f),f=null),(D=m.domElement)==null||D.removeEventListener("transitionend",O),S()}),$n(m).set(!1)}})}function _o(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function Hu(e,t){return Array.isArray(e)?e.includes(t):e===t}function Fu(e,t,n,o,a){var s;let r=e.key;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r))return;e.preventDefault();let i=t.map((d,f)=>{var p;return(p=d.key)!=null?p:String(f)}),l=i.indexOf(n),c=l;if(r==="ArrowDown")c=(l+1)%i.length;else if(r==="ArrowUp")c=(l-1+i.length)%i.length;else if(r==="ArrowRight"||r==="ArrowLeft"){let d=Oe(r,e.target);c=(l+d+i.length)%i.length}else r==="Home"?c=0:r==="End"&&(c=i.length-1);a||o.set(i[c]);let m=e.target.closest("[role=group]");(s=m==null?void 0:m.querySelectorAll("button")[c])==null||s.focus()}function Ri(e,t,n,o,a,r){return e.map((i,l)=>{var s;let c=(s=i.key)!=null?s:String(l);return{button:[typeof i.label=="string"?{span:i.label}:i.label],_key:c,type:"button",role:"button",ariaPressed:d=>Hu(t.get(d),c),tabIndex:d=>{var p,y,g,S,E;let f=t.get(d);if(o){let O=n.get(d);if(O!==null)return c===O?0:-1;let x=(g=(y=(Array.isArray(f)?f:[])[0])!=null?y:(p=e[0])==null?void 0:p.key)!=null?g:"0";return c===x?0:-1}return f===c||f===""&&c===((E=(S=e[0])==null?void 0:S.key)!=null?E:"0")?0:-1},onFocus:()=>n.set(c),onClick:()=>{let d=t.get();if(o){let f=Array.isArray(d)?[...d]:[];t.set(f.includes(c)?f.filter(p=>p!==c):[...f,c])}else t.set(d===c?"":c)},onKeyDown:d=>Fu(d,e,c,t,o),style:{cursor:"pointer",fontSize:d=>w(d,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(2),border:"none",borderRadius:h(1.5),color:d=>u(d,"shift-13",a),backgroundColor:d=>u(d,"inherit",a),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-pressed=true])":{color:d=>u(d,"shift-13",a),backgroundColor:d=>u(d,"hover",a)},"&:active:not([disabled])":{backgroundColor:d=>u(d,"increase-2",a)},"&[aria-pressed=true]":{backgroundColor:d=>u(d,"shift-3",r),color:d=>u(d,"shift-13",r)},"&:focus-visible":{boxShadow:d=>L(d,r)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function ju(e={items:[]}){let{items:t=[],multiple:n=!1,color:o="neutral",accentColor:a="primary"}=e;return A(I({role:"group",_onSchedule:(i,l)=>{let c=_o(i,"toggleGroupValue",e.value,n?[]:"");i.setContext("toggleGroup",{value:c,multiple:n});let m=_o(i,"toggleGroupFocusedKey",void 0,null);l[i.tagName]=Ri(t,c,m,n,o,a)}},H("toggle-items",i=>({update(l){let c=_o(i,"toggleGroupValue",e.value,l.multiple?[]:""),m=_o(i,"toggleGroupFocusedKey",void 0,null);i.children.update(Ri(l.items,c,m,l.multiple,l.color,l.accentColor),!!i.domElement,!0)}}),{items:t,multiple:n,color:o,accentColor:a})),{style:{display:"flex",paddingBlock:h(1),paddingInline:h(1),gap:h(1),borderRadius:h(2),fontSize:i=>w(i,"inherit"),backgroundColor:i=>u(i,"inherit",o),color:i=>u(i,"text",o),outline:i=>`1px solid ${u(i,"border",o)}`,outlineOffset:"-1px"}})}function Wu(e={}){return Rn(e)}function Ku(){return{div:null,style:{flex:"1 1 0"}}}function qu(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content",openDelay:a,closeDelay:r}=e,i=v(n),l=v(o),c={span:g=>l.get(g)},{show:m,hide:s,anchorPartial:d,openState:f}=_e({kind:"tooltip",open:t,onDismiss:e.onDismiss,placement:i,content:c,openDelay:a,closeDelay:r}),p={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:g=>h(b(g)*1),paddingInline:g=>h(b(g)*3),borderRadius:g=>h(b(g)*1.5),color:g=>u(g,"text"),backgroundColor:g=>u(g),fontSize:g=>w(g,"inherit"),boxShadow:U("low")},$:[In({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(p),X(d,{ariaDescribedby:g=>g!=null&&g.elementNode&&f.get(g)?ge("tooltip",g.elementNode):void 0,onMouseEnter:(g,S)=>m(S),onMouseLeave:(g,S)=>s(S),onFocus:(g,S)=>m(S),onBlur:(g,S)=>s(S),onKeyDown:(g,S)=>g.key==="Escape"&&s(S)}),d}function $i(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Uu(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,a=new Map,r=new Set,i=new Set;return{_onMount:l=>{l.addHook("Remove",()=>{for(let c of Array.from(a.values()))c();a.clear();for(let c of r)clearTimeout(c);r.clear();for(let c of i)cancelAnimationFrame(c);i.clear()})},_onBeforeUpdate:l=>{o=new Map,!St()&&l.children.items.forEach((c,m)=>{if(!(c instanceof ne))return;let s=c.domElement;s&&o.set($i(c,m),s.getBoundingClientRect())})},_onUpdate:l=>{l.children.items.forEach((c,m)=>{var D;if(!(c instanceof ne))return;let s=c.domElement;if(!s)return;let d=$i(c,m),f=o.get(d);if(!f)return;let p=s.getBoundingClientRect(),y=f.left-p.left,g=f.top-p.top;if(Math.abs(y)<.5&&Math.abs(g)<.5)return;(D=a.get(s))==null||D(),s.style.transition="none",s.style.transform=`translate(${y}px, ${g}px)`,s.getBoundingClientRect();let S=requestAnimationFrame(()=>{i.delete(S),s.style.transition=`transform ${t}ms ease ${n}ms`,s.style.transform="translate(0px, 0px)"});i.add(S);let E=!1,O=null,T=()=>{E||(E=!0,O&&(r.delete(O),O=null),a.delete(s),s.removeEventListener("transitionend",x),s.style.transition="",s.style.transform="")},x=_=>{_.propertyName==="transform"&&T()};a.set(s,()=>{E=!0,O&&(clearTimeout(O),r.delete(O),O=null),a.delete(s),s.removeEventListener("transitionend",x)}),s.addEventListener("transitionend",x),O=setTimeout(T,t+n+34),r.add(O)}),o.clear()}}}function Gu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingInlineStart:h(3),listStyleType:"disc",listStylePosition:"outside"}}}function Yu(){return{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}}return qi(Xu);})();
9
+ ${Ba}`}function Va(e){var t;if(typeof document!="undefined")if(e){e.textContent=Xo();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Xo(),document.head.appendChild(e)}function h(e){return`calc(${e/4}em)`}var Uo=16;function Ha(e,t,n=320,o=1280){let a=e/4,r=t/4,i=a*Uo,l=(r*Uo-i)/(o-n)*100,c=(i-l*n/100)/Uo,m=parseFloat(l.toFixed(4)),s=parseFloat(c.toFixed(4)),d=s===0?`${m}vw`:`${s}em + ${m}vw`;return`clamp(${a}em, ${d}, ${r}em)`}function Fa(e,t={}){if(typeof document=="undefined")throw new Error('applySystemTheme() requires a browser DOM \u2014 "document" is not defined. For SSR, call it only on the client (e.g. inside an _onMount lifecycle hook, or behind a typeof window !== "undefined" guard).');let n=e!=null?e:document.documentElement,{persist:o=!0,storageKey:a="dp-theme"}=t,r=()=>{try{return localStorage.getItem(a)}catch(m){return null}},i=()=>{if(o){let m=r();if(m==="light"||m==="dark")return m}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};n.setAttribute("data-theme",i());let l=window.matchMedia("(prefers-color-scheme: dark)"),c=m=>{(!o||!r())&&n.setAttribute("data-theme",m.matches?"dark":"light")};return l.addEventListener("change",c),()=>l.removeEventListener("change",c)}function dt(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let n="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(n=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),n}var ja=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],Zo=["inherit"];[...Array(5).keys()].forEach(e=>{Zo.push(`decrease-${e}`),Zo.push(`increase-${e}`)});function Wa(e,t="inherit"){if(!Zo.includes(t))throw Error(`density name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(4,n))}function Ka(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(n=Wa(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function b(e){let t=Ka(e);return $e(e?dt(e):"light").densities[t]}var qa=e=>{let t=n=>{let o=Math.max(0,Math.min(1,n)),a=o<=.0031308?12.92*o:1.055*W(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(a*255)))};return e.map(t)},Ua=e=>{let t=n=>n>.04045?W((n+.055)/1.055,2.4):n/12.92;return e.map(t)},xe=e=>{let[t,n,o]=qa(e);return t=t.toString(16).padStart(2,"0"),n=n.toString(16).padStart(2,"0"),o=o.toString(16).padStart(2,"0"),`#${t}${n}${o}`},Or=e=>typeof e=="string"&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e),rn=e=>{if(!Or(e))throw new Error(`Invalid hex color "${e}": expected "#rgb", "#rgba", "#rrggbb", or "#rrggbbaa" (hex digits 0-9, a-f, case-insensitive).`);let t=e.slice(1).toLowerCase();return t.length<=4&&(t=t.split("").map(n=>n+n).join("")),`#${t}`},ue=e=>{let t=rn(e),n=parseInt(t.slice(1,3),16)/255,o=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255;return Ua([n,o,a])},Mt=e=>{let t=.4122214708*e[0]+.5363325363*e[1]+.0514459929*e[2],n=.2119034982*e[0]+.6806995451*e[1]+.1073969566*e[2],o=.0883024619*e[0]+.2817188376*e[1]+.6299787005*e[2],a=Math.cbrt(t),r=Math.cbrt(n),i=Math.cbrt(o);return[.2104542553*a+.793617785*r-.0040720468*i,1.9779984951*a-2.428592205*r+.4505937099*i,.0259040371*a+.7827717662*r-.808675766*i]},so=e=>{let[t,n,o]=e,a=t+.3963377774*n+.2158037573*o,r=t-.1055613458*n-.0638541728*o,i=t-.0894841775*n-1.291485548*o,l=a*a*a,c=r*r*r,m=i*i*i;return[4.0767416621*l-3.3077115913*c+.2309699292*m,-1.2684380046*l+2.6097574011*c-.3413193965*m,-.0041960863*l-.7034186147*c+1.707614701*m]},Lr=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,c=.1307,m=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,d=0;return(r<=90||r>=270)&&(d=c*Math.abs(Math.cos(r*(Math.PI/180)))+m),t+(s+d)*a},Ga=(e,t)=>{let[,n,o]=t,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,c=.1307,m=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,d=0;return(r<=90||r>=270)&&(d=c*Math.abs(Math.cos(r*(Math.PI/180)))+m),Math.max(0,e-(s+d)*a)},Ya=e=>{let[t,n,o]=e,a=o*Math.PI/180;return[t,n*Math.cos(a),n*Math.sin(a)]},mt=e=>{let[t,n,o]=e,a=.4124564*t+.3575761*n+.1804375*o,r=.2126729*t+.7151522*n+.072175*o,i=.0193339*t+.119192*n+.9503041*o,l=.95047,c=1,m=1.08883,s=y=>y>.008856?Math.cbrt(y):7.787*y+16/116,d=s(a/l),f=s(r/c),p=s(i/m);return[116*f-16,500*(d-f),200*(f-p)]},Ir=e=>{let[t,n,o]=e,a=(t+16)/116,r=n/500+a,i=a-o/200,l=y=>W(y,3)>.008856?W(y,3):(y-16/116)/7.787,c=.95047,m=1,s=1.08883,d=l(r)*c,f=l(a)*m,p=l(i)*s;return[3.2404542*d-1.5371385*f-.4985314*p,-.969266*d+1.8760108*f+.041556*p,.0556434*d-.2040259*f+1.0572252*p]},Pr=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o);if(a<1e-4)return[t,0,0];let r=(Math.atan2(o,n)*180/Math.PI+360)%360;return r>=359.9999&&(r=0),[t,a,r]},an=(e,t)=>{let[n,o,a]=e,[r,i,l]=t,c=Math.hypot(o,a),m=Math.hypot(i,l),s=(c+m)/2,d=.5*(1-Math.sqrt(W(s,7)/(W(s,7)+W(25,7)))),f=o*(1+d),p=i*(1+d),y=Math.hypot(f,a),g=Math.hypot(p,l),S=(y+g)/2,E=(oe,se)=>{if(oe===0&&se===0)return 0;let ve=Math.atan2(se,oe)*180/Math.PI;return ve>=0?ve:ve+360},O=E(f,a),T=E(p,l),x=T-O,D=Math.abs(x),_=O+T,C=y*g===0,M;C?M=0:D<=180?M=x:x>180?M=x-360:M=x+360;let P;C?P=_:D<=180?P=_/2:_<360?P=(_+360)/2:P=(_-360)/2;let V=1-.17*Math.cos((P-30)*Math.PI/180)+.24*Math.cos(2*P*Math.PI/180)+.32*Math.cos((3*P+6)*Math.PI/180)-.2*Math.cos((4*P-63)*Math.PI/180),re=r-n,F=g-y,G=2*Math.sqrt(y*g)*Math.sin(M/2*Math.PI/180),ie=(n+r)/2,Y=1+.015*W(ie-50,2)/Math.sqrt(20+W(ie-50,2)),Q=1+.045*S,ae=1+.015*S*V,ee=30*Math.exp(-W((P-275)/25,2)),le=-(2*Math.sqrt(W(S,7)/(W(S,7)+W(25,7))))*Math.sin(2*ee*Math.PI/180);return Math.sqrt(W(re/Y,2)+W(F/Q,2)+W(G/ae,2)+le*(F/Q)*(G/ae))},Xa=e=>{let t=()=>new Error(`Invalid CSS rgb() "${e}": expected "rgb(r, g, b)" with channels 0-255 or 0%-100% (comma or space separated, optional alpha after "," or "/").`),n=/^\s*rgba?\(\s*(.+?)\s*\)\s*$/i.exec(e);if(!n)throw t();let o=n[1].split("/")[0],a=o.includes(",")?o.split(",").map(l=>l.trim()).slice(0,3):o.trim().split(/\s+/);if(a.length!==3)throw t();let r=a.map(l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l));if(r.some(l=>!Number.isFinite(l)))throw t();let i=l=>{let c=l/255;return c<=.04045?c/12.92:W((c+.055)/1.055,2.4)};return r.map(i)},ao=e=>{if(e.length<1)return m=>0;let t=[...e].sort((m,s)=>m[0]-s[0]),n=[];for(let m=0;m<t.length;m++)(m===0||t[m][0]!==t[m-1][0])&&n.push(t[m]);let o=n.length;if(o===1)return m=>n[0][1];let a=n.map(m=>m[0]),r=n.map(m=>m[1]),i=[],l=[];for(let m=0;m<o-1;m++)i[m]=a[m+1]-a[m],l[m]=(r[m+1]-r[m])/i[m];let c=new Array(o);c[0]=l[0],c[o-1]=l[o-2];for(let m=1;m<o-1;m++){let s=l[m-1],d=l[m];if(s*d<=0)c[m]=0;else{let f=(1+i[m]/(i[m-1]+i[m]))/3;c[m]=s*d/((1-f)*s+f*d)}}return m=>{if(m<=a[0])return r[0];if(m>=a[o-1])return r[o-1];let s=0,d=o-2,f=0;for(;s<=d;){let T=Math.floor((s+d)/2);if(m>=a[T]&&m<=a[T+1]){f=T;break}m<a[T]?d=T-1:s=T+1}let p=i[f],y=(m-a[f])/p,g=y*y,S=g*y,E=c[f]*p,O=c[f+1]*p;return(2*S-3*g+1)*r[f]+(S-2*g+y)*E+(-2*S+3*g)*r[f+1]+(S-g)*O}};function at(e){let t=e.length;if(t===0)return 0;let n=0;for(let o=0;o<t;o++)n+=e[o]*e[o];return Math.sqrt(n/t)}var Za=e=>{let t=e.length;if(t===0)return{min:0,max:0,avg:0};let n=e[0],o=e[0],a=0;for(let r=0;r<t;r++){let i=e[r];i<n&&(n=i),i>o&&(o=i),a+=i}return{min:n,max:o,avg:a/t}},ln=e=>{let t=e.length;if(t===0)return 0;let n=1e-6,o=e.reduce((i,l)=>i*(l+n),1),a=W(o,1/t),r=Math.max(0,Math.min(1,a));return parseFloat((r*100).toFixed(2))},Ja=(e,t)=>{let[n,o,a]=ue(e),[r,i,l]=ue(t),c=.2126*n+.7152*o+.0722*a,m=.2126*r+.7152*i+.0722*l,s=Math.max(c,m),d=Math.min(c,m);return(s+.05)/(d+.05)},Qa=(e,t,n=.5,o="oklab")=>{let a=Math.max(0,Math.min(1,n)),r=ue(e),i=ue(t);if(o==="rgb")return xe(r.map((m,s)=>m+a*(i[s]-m)));if(o==="lab"){let m=mt(r),s=mt(i);return xe(Ir(m.map((d,f)=>d+a*(s[f]-d))))}let l=Mt(r),c=Mt(i);return xe(so(l.map((m,s)=>m+a*(c[s]-m))))},el=(e,t)=>{if(e.length<2)throw new Error("scale() requires at least 2 colors");if(t<1)return[];if(t===1)return[xe(ue(e[0]))];let n=e.map(r=>Mt(ue(r))),o=n.length-1,a=[];for(let r=0;r<t;r++){let i=r/(t-1)*o,l=Math.min(Math.floor(i),o-1),c=i-l,m=n[l],s=n[l+1];a.push(xe(so(m.map((d,f)=>d+c*(s[f]-d)))))}return a},Jo=class{constructor(e){this.hex=e}get rgb(){return ue(this.hex)}get lab(){return mt(this.rgb)}get lch(){return Pr(this.lab)}get lightness(){return Lr(this.lab)}get chroma(){return this.lch[1]}get hue(){return this.lch[2]}get luminance(){let[e,t,n]=this.rgb;return .2126*e+.7152*t+.0722*n}},Mr=.501,Rr=class{constructor(e=[],t="brand"){this.swatches=e.map(n=>new Jo(n)),this.name=t}get colors(){return this.swatches.map(e=>e.hex)}get peakChroma(){let e=this.colors.slice(2,-2),t="",n=-1/0;for(let o of e){let a=new Jo(o);a.chroma>n&&(n=a.chroma,t=o)}return n<6?this.colors[Math.ceil(this.steps/2)]:t}get steps(){return this.colors.length}get baseColor(){return this.colors.length===0?"":this.peakChroma||this.colors[Math.floor(this.colors.length/2)]}get baseIndex(){return this.colors.length===0?-1:this.colors.findIndex(e=>e.toLowerCase()===this.baseColor.toLowerCase())}get wcag(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let a of[30,45,70])o[a]={efficiency:1,target:a/10,span:0,value:0};return o}for(let a of[30,45,70]){let r=a/10,i=n,l=0;for(let c=1;c<t;c++){let m=1/0;for(let s=0;s<t-c;s++){let d=e[s].luminance,f=e[s+c].luminance,p=(Math.max(d,f)+.05)/(Math.min(d,f)+.05);p<m&&(m=p)}if(m>=r){i=c,l=m;break}c===n&&(l=m)}o[a]={efficiency:i/n,target:r,span:i,value:l}}return o}get apca(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let r of[45,60,75])o[r]={efficiency:1,target:r,span:0,value:0};return o}let a=(r,i)=>{let l=Math.SQRT2,c=r<.022?r+W(.022-r,l):r,m=i<.022?i+W(.022-i,l):i,s=m>=c?(W(m,.56)-W(c,.57))*114:(W(m,.65)-W(c,.62))*114;return Math.abs(s)<10?0:(s=s>0?s-2.7:s+2.7,Math.round(s))};for(let r of[45,60,75]){let i=r,l=n,c=0;for(let m=1;m<t;m++){let s=1/0;for(let d=0;d<t-m;d++){let f=e[d].luminance>e[d+m].luminance?e[d].luminance:e[d+m].luminance,p=e[d].luminance>e[d+m].luminance?e[d+m].luminance:e[d].luminance,y=Math.abs(a(p,f));y<s&&(s=y)}if(s>=i){l=m,c=s;break}m===n&&(c=s)}o[r]={efficiency:l/n,target:i,span:l,value:c}}return o}get deltaECurve(){let e=[0];for(let t=1;t<this.swatches.length;t++){let n=an(this.swatches[t-1].lab,this.swatches[t].lab);e.push(e[t-1]+n)}return e}get unwrapHues(){let e=this.swatches.map(n=>n.hue).slice(1,-1);if(e.length===0)return[];let t=[e[0]];for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];o>180?o-=360:o<-180&&(o+=360),t.push(t[n-1]+o)}return t}get lightnessLinearity(){let e=this.swatches.map(d=>d.lightness),t=e.length;if(t<2)return 1;let n=0,o=0,a=0,r=0;for(let d=0;d<t;d++)n+=d,o+=e[d],a+=d*e[d],r+=d*d;let i=t*r-n*n;if(Math.abs(i)<1e-10)return 1;let l=(t*a-n*o)/i,c=(o-l*n)/t;if(Math.abs(l*(t-1))<.001)return 1;let m=0,s=0;for(let d=0;d<t;d++){let f=l*d+c,p=e[d]-f;m+=p*p;let y=Math.max(f-Math.min(c,l*(t-1)+c),Math.max(c,l*(t-1)+c)-f);s+=y*y}return Math.max(0,Math.min(1,1-Math.sqrt(m/t)/Math.sqrt(s/t)))}get chromaSmoothness(){let e=this.swatches.map(d=>d.chroma),t=e.length;if(t<3)return 1;let n=133.8,o=Math.max(...e);if(o<=.01)return 1;let a=e.map(d=>d/o*n),r=Math.min(...a),i=Math.max(...a),l=a.indexOf(i),c=ao([[0,a[0]],[l,i],[t-1,a[t-1]]]),m=0,s=0;for(let d=0;d<t;d++){let f=c(d),p=a[d]-f;m+=p*p,s+=W(Math.max(f-r,i-f),2)}return Math.max(0,Math.min(1,1-Math.sqrt(m/t)/Math.sqrt(s/t)))}get spacingUniformity(){let e=this.deltaECurve,t=e.length;if(t<2)return 1;let n=[];for(let i=1;i<t;i++){let l=e[i]-e[i-1];if(l<0)return 0;n.push(l)}let o=n.reduce((i,l)=>i+l,0)/n.length;if(o<=1e-6)return 0;let a=0;for(let i of n)a+=W(i-o,2);let r=Math.sqrt(a/n.length)/o;return Math.max(0,Math.min(1,1/(1+r)))}get hueStability(){var e,t,n;let o=this.unwrapHues,a=o.length;if(a<2)return 1;let r=(n=(t=o[this.baseIndex-1])!=null?t:(e=this.swatches[this.baseIndex])==null?void 0:e.hue)!=null?n:0,i=0,l=0;for(let c=0;c<a;c++){let m=Math.abs(o[c]-r)%360;m>180&&(m=360-m),i+=m*m;let s=c/(a-1)*180;l+=s*s}return Math.max(0,Math.min(1,1-Math.sqrt(i/a)/(Math.sqrt(l/a)||1)))}get contrastEfficiency(){let e=this.wcag[45].span,t=this.steps;if(t<=1)return 1;let n=Mr,o=e/(t-1);return o<=n?1:o>=1?0:1-(o-n)/(1-n)}get metrics(){return{lightnessLinearity:this.lightnessLinearity,chromaSmoothness:this.chromaSmoothness,spacingUniformity:this.spacingUniformity,hueStability:this.hueStability,contrastEfficiency:this.contrastEfficiency}}get score(){return ln(Object.values(this.metrics))}},$r=.605,Qo=.685;function tl(e){let t=W(e,$r);return t/(1+Qo*(1-t))}function ol(e){let t=e*(1+Qo)/(1+e*Qo);return W(t,1/$r)}function ut(e){let t=n=>n<0?0:n>1?1:n;return .2126*t(e[0])+.7152*t(e[1])+.0722*t(e[2])}var nl=21;function rl(e){let t=W(nl,-1/(e-1)),n=[];for(let o=e-1;o>=0;o--)n.push(1.05*W(t,o)-.05);return n}function il(e){return Math.ceil(Mr*(e-1))}var al=4.5,ll=.07,xr=Math.log(al+ll),Er=Math.log(1.02);function no(e){return Math.log(e+.05)}function sl(e){return Math.exp(e)-.05}var Ar=1e-10,cl=2e3;function ul(e,t){let n=(r,i)=>{if(i.low===i.high){if(r[i.low]===i.minGap)return r;let s=r.slice();return s[i.low]=i.minGap,s}let l=r[i.high]-r[i.low];if(l>=i.minGap)return r;let c=(i.minGap-l)/2,m=r.slice();return m[i.low]-=c,m[i.high]+=c,m},o=e.slice(),a=t.map(()=>new Array(e.length).fill(0));for(let r=0;r<cl;r++){let i=0;for(let l=0;l<t.length;l++){let c=o.map((s,d)=>s+a[l][d]),m=n(c,t[l]);for(let s=0;s<e.length;s++)a[l][s]=c[s]-m[s],i=Math.max(i,Math.abs(m[s]-o[s]));o=m}if(i<Ar)return o}throw new Error("generateRamp: the constrained luminance ladder did not converge \u2014 this is an internal solver failure, not an invalid input (infeasible anchor placements are rejected before the solve starts).")}function ml(e,t,n,o){let a=[...e].sort((r,i)=>r.index-i.index);for(let r=0;r<a.length;r++)for(let i=r+1;i<a.length;i++){let l=a[r],c=a[i];if(c.index===l.index){if(Math.abs(c.value-l.value)<Ar)continue;throw new Error(`generateRamp: ${l.label} and ${c.label} both land on ramp step ${l.index} but pin it to different luminances. Space these anchors further apart.`)}let m=c.index-l.index,s=Math.floor(m/t),d=m-s*t,f=s*n+d*o,p=c.value-l.value;if(p>=f)continue;let y=Math.exp(p),g=Math.exp(n),S=s>=1?`${s} full ${t}-step AA window${s>1?"s":""} (need >= ${g.toFixed(2)}:1 per window)`:"the ramp's own light-to-dark order";throw new Error(`generateRamp: ${l.label} and ${c.label} are ${m} ramp steps apart, spanning ${S}, but their own luminance only contrasts ${y.toFixed(2)}:1. Space these anchors further apart, or pick less similar luminances.`)}}var dl=32;function hl(e,t){let n=0,o=1;for(let a=0;a<dl;a++){let r=(n+o)/2;ut(e(r))<t?n=r:o=r}return(n+o)/2}function fl(e,t){return Math.sqrt(W(e[0]-t[0],2)+W(e[1]-t[1],2)+W(e[2]-t[2],2))}function pl(e){let t=[[0,0,0],...e,[1,1,1]].map(s=>Mt(s)),n=t.map(s=>s[0]),o=t.map(s=>s[1]),a=t.map(s=>s[2]),r=[0],i=0;for(let s=1;s<t.length;s++)i+=fl(t[s],t[s-1]),r.push(i);let l=r.map(s=>ol(i>0?s/i:0)),c=ao(l.map((s,d)=>[s,o[d]])),m=ao(l.map((s,d)=>[s,a[d]]));return{colorAtParam:s=>{let d=tl(s),f=0;for(let T=0;T<l.length-1;T++)if(d<=l[T+1]){f=T;break}let p=l[f],y=l[f+1],g=(d-p)/(y-p||1),S=n[f]+g*(n[f+1]-n[f]),E=c(d),O=m(d);return so([S,E,O])},parameters:l.slice(1,-1)}}var Go=512,Cr=512;function gl(e,t){let n=0,o=1/0;for(let l=0;l<=Go;l++){let c=l/Go,m=Math.abs(ut(e(c))-t);m<o&&(o=m,n=c)}let a=1/Go,r=Math.max(0,n-a),i=Math.min(1,n+a);for(let l=0;l<=Cr;l++){let c=r+(i-r)*l/Cr,m=Math.abs(ut(e(c))-t);m<o&&(o=m,n=c)}return e(n)}var yl=1e-9;function Nr(e,t){let n=Array.isArray(e)?e:[e];if(n.length===0)throw new Error("generateRamp requires at least one anchor color");if(t<=0)return[];if(t===1)return[xe(ue(n[0]))];let o=n.map(g=>xe(ue(g))).reverse(),{colorAtParam:a,parameters:r}=pl([...n.map(ue)].reverse()),i=[0,...r,1],l=i.map(g=>Math.round(g*(t-1))),c=[];if(n.length===1)for(let g of rl(t))c.push(xe(a(hl(a,g))));else{let g=0;for(let S=0;S<t;S++){for(;g<l.length-2&&S>l[g+1];)g++;let E=l[g],O=l[g+1],T=i[g],x=i[g+1],D;if(O<=E)D=T;else{let _=(S-E)/(O-E);D=T+_*(x-T)}c.push(xe(a(D)))}}let m=[{index:0,value:no(0),label:"the black edge"},{index:t-1,value:no(1),label:"the white edge"}],s=new Map;for(let g=0;g<o.length;g++){let S=l[g+1];if(S<=0||S>=t-1)continue;let E=no(ut(ue(o[g])));n.length>1?(c[S]=o[g],m.push({index:S,value:E,label:`anchor ${o[g]}`})):s.set(S,E)}let d=il(t);n.length>1&&d>=1&&d<t&&ml(m,d,xr,Er);let f=c.map((g,S)=>s.has(S)?s.get(S):no(ut(ue(g)))),p=m.map(({index:g,value:S})=>({low:g,high:g,minGap:S}));for(let g=1;g<t;g++)p.push({low:g-1,high:g,minGap:Er});if(d>=1)for(let g=0;g+d<t;g++)p.push({low:g,high:g+d,minGap:xr});let y=ul(f,p);return c.map((g,S)=>{let E=Math.max(0,Math.min(1,sl(y[S])));return Math.abs(E-ut(ue(g)))<yl?g:xe(gl(a,E))}).reverse()}var bl=class{constructor(e={},t="Collection 1"){this.ramps=Object.entries(e).map(([n,o])=>new Rr(o,n)),this.name=t}get colors(){return Object.fromEntries(this.ramps.map(e=>[e.name,e.colors]))}get steps(){var e;return((e=this.ramps[0])==null?void 0:e.steps)||0}get wcag(){let e={},t=this.steps;for(let n of[30,45,70]){let o=this.ramps.map(i=>i.wcag[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n/10,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get apca(){let e={},t=this.steps;for(let n of[45,60,75]){let o=this.ramps.map(i=>i.apca[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get contrastEfficiency(){return at(this.ramps.map(e=>e.contrastEfficiency))}get lightnessLinearity(){return at(this.ramps.map(e=>e.lightnessLinearity))}get chromaSmoothness(){return at(this.ramps.map(e=>e.chromaSmoothness))}get hueStability(){return at(this.ramps.map(e=>e.hueStability))}get spacingUniformity(){return at(this.ramps.map(e=>e.spacingUniformity))}get score(){return ln([this.contrastEfficiency,this.lightnessLinearity,this.chromaSmoothness,this.hueStability,this.spacingUniformity])}},vl=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],Sl=[.75,1,1.5,2,2.5];function wl(e,t){let n=mt(ue(t)),o=0,a=1/0;for(let r=0;r<e.length;r++){let i=an(n,mt(ue(e[r])));i<a&&(a=i,o=r)}return o}function xl(e,t={}){var n,o,a,r,i;if(t.steps!==void 0&&t.steps!==K)throw new Error(`generateTheme() steps must be ${K} (the tone model is fixed at shift-0\u2026shift-${K-1}), got ${t.steps}`);let l=K,c={},m={};for(let[s,d]of Object.entries(e)){let f;try{f=rn(d)}catch(y){throw new Error(`baseColors.${s}: ${y instanceof Error?y.message:String(y)}`)}let p=Nr(f,l);c[s]=p,m[s]=wl(p,f)}return{direction:(n=t.direction)!=null?n:"darken",colors:c,baseTones:m,fontSizes:(o=t.fontSizes)!=null?o:vl,densities:(a=t.densities)!=null?a:Sl,darkBias:(r=t.darkBias)!=null?r:1,custom:(i=t.custom)!=null?i:{}}}var en=["inherit"];[...Array(8).keys()].forEach(e=>{en.push(`decrease-${e}`),en.push(`increase-${e}`)});function zr(e,t="inherit"){if(!en.includes(t))throw Error(`size name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(7,n))}function El(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(n=zr(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function w(e,t="inherit"){let n=zr(El(e),t);return Pt().fontSizes[n]}var lo={surface:"shift-1",hover:"shift-2",border:"shift-3","border-strong":"shift-4",muted:"shift-8",text:"shift-9"},Ot=["inherit","base",...Object.keys(lo)];[...Array(K).keys()].forEach(e=>{Ot.push(`decrease-${e}`),Ot.push(`increase-${e}`),Ot.push(`shift-${e}`)});var st=9;function q(e,t=null){let n=Math.max(0,Math.min(K-1,Math.round(e)));if(!t){let c=n+st;return`shift-${c<=K-1?c:n-st}`}let o=$e(dt(t)),a=un(co(t),o.direction,o.darkBias),r=sn(a,n),i=r+st,l=r-st;return i<=K-1?i:l>=0?l:r<=(K-1)/2?K-1:0}function Cl(e,t=null){let n=/^shift-(\d+)$/.exec(e),o=`shift-${K-1}`;if(!n)return o;let a=Number(n[1]);if(!t)return a+st<=K-1?o:"shift-0";let r=$e(dt(t)),i=un(co(t),r.direction,r.darkBias),l=sn(i,a);return K-1-l>=l?K-1:0}function kr(e,t){if(e<0||e>K-1)return e;let n=e+t;return n=Math.max(0,Math.min(K-1,n)),n}function sn(e,t){if(e<0||e>K-1)return e;let n=Math.floor((K-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(K-1,o)),o}function cn(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!Ot.includes(t))throw Error(`tone name "${t}" invalid`);if(t in lo&&(t=lo[t]),t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return kr(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return kr(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return sn(e,n)}else return e}function co(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let n=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(n=cn(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function un(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===K-1?K-1-n:e}function Rt(e,t,n,o){if(n==="base")return kl(e,o);let a=$e(e);return cn(un(t,a.direction,a.darkBias),n)}function kl(e,t){let n=$e(e).baseTones[t];if(n===void 0)throw new Error(`baseTones.${t} is not defined on theme "${e}" \u2014 set a base tone index (0\u2013${K-1}) via setTheme("${e}", { baseTones: { ${t}: <index> } }) so themeColor(..., "base", "${t}") can resolve`);return n}function u(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e){let i=Pt()[o];if(!i)throw Error(`color "${o}" not found on theme "light"`);return i[Rt("light",0,t,o)]}let a=dt(e),r=Pt()[o];if(!r)throw Error(a==="light"?`color "${o}" not found on theme "light"`:`color "${o}" not found on the "light" theme (required by node theme "${a}") \u2014 themeColor() var references are keyed on the "light" theme structure; register the role on "light" as well (e.g. setTheme("light", { colors: { ${o}: \u2026 } })) so the shared CSS-var baseline includes it`);return r[Rt(a,co(e),t,o)]}function mn(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,a=e?dt(e):"light",r=nn(a)[o];if(!r)throw Error(`color "${o}" not found on theme "${a}"`);return e?r[Rt(a,co(e),t,o)]:r[Rt("light",0,t,o)]}function Tl(e={}){var t;let n=!e.color||e.color==="inherit"?"neutral":e.color,o=(t=e.theme)!=null?t:"light",a=nn(o)[n];if(!a)throw Error(`color "${n}" not found on theme "${o}"`);return a[Br(e)]}function Br(e={}){let{theme:t="light",surface:n="inherit",tone:o="inherit",color:a="inherit"}=e;return Rt(t,cn(0,n),o,a==="inherit"?"neutral":a)}var _l=["sans-serif","monospace"],Dl=["light","regular","medium","semibold","bold","extrabold","black"],Ol=["tighter","tight","normal","wide","wider","widest"];function dn(e,t,n){let o=Pt()[e],a=o==null?void 0:o[t];if(!a){let r=Object.keys(o!=null?o:{}).join(", ");throw Error(`${e}.${t} is not registered on the "light" theme \u2014 ${n}() resolves against the shared token baseline. Known names: ${r||"(none)"}. Register it with setTheme("light", { ${e}: { ${t}: \u2026 } }).`)}return a}function We(e="sans-serif"){return dn("fontFamilies",e,"themeFont")}function Z(e="regular"){return dn("fontWeights",e,"themeWeight")}function Ll(e="normal"){return dn("letterSpacings",e,"themeLetterSpacing")}var Do={};Wt(Do,{abbreviation:()=>Il,accordion:()=>Pl,alert:()=>Ml,avatar:()=>Rl,badge:()=>$l,blockquote:()=>Al,breadcrumb:()=>Nl,breadcrumbEllipsis:()=>zl,button:()=>Hl,buttonGhost:()=>hn,buttonSwitch:()=>Fl,card:()=>Wl,code:()=>Kl,combobox:()=>Hs,command:()=>Ws,commandItem:()=>qs,commandSearch:()=>Ks,datePicker:()=>Ys,descriptionList:()=>Js,details:()=>Qs,dialog:()=>tc,divider:()=>oc,drawer:()=>rc,elevation:()=>U,emphasis:()=>ic,empty:()=>ac,errorBoundary:()=>sc,fab:()=>uc,figure:()=>mc,focusRing:()=>L,formGroup:()=>dc,grid:()=>hc,heading:()=>pc,horizontalRule:()=>gc,icon:()=>yc,image:()=>bc,inputCheckbox:()=>vc,inputColor:()=>Sc,inputDateTime:()=>wc,inputFile:()=>xc,inputNumber:()=>Ec,inputOTP:()=>Cc,inputPassword:()=>Dc,inputRadio:()=>Oc,inputRange:()=>Lc,inputSearch:()=>Ic,inputSwitch:()=>Pc,inputText:()=>Mc,keyboard:()=>Rc,label:()=>$c,link:()=>Ac,linkButton:()=>Bc,list:()=>Vc,listItem:()=>Hc,listItemButton:()=>Fc,mark:()=>jc,menu:()=>Wc,motion:()=>qc,orderedList:()=>Uc,pagination:()=>Xc,panelSection:()=>Zc,paragraph:()=>Jc,popover:()=>ou,popoverArrow:()=>In,preformated:()=>nu,progress:()=>ru,rating:()=>su,ringProgress:()=>cu,row:()=>Rn,scrollArea:()=>uu,segmented:()=>du,select:()=>hu,selectBox:()=>gu,selectItem:()=>yu,selectList:()=>vu,skeleton:()=>Su,small:()=>wu,spinner:()=>xu,splitter:()=>Eu,splitterHandle:()=>Tu,splitterPanel:()=>ku,stack:()=>_u,steps:()=>Ou,strong:()=>Lu,subscript:()=>Iu,superscript:()=>Pu,table:()=>Mu,tabs:()=>Ru,tag:()=>zt,textarea:()=>$u,timeline:()=>Au,timelineItem:()=>Nu,toast:()=>Vu,toggleGroup:()=>ju,toolbar:()=>Wu,toolbarSpacer:()=>Ku,tooltip:()=>qu,transitionGroup:()=>Uu,unorderedList:()=>Gu,visuallyHidden:()=>Yu});function Il(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>w(r),backgroundColor:r=>u(r),color:r=>u(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>u(r,"shift-7",t.get(r)),textUnderlineOffset:h(.72),cursor:"help","&:hover":{color:r=>u(r,"shift-11",n.get(r)),textDecorationColor:r=>u(r,"shift-9",n.get(r))}}}}function L(e,t="primary"){let n=u(e,"surface"),o=u(e,"shift-9",t);return`0 0 0 2px ${n}, 0 0 0 4px ${o}`}function Pl(e={}){var a,r;let{type:t="single"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:i=>{let l=i.domElement;if(!l)return;if(t==="single"){let m=s=>{let d=s.target.closest("summary");if(!d)return;let f=d.closest("details");!f||f.parentElement!==l||f.open||Array.from(l.querySelectorAll(":scope > details")).forEach(p=>{p!==f&&(p.open=!1)})};l.addEventListener("click",m),i.addHook("Remove",()=>l.removeEventListener("click",m))}let c=m=>{var S;let s=m.key;if(!["ArrowUp","ArrowDown","Home","End"].includes(s))return;let d=m.target.closest("summary");if(!d)return;let f=d.closest("details");if(!f||f.parentElement!==l)return;let p=Array.from(l.querySelectorAll(":scope > details > summary")),y=p.indexOf(d);if(y===-1)return;let g=y;s==="ArrowDown"?g=(y+1)%p.length:s==="ArrowUp"?g=(y-1+p.length)%p.length:s==="Home"?g=0:s==="End"&&(g=p.length-1),m.preventDefault(),(S=p[g])==null||S.focus()};l.addEventListener("keydown",c),i.addHook("Remove",()=>l.removeEventListener("keydown",c))},style:{display:"flex",flexDirection:"column",borderRadius:i=>h(b(i)*1.5),outline:i=>`1px solid ${u(i,"border-strong",n.get(i))}`,outlineOffset:"-1px",color:i=>u(i,"text",n.get(i)),overflow:"hidden","& > details":{borderBottom:i=>`1px solid ${u(i,"border-strong",n.get(i))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{boxShadow:i=>L(i,o.get(i))}}}}function Ml(e={}){var n;let t=v((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:h(3),paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),borderRadius:o=>h(b(o)*1.5),boxShadow:o=>`inset ${h(1)} 0 0 0 ${u(o,"shift-8",t.get(o))}`,backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"shift-10",t.get(o)),fontSize:o=>w(o,"inherit")}}}function Rl(e={}){var n;let t=v((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:h(9),height:h(9),fontSize:o=>w(o,"inherit"),fontWeight:Z("semibold"),userSelect:"none",backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"shift-11",t.get(o)),boxShadow:o=>`0 0 0 1px ${u(o,"border",t.get(o))}`,"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function $l(e={}){var a;let{label:t=999}=e,n=v(t),o=v((a=e.color)!=null?a:"danger","color");return{style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%,-50%)",paddingInline:r=>h(b(r)*(1.5/1.5)),minWidth:h(5),height:r=>h(b(r)*(5/1.5)),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>w(r,"decrease-2"),fontWeight:Z("semibold"),lineHeight:1,borderRadius:r=>h(b(r)*999),backgroundColor:r=>u(r,"shift-9",o.get(r)),color:r=>u(r,"shift-0",o.get(r)),boxShadow:r=>`0 0 0 1px ${u(r,"shift-0",o.get(r))}`}}}}function Al(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"text",t.get(o)),boxShadow:o=>`inset ${h(1)} 0 0 0 ${u(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),margin:0}}}function Nl(e={}){var o;let{separator:t="/"}=e,n=v((o=e.color)!=null?o:"neutral","color");return{_onInsert:a=>{a.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},_doctorDisable:"low-contrast",ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:a=>w(a,"inherit"),gap:h(1),color:a=>u(a,"text",n.get(a)),backgroundColor:a=>u(a,"inherit",n.get(a)),"& > *":{display:"inline-flex",alignItems:"center"},"& > *:not(:last-child)::after":{content:`"${t}"`,color:a=>u(a,"muted",n.get(a)),paddingInlineStart:h(1)},"& > [aria-current=page]":{pointerEvents:"none"}}}}function zl(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{type:"button",_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>w(o,"inherit"),paddingInline:h(1),border:"none",background:"none",cursor:"pointer",color:o=>u(o,"text",t.get(o)),borderRadius:h(1),transition:"color 140ms ease, background-color 140ms ease, box-shadow 140ms ease","&:hover":{color:o=>u(o,q(2),t.get(o)),backgroundColor:o=>u(o,"hover",t.get(o))},"&:focus-visible":{boxShadow:o=>L(o,t.get(o))}}}}var ht={small:"decrease-1",medium:"inherit",large:"increase-1"};var Bl={small:.5,medium:1,large:1.5};function hn(e={}){var a,r,i;let t=v((a=e.color)!=null?a:"neutral","color"),n=Bl[(r=e.size)!=null?r:"medium"],o=ht[(i=e.size)!=null?i:"medium"];return{type:"button",_onInsert:l=>{l.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:l=>w(l,o),paddingBlock:l=>h(b(l)*n),paddingInline:l=>h(b(l)*n),borderRadius:l=>h(b(l)*1.5),display:"inline-flex",width:"fit-content",justifyContent:"center",alignItems:"center",gap:l=>h(b(l)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:l=>u(l,"text",t.get(l)),"&:hover:not([disabled]):not([aria-busy=true])":{color:l=>u(l,q(2),t.get(l)),backgroundColor:l=>u(l,"hover",t.get(l))},"&:active:not([disabled]):not([aria-busy=true])":{color:l=>u(l,q(2),t.get(l)),backgroundColor:l=>u(l,"increase-2",t.get(l))},"&:focus-visible":{boxShadow:l=>L(l,t.get(l))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>u(l,"border-strong","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var Vl={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}};function Hl(e={}){var i,l,c,m;let t=(i=e.variant)!=null?i:"outline";if(t==="ghost")return hn({color:e.color,size:e.size});let n=v((l=e.color)!=null?l:"primary","color"),o=t==="solid",a=Vl[(c=e.size)!=null?c:"medium"],r=ht[(m=e.size)!=null?m:"medium"];return A(I({type:"button",_onInsert:s=>{s.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')}},o?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{appearance:"none",fontSize:s=>w(s,r),paddingBlock:s=>h(b(s)*a.block),paddingInline:s=>h(b(s)*a.inline),borderRadius:s=>h(b(s)*1.5),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:s=>h(b(s)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o?"none":s=>`1px solid ${u(s,"border-strong",n.get(s))}`,color:s=>o?u(s,"shift-0","neutral"):u(s,"shift-13",n.get(s)),backgroundColor:s=>o?u(s,"shift-13",n.get(s)):u(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{color:s=>o?u(s,"shift-0","neutral"):u(s,"shift-14",n.get(s)),backgroundColor:s=>o?u(s,"shift-14",n.get(s)):u(s,"hover",n.get(s))},"&:active:not([disabled]):not([aria-busy=true])":{backgroundColor:s=>o?u(s,"shift-15",n.get(s)):u(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>L(s,n.get(s))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:s=>u(s,"shift-2","neutral"),outline:s=>`1px solid ${u(s,"border-strong","neutral")}`,color:s=>u(s,"muted","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}})}function Fl(e={}){var r,i;let{checked:t=!1}=e,n=v(t),o=v((r=e.color)!=null?r:"neutral","color"),a=v((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"button",_onSchedule:l=>{l.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaLabel:"Toggle",ariaChecked:l=>n.get(l),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:l=>w(l),border:"none",outlineWidth:"1px",outline:l=>`1px solid ${u(l,"shift-7",o.get(l))}`,minWidth:h(12),minHeight:h(6),width:"fit-content",flexShrink:0,borderRadius:h(999),paddingInlineStart:h(7),paddingInlineEnd:h(2),cursor:"pointer",transition:"padding-inline-start 0.3s, padding-inline-end 0.3s, background-color 140ms ease, box-shadow 140ms ease",backgroundColor:l=>u(l,"inherit",o.get(l)),color:l=>u(l,"text",o.get(l)),"&:focus-visible":{boxShadow:l=>L(l,a.get(l))},"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",insetInlineStart:h(.5),top:"50%",transform:"translateY(-50%)",transition:"inset-inline-start 0.3s",width:h(5),height:h(5),borderRadius:h(999),color:l=>u(l,"text"),backgroundColor:l=>u(l,"decrease-2",o.get(l)),outline:l=>`1px solid ${u(l,"shift-7",o.get(l))}`,outlineOffset:"-1px"},"&[aria-checked=true]":{backgroundColor:l=>u(l,"increase-3",a.get(l)),outline:"none",color:l=>u(l,q(3),a.get(l)),paddingInlineStart:h(2),paddingInlineEnd:h(7)},"&[aria-checked=true] > :first-child":{insetInlineStart:`calc(100% - ${h(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var jl={low:"0 1px 2px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.10)",medium:"0 2px 4px rgba(0,0,0,0.10), 0 10px 24px rgba(0,0,0,0.14)",high:"0 6px 12px rgba(0,0,0,0.14), 0 24px 48px rgba(0,0,0,0.20)"};function U(e){return jl[e]}function Wl(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>h(b(o)*2),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"shift-10",t.get(o)),outline:o=>`1px solid ${u(o,"border-strong",t.get(o))}`,outlineOffset:"-1px",boxShadow:U("low"),overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),fontWeight:Z("semibold"),color:o=>u(o,"shift-11",t.get(o)),margin:0},"& > p":{gridArea:"desc",paddingInline:o=>h(b(o)*4),paddingBottom:o=>h(b(o)*2),color:o=>u(o,"text",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>h(b(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>h(b(o)*4)},"& > footer":{gridArea:"footer",display:"flex",gap:h(2),paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*4),borderTop:o=>`1px solid ${u(o,"border",t.get(o))}`}}}}function Kl(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",fontSize:o=>w(o,"inherit"),fontFamily:We("monospace"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),height:o=>h(b(o)*(6/1.5)),paddingInline:o=>h(b(o)*(1.5/1.5)),borderRadius:o=>h(b(o)*(1/1.5))}}}var ql="text",fn="shift-11";function we(e="neutral"){let t=v(e,"color");return{color:n=>u(n,fn,t.get(n)),"&::placeholder":{color:n=>u(n,ql,t.get(n))}}}var Ul=Object.defineProperty,Gl=Object.defineProperties,Yl=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Yr=Object.prototype.propertyIsEnumerable,Vr=(e,t,n)=>t in e?Ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t)=>{for(var n in t||(t={}))Gr.call(t,n)&&Vr(e,n,t[n]);if(ho)for(var n of ho(t))Yr.call(t,n)&&Vr(e,n,t[n]);return e},Ue=(e,t)=>Gl(e,Yl(t)),Xr=(e,t)=>{var n={};for(var o in e)Gr.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&ho)for(var o of ho(e))t.indexOf(o)<0&&Yr.call(e,o)&&(n[o]=e[o]);return n},Xe=(e,t,n)=>new Promise((o,a)=>{var r=c=>{try{l(n.next(c))}catch(m){a(m)}},i=c=>{try{l(n.throw(c))}catch(m){a(m)}},l=c=>c.done?o(c.value):Promise.resolve(c.value).then(r,i);l((n=n.apply(e,t)).next())}),Xl=["top","right","bottom","left"],Hr=["start","end"],pd=Xl.reduce((e,t)=>e.concat(t,`${t}-${Hr[0]}`,`${t}-${Hr[1]}`),[]),fo=Math.min,qe=Math.max,po=Math.round,mo=Math.floor,Ie=e=>({x:e,y:e}),Zl={left:"right",right:"left",bottom:"top",top:"bottom"};function Jl(e,t,n){return qe(e,fo(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function pt(e){return e.split("-")[0]}function vo(e){return e.split("-")[1]}function Zr(e){return e==="x"?"y":"x"}function Jr(e){return e==="y"?"height":"width"}function Ae(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Qr(e){return Zr(Ae(e))}function Ql(e,t,n=!1){let o=vo(e),a=Qr(e),r=Jr(a),i=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=go(i)),[i,go(i)]}function es(e){let t=go(e);return[yn(e),t,yn(t)]}function yn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Fr=["left","right"],jr=["right","left"],ts=["top","bottom"],os=["bottom","top"];function ns(e,t,n){switch(e){case"top":case"bottom":return n?t?jr:Fr:t?Fr:jr;case"left":case"right":return t?ts:os;default:return[]}}function rs(e,t,n,o){let a=vo(e),r=ns(pt(e),n==="start",o);return a&&(r=r.map(i=>`${i}-${a}`),t&&(r=r.concat(r.map(yn)))),r}function go(e){let t=pt(e);return Zl[t]+e.slice(t.length)}function is(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function as(e){return typeof e!="number"?is(e):{top:e,right:e,bottom:e,left:e}}function yo(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Wr({reference:e,floating:t},n,o){let a=Ae(n),r=Qr(n),i=Jr(r),l=pt(n),c=a==="y",m=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,d=e[i]/2-t[i]/2,f;switch(l){case"top":f={x:m,y:e.y-t.height};break;case"bottom":f={x:m,y:e.y+e.height};break;case"right":f={x:e.x+e.width,y:s};break;case"left":f={x:e.x-t.width,y:s};break;default:f={x:e.x,y:e.y}}let p=vo(n);return p&&(f[r]+=d*(p==="end"?1:-1)*(o&&c?-1:1)),f}function ls(e){return Xe(this,arguments,function*(t,n={}){var o,a,r,i,l,c;let{x:m,y:s,platform:d,rects:f,elements:p,strategy:y}=t,{boundary:g="clippingAncestors",rootBoundary:S="viewport",elementContext:E="floating",altBoundary:O=!1,padding:T=0}=bo(n,t),x=as(T),D=p[O?E==="floating"?"reference":"floating":E],_=yo(yield d.getClippingRect({element:(a=yield(o=d.isElement)==null?void 0:o.call(d,D))==null||a?D:D.contextElement||(yield(r=d.getDocumentElement)==null?void 0:r.call(d,p.floating)),boundary:g,rootBoundary:S,strategy:y})),C=E==="floating"?{x:m,y:s,width:f.floating.width,height:f.floating.height}:f.reference,M=yield(i=d.getOffsetParent)==null?void 0:i.call(d,p.floating),P=(yield(l=d.isElement)==null?void 0:l.call(d,M))&&(yield(c=d.getScale)==null?void 0:c.call(d,M))||{x:1,y:1},V=yo(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:C,offsetParent:M,strategy:y}):C);return{top:(_.top-V.top+x.top)/P.y,bottom:(V.bottom-_.bottom+x.bottom)/P.y,left:(_.left-V.left+x.left)/P.x,right:(V.right-_.right+x.right)/P.x}})}var ss=50,cs=(e,t,n)=>Xe(null,null,function*(){var o;let{placement:a="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=l.detectOverflow?l:Ue(Ce({},l),{detectOverflow:ls}),m=yield(o=l.isRTL)==null?void 0:o.call(l,t),s=yield l.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=Wr(s,a,m),p=a,y=0,g={};for(let S=0;S<i.length;S++){let E=i[S];if(!E)continue;let{name:O,fn:T}=E,{x,y:D,data:_,reset:C}=yield T({x:d,y:f,initialPlacement:a,placement:p,strategy:r,middlewareData:g,rects:s,platform:c,elements:{reference:e,floating:t}});d=x!=null?x:d,f=D!=null?D:f,g[O]=Ce(Ce({},g[O]),_),C&&y<ss&&(y++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(s=C.rects===!0?yield l.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:d,y:f}=Wr(s,p,m)),S=-1)}return{x:d,y:f,placement:p,strategy:r,middlewareData:g}});var us=(e={})=>({name:"flip",options:e,fn(t){return Xe(this,null,function*(){var n,o,a,r,i,l;let{placement:c,middlewareData:m,rects:s,initialPlacement:d,platform:f,elements:p}=t,y=bo(e,t),{mainAxis:g=!0,crossAxis:S=!0,fallbackPlacements:E,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:x=!0}=y,D=Xr(y,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=m.arrow)!=null&&n.alignmentOffset)return{};let _=pt(c),C=Ae(d),M=pt(d)===d,P=yield(o=f.isRTL)==null?void 0:o.call(f,p.floating),V=E||(M||!x?[go(d)]:es(d)),re=T!=="none";!E&&re&&V.push(...rs(d,x,T,P));let F=[d,...V],G=yield f.detectOverflow(t,D),ie=[],Y=((a=m.flip)==null?void 0:a.overflows)||[];if(g&&ie.push(G[_]),S){let Q=Ql(c,s,P);ie.push(G[Q[0]],G[Q[1]])}if(Y=[...Y,{placement:c,overflows:ie}],!ie.every(Q=>Q<=0)){let Q=(((r=m.flip)==null?void 0:r.index)||0)+1,ae=F[Q];if(ae&&(!(S==="alignment"&&C!==Ae(ae))||Y.every(le=>Ae(le.placement)===C?le.overflows[0]>0:!0)))return{data:{index:Q,overflows:Y},reset:{placement:ae}};let ee=(i=Y.filter(le=>le.overflows[0]<=0).sort((le,oe)=>le.overflows[1]-oe.overflows[1])[0])==null?void 0:i.placement;if(!ee)switch(O){case"bestFit":{let le=(l=Y.filter(oe=>{if(re){let se=Ae(oe.placement);return se===C||se==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(se=>se>0).reduce((se,ve)=>se+ve,0)]).sort((oe,se)=>oe[1]-se[1])[0])==null?void 0:l[0];le&&(ee=le);break}case"initialPlacement":ee=d;break;default:}if(c!==ee)return{reset:{placement:ee}}}return{}})}});var ms=new Set(["left","top"]);function ds(e,t){return Xe(this,null,function*(){var n;let{placement:o,platform:a,elements:r}=e,i=yield(n=a.isRTL)==null?void 0:n.call(a,r.floating),l=pt(o),c=vo(o),m=Ae(o)==="y",s=ms.has(l)?-1:1,d=i&&m?-1:1,f=bo(t,e),{mainAxis:p,crossAxis:y,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(y=c==="end"?g*-1:g),m?{x:y*d,y:p*s}:{x:p*s,y:y*d}})}var hs=(e=0)=>({name:"offset",options:e,fn(t){return Xe(this,null,function*(){var n,o;let{x:a,y:r,placement:i,middlewareData:l}=t,c=yield ds(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+c.x,y:r+c.y,data:Ue(Ce({},c),{placement:i})}})}}),fs=(e={})=>({name:"shift",options:e,fn(t){return Xe(this,null,function*(){let{x:n,y:o,placement:a,platform:r}=t,i=bo(e,t),{mainAxis:l=!0,crossAxis:c=!1,limiter:m={fn:({x:T,y:x})=>({x:T,y:x})}}=i,s=Xr(i,["mainAxis","crossAxis","limiter"]),d={x:n,y:o},f=yield r.detectOverflow(t,s),p=Ae(a),y=Zr(p),g=d[y],S=d[p],E=(T,x)=>Jl(x+f[T==="y"?"top":"left"],x,x-f[T==="y"?"bottom":"right"]);l&&(g=E(y,g)),c&&(S=E(p,S));let O=m.fn(Ue(Ce({},t),{[y]:g,[p]:S}));return Ue(Ce({},O),{data:{x:O.x-n,y:O.y-o,enabled:{[y]:l,[p]:c}}})})}});function So(){return typeof window!="undefined"}function gt(e){return ei(e)?(e.nodeName||"").toLowerCase():"#document"}function pe(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function Pe(e){var t;return(t=(ei(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ei(e){return So()?e instanceof Node||e instanceof pe(e).Node:!1}function ke(e){return So()?e instanceof Element||e instanceof pe(e).Element:!1}function Ne(e){return So()?e instanceof HTMLElement||e instanceof pe(e).HTMLElement:!1}function Kr(e){return!So()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof pe(e).ShadowRoot}function wo(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Te(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function ps(e){return/^(table|td|th)$/.test(gt(e))}function xo(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var gs=/transform|translate|scale|rotate|perspective|filter/,ys=/paint|layout|strict|content/,Ke=e=>!!e&&e!=="none",pn;function vn(e){let t=ke(e)?Te(e):e;return Ke(t.transform)||Ke(t.translate)||Ke(t.scale)||Ke(t.rotate)||Ke(t.perspective)||!Sn()&&(Ke(t.backdropFilter)||Ke(t.filter))||gs.test(t.willChange||"")||ys.test(t.contain||"")}function bs(e){let t=Ge(e);for(;Ne(t)&&!$t(t);){if(vn(t))return t;if(xo(t))return null;t=Ge(t)}return null}function Sn(){return pn==null&&(pn=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pn}function $t(e){return/^(html|body|#document)$/.test(gt(e))}function Te(e){return pe(e).getComputedStyle(e)}function Eo(e){return ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(gt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Kr(e)&&e.host||Pe(e);return Kr(t)?t.host:t}function ti(e){let t=Ge(e);return $t(t)?(e.ownerDocument||e).body:Ne(t)&&wo(t)?t:ti(t)}function At(e,t=[],n=!0){var o;let a=ti(e),r=a===((o=e.ownerDocument)==null?void 0:o.body),i=pe(a);if(r){let l=bn(i);return t.concat(i,i.visualViewport||[],wo(a)?a:[],l&&n?At(l):[])}else return t.concat(a,At(a,[],n))}function bn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oi(e){let t=Te(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Ne(e),r=a?e.offsetWidth:n,i=a?e.offsetHeight:o,l=po(n)!==r||po(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function wn(e){return ke(e)?e:e.contextElement}function ft(e){let t=wn(e);if(!Ne(t))return Ie(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:r}=oi(t),i=(r?po(n.width):n.width)/o,l=(r?po(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var vs=Ie(0);function ni(e){let t=pe(e);return!Sn()||!t.visualViewport?vs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ss(e,t=!1,n){return!!n&&t&&n===pe(e)}function Ye(e,t=!1,n=!1,o){let a=e.getBoundingClientRect(),r=wn(e),i=Ie(1);t&&(o?ke(o)&&(i=ft(o)):i=ft(e));let l=Ss(r,n,o)?ni(r):Ie(0),c=(a.left+l.x)/i.x,m=(a.top+l.y)/i.y,s=a.width/i.x,d=a.height/i.y;if(r&&o){let f=pe(r),p=ke(o)?pe(o):o,y=f,g=bn(y);for(;g&&p!==y;){let S=ft(g),E=g.getBoundingClientRect(),O=Te(g),T=E.left+(g.clientLeft+parseFloat(O.paddingLeft))*S.x,x=E.top+(g.clientTop+parseFloat(O.paddingTop))*S.y;c*=S.x,m*=S.y,s*=S.x,d*=S.y,c+=T,m+=x,y=pe(g),g=bn(y)}}return yo({width:s,height:d,x:c,y:m})}function Co(e,t){let n=Eo(e).scrollLeft;return t?t.left+n:Ye(Pe(e)).left+n}function ri(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Co(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function ws({elements:e,rect:t,offsetParent:n,strategy:o}){let a=o==="fixed",r=Pe(n),i=e?xo(e.floating):!1;if(n===r||i&&a)return t;let l={scrollLeft:0,scrollTop:0},c=Ie(1),m=Ie(0),s=Ne(n);if((s||!a)&&((gt(n)!=="body"||wo(r))&&(l=Eo(n)),s)){let f=Ye(n);c=ft(n),m.x=f.x+n.clientLeft,m.y=f.y+n.clientTop}let d=r&&!s&&!a?ri(r,l):Ie(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+m.x+d.x,y:t.y*c.y-l.scrollTop*c.y+m.y+d.y}}function xs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Es(e){let t=Eo(e),n=e.ownerDocument.body,o=qe(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=qe(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),r=-t.scrollLeft+Co(e),i=-t.scrollTop;return Te(n).direction==="rtl"&&(r+=qe(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:r,y:i}}var Cs=25;function ks(e,t,n="viewport"){let o=n==="layoutViewport",a=pe(e),r=Pe(e),i=a.visualViewport,l=r.clientWidth,c=r.clientHeight,m=0,s=0;if(i){let d=!Sn()||t==="fixed";o?d||(m=-i.offsetLeft,s=-i.offsetTop):(l=i.width,c=i.height,d&&(m=i.offsetLeft,s=i.offsetTop))}if(Co(r)<=0){let d=r.ownerDocument,f=d.body,p=getComputedStyle(f),y=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-y),S=getComputedStyle(r).scrollbarGutter==="stable both-edges"?g/2:g;S<=Cs&&(l-=S)}return{width:l,height:c,x:m,y:s}}function Ts(e,t){let n=Ye(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,r=ft(e),i=e.clientWidth*r.x,l=e.clientHeight*r.y,c=a*r.x,m=o*r.y;return{width:i,height:l,x:c,y:m}}function qr(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=ks(e,n,t);else if(t==="document")o=Es(Pe(e));else if(ke(t))o=Ts(t,n);else{let a=ni(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return yo(o)}function _s(e,t){let n=t.get(e);if(n)return n;let o=At(e,[],!1).filter(l=>ke(l)&&gt(l)!=="body"),a=null,r=Te(e).position==="fixed",i=r?Ge(e):e;for(;ke(i)&&!$t(i);){let l=Te(i),c=vn(i),m=a?a.position:r?"fixed":"";!c&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(s=>s!==i):a=l,i=Ge(i)}return t.set(e,o),o}function Ds({element:e,boundary:t,rootBoundary:n,strategy:o}){let a=[...t==="clippingAncestors"?xo(e)?[]:_s(e,this._c):[].concat(t),n],r=qr(e,a[0],o),i=r.top,l=r.right,c=r.bottom,m=r.left;for(let s=1;s<a.length;s++){let d=qr(e,a[s],o);i=qe(d.top,i),l=fo(d.right,l),c=fo(d.bottom,c),m=qe(d.left,m)}return{width:l-m,height:c-i,x:m,y:i}}function Os(e){let{width:t,height:n}=oi(e);return{width:t,height:n}}function Ls(e,t,n){let o=Ne(t),a=Pe(t),r=n==="fixed",i=Ye(e,!0,r,t),l={scrollLeft:0,scrollTop:0},c=Ie(0);if((o||!r)&&((gt(t)!=="body"||wo(a))&&(l=Eo(t)),o)){let f=Ye(t,!0,r,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}!o&&a&&(c.x=Co(a));let m=a&&!o&&!r?ri(a,l):Ie(0),s=i.left+l.scrollLeft-c.x-m.x,d=i.top+l.scrollTop-c.y-m.y;return{x:s,y:d,width:i.width,height:i.height}}function gn(e){return Te(e).position==="static"}function Ur(e,t){if(!Ne(e)||Te(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pe(e)===n&&(n=n.ownerDocument.body),n}function ii(e,t){let n=pe(e);if(xo(e))return n;if(!Ne(e)){let a=Ge(e);for(;a&&!$t(a);){if(ke(a)&&!gn(a))return a;a=Ge(a)}return n}let o=Ur(e,t);for(;o&&ps(o)&&gn(o);)o=Ur(o,t);return o&&$t(o)&&gn(o)&&!vn(o)?n:o||bs(e)||n}var Is=function(e){return Xe(this,null,function*(){let t=this.getOffsetParent||ii,n=this.getDimensions,o=yield n(e.floating);return{reference:Ls(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Ps(e){return Te(e).direction==="rtl"}var Ms={convertOffsetParentRelativeRectToViewportRelativeRect:ws,getDocumentElement:Pe,getClippingRect:Ds,getOffsetParent:ii,getElementRects:Is,getClientRects:xs,getDimensions:Os,getScale:ft,isElement:ke,isRTL:Ps};function ai(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rs(e,t,n){let o=null,a,r=Pe(e);function i(){clearTimeout(a),o==null||o.disconnect(),o=null}function l(s=!1,d=1){i();let f=e.getBoundingClientRect(),{left:p,top:y,width:g,height:S}=f;if(s||t(),!g||!S)return;let E=mo(y),O=mo(r.clientWidth-(p+g)),T=mo(r.clientHeight-(y+S)),x=mo(p),D={rootMargin:`${-E}px ${-O}px ${-T}px ${-x}px`,threshold:qe(0,fo(1,d))||1},_=!0;function C(M){let P=M[0].intersectionRatio;if(!ai(f,e.getBoundingClientRect()))return l();if(P!==d){if(!_)return l();P?l(!1,P):a=setTimeout(()=>{l(!1,1e-7)},1e3)}_=!1}try{o=new IntersectionObserver(C,Ue(Ce({},D),{root:r.ownerDocument}))}catch(M){o=new IntersectionObserver(C,D)}o.observe(e)}let c=pe(e),m=()=>l(n);return c.addEventListener("resize",m),l(!0),()=>{c.removeEventListener("resize",m),i()}}function li(e,t,n,o={}){let{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,m=wn(e),s=a||r?[...m?At(m):[],...t?At(t):[]]:[];s.forEach(E=>{a&&E.addEventListener("scroll",n),r&&E.addEventListener("resize",n)});let d=m&&l?Rs(m,n,r):null,f=-1,p=null;i&&(p=new ResizeObserver(([E])=>{E&&E.target===m&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p==null||p.observe(t)})),n()}),m&&!c&&p.observe(m),t&&p.observe(t));let y,g=c?Ye(e):null;c&&S();function S(){let E=Ye(e);g&&!ai(g,E)&&n(),g=E,y=requestAnimationFrame(S)}return n(),()=>{s.forEach(E=>{a&&E.removeEventListener("scroll",n),r&&E.removeEventListener("resize",n)}),d==null||d(),p==null||p.disconnect(),p=null,c&&cancelAnimationFrame(y)}}var si=hs;var ci=fs,ui=us;var mi=(e,t,n)=>{let o=new Map,a=n!=null?n:{},r=Ue(Ce(Ce({},Ms),a.platform),{_c:o});return cs(e,t,Ue(Ce({},a),{platform:r}))};function $s(e){return typeof e.set=="function"}function be(e,t,n=!0){if(typeof e.addListener=="function")return n&&t(e.get()),e.addListener(t);if(n)return Dt(()=>{t(e.get())});let o=!0,a=Dt(()=>{let r=e.get();o||t(r)});return o=!1,a}function xn(e,t){$s(e)&&e.set(t)}function ze(e,t){t==null||t(),xn(e,!1)}function yt(e){return v(e!=null?e:!1)}var di=100;function ge(e,t){return`domphy-${e}-${t.nodeId}`}var En="data-domphy-floating",Cn=`:scope > [${En}]`,hi="data-domphy-floating-kind";function ko(e){let t=e.querySelector(Cn);return t?Array.from(t.children).some(n=>n.getAttribute(hi)!=="tooltip"):!1}function As(e,t){var Ht,Qe,wt,Ft;let{openState:n,onDismiss:o,placement:a,content:r,keepOpenOnContentHover:i,openDelay:l,closeDelay:c}=t,{kind:m}=t,s=`floating:${m}`,d=null,f=null,p=null,y=null,g=!1,S=e.domElement,E=e.getRoot(),O=ge(m,e),T={style:{position:"fixed",pointerEvents:"auto",visibility:N=>n.get(N)?"visible":"hidden"},onKeyDown:N=>{N.key==="Escape"&&ie()&&(N.stopPropagation(),F())},onMouseEnter:()=>i&&re(),onMouseLeave:()=>i&&F(),_onMount:N=>{var te;if(p=N.domElement,p.id||(p.id=O),p.setAttribute(hi,m),S&&p&&!p.hasAttribute("data-theme")){let ye=(te=S.closest("[data-theme]"))==null?void 0:te.getAttribute("data-theme");ye&&p.setAttribute("data-theme",ye)}},_portal:N=>{let te=S.closest("dialog");if(te){let me=te.querySelector(Cn);return me||(me=te.ownerDocument.createElement("div"),me.setAttribute(En,""),Object.assign(me.style,{position:"fixed",inset:"0",zIndex:"20",pointerEvents:"none"}),te.appendChild(me)),me}let ye=N.domElement.querySelector(Cn);if(!ye){let me={div:[],[En]:"",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};ye=N.children.insert(me).domElement}return ye}},x=N=>X(N,T);x(r);let D=()=>{g||(g=!0,y=E.children.insert(r),y._behaviorInstances.set(s,se))},_=()=>{y&&(y._behaviorInstances.delete(s),y.remove(),y=null)},C=()=>{g&&(!p||!p.isConnected)&&(f==null||f(),f=null,y=null,p=null,g=!1),D(),S&&p&&(f==null||f(),f=li(S,p,()=>{mi(S,p,{placement:a.get(),middleware:[si(12),ui(),ci()],strategy:"fixed"}).then(({x:N,y:te,placement:ye})=>{p&&(Object.assign(p.style,{left:`${N}px`,top:`${te}px`}),a.set(ye))})}),xn(n,!0))},M=()=>{if(!p)return!1;let te=p.getRootNode().activeElement;return!!te&&p.contains(te)},P=()=>{var ye,me,xt;if(!S)return;(ye=S.focus)==null||ye.call(S);let te=S.getRootNode().activeElement;te&&S.contains(te)||(xt=(me=S.querySelector('input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'))==null?void 0:me.focus)==null||xt.call(me)},V=()=>{f==null||f(),f=null;let N=M();_(),p=null,g=!1,N&&P(),ze(n,o)},re=()=>{d&&clearTimeout(d),d=setTimeout(C,l)},F=()=>{d&&clearTimeout(d),d=setTimeout(V,c)},G=N=>{if(!n.get()||!S||!p)return;let te=N.target;!S.contains(te)&&!p.contains(te)&&F()};(Ht=E.domElement)==null||Ht.addEventListener("click",G);let ie=()=>{var N;return!!p&&((N=p.parentElement)==null?void 0:N.lastElementChild)===p},Y=N=>{N.key==="Escape"&&n.get()&&ie()&&F()},Q=(Ft=(wt=(Qe=E.domElement)==null?void 0:Qe.ownerDocument)!=null?wt:E.domElement)!=null?Ft:null;Q==null||Q.addEventListener("keydown",Y);let ae=N=>{N?g||C():g&&V()},ee=()=>{},le=!1,oe=!1,se,ve=N=>{var te;N._behaviors=A(I({},(te=N._behaviors)!=null?te:{}),{[s]:{attach:()=>se,props:{}}})};return se={show:re,hide:F,panelId:O,update(N){if(!oe&&(o=N.onDismiss,N.openState!==n&&(ee(),n=N.openState,ee=be(n,ae,!1),n.get()&&C()),a=N.placement,r=N.content,i=N.keepOpenOnContentHover,l=N.openDelay,c=N.closeDelay,x(r),ve(r),y)){oe=!0;try{y.patch(r)}finally{oe=!1}}},destroy(){var N;le||(le=!0,d&&clearTimeout(d),d=null,f==null||f(),f=null,_(),p=null,g=!1,ee(),ee=()=>{},(N=E.domElement)==null||N.removeEventListener("click",G),Q==null||Q.removeEventListener("keydown",Y))}},ve(r),ee=be(n,ae),se}function _e(e){var m,s;let{kind:t,placement:n,onDismiss:o}=e,a=yt(e.open),r=`floating:${t}`,i=d=>{var f;return(f=d==null?void 0:d.getBehavior(r))==null?void 0:f.show()},l=d=>{var f;return(f=d==null?void 0:d.getBehavior(r))==null?void 0:f.hide()},c=I({onKeyDown:(d,f)=>d.key==="Escape"&&l(f)},H(r,As,{kind:t,openState:a,onDismiss:o,placement:n,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover,openDelay:(m=e.openDelay)!=null?m:di,closeDelay:(s=e.closeDelay)!=null?s:di}));return{show:i,hide:l,anchorPartial:c,openState:a}}function Ze(e){return e?Array.from(e.querySelectorAll("[role=option]")).filter(t=>t.getAttribute("aria-disabled")!=="true"&&!t.hasAttribute("disabled")):[]}var Ns='<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>',Nt=1.5,zs=6/Nt,fi=2.5/Nt,Bs=1/Nt,pi=4/Nt,Vs=1/Nt;function zt(e={}){var o;let{removable:t=!1}=e,n=v((o=e.color)!=null?o:"neutral","color");return A(I({dataTone:"shift-2"},H("tag-remove",(a,r)=>{let i=()=>a.remove(),l=()=>({span:Fe(Ns),_key:"tag-remove",onClick:s=>{s.stopPropagation(),i()},onKeyDown:s=>{let d=s;d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),d.stopPropagation(),i())},tabindex:0,role:"button",ariaLabel:"Remove",style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s=>h(b(s)*Vs),width:s=>h(b(s)*pi),height:s=>h(b(s)*pi),flexShrink:0,transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover":{backgroundColor:s=>u(s,"shift-4",n.get(s))},"&:focus-visible":{boxShadow:s=>L(s,n.get(s))}}}),c=()=>{var s;return(s=a.children.items.find(d=>d instanceof ne&&d.key==="tag-remove"))!=null?s:null},m=s=>{let d=c();s.removable&&!d?a.children.insert(l()):!s.removable&&d&&a.children.remove(d)};return m(r),{update:m}},{removable:t})),{style:{display:"inline-flex",width:"fit-content",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:a=>h(b(a)*zs),paddingBlock:0,borderRadius:a=>h(b(a)*999),paddingInlineStart:a=>h(b(a)*fi),paddingInlineEnd:a=>h(b(a)*(t?Bs:fi)),gap:h(1.5),fontSize:a=>w(a,"decrease-1"),backgroundColor:a=>u(a,"inherit",n.get(a)),color:a=>u(a,"text",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${u(a,"border-strong",n.get(a))}`}})}function Hs(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=v(e.value),l=v(a),{show:c,hide:m,anchorPartial:s}=_e({kind:"combobox",open:l,onDismiss:e.onDismiss,placement:v(n),content:e.content}),d={onClick:(C,M)=>!r&&m(M),dataTone:"shift-0",style:{backgroundColor:C=>u(C,"inherit"),color:C=>u(C,"text"),borderRadius:C=>h(b(C)*2),outline:C=>`1px solid ${u(C,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}};X(e.content,d);let f=A(I({border:"none",outline:"none",padding:0,margin:0,flex:1,height:h(6),marginInlineStart:h(2),fontSize:C=>w(C,"inherit")},we(o)),{backgroundColor:C=>u(C,"inherit",o)}),p=C=>{var M,P;return(P=(M=C==null?void 0:C.elementNode)==null?void 0:M.getBehavior("comboboxInner"))==null?void 0:P.query},y=C=>{let M=C;for(;M;){if(M._behaviorInstances.has("floating:combobox"))return M;M=M.parent}return C},g=(C,M)=>{var ie,Y;let P=y(C),V=P.getRoot().domElement,re=(ie=V==null?void 0:V.querySelector(`#${ge("combobox",P)}`))!=null?ie:null,F=Ze(re);if(!F.length)return;let G=F[M?F.length-1:0];G.focus(),(Y=G.scrollIntoView)==null||Y.call(G,{block:"nearest"})},S=(C,M)=>{let P;P=be(l,V=>{V&&(P==null||P(),requestAnimationFrame(()=>g(C,M)))},!1),c(C)},O={role:"combobox",ariaHaspopup:"listbox",ariaAutocomplete:"list",ariaExpanded:C=>l.get(C),ariaControls:C=>C!=null&&C.elementNode?ge("combobox",y(C.elementNode)):void 0,onKeyDown:(C,M)=>{let P=C.key;if(!(P!=="ArrowDown"&&P!=="ArrowUp")){if(C.preventDefault(),l.get()){g(M,P==="ArrowUp");return}S(M,P==="ArrowUp")}}},T=C=>C?(X(C,I({onClick:(M,P)=>c(P),style:f,_key:"combobox-input"},O)),C):I({input:null,ariaLabel:"Filter options",onClick:(M,P)=>c(P),value:M=>{var P,V;return(V=(P=p(M))==null?void 0:P.get(M))!=null?V:""},onInput:(M,P)=>{var V;(V=P.getBehavior("comboboxInner"))==null||V.query.set(M.target.value),c(P)},style:f,_key:"combobox-input"},O),x=C=>({div:M=>{l.get(M);let P=C.state.get(M),V=Array.isArray(P)?P:[P],F=C.options.filter(G=>V.includes(G.value)).map(G=>({span:G.label,$:[zt({color:C.color,removable:!0})],_key:G.value,_onRemove:ie=>{let Y=C.state.get(),ae=(Array.isArray(Y)?Y:[Y]).filter(ee=>ee!==G.value);C.multiple?C.state.set(ae):C.state.set(ae[0])}}));return F.push(T(C.input)),F},_key:"comboboxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1)}}),_=A(I({_onInsert:C=>{C.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onSchedule:(C,M)=>{M[C.tagName]=[x({options:t,multiple:r,color:o,state:i,input:e.input})]}},H("comboboxInner",(C,M)=>{let P=C.getMetadata("comboboxQuery");return P||(P=v(""),C.setMetadata("comboboxQuery",P)),{query:P,update(V){C.children.update([x(V)])}}},{options:t,multiple:r,color:o,state:i,input:e.input})),{style:{minWidth:h(32),outlineOffset:"-1px",outline:C=>`1px solid ${u(C,"border-strong","neutral")}`,paddingBlock:C=>h(b(C)*1),paddingInline:C=>h(b(C)*1),borderRadius:C=>h(b(C)*1.5),fontSize:C=>w(C,"inherit"),color:C=>u(C,"text",o),backgroundColor:C=>u(C,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-within":{boxShadow:C=>L(C,o)}}});return X(s,_),s}function Fs(e){return Array.from(e.querySelectorAll("[data-command-item]")).filter(t=>!t.hidden&&!t.hasAttribute("disabled"))}function js(e,t){var m;let n=e.key,o=t.domElement;if(!o)return;let a=Fs(o);if(!a.length)return;let r=o.ownerDocument.activeElement,i=r?a.indexOf(r):-1;if(n==="Enter"){if(i===-1)return;e.preventDefault(),a[i].click();return}let l;if(n==="ArrowDown")l=(i+1)%a.length;else if(n==="ArrowUp")l=i<=0?a.length-1:i-1;else if(n==="Home")l=0;else if(n==="End")l=a.length-1;else return;e.preventDefault();let c=a[l];c.focus(),(m=c.scrollIntoView)==null||m.call(c,{block:"nearest"})}function Ws(){return{role:"group",ariaLabel:"Commands",onKeyDown:js,_onSchedule:(e,t)=>{X(t,{_context:{command:{query:v("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Ks(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,i=()=>a.query.set(r.value);r.addEventListener("input",i),o.addHook("Remove",()=>r.removeEventListener("input",i))},style:A(I({fontSize:o=>w(o,"inherit"),paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*2),border:"none",borderBottom:o=>`1px solid ${u(o,"border",t)}`,outline:"none"},we(t)),{backgroundColor:o=>u(o,"inherit",t),transition:"border-bottom-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{borderBottomColor:o=>u(o,"shift-6",n),boxShadow:o=>L(o,n)}})}}function qs(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{type:"button",dataCommandItem:"",_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,i=c=>{var s,d;if(c.length===0){r.hidden=!1;return}let m=(d=(s=r.textContent)==null?void 0:s.toLowerCase())!=null?d:"";r.hidden=!m.includes(c.toLowerCase())};i(a.query.get());let l=a.query.addListener(i);o.addHook("Remove",l)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>w(o,"inherit"),height:o=>h(6+b(o)*2),paddingInline:o=>h(b(o)*3),border:"none",outline:"none",color:o=>u(o,"shift-13",t),backgroundColor:o=>u(o,"inherit",t),transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:o=>u(o,"shift-13",t),backgroundColor:o=>u(o,"hover",t)},"&:focus-visible":{boxShadow:o=>L(o,n)}}}}var ce=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Je=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),kn=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Bt=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Tn=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,_n=(e,t)=>Je(e,-((e.getDay()-t+7)%7));function Us(e){var t,n;try{let o=new Intl.Locale(e),a=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(a!=null&&a.firstDay)return a.firstDay%7}catch(o){}return 0}function Gs(e,t){let n=t,o=null,a=i=>{o==null||o(),o=i.onChange?i.selection.addListener(l=>i.onChange(l)):null},r=(i,l)=>{i!==l&&i.set(l.get())};return a(n),{update(i){i.selectionIsCallerOwned||r(i.selection,n.selection),r(i.viewYear,n.viewYear),r(i.viewMonth,n.viewMonth),r(i.focused,n.focused),r(i.hovered,n.hovered),r(i.hour,n.hour),r(i.minute,n.minute),r(i.open,n.open),(i.selection!==n.selection||i.onChange!==n.onChange)&&a(i),n=i},destroy(){o==null||o(),o=null}}}function Ys(e={}){var An,Nn,zn,Bn;let{mode:t="single",time:n=!1,min:o,max:a,disabledDate:r,locale:i=typeof navigator!="undefined"?navigator.language:"en-US",format:l,onChange:c}=e,m=(An=e.weekStartsOn)!=null?An:Us(i),s=v((Nn=e.accentColor)!=null?Nn:"primary","accentColor"),d=v((zn=e.placement)!=null?zn:"bottom-start"),f=v((Bn=e.value)!=null?Bn:t==="range"?[null,null]:null),p=(()=>{let k=f.get(),R=t==="range"?k==null?void 0:k[0]:k;return R instanceof Date?R:new Date})(),y=v(p.getFullYear(),"viewYear"),g=v(p.getMonth(),"viewMonth"),S=v(ce(p),"focused"),E=v(null,"hovered"),O=v(p.getHours(),"hour"),T=v(p.getMinutes(),"minute"),x=new Intl.DateTimeFormat(i,I({dateStyle:"medium"},n?{timeStyle:"short"}:{})),D=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),_=new Intl.DateTimeFormat(i,{weekday:"short"}),C=new Intl.DateTimeFormat(i,{dateStyle:"full"}),M=k=>k?x.format(k):"",P=k=>{if(l)return l(k);if(t==="range"){let[R,$]=k!=null?k:[null,null];return R?`${M(R)} \u2013 ${M($)}`:""}return M(k)},V=Array.from({length:7},(k,R)=>_.format(new Date(2023,0,1+(R+m)%7))),re=k=>!!o&&ce(k)<ce(o)||!!a&&ce(k)>ce(a)||!!r&&r(k),F=k=>{if(!n)return ce(k);let R=ce(k);return R.setHours(O.get(),T.get(),0,0),R},G=(k,R)=>{var z;if(re(k))return;if(t==="single"){f.set(F(k)),n||Qe(R);return}let[$,B]=(z=f.get())!=null?z:[null,null];!$||$&&B?f.set([F(k),null]):ce(k)<ce($)?(f.set([F(k),F($)]),n||Qe(R)):(f.set([$,F(k)]),n||Qe(R))},ie=()=>{var k;if(n)if(t==="single"){let R=f.get();R&&f.set(F(R))}else{let[R,$]=(k=f.get())!=null?k:[null,null];f.set([R&&F(R),$&&F($)])}},Y=(k,R)=>{var et;if(t!=="range")return!1;let[$,B]=(et=f.get(R))!=null?et:[null,null],z=B!=null?B:E.get(R);if(!$||!z)return!1;let j=ce($)<=ce(z)?$:z,Se=ce($)<=ce(z)?z:$,fe=ce(k);return fe>=ce(j)&&fe<=ce(Se)},Q=(k,R)=>{let $=f.get(R);if(t==="range"){let[B,z]=$!=null?$:[null,null];return Bt(k,B)||Bt(k,z)}return Bt(k,$)},ae=k=>{y.set(k.getFullYear()),g.set(k.getMonth())},ee=k=>{let R=kn(new Date(y.get(),g.get(),1),k);ae(R)},le=k=>y.set(y.get()+k),oe=k=>{var $;let R=($=k==null?void 0:k.getRoot())==null?void 0:$.domElement;setTimeout(()=>{var B;(B=R==null?void 0:R.querySelector(`[data-date="${Tn(S.get())}"]`))==null||B.focus()},0)},se=ye(),ve=v(!1),{show:Ht,hide:Qe,anchorPartial:wt}=_e({kind:"datePicker",open:ve,placement:d,content:se}),Ft=I({type:"text",readonly:!0,value:k=>P(f.get(k)),role:"combobox",ariaHaspopup:"dialog",ariaExpanded:k=>ve.get(k),ariaControls:k=>k!=null&&k.elementNode?ge("datePicker",k.elementNode):void 0,ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(k,R)=>{N(R)},onKeyDown:(k,R)=>{let $=k.key;($==="ArrowDown"||$==="Enter")&&(k.preventDefault(),N(R))}},H("datePicker",Gs,{selection:f,selectionIsCallerOwned:e.value!==void 0,viewYear:y,viewMonth:g,focused:S,hovered:E,hour:O,minute:T,open:ve,onChange:c}));function N(k){var $;let R=($=te())!=null?$:new Date;S.set(ce(R)),ae(R),Ht(k),oe(k)}function te(){var R;let k=f.get();return t==="range"?(R=k==null?void 0:k[0])!=null?R:null:k!=null?k:null}return X(wt,Ft),wt;function ye(){let k=(j,Se,fe)=>({button:j,type:"button",ariaLabel:Se,onClick:fe,style:Xs()}),R={div:[k("\xAB","Previous year",()=>le(-1)),k("\u2039","Previous month",()=>ee(-1)),{div:j=>D.format(new Date(y.get(j),g.get(j),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:Z("bold"),fontSize:j=>w(j)}},k("\u203A","Next month",()=>ee(1)),k("\xBB","Next year",()=>le(1))],style:{display:"flex",alignItems:"center",gap:h(1),marginBottom:h(2)}},$={div:V.map((j,Se)=>({div:j,style:{textAlign:"center",fontSize:fe=>w(fe,"decrease-1"),fontWeight:Z("bold"),color:fe=>u(fe,"shift-7"),paddingBlock:h(1)},_key:Se})),role:"row",style:gi()},B={div:j=>me(j),role:"grid",ariaLabel:"Calendar",onKeyDown:zi,onMouseLeave:()=>t==="range"&&E.set(null),style:{display:"flex",flexDirection:"column",gap:h(.5)}},z=[R,$,B];return n&&z.push(Ai()),z.push(Ni()),{div:z,role:"dialog",ariaModal:"false",dataTone:"shift-0",style:{minWidth:h(70),padding:h(3),borderRadius:j=>h(b(j)*2),backgroundColor:j=>u(j,"inherit"),color:j=>u(j,"text"),outline:j=>`1px solid ${u(j,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}}}function me(k){let R=new Date(y.get(k),g.get(k),1),$=g.get(k),B=_n(R,m),z=[];for(let j=0;j<6;j++){let Se=[];for(let fe=0;fe<7;fe++){let et=Je(B,j*7+fe);Se.push(xt(et,$,k))}z.push({div:Se,role:"row",style:gi(),_key:j})}return z}function xt(k,R,$){let B=re(k),z=Q(k,$),j=Y(k,$),Se=k.getMonth()!==R,fe=Bt(k,S.get($)),et=Bt(k,new Date);return{button:String(k.getDate()),type:"button",role:"gridcell",tabIndex:fe?0:-1,ariaSelected:z,ariaDisabled:B,disabled:B,ariaLabel:C.format(k),dataDate:Tn(k),onClick:(J,Bi)=>G(k,Bi),onMouseEnter:()=>t==="range"&&E.set(k),style:{appearance:"none",border:"none",cursor:B?"not-allowed":"pointer",aspectRatio:"1",borderRadius:h(1),fontSize:J=>w(J),opacity:B?.35:Se?.5:1,backgroundColor:J=>z?u(J,"shift-13",s.get(J)):j?u(J,"hover",s.get(J)):"transparent",color:J=>z?u(J,"shift-0","neutral"):j?u(J,q(2)):u(J,"text"),outline:et?J=>`1px solid ${u(J,"shift-6",s.get(J))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":I({backgroundColor:J=>z?u(J,"shift-13",s.get(J)):u(J,"shift-3",s.get(J))},z?{}:{color:J=>u(J,q(3))}),transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:J=>L(J,s.get(J))}},_key:Tn(k)}}function Ai(){let k=(R,$,B)=>({select:Array.from({length:R},(z,j)=>({option:String(j).padStart(2,"0"),value:String(j),selected:Se=>$.get(Se)===j,_key:j})),ariaLabel:B,onChange:z=>{$.set(Number(z.target.value)),ie()},style:Zs()});return{div:[k(24,O,"Hour"),{span:":",style:{fontWeight:Z("bold")}},k(60,T,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:h(1),marginTop:h(3)}}}function Ni(){let k=(R,$)=>({button:R,type:"button",onClick:(B,z)=>$(z),style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontSize:B=>w(B,"decrease-1"),color:B=>u(B,"muted",s.get(B)),padding:h(1)}});return{div:[k("Today",R=>{let $=new Date;S.set(ce($)),ae($),oe(R)}),k("Clear",()=>{f.set(t==="range"?[null,null]:null),E.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:h(2),paddingTop:h(2),borderTop:R=>`1px solid ${u(R,"border")}`}}}function zi(k,R){let $=k,B=S.get(),z=null;switch($.key){case"ArrowLeft":z=Je(B,-1);break;case"ArrowRight":z=Je(B,1);break;case"ArrowUp":z=Je(B,-7);break;case"ArrowDown":z=Je(B,7);break;case"Home":z=_n(B,m);break;case"End":z=Je(_n(B,m),6);break;case"PageUp":z=kn(B,$.shiftKey?-12:-1);break;case"PageDown":z=kn(B,$.shiftKey?12:1);break;case"Enter":case" ":$.preventDefault(),G(B,R);return;default:return}$.preventDefault(),S.set(z),ae(z),oe(R)}}function gi(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:h(.5)}}function Xs(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontSize:e=>w(e),color:e=>u(e,"muted"),width:h(7),height:h(7),borderRadius:h(1),"&:hover":{backgroundColor:e=>u(e,"shift-3"),color:e=>u(e,q(3))}}}function Zs(){return{fontSize:e=>w(e),padding:h(1),borderRadius:h(1),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${u(e,"border-strong")}`,backgroundColor:e=>u(e,"inherit"),color:e=>u(e,"text")}}function Js(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${h(24)}, max-content) 1fr`,columnGap:h(4),margin:0,"& dt":{margin:0,fontWeight:Z("semibold"),fontSize:o=>w(o,"inherit"),color:o=>u(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o))}}}}function Qs(e={}){var a,r;let{duration:t=240}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:i=>{i.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:i=>w(i,"inherit"),color:i=>u(i,"text",n.get(i)),backgroundColor:i=>u(i,"inherit",n.get(i)),overflow:"hidden","& > summary":{backgroundColor:i=>u(i,"shift-2",n.get(i)),color:i=>u(i,"shift-11",n.get(i)),fontSize:i=>w(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:h(2),cursor:"pointer",userSelect:"none",fontWeight:Z("medium"),paddingInline:i=>h(b(i)*4),height:h(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:h(2),height:h(2),flexShrink:0,marginTop:h(-.5),borderInlineEnd:i=>`${h(.5)} solid ${u(i,"shift-9",n.get(i))}`,borderBottom:i=>`${h(.5)} solid ${u(i,"shift-9",n.get(i))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>u(i,"shift-3",n.get(i)),color:i=>u(i,q(3),n.get(i))},"& > summary:focus-visible":{borderRadius:i=>h(b(i)*2),boxShadow:i=>L(i,o.get(i))},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:i=>h(b(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:"none",opacity:1,paddingTop:i=>h(b(i)*1),paddingBottom:i=>h(b(i)*3)}}}}var Vt=0;function To(){Vt++,Vt===1&&(document.body.style.overflow="hidden")}function bt(){Vt=Math.max(0,Vt-1),Vt===0&&(document.body.style.overflow="")}var yi='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function ec(e,t){let{state:n,onDismiss:o}=t,a=null,r=!1,i=!1,l=null,c=e.domElement;c.setAttribute("aria-modal","true");let m=()=>{r=!1,typeof c.close=="function"&&c.close(),c.style.visibility="hidden",c.style.pointerEvents="none",c.style.display="none",i&&(bt(),i=!1),a==null||a.focus(),a=null},s=y=>{if(y.key!=="Tab")return;let g=Array.from(c.querySelectorAll(yi)).filter(O=>!O.closest("[aria-hidden='true']")&&O.getClientRects().length>0);if(!g.length){y.preventDefault();return}let S=g[0],E=g[g.length-1];y.shiftKey?(document.activeElement===S||document.activeElement===c)&&(y.preventDefault(),E.focus()):document.activeElement===E&&(y.preventDefault(),S.focus())},d=y=>{y.preventDefault(),!ko(c)&&ze(n,o)};c.addEventListener("cancel",d);let f=y=>{if(y)r=!1,l&&(clearTimeout(l),l=null),a=document.activeElement,c.style.visibility="visible",c.style.pointerEvents="auto",c.style.display="",typeof c.showModal=="function"&&!c.open&&c.showModal(),i||(To(),i=!0),c.addEventListener("keydown",s),requestAnimationFrame(()=>{var S;c.style.opacity="1";let g=(S=c.querySelector("[autofocus]:not([disabled])"))!=null?S:c.querySelector(yi);g==null||g.focus()});else{if(r=!0,c.style.opacity="0",c.removeEventListener("keydown",s),!c.open){m();return}l=setTimeout(()=>{l=null,r&&m()},350)}},p=be(n,f);return{requestClose:()=>ze(n,o),onTransitionEnd:y=>{r&&y.target===c&&y.propertyName==="opacity"&&m()},update(y){o=y.onDismiss,y.state!==n&&(p(),n=y.state,p=be(n,f,!1))},destroy(){l&&(clearTimeout(l),l=null),p(),c.removeEventListener("cancel",d),i&&(bt(),i=!1),c.removeEventListener("keydown",s),a==null||a.focus(),a=null}}}function tc(e={}){let{color:t="neutral",open:n=!1,labelledBy:o,describedBy:a,onDismiss:r}=e,i=yt(n);return A(I({_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')}},H("dialog",ec,{state:i,onDismiss:r})),{ariaLabelledby:o,ariaDescribedby:a,onClick:(l,c)=>{var d;if(l.target!==c.domElement)return;let m=c.domElement.getBoundingClientRect();l.clientX>=m.left&&l.clientX<=m.right&&l.clientY>=m.top&&l.clientY<=m.bottom||(d=c.getBehavior("dialog"))==null||d.requestClose()},onTransitionEnd:(l,c)=>{var m;return(m=c.getBehavior("dialog"))==null?void 0:m.onTransitionEnd(l)},style:{opacity:"0",visibility:"hidden",pointerEvents:"none",transition:"opacity 200ms ease",fontSize:l=>w(l,"inherit"),color:l=>u(l,"shift-10",t),backgroundColor:l=>u(l,"inherit",t),border:"none",borderRadius:l=>h(b(l)*2),padding:l=>h(b(l)*3),boxShadow:U("high"),"&::backdrop":{backgroundColor:l=>u(l,"shift-2","neutral"),opacity:.75}}})}function oc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:h(2),fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>u(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>u(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Dn={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},bi={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},vt=e=>e==="left"||e==="right";function vi(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function nc(e,t){let{state:n,onDismiss:o,placement:a,size:r}=t,i=e.domElement;i.setAttribute("aria-modal","true");let l=E=>{E.preventDefault(),!ko(i)&&ze(n,o)};i.addEventListener("cancel",l);let c=(E,O)=>{let x=(E==="start"||E==="end")&&(i.ownerDocument.documentElement.dir==="rtl"||i.ownerDocument.dir==="rtl"),D=vi(E,x),_=O!=null?O:vt(D)?h(80):h(64);return i.style.margin=bi[D],i.style.width=vt(D)?_:"100dvw",i.style.height=vt(D)?"100dvh":_,D},m=c(a,r),s=!1,d=!1,f=null,p=()=>{f=null,s&&(s=!1,typeof i.close=="function"&&i.close(),i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="none",d&&(bt(),d=!1))},y=E=>{E.target===i&&E.propertyName==="transform"&&p()};i.addEventListener("transitionend",y);let g=E=>{if(E)s=!1,f&&(clearTimeout(f),f=null),i.style.visibility="visible",i.style.pointerEvents="auto",i.style.display="",typeof i.showModal=="function"&&!i.open&&i.showModal(),d||(To(),d=!0),requestAnimationFrame(()=>{i.style.transform="translate(0, 0)"});else{if(s=!0,i.style.transform=Dn[m],!i.open){p();return}f=setTimeout(p,350)}},S=be(n,g);return{requestClose:()=>ze(n,o),update(E){o=E.onDismiss,E.state!==n&&(S(),n=E.state,S=be(n,g,!1)),(E.placement!==a||E.size!==r)&&(a=E.placement,r=E.size,m=c(a,r),n.get()||(i.style.transform=Dn[m]))},destroy(){f&&(clearTimeout(f),f=null),S(),i.removeEventListener("cancel",l),i.removeEventListener("transitionend",y),d&&(bt(),d=!1)}}}function rc(e={}){let{color:t="neutral",open:n=!1,onDismiss:o,placement:a="end",size:r}=e,i=yt(n),l=vi(a,!1),c=vt(l)?h(80):h(64),m=r!=null?r:c;return A(I({_onInsert:s=>{s.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')}},H("drawer",nc,{state:i,onDismiss:o,placement:a,size:r})),{onClick:(s,d)=>{var y;if(s.target!==d.domElement)return;let f=d.domElement.getBoundingClientRect();s.clientX>=f.left&&s.clientX<=f.right&&s.clientY>=f.top&&s.clientY<=f.bottom||(y=d.getBehavior("drawer"))==null||y.requestClose()},style:{transform:Dn[l],visibility:"hidden",pointerEvents:"none",transition:"transform 0.25s ease",fontSize:s=>w(s,"inherit"),color:s=>u(s,"shift-10",t),backgroundColor:s=>u(s,"inherit",t),border:"none",padding:s=>h(b(s)*3),margin:bi[l],width:vt(l)?m:"100dvw",height:vt(l)?"100dvh":m,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:U("high"),"&::backdrop":{backgroundColor:s=>u(s,"shift-2","neutral"),opacity:.75}}})}function ic(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>w(o,"inherit"),fontStyle:"italic",color:o=>u(o,"shift-10",t.get(o))}}}function ac(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:h(3),paddingBlock:h(12),paddingInline:h(6),textAlign:"center",color:o=>u(o,"muted",t.get(o)),"& > :first-child":{color:o=>u(o,"shift-5",t.get(o)),opacity:.9},"& > :nth-child(2)":{color:o=>u(o,"text",t.get(o))}}}}var On="errorBoundaryOriginal";function lc(e){var n;let t=e.getMetadata(On);if(typeof t=="function"){(n=e._childrenRelease)==null||n.call(e),e._setupFunctionChildren(t);return}if(t!=null){e.children.update(Array.isArray(t)?t:[t]);return}e.children.update([])}function sc(e={}){return{_onSchedule:(t,n)=>{t.getMetadata(On)===void 0&&t.setMetadata(On,n[t.tagName])},_onError:(t,n)=>{var r,i;(r=e.onError)==null||r.call(e,n);let o=()=>lc(t),a=typeof e.fallback=="function"?e.fallback(n,o):(i=e.fallback)!=null?i:{div:"An error occurred."};t.children.update([a])}}}var cc={small:8,medium:10,large:14};function uc(e={}){var o,a;let t=v((o=e.color)!=null?o:"primary","color"),n=h(cc[(a=e.size)!=null?a:"medium"]);return{type:"button",_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"],style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>w(r,"inherit"),backgroundColor:r=>u(r,"shift-13",t.get(r)),color:r=>u(r,"shift-0","neutral"),boxShadow:U("low"),transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>u(r,"shift-14",t.get(r)),boxShadow:U("medium")},"&:active:not([disabled])":{backgroundColor:r=>u(r,"shift-15",t.get(r)),boxShadow:U("low")},"&:focus-visible":{boxShadow:r=>`${U("medium")}, ${L(r,t.get(r))}`},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function mc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:h(2),marginInline:0,marginTop:h(3),marginBottom:h(3),color:o=>u(o,"text",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:h(2)},"& figcaption":{fontSize:o=>w(o,"decrease-1"),color:o=>u(o,"muted",t.get(o)),lineHeight:1.45}}}}function dc(e={}){var a;let{layout:t="horizontal"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>h(b(r)*3),paddingBlock:r=>h(b(r)*3),border:"none",borderRadius:r=>h(b(r)*2),fontSize:r=>w(r,"inherit"),backgroundColor:r=>u(r,"inherit",n.get(r)),color:r=>u(r,"text",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:h(4),rowGap:h(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>w(r,"inherit"),fontWeight:Z("semibold"),paddingBlock:r=>h(b(r)*1),borderRadius:r=>h(b(r)*2),color:r=>u(r,"text",n.get(r)),backgroundColor:r=>u(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?0:h(b(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p, input[type=checkbox], input[type=radio], input[type=color])":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > input[type=checkbox], & > input[type=radio], & > input[type=color]":{gridColumn:o?"1":"2",justifySelf:"start"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${h(2)} * -1)`,fontSize:r=>w(r,"decrease-1"),color:r=>u(r,"text",n.get(r))}}}}function hc(e={}){let{columns:t=1,gap:n=4,align:o}=e;return{style:I({display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, minmax(0, 1fr))`:t,gap:a=>h(b(a)*n)},o?{alignItems:o}:{})}}var fc={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function pc(e={}){var o;let t=v((o=e.color)!=null?o:"neutral","color"),n=e.size;return{_onInsert:a=>{["h1","h2","h3","h4","h5","h6"].includes(a.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:a=>u(a,"shift-11",t.get(a)),marginTop:0,marginBottom:h(2),fontSize:a=>{if(n!==void 0)return w(a,n);let r=fc[a.elementNode.tagName]||"inherit";return w(a,r)}}}}function gc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},dataTone:"shift-3",style:{border:0,height:"1px",marginInline:0,marginTop:h(3),marginBottom:h(3),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"text",t.get(o))}}}function yc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:h(4),height:h(4),flexShrink:"0",fontSize:o=>w(o),backgroundColor:"transparent",color:o=>u(o,"text",t.get(o))}}}function bc(e){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{alt:e.decorative?"":e.alt,dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:h(2),backgroundColor:o=>u(o,"inherit",t.get(o)),color:o=>u(o,"text",t.get(o))}}}function vc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>w(r,"inherit"),color:r=>u(r,"text",t.get(r)),display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:h(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,color:r=>u(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>u(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${u(r,"shift-6",n.get(r))}`,backgroundColor:r=>u(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>u(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${h(.5)} solid ${u(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${u(r,"shift-6",n.get(r))}`,backgroundColor:r=>u(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>u(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>u(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:h(1.5),boxShadow:r=>L(r,n.get(r))},"&[disabled]":{cursor:"not-allowed",opacity:.7},"&[disabled]::before":{pointerEvents:"none",outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,backgroundColor:r=>u(r,"inherit","neutral")},"&[disabled]:checked::before":{backgroundColor:r=>u(r,"shift-8","neutral")},"&[disabled]:indeterminate::before":{backgroundColor:r=>u(r,"shift-3","neutral")},"&[disabled]:checked::after":{pointerEvents:"none",borderColor:r=>u(r,"shift-0","neutral")},"&[disabled]:indeterminate::after":{pointerEvents:"none",backgroundColor:r=>u(r,"shift-8","neutral")}}}}function Sc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{type:"color",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag')},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),paddingBlock:o=>h(b(o)*1),paddingInline:o=>h(b(o)*1),blockSize:o=>h(6+b(o)*2),inlineSize:o=>h(6+b(o)*2),backgroundColor:"transparent",transition:"box-shadow 140ms ease",borderRadius:o=>h(b(o)*1.5),"&:focus-visible":{boxShadow:o=>L(o,t.get(o))},"&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>h(b(o)*1.5)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>u(o,"shift-2","neutral"),outline:o=>`1px solid ${u(o,"border-strong","neutral")}`}}}}function wc(e={}){var a,r;let{mode:t="datetime-local"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag')},style:{fontSize:i=>w(i,"inherit"),lineHeight:"inherit",color:i=>u(i,"text",n.get(i)),backgroundColor:i=>u(i,"inherit",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${u(i,"border-strong",n.get(i))}`,borderRadius:i=>h(b(i)*1.5),paddingInline:i=>h(b(i)*3),height:i=>h(6+b(i)*2),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${u(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>L(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>u(i,"muted","neutral"),backgroundColor:i=>u(i,"shift-2","neutral"),outline:i=>`1px solid ${u(i,"border-strong","neutral")}`},"&:invalid":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`}}}}function xc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"file",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag')},style:{display:"inline-flex",alignItems:"center",fontSize:r=>w(r,"inherit"),lineHeight:"inherit",color:r=>u(r,"text",t.get(r)),backgroundColor:r=>u(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,borderRadius:r=>h(b(r)*1.5),height:r=>h(6+b(r)*2),paddingInline:r=>h(b(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-file-upload-button":{marginTop:r=>h(b(r)),fontSize:"inherit",border:"none",borderRadius:h(1),height:h(6),paddingInline:h(2),cursor:"pointer",color:r=>u(r,"shift-11",t.get(r)),backgroundColor:r=>u(r,"surface",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${u(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>u(r,"muted","neutral"),outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,backgroundColor:r=>u(r,"surface","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>u(r,"muted","neutral"),backgroundColor:r=>u(r,"shift-3","neutral")}}}}function Ec(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"number",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag')},style:A(I({lineHeight:"inherit",minWidth:h(10),paddingInlineStart:r=>h(b(r)*3),paddingInlineEnd:r=>h(b(r)*1.5),paddingBlock:r=>h(b(r)*1),borderRadius:r=>h(b(r)*1.5),fontSize:r=>w(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`},we(t)),{backgroundColor:r=>u(r,"inherit",t.get(r)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${u(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>u(r,"shift-2","neutral"),outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,color:r=>u(r,"muted","neutral")}})}}function Cc(){return{role:"group",ariaLabel:"One-time password",style:{display:"flex",alignItems:"center",gap:h(2),"& > input":{minWidth:h(9)}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=i=>{if(i.isComposing)return;let l=n(),c=i.target,m=l.indexOf(c);c.value&&m<l.length-1&&l[m+1].focus()},a=i=>{if(i.isComposing)return;let l=n(),c=i.target,m=l.indexOf(c);i.key==="Backspace"&&!c.value&&m>0&&l[m-1].focus(),i.key==="ArrowLeft"&&m>0&&(i.preventDefault(),l[m-1].focus()),i.key==="ArrowRight"&&m<l.length-1&&(i.preventDefault(),l[m+1].focus())},r=i=>{var f,p,y;i.preventDefault();let l=(p=(f=i.clipboardData)==null?void 0:f.getData("text"))!=null?p:"",c=n(),m=c.indexOf(i.target),s=m===-1?0:m;[...l].forEach((g,S)=>{let E=c[s+S];E&&(E.value=g,E.dispatchEvent(new Event("input",{bubbles:!0})),E.dispatchEvent(new Event("change",{bubbles:!0})))});let d=Math.min(s+l.length-1,c.length-1);(y=c[d])==null||y.focus()};t.addEventListener("input",o),t.addEventListener("keydown",a),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",a),t.removeEventListener("paste",r)})}}}var kc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>',Tc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>',_c=["name","value","onInput","disabled","required"];function Si(e){if(e!=null)return typeof e=="function"?e:he(e)?t=>e.get(t):e}function Dc(e={}){var r,i;let t=v((r=e.color)!=null?r:"neutral","color"),n=v((i=e.accentColor)!=null?i:"primary","accentColor"),o=v(!1),a={};return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onSchedule:(l,c)=>{let m=c;for(let s of _c)m[s]!==void 0&&(a[s]=m[s],delete m[s])},_onInit:l=>{var g,S,E,O,T,x,D;let c=(g=e.name)!=null?g:a.name,m=Si((S=e.value)!=null?S:a.value),s=(E=e.onInput)!=null?E:a.onInput,d=Si((O=e.disabled)!=null?O:a.disabled),f=(T=e.required)!=null?T:a.required,p=A(I(I(I(I(I({input:null,type:_=>o.get(_)?"text":"password",ariaLabel:(x=e.ariaLabel)!=null?x:"Password",autocomplete:(D=e.autocomplete)!=null?D:"current-password"},c!=null?{name:c}:{}),m!=null?{value:m}:{}),s!=null?{onInput:s}:{}),d!=null?{disabled:d}:{}),f!=null?{required:f}:{}),{style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}}),y={button:_=>Fe(o.get(_)?Tc:kc),type:"button",ariaLabel:_=>o.get(_)?"Hide password":"Show password",onClick:()=>o.set(!o.get()),style:{background:"none",border:"none",padding:0,margin:0,cursor:"pointer",color:"inherit",fontSize:_=>w(_,"inherit"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,minWidth:h(6),minHeight:h(6),marginInlineEnd:_=>`calc(${h(b(_)*1)} * -1)`,opacity:.6}};l.children.insert(p),l.children.insert(y)},style:{display:"flex",alignItems:"center",gap:l=>h(b(l)*1),paddingBlock:l=>h(b(l)*1),paddingInline:l=>h(b(l)*3),borderRadius:l=>h(b(l)*1.5),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${u(l,"border-strong",t.get(l))}`,color:l=>u(l,fn,t.get(l)),backgroundColor:l=>u(l,"inherit",t.get(l)),fontSize:l=>w(l,"inherit"),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not(:has([disabled])):not(:focus-within)":{outline:l=>`1px solid ${u(l,"shift-5",n.get(l))}`},"&:focus-within":{boxShadow:l=>L(l,n.get(l))}}}}function Oc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"radio",_onInsert:r=>{if(r.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:r=>w(r,"inherit"),color:r=>u(r,"text",t.get(r)),appearance:"none",display:"inline-flex",position:"relative",width:h(6),height:h(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:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,color:r=>u(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>u(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${u(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>u(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>u(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",boxShadow:r=>L(r,n.get(r))},"&[disabled]":{cursor:"not-allowed",opacity:.7},"&[disabled]::before":{pointerEvents:"none",outline:r=>`1px solid ${u(r,"border-strong","neutral")}`,backgroundColor:r=>u(r,"inherit","neutral")},"&[disabled]:checked::after":{pointerEvents:"none",backgroundColor:r=>u(r,"shift-8","neutral")}}}}function Lc(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"range",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>w(r,"inherit"),width:"100%",margin:0,padding:0,height:h(6),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:h(1.5),borderRadius:h(999),backgroundColor:r=>u(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:h(4),height:h(4),borderRadius:h(999),border:"none",marginTop:`calc((${h(1.5)} - ${h(4)}) / 2)`,backgroundColor:r=>u(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>u(r,"shift-10",n.get(r))},"&::-moz-range-track":{height:h(1.5),borderRadius:h(999),backgroundColor:r=>u(r,"shift-3",t.get(r))},"&::-moz-range-thumb":{width:h(4),height:h(4),borderRadius:h(999),border:"none",backgroundColor:r=>u(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:r=>u(r,"shift-10",n.get(r))},borderRadius:h(2),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ic(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"search",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag')},style:A(I({fontSize:r=>w(r,"inherit"),lineHeight:"inherit"},we(t)),{backgroundColor:r=>u(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${u(r,"border-strong",t.get(r))}`,borderRadius:r=>h(b(r)*1.5),minWidth:h(32),paddingInline:r=>h(b(r)*3),paddingBlock:r=>h(b(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${u(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>u(r,"muted","neutral"),backgroundColor:r=>u(r,"shift-2","neutral"),outline:r=>`1px solid ${u(r,"border-strong","neutral")}`}})}}function Pc(e={}){var n;let t=v((n=e.accentColor)!=null?n:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>w(o,"inherit"),backgroundColor:"transparent",color:o=>u(o,"text"),appearance:"none",position:"relative",display:"inline-flex",width:h(9),height:h(6),cursor:"pointer",margin:"0",transition:"box-shadow 140ms ease",borderRadius:h(999),"&:focus-visible":{boxShadow:o=>L(o,t.get(o))},"&:checked":{"&::before":{backgroundColor:o=>u(o,"increase-3",t.get(o))},"&::after":{insetInlineStart:`calc(100% - ${h(5.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:h(5),height:h(5),borderRadius:h(999),insetInlineStart:h(.5),top:"50%",transform:"translateY(-50%)",transition:"inset-inline-start 0.3s",backgroundColor:o=>u(o,"decrease-3"),outline:o=>`1px solid ${u(o,"shift-7")}`,outlineOffset:"-1px"},"&::before":{content:'""',width:"100%",borderRadius:h(999),display:"inline-block",fontSize:o=>w(o,"inherit"),lineHeight:1,backgroundColor:o=>u(o,"inherit"),outline:o=>`1px solid ${u(o,"shift-7")}`,outlineOffset:"-1px"},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Mc(e={}){var a,r;let{type:t="text"}=e,n=v((a=e.color)!=null?a:"neutral","color"),o=v((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type')},style:A(I({lineHeight:"inherit",minWidth:h(10),paddingInline:i=>h(b(i)*3),paddingBlock:i=>h(b(i)*1),borderRadius:i=>h(b(i)*1.5),fontSize:i=>w(i,"inherit"),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${u(i,"border-strong",n.get(i))}`},we(n)),{backgroundColor:i=>u(i,"inherit",n.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${u(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>L(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:i=>u(i,"shift-2","neutral"),outline:i=>`1px solid ${u(i,"border-strong","neutral")}`,color:i=>u(i,"muted","neutral")},"&[placeholder]:invalid:not(:placeholder-shown)":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`},"&[data-status=error]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","warning")}`}})}}function Rc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>w(o,"inherit"),fontFamily:We("monospace"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),paddingBlock:o=>h(b(o)*(.5/1.5)),paddingInline:o=>h(b(o)*(1.5/1.5)),borderRadius:o=>h(b(o)*(1/1.5)),outline:o=>`1px solid ${u(o,"border-strong",t.get(o))}`}}}function $c(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:h(2),fontSize:r=>w(r,"inherit"),color:r=>u(r,"text",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>u(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>u(r,"muted","neutral")}}}}function Ac(e={}){var o,a;let t=v((o=e.color)!=null?o:"primary","color"),n=v((a=e.accentColor)!=null?a:"secondary","accentColor");return{role:"link",tabIndex:0,_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag'),r.attributes.has("href")&&(r.attributes.get("role")==="link"&&r.attributes.remove("role"),r.attributes.get("tabIndex")===0&&r.attributes.remove("tabIndex"))},onClick:(r,i)=>{let l=i.domElement;(l!=null&&l.hasAttribute("disabled")||(l==null?void 0:l.getAttribute("aria-disabled"))==="true")&&r.preventDefault()},onKeyDown:(r,i)=>{var c;if(i.attributes.has("href"))return;let l=r.key;l!=="Enter"&&l!==" "||(r.preventDefault(),(c=i.domElement)==null||c.click())},style:{fontSize:r=>w(r,"inherit"),backgroundColor:r=>u(r),color:r=>u(r,"shift-13",t.get(r)),textDecoration:"none","&:visited":{color:r=>u(r,"shift-13",n.get(r))},"&:hover:not([disabled])":{color:r=>u(r,"shift-14",t.get(r)),textDecoration:"underline"},borderRadius:h(1),outline:"none",transition:"color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>L(r,n.get(r))},"&[disabled], &[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:r=>u(r,"muted","neutral")}}}}var Nc={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}},zc={small:.5,medium:1,large:1.5};function Bc(e={}){var l,c,m;let t=(l=e.variant)!=null?l:"outline",n=v((c=e.color)!=null?c:t==="ghost"?"neutral":"primary","color"),o=(m=e.size)!=null?m:"medium",a=ht[o];if(t==="ghost"){let s=zc[o];return{_onInsert:d=>{d.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:d=>w(d,a),textDecoration:"none",paddingBlock:d=>h(b(d)*s),paddingInline:d=>h(b(d)*s),borderRadius:d=>h(b(d)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:d=>h(b(d)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:d=>u(d,"text",n.get(d)),"&:hover:not([aria-disabled=true])":{color:d=>u(d,q(2),n.get(d)),backgroundColor:d=>u(d,"hover",n.get(d)),textDecoration:"none"},"&:active:not([aria-disabled=true])":{color:d=>u(d,q(2),n.get(d)),backgroundColor:d=>u(d,"increase-2",n.get(d))},"&:focus-visible":{boxShadow:d=>L(d,n.get(d))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:d=>u(d,"border-strong","neutral")}}}}let r=t==="solid",i=Nc[o];return A(I({_onInsert:s=>{s.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')}},r?{_doctorDisable:["tone-background-inherit"]}:{}),{style:{fontSize:s=>w(s,a),textDecoration:"none",paddingBlock:s=>h(b(s)*i.block),paddingInline:s=>h(b(s)*i.inline),borderRadius:s=>h(b(s)*1.5),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:s=>h(b(s)*1),userSelect:"none",cursor:"pointer",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:r?"none":s=>`1px solid ${u(s,"border-strong",n.get(s))}`,color:s=>r?u(s,"shift-0","neutral"):u(s,"shift-13",n.get(s)),backgroundColor:s=>r?u(s,"shift-13",n.get(s)):u(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([aria-disabled=true])":{textDecoration:"none",color:s=>r?u(s,"shift-0","neutral"):u(s,"shift-14",n.get(s)),backgroundColor:s=>r?u(s,"shift-14",n.get(s)):u(s,"hover",n.get(s))},"&:active:not([aria-disabled=true])":{backgroundColor:s=>r?u(s,"shift-15",n.get(s)):u(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>L(s,n.get(s))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:s=>u(s,"shift-2","neutral"),outline:s=>`1px solid ${u(s,"border-strong","neutral")}`,color:s=>u(s,"muted","neutral")}}})}function Vc(e={}){var n;let t=(n=e.color)!=null?n:"neutral";return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",backgroundColor:o=>u(o,"inherit",t),color:o=>u(o,"text",t)}}}function Hc(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>h(b(n)*2),paddingBlock:n=>h(t?1:b(n)*2),paddingInline:n=>h(b(n)*3),fontSize:n=>w(n,"inherit"),color:n=>u(n,"text")}}}function Fc(e={}){var a,r;let t=v((a=e.color)!=null?a:"neutral","color"),n=(r=e.accentColor)!=null?r:"primary",{dense:o=!1}=e;return{type:"button",style:{cursor:"pointer",appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"start",display:"flex",alignItems:"center",width:"100%",gap:i=>h(b(i)*2),paddingBlock:i=>h(o?1:b(i)*2),paddingInline:i=>h(b(i)*3),fontSize:i=>w(i,"inherit"),color:i=>u(i,"text",t.get(i)),borderRadius:i=>h(b(i)*1.5),transition:"background-color 150ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:i=>u(i,q(2),t.get(i)),backgroundColor:i=>u(i,"hover",t.get(i))},"&:active:not([disabled])":{color:i=>u(i,q(2),t.get(i)),backgroundColor:i=>u(i,"increase-2",t.get(i))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:i=>u(i,"shift-3",n),color:i=>u(i,"shift-12",n)},"&:focus-visible":{boxShadow:i=>L(i,n)},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function jc(e={}){var n;let t=v((n=e.accentColor)!=null?n:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),height:o=>h(b(o)*(6/1.5)),borderRadius:o=>h(b(o)*(1/1.5)),paddingInline:o=>h(b(o)*(1.5/1.5))}}}function Wc(e={items:[]}){var d;let{items:t=[],selectable:n=!0,color:o="neutral",accentColor:a="primary"}=e,r=v((d=e.activeKey)!=null?d:null),i=e.activeKey!==void 0,l=(f,p)=>{var E;let y=f.focusedKey.get(p);if(y!==null)return y;let g=f.selectable?f.activeKey.get(p):null;if(g!==null)return g;let S=f.items[0];return S?(E=S.key)!=null?E:0:null},c=(f,p)=>{let y=f.nodeId;return p.items.map((g,S)=>{var O;let E=(O=g.key)!=null?O:S;return A(I({button:typeof g.label=="string"?[{span:g.label}]:[g.label],_key:E,type:"button",id:`menuitem${y}${E}`,role:"menuitem",tabIndex:T=>l(p,T)===E?0:-1,onFocus:()=>p.focusedKey.set(E)},p.selectable?{ariaCurrent:T=>p.activeKey.get(T)===E||void 0}:{}),{onClick:()=>{var T;p.selectable&&p.activeKey.set(E),(T=g.onClick)==null||T.call(g)},onKeyDown:T=>{var P;let x=T.key;if(x==="Enter"||x===" "){T.preventDefault(),T.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(x))return;T.preventDefault();let D=p.items.map((V,re)=>{var F;return(F=V.key)!=null?F:re}),_=D.indexOf(E),C=_;x==="ArrowDown"?C=(_+1)%D.length:x==="ArrowUp"?C=(_-1+D.length)%D.length:x==="Home"?C=0:x==="End"&&(C=D.length-1);let M=T.target.closest("[role=menu]");(P=M==null?void 0:M.querySelectorAll("[role=menuitem]")[C])==null||P.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:h(2),width:"100%",fontSize:T=>w(T,"inherit"),height:T=>h(6+b(T)*2),paddingInline:T=>h(b(T)*3),border:"none",outline:"none",color:T=>u(T,"text",p.color),backgroundColor:T=>u(T,"inherit",p.color),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:T=>u(T,"hover",p.color),color:T=>u(T,q(2),p.color)},"&[aria-current=true]":{backgroundColor:T=>u(T,"shift-3",p.accentColor),color:T=>u(T,"shift-13",p.accentColor)},"&:focus-visible":{boxShadow:T=>L(T,p.accentColor)}}})})},m=(f,p)=>{p.focusedKey.set(null);let y=p;return{update(g){g.activeKey!==y.activeKey&&!g.activeKeyIsCallerOwned&&g.activeKey.set(y.activeKey.get()),g.focusedKey!==y.focusedKey&&g.focusedKey.set(y.focusedKey.get()),y=g,y.items.length!==0&&f.children.update(c(f,y))}}},s={items:t,activeKey:r,activeKeyIsCallerOwned:i,selectable:n,color:o,accentColor:a,focusedKey:v(null)};return A(I({role:"menu",dataTone:"shift-0",_onSchedule:(f,p)=>{t.length!==0&&(p[f.tagName]=c(f,s))}},H("menu",m,s)),{style:{display:"flex",flexDirection:"column",paddingBlock:f=>h(b(f)*2),paddingInline:f=>h(b(f)*2),fontSize:f=>w(f,"inherit"),backgroundColor:f=>u(f,"inherit",o),color:f=>u(f,"text",o),borderRadius:f=>h(b(f)*2),outline:f=>`1px solid ${u(f,"border-strong",o)}`,outlineOffset:"-1px",boxShadow:U("medium")}})}function St(){if(typeof matchMedia!="function")return!1;try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch(e){return!1}}var wi=e=>!!e&&typeof e.get=="function"&&e._isState===!0,De=e=>{let t={},n=[];for(let o in e){let a=e[o];o==="x"?n.push(`translateX(${typeof a=="number"?`${a}px`:a})`):o==="y"?n.push(`translateY(${typeof a=="number"?`${a}px`:a})`):o==="scale"?n.push(`scale(${a})`):o==="rotate"?n.push(`rotate(${typeof a=="number"?`${a}deg`:a})`):t[o]=a}return n.length&&(t.transform=n.join(" ")),t};function Ln(e={}){var t,n,o,a;return{duration:(t=e.duration)!=null?t:300,delay:(n=e.delay)!=null?n:0,easing:(o=e.easing)!=null?o:"ease",iterations:(a=e.iterations)!=null?a:1,fill:"both"}}function Kc(e,t){let n=e.domElement,o=t,a,r=l=>{a==null||a(),a=void 0,!(!n||!wi(l))&&(a=l.addListener(c=>{St()?Object.assign(n.style,De(c)):typeof n.animate=="function"&&n.animate([De(c)],Ln(o.transition))}))},i=(l,c)=>{if(!n)return;let m=wi(l.animate)?l.animate.get():l.animate;if(St()){m?Object.assign(n.style,De(m)):c==="enter"&&l.initial&&Object.assign(n.style,De(l.initial));return}if(typeof n.animate=="function")if(m){let s=c==="enter"&&l.initial?[De(l.initial),De(m)]:[De(m)];n.animate(s,Ln(l.transition))}else c==="enter"&&l.initial&&Object.assign(n.style,De(l.initial))};return i(t,"enter"),r(t.animate),{play:i,getExit:()=>o.exit,getTransition:()=>o.transition,update(l){o=l,i(l,"update"),r(l.animate)},destroy(){a==null||a()}}}function qc(e={}){return A(I({},H("motion",(t,n)=>Kc(t,n),e)),{_onBeforeRemove:(t,n)=>{var i,l;let o=t.domElement,a=t.getBehavior("motion"),r=(i=a==null?void 0:a.getExit())!=null?i:e.exit;if(!o||!r||typeof o.animate!="function")return n();if(St())return Object.assign(o.style,De(r)),n();o.animate([De(r)],Ln((l=a==null?void 0:a.getTransition())!=null?l:e.transition)).finished.then(n,n)}})}function Uc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingInlineStart:h(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Gc(e,t){if(t<=7)return Array.from({length:t},(r,i)=>i+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),a=Math.min(t-1,e+1);for(let r=o;r<=a;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function Yc(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function xi(e,t){let n=e.getMetadata("paginationTotal");return n||(n=v(t),e.setMetadata("paginationTotal",n)),n}function Xc(e){let{total:t,color:n="neutral",accentColor:o="primary"}=e,a={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:i=>h(6+b(i)*2),height:i=>h(6+b(i)*2),paddingInline:i=>h(b(i)*2),borderRadius:i=>h(b(i)*1.5),border:"none",cursor:"pointer",fontSize:i=>w(i,"inherit"),backgroundColor:"transparent",color:i=>u(i,"shift-13",n),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled])":{color:i=>u(i,"shift-13",n),backgroundColor:i=>u(i,"hover",n)},"&:focus-visible":{boxShadow:i=>L(i,o)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},r=A(I({},a),{backgroundColor:i=>u(i,"shift-13",o),color:i=>u(i,"shift-0","neutral"),fontWeight:Z("bold"),cursor:"default","&:hover:not([disabled])":{backgroundColor:i=>u(i,"shift-13",o)}});return A(I({role:"navigation",ariaLabel:"Pagination",_onInsert:i=>{i.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:i=>{let l=Yc(i,"paginationPage",e.value,1),c=xi(i,t),m={div:s=>{let d=l.get(s),f=c.get(s),p=[];p.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&l.set(d-1),style:a});let y=0;for(let g of Gc(d,f))if(g==="...")p.push({span:"\u2026",_key:`ellipsis-${y++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:S=>h(b(S)*2),color:S=>u(S,"shift-7",n)}});else{let S=g===d;p.push({button:String(g),_key:`page-${g}`,type:"button",ariaLabel:`Page ${g}`,ariaCurrent:S?"page":void 0,onClick:()=>l.set(g),style:S?r:a})}return p.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:d>=f,onClick:()=>d<f&&l.set(d+1),style:a}),p},style:{display:"flex",alignItems:"center",gap:h(1)}};i.children.insert(m)}},H("pagination-total",i=>({update(l){xi(i,l.total).set(l.total)}}),{total:t})),{style:{display:"inline-flex"}})}function Zc(e={}){var a;let{padding:t=4,divider:n=!1}=e,o=v((a=e.color)!=null?a:"neutral","color");return{style:I({padding:r=>h(b(r)*t)},n?{borderBottom:r=>`1px solid ${u(r,"border",o.get(r))}`,color:r=>u(r,"text")}:{})}}function Jc(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}var Qc=new Set(["dialog","grid","listbox","menu","tree"]);function eu(e){var o;let t;for(let a of(o=e.$)!=null?o:[]){let r=a==null?void 0:a.role;typeof r=="string"&&(t=r)}let n=e.role;return typeof n=="string"&&(t=n),typeof t!="string"?"dialog":t==="alertdialog"||t==="menubar"?t==="menubar"?"menu":"dialog":t==="treegrid"?"grid":Qc.has(t)?t:"dialog"}function tu(e){if(typeof e.dataTone=="string")return!0;let n=e.$;return n?n.some(o=>o!=null&&typeof o.dataTone=="string"):!1}function ou(e){var d;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,a=v(t),r=v(n),{show:i,hide:l,anchorPartial:c}=_e({kind:"popover",open:a,onDismiss:e.onDismiss,placement:r,content:e.content,keepOpenOnContentHover:o==="hover"}),m={role:"dialog",dataTone:"shift-0",style:{backgroundColor:f=>u(f,"inherit"),color:f=>u(f,"text"),borderRadius:f=>h(b(f)*2),outline:f=>`1px solid ${u(f,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}};tu(e.content)||((d=e.content).$||(d.$=[]),e.content.$.push(m));let s={ariaHaspopup:eu(e.content),ariaExpanded:f=>a.get(f),ariaControls:f=>f!=null&&f.elementNode?ge("popover",f.elementNode):void 0,onMouseEnter:(f,p)=>o==="hover"&&i(p),onMouseLeave:(f,p)=>o==="hover"&&l(p),onClick:(f,p)=>{o==="click"&&(a.get()?l(p):i(p))},onKeyDown:(f,p)=>{f.key==="Escape"&&a.get()&&l(p)},onFocus:(f,p)=>o==="hover"&&i(p),onBlur:(f,p)=>{if(o!=="hover")return;let y=f.relatedTarget,S=p.getRoot().domElement.querySelector(`#${ge("popover",p)}`);y&&(S!=null&&S.contains(y))||l(p)}};return X(c,s),c}function In(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=h(6),bordered:a=!0}=e,r=v(t),i={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=s=>{var d;return(d=i[r.get(s)])!=null?d:i["bottom-end"]},c=s=>s.includes("start")?o:s.includes("end")?"auto":"50%",m=s=>s.includes("end")?o:s.includes("start")?"auto":"50%";return{style:{fontSize:s=>w(s),backgroundColor:s=>u(s),color:s=>u(s,"text",n),position:"relative","&::after":{content:'""',position:"absolute",width:h(1.5),height:h(1.5),backgroundColor:s=>u(s,"inherit",n),borderWidth:a?"1px":0,borderColor:s=>u(s,"border-strong",n),borderTopStyle:s=>{let d=l(s);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:s=>{let d=l(s);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:s=>{let d=l(s);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:s=>{let d=l(s);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:s=>{let d=l(s);return d.includes("top")?0:d.includes("bottom")?"auto":c(d)},right:s=>{let d=l(s);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:s=>{let d=l(s);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:s=>{let d=l(s);return d.includes("left")?0:d.includes("right")?"auto":c(d)},transform:s=>{let d=l(s),f=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",p=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${f},${p}) rotate(45deg)`}}}}}function nu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>w(o,"inherit"),fontFamily:We("monospace"),color:o=>u(o,"text",t.get(o)),backgroundColor:o=>u(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>h(b(o)*2),paddingInline:o=>h(b(o)*3),borderRadius:o=>h(b(o)*2)}}}function ru(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),n=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},dataTone:"shift-3",style:{appearance:"none",width:"100%",height:h(2),border:0,borderRadius:h(999),overflow:"hidden",backgroundColor:r=>u(r,"inherit",t.get(r)),color:r=>u(r,"text",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>u(r,"inherit",t.get(r)),borderRadius:h(999)},"&::-webkit-progress-value":{backgroundColor:r=>u(r,"shift-9",n.get(r)),borderRadius:h(999),transition:"width 220ms ease"}}}}function Pn(e){return!e||typeof getComputedStyle!="function"?!1:getComputedStyle(e).direction==="rtl"}function Oe(e,t){return e!=="ArrowRight"&&e!=="ArrowLeft"?0:e==="ArrowRight"!==Pn(t)?1:-1}var iu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',au='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function Ei(e,t){var n,o,a;e.onChange=t.onChange,e.readOnly=(n=t.readOnly)!=null?n:!1,e.max=(o=t.max)!=null?o:5,e.color=(a=t.color)!=null?a:"warning",he(t.value)?t.value!==e.valueState&&e.valueState.set(t.value.get()):t.value!==void 0&&e.valueState.set(t.value)}function lu(e,t,n,o){let a=i=>{let l=o.get(i);return l>0?l:n.valueState.get(i)},r={button:i=>Fe(t<=a(i)?iu:au),_key:t,type:"button",ariaLabel:`${t} star${t>1?"s":""}`,role:"radio",ariaChecked:i=>n.valueState.get(i)===t,tabindex:i=>{let l=n.valueState.get(i);return(l===0?1:l)===t?0:-1},onClick:()=>{var l;if(n.readOnly)return;let i=t===n.valueState.get()?0:t;n.valueState.set(i),(l=n.onChange)==null||l.call(n,i),o.set(0)},onMouseEnter:()=>{n.readOnly||o.set(t)},onMouseLeave:()=>o.set(0),onKeyDown:i=>{var s,d,f;if(n.readOnly)return;let l=n.valueState.get(),c=l;if(i.key==="ArrowUp")c=Math.min(n.max,l+1),i.preventDefault();else if(i.key==="ArrowDown")c=Math.max(0,l-1),i.preventDefault();else if(i.key==="ArrowRight"||i.key==="ArrowLeft")c=Oe(i.key,i.target)>0?Math.min(n.max,l+1):Math.max(0,l-1),i.preventDefault();else if(i.key==="Home")c=1,i.preventDefault();else if(i.key==="End")c=n.max,i.preventDefault();else return;n.valueState.set(c),(s=n.onChange)==null||s.call(n,c);let m=c>0?c-1:0;(f=(d=e.domElement)==null?void 0:d.children[m])==null||f.focus()},style:{background:"none",border:"none",outline:"none",borderRadius:h(1),padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center",justifyContent:"center",minWidth:h(6),minHeight:h(6),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:i=>L(i,n.color)}}};e.children.insert(r)}function Mn(e,t,n){let o=e.children.items;for(;o.length>t.max;)e.children.remove(o[o.length-1]);for(let a=o.length+1;a<=t.max;a++)lu(e,a,t,n)}function su(e={}){var o,a,r,i,l,c,m;let t={valueState:v((o=e.value)!=null?o:0),onChange:e.onChange,readOnly:(a=e.readOnly)!=null?a:!1,max:(r=e.max)!=null?r:5,color:(i=e.color)!=null?i:"warning"},n=v(0);return A(I({role:"radiogroup",ariaLabel:"Rating",ariaReadonly:t.readOnly?"true":void 0,style:{display:"inline-flex",gap:h(.5),fontSize:s=>w(s,"increase-1"),cursor:t.readOnly?"default":"pointer",color:s=>u(s,"muted",t.color)}},H("rating",(s,d)=>(Ei(t,d),Mn(s,t,n),{update(f){Ei(t,f),Mn(s,t,n)}}),{value:e.value,max:(l=e.max)!=null?l:5,onChange:e.onChange,readOnly:(c=e.readOnly)!=null?c:!1,color:(m=e.color)!=null?m:"warning"})),{_onInit:s=>{Mn(s,t,n)}})}function cu(e={}){var c,m,s;let{size:t=16,thickness:n=.25}=e,o=v((c=e.value)!=null?c:0,"value"),a=v((m=e.color)!=null?m:"primary","color"),r=v((s=e.trackColor)!=null?s:"neutral","trackColor"),i=Math.round((1-n)*100),l=`radial-gradient(circle closest-side, transparent ${i}%, black ${i}%)`;return{role:"progressbar",ariaValuenow:d=>String(Math.round(o.get(d))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:d=>{d.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:h(t),height:h(t),borderRadius:"50%",color:d=>u(d,"shift-9",a.get(d)),background:d=>`conic-gradient(from -90deg, ${u(d,"shift-9",a.get(d))} ${o.get(d)}%, ${u(d,"shift-3",r.get(d))} 0%)`,WebkitMask:l,mask:l}}}function Rn(e={}){let{gap:t=4,align:n="center",justify:o,wrap:a=!1,density:r=!0}=e;return{style:I(I({display:"flex",alignItems:n,gap:r?i=>h(b(i)*t):()=>h(t)},o?{justifyContent:o}:{}),a?{flexWrap:"wrap"}:{})}}function uu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return A(I({},e.label?{role:"region",ariaLabel:e.label,tabIndex:0}:{}),{style:{overflow:"auto",color:o=>u(o,"text",t.get(o)),"&::-webkit-scrollbar":{width:h(2),height:h(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>u(o,"shift-5",t.get(o)),borderRadius:h(999),border:`${h(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>u(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${u(o,"shift-5",t.get(o))} transparent`}})}function Ci(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function mu(e,t,n,o){var m;let a=e.key;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(a))return;e.preventDefault();let r=t.map((s,d)=>{var f;return(f=s.key)!=null?f:String(d)}),i=r.indexOf(n),l=i;if(a==="ArrowDown")l=(i+1)%r.length;else if(a==="ArrowUp")l=(i-1+r.length)%r.length;else if(a==="ArrowRight"||a==="ArrowLeft"){let s=Oe(a,e.target);l=(i+s+r.length)%r.length}else a==="Home"?l=0:a==="End"&&(l=r.length-1);o.set(r[l]);let c=e.target.closest("[role=radiogroup]");(m=c==null?void 0:c.querySelectorAll("[role=radio]")[l])==null||m.focus()}function ki(e,t,n,o){return e.map((a,r)=>{var c;let i=(c=a.key)!=null?c:String(r);return{button:[typeof a.label=="string"?{span:a.label}:a.label],_key:i,type:"button",role:"radio",ariaChecked:m=>t.get(m)===i,tabIndex:m=>{var d,f;let s=t.get(m);return s===i||s===""&&i===((f=(d=e[0])==null?void 0:d.key)!=null?f:"")?0:-1},onClick:()=>t.set(i),onKeyDown:m=>mu(m,e,i,t),style:{cursor:"pointer",fontSize:m=>w(m,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(3),border:"none",borderRadius:h(10),color:m=>u(m,"text",n),backgroundColor:"transparent",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:m=>u(m,"shift-3",n),color:m=>u(m,q(3),n)},"&:active:not([disabled]):not([aria-checked=true])":{backgroundColor:m=>u(m,"increase-2",n),color:m=>u(m,q(3),n)},"&[aria-checked=true]":{backgroundColor:m=>u(m,"shift-0",o),color:m=>u(m,"shift-10",o),boxShadow:U("low")},"&:focus-visible":{boxShadow:m=>L(m,o)},"&[aria-checked=true]:focus-visible":{boxShadow:m=>`${U("low")}, ${L(m,o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function du(e={items:[]}){let{items:t=[],color:n="neutral",accentColor:o="primary"}=e;return A(I({role:"radiogroup",_onSchedule:(r,i)=>{var c,m;let l=Ci(r,"segmentedValue",e.value,(m=(c=t[0])==null?void 0:c.key)!=null?m:"");r.setContext("segmented",{value:l}),i[r.tagName]=ki(t,l,n,o)}},H("segmented-items",r=>({update(i){var c,m;let l=Ci(r,"segmentedValue",e.value,(m=(c=i.items[0])==null?void 0:c.key)!=null?m:"");r.children.update(ki(i.items,l,i.color,i.accentColor),!!r.domElement,!0)}}),{items:t,color:n,accentColor:o})),{dataTone:"shift-2",style:{display:"inline-flex",paddingBlock:h(1),paddingInline:h(1),gap:h(.5),borderRadius:h(10),backgroundColor:r=>u(r,"inherit",n),color:r=>u(r,"text",n)}})}function hu(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontSize:o=>w(o,"inherit"),lineHeight:"inherit",color:o=>u(o,"text",t),backgroundColor:o=>u(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${u(o,"border-strong",t)}`,borderRadius:o=>h(b(o)*1.5),paddingBlock:o=>h(b(o)*1),paddingInlineStart:o=>h(b(o)*3),paddingInlineEnd:o=>h(b(o)*5),backgroundImage:o=>{let a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${mn(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},backgroundRepeat:"no-repeat",backgroundPosition:o=>{var a;return`${Pn((a=o.elementNode)==null?void 0:a.domElement)?"left":"right"} ${h(2)} center`},backgroundSize:`${h(2.5)} ${h(1.5)}`,transition:"outline-color 140ms ease, box-shadow 140ms ease","&:not([multiple])":{height:o=>h(6+b(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`1px solid ${u(o,"shift-5",n)}`},"&:focus-visible":{boxShadow:o=>L(o,n)},"& optgroup":{color:o=>u(o,"shift-11",t)},"& option[disabled]":{color:o=>u(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>u(o,"muted","neutral"),outline:o=>`1px solid ${u(o,"border-strong","neutral")}`,backgroundColor:o=>u(o,"shift-2","neutral")}}}}var fu=1e3;function pu(e){let t=e.getMetadata("selectBoxTypeahead");return t||(t={buffer:"",timer:null},e.setMetadata("selectBoxTypeahead",t)),t}var Ti=(e,t)=>e.trim().toLowerCase().startsWith(t);function gu(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=v(e.value),l=v(a),{show:c,hide:m,anchorPartial:s}=_e({kind:"selectBox",open:l,onDismiss:e.onDismiss,placement:v(n),content:e.content}),d={onClick:(x,D)=>!r&&m(D),dataTone:"shift-0",style:{backgroundColor:x=>u(x,"inherit"),color:x=>u(x,"text"),borderRadius:x=>h(b(x)*2),outline:x=>`1px solid ${u(x,"border-strong")}`,outlineOffset:"-1px",boxShadow:U("medium")}};X(e.content,d);let f=x=>({div:D=>{let _=x.state.get(D),C=Array.isArray(_)?_:[_];return x.options.filter(P=>C.includes(P.value)).map(P=>({span:P.label,$:[zt({color:x.color,removable:x.multiple})],_key:P.value,_onRemove:V=>{let re=x.state.get(),G=(Array.isArray(re)?re:[re]).filter(ie=>ie!==P.value);x.multiple?x.state.set(G):x.state.set(G[0])}}))},_key:"selectBoxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1),flex:1}}),p=(x,D)=>({update(_){x.children.update([f(_)])}}),y=x=>l.get()?m(x):c(x),g=x=>{var _;let D=x.getRoot().domElement;return(_=D==null?void 0:D.querySelector(`#${ge("selectBox",x)}`))!=null?_:null},S=(x,D)=>{var M;let _=Ze(g(x));if(!_.length)return;let C=_[D?_.length-1:0];C.focus(),(M=C.scrollIntoView)==null||M.call(C,{block:"nearest"})},E=(x,D)=>{let _;_=be(l,C=>{C&&(_==null||_(),requestAnimationFrame(()=>S(x,D)))},!1),c(x)},O=(x,D)=>{var F,G,ie;let _=pu(D);_.timer&&clearTimeout(_.timer),_.buffer+=x.toLowerCase(),_.timer=setTimeout(()=>{_.buffer=""},fu);let C=_.buffer.length>1&&new Set(_.buffer).size===1,M=C?_.buffer[0]:_.buffer;if(l.get()){let Y=Ze(g(D)).filter(le=>{var oe;return Ti((oe=le.textContent)!=null?oe:"",M)});if(!Y.length)return;let Q=(G=(F=D.domElement)==null?void 0:F.ownerDocument)==null?void 0:G.activeElement,ae=C&&Q?Y.indexOf(Q):-1,ee=Y[(ae+1)%Y.length];ee.focus(),(ie=ee.scrollIntoView)==null||ie.call(ee,{block:"nearest"});return}if(r)return;let P=t.filter(Y=>Ti(Y.label,M));if(!P.length)return;let V=C?P.findIndex(Y=>Y.value===i.get()):-1,re=P[(V+1)%P.length];i.set(re.value)},T=A(I({_onInsert:x=>{x.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onSchedule:(x,D)=>{D[x.tagName]=[f({options:t,multiple:r,color:o,state:i})]}},H("selectBoxInner",p,{options:t,multiple:r,color:o,state:i})),{onClick:(x,D)=>y(D),tabindex:0,role:"combobox",ariaLabel:"Select",ariaExpanded:x=>l.get(x),ariaHaspopup:"listbox",ariaControls:x=>x!=null&&x.elementNode?ge("selectBox",x.elementNode):void 0,onKeyDown:(x,D)=>{let _=x.key;if(_==="Escape"){m(D);return}if(_==="Enter"||_===" "){x.preventDefault(),y(D);return}if(_==="ArrowDown"||_==="ArrowUp"||_==="Home"||_==="End"){x.preventDefault();let M=_==="ArrowUp"||_==="End";l.get()?S(D,M):E(D,M);return}let C=x;_.length===1&&!C.ctrlKey&&!C.metaKey&&!C.altKey&&O(_,D)},style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:x=>h(6+b(x)*2),minWidth:h(32),outlineOffset:"-1px",outline:x=>`1px solid ${u(x,"border-strong","neutral")}`,paddingInline:x=>h(b(x)*2),borderRadius:x=>h(b(x)*1.5),fontSize:x=>w(x,"inherit"),color:x=>u(x,"text",o),backgroundColor:x=>u(x,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:x=>L(x,o)}}});return X(s,T),s}function yu(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",tabindex:-1,ariaSelected:r=>{var c;let i=(c=r==null?void 0:r.elementNode)==null?void 0:c.getContext("select");if(!i)return;let l=i.value.get(r);return i.multiple?l.includes(o):l===o},onClick:(r,i)=>{let l=i.getContext("select");if(!l)return;let c=l.value,m=c.get();l.multiple?m.includes(o)?c.set(m.filter(s=>s!==o)):c.set(m.concat([o])):m!==o&&c.set(o)},_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag')},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>w(r,"inherit"),height:r=>h(6+b(r)*2),paddingInline:r=>h(b(r)*3),border:"none",outline:"none",color:r=>u(r,"text",n),backgroundColor:r=>u(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>u(r,"hover",n),color:r=>u(r,q(2),n)},"&[aria-selected=true]":{backgroundColor:r=>u(r,"shift-13",t),color:r=>u(r,"shift-0","neutral")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>L(r,t)}}}}function bu(e,t){var m;let n=e.key,o=t.domElement;if(!o)return;let a=Ze(o);if(!a.length)return;let r=o.ownerDocument.activeElement,i=r?a.indexOf(r):-1;if(n==="Enter"||n===" "){if(i===-1)return;e.preventDefault(),a[i].click();return}let l;if(n==="ArrowDown")l=Math.min(a.length-1,i+1);else if(n==="ArrowUp")l=i<=0?0:i-1;else if(n==="Home")l=0;else if(n==="End")l=a.length-1;else return;e.preventDefault();let c=a[l];c.focus(),(m=c.scrollIntoView)==null||m.call(c,{block:"nearest"})}function vu(e={}){var i;let{color:t="neutral",multiple:n=!1}=e,o=v((i=e.value)!=null?i:n?[]:null),a={div:l=>{let c=o.get(l);return(Array.isArray(c)?c:[c]).map(s=>({input:null,type:"hidden",name:e.name,value:s==null?"":String(s)}))},ariaHidden:"true",hidden:!0};return{dataTone:"shift-0",role:"listbox",ariaLabel:"Options",ariaMultiselectable:n?"true":void 0,tabindex:0,onKeyDown:bu,_onSchedule:l=>{l.setContext("select",{value:o,multiple:n})},_onInit:l=>{l.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),l.children.insert(a)},style:{display:"flex",flexDirection:"column",paddingBlock:l=>h(b(l)*2),paddingInline:l=>h(b(l)*2),fontSize:l=>w(l,"inherit"),backgroundColor:l=>u(l,"inherit",t),color:l=>u(l,"text",t)}}}function Su(e={}){var a;let t=v((a=e.color)!=null?a:"neutral","color"),n={"0%":{backgroundPosition:"200% 0"},"100%":{backgroundPosition:"-200% 0"}},o=He(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-1",style:{fontSize:r=>w(r),color:r=>u(r,"text",t.get(r)),height:h(6),display:"block",borderRadius:h(1),backgroundColor:r=>u(r,"inherit",t.get(r)),backgroundImage:r=>`linear-gradient(90deg, ${u(r,"inherit",t.get(r))} 0%, ${u(r,"shift-2",t.get(r))} 50%, ${u(r,"inherit",t.get(r))} 100%)`,backgroundSize:"200% 100%",animation:`${o} 1.6s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function wu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="small"&&console.warn('"small" patch must use small tag')},dataSize:"decrease-1",style:{fontSize:o=>w(o,"inherit"),color:o=>u(o,"shift-10",t.get(o))}}}var Di={to:{transform:"rotate(360deg)"}},_i=He(JSON.stringify(Di));function xu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>w(o),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:h(6),height:h(6),borderRadius:"50%",border:o=>`${h(.5)} solid ${u(o,"border-strong",t.get(o))}`,borderTopColor:o=>u(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${_i} 0.7s linear infinite`,[`@keyframes ${_i}`]:Di}}}function Eu(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:a=90}=e;return{_onSchedule:(r,i)=>{X(i,{_context:{splitter:{direction:t,size:v(n),min:o,max:a,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function Cu(e){let t=e.parent;if(!t)return!0;for(let n of t.children.items)if(n instanceof ne&&n.getMetadata("splitterPanel"))return n===e;return!0}function ku(){return{_metadata:{splitterPanel:!0},_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal"?"width":"height",a=i=>{n.style[o]=`${Cu(e)?i:100-i}%`};a(t.size.get()),n.style.flexShrink="0",n.style.overflow="auto";let r=t.size.addListener(a);e.addHook("Remove",()=>{var i;t.panelCount=Math.max(0,((i=t.panelCount)!=null?i:1)-1),r()})}}}function Tu(e={}){let{label:t="Resize"}=e;return{role:"separator",tabindex:0,ariaLabel:t,_onMount:n=>{let o=n.getContext("splitter");if(!o){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let a=n.domElement,r=o.direction==="horizontal";a.style.cursor=r?"col-resize":"row-resize",a.setAttribute("aria-orientation",r?"vertical":"horizontal"),a.setAttribute("aria-valuemin",String(o.min)),a.setAttribute("aria-valuemax",String(o.max)),a.setAttribute("aria-valuenow",String(Math.round(o.size.get())));let i=o.size.addListener(s=>{a.setAttribute("aria-valuenow",String(Math.round(s)))}),l=s=>{let d=s.shiftKey?10:1,f=null;if(r){let p=Oe(s.key,a);p!==0&&(f=Math.min(Math.max(o.size.get()+p*d,o.min),o.max))}else s.key==="ArrowDown"?f=Math.min(o.size.get()+d,o.max):s.key==="ArrowUp"&&(f=Math.max(o.size.get()-d,o.min));s.key==="Home"?f=o.min:s.key==="End"&&(f=o.max),f!==null&&(s.preventDefault(),o.size.set(f))},c=null,m=s=>{var y;s.preventDefault();let d=a.parentElement;(y=a.setPointerCapture)==null||y.call(a,s.pointerId);let f=g=>{if(g.pointerId!==s.pointerId)return;let S=d.getBoundingClientRect(),E=r?(g.clientX-S.left)/S.width*100:(g.clientY-S.top)/S.height*100;o.size.set(Math.min(Math.max(E,o.min),o.max))};c=()=>{var g;document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p),c=null,(g=a.hasPointerCapture)!=null&&g.call(a,s.pointerId)&&a.releasePointerCapture(s.pointerId)};function p(g){g.pointerId===s.pointerId&&(c==null||c())}document.addEventListener("pointermove",f),document.addEventListener("pointerup",p),document.addEventListener("pointercancel",p)};a.addEventListener("keydown",l),a.addEventListener("pointerdown",m),n.addHook("Remove",()=>{c==null||c(),i(),a.removeEventListener("keydown",l),a.removeEventListener("pointerdown",m)})},dataTone:"shift-2",style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none",backgroundColor:n=>u(n,"inherit"),color:n=>u(n,"text"),"&:hover":{backgroundColor:n=>u(n,"increase-1")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:n=>L(n,"primary")},"&::after":{content:'""',width:h(1),height:h(1),borderRadius:h(999),backgroundColor:n=>u(n,"shift-4")}}}}function _u(e={}){let{gap:t=3,align:n,justify:o,density:a=!0}=e;return{style:I(I({display:"flex",flexDirection:"column",gap:a?r=>h(b(r)*t):()=>h(t)},n?{alignItems:n}:{}),o?{justifyContent:o}:{})}}function Oi(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function Du(e,t,n){return e==="vertical"?{"&:not(:last-child)::after":{content:'""',position:"absolute",insetInlineStart:h(3),top:h(6),bottom:`-${h(2)}`,width:"2px",height:"auto",insetInlineEnd:"auto",backgroundColor:o=>u(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:last-child)::after":{backgroundColor:o=>u(o,"shift-9",n)}}:{"&:not(:first-child)::after":{content:'""',position:"absolute",top:h(3),insetInlineEnd:`calc(50% + ${h(3)})`,insetInlineStart:`calc(-50% + ${h(3)})`,height:"2px",backgroundColor:o=>u(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:first-child)::after":{backgroundColor:o=>u(o,"shift-9",n)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:o=>u(o,"shift-9",n)}}}function Li(e,t,n,o,a){let r=n==="vertical",i=Du(n,o,a);return e.map((l,c)=>{var s;return{li:[typeof l.label=="string"?{span:l.label}:l.label],_key:(s=l.key)!=null?s:c,dataStep:String(c+1),dataStatus:d=>{let f=t.get(d);return c<f?"done":c===f?"active":"pending"},ariaCurrent:d=>t.get(d)===c?"step":void 0,style:A(I({position:"relative",display:"flex",flexDirection:r?"row":"column",alignItems:r?"flex-start":"center",gap:h(1),flex:r?"none":"1",fontSize:d=>w(d,"decrease-1"),textAlign:r?"start":"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:h(6),height:h(6),borderRadius:h(999),fontSize:d=>w(d,"decrease-1"),fontWeight:Z("bold"),flexShrink:"0",border:d=>`2px solid ${u(d,"border-strong",o)}`,backgroundColor:d=>u(d,"inherit"),color:d=>u(d,"muted"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"}},i),{"&[data-status=active]::before":{backgroundColor:d=>u(d,"shift-9",a),borderColor:d=>u(d,"shift-9",a),color:d=>u(d,"shift-0",a),boxShadow:d=>`0 0 0 3px ${u(d,"shift-3",a)}`},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:d=>u(d,"shift-9",a),borderColor:d=>u(d,"shift-9",a),color:d=>u(d,"shift-0",a)},"&[data-status=pending]":{color:d=>u(d,"muted")},"&[data-status=active]":{color:d=>u(d,"shift-11",a),fontWeight:Z("bold")},"&[data-status=done]":{color:d=>u(d,"text",o)}})}})}function Ou(e={items:[]}){var i;let{items:t=[],direction:n="horizontal",color:o="neutral",accentColor:a="primary"}=e,r={items:t,direction:n,color:o,accentColor:a};return A(I({_context:{steps:{current:v((i=e.current)!=null?i:0),direction:n,color:o,accentColor:a}},_onSchedule:(l,c)=>{let m=Oi(l,"stepsCurrent",e.current,0);c[l.tagName]=Li(t,m,n,o,a)}},H("steps-items",l=>({update(c){let m=Oi(l,"stepsCurrent",e.current,0);l.children.update(Li(c.items,m,c.direction,c.color,c.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",flexDirection:n==="vertical"?"column":"row",alignItems:n==="vertical"?"flex-start":"center",gap:h(2),listStyle:"none",margin:"0",padding:"0"}})}function Lu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>w(o,"inherit"),fontWeight:Z("bold"),color:o=>u(o,"shift-11",t.get(o)),backgroundColor:o=>u(o)}}}function Iu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>w(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>u(o,"text",t.get(o))}}}function Pu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>w(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>u(o,"text",t.get(o))}}}function Mu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>w(o,"inherit"),color:o=>u(o,"text",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"start",fontWeight:Z("medium"),paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*1),color:o=>u(o,"shift-10",t.get(o)),backgroundColor:o=>u(o,"inherit")},"& td":{textAlign:"start",paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*1),color:o=>u(o,"text",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${u(o,"shift-3",t.get(o))}`,fontSize:o=>w(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"start",fontWeight:Z("medium"),paddingInline:o=>h(b(o)*3),paddingBlock:o=>h(b(o)*1),color:o=>u(o,"shift-10",t.get(o)),backgroundColor:o=>u(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${u(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>u(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>u(o,"hover"),color:o=>u(o,q(2))},"& tbody tr:hover td, & tbody tr:hover th":{color:o=>u(o,q(2))}}}}function Ii(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function Pi(e,t,n,o,a){let r=e.nodeId,l={div:t.map((m,s)=>{var p;let d=(p=m.key)!=null?p:s;return{button:[typeof m.label=="string"?{span:m.label}:m.label],_key:d,type:"button",role:"tab",id:`tab${r}${d}`,ariaControls:`panel${r}${d}`,ariaSelected:y=>n.get(y)===d,tabIndex:y=>n.get(y)===d?0:-1,onClick:()=>n.set(d),onKeyDown:y=>{var x;let g=y.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(g))return;y.preventDefault();let S=t.map((D,_)=>{var C;return(C=D.key)!=null?C:_}),E=S.indexOf(d),O=E;if(g==="ArrowRight"||g==="ArrowLeft"){let D=Oe(g,y.target);O=(E+D+S.length)%S.length}else g==="Home"?O=0:g==="End"&&(O=S.length-1);n.set(S[O]);let T=y.target.closest("[role=tablist]");(x=T==null?void 0:T.querySelectorAll("[role=tab]")[O])==null||x.focus()},style:{cursor:"pointer",fontSize:y=>w(y,"inherit"),height:y=>h(6+b(y)*2),paddingInline:y=>h(b(y)*4),border:"none",outline:"none",color:y=>u(y,"shift-13"),backgroundColor:y=>u(y,"inherit"),boxShadow:y=>`inset 0 ${h(-.5)} 0 0 ${u(y,"shift-1",a)}`,transition:"box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-selected=true])":{color:y=>u(y,"shift-13"),boxShadow:y=>`inset 0 ${h(-.5)} 0 0 ${u(y,"shift-2",a)}`},"&[aria-selected=true]:not([disabled])":{color:y=>u(y,"shift-13",o),boxShadow:y=>`inset 0 ${h(-.5)} 0 0 ${u(y,"shift-8",o)}`},"&:focus-visible":{boxShadow:y=>L(y,o)},"&[aria-selected=true]:focus-visible":{boxShadow:y=>`${L(y,o)}, inset 0 ${h(-.5)} 0 0 ${u(y,"shift-6",o)}`}}}}),_key:"tablist",role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},c=t.map((m,s)=>{var f;let d=(f=m.key)!=null?f:s;return{div:[m.content],_key:d,role:"tabpanel",id:`panel${r}${d}`,ariaLabelledby:`tab${r}${d}`,tabIndex:0,hidden:p=>n.get(p)!==d,style:{paddingBlock:p=>h(b(p)*2),paddingInline:p=>h(b(p)*2)}}});return[l,...c]}function Ru(e={items:[]}){let{items:t=[],accentColor:n="primary",color:o="neutral"}=e;return I({_onSchedule:(r,i)=>{var c,m;let l=Ii(r,"tabsActiveKey",e.activeKey,(m=(c=t[0])==null?void 0:c.key)!=null?m:0);i[r.tagName]=Pi(r,t,l,n,o)}},H("tabs-items",r=>({update(i){var c,m;let l=Ii(r,"tabsActiveKey",e.activeKey,(m=(c=i.items[0])==null?void 0:c.key)!=null?m:0);r.children.update(Pi(r,i.items,l,i.accentColor,i.color),!!r.domElement,!0)}}),{items:t,accentColor:n,color:o}))}function $u(e={}){var a,r;let t=v((a=e.color)!=null?a:"neutral","color"),n=v((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return A(I({_onInsert:i=>{i.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')}},H("textarea-auto-resize",(i,l)=>{let c=i.domElement,m=l.autoResize,s=!1,d,f,p=()=>{!m||s||(s=!0,f==null||f.unobserve(c),c.style.overflow="hidden",c.style.height="auto",c.style.height=`${c.scrollHeight}px`,s=!1,m&&(f==null||f.observe(c)))},y=()=>{typeof IntersectionObserver!="undefined"&&(d||(d=new IntersectionObserver(S=>{S.some(E=>E.isIntersecting)&&p()})),d.observe(c)),typeof ResizeObserver!="undefined"&&(f||(f=new ResizeObserver(()=>{s||p()})),f.observe(c))},g=()=>{d==null||d.unobserve(c),f==null||f.unobserve(c)};return c.addEventListener("input",p),i.attributes.addListener("value",p),m&&(y(),p()),{resize:p,update(S){m=S.autoResize,i.attributes.addListener("value",p),m?(y(),p()):g()},destroy(){c.removeEventListener("input",p),d==null||d.disconnect(),f==null||f.disconnect()}}},{autoResize:o})),{_onUpdate:i=>{var l;(l=i.getBehavior("textarea-auto-resize"))==null||l.resize()},style:A(I({lineHeight:"inherit",resize:"vertical",paddingInline:i=>h(b(i)*2),paddingBlock:i=>h(b(i)*1.5),border:"none",borderRadius:i=>h(b(i)*1.5),fontSize:i=>w(i,"inherit")},we(t)),{outlineOffset:"-1px",outline:i=>`1px solid ${u(i,"border-strong",t.get(i))}`,backgroundColor:i=>u(i,"inherit",t.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${u(i,"shift-5",n.get(i))}`},"&:focus-visible":{boxShadow:i=>L(i,n.get(i))},"&[placeholder]:invalid:not(:placeholder-shown)":{outline:i=>`${h(.5)} solid ${u(i,"shift-5","error")}`},"&[data-status=error]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${h(.5)} solid ${u(i,"shift-6","warning")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>u(i,"muted","neutral"),outline:i=>`1px solid ${u(i,"border-strong","neutral")}`,backgroundColor:i=>u(i,"shift-2","neutral")}})})}function Au(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Nu(e={}){var r,i,l;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(i=e.accentColor)!=null?i:"primary",a=v((l=e.active)!=null?l:!1);return{style:I({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:c=>h(b(c)*2),paddingBottom:c=>t?"0":h(b(c)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:h(1),transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:c=>u(c,"shift-8",a.get(c)?o:n),opacity:c=>a.get(c)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",insetInlineStart:"calc(1rem - 1px)",top:"1.25rem",bottom:c=>h(b(c)*-4),width:"2px",backgroundColor:c=>u(c,"shift-3",n)}})}}function $n(e){let t=e.getMetadata("toastOpen");return t||(t=v(!1),e.setMetadata("toastOpen",t)),t}var Mi=e=>{let t=e==null?void 0:e.elementNode;return t?$n(t).get(e):!1},zu=5e3;function Bu(e,t){let{duration:n,onDismiss:o}=t,a=null,r=n,i=0,l=!1,c=()=>{a&&(clearTimeout(a),a=null)},m=()=>{l||(l=!0,c(),o==null||o(),e.remove())},s=y=>{c(),!(l||!Number.isFinite(y)||y<=0)&&(i=Date.now(),a=setTimeout(m,y))};s(n);let d=()=>{a&&(r-=Date.now()-i,c())},f=()=>{l||a||s(r)},p=e.domElement;return p==null||p.addEventListener("pointerenter",d),p==null||p.addEventListener("pointerleave",f),p==null||p.addEventListener("focusin",d),p==null||p.addEventListener("focusout",f),{pause:d,resume:f,update(y){n=y.duration,o=y.onDismiss,!a&&!l&&(r=n)},destroy(){c(),p==null||p.removeEventListener("pointerenter",d),p==null||p.removeEventListener("pointerleave",f),p==null||p.removeEventListener("focusin",d),p==null||p.removeEventListener("focusout",f)}}}function Vu(e={}){let{position:t="top-center",color:n="neutral",duration:o=zu,onDismiss:a}=e,r=t.startsWith("top"),i=t.endsWith("center"),l=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":l?"end":"start",inset:0,gap:h(4),zIndex:30,padding:h(6),pointerEvents:"none"}};return A(I({},H("toastAutoDismiss",Bu,{duration:o,onDismiss:a})),{_portal:m=>{let s=m.domElement.querySelector(`#domphy-toast-${t}`);return s||(s=m.children.insert(c).domElement),s},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:h(32),pointerEvents:"auto",paddingBlock:m=>h(b(m)*2),paddingInline:m=>h(b(m)*4),borderRadius:m=>h(b(m)*2),fontSize:m=>w(m,"inherit"),color:m=>u(m,"text",n),backgroundColor:m=>u(m,"inherit",n),boxShadow:U("medium"),opacity:m=>Number(Mi(m)),transform:m=>Mi(m)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:m=>requestAnimationFrame(()=>$n(m).set(!0)),_onBeforeRemove:(m,s)=>{var T,x;let d=!1,f=null,p=!1,y=m.getRoot(),g=(x=(T=m.domElement)==null?void 0:T.parentElement)!=null?x:null,S=()=>{var _;if(p||!g||g.id!==`domphy-toast-${t}`||g.childElementCount>0)return;p=!0;let D=(_=y.children)==null?void 0:_.items.find(C=>C.domElement===g);D?y.children.remove(D):g.remove()},E=()=>{d||(d=!0,f&&(clearTimeout(f),f=null),m.domElement.removeEventListener("transitionend",O),s(),S())},O=D=>{D.propertyName==="transform"&&E()};m.domElement.addEventListener("transitionend",O),f=setTimeout(E,350),m.addHook("Remove",()=>{var D;f&&(clearTimeout(f),f=null),(D=m.domElement)==null||D.removeEventListener("transitionend",O),S()}),$n(m).set(!1)}})}function _o(e,t,n,o){if(he(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=v(n!=null?n:o),e.setMetadata(t,a)),a}function Hu(e,t){return Array.isArray(e)?e.includes(t):e===t}function Fu(e,t,n,o,a){var s;let r=e.key;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r))return;e.preventDefault();let i=t.map((d,f)=>{var p;return(p=d.key)!=null?p:String(f)}),l=i.indexOf(n),c=l;if(r==="ArrowDown")c=(l+1)%i.length;else if(r==="ArrowUp")c=(l-1+i.length)%i.length;else if(r==="ArrowRight"||r==="ArrowLeft"){let d=Oe(r,e.target);c=(l+d+i.length)%i.length}else r==="Home"?c=0:r==="End"&&(c=i.length-1);a||o.set(i[c]);let m=e.target.closest("[role=group]");(s=m==null?void 0:m.querySelectorAll("button")[c])==null||s.focus()}function Ri(e,t,n,o,a,r){return e.map((i,l)=>{var s;let c=(s=i.key)!=null?s:String(l);return{button:[typeof i.label=="string"?{span:i.label}:i.label],_key:c,type:"button",role:"button",ariaPressed:d=>Hu(t.get(d),c),tabIndex:d=>{var p,y,g,S,E;let f=t.get(d);if(o){let O=n.get(d);if(O!==null)return c===O?0:-1;let x=(g=(y=(Array.isArray(f)?f:[])[0])!=null?y:(p=e[0])==null?void 0:p.key)!=null?g:"0";return c===x?0:-1}return f===c||f===""&&c===((E=(S=e[0])==null?void 0:S.key)!=null?E:"0")?0:-1},onFocus:()=>n.set(c),onClick:()=>{let d=t.get();if(o){let f=Array.isArray(d)?[...d]:[];t.set(f.includes(c)?f.filter(p=>p!==c):[...f,c])}else t.set(d===c?"":c)},onKeyDown:d=>Fu(d,e,c,t,o),style:{cursor:"pointer",fontSize:d=>w(d,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(2),border:"none",borderRadius:h(1.5),color:d=>u(d,"shift-13",a),backgroundColor:d=>u(d,"inherit",a),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-pressed=true])":{color:d=>u(d,"shift-13",a),backgroundColor:d=>u(d,"hover",a)},"&:active:not([disabled])":{backgroundColor:d=>u(d,"increase-2",a)},"&[aria-pressed=true]":{backgroundColor:d=>u(d,"shift-3",r),color:d=>u(d,"shift-13",r)},"&:focus-visible":{boxShadow:d=>L(d,r)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function ju(e={items:[]}){let{items:t=[],multiple:n=!1,color:o="neutral",accentColor:a="primary"}=e;return A(I({role:"group",_onSchedule:(i,l)=>{let c=_o(i,"toggleGroupValue",e.value,n?[]:"");i.setContext("toggleGroup",{value:c,multiple:n});let m=_o(i,"toggleGroupFocusedKey",void 0,null);l[i.tagName]=Ri(t,c,m,n,o,a)}},H("toggle-items",i=>({update(l){let c=_o(i,"toggleGroupValue",e.value,l.multiple?[]:""),m=_o(i,"toggleGroupFocusedKey",void 0,null);i.children.update(Ri(l.items,c,m,l.multiple,l.color,l.accentColor),!!i.domElement,!0)}}),{items:t,multiple:n,color:o,accentColor:a})),{style:{display:"flex",paddingBlock:h(1),paddingInline:h(1),gap:h(1),borderRadius:h(2),fontSize:i=>w(i,"inherit"),backgroundColor:i=>u(i,"inherit",o),color:i=>u(i,"text",o),outline:i=>`1px solid ${u(i,"border",o)}`,outlineOffset:"-1px"}})}function Wu(e={}){return Rn(e)}function Ku(){return{div:null,style:{flex:"1 1 0"}}}function qu(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content",openDelay:a,closeDelay:r}=e,i=v(n),l=v(o),c={span:g=>l.get(g)},{show:m,hide:s,anchorPartial:d,openState:f}=_e({kind:"tooltip",open:t,onDismiss:e.onDismiss,placement:i,content:c,openDelay:a,closeDelay:r}),p={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:g=>h(b(g)*1),paddingInline:g=>h(b(g)*3),borderRadius:g=>h(b(g)*1.5),color:g=>u(g,"text"),backgroundColor:g=>u(g),fontSize:g=>w(g,"inherit"),boxShadow:U("low")},$:[In({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(p),X(d,{ariaDescribedby:g=>g!=null&&g.elementNode&&f.get(g)?ge("tooltip",g.elementNode):void 0,onMouseEnter:(g,S)=>m(S),onMouseLeave:(g,S)=>s(S),onFocus:(g,S)=>m(S),onBlur:(g,S)=>s(S),onKeyDown:(g,S)=>g.key==="Escape"&&s(S)}),d}function $i(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Uu(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,a=new Map,r=new Set,i=new Set;return{_onMount:l=>{l.addHook("Remove",()=>{for(let c of Array.from(a.values()))c();a.clear();for(let c of r)clearTimeout(c);r.clear();for(let c of i)cancelAnimationFrame(c);i.clear()})},_onBeforeUpdate:l=>{o=new Map,!St()&&l.children.items.forEach((c,m)=>{if(!(c instanceof ne))return;let s=c.domElement;s&&o.set($i(c,m),s.getBoundingClientRect())})},_onUpdate:l=>{l.children.items.forEach((c,m)=>{var D;if(!(c instanceof ne))return;let s=c.domElement;if(!s)return;let d=$i(c,m),f=o.get(d);if(!f)return;let p=s.getBoundingClientRect(),y=f.left-p.left,g=f.top-p.top;if(Math.abs(y)<.5&&Math.abs(g)<.5)return;(D=a.get(s))==null||D(),s.style.transition="none",s.style.transform=`translate(${y}px, ${g}px)`,s.getBoundingClientRect();let S=requestAnimationFrame(()=>{i.delete(S),s.style.transition=`transform ${t}ms ease ${n}ms`,s.style.transform="translate(0px, 0px)"});i.add(S);let E=!1,O=null,T=()=>{E||(E=!0,O&&(r.delete(O),O=null),a.delete(s),s.removeEventListener("transitionend",x),s.style.transition="",s.style.transform="")},x=_=>{_.propertyName==="transform"&&T()};a.set(s,()=>{E=!0,O&&(clearTimeout(O),r.delete(O),O=null),a.delete(s),s.removeEventListener("transitionend",x)}),s.addEventListener("transitionend",x),O=setTimeout(T,t+n+34),r.add(O)}),o.clear()}}}function Gu(e={}){var n;let t=v((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>w(o,"inherit"),backgroundColor:o=>u(o),color:o=>u(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingInlineStart:h(3),listStyleType:"disc",listStylePosition:"outside"}}}function Yu(){return{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}}return qi(Xu);})();
10
10
  //# sourceMappingURL=core-theme-ui.global.js.map