canny-ui-react 6.3.2 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use client";"use strict";var jl=t=>{throw TypeError(t)};var Al=(t,e,n)=>e.has(t)||jl("Cannot "+n);var Be=(t,e,n)=>(Al(t,e,"read from private field"),n?n.call(t):e.get(t)),Dl=(t,e,n)=>e.has(t)?jl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Us=(t,e,n,r)=>(Al(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),Da=require("react-dom");function Ud(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const p=Ud(S),Or=Ud(Da);function H(...t){return t.filter(Boolean).join(" ")}const Hd={sm:640,md:768,lg:1024,xl:1280},Hs=["base","sm","md","lg","xl"],Jy=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),ev=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),tv=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^ms-/,"-ms-"),nv=t=>t.replace(/[<>]/g,""),rv=(t,e)=>typeof e=="number"&&e!==0&&!Jy.has(t)?`${e}px`:nv(String(e)),Il=t=>Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>`${tv(e)}:${rv(e,n)};`).join(""),ov=t=>{let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)|0;return(e>>>0).toString(36)};function Ia(t){const e={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[a,c]of Object.entries(t))if(ev(c)){r=!0;for(const u of Hs){const d=c[u];d!==void 0&&(n[u][a]=d)}}else e[a]=c;if(!r)return{style:e};Object.assign(n.base,e);const o=[];for(const a of Hs){const c=Il(n[a]);c&&o.push(`${a}{${c}}`)}const s=`cny-sx-${ov(o.join(""))}`;let i="";for(const a of Hs){const c=Il(n[a]);c&&(i+=a==="base"?`.${s}{${c}}`:`@media (min-width:${Hd[a]}px){.${s}{${c}}}`)}return{className:s,css:i}}function ae(t,e,...n){const r=t?Ia(t):void 0;return{className:H(...n,r==null?void 0:r.className),style:r!=null&&r.style||e?{...r==null?void 0:r.style,...e}:void 0,styleTag:r!=null&&r.css?l.jsx("style",{dangerouslySetInnerHTML:{__html:r.css}}):null}}const ka=S.createContext({});function Na(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const sv=typeof window<"u",Wd=sv?S.useLayoutEffect:S.useEffect,ss=S.createContext(null);function _a(t,e){t.indexOf(e)===-1&&t.push(e)}function Ho(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const kt=(t,e,n)=>n>e?e:n<t?t:n;function ji(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let nr=()=>{},Vt=()=>{};var zd;typeof process<"u"&&((zd=process.env)==null?void 0:zd.NODE_ENV)!=="production"&&(nr=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(ji(e,n))},Vt=(t,e,n)=>{if(!t)throw new Error(ji(e,n))});const en={},Kd=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Yd(t){return typeof t=="object"&&t!==null}const Xd=t=>/^0[^.\s]+$/u.test(t);function qd(t){let e;return()=>(e===void 0&&(e=t()),e)}const ft=t=>t,iv=(t,e)=>n=>e(t(n)),Lr=(...t)=>t.reduce(iv),Pr=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Oa{constructor(){this.subscriptions=[]}add(e){return _a(this.subscriptions,e),()=>Ho(this.subscriptions,e)}notify(e,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](e,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Xe=t=>t*1e3,dt=t=>t/1e3;function Zd(t,e){return e?t*(1e3/e):0}const kl=new Set;function La(t,e,n){t||kl.has(e)||(console.warn(ji(e,n)),kl.add(e))}const Qd=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,av=1e-7,cv=12;function lv(t,e,n,r,o){let s,i,a=0;do i=e+(n-e)/2,s=Qd(i,r,o)-t,s>0?n=i:e=i;while(Math.abs(s)>av&&++a<cv);return i}function $r(t,e,n,r){if(t===e&&n===r)return ft;const o=s=>lv(s,0,1,t,n);return s=>s===0||s===1?s:Qd(o(s),e,r)}const Jd=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ef=t=>e=>1-t(1-e),tf=$r(.33,1.53,.69,.99),$a=ef(tf),nf=Jd($a),rf=t=>t>=1?1:(t*=2)<1?.5*$a(t):.5*(2-Math.pow(2,-10*(t-1))),Fa=t=>1-Math.sin(Math.acos(t)),of=ef(Fa),sf=Jd(Fa),uv=$r(.42,0,1,1),dv=$r(0,0,.58,1),af=$r(.42,0,.58,1),fv=t=>Array.isArray(t)&&typeof t[0]!="number",cf=t=>Array.isArray(t)&&typeof t[0]=="number",Nl={linear:ft,easeIn:uv,easeInOut:af,easeOut:dv,circIn:Fa,circInOut:sf,circOut:of,backIn:$a,backInOut:nf,backOut:tf,anticipate:rf},hv=t=>typeof t=="string",_l=t=>{if(cf(t)){Vt(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,o]=t;return $r(e,n,r,o)}else if(hv(t))return Vt(Nl[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Nl[t];return t},uo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pv(t,e){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const g=h&&o?n:r;return f&&i.add(d),g.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0;const f=n;n=r,r=f,n.forEach(c),n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const mv=40;function lf(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=uo.reduce((b,C)=>(b[C]=pv(s),b),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:m,postRender:g}=i,y=()=>{const b=en.useManualTiming,C=b?o.timestamp:performance.now();n=!1,b||(o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,mv),1)),o.timestamp=C,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),m.process(o),g.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(y))},v=()=>{n=!0,r=!0,o.isProcessing||t(y)};return{schedule:uo.reduce((b,C)=>{const P=i[C];return b[C]=(R,M=!1,j=!1)=>(n||v(),P.schedule(R,M,j)),b},{}),cancel:b=>{for(let C=0;C<uo.length;C++)i[uo[C]].cancel(b)},state:o,steps:i}}const{schedule:pe,cancel:tn,state:Oe,steps:Ws}=lf(typeof requestAnimationFrame<"u"?requestAnimationFrame:ft,!0);let Do;function gv(){Do=void 0}const He={now:()=>(Do===void 0&&He.set(Oe.isProcessing||en.useManualTiming?Oe.timestamp:performance.now()),Do),set:t=>{Do=t,queueMicrotask(gv)}},uf=t=>e=>typeof e=="string"&&e.startsWith(t),df=uf("--"),yv=uf("var(--"),Va=t=>yv(t)?vv.test(t.split("/*")[0].trim()):!1,vv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ol(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const rr={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Rr={...rr,transform:t=>kt(0,1,t)},fo={...rr,default:1},br=t=>Math.round(t*1e5)/1e5,Ba=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xv(t){return t==null}const bv=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ga=(t,e)=>n=>!!(typeof n=="string"&&bv.test(n)&&n.startsWith(t)||e&&!xv(n)&&Object.prototype.hasOwnProperty.call(n,e)),ff=(t,e,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Ba);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},wv=t=>kt(0,255,t),Ks={...rr,transform:t=>Math.round(wv(t))},wn={test:Ga("rgb","red"),parse:ff("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Ks.transform(t)+", "+Ks.transform(e)+", "+Ks.transform(n)+", "+br(Rr.transform(r))+")"};function Cv(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Ai={test:Ga("#"),parse:Cv,transform:wn.transform},Fr=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),qt=Fr("deg"),Dt=Fr("%"),ee=Fr("px"),Sv=Fr("vh"),Pv=Fr("vw"),Ll={...Dt,parse:t=>Dt.parse(t)/100,transform:t=>Dt.transform(t*100)},zn={test:Ga("hsl","hue"),parse:ff("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Dt.transform(br(e))+", "+Dt.transform(br(n))+", "+br(Rr.transform(r))+")"},Re={test:t=>wn.test(t)||Ai.test(t)||zn.test(t),parse:t=>wn.test(t)?wn.parse(t):zn.test(t)?zn.parse(t):Ai.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?wn.transform(t):zn.transform(t),getAnimatableNone:t=>{const e=Re.parse(t);return e.alpha=0,Re.transform(e)}},Rv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Tv(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ba))==null?void 0:e.length)||0)+(((n=t.match(Rv))==null?void 0:n.length)||0)>0}const hf="number",pf="color",Mv="var",Ev="var(",$l="${}",jv=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function qn(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=e.replace(jv,c=>(Re.test(c)?(r.color.push(s),o.push(pf),n.push(Re.parse(c))):c.startsWith(Ev)?(r.var.push(s),o.push(Mv),n.push(c)):(r.number.push(s),o.push(hf),n.push(parseFloat(c))),++s,$l)).split($l);return{values:n,split:a,indexes:r,types:o}}function Av(t){return qn(t).values}function mf({split:t,types:e}){const n=t.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],r[s]!==void 0){const i=e[s];i===hf?o+=br(r[s]):i===pf?o+=Re.transform(r[s]):o+=r[s]}return o}}function Dv(t){return mf(qn(t))}const Iv=t=>typeof t=="number"?0:Re.test(t)?Re.getAnimatableNone(t):t,kv=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Iv(t);function Nv(t){const e=qn(t);return mf(e)(e.values.map((r,o)=>kv(r,e.split[o])))}const yt={test:Tv,parse:Av,createTransformer:Dv,getAnimatableNone:Nv};function Ys(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _v({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let o=0,s=0,i=0;if(!e)o=s=i=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;o=Ys(c,a,t+1/3),s=Ys(c,a,t),i=Ys(c,a,t-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Wo(t,e){return n=>n>0?e:t}const ye=(t,e,n)=>t+(e-t)*n,Xs=(t,e,n)=>{const r=t*t,o=n*(e*e-r)+r;return o<0?0:Math.sqrt(o)},Ov=[Ai,wn,zn],Lv=t=>Ov.find(e=>e.test(t));function Fl(t){const e=Lv(t);if(nr(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===zn&&(n=_v(n)),n}const Vl=(t,e)=>{const n=Fl(t),r=Fl(e);if(!n||!r)return Wo(t,e);const o={...n};return s=>(o.red=Xs(n.red,r.red,s),o.green=Xs(n.green,r.green,s),o.blue=Xs(n.blue,r.blue,s),o.alpha=ye(n.alpha,r.alpha,s),wn.transform(o))},Di=new Set(["none","hidden"]);function $v(t,e){return Di.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Fv(t,e){return n=>ye(t,e,n)}function za(t){return typeof t=="number"?Fv:typeof t=="string"?Va(t)?Wo:Re.test(t)?Vl:Gv:Array.isArray(t)?gf:typeof t=="object"?Re.test(t)?Vl:Vv:Wo}function gf(t,e){const n=[...t],r=n.length,o=t.map((s,i)=>za(s)(s,e[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Vv(t,e){const n={...t,...e},r={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(r[o]=za(t[o])(t[o],e[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Bv(t,e){const n=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],i=t.indexes[s][r[s]],a=t.values[i]??0;n[o]=a,r[s]++}return n}const Gv=(t,e)=>{const n=yt.createTransformer(e),r=qn(t),o=qn(e);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Di.has(t)&&!o.values.length||Di.has(e)&&!r.values.length?$v(t,e):Lr(gf(Bv(r,o),o.values),n):(nr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Wo(t,e))};function yf(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ye(t,e,n):za(t)(t,e)}const zv=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>pe.update(e,n),stop:()=>tn(e),now:()=>Oe.isProcessing?Oe.timestamp:He.now()}},vf=(t,e,n=10)=>{let r="";const o=Math.max(Math.round(e/n),2);for(let s=0;s<o;s++)r+=Math.round(t(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Ko=2e4;function Ua(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Ko;)e+=n,r=t.next(e);return e>=Ko?1/0:e}function Uv(t,e=100,n){const r=n({...t,keyframes:[0,e]}),o=Math.min(Ua(r),Ko);return{type:"keyframes",ease:s=>r.next(o*s).value/e,duration:dt(o)}}const xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ii(t,e){return t*Math.sqrt(1-e*e)}const Hv=12;function Wv(t,e,n){let r=n;for(let o=1;o<Hv;o++)r=r-t(r)/e(r);return r}const qs=.001;function Kv({duration:t=xe.duration,bounce:e=xe.bounce,velocity:n=xe.velocity,mass:r=xe.mass}){let o,s;nr(t<=Xe(xe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-e;i=kt(xe.minDamping,xe.maxDamping,i),t=kt(xe.minDuration,xe.maxDuration,dt(t)),i<1?(o=u=>{const d=u*i,f=d*t,h=d-n,m=Ii(u,i),g=Math.exp(-f);return qs-h/m*g},s=u=>{const f=u*i*t,h=f*n+n,m=Math.pow(i,2)*Math.pow(u,2)*t,g=Math.exp(-f),y=Ii(Math.pow(u,2),i);return(-o(u)+qs>0?-1:1)*((h-m)*g)/y}):(o=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-qs+d*f},s=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const a=5/t,c=Wv(o,s,a);if(t=Xe(t),isNaN(c))return{stiffness:xe.stiffness,damping:xe.damping,duration:t};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:t}}}const Yv=["duration","bounce"],Xv=["stiffness","damping","mass"];function Bl(t,e){return e.some(n=>t[n]!==void 0)}function qv(t){let e={velocity:xe.velocity,stiffness:xe.stiffness,damping:xe.damping,mass:xe.mass,isResolvedFromDuration:!1,...t};if(!Bl(t,Xv)&&Bl(t,Yv))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*kt(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:xe.mass,stiffness:o,damping:s}}else{const n=Kv({...t,velocity:0});e={...e,...n,mass:xe.mass},e.isResolvedFromDuration=!0}return e}function Yo(t=xe.visualDuration,e=xe.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=qv({...n,velocity:-dt(n.velocity||0)}),g=h||0,y=u/(2*Math.sqrt(c*d)),v=i-s,x=dt(Math.sqrt(c/d)),w=Math.abs(v)<5;r||(r=w?xe.restSpeed.granular:xe.restSpeed.default),o||(o=w?xe.restDelta.granular:xe.restDelta.default);let b,C,P,R,M,j;if(y<1)P=Ii(x,y),R=(g+y*x*v)/P,b=E=>{const N=Math.exp(-y*x*E);return i-N*(R*Math.sin(P*E)+v*Math.cos(P*E))},M=y*x*R+v*P,j=y*x*v-R*P,C=E=>Math.exp(-y*x*E)*(M*Math.sin(P*E)+j*Math.cos(P*E));else if(y===1){b=N=>i-Math.exp(-x*N)*(v+(g+x*v)*N);const E=g+x*v;C=N=>Math.exp(-x*N)*(x*E*N-g)}else{const E=x*Math.sqrt(y*y-1);b=V=>{const q=Math.exp(-y*x*V),G=Math.min(E*V,300);return i-q*((g+y*x*v)*Math.sinh(G)+E*v*Math.cosh(G))/E};const N=(g+y*x*v)/E,O=y*x*N-v*E,$=y*x*v-N*E;C=V=>{const q=Math.exp(-y*x*V),G=Math.min(E*V,300);return q*(O*Math.sinh(G)+$*Math.cosh(G))}}const T={calculatedDuration:m&&f||null,velocity:E=>Xe(C(E)),next:E=>{if(!m&&y<1){const O=Math.exp(-y*x*E),$=Math.sin(P*E),V=Math.cos(P*E),q=i-O*(R*$+v*V),G=Xe(O*(M*$+j*V));return a.done=Math.abs(G)<=r&&Math.abs(i-q)<=o,a.value=a.done?i:q,a}const N=b(E);if(m)a.done=E>=f;else{const O=Xe(C(E));a.done=Math.abs(O)<=r&&Math.abs(i-N)<=o}return a.value=a.done?i:N,a},toString:()=>{const E=Math.min(Ua(T),Ko),N=vf(O=>T.next(E*O).value,E,30);return E+"ms "+N},toTransition:()=>{}};return T}Yo.applyToOptions=t=>{const e=Uv(t,100,Yo);return t.ease=e.ease,t.duration=Xe(e.duration),t.type="keyframes",t};const Zv=5;function xf(t,e,n){const r=Math.max(e-Zv,0);return Zd(n-t(r),e-r)}function ki({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=t[0],h={done:!1,value:f},m=j=>a!==void 0&&j<a||c!==void 0&&j>c,g=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let y=n*e;const v=f+y,x=i===void 0?v:i(v);x!==v&&(y=x-f);const w=j=>-y*Math.exp(-j/r),b=j=>x+w(j),C=j=>{const T=w(j),E=b(j);h.done=Math.abs(T)<=u,h.value=h.done?x:E};let P,R;const M=j=>{m(h.value)&&(P=j,R=Yo({keyframes:[h.value,g(h.value)],velocity:xf(b,j,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return M(0),{calculatedDuration:null,next:j=>{let T=!1;return!R&&P===void 0&&(T=!0,C(j),M(j)),P!==void 0&&j>=P?R.next(j-P):(!T&&C(j),h)}}}function Qv(t,e,n){const r=[],o=n||en.mix||yf,s=t.length-1;for(let i=0;i<s;i++){let a=o(t[i],t[i+1]);if(e){const c=Array.isArray(e)?e[i]||ft:e;a=Lr(c,a)}r.push(a)}return r}function Jv(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;if(Vt(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const i=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Qv(e,r,o),c=a.length,u=d=>{if(i&&d<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const h=Pr(t[f],t[f+1],d);return a[f](h)};return n?d=>u(kt(t[0],t[s-1],d)):u}function ex(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=Pr(0,e,r);t.push(ye(n,1,o))}}function tx(t){const e=[0];return ex(e,t.length-1),e}function nx(t,e){return t.map(n=>n*e)}function rx(t,e){return t.map(()=>e||af).splice(0,t.length-1)}function Un({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=fv(r)?r.map(_l):_l(r),s={done:!1,value:e[0]},i=nx(n&&n.length===e.length?n:tx(e),t),a=Jv(i,e,{ease:Array.isArray(o)?o:rx(e,o)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const ox=t=>t!==null;function is(t,{repeat:e,repeatType:n="loop"},r,o=1){const s=t.filter(ox),a=o<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const sx={decay:ki,inertia:ki,tween:Un,keyframes:Un,spring:Yo};function bf(t){typeof t.type=="string"&&(t.type=sx[t.type])}class Ha{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const ix=t=>t/100;class Xo extends Ha{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==He.now()&&this.tick(He.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;bf(e);const{type:n=Un,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=e;let{keyframes:a}=e;const c=n||Un;process.env.NODE_ENV!=="production"&&c!==Un&&Vt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Un&&typeof a[0]!="number"&&(this.mixKeyframes=Lr(ix,yf(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=Ua(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:m,type:g,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-o/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let b=this.currentTime,C=r;if(f){const j=Math.min(this.currentTime,o)/a;let T=Math.floor(j),E=j%1;!E&&j>=1&&(E=1),E===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(h==="reverse"?(E=1-E,m&&(E-=m/a)):h==="mirror"&&(C=i)),b=kt(0,1,E)*a}let P;w?(this.delayState.value=d[0],P=this.delayState):P=C.next(b),s&&!w&&(P.value=s(P.value));let{done:R}=P;!w&&c!==null&&(R=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return M&&g!==ki&&(P.value=is(d,this.options,v,this.speed)),y&&y(P.value),M&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return dt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+dt(e)}get time(){return dt(this.currentTime)}set time(e){e=Xe(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return xf(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(He.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=dt(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:e=zv,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(He.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function ax(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Cn=t=>t*180/Math.PI,Ni=t=>{const e=Cn(Math.atan2(t[1],t[0]));return _i(e)},cx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ni,rotateZ:Ni,skewX:t=>Cn(Math.atan(t[1])),skewY:t=>Cn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},_i=t=>(t=t%360,t<0&&(t+=360),t),Gl=Ni,zl=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ul=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),lx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:zl,scaleY:Ul,scale:t=>(zl(t)+Ul(t))/2,rotateX:t=>_i(Cn(Math.atan2(t[6],t[5]))),rotateY:t=>_i(Cn(Math.atan2(-t[2],t[0]))),rotateZ:Gl,rotate:Gl,skewX:t=>Cn(Math.atan(t[4])),skewY:t=>Cn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Oi(t){return t.includes("scale")?1:0}function Li(t,e){if(!t||t==="none")return Oi(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=lx,o=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=cx,o=a}if(!o)return Oi(e);const s=r[e],i=o[1].split(",").map(dx);return typeof s=="function"?s(i):i[s]}const ux=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Li(n,e)};function dx(t){return parseFloat(t.trim())}const or=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sr=new Set(or),Hl=t=>t===rr||t===ee,fx=new Set(["x","y","z"]),hx=or.filter(t=>!fx.has(t));function px(t){const e=[];return hx.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Qt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Li(e,"x"),y:(t,{transform:e})=>Li(e,"y")};Qt.translateX=Qt.x;Qt.translateY=Qt.y;const Sn=new Set;let $i=!1,Fi=!1,Vi=!1;function wf(){if(Fi){const t=Array.from(Sn).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const o=px(r);o.length&&(n.set(r,o),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Fi=!1,$i=!1,Sn.forEach(t=>t.complete(Vi)),Sn.clear()}function Cf(){Sn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fi=!0)})}function mx(){Vi=!0,Cf(),wf(),Vi=!1}class Wa{constructor(e,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Sn.add(this),$i||($i=!0,pe.read(Cf),pe.resolveKeyframes(wf))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:o}=this;if(e[0]===null){const s=o==null?void 0:o.get(),i=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=i),o&&s===void 0&&o.set(e[0])}ax(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Sn.delete(this)}cancel(){this.state==="scheduled"&&(Sn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const gx=t=>t.startsWith("--");function Sf(t,e,n){gx(e)?t.style.setProperty(e,n):t.style[e]=n}const yx={};function Pf(t,e){const n=qd(t);return()=>yx[e]??n()}const vx=Pf(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Rf=Pf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),vr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Wl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:vr([0,.65,.55,1]),circOut:vr([.55,0,1,.45]),backIn:vr([.31,.01,.66,-.59]),backOut:vr([.33,1.53,.69,.99])};function Tf(t,e){if(t)return typeof t=="function"?Rf()?vf(t,e):"ease-out":cf(t)?vr(t):Array.isArray(t)?t.map(n=>Tf(n,e)||Wl.easeOut):Wl[t]}function xx(t,e,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const f=Tf(a,o);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(d,h)}function Mf(t){return typeof t=="function"&&"applyToOptions"in t}function bx({type:t,...e}){return Mf(t)&&Rf()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ef extends Ha{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=e,Vt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=bx(e);this.animation=xx(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=is(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Sf(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,o;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return dt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+dt(e)}get time(){return dt(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Xe(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&vx()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ft):o(this)}}const jf={anticipate:rf,backInOut:nf,circInOut:sf};function wx(t){return t in jf}function Cx(t){typeof t.ease=="string"&&wx(t.ease)&&(t.ease=jf[t.ease])}const Zs=10;class Sx extends Ef{constructor(e){Cx(e),bf(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Xo({...i,autoplay:!1}),c=Math.max(Zs,He.now()-this.startTime),u=kt(0,Zs,c-Zs),d=a.sample(c).value,{name:f}=this.options;s&&f&&Sf(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const Kl=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(yt.test(t)||t==="0")&&!t.startsWith("url("));function Px(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Rx(t,e,n,r){const o=t[0];if(o===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],i=Kl(o,e),a=Kl(s,e);return nr(i===a,`You are trying to animate ${e} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:Px(t)||(n==="spring"||Mf(n))&&r}function Bi(t){t.duration=0,t.type="keyframes"}const Af=new Set(["opacity","clipPath","filter","transform"]),Tx=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Mx(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Tx.test(t[e]))return!0;return!1}const Ex=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),jx=qd(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ax(t){var f;const{motionValue:e,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=t;if(!(((f=e==null?void 0:e.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return jx()&&n&&(Af.has(n)||Ex.has(n)&&Mx(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const Dx=40;class Ix extends Ha{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:d,...f}){var g;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=He.now();const h={autoplay:e,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},m=(d==null?void 0:d.KeyframeResolver)||Wa;this.keyframeResolver=new m(a,(y,v,x)=>this.onKeyframesResolved(y,v,h,!x),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(e,n,r,o){var x,w;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=He.now();let f=!0;Rx(e,s,i,a)||(f=!1,(en.instantAnimations||!c)&&(d==null||d(is(e,r,n))),e[0]=e[e.length-1],Bi(r),r.repeat=0);const m={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Dx?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},g=f&&!u&&Ax(m),y=(w=(x=m.motionValue)==null?void 0:x.owner)==null?void 0:w.current;let v;if(g)try{v=new Sx({...m,element:y})}catch{v=new Xo(m)}else v=new Xo(m);v.finished.then(()=>{this.notifyFinished()}).catch(ft),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),mx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Df(t,e,n,r=0,o=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),i=t.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const kx=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Nx(t){const e=kx.exec(t);if(!e)return[,];const[,n,r,o]=e;return[`--${n??r}`,o]}const _x=4;function If(t,e,n=1){Vt(n<=_x,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Nx(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const i=s.trim();return Kd(i)?parseFloat(i):i}return Va(o)?If(o,e,n+1):o}const Ox={type:"spring",stiffness:500,damping:25,restSpeed:10},Lx=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$x={type:"keyframes",duration:.8},Fx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Vx=(t,{keyframes:e})=>e.length>2?$x:sr.has(t)?t.startsWith("scale")?Lx(e[1]):Ox:Fx;function kf(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Ka(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?kf(n,t):n}const Bx=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Gx(t){for(const e in t)if(!Bx.has(e))return!0;return!1}const Ya=(t,e,n,r={},o,s)=>i=>{const a=Ka(r,t)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Xe(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};Gx(a)||Object.assign(d,Vx(t,d)),d.duration&&(d.duration=Xe(d.duration)),d.repeatDelay&&(d.repeatDelay=Xe(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Bi(d),d.delay===0&&(f=!0)),(en.instantAnimations||en.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,Bi(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&e.get()!==void 0){const h=is(d.keyframes,a);if(h!==void 0){pe.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new Xo(d):new Ix(d)};function Yl(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Xa(t,e,n,r){if(typeof e=="function"){const[o,s]=Yl(r);e=e(n!==void 0?n:t.custom,o,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[o,s]=Yl(r);e=e(n!==void 0?n:t.custom,o,s)}return e}function Pn(t,e,n){const r=t.getProps();return Xa(r,e,n!==void 0?n:r.custom,t)}const Nf=new Set(["width","height","top","left","right","bottom",...or]),Xl=30,zx=t=>!isNaN(parseFloat(t));class Ux{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=He.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=He.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=zx(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&La(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Oa);const r=this.events[e].add(n);return e==="change"?()=>{r(),pe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=He.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Xl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xl);return Zd(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zn(t,e){return new Ux(t,e)}const Gi=t=>Array.isArray(t);function Hx(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Zn(n))}function Wx(t){return Gi(t)?t[t.length-1]||0:t}function Kx(t,e){const n=Pn(t,e);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=Wx(s[i]);Hx(t,i,a)}}const Le=t=>!!(t&&t.getVelocity);function Yx(t){return!!(Le(t)&&t.add)}function zi(t,e){const n=t.getValue("willChange");if(Yx(n))return n.add(e);if(!n&&en.WillChange){const r=new en.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function qa(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Xx="framerAppearId",_f="data-"+qa(Xx);function Of(t){return t.props[_f]}function qx({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Lf(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=e;const c=t.getDefaultTransition();s=s?kf(s,c):c;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&t.animationState&&t.animationState.getState()[o];for(const h in a){const m=t.getValue(h,t.latestValues[h]??null),g=a[h];if(g===void 0||f&&qx(f,h))continue;const y={delay:n,...Ka(s||{},h)},v=m.get();if(v!==void 0&&!m.isAnimating()&&!Array.isArray(g)&&g===v&&!y.velocity){pe.update(()=>m.set(g));continue}let x=!1;if(window.MotionHandoffAnimation){const C=Of(t);if(C){const P=window.MotionHandoffAnimation(C,h,pe);P!==null&&(y.startTime=P,x=!0)}}zi(t,h);const w=u??t.shouldReduceMotion;m.start(Ya(h,m,g,w&&Nf.has(h)?{type:!1}:y,t,x));const b=m.animation;b&&d.push(b)}if(i){const h=()=>pe.update(()=>{i&&Kx(t,i)});d.length?Promise.all(d).then(h):h()}return d}function Ui(t,e,n={}){var c;const r=Pn(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Lf(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return Zx(t,e,u,d,f,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[u,d]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(n.delay)])}function Zx(t,e,n=0,r=0,o=0,s=1,i){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(Ui(c,e,{...i,delay:n+(typeof r=="function"?0:r)+Df(t.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Qx(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const o=e.map(s=>Ui(t,s,n));r=Promise.all(o)}else if(typeof e=="string")r=Ui(t,e,n);else{const o=typeof e=="function"?Pn(t,e,n.custom):e;r=Promise.all(Lf(t,o,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Jx={test:t=>t==="auto",parse:t=>t},$f=t=>e=>e.test(t),Ff=[rr,ee,Dt,qt,Pv,Sv,Jx],ql=t=>Ff.find($f(t));function eb(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Xd(t):!0}const tb=new Set(["brightness","contrast","saturate","opacity"]);function nb(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Ba)||[];if(!r)return t;const o=n.replace(r,"");let s=tb.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const rb=/\b([a-z-]*)\(.*?\)/gu,Hi={...yt,getAnimatableNone:t=>{const e=t.match(rb);return e?e.map(nb).join(" "):t}},Wi={...yt,getAnimatableNone:t=>{const e=yt.parse(t);return yt.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Zl={...rr,transform:Math.round},ob={rotate:qt,rotateX:qt,rotateY:qt,rotateZ:qt,scale:fo,scaleX:fo,scaleY:fo,scaleZ:fo,skew:qt,skewX:qt,skewY:qt,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:Rr,originX:Ll,originY:Ll,originZ:ee},Za={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,inset:ee,insetBlock:ee,insetBlockStart:ee,insetBlockEnd:ee,insetInline:ee,insetInlineStart:ee,insetInlineEnd:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,paddingBlock:ee,paddingBlockStart:ee,paddingBlockEnd:ee,paddingInline:ee,paddingInlineStart:ee,paddingInlineEnd:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,marginBlock:ee,marginBlockStart:ee,marginBlockEnd:ee,marginInline:ee,marginInlineStart:ee,marginInlineEnd:ee,fontSize:ee,backgroundPositionX:ee,backgroundPositionY:ee,...ob,zIndex:Zl,fillOpacity:Rr,strokeOpacity:Rr,numOctaves:Zl},sb={...Za,color:Re,backgroundColor:Re,outlineColor:Re,fill:Re,stroke:Re,borderColor:Re,borderTopColor:Re,borderRightColor:Re,borderBottomColor:Re,borderLeftColor:Re,filter:Hi,WebkitFilter:Hi,mask:Wi,WebkitMask:Wi},Vf=t=>sb[t],ib=new Set([Hi,Wi]);function Bf(t,e){let n=Vf(t);return ib.has(n)||(n=yt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ab=new Set(["auto","none","0"]);function cb(t,e,n){let r=0,o;for(;r<t.length&&!o;){const s=t[r];typeof s=="string"&&!ab.has(s)&&qn(s).values.length&&(o=t[r]),r++}if(o&&n)for(const s of e)t[s]=Bf(n,o)}class lb extends Wa{constructor(e,n,r,o,s){super(e,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let f=e[d];if(typeof f=="string"&&(f=f.trim(),Va(f))){const h=If(f,n.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Nf.has(r)||e.length!==2)return;const[o,s]=e,i=ql(o),a=ql(s),c=Ol(o),u=Ol(s);if(c!==u&&Qt[r]){this.needsMeasurement=!0;return}if(i!==a)if(Hl(i)&&Hl(a))for(let d=0;d<e.length;d++){const f=e[d];typeof f=="string"&&(e[d]=parseFloat(f))}else Qt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let o=0;o<e.length;o++)(e[o]===null||eb(e[o]))&&r.push(o);r.length&&cb(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&e.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const o=e.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=Qt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Gf(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const o=(n==null?void 0:n[t])??r.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(r=>r!=null)}const zf=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Io(t){return Yd(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Qa}=lf(queueMicrotask,!1),mt={x:!1,y:!1};function Uf(){return mt.x||mt.y}function ub(t){return t==="x"||t==="y"?mt[t]?null:(mt[t]=!0,()=>{mt[t]=!1}):mt.x||mt.y?null:(mt.x=mt.y=!0,()=>{mt.x=mt.y=!1})}function Hf(t,e){const n=Gf(t),r=new AbortController,o={passive:!0,...e,signal:r.signal};return[n,o,()=>r.abort()]}function db(t){return!(t.pointerType==="touch"||Uf())}function fb(t,e,n={}){const[r,o,s]=Hf(t,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",g)},f=v=>{u&&(u(v),u=void 0),d()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(v))},m=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},g=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}f(v)}},y=v=>{if(!db(v))return;c=!1;const x=e(i,v);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",g,o))};i.addEventListener("pointerenter",y,o),i.addEventListener("pointerdown",m,o)}),s}const Wf=(t,e)=>e?t===e?!0:Wf(t,e.parentElement):!1,Ja=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,hb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pb(t){return hb.has(t.tagName)||t.isContentEditable===!0}const mb=new Set(["INPUT","SELECT","TEXTAREA"]);function gb(t){return mb.has(t.tagName)||t.isContentEditable===!0}const ko=new WeakSet;function Ql(t){return e=>{e.key==="Enter"&&t(e)}}function Qs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const yb=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Ql(()=>{if(ko.has(n))return;Qs(n,"down");const o=Ql(()=>{Qs(n,"up")}),s=()=>Qs(n,"cancel");n.addEventListener("keyup",o,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Jl(t){return Ja(t)&&!Uf()}const eu=new WeakSet;function vb(t,e,n={}){const[r,o,s]=Hf(t,n),i=a=>{const c=a.currentTarget;if(!Jl(a)||eu.has(a))return;ko.add(c),n.stopPropagation&&eu.add(a);const u=e(c,a),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),ko.has(c)&&ko.delete(c),Jl(m)&&typeof u=="function"&&u(m,{success:g})},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||Wf(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Io(a)&&(a.addEventListener("focus",u=>yb(u,o)),!pb(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function ec(t){return Yd(t)&&"ownerSVGElement"in t}const No=new WeakMap;let Zt;const Kf=(t,e,n)=>(r,o)=>o&&o[0]?o[0][t+"Size"]:ec(r)&&"getBBox"in r?r.getBBox()[e]:r[n],xb=Kf("inline","width","offsetWidth"),bb=Kf("block","height","offsetHeight");function wb({target:t,borderBoxSize:e}){var n;(n=No.get(t))==null||n.forEach(r=>{r(t,{get width(){return xb(t,e)},get height(){return bb(t,e)}})})}function Cb(t){t.forEach(wb)}function Sb(){typeof ResizeObserver>"u"||(Zt=new ResizeObserver(Cb))}function Pb(t,e){Zt||Sb();const n=Gf(t);return n.forEach(r=>{let o=No.get(r);o||(o=new Set,No.set(r,o)),o.add(e),Zt==null||Zt.observe(r)}),()=>{n.forEach(r=>{const o=No.get(r);o==null||o.delete(e),o!=null&&o.size||Zt==null||Zt.unobserve(r)})}}const _o=new Set;let Hn;function Rb(){Hn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};_o.forEach(e=>e(t))},window.addEventListener("resize",Hn)}function Tb(t){return _o.add(t),Hn||Rb(),()=>{_o.delete(t),!_o.size&&typeof Hn=="function"&&(window.removeEventListener("resize",Hn),Hn=void 0)}}function tu(t,e){return typeof t=="function"?Tb(t):Pb(t,e)}function Mb(t){return ec(t)&&t.tagName==="svg"}const Eb=[...Ff,Re,yt],jb=t=>Eb.find($f(t)),nu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wn=()=>({x:nu(),y:nu()}),ru=()=>({min:0,max:0}),je=()=>({x:ru(),y:ru()}),Ab=new WeakMap;function as(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Tr(t){return typeof t=="string"||Array.isArray(t)}const tc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],nc=["initial",...tc];function cs(t){return as(t.animate)||nc.some(e=>Tr(t[e]))}function Yf(t){return!!(cs(t)||t.variants)}function Db(t,e,n){for(const r in e){const o=e[r],s=n[r];if(Le(o))t.addValue(r,o);else if(Le(s))t.addValue(r,Zn(o,{owner:t}));else if(s!==o)if(t.hasValue(r)){const i=t.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=t.getStaticValue(r);t.addValue(r,Zn(i!==void 0?i:o,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Ki={current:null},Xf={current:!1},Ib=typeof window<"u";function kb(){if(Xf.current=!0,!!Ib)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ki.current=t.matches;t.addEventListener("change",e),e()}else Ki.current=!1}const ou=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let qo={};function qf(t){qo=t}function Nb(){return qo}class _b{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Wa,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=He.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,pe.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=cs(n),this.isVariantNode=Yf(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const g=h[m];u[m]!==void 0&&Le(g)&&g.set(u[m])}}mount(e){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=e,Ab.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Xf.current||kb(),this.shouldReduceMotion=Ki.current),process.env.NODE_ENV!=="production"&&La(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),tn(this.notifyUpdate),tn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Af.has(e)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new Ef({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:Xe(d)}),h=i(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const r=sr.has(e);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[e]=i,this.props.onUpdate&&pe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in qo){const n=qo[e];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[e]&&o&&r(this.props)&&(this.features[e]=new o(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):je()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<ou.length;r++){const o=ou[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=e[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Db(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Zn(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(Kd(r)||Xd(r))?r=parseFloat(r):!jb(r)&&yt.test(n)&&(r=Bf(e,n)),this.setBaseTarget(e,Le(r)?r.get():r)),Le(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Xa(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[e])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!Le(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Oa),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Qa.render(this.render)}}class Zf extends _b{constructor(){super(...arguments),this.KeyframeResolver=lb}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Le(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ln{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Qf({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Ob({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Lb(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Js(t){return t===void 0||t===1}function Yi({scale:t,scaleX:e,scaleY:n}){return!Js(t)||!Js(e)||!Js(n)}function bn(t){return Yi(t)||Jf(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Jf(t){return su(t.x)||su(t.y)}function su(t){return t&&t!=="0%"}function Zo(t,e,n){const r=t-n,o=e*r;return n+o}function iu(t,e,n,r,o){return o!==void 0&&(t=Zo(t,o,r)),Zo(t,n,r)+e}function Xi(t,e=0,n=1,r,o){t.min=iu(t.min,e,n,r,o),t.max=iu(t.max,e,n,r,o)}function eh(t,{x:e,y:n}){Xi(t.x,e.translate,e.scale,e.originPoint),Xi(t.y,n.translate,n.scale,n.originPoint)}const au=.999999999999,cu=1.0000000000001;function $b(t,e,n,r=!1){var a;const o=n.length;if(!o)return;e.x=e.y=1;let s,i;for(let c=0;c<o;c++){s=n[c],i=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Et(t.x,-s.scroll.offset.x),Et(t.y,-s.scroll.offset.y)),i&&(e.x*=i.x.scale,e.y*=i.y.scale,eh(t,i)),r&&bn(s.latestValues)&&Oo(t,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}e.x<cu&&e.x>au&&(e.x=1),e.y<cu&&e.y>au&&(e.y=1)}function Et(t,e){t.min+=e,t.max+=e}function lu(t,e,n,r,o=.5){const s=ye(t.min,t.max,o);Xi(t,e,n,s,r)}function uu(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Oo(t,e,n){const r=n??t;lu(t.x,uu(e.x,r.x),e.scaleX,e.scale,e.originX),lu(t.y,uu(e.y,r.y),e.scaleY,e.scale,e.originY)}function th(t,e){return Qf(Lb(t.getBoundingClientRect(),e))}function Fb(t,e,n){const r=th(t,n),{scroll:o}=e;return o&&(Et(r.x,o.offset.x),Et(r.y,o.offset.y)),r}const Vb={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bb=or.length;function Gb(t,e,n){let r="",o=!0;for(let s=0;s<Bb;s++){const i=or[s],a=t[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const u=parseFloat(a);c=i.startsWith("scale")?u===1:u===0}if(!c||n){const u=zf(a,Za[i]);if(!c){o=!1;const d=Vb[i]||i;r+=`${d}(${u}) `}n&&(e[i]=u)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}function rc(t,e,n){const{style:r,vars:o,transformOrigin:s}=t;let i=!1,a=!1;for(const c in e){const u=e[c];if(sr.has(c)){i=!0;continue}else if(df(c)){o[c]=u;continue}else{const d=zf(u,Za[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(e.transform||(i||n?r.transform=Gb(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function nh(t,{style:e,vars:n},r,o){const s=t.style;let i;for(i in e)s[i]=e[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function du(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gr={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(ee.test(t))t=parseFloat(t);else return t;const n=du(t,e.target.x),r=du(t,e.target.y);return`${n}% ${r}%`}},zb={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=yt.parse(t);if(o.length>5)return r;const s=yt.createTransformer(t),i=typeof o[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;o[0+i]/=a,o[1+i]/=c;const u=ye(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},qi={borderRadius:{...gr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gr,borderTopRightRadius:gr,borderBottomLeftRadius:gr,borderBottomRightRadius:gr,boxShadow:zb};function rh(t,{layout:e,layoutId:n}){return sr.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!qi[t]||t==="opacity")}function oc(t,e,n){var i;const r=t.style,o=e==null?void 0:e.style,s={};if(!r)return s;for(const a in r)(Le(r[a])||o&&Le(o[a])||rh(a,t)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Ub(t){return window.getComputedStyle(t)}class Hb extends Zf{constructor(){super(...arguments),this.type="html",this.renderInstance=nh}readValueFromInstance(e,n){var r;if(sr.has(n))return(r=this.projection)!=null&&r.isProjecting?Oi(n):ux(e,n);{const o=Ub(e),s=(df(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return th(e,n)}build(e,n,r){rc(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return oc(e,n,r)}}const Wb={offset:"stroke-dashoffset",array:"stroke-dasharray"},Kb={offset:"strokeDashoffset",array:"strokeDasharray"};function Yb(t,e,n=1,r=0,o=!0){t.pathLength=1;const s=o?Wb:Kb;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const Xb=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function oh(t,{attrX:e,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(rc(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const m of Xb)f[m]!==void 0&&(h[m]=f[m],delete f[m]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Yb(f,o,s,i,!1)}const sh=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ih=t=>typeof t=="string"&&t.toLowerCase()==="svg";function qb(t,e,n,r){nh(t,e,void 0,r);for(const o in e.attrs)t.setAttribute(sh.has(o)?o:qa(o),e.attrs[o])}function ah(t,e,n){const r=oc(t,e,n);for(const o in t)if(Le(t[o])||Le(e[o])){const s=or.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=t[o]}return r}class Zb extends Zf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=je}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(sr.has(n)){const r=Vf(n);return r&&r.default||0}return n=sh.has(n)?n:qa(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return ah(e,n,r)}build(e,n,r){oh(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,o){qb(e,n,r,o)}mount(e){this.isSVGTag=ih(e.tagName),super.mount(e)}}const Qb=nc.length;function ch(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ch(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Qb;n++){const r=nc[n],o=t.props[r];(Tr(o)||o===!1)&&(e[r]=o)}return e}function lh(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const Jb=[...tc].reverse(),ew=tc.length;function tw(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Qx(t,n,r)))}function nw(t){let e=tw(t),n=fu(),r=!0,o=!1;const s=u=>(d,f)=>{var m;const h=Pn(t,f,u==="exit"?(m=t.presenceContext)==null?void 0:m.custom:void 0);if(h){const{transition:g,transitionEnd:y,...v}=h;d={...d,...v,...y}}return d};function i(u){e=u(t)}function a(u){const{props:d}=t,f=ch(t.parent)||{},h=[],m=new Set;let g={},y=1/0;for(let x=0;x<ew;x++){const w=Jb[x],b=n[w],C=d[w]!==void 0?d[w]:f[w],P=Tr(C),R=w===u?b.isActive:null;R===!1&&(y=x);let M=C===f[w]&&C!==d[w]&&P;if(M&&(r||o)&&t.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...g},!b.isActive&&R===null||!C&&!b.prevProp||as(C)||typeof C=="boolean")continue;if(w==="exit"&&b.isActive&&R!==!0){b.prevResolvedValues&&(g={...g,...b.prevResolvedValues});continue}const j=rw(b.prevProp,C);let T=j||w===u&&b.isActive&&!M&&P||x>y&&P,E=!1;const N=Array.isArray(C)?C:[C];let O=N.reduce(s(w),{});R===!1&&(O={});const{prevResolvedValues:$={}}=b,V={...$,...O},q=F=>{T=!0,m.has(F)&&(E=!0,m.delete(F)),b.needsAnimating[F]=!0;const L=t.getValue(F);L&&(L.liveStyle=!1)};for(const F in V){const L=O[F],D=$[F];if(g.hasOwnProperty(F))continue;let X=!1;Gi(L)&&Gi(D)?X=!lh(L,D):X=L!==D,X?L!=null?q(F):m.add(F):L!==void 0&&m.has(F)?q(F):b.protectedKeys[F]=!0}b.prevProp=C,b.prevResolvedValues=O,b.isActive&&(g={...g,...O}),(r||o)&&t.blockInitialAnimation&&(T=!1);const G=M&&j;T&&(!G||E)&&h.push(...N.map(F=>{const L={type:w};if(typeof F=="string"&&(r||o)&&!G&&t.manuallyAnimateOnMount&&t.parent){const{parent:D}=t,X=Pn(D,F);if(D.enteringChildren&&X){const{delayChildren:A}=X.transition||{};L.delay=Df(D.enteringChildren,t,A)}}return{animation:F,options:L}}))}if(m.size){const x={};if(typeof d.initial!="boolean"){const w=Pn(t,Array.isArray(d.initial)?d.initial[0]:d.initial);w&&w.transition&&(x.transition=w.transition)}m.forEach(w=>{const b=t.getBaseTarget(w),C=t.getValue(w);C&&(C.liveStyle=!0),x[w]=b??null}),h.push({animation:x})}let v=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(v=!1),r=!1,o=!1,v?e(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=fu(),o=!0}}}function rw(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!lh(e,t):!1}function vn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fu(){return{animate:vn(!0),whileInView:vn(),whileHover:vn(),whileTap:vn(),whileDrag:vn(),whileFocus:vn(),exit:vn()}}function Zi(t,e){t.min=e.min,t.max=e.max}function pt(t,e){Zi(t.x,e.x),Zi(t.y,e.y)}function hu(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const uh=1e-4,ow=1-uh,sw=1+uh,dh=.01,iw=0-dh,aw=0+dh;function We(t){return t.max-t.min}function cw(t,e,n){return Math.abs(t-e)<=n}function pu(t,e,n,r=.5){t.origin=r,t.originPoint=ye(e.min,e.max,t.origin),t.scale=We(n)/We(e),t.translate=ye(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ow&&t.scale<=sw||isNaN(t.scale))&&(t.scale=1),(t.translate>=iw&&t.translate<=aw||isNaN(t.translate))&&(t.translate=0)}function wr(t,e,n,r){pu(t.x,e.x,n.x,r?r.originX:void 0),pu(t.y,e.y,n.y,r?r.originY:void 0)}function mu(t,e,n,r=0){const o=r?ye(n.min,n.max,r):n.min;t.min=o+e.min,t.max=t.min+We(e)}function lw(t,e,n,r){mu(t.x,e.x,n.x,r==null?void 0:r.x),mu(t.y,e.y,n.y,r==null?void 0:r.y)}function gu(t,e,n,r=0){const o=r?ye(n.min,n.max,r):n.min;t.min=e.min-o,t.max=t.min+We(e)}function Qo(t,e,n,r){gu(t.x,e.x,n.x,r==null?void 0:r.x),gu(t.y,e.y,n.y,r==null?void 0:r.y)}function yu(t,e,n,r,o){return t-=e,t=Zo(t,1/n,r),o!==void 0&&(t=Zo(t,1/o,r)),t}function uw(t,e=0,n=1,r=.5,o,s=t,i=t){if(Dt.test(e)&&(e=parseFloat(e),e=ye(i.min,i.max,e/100)-i.min),typeof e!="number")return;let a=ye(s.min,s.max,r);t===s&&(a-=e),t.min=yu(t.min,e,n,a,o),t.max=yu(t.max,e,n,a,o)}function vu(t,e,[n,r,o],s,i){uw(t,e[n],e[r],e[o],e.scale,s,i)}const dw=["x","scaleX","originX"],fw=["y","scaleY","originY"];function xu(t,e,n,r){vu(t.x,e,dw,n?n.x:void 0,r?r.x:void 0),vu(t.y,e,fw,n?n.y:void 0,r?r.y:void 0)}function bu(t){return t.translate===0&&t.scale===1}function fh(t){return bu(t.x)&&bu(t.y)}function wu(t,e){return t.min===e.min&&t.max===e.max}function hw(t,e){return wu(t.x,e.x)&&wu(t.y,e.y)}function Cu(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function hh(t,e){return Cu(t.x,e.x)&&Cu(t.y,e.y)}function Su(t){return We(t.x)/We(t.y)}function Pu(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tt(t){return[t("x"),t("y")]}function pw(t,e,n){let r="";const o=t.x.translate/e.x,s=t.y.translate/e.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const ph=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],mw=ph.length,Ru=t=>typeof t=="string"?parseFloat(t):t,Tu=t=>typeof t=="number"||ee.test(t);function gw(t,e,n,r,o,s){o?(t.opacity=ye(0,n.opacity??1,yw(r)),t.opacityExit=ye(e.opacity??1,0,vw(r))):s&&(t.opacity=ye(e.opacity??1,n.opacity??1,r));for(let i=0;i<mw;i++){const a=ph[i];let c=Mu(e,a),u=Mu(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Tu(c)===Tu(u)?(t[a]=Math.max(ye(Ru(c),Ru(u),r),0),(Dt.test(u)||Dt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=ye(e.rotate||0,n.rotate||0,r))}function Mu(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const yw=mh(0,.5,of),vw=mh(.5,.95,ft);function mh(t,e,n){return r=>r<t?0:r>e?1:n(Pr(t,e,r))}function xw(t,e,n){const r=Le(t)?t:Zn(t);return r.start(Ya("",r,e,n)),r.animation}function Mr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const bw=(t,e)=>t.depth-e.depth;class ww{constructor(){this.children=[],this.isDirty=!1}add(e){_a(this.children,e),this.isDirty=!0}remove(e){Ho(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(bw),this.isDirty=!1,this.children.forEach(e)}}function Cw(t,e){const n=He.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(tn(r),t(s-e))};return pe.setup(r,!0),()=>tn(r)}function Lo(t){return Le(t)?t.get():t}class Sw{constructor(){this.members=[]}add(e){_a(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Ho(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Ho(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(e,n){var o;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=e.options;(s===void 0||s!==i)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(o=e.root)!=null&&o.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,o,s,i;(r=(n=e.options).onExitComplete)==null||r.call(n),(i=(o=e.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const $o={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ei=["","X","Y","Z"],Pw=1e3;let Rw=0;function ti(t,e,n,r){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),r&&(r[t]=0))}function gh(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Of(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",pe,!(o||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&gh(r)}function yh({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=e==null?void 0:e()){this.id=Rw++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Ew),this.nodes.forEach(Nw),this.nodes.forEach(_w),this.nodes.forEach(jw)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new ww)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Oa),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=ec(i)&&!Mb(i),this.instance=i;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;pe.read(()=>{f=window.innerWidth}),t(i,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=Cw(h,250),$o.hasAnimatedSinceResize&&($o.hasAnimatedSinceResize=!1,this.nodes.forEach(Au)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||Vw,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=u.getProps(),x=!this.targetLayout||!hh(this.targetLayout,m),w=!f&&h;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...Ka(g,"layout"),onPlay:y,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(d,w)}else f||Au(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),tn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ow),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&gh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Dw),this.nodes.forEach(Eu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ju);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Iw),this.nodes.forEach(kw),this.nodes.forEach(Tw),this.nodes.forEach(Mw)):this.nodes.forEach(ju),this.clearAllSnapshots();const a=He.now();Oe.delta=kt(0,1e3/60,a-Oe.timestamp),Oe.timestamp=a,Oe.isProcessing=!0,Ws.update.process(Oe),Ws.preRender.process(Oe),Ws.render.process(Oe),Oe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qa.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Aw),this.sharedNodes.forEach(Lw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!We(this.snapshot.measuredBox.x)&&!We(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=je()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!fh(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||bn(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Bw(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return je();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Gw))){const{scroll:d}=this.root;d&&(Et(a.x,d.offset.x),Et(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=je();if(pt(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&pt(a,i),Et(a.x,f.offset.x),Et(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||je();pt(u,i);for(let h=0;h<this.path.length;h++){const m=this.path[h];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(Et(u.x,-m.scroll.offset.x),Et(u.y,-m.scroll.offset.y)),bn(m.latestValues)&&Oo(u,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return bn(this.latestValues)&&Oo(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=je();pt(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!bn(d.latestValues))continue;let f;d.instance&&(Yi(d.latestValues)&&d.updateSnapshot(),f=je(),pt(f,d.measurePageBox())),xu(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return bn(this.latestValues)&&xu(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Oe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Oe.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=je(),this.targetWithTransforms=je()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lw(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):pt(this.target,this.layout.layoutBox),eh(this.target,this.targetDelta)):pt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Yi(this.parent.latestValues)||Jf(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=je(),this.relativeTargetOrigin=je(),Qo(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),pt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var g;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Oe.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;pt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;$b(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=je());const{target:m}=i;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(hu(this.prevProjectionDelta.x,this.projectionDelta.x),hu(this.prevProjectionDelta.y,this.projectionDelta.y)),wr(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Pu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wn(),this.projectionDelta=Wn(),this.projectionDeltaWithTransform=Wn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=Wn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=je(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,y=m!==g,v=this.getStack(),x=!v||v.members.length<=1,w=!!(y&&!x&&this.options.crossfade===!0&&!this.path.some(Fw));this.animationProgress=0;let b;this.mixTargetDelta=C=>{const P=C/1e3;Du(f.x,i.x,P),Du(f.y,i.y,P),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qo(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),$w(this.relativeTarget,this.relativeTargetOrigin,h,P),b&&hw(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=je()),pt(b,this.relativeTarget)),y&&(this.animationValues=d,gw(d,u,this.latestValues,P,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(tn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pe.update(()=>{$o.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zn(0)),this.motionValue.jump(0,!1),this.currentAnimation=xw(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),i.onUpdate&&i.onUpdate(d)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Pw),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=i;if(!(!a||!c||!u)){if(this!==i&&this.layout&&u&&vh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||je();const f=We(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=We(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}pt(a,c),Oo(a,d),wr(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Sw),this.sharedNodes.get(i).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&ti("z",i,u,this.animationValues);for(let d=0;d<ei.length;d++)ti(`rotate${ei[d]}`,i,u,this.animationValues),ti(`skew${ei[d]}`,i,u,this.animationValues);i.render();for(const d in u)i.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Lo(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Lo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!bn(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=pw(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:m}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in qi){if(d[g]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:x}=qi[g],w=f==="none"?d[g]:y(d[g],u);if(v){const b=v.length;for(let C=0;C<b;C++)i[v[C]]=w}else x?this.options.visualElement.renderState.vars[g]=w:i[g]=w}this.options.layoutId&&(i.pointerEvents=u===this?Lo(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Eu),this.root.sharedNodes.clear()}}}function Tw(t){t.updateLayout()}function Mw(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=t.layout,{animationType:s}=t.options,i=e.source!==t.layout.source;if(s==="size")Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=We(h);h.min=r[f].min,h.max=h.min+m});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";Zi(i?e.measuredBox[f]:e.layoutBox[f],r[f])}else vh(s,e.layoutBox,r)&&Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=We(r[f]);h.max=h.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+m)});const a=Wn();wr(a,r,e.layoutBox);const c=Wn();i?wr(c,t.applyTransform(o,!0),e.measuredBox):wr(c,r,e.layoutBox);const u=!fh(a);let d=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=t.options.layoutAnchor||void 0,y=je();Qo(y,e.layoutBox,h.layoutBox,g);const v=je();Qo(v,r,m.layoutBox,g),hh(y,v)||(d=!0),f.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=y,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Ew(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function jw(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Aw(t){t.clearSnapshot()}function Eu(t){t.clearMeasurements()}function Dw(t){t.isLayoutDirty=!0,t.updateLayout()}function ju(t){t.isLayoutDirty=!1}function Iw(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function kw(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Au(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Nw(t){t.resolveTargetDelta()}function _w(t){t.calcProjection()}function Ow(t){t.resetSkewAndRotation()}function Lw(t){t.removeLeadSnapshot()}function Du(t,e,n){t.translate=ye(e.translate,0,n),t.scale=ye(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Iu(t,e,n,r){t.min=ye(e.min,n.min,r),t.max=ye(e.max,n.max,r)}function $w(t,e,n,r){Iu(t.x,e.x,n.x,r),Iu(t.y,e.y,n.y,r)}function Fw(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Vw={duration:.45,ease:[.4,0,.1,1]},ku=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Nu=ku("applewebkit/")&&!ku("chrome/")?Math.round:ft;function _u(t){t.min=Nu(t.min),t.max=Nu(t.max)}function Bw(t){_u(t.x),_u(t.y)}function vh(t,e,n){return t==="position"||t==="preserve-aspect"&&!cw(Su(e),Su(n),.2)}function Gw(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const zw=yh({attachResizeListener:(t,e)=>Mr(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),ni={current:void 0},xh=yh({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ni.current){const t=new zw({});t.mount(window),t.setOptions({layoutScroll:!0}),ni.current=t}return ni.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),sc=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ou(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Uw(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Ou(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ou(t[o],null)}}}}function Hw(...t){return p.useCallback(Uw(...t),t)}class Ww extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Io(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Io(r)&&r.offsetWidth||0,s=Io(r)&&r.offsetHeight||0,i=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=o-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Kw({children:t,isPresent:e,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=S.useId(),a=S.useRef(null),c=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=S.useContext(sc),d=((h=t.props)==null?void 0:h.ref)??(t==null?void 0:t.ref),f=Hw(a,d);return S.useInsertionEffect(()=>{const{width:m,height:g,top:y,left:v,right:x,bottom:w}=c.current;if(e||s===!1||!a.current||!m||!g)return;const b=n==="left"?`left: ${v}`:`right: ${x}`,C=r==="bottom"?`bottom: ${w}`:`top: ${y}`;a.current.dataset.motionPopId=i;const P=document.createElement("style");u&&(P.nonce=u);const R=o??document.head;return R.appendChild(P),P.sheet&&P.sheet.insertRule(`
1
+ "use client";"use strict";var Dl=t=>{throw TypeError(t)};var Il=(t,e,n)=>e.has(t)||Dl("Cannot "+n);var Ge=(t,e,n)=>(Il(t,e,"read from private field"),n?n.call(t):e.get(t)),kl=(t,e,n)=>e.has(t)?Dl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Us=(t,e,n,r)=>(Il(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),Da=require("react-dom");function Wd(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const p=Wd(S),Lr=Wd(Da);function W(...t){return t.filter(Boolean).join(" ")}const Kd=S.createContext(void 0);function nv({nonce:t,children:e}){return typeof window<"u"&&t&&(globalThis.__webpack_nonce__=t),l.jsx(Kd.Provider,{value:t,children:e})}function Ia(){return S.useContext(Kd)}function ka({css:t}){const e=Ia();return l.jsx("style",{nonce:e,dangerouslySetInnerHTML:{__html:t}})}const Yd={sm:640,md:768,lg:1024,xl:1280},Hs=["base","sm","md","lg","xl"],rv=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),ov=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),sv=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^ms-/,"-ms-"),iv=t=>t.replace(/[<>]/g,""),av=(t,e)=>typeof e=="number"&&e!==0&&!rv.has(t)?`${e}px`:iv(String(e)),Nl=t=>Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>`${sv(e)}:${av(e,n)};`).join(""),cv=t=>{let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)|0;return(e>>>0).toString(36)};function Na(t){const e={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[a,c]of Object.entries(t))if(ov(c)){r=!0;for(const u of Hs){const d=c[u];d!==void 0&&(n[u][a]=d)}}else e[a]=c;if(!r)return{style:e};Object.assign(n.base,e);const o=[];for(const a of Hs){const c=Nl(n[a]);c&&o.push(`${a}{${c}}`)}const s=`cny-sx-${cv(o.join(""))}`;let i="";for(const a of Hs){const c=Nl(n[a]);c&&(i+=a==="base"?`.${s}{${c}}`:`@media (min-width:${Yd[a]}px){.${s}{${c}}}`)}return{className:s,css:i}}function se(t,e,...n){const r=t?Na(t):void 0;return{className:W(...n,r==null?void 0:r.className),style:r!=null&&r.style||e?{...r==null?void 0:r.style,...e}:void 0,styleTag:r!=null&&r.css?l.jsx(ka,{css:r.css}):null}}const _a=S.createContext({});function Oa(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const lv=typeof window<"u",Xd=lv?S.useLayoutEffect:S.useEffect,ss=S.createContext(null);function La(t,e){t.indexOf(e)===-1&&t.push(e)}function Ho(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const kt=(t,e,n)=>n>e?e:n<t?t:n;function ji(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let rr=()=>{},Vt=()=>{};var Hd;typeof process<"u"&&((Hd=process.env)==null?void 0:Hd.NODE_ENV)!=="production"&&(rr=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(ji(e,n))},Vt=(t,e,n)=>{if(!t)throw new Error(ji(e,n))});const en={},qd=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Zd(t){return typeof t=="object"&&t!==null}const Qd=t=>/^0[^.\s]+$/u.test(t);function Jd(t){let e;return()=>(e===void 0&&(e=t()),e)}const ht=t=>t,uv=(t,e)=>n=>e(t(n)),$r=(...t)=>t.reduce(uv),Rr=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class $a{constructor(){this.subscriptions=[]}add(e){return La(this.subscriptions,e),()=>Ho(this.subscriptions,e)}notify(e,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](e,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ze=t=>t*1e3,ft=t=>t/1e3;function ef(t,e){return e?t*(1e3/e):0}const _l=new Set;function Fa(t,e,n){t||_l.has(e)||(console.warn(ji(e,n)),_l.add(e))}const tf=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,dv=1e-7,fv=12;function hv(t,e,n,r,o){let s,i,a=0;do i=e+(n-e)/2,s=tf(i,r,o)-t,s>0?n=i:e=i;while(Math.abs(s)>dv&&++a<fv);return i}function Fr(t,e,n,r){if(t===e&&n===r)return ht;const o=s=>hv(s,0,1,t,n);return s=>s===0||s===1?s:tf(o(s),e,r)}const nf=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rf=t=>e=>1-t(1-e),of=Fr(.33,1.53,.69,.99),Va=rf(of),sf=nf(Va),af=t=>t>=1?1:(t*=2)<1?.5*Va(t):.5*(2-Math.pow(2,-10*(t-1))),Ba=t=>1-Math.sin(Math.acos(t)),cf=rf(Ba),lf=nf(Ba),pv=Fr(.42,0,1,1),mv=Fr(0,0,.58,1),uf=Fr(.42,0,.58,1),gv=t=>Array.isArray(t)&&typeof t[0]!="number",df=t=>Array.isArray(t)&&typeof t[0]=="number",Ol={linear:ht,easeIn:pv,easeInOut:uf,easeOut:mv,circIn:Ba,circInOut:lf,circOut:cf,backIn:Va,backInOut:sf,backOut:of,anticipate:af},yv=t=>typeof t=="string",Ll=t=>{if(df(t)){Vt(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,o]=t;return Fr(e,n,r,o)}else if(yv(t))return Vt(Ol[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Ol[t];return t},uo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function vv(t,e){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const g=h&&o?n:r;return f&&i.add(d),g.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0;const f=n;n=r,r=f,n.forEach(c),n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const xv=40;function ff(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=uo.reduce((b,C)=>(b[C]=vv(s),b),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:m,postRender:g}=i,y=()=>{const b=en.useManualTiming,C=b?o.timestamp:performance.now();n=!1,b||(o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,xv),1)),o.timestamp=C,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),m.process(o),g.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(y))},v=()=>{n=!0,r=!0,o.isProcessing||t(y)};return{schedule:uo.reduce((b,C)=>{const P=i[C];return b[C]=(R,M=!1,j=!1)=>(n||v(),P.schedule(R,M,j)),b},{}),cancel:b=>{for(let C=0;C<uo.length;C++)i[uo[C]].cancel(b)},state:o,steps:i}}const{schedule:ye,cancel:tn,state:Le,steps:Ws}=ff(typeof requestAnimationFrame<"u"?requestAnimationFrame:ht,!0);let Do;function bv(){Do=void 0}const Ke={now:()=>(Do===void 0&&Ke.set(Le.isProcessing||en.useManualTiming?Le.timestamp:performance.now()),Do),set:t=>{Do=t,queueMicrotask(bv)}},hf=t=>e=>typeof e=="string"&&e.startsWith(t),pf=hf("--"),wv=hf("var(--"),Ga=t=>wv(t)?Cv.test(t.split("/*")[0].trim()):!1,Cv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $l(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const or={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Tr={...or,transform:t=>kt(0,1,t)},fo={...or,default:1},wr=t=>Math.round(t*1e5)/1e5,za=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Sv(t){return t==null}const Pv=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ua=(t,e)=>n=>!!(typeof n=="string"&&Pv.test(n)&&n.startsWith(t)||e&&!Sv(n)&&Object.prototype.hasOwnProperty.call(n,e)),mf=(t,e,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(za);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Rv=t=>kt(0,255,t),Ks={...or,transform:t=>Math.round(Rv(t))},Cn={test:Ua("rgb","red"),parse:mf("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Ks.transform(t)+", "+Ks.transform(e)+", "+Ks.transform(n)+", "+wr(Tr.transform(r))+")"};function Tv(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Ai={test:Ua("#"),parse:Tv,transform:Cn.transform},Vr=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),qt=Vr("deg"),Dt=Vr("%"),ne=Vr("px"),Mv=Vr("vh"),Ev=Vr("vw"),Fl={...Dt,parse:t=>Dt.parse(t)/100,transform:t=>Dt.transform(t*100)},Un={test:Ua("hsl","hue"),parse:mf("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Dt.transform(wr(e))+", "+Dt.transform(wr(n))+", "+wr(Tr.transform(r))+")"},Me={test:t=>Cn.test(t)||Ai.test(t)||Un.test(t),parse:t=>Cn.test(t)?Cn.parse(t):Un.test(t)?Un.parse(t):Ai.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Cn.transform(t):Un.transform(t),getAnimatableNone:t=>{const e=Me.parse(t);return e.alpha=0,Me.transform(e)}},jv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Av(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(za))==null?void 0:e.length)||0)+(((n=t.match(jv))==null?void 0:n.length)||0)>0}const gf="number",yf="color",Dv="var",Iv="var(",Vl="${}",kv=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Zn(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=e.replace(kv,c=>(Me.test(c)?(r.color.push(s),o.push(yf),n.push(Me.parse(c))):c.startsWith(Iv)?(r.var.push(s),o.push(Dv),n.push(c)):(r.number.push(s),o.push(gf),n.push(parseFloat(c))),++s,Vl)).split(Vl);return{values:n,split:a,indexes:r,types:o}}function Nv(t){return Zn(t).values}function vf({split:t,types:e}){const n=t.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],r[s]!==void 0){const i=e[s];i===gf?o+=wr(r[s]):i===yf?o+=Me.transform(r[s]):o+=r[s]}return o}}function _v(t){return vf(Zn(t))}const Ov=t=>typeof t=="number"?0:Me.test(t)?Me.getAnimatableNone(t):t,Lv=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Ov(t);function $v(t){const e=Zn(t);return vf(e)(e.values.map((r,o)=>Lv(r,e.split[o])))}const yt={test:Av,parse:Nv,createTransformer:_v,getAnimatableNone:$v};function Ys(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Fv({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let o=0,s=0,i=0;if(!e)o=s=i=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;o=Ys(c,a,t+1/3),s=Ys(c,a,t),i=Ys(c,a,t-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Wo(t,e){return n=>n>0?e:t}const xe=(t,e,n)=>t+(e-t)*n,Xs=(t,e,n)=>{const r=t*t,o=n*(e*e-r)+r;return o<0?0:Math.sqrt(o)},Vv=[Ai,Cn,Un],Bv=t=>Vv.find(e=>e.test(t));function Bl(t){const e=Bv(t);if(rr(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===Un&&(n=Fv(n)),n}const Gl=(t,e)=>{const n=Bl(t),r=Bl(e);if(!n||!r)return Wo(t,e);const o={...n};return s=>(o.red=Xs(n.red,r.red,s),o.green=Xs(n.green,r.green,s),o.blue=Xs(n.blue,r.blue,s),o.alpha=xe(n.alpha,r.alpha,s),Cn.transform(o))},Di=new Set(["none","hidden"]);function Gv(t,e){return Di.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function zv(t,e){return n=>xe(t,e,n)}function Ha(t){return typeof t=="number"?zv:typeof t=="string"?Ga(t)?Wo:Me.test(t)?Gl:Wv:Array.isArray(t)?xf:typeof t=="object"?Me.test(t)?Gl:Uv:Wo}function xf(t,e){const n=[...t],r=n.length,o=t.map((s,i)=>Ha(s)(s,e[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Uv(t,e){const n={...t,...e},r={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(r[o]=Ha(t[o])(t[o],e[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Hv(t,e){const n=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],i=t.indexes[s][r[s]],a=t.values[i]??0;n[o]=a,r[s]++}return n}const Wv=(t,e)=>{const n=yt.createTransformer(e),r=Zn(t),o=Zn(e);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Di.has(t)&&!o.values.length||Di.has(e)&&!r.values.length?Gv(t,e):$r(xf(Hv(r,o),o.values),n):(rr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Wo(t,e))};function bf(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?xe(t,e,n):Ha(t)(t,e)}const Kv=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ye.update(e,n),stop:()=>tn(e),now:()=>Le.isProcessing?Le.timestamp:Ke.now()}},wf=(t,e,n=10)=>{let r="";const o=Math.max(Math.round(e/n),2);for(let s=0;s<o;s++)r+=Math.round(t(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Ko=2e4;function Wa(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Ko;)e+=n,r=t.next(e);return e>=Ko?1/0:e}function Yv(t,e=100,n){const r=n({...t,keyframes:[0,e]}),o=Math.min(Wa(r),Ko);return{type:"keyframes",ease:s=>r.next(o*s).value/e,duration:ft(o)}}const Ce={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ii(t,e){return t*Math.sqrt(1-e*e)}const Xv=12;function qv(t,e,n){let r=n;for(let o=1;o<Xv;o++)r=r-t(r)/e(r);return r}const qs=.001;function Zv({duration:t=Ce.duration,bounce:e=Ce.bounce,velocity:n=Ce.velocity,mass:r=Ce.mass}){let o,s;rr(t<=Ze(Ce.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-e;i=kt(Ce.minDamping,Ce.maxDamping,i),t=kt(Ce.minDuration,Ce.maxDuration,ft(t)),i<1?(o=u=>{const d=u*i,f=d*t,h=d-n,m=Ii(u,i),g=Math.exp(-f);return qs-h/m*g},s=u=>{const f=u*i*t,h=f*n+n,m=Math.pow(i,2)*Math.pow(u,2)*t,g=Math.exp(-f),y=Ii(Math.pow(u,2),i);return(-o(u)+qs>0?-1:1)*((h-m)*g)/y}):(o=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-qs+d*f},s=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const a=5/t,c=qv(o,s,a);if(t=Ze(t),isNaN(c))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:t};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:t}}}const Qv=["duration","bounce"],Jv=["stiffness","damping","mass"];function zl(t,e){return e.some(n=>t[n]!==void 0)}function ex(t){let e={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...t};if(!zl(t,Jv)&&zl(t,Qv))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*kt(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:Ce.mass,stiffness:o,damping:s}}else{const n=Zv({...t,velocity:0});e={...e,...n,mass:Ce.mass},e.isResolvedFromDuration=!0}return e}function Yo(t=Ce.visualDuration,e=Ce.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=ex({...n,velocity:-ft(n.velocity||0)}),g=h||0,y=u/(2*Math.sqrt(c*d)),v=i-s,x=ft(Math.sqrt(c/d)),w=Math.abs(v)<5;r||(r=w?Ce.restSpeed.granular:Ce.restSpeed.default),o||(o=w?Ce.restDelta.granular:Ce.restDelta.default);let b,C,P,R,M,j;if(y<1)P=Ii(x,y),R=(g+y*x*v)/P,b=E=>{const k=Math.exp(-y*x*E);return i-k*(R*Math.sin(P*E)+v*Math.cos(P*E))},M=y*x*R+v*P,j=y*x*v-R*P,C=E=>Math.exp(-y*x*E)*(M*Math.sin(P*E)+j*Math.cos(P*E));else if(y===1){b=k=>i-Math.exp(-x*k)*(v+(g+x*v)*k);const E=g+x*v;C=k=>Math.exp(-x*k)*(x*E*k-g)}else{const E=x*Math.sqrt(y*y-1);b=G=>{const Q=Math.exp(-y*x*G),V=Math.min(E*G,300);return i-Q*((g+y*x*v)*Math.sinh(V)+E*v*Math.cosh(V))/E};const k=(g+y*x*v)/E,_=y*x*k-v*E,$=y*x*v-k*E;C=G=>{const Q=Math.exp(-y*x*G),V=Math.min(E*G,300);return Q*(_*Math.sinh(V)+$*Math.cosh(V))}}const T={calculatedDuration:m&&f||null,velocity:E=>Ze(C(E)),next:E=>{if(!m&&y<1){const _=Math.exp(-y*x*E),$=Math.sin(P*E),G=Math.cos(P*E),Q=i-_*(R*$+v*G),V=Ze(_*(M*$+j*G));return a.done=Math.abs(V)<=r&&Math.abs(i-Q)<=o,a.value=a.done?i:Q,a}const k=b(E);if(m)a.done=E>=f;else{const _=Ze(C(E));a.done=Math.abs(_)<=r&&Math.abs(i-k)<=o}return a.value=a.done?i:k,a},toString:()=>{const E=Math.min(Wa(T),Ko),k=wf(_=>T.next(E*_).value,E,30);return E+"ms "+k},toTransition:()=>{}};return T}Yo.applyToOptions=t=>{const e=Yv(t,100,Yo);return t.ease=e.ease,t.duration=Ze(e.duration),t.type="keyframes",t};const tx=5;function Cf(t,e,n){const r=Math.max(e-tx,0);return ef(n-t(r),e-r)}function ki({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=t[0],h={done:!1,value:f},m=j=>a!==void 0&&j<a||c!==void 0&&j>c,g=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let y=n*e;const v=f+y,x=i===void 0?v:i(v);x!==v&&(y=x-f);const w=j=>-y*Math.exp(-j/r),b=j=>x+w(j),C=j=>{const T=w(j),E=b(j);h.done=Math.abs(T)<=u,h.value=h.done?x:E};let P,R;const M=j=>{m(h.value)&&(P=j,R=Yo({keyframes:[h.value,g(h.value)],velocity:Cf(b,j,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return M(0),{calculatedDuration:null,next:j=>{let T=!1;return!R&&P===void 0&&(T=!0,C(j),M(j)),P!==void 0&&j>=P?R.next(j-P):(!T&&C(j),h)}}}function nx(t,e,n){const r=[],o=n||en.mix||bf,s=t.length-1;for(let i=0;i<s;i++){let a=o(t[i],t[i+1]);if(e){const c=Array.isArray(e)?e[i]||ht:e;a=$r(c,a)}r.push(a)}return r}function rx(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;if(Vt(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const i=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=nx(e,r,o),c=a.length,u=d=>{if(i&&d<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const h=Rr(t[f],t[f+1],d);return a[f](h)};return n?d=>u(kt(t[0],t[s-1],d)):u}function ox(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=Rr(0,e,r);t.push(xe(n,1,o))}}function sx(t){const e=[0];return ox(e,t.length-1),e}function ix(t,e){return t.map(n=>n*e)}function ax(t,e){return t.map(()=>e||uf).splice(0,t.length-1)}function Hn({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=gv(r)?r.map(Ll):Ll(r),s={done:!1,value:e[0]},i=ix(n&&n.length===e.length?n:sx(e),t),a=rx(i,e,{ease:Array.isArray(o)?o:ax(e,o)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const cx=t=>t!==null;function is(t,{repeat:e,repeatType:n="loop"},r,o=1){const s=t.filter(cx),a=o<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const lx={decay:ki,inertia:ki,tween:Hn,keyframes:Hn,spring:Yo};function Sf(t){typeof t.type=="string"&&(t.type=lx[t.type])}class Ka{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const ux=t=>t/100;class Xo extends Ka{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==Ke.now()&&this.tick(Ke.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Sf(e);const{type:n=Hn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=e;let{keyframes:a}=e;const c=n||Hn;process.env.NODE_ENV!=="production"&&c!==Hn&&Vt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Hn&&typeof a[0]!="number"&&(this.mixKeyframes=$r(ux,bf(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=Wa(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:m,type:g,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-o/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let b=this.currentTime,C=r;if(f){const j=Math.min(this.currentTime,o)/a;let T=Math.floor(j),E=j%1;!E&&j>=1&&(E=1),E===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(h==="reverse"?(E=1-E,m&&(E-=m/a)):h==="mirror"&&(C=i)),b=kt(0,1,E)*a}let P;w?(this.delayState.value=d[0],P=this.delayState):P=C.next(b),s&&!w&&(P.value=s(P.value));let{done:R}=P;!w&&c!==null&&(R=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return M&&g!==ki&&(P.value=is(d,this.options,v,this.speed)),y&&y(P.value),M&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return ft(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ft(e)}get time(){return ft(this.currentTime)}set time(e){e=Ze(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Cf(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(Ke.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ft(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:e=Kv,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ke.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function dx(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Sn=t=>t*180/Math.PI,Ni=t=>{const e=Sn(Math.atan2(t[1],t[0]));return _i(e)},fx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ni,rotateZ:Ni,skewX:t=>Sn(Math.atan(t[1])),skewY:t=>Sn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},_i=t=>(t=t%360,t<0&&(t+=360),t),Ul=Ni,Hl=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Wl=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),hx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hl,scaleY:Wl,scale:t=>(Hl(t)+Wl(t))/2,rotateX:t=>_i(Sn(Math.atan2(t[6],t[5]))),rotateY:t=>_i(Sn(Math.atan2(-t[2],t[0]))),rotateZ:Ul,rotate:Ul,skewX:t=>Sn(Math.atan(t[4])),skewY:t=>Sn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Oi(t){return t.includes("scale")?1:0}function Li(t,e){if(!t||t==="none")return Oi(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=hx,o=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=fx,o=a}if(!o)return Oi(e);const s=r[e],i=o[1].split(",").map(mx);return typeof s=="function"?s(i):i[s]}const px=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Li(n,e)};function mx(t){return parseFloat(t.trim())}const sr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ir=new Set(sr),Kl=t=>t===or||t===ne,gx=new Set(["x","y","z"]),yx=sr.filter(t=>!gx.has(t));function vx(t){const e=[];return yx.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Qt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Li(e,"x"),y:(t,{transform:e})=>Li(e,"y")};Qt.translateX=Qt.x;Qt.translateY=Qt.y;const Pn=new Set;let $i=!1,Fi=!1,Vi=!1;function Pf(){if(Fi){const t=Array.from(Pn).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const o=vx(r);o.length&&(n.set(r,o),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Fi=!1,$i=!1,Pn.forEach(t=>t.complete(Vi)),Pn.clear()}function Rf(){Pn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fi=!0)})}function xx(){Vi=!0,Rf(),Pf(),Vi=!1}class Ya{constructor(e,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Pn.add(this),$i||($i=!0,ye.read(Rf),ye.resolveKeyframes(Pf))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:o}=this;if(e[0]===null){const s=o==null?void 0:o.get(),i=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=i),o&&s===void 0&&o.set(e[0])}dx(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Pn.delete(this)}cancel(){this.state==="scheduled"&&(Pn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const bx=t=>t.startsWith("--");function Tf(t,e,n){bx(e)?t.style.setProperty(e,n):t.style[e]=n}const wx={};function Mf(t,e){const n=Jd(t);return()=>wx[e]??n()}const Cx=Mf(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ef=Mf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Yl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xr([0,.65,.55,1]),circOut:xr([.55,0,1,.45]),backIn:xr([.31,.01,.66,-.59]),backOut:xr([.33,1.53,.69,.99])};function jf(t,e){if(t)return typeof t=="function"?Ef()?wf(t,e):"ease-out":df(t)?xr(t):Array.isArray(t)?t.map(n=>jf(n,e)||Yl.easeOut):Yl[t]}function Sx(t,e,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const f=jf(a,o);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(d,h)}function Af(t){return typeof t=="function"&&"applyToOptions"in t}function Px({type:t,...e}){return Af(t)&&Ef()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Df extends Ka{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=e,Vt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Px(e);this.animation=Sx(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=is(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Tf(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,o;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ft(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ft(e)}get time(){return ft(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ze(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Cx()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ht):o(this)}}const If={anticipate:af,backInOut:sf,circInOut:lf};function Rx(t){return t in If}function Tx(t){typeof t.ease=="string"&&Rx(t.ease)&&(t.ease=If[t.ease])}const Zs=10;class Mx extends Df{constructor(e){Tx(e),Sf(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Xo({...i,autoplay:!1}),c=Math.max(Zs,Ke.now()-this.startTime),u=kt(0,Zs,c-Zs),d=a.sample(c).value,{name:f}=this.options;s&&f&&Tf(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const Xl=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(yt.test(t)||t==="0")&&!t.startsWith("url("));function Ex(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function jx(t,e,n,r){const o=t[0];if(o===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],i=Xl(o,e),a=Xl(s,e);return rr(i===a,`You are trying to animate ${e} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:Ex(t)||(n==="spring"||Af(n))&&r}function Bi(t){t.duration=0,t.type="keyframes"}const kf=new Set(["opacity","clipPath","filter","transform"]),Ax=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Dx(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Ax.test(t[e]))return!0;return!1}const Ix=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),kx=Jd(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Nx(t){var f;const{motionValue:e,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=t;if(!(((f=e==null?void 0:e.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return kx()&&n&&(kf.has(n)||Ix.has(n)&&Dx(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const _x=40;class Ox extends Ka{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:d,...f}){var g;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Ke.now();const h={autoplay:e,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},m=(d==null?void 0:d.KeyframeResolver)||Ya;this.keyframeResolver=new m(a,(y,v,x)=>this.onKeyframesResolved(y,v,h,!x),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(e,n,r,o){var x,w;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Ke.now();let f=!0;jx(e,s,i,a)||(f=!1,(en.instantAnimations||!c)&&(d==null||d(is(e,r,n))),e[0]=e[e.length-1],Bi(r),r.repeat=0);const m={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>_x?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},g=f&&!u&&Nx(m),y=(w=(x=m.motionValue)==null?void 0:x.owner)==null?void 0:w.current;let v;if(g)try{v=new Mx({...m,element:y})}catch{v=new Xo(m)}else v=new Xo(m);v.finished.then(()=>{this.notifyFinished()}).catch(ht),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),xx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Nf(t,e,n,r=0,o=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),i=t.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const Lx=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $x(t){const e=Lx.exec(t);if(!e)return[,];const[,n,r,o]=e;return[`--${n??r}`,o]}const Fx=4;function _f(t,e,n=1){Vt(n<=Fx,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=$x(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const i=s.trim();return qd(i)?parseFloat(i):i}return Ga(o)?_f(o,e,n+1):o}const Vx={type:"spring",stiffness:500,damping:25,restSpeed:10},Bx=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Gx={type:"keyframes",duration:.8},zx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ux=(t,{keyframes:e})=>e.length>2?Gx:ir.has(t)?t.startsWith("scale")?Bx(e[1]):Vx:zx;function Of(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Xa(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Of(n,t):n}const Hx=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Wx(t){for(const e in t)if(!Hx.has(e))return!0;return!1}const qa=(t,e,n,r={},o,s)=>i=>{const a=Xa(r,t)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Ze(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};Wx(a)||Object.assign(d,Ux(t,d)),d.duration&&(d.duration=Ze(d.duration)),d.repeatDelay&&(d.repeatDelay=Ze(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Bi(d),d.delay===0&&(f=!0)),(en.instantAnimations||en.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,Bi(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&e.get()!==void 0){const h=is(d.keyframes,a);if(h!==void 0){ye.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new Xo(d):new Ox(d)};function ql(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Za(t,e,n,r){if(typeof e=="function"){const[o,s]=ql(r);e=e(n!==void 0?n:t.custom,o,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[o,s]=ql(r);e=e(n!==void 0?n:t.custom,o,s)}return e}function Rn(t,e,n){const r=t.getProps();return Za(r,e,n!==void 0?n:r.custom,t)}const Lf=new Set(["width","height","top","left","right","bottom",...sr]),Zl=30,Kx=t=>!isNaN(parseFloat(t));class Yx{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Ke.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ke.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Kx(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Fa(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new $a);const r=this.events[e].add(n);return e==="change"?()=>{r(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ke.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Zl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Zl);return ef(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qn(t,e){return new Yx(t,e)}const Gi=t=>Array.isArray(t);function Xx(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Qn(n))}function qx(t){return Gi(t)?t[t.length-1]||0:t}function Zx(t,e){const n=Rn(t,e);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=qx(s[i]);Xx(t,i,a)}}const $e=t=>!!(t&&t.getVelocity);function Qx(t){return!!($e(t)&&t.add)}function zi(t,e){const n=t.getValue("willChange");if(Qx(n))return n.add(e);if(!n&&en.WillChange){const r=new en.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Qa(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Jx="framerAppearId",$f="data-"+Qa(Jx);function Ff(t){return t.props[$f]}function eb({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Vf(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=e;const c=t.getDefaultTransition();s=s?Of(s,c):c;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&t.animationState&&t.animationState.getState()[o];for(const h in a){const m=t.getValue(h,t.latestValues[h]??null),g=a[h];if(g===void 0||f&&eb(f,h))continue;const y={delay:n,...Xa(s||{},h)},v=m.get();if(v!==void 0&&!m.isAnimating()&&!Array.isArray(g)&&g===v&&!y.velocity){ye.update(()=>m.set(g));continue}let x=!1;if(window.MotionHandoffAnimation){const C=Ff(t);if(C){const P=window.MotionHandoffAnimation(C,h,ye);P!==null&&(y.startTime=P,x=!0)}}zi(t,h);const w=u??t.shouldReduceMotion;m.start(qa(h,m,g,w&&Lf.has(h)?{type:!1}:y,t,x));const b=m.animation;b&&d.push(b)}if(i){const h=()=>ye.update(()=>{i&&Zx(t,i)});d.length?Promise.all(d).then(h):h()}return d}function Ui(t,e,n={}){var c;const r=Rn(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Vf(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return tb(t,e,u,d,f,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[u,d]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(n.delay)])}function tb(t,e,n=0,r=0,o=0,s=1,i){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(Ui(c,e,{...i,delay:n+(typeof r=="function"?0:r)+Nf(t.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function nb(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const o=e.map(s=>Ui(t,s,n));r=Promise.all(o)}else if(typeof e=="string")r=Ui(t,e,n);else{const o=typeof e=="function"?Rn(t,e,n.custom):e;r=Promise.all(Vf(t,o,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const rb={test:t=>t==="auto",parse:t=>t},Bf=t=>e=>e.test(t),Gf=[or,ne,Dt,qt,Ev,Mv,rb],Ql=t=>Gf.find(Bf(t));function ob(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Qd(t):!0}const sb=new Set(["brightness","contrast","saturate","opacity"]);function ib(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(za)||[];if(!r)return t;const o=n.replace(r,"");let s=sb.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const ab=/\b([a-z-]*)\(.*?\)/gu,Hi={...yt,getAnimatableNone:t=>{const e=t.match(ab);return e?e.map(ib).join(" "):t}},Wi={...yt,getAnimatableNone:t=>{const e=yt.parse(t);return yt.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Jl={...or,transform:Math.round},cb={rotate:qt,rotateX:qt,rotateY:qt,rotateZ:qt,scale:fo,scaleX:fo,scaleY:fo,scaleZ:fo,skew:qt,skewX:qt,skewY:qt,distance:ne,translateX:ne,translateY:ne,translateZ:ne,x:ne,y:ne,z:ne,perspective:ne,transformPerspective:ne,opacity:Tr,originX:Fl,originY:Fl,originZ:ne},Ja={borderWidth:ne,borderTopWidth:ne,borderRightWidth:ne,borderBottomWidth:ne,borderLeftWidth:ne,borderRadius:ne,borderTopLeftRadius:ne,borderTopRightRadius:ne,borderBottomRightRadius:ne,borderBottomLeftRadius:ne,width:ne,maxWidth:ne,height:ne,maxHeight:ne,top:ne,right:ne,bottom:ne,left:ne,inset:ne,insetBlock:ne,insetBlockStart:ne,insetBlockEnd:ne,insetInline:ne,insetInlineStart:ne,insetInlineEnd:ne,padding:ne,paddingTop:ne,paddingRight:ne,paddingBottom:ne,paddingLeft:ne,paddingBlock:ne,paddingBlockStart:ne,paddingBlockEnd:ne,paddingInline:ne,paddingInlineStart:ne,paddingInlineEnd:ne,margin:ne,marginTop:ne,marginRight:ne,marginBottom:ne,marginLeft:ne,marginBlock:ne,marginBlockStart:ne,marginBlockEnd:ne,marginInline:ne,marginInlineStart:ne,marginInlineEnd:ne,fontSize:ne,backgroundPositionX:ne,backgroundPositionY:ne,...cb,zIndex:Jl,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:Jl},lb={...Ja,color:Me,backgroundColor:Me,outlineColor:Me,fill:Me,stroke:Me,borderColor:Me,borderTopColor:Me,borderRightColor:Me,borderBottomColor:Me,borderLeftColor:Me,filter:Hi,WebkitFilter:Hi,mask:Wi,WebkitMask:Wi},zf=t=>lb[t],ub=new Set([Hi,Wi]);function Uf(t,e){let n=zf(t);return ub.has(n)||(n=yt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const db=new Set(["auto","none","0"]);function fb(t,e,n){let r=0,o;for(;r<t.length&&!o;){const s=t[r];typeof s=="string"&&!db.has(s)&&Zn(s).values.length&&(o=t[r]),r++}if(o&&n)for(const s of e)t[s]=Uf(n,o)}class hb extends Ya{constructor(e,n,r,o,s){super(e,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let f=e[d];if(typeof f=="string"&&(f=f.trim(),Ga(f))){const h=_f(f,n.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Lf.has(r)||e.length!==2)return;const[o,s]=e,i=Ql(o),a=Ql(s),c=$l(o),u=$l(s);if(c!==u&&Qt[r]){this.needsMeasurement=!0;return}if(i!==a)if(Kl(i)&&Kl(a))for(let d=0;d<e.length;d++){const f=e[d];typeof f=="string"&&(e[d]=parseFloat(f))}else Qt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let o=0;o<e.length;o++)(e[o]===null||ob(e[o]))&&r.push(o);r.length&&fb(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&e.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const o=e.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=Qt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Hf(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const o=(n==null?void 0:n[t])??r.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(r=>r!=null)}const Wf=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Io(t){return Zd(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:ec}=ff(queueMicrotask,!1),mt={x:!1,y:!1};function Kf(){return mt.x||mt.y}function pb(t){return t==="x"||t==="y"?mt[t]?null:(mt[t]=!0,()=>{mt[t]=!1}):mt.x||mt.y?null:(mt.x=mt.y=!0,()=>{mt.x=mt.y=!1})}function Yf(t,e){const n=Hf(t),r=new AbortController,o={passive:!0,...e,signal:r.signal};return[n,o,()=>r.abort()]}function mb(t){return!(t.pointerType==="touch"||Kf())}function gb(t,e,n={}){const[r,o,s]=Yf(t,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",g)},f=v=>{u&&(u(v),u=void 0),d()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(v))},m=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},g=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}f(v)}},y=v=>{if(!mb(v))return;c=!1;const x=e(i,v);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",g,o))};i.addEventListener("pointerenter",y,o),i.addEventListener("pointerdown",m,o)}),s}const Xf=(t,e)=>e?t===e?!0:Xf(t,e.parentElement):!1,tc=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,yb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function vb(t){return yb.has(t.tagName)||t.isContentEditable===!0}const xb=new Set(["INPUT","SELECT","TEXTAREA"]);function bb(t){return xb.has(t.tagName)||t.isContentEditable===!0}const ko=new WeakSet;function eu(t){return e=>{e.key==="Enter"&&t(e)}}function Qs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const wb=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=eu(()=>{if(ko.has(n))return;Qs(n,"down");const o=eu(()=>{Qs(n,"up")}),s=()=>Qs(n,"cancel");n.addEventListener("keyup",o,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function tu(t){return tc(t)&&!Kf()}const nu=new WeakSet;function Cb(t,e,n={}){const[r,o,s]=Yf(t,n),i=a=>{const c=a.currentTarget;if(!tu(a)||nu.has(a))return;ko.add(c),n.stopPropagation&&nu.add(a);const u=e(c,a),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),ko.has(c)&&ko.delete(c),tu(m)&&typeof u=="function"&&u(m,{success:g})},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||Xf(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Io(a)&&(a.addEventListener("focus",u=>wb(u,o)),!vb(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function nc(t){return Zd(t)&&"ownerSVGElement"in t}const No=new WeakMap;let Zt;const qf=(t,e,n)=>(r,o)=>o&&o[0]?o[0][t+"Size"]:nc(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Sb=qf("inline","width","offsetWidth"),Pb=qf("block","height","offsetHeight");function Rb({target:t,borderBoxSize:e}){var n;(n=No.get(t))==null||n.forEach(r=>{r(t,{get width(){return Sb(t,e)},get height(){return Pb(t,e)}})})}function Tb(t){t.forEach(Rb)}function Mb(){typeof ResizeObserver>"u"||(Zt=new ResizeObserver(Tb))}function Eb(t,e){Zt||Mb();const n=Hf(t);return n.forEach(r=>{let o=No.get(r);o||(o=new Set,No.set(r,o)),o.add(e),Zt==null||Zt.observe(r)}),()=>{n.forEach(r=>{const o=No.get(r);o==null||o.delete(e),o!=null&&o.size||Zt==null||Zt.unobserve(r)})}}const _o=new Set;let Wn;function jb(){Wn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};_o.forEach(e=>e(t))},window.addEventListener("resize",Wn)}function Ab(t){return _o.add(t),Wn||jb(),()=>{_o.delete(t),!_o.size&&typeof Wn=="function"&&(window.removeEventListener("resize",Wn),Wn=void 0)}}function ru(t,e){return typeof t=="function"?Ab(t):Eb(t,e)}function Db(t){return nc(t)&&t.tagName==="svg"}const Ib=[...Gf,Me,yt],kb=t=>Ib.find(Bf(t)),ou=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kn=()=>({x:ou(),y:ou()}),su=()=>({min:0,max:0}),Ae=()=>({x:su(),y:su()}),Nb=new WeakMap;function as(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Mr(t){return typeof t=="string"||Array.isArray(t)}const rc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],oc=["initial",...rc];function cs(t){return as(t.animate)||oc.some(e=>Mr(t[e]))}function Zf(t){return!!(cs(t)||t.variants)}function _b(t,e,n){for(const r in e){const o=e[r],s=n[r];if($e(o))t.addValue(r,o);else if($e(s))t.addValue(r,Qn(o,{owner:t}));else if(s!==o)if(t.hasValue(r)){const i=t.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=t.getStaticValue(r);t.addValue(r,Qn(i!==void 0?i:o,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Ki={current:null},Qf={current:!1},Ob=typeof window<"u";function Lb(){if(Qf.current=!0,!!Ob)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ki.current=t.matches;t.addEventListener("change",e),e()}else Ki.current=!1}const iu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let qo={};function Jf(t){qo=t}function $b(){return qo}class Fb{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ya,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Ke.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ye.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=cs(n),this.isVariantNode=Zf(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const g=h[m];u[m]!==void 0&&$e(g)&&g.set(u[m])}}mount(e){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=e,Nb.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Qf.current||Lb(),this.shouldReduceMotion=Ki.current),process.env.NODE_ENV!=="production"&&Fa(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),tn(this.notifyUpdate),tn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&kf.has(e)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new Df({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:Ze(d)}),h=i(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const r=ir.has(e);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[e]=i,this.props.onUpdate&&ye.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in qo){const n=qo[e];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[e]&&o&&r(this.props)&&(this.features[e]=new o(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ae()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<iu.length;r++){const o=iu[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=e[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=_b(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Qn(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(qd(r)||Qd(r))?r=parseFloat(r):!kb(r)&&yt.test(n)&&(r=Uf(e,n)),this.setBaseTarget(e,$e(r)?r.get():r)),$e(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Za(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[e])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!$e(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new $a),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ec.render(this.render)}}class eh extends Fb{constructor(){super(...arguments),this.KeyframeResolver=hb}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;$e(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ln{constructor(e){this.isMounted=!1,this.node=e}update(){}}function th({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Vb({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bb(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Js(t){return t===void 0||t===1}function Yi({scale:t,scaleX:e,scaleY:n}){return!Js(t)||!Js(e)||!Js(n)}function wn(t){return Yi(t)||nh(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function nh(t){return au(t.x)||au(t.y)}function au(t){return t&&t!=="0%"}function Zo(t,e,n){const r=t-n,o=e*r;return n+o}function cu(t,e,n,r,o){return o!==void 0&&(t=Zo(t,o,r)),Zo(t,n,r)+e}function Xi(t,e=0,n=1,r,o){t.min=cu(t.min,e,n,r,o),t.max=cu(t.max,e,n,r,o)}function rh(t,{x:e,y:n}){Xi(t.x,e.translate,e.scale,e.originPoint),Xi(t.y,n.translate,n.scale,n.originPoint)}const lu=.999999999999,uu=1.0000000000001;function Gb(t,e,n,r=!1){var a;const o=n.length;if(!o)return;e.x=e.y=1;let s,i;for(let c=0;c<o;c++){s=n[c],i=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Et(t.x,-s.scroll.offset.x),Et(t.y,-s.scroll.offset.y)),i&&(e.x*=i.x.scale,e.y*=i.y.scale,rh(t,i)),r&&wn(s.latestValues)&&Oo(t,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}e.x<uu&&e.x>lu&&(e.x=1),e.y<uu&&e.y>lu&&(e.y=1)}function Et(t,e){t.min+=e,t.max+=e}function du(t,e,n,r,o=.5){const s=xe(t.min,t.max,o);Xi(t,e,n,s,r)}function fu(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Oo(t,e,n){const r=n??t;du(t.x,fu(e.x,r.x),e.scaleX,e.scale,e.originX),du(t.y,fu(e.y,r.y),e.scaleY,e.scale,e.originY)}function oh(t,e){return th(Bb(t.getBoundingClientRect(),e))}function zb(t,e,n){const r=oh(t,n),{scroll:o}=e;return o&&(Et(r.x,o.offset.x),Et(r.y,o.offset.y)),r}const Ub={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Hb=sr.length;function Wb(t,e,n){let r="",o=!0;for(let s=0;s<Hb;s++){const i=sr[s],a=t[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const u=parseFloat(a);c=i.startsWith("scale")?u===1:u===0}if(!c||n){const u=Wf(a,Ja[i]);if(!c){o=!1;const d=Ub[i]||i;r+=`${d}(${u}) `}n&&(e[i]=u)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}function sc(t,e,n){const{style:r,vars:o,transformOrigin:s}=t;let i=!1,a=!1;for(const c in e){const u=e[c];if(ir.has(c)){i=!0;continue}else if(pf(c)){o[c]=u;continue}else{const d=Wf(u,Ja[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(e.transform||(i||n?r.transform=Wb(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function sh(t,{style:e,vars:n},r,o){const s=t.style;let i;for(i in e)s[i]=e[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function hu(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const yr={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(ne.test(t))t=parseFloat(t);else return t;const n=hu(t,e.target.x),r=hu(t,e.target.y);return`${n}% ${r}%`}},Kb={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=yt.parse(t);if(o.length>5)return r;const s=yt.createTransformer(t),i=typeof o[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;o[0+i]/=a,o[1+i]/=c;const u=xe(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},qi={borderRadius:{...yr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:yr,borderTopRightRadius:yr,borderBottomLeftRadius:yr,borderBottomRightRadius:yr,boxShadow:Kb};function ih(t,{layout:e,layoutId:n}){return ir.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!qi[t]||t==="opacity")}function ic(t,e,n){var i;const r=t.style,o=e==null?void 0:e.style,s={};if(!r)return s;for(const a in r)($e(r[a])||o&&$e(o[a])||ih(a,t)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Yb(t){return window.getComputedStyle(t)}class Xb extends eh{constructor(){super(...arguments),this.type="html",this.renderInstance=sh}readValueFromInstance(e,n){var r;if(ir.has(n))return(r=this.projection)!=null&&r.isProjecting?Oi(n):px(e,n);{const o=Yb(e),s=(pf(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return oh(e,n)}build(e,n,r){sc(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return ic(e,n,r)}}const qb={offset:"stroke-dashoffset",array:"stroke-dasharray"},Zb={offset:"strokeDashoffset",array:"strokeDasharray"};function Qb(t,e,n=1,r=0,o=!0){t.pathLength=1;const s=o?qb:Zb;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const Jb=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ah(t,{attrX:e,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(sc(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const m of Jb)f[m]!==void 0&&(h[m]=f[m],delete f[m]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Qb(f,o,s,i,!1)}const ch=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),lh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ew(t,e,n,r){sh(t,e,void 0,r);for(const o in e.attrs)t.setAttribute(ch.has(o)?o:Qa(o),e.attrs[o])}function uh(t,e,n){const r=ic(t,e,n);for(const o in t)if($e(t[o])||$e(e[o])){const s=sr.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=t[o]}return r}class tw extends eh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ae}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ir.has(n)){const r=zf(n);return r&&r.default||0}return n=ch.has(n)?n:Qa(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return uh(e,n,r)}build(e,n,r){ah(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,o){ew(e,n,r,o)}mount(e){this.isSVGTag=lh(e.tagName),super.mount(e)}}const nw=oc.length;function dh(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?dh(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<nw;n++){const r=oc[n],o=t.props[r];(Mr(o)||o===!1)&&(e[r]=o)}return e}function fh(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const rw=[...rc].reverse(),ow=rc.length;function sw(t){return e=>Promise.all(e.map(({animation:n,options:r})=>nb(t,n,r)))}function iw(t){let e=sw(t),n=pu(),r=!0,o=!1;const s=u=>(d,f)=>{var m;const h=Rn(t,f,u==="exit"?(m=t.presenceContext)==null?void 0:m.custom:void 0);if(h){const{transition:g,transitionEnd:y,...v}=h;d={...d,...v,...y}}return d};function i(u){e=u(t)}function a(u){const{props:d}=t,f=dh(t.parent)||{},h=[],m=new Set;let g={},y=1/0;for(let x=0;x<ow;x++){const w=rw[x],b=n[w],C=d[w]!==void 0?d[w]:f[w],P=Mr(C),R=w===u?b.isActive:null;R===!1&&(y=x);let M=C===f[w]&&C!==d[w]&&P;if(M&&(r||o)&&t.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...g},!b.isActive&&R===null||!C&&!b.prevProp||as(C)||typeof C=="boolean")continue;if(w==="exit"&&b.isActive&&R!==!0){b.prevResolvedValues&&(g={...g,...b.prevResolvedValues});continue}const j=aw(b.prevProp,C);let T=j||w===u&&b.isActive&&!M&&P||x>y&&P,E=!1;const k=Array.isArray(C)?C:[C];let _=k.reduce(s(w),{});R===!1&&(_={});const{prevResolvedValues:$={}}=b,G={...$,..._},Q=L=>{T=!0,m.has(L)&&(E=!0,m.delete(L)),b.needsAnimating[L]=!0;const O=t.getValue(L);O&&(O.liveStyle=!1)};for(const L in G){const O=_[L],D=$[L];if(g.hasOwnProperty(L))continue;let X=!1;Gi(O)&&Gi(D)?X=!fh(O,D):X=O!==D,X?O!=null?Q(L):m.add(L):O!==void 0&&m.has(L)?Q(L):b.protectedKeys[L]=!0}b.prevProp=C,b.prevResolvedValues=_,b.isActive&&(g={...g,..._}),(r||o)&&t.blockInitialAnimation&&(T=!1);const V=M&&j;T&&(!V||E)&&h.push(...k.map(L=>{const O={type:w};if(typeof L=="string"&&(r||o)&&!V&&t.manuallyAnimateOnMount&&t.parent){const{parent:D}=t,X=Rn(D,L);if(D.enteringChildren&&X){const{delayChildren:A}=X.transition||{};O.delay=Nf(D.enteringChildren,t,A)}}return{animation:L,options:O}}))}if(m.size){const x={};if(typeof d.initial!="boolean"){const w=Rn(t,Array.isArray(d.initial)?d.initial[0]:d.initial);w&&w.transition&&(x.transition=w.transition)}m.forEach(w=>{const b=t.getBaseTarget(w),C=t.getValue(w);C&&(C.liveStyle=!0),x[w]=b??null}),h.push({animation:x})}let v=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(v=!1),r=!1,o=!1,v?e(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=pu(),o=!0}}}function aw(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!fh(e,t):!1}function xn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pu(){return{animate:xn(!0),whileInView:xn(),whileHover:xn(),whileTap:xn(),whileDrag:xn(),whileFocus:xn(),exit:xn()}}function Zi(t,e){t.min=e.min,t.max=e.max}function pt(t,e){Zi(t.x,e.x),Zi(t.y,e.y)}function mu(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const hh=1e-4,cw=1-hh,lw=1+hh,ph=.01,uw=0-ph,dw=0+ph;function Ye(t){return t.max-t.min}function fw(t,e,n){return Math.abs(t-e)<=n}function gu(t,e,n,r=.5){t.origin=r,t.originPoint=xe(e.min,e.max,t.origin),t.scale=Ye(n)/Ye(e),t.translate=xe(n.min,n.max,t.origin)-t.originPoint,(t.scale>=cw&&t.scale<=lw||isNaN(t.scale))&&(t.scale=1),(t.translate>=uw&&t.translate<=dw||isNaN(t.translate))&&(t.translate=0)}function Cr(t,e,n,r){gu(t.x,e.x,n.x,r?r.originX:void 0),gu(t.y,e.y,n.y,r?r.originY:void 0)}function yu(t,e,n,r=0){const o=r?xe(n.min,n.max,r):n.min;t.min=o+e.min,t.max=t.min+Ye(e)}function hw(t,e,n,r){yu(t.x,e.x,n.x,r==null?void 0:r.x),yu(t.y,e.y,n.y,r==null?void 0:r.y)}function vu(t,e,n,r=0){const o=r?xe(n.min,n.max,r):n.min;t.min=e.min-o,t.max=t.min+Ye(e)}function Qo(t,e,n,r){vu(t.x,e.x,n.x,r==null?void 0:r.x),vu(t.y,e.y,n.y,r==null?void 0:r.y)}function xu(t,e,n,r,o){return t-=e,t=Zo(t,1/n,r),o!==void 0&&(t=Zo(t,1/o,r)),t}function pw(t,e=0,n=1,r=.5,o,s=t,i=t){if(Dt.test(e)&&(e=parseFloat(e),e=xe(i.min,i.max,e/100)-i.min),typeof e!="number")return;let a=xe(s.min,s.max,r);t===s&&(a-=e),t.min=xu(t.min,e,n,a,o),t.max=xu(t.max,e,n,a,o)}function bu(t,e,[n,r,o],s,i){pw(t,e[n],e[r],e[o],e.scale,s,i)}const mw=["x","scaleX","originX"],gw=["y","scaleY","originY"];function wu(t,e,n,r){bu(t.x,e,mw,n?n.x:void 0,r?r.x:void 0),bu(t.y,e,gw,n?n.y:void 0,r?r.y:void 0)}function Cu(t){return t.translate===0&&t.scale===1}function mh(t){return Cu(t.x)&&Cu(t.y)}function Su(t,e){return t.min===e.min&&t.max===e.max}function yw(t,e){return Su(t.x,e.x)&&Su(t.y,e.y)}function Pu(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function gh(t,e){return Pu(t.x,e.x)&&Pu(t.y,e.y)}function Ru(t){return Ye(t.x)/Ye(t.y)}function Tu(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tt(t){return[t("x"),t("y")]}function vw(t,e,n){let r="";const o=t.x.translate/e.x,s=t.y.translate/e.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const yh=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],xw=yh.length,Mu=t=>typeof t=="string"?parseFloat(t):t,Eu=t=>typeof t=="number"||ne.test(t);function bw(t,e,n,r,o,s){o?(t.opacity=xe(0,n.opacity??1,ww(r)),t.opacityExit=xe(e.opacity??1,0,Cw(r))):s&&(t.opacity=xe(e.opacity??1,n.opacity??1,r));for(let i=0;i<xw;i++){const a=yh[i];let c=ju(e,a),u=ju(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Eu(c)===Eu(u)?(t[a]=Math.max(xe(Mu(c),Mu(u),r),0),(Dt.test(u)||Dt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=xe(e.rotate||0,n.rotate||0,r))}function ju(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const ww=vh(0,.5,cf),Cw=vh(.5,.95,ht);function vh(t,e,n){return r=>r<t?0:r>e?1:n(Rr(t,e,r))}function Sw(t,e,n){const r=$e(t)?t:Qn(t);return r.start(qa("",r,e,n)),r.animation}function Er(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const Pw=(t,e)=>t.depth-e.depth;class Rw{constructor(){this.children=[],this.isDirty=!1}add(e){La(this.children,e),this.isDirty=!0}remove(e){Ho(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Pw),this.isDirty=!1,this.children.forEach(e)}}function Tw(t,e){const n=Ke.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(tn(r),t(s-e))};return ye.setup(r,!0),()=>tn(r)}function Lo(t){return $e(t)?t.get():t}class Mw{constructor(){this.members=[]}add(e){La(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Ho(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Ho(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(e,n){var o;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=e.options;(s===void 0||s!==i)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(o=e.root)!=null&&o.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,o,s,i;(r=(n=e.options).onExitComplete)==null||r.call(n),(i=(o=e.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const $o={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ei=["","X","Y","Z"],Ew=1e3;let jw=0;function ti(t,e,n,r){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),r&&(r[t]=0))}function xh(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ff(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(o||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&xh(r)}function bh({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=e==null?void 0:e()){this.id=jw++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Iw),this.nodes.forEach($w),this.nodes.forEach(Fw),this.nodes.forEach(kw)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rw)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new $a),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=nc(i)&&!Db(i),this.instance=i;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{f=window.innerWidth}),t(i,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=Tw(h,250),$o.hasAnimatedSinceResize&&($o.hasAnimatedSinceResize=!1,this.nodes.forEach(Iu)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||Uw,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=u.getProps(),x=!this.targetLayout||!gh(this.targetLayout,m),w=!f&&h;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...Xa(g,"layout"),onPlay:y,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(d,w)}else f||Iu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),tn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Vw),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(_w),this.nodes.forEach(Au);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Du);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ow),this.nodes.forEach(Lw),this.nodes.forEach(Aw),this.nodes.forEach(Dw)):this.nodes.forEach(Du),this.clearAllSnapshots();const a=Ke.now();Le.delta=kt(0,1e3/60,a-Le.timestamp),Le.timestamp=a,Le.isProcessing=!0,Ws.update.process(Le),Ws.preRender.process(Le),Ws.render.process(Le),Le.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ec.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Nw),this.sharedNodes.forEach(Bw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ye(this.snapshot.measuredBox.x)&&!Ye(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ae()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!mh(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||wn(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Hw(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return Ae();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Ww))){const{scroll:d}=this.root;d&&(Et(a.x,d.offset.x),Et(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=Ae();if(pt(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&pt(a,i),Et(a.x,f.offset.x),Et(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||Ae();pt(u,i);for(let h=0;h<this.path.length;h++){const m=this.path[h];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(Et(u.x,-m.scroll.offset.x),Et(u.y,-m.scroll.offset.y)),wn(m.latestValues)&&Oo(u,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return wn(this.latestValues)&&Oo(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=Ae();pt(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!wn(d.latestValues))continue;let f;d.instance&&(Yi(d.latestValues)&&d.updateSnapshot(),f=Ae(),pt(f,d.measurePageBox())),wu(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return wn(this.latestValues)&&wu(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Le.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Le.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ae(),this.targetWithTransforms=Ae()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hw(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):pt(this.target,this.layout.layoutBox),rh(this.target,this.targetDelta)):pt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Yi(this.parent.latestValues)||nh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),Qo(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),pt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var g;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Le.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;pt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Gb(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Ae());const{target:m}=i;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mu(this.prevProjectionDelta.x,this.projectionDelta.x),mu(this.prevProjectionDelta.y,this.projectionDelta.y)),Cr(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Tu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Tu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kn(),this.projectionDelta=Kn(),this.projectionDeltaWithTransform=Kn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=Kn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Ae(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,y=m!==g,v=this.getStack(),x=!v||v.members.length<=1,w=!!(y&&!x&&this.options.crossfade===!0&&!this.path.some(zw));this.animationProgress=0;let b;this.mixTargetDelta=C=>{const P=C/1e3;ku(f.x,i.x,P),ku(f.y,i.y,P),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qo(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Gw(this.relativeTarget,this.relativeTargetOrigin,h,P),b&&yw(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Ae()),pt(b,this.relativeTarget)),y&&(this.animationValues=d,bw(d,u,this.latestValues,P,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(tn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{$o.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Qn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Sw(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),i.onUpdate&&i.onUpdate(d)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ew),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=i;if(!(!a||!c||!u)){if(this!==i&&this.layout&&u&&wh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ae();const f=Ye(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=Ye(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}pt(a,c),Oo(a,d),Cr(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Mw),this.sharedNodes.get(i).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&ti("z",i,u,this.animationValues);for(let d=0;d<ei.length;d++)ti(`rotate${ei[d]}`,i,u,this.animationValues),ti(`skew${ei[d]}`,i,u,this.animationValues);i.render();for(const d in u)i.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Lo(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Lo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!wn(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=vw(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:m}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in qi){if(d[g]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:x}=qi[g],w=f==="none"?d[g]:y(d[g],u);if(v){const b=v.length;for(let C=0;C<b;C++)i[v[C]]=w}else x?this.options.visualElement.renderState.vars[g]=w:i[g]=w}this.options.layoutId&&(i.pointerEvents=u===this?Lo(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Au),this.root.sharedNodes.clear()}}}function Aw(t){t.updateLayout()}function Dw(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=t.layout,{animationType:s}=t.options,i=e.source!==t.layout.source;if(s==="size")Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=Ye(h);h.min=r[f].min,h.max=h.min+m});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";Zi(i?e.measuredBox[f]:e.layoutBox[f],r[f])}else wh(s,e.layoutBox,r)&&Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=Ye(r[f]);h.max=h.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+m)});const a=Kn();Cr(a,r,e.layoutBox);const c=Kn();i?Cr(c,t.applyTransform(o,!0),e.measuredBox):Cr(c,r,e.layoutBox);const u=!mh(a);let d=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=t.options.layoutAnchor||void 0,y=Ae();Qo(y,e.layoutBox,h.layoutBox,g);const v=Ae();Qo(v,r,m.layoutBox,g),gh(y,v)||(d=!0),f.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=y,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Iw(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function kw(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Nw(t){t.clearSnapshot()}function Au(t){t.clearMeasurements()}function _w(t){t.isLayoutDirty=!0,t.updateLayout()}function Du(t){t.isLayoutDirty=!1}function Ow(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Lw(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Iu(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function $w(t){t.resolveTargetDelta()}function Fw(t){t.calcProjection()}function Vw(t){t.resetSkewAndRotation()}function Bw(t){t.removeLeadSnapshot()}function ku(t,e,n){t.translate=xe(e.translate,0,n),t.scale=xe(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Nu(t,e,n,r){t.min=xe(e.min,n.min,r),t.max=xe(e.max,n.max,r)}function Gw(t,e,n,r){Nu(t.x,e.x,n.x,r),Nu(t.y,e.y,n.y,r)}function zw(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Uw={duration:.45,ease:[.4,0,.1,1]},_u=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ou=_u("applewebkit/")&&!_u("chrome/")?Math.round:ht;function Lu(t){t.min=Ou(t.min),t.max=Ou(t.max)}function Hw(t){Lu(t.x),Lu(t.y)}function wh(t,e,n){return t==="position"||t==="preserve-aspect"&&!fw(Ru(e),Ru(n),.2)}function Ww(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Kw=bh({attachResizeListener:(t,e)=>Er(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),ni={current:void 0},Ch=bh({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ni.current){const t=new Kw({});t.mount(window),t.setOptions({layoutScroll:!0}),ni.current=t}return ni.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ac=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function $u(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Yw(...t){return e=>{let n=!1;const r=t.map(o=>{const s=$u(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():$u(t[o],null)}}}}function Xw(...t){return p.useCallback(Yw(...t),t)}class qw extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Io(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Io(r)&&r.offsetWidth||0,s=Io(r)&&r.offsetHeight||0,i=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=o-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Zw({children:t,isPresent:e,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=S.useId(),a=S.useRef(null),c=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=S.useContext(ac),d=((h=t.props)==null?void 0:h.ref)??(t==null?void 0:t.ref),f=Xw(a,d);return S.useInsertionEffect(()=>{const{width:m,height:g,top:y,left:v,right:x,bottom:w}=c.current;if(e||s===!1||!a.current||!m||!g)return;const b=n==="left"?`left: ${v}`:`right: ${x}`,C=r==="bottom"?`bottom: ${w}`:`top: ${y}`;a.current.dataset.motionPopId=i;const P=document.createElement("style");u&&(P.nonce=u);const R=o??document.head;return R.appendChild(P),P.sheet&&P.sheet.insertRule(`
2
2
  [data-motion-pop-id="${i}"] {
3
3
  position: absolute !important;
4
4
  width: ${m}px !important;
@@ -6,27 +6,27 @@
6
6
  ${b}px !important;
7
7
  ${C}px !important;
8
8
  }
9
- `),()=>{var M;(M=a.current)==null||M.removeAttribute("data-motion-pop-id"),R.contains(P)&&R.removeChild(P)}},[e]),l.jsx(Ww,{isPresent:e,childRef:a,sizeRef:c,pop:s,children:s===!1?t:p.cloneElement(t,{ref:f})})}const Yw=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=Na(Xw),f=S.useId();let h=!0,m=S.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:o,onExitComplete:g=>{d.set(g,!0);for(const y of d.values())if(!y)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return s&&h&&(m={...m}),S.useMemo(()=>{d.forEach((g,y)=>d.set(y,!1))},[n]),p.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=l.jsx(Kw,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),l.jsx(ss.Provider,{value:m,children:t})};function Xw(){return new Map}function bh(t=!0){const e=S.useContext(ss);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,s=S.useId();S.useEffect(()=>{if(t)return o(s)},[t]);const i=S.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,i]:[!0]}const ho=t=>t.key||"";function Lu(t){const e=[];return S.Children.forEach(t,n=>{S.isValidElement(n)&&e.push(n)}),e}const wh=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,f]=bh(i),h=S.useMemo(()=>Lu(t),[t]),m=i&&!d?[]:h.map(ho),g=S.useRef(!0),y=S.useRef(h),v=Na(()=>new Map),x=S.useRef(new Set),[w,b]=S.useState(h),[C,P]=S.useState(h);Wd(()=>{g.current=!1,y.current=h;for(let j=0;j<C.length;j++){const T=ho(C[j]);m.includes(T)?(v.delete(T),x.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[C,m.length,m.join("-")]);const R=[];if(h!==w){let j=[...h];for(let T=0;T<C.length;T++){const E=C[T],N=ho(E);m.includes(N)||(j.splice(T,0,E),R.push(E))}return s==="wait"&&R.length&&(j=R),P(Lu(j)),b(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&C.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:M}=S.useContext(ka);return l.jsx(l.Fragment,{children:C.map(j=>{const T=ho(j),E=i&&!d?!1:h===C||m.includes(T),N=()=>{if(x.current.has(T))return;if(v.has(T))x.current.add(T),v.set(T,!0);else return;let O=!0;v.forEach($=>{$||(O=!1)}),O&&(M==null||M(),P(y.current),i&&(f==null||f()),r&&r())};return l.jsx(Yw,{isPresent:E,initial:!g.current||n?void 0:!1,custom:e,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:E?void 0:N,anchorX:a,anchorY:c,children:j},T)})})},Ch=S.createContext({strict:!1}),$u={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Fu=!1;function qw(){if(Fu)return;const t={};for(const e in $u)t[e]={isEnabled:n=>$u[e].some(r=>!!n[r])};qf(t),Fu=!0}function Sh(){return qw(),Nb()}function Zw(t){const e=Sh();for(const n in t)e[n]={...e[n],...t[n]};qf(e)}const Qw=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Jo(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Qw.has(t)}let Ph=t=>!Jo(t);function Jw(t){typeof t=="function"&&(Ph=e=>e.startsWith("on")?!Jo(e):t(e))}try{Jw(require("@emotion/is-prop-valid").default)}catch{}function e0(t,e,n){const r={};for(const o in t)o==="values"&&typeof t.values=="object"||Le(t[o])||(Ph(o)||n===!0&&Jo(o)||!e&&!Jo(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}const ls=S.createContext({});function t0(t,e){if(cs(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Tr(n)?n:void 0,animate:Tr(r)?r:void 0}}return t.inherit!==!1?e:{}}function n0(t){const{initial:e,animate:n}=t0(t,S.useContext(ls));return S.useMemo(()=>({initial:e,animate:n}),[Vu(e),Vu(n)])}function Vu(t){return Array.isArray(t)?t.join(" "):t}const ic=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Rh(t,e,n){for(const r in e)!Le(e[r])&&!rh(r,n)&&(t[r]=e[r])}function r0({transformTemplate:t},e){return S.useMemo(()=>{const n=ic();return rc(n,e,t),Object.assign({},n.vars,n.style)},[e])}function o0(t,e){const n=t.style||{},r={};return Rh(r,n,t),Object.assign(r,r0(t,e)),r}function s0(t,e){const n={},r=o0(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const Th=()=>({...ic(),attrs:{}});function i0(t,e,n,r){const o=S.useMemo(()=>{const s=Th();return oh(s,e,ih(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Rh(s,t.style,t),o.style={...s,...o.style}}return o}const a0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ac(t){return typeof t!="string"||t.includes("-")?!1:!!(a0.indexOf(t)>-1||/[A-Z]/u.test(t))}function c0(t,e,n,{latestValues:r},o,s=!1,i){const c=(i??ac(t)?i0:s0)(e,r,o,t),u=e0(e,typeof t=="string",s),d=t!==S.Fragment?{...u,...c,ref:n}:{},{children:f}=e,h=S.useMemo(()=>Le(f)?f.get():f,[f]);return S.createElement(t,{...d,children:h})}function l0({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,o){return{latestValues:u0(n,r,o,t),renderState:e()}}function u0(t,e,n,r){const o={},s=r(t,{});for(const h in s)o[h]=Lo(s[h]);let{initial:i,animate:a}=t;const c=cs(t),u=Yf(t);e&&u&&!c&&t.inherit!==!1&&(i===void 0&&(i=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!as(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const g=Xa(t,h[m]);if(g){const{transitionEnd:y,transition:v,...x}=g;for(const w in x){let b=x[w];if(Array.isArray(b)){const C=d?b.length-1:0;b=b[C]}b!==null&&(o[w]=b)}for(const w in y)o[w]=y[w]}}}return o}const Mh=t=>(e,n)=>{const r=S.useContext(ls),o=S.useContext(ss),s=()=>l0(t,e,r,o);return n?s():Na(s)},d0=Mh({scrapeMotionValuesFromProps:oc,createRenderState:ic}),f0=Mh({scrapeMotionValuesFromProps:ah,createRenderState:Th}),h0=Symbol.for("motionComponentSymbol");function p0(t,e,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const o=S.useRef(null);return S.useCallback(s=>{var a;s&&((a=t.onMount)==null||a.call(t,s));const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const Eh=S.createContext({});function Fn(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function m0(t,e,n,r,o,s){var b,C;const{visualElement:i}=S.useContext(ls),a=S.useContext(Ch),c=S.useContext(ss),u=S.useContext(sc),d=u.reducedMotion,f=u.skipAnimations,h=S.useRef(null),m=S.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(t,{visualState:e,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,y=S.useContext(Eh);g&&!g.projection&&o&&(g.type==="html"||g.type==="svg")&&g0(h.current,n,o,y);const v=S.useRef(!1);S.useInsertionEffect(()=>{g&&v.current&&g.update(n,c)});const x=n[_f],w=S.useRef(!!x&&typeof window<"u"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,x))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,x)));return Wd(()=>{m.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),w.current&&g.animationState&&g.animationState.animateChanges())}),S.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,x)}),w.current=!1),g.enteringChildren=void 0)}),g}function g0(t,e,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:jh(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&Fn(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function jh(t){if(t)return t.options.allowProjection!==!1?t.projection:jh(t.parent)}function ri(t,{forwardMotionProps:e=!1,type:n}={},r,o){r&&Zw(r);const s=n?n==="svg":ac(t),i=s?f0:d0;function a(u,d){let f;const h={...S.useContext(sc),...u,layoutId:y0(u)},{isStatic:m}=h,g=n0(u),y=i(u,m);if(!m&&typeof window<"u"){v0(h,r);const v=x0(h);f=v.MeasureLayout,g.visualElement=m0(t,y,h,o,v.ProjectionNode,s)}return l.jsxs(ls.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,c0(t,u,p0(y,g.visualElement,d),y,m,e,s)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=S.forwardRef(a);return c[h0]=t,c}function y0({layoutId:t}){const e=S.useContext(ka).id;return e&&t!==void 0?e+"-"+t:t}function v0(t,e){const n=S.useContext(Ch).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?nr(!1,r,"lazy-strict-mode"):Vt(!1,r,"lazy-strict-mode")}}function x0(t){const e=Sh(),{drag:n,layout:r}=e;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function b0(t,e){if(typeof Proxy>"u")return ri;const n=new Map,r=(s,i)=>ri(s,i,t,e),o=(s,i)=>(process.env.NODE_ENV!=="production"&&La(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,ri(i,void 0,t,e)),n.get(i))})}const w0=(t,e)=>e.isSVG??ac(t)?new Zb(e):new Hb(e,{allowProjection:t!==S.Fragment});class C0 extends ln{constructor(e){super(e),e.animationState||(e.animationState=nw(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();as(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let S0=0;class P0 extends ln{constructor(){super(...arguments),this.id=S0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Pn(this.node,i,a);if(c){const{transition:u,transitionEnd:d,...f}=c;for(const h in f)(s=this.node.getValue(h))==null||s.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!e);n&&!e&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const R0={animation:{Feature:C0},exit:{Feature:P0}};function Vr(t){return{point:{x:t.pageX,y:t.pageY}}}const T0=t=>e=>Ja(e)&&t(e,Vr(e));function Cr(t,e,n,r){return Mr(t,e,T0(n),r)}const Ah=({current:t})=>t?t.ownerDocument.defaultView:null,Bu=(t,e)=>Math.abs(t-e);function M0(t,e){const n=Bu(t.x,e.x),r=Bu(t.y,e.y);return Math.sqrt(n**2+r**2)}const Gu=new Set(["auto","scroll"]);class Dh{constructor(e,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=po(this.lastRawMoveEventInfo,this.transformPagePoint));const m=oi(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=M0(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:v}=m,{timestamp:x}=Oe;this.history.push({...v,timestamp:x});const{onStart:w,onMove:b}=this.handlers;g||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=po(g,this.transformPagePoint),pe.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:y,onSessionEnd:v,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=oi(m.type==="pointercancel"?this.lastMoveEventInfo:po(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,w),v&&v(m,w)},!Ja(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=Vr(e),u=po(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=Oe;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,oi(u,this.history)),this.removeListeners=Lr(Cr(this.contextWindow,"pointermove",this.handlePointerMove),Cr(this.contextWindow,"pointerup",this.handlePointerUp),Cr(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Gu.has(r.overflowX)||Gu.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,o),pe.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),tn(this.updatePoint)}}function po(t,e){return e?{point:e(t.point)}:t}function zu(t,e){return{x:t.x-e.x,y:t.y-e.y}}function oi({point:t},e){return{point:t,delta:zu(t,Ih(e)),offset:zu(t,E0(e)),velocity:j0(e,.1)}}function E0(t){return t[0]}function Ih(t){return t[t.length-1]}function j0(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=Ih(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>Xe(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&o.timestamp-r.timestamp>Xe(e)*2&&(r=t[1]);const s=dt(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function A0(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?ye(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?ye(n,t,r.max):Math.min(t,n)),t}function Uu(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function D0(t,{top:e,left:n,bottom:r,right:o}){return{x:Uu(t.x,n,o),y:Uu(t.y,e,r)}}function Hu(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function I0(t,e){return{x:Hu(t.x,e.x),y:Hu(t.y,e.y)}}function k0(t,e){let n=.5;const r=We(t),o=We(e);return o>r?n=Pr(e.min,e.max-r,t.min):r>o&&(n=Pr(t.min,t.max-o,e.min)),kt(0,1,n)}function N0(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Qi=.35;function _0(t=Qi){return t===!1?t=0:t===!0&&(t=Qi),{x:Wu(t,"left","right"),y:Wu(t,"top","bottom")}}function Wu(t,e,n){return{min:Ku(t,e),max:Ku(t,n)}}function Ku(t,e){return typeof t=="number"?t:t[e]||0}const O0=new WeakMap;class L0{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=je(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(Vr(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:g,onDragStart:y}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ub(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tt(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Dt.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const C=b.layout.layoutBox[x];C&&(w=We(C)*(parseFloat(w)/100))}}this.originPoint[x]=w}),y&&pe.update(()=>y(f,h),!1,!0),zi(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:y,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=h;if(g&&this.currentDirection===null){this.currentDirection=F0(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),v&&pe.update(()=>v(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Dh(e,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Ah(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&pe.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:o}=this.getProps();if(!r||!mo(e,o,this.currentDirection))return;const s=this.getAxisMotionValue(e);let i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=A0(i,this.constraints[e],this.elastic[e])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;e&&Fn(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=D0(r.layoutBox,e):this.constraints=!1,this.elastic=_0(n),o!==this.constraints&&!Fn(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=N0(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Fn(e))return!1;const r=e.current;Vt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=Fb(r,o.root,this.visualElement.getTransformPagePoint());let i=I0(o.layout.layoutBox,s);if(n){const a=n(Ob(i));this.hasMutatedConstraints=!!a,a&&(i=Qf(a))}return i}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Tt(d=>{if(!mo(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,g={type:"inertia",velocity:r?e[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return zi(this.visualElement,e),r.start(Ya(e,r,0,n,this.visualElement,!1))}stopAnimation(){Tt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Tt(n=>{const{drag:r}=this.getProps();if(!mo(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n],c=s.get()||0;s.set(e[n]-ye(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Fn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Tt(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=k0({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tt(i=>{if(!mo(i,e,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(ye(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;O0.set(this.visualElement,this);const e=this.visualElement.current,n=Cr(e,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,m=h!==e&&gb(h);d&&f&&!m&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();Fn(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=$0(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pe.read(o);const a=Mr(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Tt(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),i(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Qi,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Yu(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function $0(t,e,n){const r=tu(t,Yu(n)),o=tu(e,Yu(n));return()=>{r(),o()}}function mo(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function F0(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class V0 extends ln{constructor(e){super(e),this.removeGroupControls=ft,this.removeListeners=ft,this.controls=new L0(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ft}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const si=t=>(e,n)=>{t&&pe.update(()=>t(e,n),!1,!0)};class B0 extends ln{constructor(){super(...arguments),this.removePointerDownListener=ft}onPointerDown(e){this.session=new Dh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ah(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:si(e),onStart:si(n),onMove:si(r),onEnd:(s,i)=>{delete this.session,o&&pe.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Cr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ii=!1;class G0 extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),ii&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$o.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,e.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),ii=!0,o||e.layoutDependency!==n||n===void 0||e.isPresent!==s?i.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?i.promote():i.relegate()||pe.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Qa.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=e;ii=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function kh(t){const[e,n]=bh(),r=S.useContext(ka);return l.jsx(G0,{...t,layoutGroup:r,switchLayoutGroup:S.useContext(Eh),isPresent:e,safeToRemove:n})}const z0={pan:{Feature:B0},drag:{Feature:V0,ProjectionNode:xh,MeasureLayout:kh}};function Xu(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&pe.postRender(()=>s(e,Vr(e)))}class U0 extends ln{mount(){const{current:e}=this.node;e&&(this.unmount=fb(e,(n,r)=>(Xu(this.node,r,"Start"),o=>Xu(this.node,o,"End"))))}unmount(){}}class H0 extends ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Lr(Mr(this.node.current,"focus",()=>this.onFocus()),Mr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function qu(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&pe.postRender(()=>s(e,Vr(e)))}class W0 extends ln{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=vb(e,(o,s)=>(qu(this.node,s,"Start"),(i,{success:a})=>qu(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Ji=new WeakMap,ai=new WeakMap,K0=t=>{const e=Ji.get(t.target);e&&e(t)},Y0=t=>{t.forEach(K0)};function X0({root:t,...e}){const n=t||document;ai.has(n)||ai.set(n,{});const r=ai.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(Y0,{root:t,...e})),r[o]}function q0(t,e,n){const r=X0(e);return Ji.set(t,n),r.observe(t),()=>{Ji.delete(t),r.unobserve(t)}}const Z0={some:0,all:1};class Q0 extends ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=e,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Z0[o]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=d?f:h;m&&m(u)};this.stopObserver=q0(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(J0(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function J0({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const eC={inView:{Feature:Q0},tap:{Feature:W0},focus:{Feature:H0},hover:{Feature:U0}},tC={layout:{ProjectionNode:xh,MeasureLayout:kh}},nC={...R0,...eC,...z0,...tC},Nh=b0(nC,w0);function _h(){const[t,e]=S.useState([]),n=S.useRef(0),r=S.useCallback(s=>{const a=s.currentTarget.getBoundingClientRect(),c=Math.max(a.width,a.height)*2.2,u=s.clientX-a.left-c/2,d=s.clientY-a.top-c/2,f=n.current++;e(h=>[...h,{id:f,x:u,y:d,size:c}])},[]),o=S.useCallback(s=>{e(i=>i.filter(a=>a.id!==s))},[]);return{ripples:t,add:r,remove:o}}function Oh({ripples:t,onDone:e}){return l.jsx(wh,{children:t.map(n=>l.jsx(Nh.span,{className:"btn-ripple",style:{left:n.x,top:n.y,width:n.size,height:n.size},initial:{scale:0,opacity:1},animate:{scale:1,opacity:[1,1,0]},transition:{scale:{duration:1,ease:[.4,0,.2,1]},opacity:{duration:1.2,times:[0,.6,1],ease:"easeOut"}},onAnimationComplete:()=>e(n.id)},n.id))})}const rC=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),Er=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,shape:o,block:s=!1,loading:i=!1,icon:a,iconPosition:c="start",disableRipple:u=!1,disabled:d,className:f,style:h,sx:m,children:g,onClick:y,...v},x){const{ripples:w,add:b,remove:C}=_h(),P=d||i,R=O=>{P||(!u&&e!=="link"&&b(O),y==null||y(O))},{className:M,style:j,styleTag:T}=ae(m,h,"btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",f),E=i?l.jsx(rC,{}):c==="start"?a:null,N=!i&&c==="end"?a:null;return l.jsxs("button",{ref:x,className:M,style:j,onClick:R,disabled:P,"aria-busy":i||void 0,...v,children:[T,l.jsxs("span",{className:"btn-content",children:[E,g,N]}),!u&&e!=="link"&&l.jsx(Oh,{ripples:w,onDone:C})]})}),oC=S.forwardRef(function({orientation:e="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=H("btn-group",e==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return l.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),sC=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,position:o="static",disableRipple:s=!1,icon:i,label:a,open:c=!0,className:u,onClick:d,disabled:f,...h},m){const{ripples:g,add:y,remove:v}=_h(),x=C=>{f||(s||y(C),d==null||d(C))},w=a!=null,b=H("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",w&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(wh,{children:c&&l.jsxs(Nh.button,{ref:m,type:"button",className:b,onClick:x,disabled:f,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...h,children:[l.jsxs("span",{className:"btn-content",children:[i,w&&a]}),!s&&l.jsx(Oh,{ripples:g,onDone:v})]})})}),iC=S.forwardRef(function({icon:e,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(Er,{ref:s,shape:n,variant:r,icon:e,...o})});var aC=Object.defineProperty,ir=(t,e)=>aC(t,"name",{value:e,configurable:!0}),Lh=!!(typeof window<"u"&&window.document&&window.document.createElement);function U(t,e,{checkForDefaultPrevented:n=!0}={}){return ir(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}ir(U,"composeEventHandlers");function cC(t){var e;if(!Lh)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}ir(cC,"getOwnerWindow");function ea(t){if(!Lh)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}ir(ea,"getOwnerDocument");function $h(t,e=!1){const{activeElement:n}=ea(t);if(!(n!=null&&n.nodeName))return null;if(Fh(n)&&n.contentDocument)return $h(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=ea(n).getElementById(r);if(o)return o}}return n}ir($h,"getActiveElement");function Fh(t){return t.tagName==="IFRAME"}ir(Fh,"isFrame");var Te=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},lC=Object.defineProperty,uC=(t,e)=>lC(t,"name",{value:e,configurable:!0}),Zu=p[" useEffectEvent ".trim().toString()],Qu=p[" useInsertionEffect ".trim().toString()];function Vh(t){if(typeof Zu=="function")return Zu(t);const e=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Qu=="function"?Qu(()=>{e.current=t}):Te(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}uC(Vh,"useEffectEvent");var dC=Object.defineProperty,Br=(t,e)=>dC(t,"name",{value:e,configurable:!0}),fC=p[" useInsertionEffect ".trim().toString()]||Te;function we({prop:t,defaultProp:e,onChange:n=Br(()=>{},"onChange"),caller:r}){const[o,s,i]=Bh({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:o,u=p.useCallback(d=>{var f;if(a){const h=Gh(d)?d(t):d;h!==t&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,t,s,i]);return[c,u]}Br(we,"useControllableState");function Bh({defaultProp:t,onChange:e}){const[n,r]=p.useState(t),o=p.useRef(n),s=p.useRef(e);return fC(()=>{s.current=e},[e]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}Br(Bh,"useUncontrolledState");function Gh(t){return typeof t=="function"}Br(Gh,"isFunction");var Ju=Symbol("RADIX:SYNC_STATE");function hC(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=e,c=o!==void 0,u=Vh(i),d=[{...n,state:s}];r&&d.push(r);const[f,h]=p.useReducer((v,x)=>{if(x.type===Ju)return{...v,state:x.state};const w=t(v,x);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const y=p.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return p.useEffect(()=>{c&&!Object.is(o,f.state)&&h({type:Ju,state:o})},[o,f.state,c]),[y,h]}Br(hC,"useControllableStateReducer");var pC=Object.defineProperty,cc=(t,e)=>pC(t,"name",{value:e,configurable:!0});function ta(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}cc(ta,"setRef");function zh(...t){return e=>{let n=!1;const r=t.map(o=>{const s=ta(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ta(t[o],null)}}}}cc(zh,"composeRefs");function ce(...t){return p.useCallback(zh(...t),t)}cc(ce,"useComposedRefs");var mC=Object.defineProperty,wt=(t,e)=>mC(t,"name",{value:e,configurable:!0});function Nt(t){const e=p.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];na(o)&&typeof go=="function"&&(o=go(o._payload)),p.Children.forEach(o,h=>{var m;if(Yh(h)){a=!0;const g=h;let y="child"in g.props?g.props.child:g.props.children;na(y)&&typeof go=="function"&&(y=go(y._payload)),i=gC(g,y),c.push((m=i==null?void 0:i.props)==null?void 0:m.children)}else c.push(h)}),i?i=p.cloneElement(i,void 0,c):!a&&p.Children.count(o)===1&&p.isValidElement(o)&&(i=o);const u=i?Kh(i):void 0,d=ce(r,u);if(!i){if(o||o===0)throw new Error(a?xC(t):vC(t));return o}const f=Wh(s,i.props??{});return i.type!==p.Fragment&&(f.ref=r?d:u),p.cloneElement(i,f)});return e.displayName=`${t}.Slot`,e}wt(Nt,"createSlot");var Uh=Symbol.for("radix.slottable");function Hh(t){const e=wt(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Uh,e}wt(Hh,"createSlottable");var gC=wt((t,e)=>{if("child"in t.props){const n=t.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,t.props.children(n.props.children)):null}return p.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function Wh(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}wt(Wh,"mergeProps");function Kh(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}wt(Kh,"getElementRef");function Yh(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Uh}wt(Yh,"isSlottable");var yC=Symbol.for("react.lazy");function na(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===yC&&"_payload"in t&&Xh(t._payload)}wt(na,"isLazyComponent");function Xh(t){return typeof t=="object"&&t!==null&&"then"in t}wt(Xh,"isPromiseLike");var vC=wt(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),xC=wt(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),go=p[" use ".trim().toString()],bC=Object.defineProperty,wC=(t,e)=>bC(t,"name",{value:e,configurable:!0}),CC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],te=CC.reduce((t,e)=>{const n=Nt(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function lc(t,e){t&&Or.flushSync(()=>t.dispatchEvent(e))}wC(lc,"dispatchDiscreteCustomEvent");var SC=Object.defineProperty,PC=(t,e)=>SC(t,"name",{value:e,configurable:!0}),RC="Toggle",qh=p.forwardRef(PC(function(e,n){const{pressed:r,defaultPressed:o,onPressedChange:s,...i}=e,[a,c]=we({prop:r,onChange:s,defaultProp:o??!1,caller:RC});return l.jsx(te.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:n,onClick:U(e.onClick,()=>{e.disabled||c(!a)})})},"Toggle")),TC=qh;const MC=S.forwardRef(function({variant:e="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},u){const d=H("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return l.jsx(TC,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});var EC=Object.defineProperty,ut=(t,e)=>EC(t,"name",{value:e,configurable:!0});function jC(t,e){const n=p.createContext(e);n.displayName=t+"Context";const r=ut(s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=p.useContext(n);if(c)return c;if(e!==void 0)return e;if(!a)throw new Error(`\`${s}\` must be used within \`${t}\``)}return ut(o,"useContext"),[r,o]}ut(jC,"createContext");function Ce(t,e=[]){let n=[];function r(s,i){const a=p.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=ut(f=>{var x;const{scope:h,children:m,...g}=f,y=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useMemo(()=>g,Object.values(g));return l.jsx(y.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var x;const{optional:g=!1}=m,y=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useContext(y);if(v)return v;if(i!==void 0)return i;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ut(d,"useContext"),[u,d]}ut(r,"createContext");const o=ut(()=>{const s=n.map(i=>p.createContext(i));return ut(function(a){const c=(a==null?void 0:a[t])||s;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=t,[r,Zh(o,...e)]}ut(Ce,"createContextScope");function Zh(...t){const e=t[0];if(t.length===1)return e;const n=ut(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return ut(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}ut(Zh,"composeContextScopes");var AC=Object.defineProperty,Ne=(t,e)=>AC(t,"name",{value:e,configurable:!0});function ar(t){const e=t+"CollectionProvider",[n,r]=Ce(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=Ne(y=>{const{scope:v,children:x}=y,w=p.useRef(null),b=p.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:x})},"CollectionProvider");i.displayName=e;const a=t+"CollectionSlot",c=Nt(a),u=p.forwardRef((y,v)=>{const{scope:x,children:w}=y,b=s(a,x),C=ce(v,b.collectionRef);return l.jsx(c,{ref:C,children:w})});u.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",h=Nt(d),m=p.forwardRef((y,v)=>{const{scope:x,children:w,...b}=y,C=p.useRef(null),P=ce(v,C),R=s(d,x);return p.useEffect(()=>(R.itemMap.set(C,{ref:C,...b}),()=>void R.itemMap.delete(C))),l.jsx(h,{[f]:"",ref:P,children:w})});m.displayName=d;function g(y){const v=s(t+"CollectionConsumer",y);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((R,M)=>b.indexOf(R.ref.current)-b.indexOf(M.ref.current))},[v.collectionRef,v.itemMap])}return Ne(g,"useCollection"),[{Provider:i,Slot:u,ItemSlot:m},g,r]}Ne(ar,"createCollection");var ed=new WeakMap,Pe,ot,ci=(ot=class extends Map{constructor(n){super(n);Dl(this,Pe);Us(this,Pe,[...super.keys()]),ed.set(this,!0)}set(n,r){return ed.get(this)&&(this.has(n)?Be(this,Pe)[Be(this,Pe).indexOf(n)]=n:Be(this,Pe).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Be(this,Pe).length,a=uc(n);let c=a>=0?a:i+a;const u=c<0||c>=i?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(r,o),this;const d=this.size+(s?0:1);a<0&&c++;const f=[...Be(this,Pe)];let h,m=!1;for(let g=c;g<d;g++)if(c===g){let y=f[g];f[g]===r&&(y=f[g+1]),s&&this.delete(r),h=this.get(y),this.set(r,o)}else{!m&&f[g-1]===r&&(m=!0);const y=f[m?g:g-1],v=h;h=this.get(y),this.delete(y),this.set(y,v)}return this}with(n,r,o){const s=new ot(this);return s.insert(n,r,o),s}before(n){const r=Be(this,Pe).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Be(this,Pe).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Be(this,Pe).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=Be(this,Pe).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Us(this,Pe,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Be(this,Pe).splice(Be(this,Pe).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Fo(Be(this,Pe),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Fo(Be(this,Pe),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Be(this,Pe).indexOf(n)}keyAt(n){return Fo(Be(this,Pe),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new ot(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new ot(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const a of this)s===0&&n.length===1?i=a:i=Reflect.apply(r,this,[i,a,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const a=this.at(i);i===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new ot(r)}toReversed(){const n=new ot;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new ot(r)}slice(n,r){const o=new ot;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const a=this.keyAt(i),c=this.get(a);o.set(a,c)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Pe=new WeakMap,Ne(ot,"OrderedDict"),ot);function Fo(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=Qh(t,e);return n===-1?void 0:t[n]}Ne(Fo,"at");function Qh(t,e){const n=t.length,r=uc(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Ne(Qh,"toSafeIndex");function uc(t){return t!==t||t===0?0:Math.trunc(t)}Ne(uc,"toSafeInteger");function DC(t){const e=t+"CollectionProvider",[n,r]=Ce(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ci,setItemMap:Ne(()=>{},"setItemMap")}),i=Ne(({state:b,...C})=>b?l.jsx(c,{...C,state:b}):l.jsx(a,{...C}),"CollectionProvider");i.displayName=e;const a=Ne(b=>{const C=v();return l.jsx(c,{...b,state:C})},"CollectionInit");a.displayName=e+"Init";const c=Ne(b=>{const{scope:C,children:P,state:R}=b,M=p.useRef(null),[j,T]=p.useState(null),E=ce(M,T),[N,O]=R;return p.useEffect(()=>{if(!j)return;const $=tp(()=>{});return $.observe(j,{childList:!0,subtree:!0}),()=>{$.disconnect()}},[j]),l.jsx(o,{scope:C,itemMap:N,setItemMap:O,collectionRef:E,collectionRefObject:M,collectionElement:j,children:P})},"CollectionProviderImpl");c.displayName=e+"Impl";const u=t+"CollectionSlot",d=Nt(u),f=p.forwardRef((b,C)=>{const{scope:P,children:R}=b,M=s(u,P),j=ce(C,M.collectionRef);return l.jsx(d,{ref:j,children:R})});f.displayName=u;const h=t+"CollectionItemSlot",m="data-radix-collection-item",g=Nt(h),y=p.forwardRef((b,C)=>{const{scope:P,children:R,...M}=b,j=p.useRef(null),[T,E]=p.useState(null),N=ce(C,j,E),O=s(h,P),{setItemMap:$}=O,V=p.useRef(M);Jh(V.current,M)||(V.current=M);const q=V.current;return p.useEffect(()=>{const G=q;return $(k=>T?k.has(T)?k.set(T,{...G,element:T}).toSorted(ra):(k.set(T,{...G,element:T}),k.toSorted(ra)):k),()=>{$(k=>!T||!k.has(T)?k:(k.delete(T),new ci(k)))}},[T,q,$]),l.jsx(g,{[m]:"",ref:N,children:R})});y.displayName=h;function v(){return p.useState(new ci)}Ne(v,"useInitCollection");function x(b){const{itemMap:C}=s(t+"CollectionConsumer",b);return C}return Ne(x,"useCollection"),[{Provider:i,Slot:f,ItemSlot:y},{createCollectionScope:r,useCollection:x,useInitCollection:v}]}Ne(DC,"createCollection");function Jh(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}Ne(Jh,"shallowEqual");function ep(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Ne(ep,"isElementPreceding");function ra(t,e){return!t[1].element||!e[1].element?0:ep(t[1].element,e[1].element)?-1:1}Ne(ra,"sortByDocumentPosition");function tp(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Ne(tp,"getChildListObserver");var IC=Object.defineProperty,kC=(t,e)=>IC(t,"name",{value:e,configurable:!0}),NC=p[" useId ".trim().toString()]||(()=>{}),_C=0;function $e(t){const[e,n]=p.useState(NC());return Te(()=>{t||n(r=>r??String(_C++))},[t]),t||(e?`radix-${e}`:"")}kC($e,"useId");var OC=Object.defineProperty,LC=(t,e)=>OC(t,"name",{value:e,configurable:!0});function qe(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}LC(qe,"useCallbackRef");var $C=Object.defineProperty,FC=(t,e)=>$C(t,"name",{value:e,configurable:!0}),VC=p.createContext(void 0);function Ht(t){const e=p.useContext(VC);return t||e||"ltr"}FC(Ht,"useDirection");var BC=Object.defineProperty,dc=(t,e)=>BC(t,"name",{value:e,configurable:!0}),li=!1;function np(){const[t,e]=p.useState(li);return p.useEffect(()=>{li||(li=!0,e(!0))},[]),t}dc(np,"useIsHydrated");var rp=p[" useSyncExternalStore ".trim().toString()];function op(){return()=>{}}dc(op,"subscribe");function sp(){return rp(op,()=>!0,()=>!1)}dc(sp,"useIsHydratedModern");var GC=typeof rp=="function"?sp:np,zC=Object.defineProperty,jn=(t,e)=>zC(t,"name",{value:e,configurable:!0}),ui="rovingFocusGroup.onEntryFocus",UC={bubbles:!1,cancelable:!0},us="RovingFocusGroup",[oa,ip,HC]=ar(us),[WC,un]=Ce(us,[HC]),[KC,YC]=WC(us),XC=p.forwardRef(jn(function(e,n){return l.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(qC,{...e,ref:n})})})},"RovingFocusGroup")),qC=p.forwardRef(jn(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=p.useRef(null),g=ce(n,m),y=Ht(i),[v,x]=we({prop:a,defaultProp:c??null,onChange:u,caller:us}),[w,b]=p.useState(!1),C=qe(d),P=ip(r),R=p.useRef(!1),[M,j]=p.useState(0);return p.useEffect(()=>{const T=m.current;if(T)return T.addEventListener(ui,C),()=>T.removeEventListener(ui,C)},[C]),l.jsx(KC,{scope:r,orientation:o,dir:y,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(T=>x(T),[x]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(T=>T+1),[]),onFocusableItemRemove:p.useCallback(()=>j(T=>T-1),[]),children:l.jsx(te.div,{tabIndex:w||M===0?-1:0,"data-orientation":o,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:U(e.onMouseDown,()=>{R.current=!0}),onFocus:U(e.onFocus,T=>{const E=!R.current;if(T.target===T.currentTarget&&E&&!w){const N=new CustomEvent(ui,UC);if(T.currentTarget.dispatchEvent(N),!N.defaultPrevented){const O=P().filter(k=>k.focusable),$=O.find(k=>k.active),V=O.find(k=>k.id===v),G=[$,V,...O].filter(Boolean).map(k=>k.ref.current);fc(G,f)}}R.current=!1}),onBlur:U(e.onBlur,()=>b(!1))})})},"RovingFocusGroupImpl")),ZC="RovingFocusGroupItem",QC=p.forwardRef(jn(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=e,u=$e(),d=i||u,f=YC(ZC,r),h=f.currentTabStopId===d,m=ip(r),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:v}=f,x=GC();return Te(()=>{if(!(!x||!o))return g(),()=>y()},[x,o,g,y]),p.useEffect(()=>{if(!(x||!o))return g(),()=>y()},[x,o,g,y]),l.jsx(oa.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:l.jsx(te.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:U(e.onMouseDown,w=>{o?f.onItemFocus(d):w.preventDefault()}),onFocus:U(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:U(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const b=cp(w,f.orientation,f.dir);if(b!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let P=m().filter(R=>R.focusable).map(R=>R.ref.current);if(b==="last")P.reverse();else if(b==="prev"||b==="next"){b==="prev"&&P.reverse();const R=P.indexOf(w.currentTarget);P=f.loop?lp(P,R+1):P.slice(R+1)}setTimeout(()=>fc(P))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:v!=null}):a})})},"RovingFocusGroupItem")),JC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ap(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}jn(ap,"getDirectionAwareKey");function cp(t,e,n){const r=ap(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return JC[r]}jn(cp,"getFocusIntent");function fc(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}jn(fc,"focusFirst");function lp(t,e){return t.map((n,r)=>t[(e+r)%t.length])}jn(lp,"wrapArray");var ds=XC,fs=QC,eS=Object.defineProperty,nn=(t,e)=>eS(t,"name",{value:e,configurable:!0}),cr="ToggleGroup",[up,cN]=Ce(cr,[un]),dp=un(),tS=p.forwardRef(nn(function(e,n){const{type:r,...o}=e;if(r==="single"){const s=o;return l.jsx(nS,{role:"radiogroup",...s,ref:n})}if(r==="multiple"){const s=o;return l.jsx(rS,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${cr}\``)},"ToggleGroup")),[fp,hp]=up(cr),nS=p.forwardRef(nn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=nn(()=>{},"onValueChange"),...i}=e,[a,c]=we({prop:r,defaultProp:o??"",onChange:s,caller:cr});return l.jsx(fp,{scope:e.__scopeToggleGroup,type:"single",value:p.useMemo(()=>a?[a]:[],[a]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:l.jsx(pp,{...i,ref:n})})},"ToggleGroupImplSingle")),rS=p.forwardRef(nn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=nn(()=>{},"onValueChange"),...i}=e,[a,c]=we({prop:r,defaultProp:o??[],onChange:s,caller:cr}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(fp,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:u,onItemDeactivate:d,children:l.jsx(pp,{...i,ref:n})})},"ToggleGroupImplMultiple")),[oS,sS]=up(cr),pp=p.forwardRef(nn(function(e,n){const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:c=!0,...u}=e,d=dp(r),f=Ht(a),h={dir:f,...u};return l.jsx(oS,{scope:r,rovingFocus:s,disabled:o,children:s?l.jsx(ds,{asChild:!0,...d,orientation:i,dir:f,loop:c,children:l.jsx(te.div,{...h,ref:n})}):l.jsx(te.div,{...h,ref:n})})},"ToggleGroupImpl")),sa="ToggleGroupItem",iS=p.forwardRef(nn(function(e,n){const r=hp(sa,e.__scopeToggleGroup),o=sS(sa,e.__scopeToggleGroup),s=dp(e.__scopeToggleGroup),i=r.value.includes(e.value),a=o.disabled||e.disabled,c={...e,pressed:i,disabled:a},u=p.useRef(null);return o.rovingFocus?l.jsx(fs,{asChild:!0,...s,focusable:!a,active:i,ref:u,children:l.jsx(td,{...c,ref:n})}):l.jsx(td,{...c,ref:n})},"ToggleGroupItem")),td=p.forwardRef(nn(function(e,n){const{__scopeToggleGroup:r,value:o,...s}=e,i=hp(sa,r),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},c=i.type==="single"?a:void 0;return l.jsx(qh,{...c,...s,ref:n,onPressedChange:u=>{u?i.onItemActivate(o):i.onItemDeactivate(o)}})},"ToggleGroupItemImpl"));const mp=S.createContext({variant:"outline",color:"primary"}),aS=S.forwardRef(function({variant:e="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},u){const d=H("btn-group",o==="spaced"&&"spaced",s&&"round",i);return l.jsx(mp.Provider,{value:{variant:e,color:n,size:r},children:l.jsx(tS,{ref:u,className:d,...c,children:a})})}),cS=S.forwardRef(function({icon:e,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=S.useContext(mp),d=H("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(iS,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[e,o]})})});/**
9
+ `),()=>{var M;(M=a.current)==null||M.removeAttribute("data-motion-pop-id"),R.contains(P)&&R.removeChild(P)}},[e]),l.jsx(qw,{isPresent:e,childRef:a,sizeRef:c,pop:s,children:s===!1?t:p.cloneElement(t,{ref:f})})}const Qw=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=Oa(Jw),f=S.useId();let h=!0,m=S.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:o,onExitComplete:g=>{d.set(g,!0);for(const y of d.values())if(!y)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return s&&h&&(m={...m}),S.useMemo(()=>{d.forEach((g,y)=>d.set(y,!1))},[n]),p.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=l.jsx(Zw,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),l.jsx(ss.Provider,{value:m,children:t})};function Jw(){return new Map}function Sh(t=!0){const e=S.useContext(ss);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,s=S.useId();S.useEffect(()=>{if(t)return o(s)},[t]);const i=S.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,i]:[!0]}const ho=t=>t.key||"";function Fu(t){const e=[];return S.Children.forEach(t,n=>{S.isValidElement(n)&&e.push(n)}),e}const Ph=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,f]=Sh(i),h=S.useMemo(()=>Fu(t),[t]),m=i&&!d?[]:h.map(ho),g=S.useRef(!0),y=S.useRef(h),v=Oa(()=>new Map),x=S.useRef(new Set),[w,b]=S.useState(h),[C,P]=S.useState(h);Xd(()=>{g.current=!1,y.current=h;for(let j=0;j<C.length;j++){const T=ho(C[j]);m.includes(T)?(v.delete(T),x.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[C,m.length,m.join("-")]);const R=[];if(h!==w){let j=[...h];for(let T=0;T<C.length;T++){const E=C[T],k=ho(E);m.includes(k)||(j.splice(T,0,E),R.push(E))}return s==="wait"&&R.length&&(j=R),P(Fu(j)),b(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&C.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:M}=S.useContext(_a);return l.jsx(l.Fragment,{children:C.map(j=>{const T=ho(j),E=i&&!d?!1:h===C||m.includes(T),k=()=>{if(x.current.has(T))return;if(v.has(T))x.current.add(T),v.set(T,!0);else return;let _=!0;v.forEach($=>{$||(_=!1)}),_&&(M==null||M(),P(y.current),i&&(f==null||f()),r&&r())};return l.jsx(Qw,{isPresent:E,initial:!g.current||n?void 0:!1,custom:e,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:E?void 0:k,anchorX:a,anchorY:c,children:j},T)})})},Rh=S.createContext({strict:!1}),Vu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Bu=!1;function e0(){if(Bu)return;const t={};for(const e in Vu)t[e]={isEnabled:n=>Vu[e].some(r=>!!n[r])};Jf(t),Bu=!0}function Th(){return e0(),$b()}function t0(t){const e=Th();for(const n in t)e[n]={...e[n],...t[n]};Jf(e)}const n0=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Jo(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||n0.has(t)}let Mh=t=>!Jo(t);function r0(t){typeof t=="function"&&(Mh=e=>e.startsWith("on")?!Jo(e):t(e))}try{r0(require("@emotion/is-prop-valid").default)}catch{}function o0(t,e,n){const r={};for(const o in t)o==="values"&&typeof t.values=="object"||$e(t[o])||(Mh(o)||n===!0&&Jo(o)||!e&&!Jo(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}const ls=S.createContext({});function s0(t,e){if(cs(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Mr(n)?n:void 0,animate:Mr(r)?r:void 0}}return t.inherit!==!1?e:{}}function i0(t){const{initial:e,animate:n}=s0(t,S.useContext(ls));return S.useMemo(()=>({initial:e,animate:n}),[Gu(e),Gu(n)])}function Gu(t){return Array.isArray(t)?t.join(" "):t}const cc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Eh(t,e,n){for(const r in e)!$e(e[r])&&!ih(r,n)&&(t[r]=e[r])}function a0({transformTemplate:t},e){return S.useMemo(()=>{const n=cc();return sc(n,e,t),Object.assign({},n.vars,n.style)},[e])}function c0(t,e){const n=t.style||{},r={};return Eh(r,n,t),Object.assign(r,a0(t,e)),r}function l0(t,e){const n={},r=c0(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const jh=()=>({...cc(),attrs:{}});function u0(t,e,n,r){const o=S.useMemo(()=>{const s=jh();return ah(s,e,lh(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Eh(s,t.style,t),o.style={...s,...o.style}}return o}const d0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function lc(t){return typeof t!="string"||t.includes("-")?!1:!!(d0.indexOf(t)>-1||/[A-Z]/u.test(t))}function f0(t,e,n,{latestValues:r},o,s=!1,i){const c=(i??lc(t)?u0:l0)(e,r,o,t),u=o0(e,typeof t=="string",s),d=t!==S.Fragment?{...u,...c,ref:n}:{},{children:f}=e,h=S.useMemo(()=>$e(f)?f.get():f,[f]);return S.createElement(t,{...d,children:h})}function h0({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,o){return{latestValues:p0(n,r,o,t),renderState:e()}}function p0(t,e,n,r){const o={},s=r(t,{});for(const h in s)o[h]=Lo(s[h]);let{initial:i,animate:a}=t;const c=cs(t),u=Zf(t);e&&u&&!c&&t.inherit!==!1&&(i===void 0&&(i=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!as(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const g=Za(t,h[m]);if(g){const{transitionEnd:y,transition:v,...x}=g;for(const w in x){let b=x[w];if(Array.isArray(b)){const C=d?b.length-1:0;b=b[C]}b!==null&&(o[w]=b)}for(const w in y)o[w]=y[w]}}}return o}const Ah=t=>(e,n)=>{const r=S.useContext(ls),o=S.useContext(ss),s=()=>h0(t,e,r,o);return n?s():Oa(s)},m0=Ah({scrapeMotionValuesFromProps:ic,createRenderState:cc}),g0=Ah({scrapeMotionValuesFromProps:uh,createRenderState:jh}),y0=Symbol.for("motionComponentSymbol");function v0(t,e,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const o=S.useRef(null);return S.useCallback(s=>{var a;s&&((a=t.onMount)==null||a.call(t,s));const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const Dh=S.createContext({});function Vn(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function x0(t,e,n,r,o,s){var b,C;const{visualElement:i}=S.useContext(ls),a=S.useContext(Rh),c=S.useContext(ss),u=S.useContext(ac),d=u.reducedMotion,f=u.skipAnimations,h=S.useRef(null),m=S.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(t,{visualState:e,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,y=S.useContext(Dh);g&&!g.projection&&o&&(g.type==="html"||g.type==="svg")&&b0(h.current,n,o,y);const v=S.useRef(!1);S.useInsertionEffect(()=>{g&&v.current&&g.update(n,c)});const x=n[$f],w=S.useRef(!!x&&typeof window<"u"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,x))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,x)));return Xd(()=>{m.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),w.current&&g.animationState&&g.animationState.animateChanges())}),S.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,x)}),w.current=!1),g.enteringChildren=void 0)}),g}function b0(t,e,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ih(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&Vn(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function Ih(t){if(t)return t.options.allowProjection!==!1?t.projection:Ih(t.parent)}function ri(t,{forwardMotionProps:e=!1,type:n}={},r,o){r&&t0(r);const s=n?n==="svg":lc(t),i=s?g0:m0;function a(u,d){let f;const h={...S.useContext(ac),...u,layoutId:w0(u)},{isStatic:m}=h,g=i0(u),y=i(u,m);if(!m&&typeof window<"u"){C0(h,r);const v=S0(h);f=v.MeasureLayout,g.visualElement=x0(t,y,h,o,v.ProjectionNode,s)}return l.jsxs(ls.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,f0(t,u,v0(y,g.visualElement,d),y,m,e,s)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=S.forwardRef(a);return c[y0]=t,c}function w0({layoutId:t}){const e=S.useContext(_a).id;return e&&t!==void 0?e+"-"+t:t}function C0(t,e){const n=S.useContext(Rh).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?rr(!1,r,"lazy-strict-mode"):Vt(!1,r,"lazy-strict-mode")}}function S0(t){const e=Th(),{drag:n,layout:r}=e;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function P0(t,e){if(typeof Proxy>"u")return ri;const n=new Map,r=(s,i)=>ri(s,i,t,e),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Fa(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,ri(i,void 0,t,e)),n.get(i))})}const R0=(t,e)=>e.isSVG??lc(t)?new tw(e):new Xb(e,{allowProjection:t!==S.Fragment});class T0 extends ln{constructor(e){super(e),e.animationState||(e.animationState=iw(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();as(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let M0=0;class E0 extends ln{constructor(){super(...arguments),this.id=M0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Rn(this.node,i,a);if(c){const{transition:u,transitionEnd:d,...f}=c;for(const h in f)(s=this.node.getValue(h))==null||s.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!e);n&&!e&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const j0={animation:{Feature:T0},exit:{Feature:E0}};function Br(t){return{point:{x:t.pageX,y:t.pageY}}}const A0=t=>e=>tc(e)&&t(e,Br(e));function Sr(t,e,n,r){return Er(t,e,A0(n),r)}const kh=({current:t})=>t?t.ownerDocument.defaultView:null,zu=(t,e)=>Math.abs(t-e);function D0(t,e){const n=zu(t.x,e.x),r=zu(t.y,e.y);return Math.sqrt(n**2+r**2)}const Uu=new Set(["auto","scroll"]);class Nh{constructor(e,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=po(this.lastRawMoveEventInfo,this.transformPagePoint));const m=oi(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=D0(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:v}=m,{timestamp:x}=Le;this.history.push({...v,timestamp:x});const{onStart:w,onMove:b}=this.handlers;g||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=po(g,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:y,onSessionEnd:v,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=oi(m.type==="pointercancel"?this.lastMoveEventInfo:po(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,w),v&&v(m,w)},!tc(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=Br(e),u=po(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=Le;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,oi(u,this.history)),this.removeListeners=$r(Sr(this.contextWindow,"pointermove",this.handlePointerMove),Sr(this.contextWindow,"pointerup",this.handlePointerUp),Sr(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Uu.has(r.overflowX)||Uu.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,o),ye.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),tn(this.updatePoint)}}function po(t,e){return e?{point:e(t.point)}:t}function Hu(t,e){return{x:t.x-e.x,y:t.y-e.y}}function oi({point:t},e){return{point:t,delta:Hu(t,_h(e)),offset:Hu(t,I0(e)),velocity:k0(e,.1)}}function I0(t){return t[0]}function _h(t){return t[t.length-1]}function k0(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=_h(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>Ze(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&o.timestamp-r.timestamp>Ze(e)*2&&(r=t[1]);const s=ft(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function N0(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?xe(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?xe(n,t,r.max):Math.min(t,n)),t}function Wu(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function _0(t,{top:e,left:n,bottom:r,right:o}){return{x:Wu(t.x,n,o),y:Wu(t.y,e,r)}}function Ku(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function O0(t,e){return{x:Ku(t.x,e.x),y:Ku(t.y,e.y)}}function L0(t,e){let n=.5;const r=Ye(t),o=Ye(e);return o>r?n=Rr(e.min,e.max-r,t.min):r>o&&(n=Rr(t.min,t.max-o,e.min)),kt(0,1,n)}function $0(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Qi=.35;function F0(t=Qi){return t===!1?t=0:t===!0&&(t=Qi),{x:Yu(t,"left","right"),y:Yu(t,"top","bottom")}}function Yu(t,e,n){return{min:Xu(t,e),max:Xu(t,n)}}function Xu(t,e){return typeof t=="number"?t:t[e]||0}const V0=new WeakMap;class B0{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ae(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(Br(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:g,onDragStart:y}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pb(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tt(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Dt.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const C=b.layout.layoutBox[x];C&&(w=Ye(C)*(parseFloat(w)/100))}}this.originPoint[x]=w}),y&&ye.update(()=>y(f,h),!1,!0),zi(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:y,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=h;if(g&&this.currentDirection===null){this.currentDirection=z0(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),v&&ye.update(()=>v(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Nh(e,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:kh(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:o}=this.getProps();if(!r||!mo(e,o,this.currentDirection))return;const s=this.getAxisMotionValue(e);let i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=N0(i,this.constraints[e],this.elastic[e])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;e&&Vn(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=_0(r.layoutBox,e):this.constraints=!1,this.elastic=F0(n),o!==this.constraints&&!Vn(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=$0(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Vn(e))return!1;const r=e.current;Vt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=zb(r,o.root,this.visualElement.getTransformPagePoint());let i=O0(o.layout.layoutBox,s);if(n){const a=n(Vb(i));this.hasMutatedConstraints=!!a,a&&(i=th(a))}return i}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Tt(d=>{if(!mo(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,g={type:"inertia",velocity:r?e[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return zi(this.visualElement,e),r.start(qa(e,r,0,n,this.visualElement,!1))}stopAnimation(){Tt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Tt(n=>{const{drag:r}=this.getProps();if(!mo(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n],c=s.get()||0;s.set(e[n]-xe(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Vn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Tt(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=L0({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tt(i=>{if(!mo(i,e,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(xe(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;V0.set(this.visualElement,this);const e=this.visualElement.current,n=Sr(e,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,m=h!==e&&bb(h);d&&f&&!m&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();Vn(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=G0(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ye.read(o);const a=Er(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Tt(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),i(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Qi,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function qu(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function G0(t,e,n){const r=ru(t,qu(n)),o=ru(e,qu(n));return()=>{r(),o()}}function mo(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function z0(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class U0 extends ln{constructor(e){super(e),this.removeGroupControls=ht,this.removeListeners=ht,this.controls=new B0(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ht}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const si=t=>(e,n)=>{t&&ye.update(()=>t(e,n),!1,!0)};class H0 extends ln{constructor(){super(...arguments),this.removePointerDownListener=ht}onPointerDown(e){this.session=new Nh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:kh(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:si(e),onStart:si(n),onMove:si(r),onEnd:(s,i)=>{delete this.session,o&&ye.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Sr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ii=!1;class W0 extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),ii&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$o.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,e.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),ii=!0,o||e.layoutDependency!==n||n===void 0||e.isPresent!==s?i.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?i.promote():i.relegate()||ye.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ec.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=e;ii=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Oh(t){const[e,n]=Sh(),r=S.useContext(_a);return l.jsx(W0,{...t,layoutGroup:r,switchLayoutGroup:S.useContext(Dh),isPresent:e,safeToRemove:n})}const K0={pan:{Feature:H0},drag:{Feature:U0,ProjectionNode:Ch,MeasureLayout:Oh}};function Zu(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ye.postRender(()=>s(e,Br(e)))}class Y0 extends ln{mount(){const{current:e}=this.node;e&&(this.unmount=gb(e,(n,r)=>(Zu(this.node,r,"Start"),o=>Zu(this.node,o,"End"))))}unmount(){}}class X0 extends ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$r(Er(this.node.current,"focus",()=>this.onFocus()),Er(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qu(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&ye.postRender(()=>s(e,Br(e)))}class q0 extends ln{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Cb(e,(o,s)=>(Qu(this.node,s,"Start"),(i,{success:a})=>Qu(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Ji=new WeakMap,ai=new WeakMap,Z0=t=>{const e=Ji.get(t.target);e&&e(t)},Q0=t=>{t.forEach(Z0)};function J0({root:t,...e}){const n=t||document;ai.has(n)||ai.set(n,{});const r=ai.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(Q0,{root:t,...e})),r[o]}function eC(t,e,n){const r=J0(e);return Ji.set(t,n),r.observe(t),()=>{Ji.delete(t),r.unobserve(t)}}const tC={some:0,all:1};class nC extends ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=e,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:tC[o]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=d?f:h;m&&m(u)};this.stopObserver=eC(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(rC(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function rC({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const oC={inView:{Feature:nC},tap:{Feature:q0},focus:{Feature:X0},hover:{Feature:Y0}},sC={layout:{ProjectionNode:Ch,MeasureLayout:Oh}},iC={...j0,...oC,...K0,...sC},Lh=P0(iC,R0);function $h(){const[t,e]=S.useState([]),n=S.useRef(0),r=S.useCallback(s=>{const a=s.currentTarget.getBoundingClientRect(),c=Math.max(a.width,a.height)*2.2,u=s.clientX-a.left-c/2,d=s.clientY-a.top-c/2,f=n.current++;e(h=>[...h,{id:f,x:u,y:d,size:c}])},[]),o=S.useCallback(s=>{e(i=>i.filter(a=>a.id!==s))},[]);return{ripples:t,add:r,remove:o}}function Fh({ripples:t,onDone:e}){return l.jsx(Ph,{children:t.map(n=>l.jsx(Lh.span,{className:"btn-ripple",style:{left:n.x,top:n.y,width:n.size,height:n.size},initial:{scale:0,opacity:1},animate:{scale:1,opacity:[1,1,0]},transition:{scale:{duration:1,ease:[.4,0,.2,1]},opacity:{duration:1.2,times:[0,.6,1],ease:"easeOut"}},onAnimationComplete:()=>e(n.id)},n.id))})}const aC=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),jr=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,shape:o,block:s=!1,loading:i=!1,icon:a,iconPosition:c="start",disableRipple:u=!1,disabled:d,className:f,style:h,sx:m,children:g,onClick:y,...v},x){const{ripples:w,add:b,remove:C}=$h(),P=d||i,R=_=>{P||(!u&&e!=="link"&&b(_),y==null||y(_))},{className:M,style:j,styleTag:T}=se(m,h,"btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",f),E=i?l.jsx(aC,{}):c==="start"?a:null,k=!i&&c==="end"?a:null;return l.jsxs("button",{ref:x,className:M,style:j,onClick:R,disabled:P,"aria-busy":i||void 0,...v,children:[T,l.jsxs("span",{className:"btn-content",children:[E,g,k]}),!u&&e!=="link"&&l.jsx(Fh,{ripples:w,onDone:C})]})}),cC=S.forwardRef(function({orientation:e="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=W("btn-group",e==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return l.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),lC=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,position:o="static",disableRipple:s=!1,icon:i,label:a,open:c=!0,className:u,onClick:d,disabled:f,...h},m){const{ripples:g,add:y,remove:v}=$h(),x=C=>{f||(s||y(C),d==null||d(C))},w=a!=null,b=W("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",w&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(Ph,{children:c&&l.jsxs(Lh.button,{ref:m,type:"button",className:b,onClick:x,disabled:f,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...h,children:[l.jsxs("span",{className:"btn-content",children:[i,w&&a]}),!s&&l.jsx(Fh,{ripples:g,onDone:v})]})})}),uC=S.forwardRef(function({icon:e,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(jr,{ref:s,shape:n,variant:r,icon:e,...o})});var dC=Object.defineProperty,ar=(t,e)=>dC(t,"name",{value:e,configurable:!0}),Vh=!!(typeof window<"u"&&window.document&&window.document.createElement);function U(t,e,{checkForDefaultPrevented:n=!0}={}){return ar(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}ar(U,"composeEventHandlers");function fC(t){var e;if(!Vh)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}ar(fC,"getOwnerWindow");function ea(t){if(!Vh)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}ar(ea,"getOwnerDocument");function Bh(t,e=!1){const{activeElement:n}=ea(t);if(!(n!=null&&n.nodeName))return null;if(Gh(n)&&n.contentDocument)return Bh(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=ea(n).getElementById(r);if(o)return o}}return n}ar(Bh,"getActiveElement");function Gh(t){return t.tagName==="IFRAME"}ar(Gh,"isFrame");var Ee=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},hC=Object.defineProperty,pC=(t,e)=>hC(t,"name",{value:e,configurable:!0}),Ju=p[" useEffectEvent ".trim().toString()],ed=p[" useInsertionEffect ".trim().toString()];function zh(t){if(typeof Ju=="function")return Ju(t);const e=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ed=="function"?ed(()=>{e.current=t}):Ee(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}pC(zh,"useEffectEvent");var mC=Object.defineProperty,Gr=(t,e)=>mC(t,"name",{value:e,configurable:!0}),gC=p[" useInsertionEffect ".trim().toString()]||Ee;function Pe({prop:t,defaultProp:e,onChange:n=Gr(()=>{},"onChange"),caller:r}){const[o,s,i]=Uh({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:o,u=p.useCallback(d=>{var f;if(a){const h=Hh(d)?d(t):d;h!==t&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,t,s,i]);return[c,u]}Gr(Pe,"useControllableState");function Uh({defaultProp:t,onChange:e}){const[n,r]=p.useState(t),o=p.useRef(n),s=p.useRef(e);return gC(()=>{s.current=e},[e]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}Gr(Uh,"useUncontrolledState");function Hh(t){return typeof t=="function"}Gr(Hh,"isFunction");var td=Symbol("RADIX:SYNC_STATE");function yC(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=e,c=o!==void 0,u=zh(i),d=[{...n,state:s}];r&&d.push(r);const[f,h]=p.useReducer((v,x)=>{if(x.type===td)return{...v,state:x.state};const w=t(v,x);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const y=p.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return p.useEffect(()=>{c&&!Object.is(o,f.state)&&h({type:td,state:o})},[o,f.state,c]),[y,h]}Gr(yC,"useControllableStateReducer");var vC=Object.defineProperty,uc=(t,e)=>vC(t,"name",{value:e,configurable:!0});function ta(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}uc(ta,"setRef");function Wh(...t){return e=>{let n=!1;const r=t.map(o=>{const s=ta(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ta(t[o],null)}}}}uc(Wh,"composeRefs");function ie(...t){return p.useCallback(Wh(...t),t)}uc(ie,"useComposedRefs");var xC=Object.defineProperty,wt=(t,e)=>xC(t,"name",{value:e,configurable:!0});function Nt(t){const e=p.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];na(o)&&typeof go=="function"&&(o=go(o._payload)),p.Children.forEach(o,h=>{var m;if(Zh(h)){a=!0;const g=h;let y="child"in g.props?g.props.child:g.props.children;na(y)&&typeof go=="function"&&(y=go(y._payload)),i=bC(g,y),c.push((m=i==null?void 0:i.props)==null?void 0:m.children)}else c.push(h)}),i?i=p.cloneElement(i,void 0,c):!a&&p.Children.count(o)===1&&p.isValidElement(o)&&(i=o);const u=i?qh(i):void 0,d=ie(r,u);if(!i){if(o||o===0)throw new Error(a?SC(t):CC(t));return o}const f=Xh(s,i.props??{});return i.type!==p.Fragment&&(f.ref=r?d:u),p.cloneElement(i,f)});return e.displayName=`${t}.Slot`,e}wt(Nt,"createSlot");var Kh=Symbol.for("radix.slottable");function Yh(t){const e=wt(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Kh,e}wt(Yh,"createSlottable");var bC=wt((t,e)=>{if("child"in t.props){const n=t.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,t.props.children(n.props.children)):null}return p.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function Xh(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}wt(Xh,"mergeProps");function qh(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}wt(qh,"getElementRef");function Zh(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Kh}wt(Zh,"isSlottable");var wC=Symbol.for("react.lazy");function na(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===wC&&"_payload"in t&&Qh(t._payload)}wt(na,"isLazyComponent");function Qh(t){return typeof t=="object"&&t!==null&&"then"in t}wt(Qh,"isPromiseLike");var CC=wt(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),SC=wt(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),go=p[" use ".trim().toString()],PC=Object.defineProperty,RC=(t,e)=>PC(t,"name",{value:e,configurable:!0}),TC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],re=TC.reduce((t,e)=>{const n=Nt(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function dc(t,e){t&&Lr.flushSync(()=>t.dispatchEvent(e))}RC(dc,"dispatchDiscreteCustomEvent");var MC=Object.defineProperty,EC=(t,e)=>MC(t,"name",{value:e,configurable:!0}),jC="Toggle",Jh=p.forwardRef(EC(function(e,n){const{pressed:r,defaultPressed:o,onPressedChange:s,...i}=e,[a,c]=Pe({prop:r,onChange:s,defaultProp:o??!1,caller:jC});return l.jsx(re.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:n,onClick:U(e.onClick,()=>{e.disabled||c(!a)})})},"Toggle")),AC=Jh;const DC=S.forwardRef(function({variant:e="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},u){const d=W("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return l.jsx(AC,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});var IC=Object.defineProperty,dt=(t,e)=>IC(t,"name",{value:e,configurable:!0});function kC(t,e){const n=p.createContext(e);n.displayName=t+"Context";const r=dt(s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=p.useContext(n);if(c)return c;if(e!==void 0)return e;if(!a)throw new Error(`\`${s}\` must be used within \`${t}\``)}return dt(o,"useContext"),[r,o]}dt(kC,"createContext");function Re(t,e=[]){let n=[];function r(s,i){const a=p.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=dt(f=>{var x;const{scope:h,children:m,...g}=f,y=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useMemo(()=>g,Object.values(g));return l.jsx(y.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var x;const{optional:g=!1}=m,y=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useContext(y);if(v)return v;if(i!==void 0)return i;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return dt(d,"useContext"),[u,d]}dt(r,"createContext");const o=dt(()=>{const s=n.map(i=>p.createContext(i));return dt(function(a){const c=(a==null?void 0:a[t])||s;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=t,[r,ep(o,...e)]}dt(Re,"createContextScope");function ep(...t){const e=t[0];if(t.length===1)return e;const n=dt(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return dt(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}dt(ep,"composeContextScopes");var NC=Object.defineProperty,_e=(t,e)=>NC(t,"name",{value:e,configurable:!0});function cr(t){const e=t+"CollectionProvider",[n,r]=Re(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=_e(y=>{const{scope:v,children:x}=y,w=p.useRef(null),b=p.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:x})},"CollectionProvider");i.displayName=e;const a=t+"CollectionSlot",c=Nt(a),u=p.forwardRef((y,v)=>{const{scope:x,children:w}=y,b=s(a,x),C=ie(v,b.collectionRef);return l.jsx(c,{ref:C,children:w})});u.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",h=Nt(d),m=p.forwardRef((y,v)=>{const{scope:x,children:w,...b}=y,C=p.useRef(null),P=ie(v,C),R=s(d,x);return p.useEffect(()=>(R.itemMap.set(C,{ref:C,...b}),()=>void R.itemMap.delete(C))),l.jsx(h,{[f]:"",ref:P,children:w})});m.displayName=d;function g(y){const v=s(t+"CollectionConsumer",y);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((R,M)=>b.indexOf(R.ref.current)-b.indexOf(M.ref.current))},[v.collectionRef,v.itemMap])}return _e(g,"useCollection"),[{Provider:i,Slot:u,ItemSlot:m},g,r]}_e(cr,"createCollection");var nd=new WeakMap,Te,it,ci=(it=class extends Map{constructor(n){super(n);kl(this,Te);Us(this,Te,[...super.keys()]),nd.set(this,!0)}set(n,r){return nd.get(this)&&(this.has(n)?Ge(this,Te)[Ge(this,Te).indexOf(n)]=n:Ge(this,Te).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Ge(this,Te).length,a=fc(n);let c=a>=0?a:i+a;const u=c<0||c>=i?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(r,o),this;const d=this.size+(s?0:1);a<0&&c++;const f=[...Ge(this,Te)];let h,m=!1;for(let g=c;g<d;g++)if(c===g){let y=f[g];f[g]===r&&(y=f[g+1]),s&&this.delete(r),h=this.get(y),this.set(r,o)}else{!m&&f[g-1]===r&&(m=!0);const y=f[m?g:g-1],v=h;h=this.get(y),this.delete(y),this.set(y,v)}return this}with(n,r,o){const s=new it(this);return s.insert(n,r,o),s}before(n){const r=Ge(this,Te).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Ge(this,Te).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Ge(this,Te).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=Ge(this,Te).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Us(this,Te,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Ge(this,Te).splice(Ge(this,Te).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Fo(Ge(this,Te),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Fo(Ge(this,Te),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Ge(this,Te).indexOf(n)}keyAt(n){return Fo(Ge(this,Te),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new it(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new it(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const a of this)s===0&&n.length===1?i=a:i=Reflect.apply(r,this,[i,a,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const a=this.at(i);i===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new it(r)}toReversed(){const n=new it;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new it(r)}slice(n,r){const o=new it;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const a=this.keyAt(i),c=this.get(a);o.set(a,c)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Te=new WeakMap,_e(it,"OrderedDict"),it);function Fo(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=tp(t,e);return n===-1?void 0:t[n]}_e(Fo,"at");function tp(t,e){const n=t.length,r=fc(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}_e(tp,"toSafeIndex");function fc(t){return t!==t||t===0?0:Math.trunc(t)}_e(fc,"toSafeInteger");function _C(t){const e=t+"CollectionProvider",[n,r]=Re(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ci,setItemMap:_e(()=>{},"setItemMap")}),i=_e(({state:b,...C})=>b?l.jsx(c,{...C,state:b}):l.jsx(a,{...C}),"CollectionProvider");i.displayName=e;const a=_e(b=>{const C=v();return l.jsx(c,{...b,state:C})},"CollectionInit");a.displayName=e+"Init";const c=_e(b=>{const{scope:C,children:P,state:R}=b,M=p.useRef(null),[j,T]=p.useState(null),E=ie(M,T),[k,_]=R;return p.useEffect(()=>{if(!j)return;const $=op(()=>{});return $.observe(j,{childList:!0,subtree:!0}),()=>{$.disconnect()}},[j]),l.jsx(o,{scope:C,itemMap:k,setItemMap:_,collectionRef:E,collectionRefObject:M,collectionElement:j,children:P})},"CollectionProviderImpl");c.displayName=e+"Impl";const u=t+"CollectionSlot",d=Nt(u),f=p.forwardRef((b,C)=>{const{scope:P,children:R}=b,M=s(u,P),j=ie(C,M.collectionRef);return l.jsx(d,{ref:j,children:R})});f.displayName=u;const h=t+"CollectionItemSlot",m="data-radix-collection-item",g=Nt(h),y=p.forwardRef((b,C)=>{const{scope:P,children:R,...M}=b,j=p.useRef(null),[T,E]=p.useState(null),k=ie(C,j,E),_=s(h,P),{setItemMap:$}=_,G=p.useRef(M);np(G.current,M)||(G.current=M);const Q=G.current;return p.useEffect(()=>{const V=Q;return $(I=>T?I.has(T)?I.set(T,{...V,element:T}).toSorted(ra):(I.set(T,{...V,element:T}),I.toSorted(ra)):I),()=>{$(I=>!T||!I.has(T)?I:(I.delete(T),new ci(I)))}},[T,Q,$]),l.jsx(g,{[m]:"",ref:k,children:R})});y.displayName=h;function v(){return p.useState(new ci)}_e(v,"useInitCollection");function x(b){const{itemMap:C}=s(t+"CollectionConsumer",b);return C}return _e(x,"useCollection"),[{Provider:i,Slot:f,ItemSlot:y},{createCollectionScope:r,useCollection:x,useInitCollection:v}]}_e(_C,"createCollection");function np(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}_e(np,"shallowEqual");function rp(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}_e(rp,"isElementPreceding");function ra(t,e){return!t[1].element||!e[1].element?0:rp(t[1].element,e[1].element)?-1:1}_e(ra,"sortByDocumentPosition");function op(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}_e(op,"getChildListObserver");var OC=Object.defineProperty,LC=(t,e)=>OC(t,"name",{value:e,configurable:!0}),$C=p[" useId ".trim().toString()]||(()=>{}),FC=0;function Fe(t){const[e,n]=p.useState($C());return Ee(()=>{t||n(r=>r??String(FC++))},[t]),t||(e?`radix-${e}`:"")}LC(Fe,"useId");var VC=Object.defineProperty,BC=(t,e)=>VC(t,"name",{value:e,configurable:!0});function Qe(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}BC(Qe,"useCallbackRef");var GC=Object.defineProperty,zC=(t,e)=>GC(t,"name",{value:e,configurable:!0}),UC=p.createContext(void 0);function Ht(t){const e=p.useContext(UC);return t||e||"ltr"}zC(Ht,"useDirection");var HC=Object.defineProperty,hc=(t,e)=>HC(t,"name",{value:e,configurable:!0}),li=!1;function sp(){const[t,e]=p.useState(li);return p.useEffect(()=>{li||(li=!0,e(!0))},[]),t}hc(sp,"useIsHydrated");var ip=p[" useSyncExternalStore ".trim().toString()];function ap(){return()=>{}}hc(ap,"subscribe");function cp(){return ip(ap,()=>!0,()=>!1)}hc(cp,"useIsHydratedModern");var WC=typeof ip=="function"?cp:sp,KC=Object.defineProperty,An=(t,e)=>KC(t,"name",{value:e,configurable:!0}),ui="rovingFocusGroup.onEntryFocus",YC={bubbles:!1,cancelable:!0},us="RovingFocusGroup",[oa,lp,XC]=cr(us),[qC,un]=Re(us,[XC]),[ZC,QC]=qC(us),JC=p.forwardRef(An(function(e,n){return l.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(eS,{...e,ref:n})})})},"RovingFocusGroup")),eS=p.forwardRef(An(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=p.useRef(null),g=ie(n,m),y=Ht(i),[v,x]=Pe({prop:a,defaultProp:c??null,onChange:u,caller:us}),[w,b]=p.useState(!1),C=Qe(d),P=lp(r),R=p.useRef(!1),[M,j]=p.useState(0);return p.useEffect(()=>{const T=m.current;if(T)return T.addEventListener(ui,C),()=>T.removeEventListener(ui,C)},[C]),l.jsx(ZC,{scope:r,orientation:o,dir:y,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(T=>x(T),[x]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(T=>T+1),[]),onFocusableItemRemove:p.useCallback(()=>j(T=>T-1),[]),children:l.jsx(re.div,{tabIndex:w||M===0?-1:0,"data-orientation":o,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:U(e.onMouseDown,()=>{R.current=!0}),onFocus:U(e.onFocus,T=>{const E=!R.current;if(T.target===T.currentTarget&&E&&!w){const k=new CustomEvent(ui,YC);if(T.currentTarget.dispatchEvent(k),!k.defaultPrevented){const _=P().filter(I=>I.focusable),$=_.find(I=>I.active),G=_.find(I=>I.id===v),V=[$,G,..._].filter(Boolean).map(I=>I.ref.current);pc(V,f)}}R.current=!1}),onBlur:U(e.onBlur,()=>b(!1))})})},"RovingFocusGroupImpl")),tS="RovingFocusGroupItem",nS=p.forwardRef(An(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=e,u=Fe(),d=i||u,f=QC(tS,r),h=f.currentTabStopId===d,m=lp(r),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:v}=f,x=WC();return Ee(()=>{if(!(!x||!o))return g(),()=>y()},[x,o,g,y]),p.useEffect(()=>{if(!(x||!o))return g(),()=>y()},[x,o,g,y]),l.jsx(oa.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:l.jsx(re.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:U(e.onMouseDown,w=>{o?f.onItemFocus(d):w.preventDefault()}),onFocus:U(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:U(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const b=dp(w,f.orientation,f.dir);if(b!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let P=m().filter(R=>R.focusable).map(R=>R.ref.current);if(b==="last")P.reverse();else if(b==="prev"||b==="next"){b==="prev"&&P.reverse();const R=P.indexOf(w.currentTarget);P=f.loop?fp(P,R+1):P.slice(R+1)}setTimeout(()=>pc(P))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:v!=null}):a})})},"RovingFocusGroupItem")),rS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function up(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}An(up,"getDirectionAwareKey");function dp(t,e,n){const r=up(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rS[r]}An(dp,"getFocusIntent");function pc(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}An(pc,"focusFirst");function fp(t,e){return t.map((n,r)=>t[(e+r)%t.length])}An(fp,"wrapArray");var ds=JC,fs=nS,oS=Object.defineProperty,nn=(t,e)=>oS(t,"name",{value:e,configurable:!0}),lr="ToggleGroup",[hp,fN]=Re(lr,[un]),pp=un(),sS=p.forwardRef(nn(function(e,n){const{type:r,...o}=e;if(r==="single"){const s=o;return l.jsx(iS,{role:"radiogroup",...s,ref:n})}if(r==="multiple"){const s=o;return l.jsx(aS,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${lr}\``)},"ToggleGroup")),[mp,gp]=hp(lr),iS=p.forwardRef(nn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=nn(()=>{},"onValueChange"),...i}=e,[a,c]=Pe({prop:r,defaultProp:o??"",onChange:s,caller:lr});return l.jsx(mp,{scope:e.__scopeToggleGroup,type:"single",value:p.useMemo(()=>a?[a]:[],[a]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:l.jsx(yp,{...i,ref:n})})},"ToggleGroupImplSingle")),aS=p.forwardRef(nn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=nn(()=>{},"onValueChange"),...i}=e,[a,c]=Pe({prop:r,defaultProp:o??[],onChange:s,caller:lr}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(mp,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:u,onItemDeactivate:d,children:l.jsx(yp,{...i,ref:n})})},"ToggleGroupImplMultiple")),[cS,lS]=hp(lr),yp=p.forwardRef(nn(function(e,n){const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:c=!0,...u}=e,d=pp(r),f=Ht(a),h={dir:f,...u};return l.jsx(cS,{scope:r,rovingFocus:s,disabled:o,children:s?l.jsx(ds,{asChild:!0,...d,orientation:i,dir:f,loop:c,children:l.jsx(re.div,{...h,ref:n})}):l.jsx(re.div,{...h,ref:n})})},"ToggleGroupImpl")),sa="ToggleGroupItem",uS=p.forwardRef(nn(function(e,n){const r=gp(sa,e.__scopeToggleGroup),o=lS(sa,e.__scopeToggleGroup),s=pp(e.__scopeToggleGroup),i=r.value.includes(e.value),a=o.disabled||e.disabled,c={...e,pressed:i,disabled:a},u=p.useRef(null);return o.rovingFocus?l.jsx(fs,{asChild:!0,...s,focusable:!a,active:i,ref:u,children:l.jsx(rd,{...c,ref:n})}):l.jsx(rd,{...c,ref:n})},"ToggleGroupItem")),rd=p.forwardRef(nn(function(e,n){const{__scopeToggleGroup:r,value:o,...s}=e,i=gp(sa,r),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},c=i.type==="single"?a:void 0;return l.jsx(Jh,{...c,...s,ref:n,onPressedChange:u=>{u?i.onItemActivate(o):i.onItemDeactivate(o)}})},"ToggleGroupItemImpl"));const vp=S.createContext({variant:"outline",color:"primary"}),dS=S.forwardRef(function({variant:e="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},u){const d=W("btn-group",o==="spaced"&&"spaced",s&&"round",i);return l.jsx(vp.Provider,{value:{variant:e,color:n,size:r},children:l.jsx(sS,{ref:u,className:d,...c,children:a})})}),fS=S.forwardRef(function({icon:e,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=S.useContext(vp),d=W("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(uS,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[e,o]})})});/**
10
10
  * @license lucide-react v1.8.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */const gp=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
14
+ */const xp=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
15
15
  * @license lucide-react v1.8.0 - ISC
16
16
  *
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
- */const lS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
19
+ */const hS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
20
20
  * @license lucide-react v1.8.0 - ISC
21
21
  *
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
- */const uS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
24
+ */const pS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
25
25
  * @license lucide-react v1.8.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
- */const nd=t=>{const e=uS(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
29
+ */const od=t=>{const e=pS(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
30
30
  * @license lucide-react v1.8.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
@@ -36,142 +36,142 @@
36
36
  *
37
37
  * This source code is licensed under the ISC license.
38
38
  * See the LICENSE file in the root directory of this source tree.
39
- */const dS=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},fS=S.createContext({}),hS=()=>S.useContext(fS),pS=S.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>{const{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:m=""}=hS()??{},g=r??f?Number(n??d)*24/Number(e??u):n??d;return S.createElement("svg",{ref:c,...di,width:e??u??di.width,height:e??u??di.height,stroke:t??h,strokeWidth:g,className:gp("lucide",m,o),...!s&&!dS(a)&&{"aria-hidden":"true"},...a},[...i.map(([y,v])=>S.createElement(y,v)),...Array.isArray(s)?s:[s]])});/**
39
+ */const mS=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},gS=S.createContext({}),yS=()=>S.useContext(gS),vS=S.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>{const{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:m=""}=yS()??{},g=r??f?Number(n??d)*24/Number(e??u):n??d;return S.createElement("svg",{ref:c,...di,width:e??u??di.width,height:e??u??di.height,stroke:t??h,strokeWidth:g,className:xp("lucide",m,o),...!s&&!mS(a)&&{"aria-hidden":"true"},...a},[...i.map(([y,v])=>S.createElement(y,v)),...Array.isArray(s)?s:[s]])});/**
40
40
  * @license lucide-react v1.8.0 - ISC
41
41
  *
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
- */const ve=(t,e)=>{const n=S.forwardRef(({className:r,...o},s)=>S.createElement(pS,{ref:s,iconNode:e,className:gp(`lucide-${lS(nd(t))}`,`lucide-${t}`,r),...o}));return n.displayName=nd(t),n};/**
44
+ */const be=(t,e)=>{const n=S.forwardRef(({className:r,...o},s)=>S.createElement(vS,{ref:s,iconNode:e,className:xp(`lucide-${hS(od(t))}`,`lucide-${t}`,r),...o}));return n.displayName=od(t),n};/**
45
45
  * @license lucide-react v1.8.0 - ISC
46
46
  *
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
- */const mS=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],gS=ve("calendar",mS);/**
49
+ */const xS=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],bS=be("calendar",xS);/**
50
50
  * @license lucide-react v1.8.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */const yS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rn=ve("check",yS);/**
54
+ */const wS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rn=be("check",wS);/**
55
55
  * @license lucide-react v1.8.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const vS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Gr=ve("chevron-down",vS);/**
59
+ */const CS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zr=be("chevron-down",CS);/**
60
60
  * @license lucide-react v1.8.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */const xS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Vo=ve("chevron-left",xS);/**
64
+ */const SS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Vo=be("chevron-left",SS);/**
65
65
  * @license lucide-react v1.8.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const bS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jt=ve("chevron-right",bS);/**
69
+ */const PS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jt=be("chevron-right",PS);/**
70
70
  * @license lucide-react v1.8.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */const wS=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yp=ve("chevron-up",wS);/**
74
+ */const RS=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bp=be("chevron-up",RS);/**
75
75
  * @license lucide-react v1.8.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const CS=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],vp=ve("chevrons-up-down",CS);/**
79
+ */const TS=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],wp=be("chevrons-up-down",TS);/**
80
80
  * @license lucide-react v1.8.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const SS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],xp=ve("circle-alert",SS);/**
84
+ */const MS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Cp=be("circle-alert",MS);/**
85
85
  * @license lucide-react v1.8.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const PS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],bp=ve("circle-check",PS);/**
89
+ */const ES=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Sp=be("circle-check",ES);/**
90
90
  * @license lucide-react v1.8.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const RS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],wp=ve("circle",RS);/**
94
+ */const jS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Pp=be("circle",jS);/**
95
95
  * @license lucide-react v1.8.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const TS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],MS=ve("clock",TS);/**
99
+ */const AS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],DS=be("clock",AS);/**
100
100
  * @license lucide-react v1.8.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const ES=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],jS=ve("cloud-upload",ES);/**
104
+ */const IS=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],kS=be("cloud-upload",IS);/**
105
105
  * @license lucide-react v1.8.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const AS=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],DS=ve("ellipsis",AS);/**
109
+ */const NS=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],_S=be("ellipsis",NS);/**
110
110
  * @license lucide-react v1.8.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const IS=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],kS=ve("eye-off",IS);/**
114
+ */const OS=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],LS=be("eye-off",OS);/**
115
115
  * @license lucide-react v1.8.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const NS=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_S=ve("eye",NS);/**
119
+ */const $S=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],FS=be("eye",$S);/**
120
120
  * @license lucide-react v1.8.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const OS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],LS=ve("file",OS);/**
124
+ */const VS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],BS=be("file",VS);/**
125
125
  * @license lucide-react v1.8.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const $S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],FS=ve("folder-open",$S);/**
129
+ */const GS=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],zS=be("folder-open",GS);/**
130
130
  * @license lucide-react v1.8.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const VS=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],BS=ve("folder",VS);/**
134
+ */const US=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],HS=be("folder",US);/**
135
135
  * @license lucide-react v1.8.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const GS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Cp=ve("info",GS);/**
139
+ */const WS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Rp=be("info",WS);/**
140
140
  * @license lucide-react v1.8.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const zS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Sp=ve("loader-circle",zS);/**
144
+ */const KS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Tp=be("loader-circle",KS);/**
145
145
  * @license lucide-react v1.8.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const US=[["path",{d:"M5 12h14",key:"1ays0h"}]],HS=ve("minus",US);/**
149
+ */const YS=[["path",{d:"M5 12h14",key:"1ays0h"}]],XS=be("minus",YS);/**
150
150
  * @license lucide-react v1.8.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const WS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],KS=ve("panel-left",WS);/**
154
+ */const qS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ZS=be("panel-left",qS);/**
155
155
  * @license lucide-react v1.8.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const YS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pp=ve("search",YS);/**
159
+ */const QS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Mp=be("search",QS);/**
160
160
  * @license lucide-react v1.8.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const XS=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Rp=ve("triangle-alert",XS);/**
164
+ */const JS=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ep=be("triangle-alert",JS);/**
165
165
  * @license lucide-react v1.8.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const qS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wt=ve("x",qS),ZS=S.forwardRef(function({color:e="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,filled:c=!1,type:u="text",disabled:d,className:f,style:h,sx:m,value:g,defaultValue:y,onChange:v,...x},w){const b=g!==void 0,[C,P]=S.useState(y!=null?String(y):""),R=b?String(g??""):C,M=S.useRef(null);S.useImperativeHandle(w,()=>M.current,[]);const[j,T]=S.useState(!1),E=a&&j&&u==="password"?"text":u,N=s&&!d&&R!=="",O=N||a,$=r!=null||o!=null||O,V=L=>{b||P(L.target.value),v==null||v(L)},q=L=>{var X;L.preventDefault(),b||P("");const D=M.current;if(D){const A=(X=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:X.set;A==null||A.call(D,""),D.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},G=ae($?void 0:m,$?void 0:h,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,c&&"filled",f),k=l.jsx("input",{ref:M,type:E,className:G.className,style:G.style,disabled:d,value:b?g:void 0,defaultValue:b?void 0:y,onChange:V,...x});if(!$)return l.jsxs(l.Fragment,{children:[G.styleTag,k]});const F=ae(m,h,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!O&&"has-suffix",O&&"has-action");return l.jsxs("span",{className:F.className,style:F.style,children:[F.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),k,o!=null&&!O&&l.jsx("span",{className:"cny-input-suffix",children:o}),N&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:q,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})}),a&&u==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>T(L=>!L),"aria-label":j?"Hide password":"Show password","aria-pressed":j,children:j?l.jsx(kS,{size:14,"aria-hidden":"true"}):l.jsx(_S,{size:14,"aria-hidden":"true"})})]})}),QS=S.forwardRef(function({color:e="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=ae(o,r,"card",e!=="default"&&e,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),JS={info:Cp,success:bp,warning:Rp,danger:xp};function eP({color:t}){const e=JS[t];return l.jsx(e,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const tP=S.forwardRef(function({color:e="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},m){const g=c!==!1,y=c&&c!==!0?c:l.jsx(eP,{color:e}),{className:v,style:x,styleTag:w}=ae(i,s,"alert",e,n&&"solid",o),b=e==="danger"?"alert":"status";return l.jsxs("div",{ref:m,role:b,className:v,style:x,...h,children:[w,g&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"alert-content",children:[r&&l.jsx("p",{className:"alert-title",children:r}),a&&l.jsx("p",{className:"alert-body",children:a})]}),u&&l.jsx("div",{className:"alert-action",children:u}),d&&l.jsx("button",{type:"button",className:"alert-close",onClick:d,"aria-label":f,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}),nP=S.forwardRef(function({size:e="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=ae(a,i,"avatar",e!=="md"&&e,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[m,r?l.jsx("img",{src:r,alt:o??""}):c]})}),rP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:H("avatar-stack",e),...r,children:n})}),oP=S.forwardRef(function({value:e=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:m}=ae(i,d,"progress",r&&"indeterminate",n!=="primary"&&n,o);return l.jsxs("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:u,className:f,style:h,...a,children:[m,l.jsx("span",{className:"progress-bar"})]})}),sP=S.forwardRef(function({value:e,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d={...s??{},"--value":u},{className:f,style:h,styleTag:m}=ae(i,d,"progress-ring",n==="lg"&&"lg",o);return l.jsxs("span",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u,className:f,style:h,...a,children:[m,r&&l.jsxs("span",{children:[u,"%"]})]})}),iP={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},Tp=S.forwardRef(function({variant:e="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m={...iP[r],maxHeight:o,maxWidth:s,...c??{}},{className:g,style:y,styleTag:v}=ae(u,m,i?"cny-scroll-region":"cny-scroll",e!=="default"&&e,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:g,style:y,...f,children:[v,d]})}),aP=S.forwardRef(function(e,n){return l.jsx(Tp,{ref:n,region:!0,...e})}),ia=S.forwardRef(function({shape:e="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=ae(i,{...s??{},width:n,height:r},"skeleton",e,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),cP=S.forwardRef(function({solid:e=!1,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=ae(o,r,"cny-navbar",e&&"solid",n);return l.jsxs("header",{ref:a,className:c,style:u,...i,children:[d,s]})}),lP=S.forwardRef(function({mark:e=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:H("cny-navbar-brand",n),...o,children:[e&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),uP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("nav",{ref:o,className:H("cny-navbar-nav",e),...r,children:n})}),dP=S.forwardRef(function({active:e=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":e?"page":void 0,className:H("cny-navbar-item",e&&"active",n),...o,children:r})}),fP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:H("cny-navbar-actions",e),...r,children:n})}),hP=S.forwardRef(function({width:e="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=ae(a,i,"cny-sidebar",e!=="default"&&e,n&&"sticky",r&&"collapsed",o&&"responsive",s);return l.jsxs("aside",{ref:d,className:f,style:h,...u,children:[m,c]})}),pP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:H("cny-sidebar-header",e),...r,children:n})}),mP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:H("cny-sidebar-footer",e),...r,children:n})}),gP=S.forwardRef(function({collapsed:e=!1,onClick:n,className:r,children:o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":!e,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:H("cny-sidebar-toggle",e&&"collapsed",r),onClick:n,...s,children:o??l.jsx(KS,{size:16,"aria-hidden":"true"})})});function aa(t){const e=Array.from(t.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(e.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const yP=S.forwardRef(function({title:e,className:n,children:r,...o},s){const i=S.useRef(null),a=S.useCallback(c=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(y=>!y.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(y=>y===document.activeElement);let m=h;switch(c.key){case"ArrowDown":c.preventDefault(),m=h<f.length-1?h+1:0;break;case"ArrowUp":c.preventDefault(),m=h<=0?f.length-1:h-1;break;case"Home":c.preventDefault(),m=0;break;case"End":c.preventDefault(),m=f.length-1;break;default:return}const g=f[m];g&&g!==document.activeElement&&(f.forEach(y=>y.setAttribute("tabindex","-1")),g.setAttribute("tabindex","0"),g.focus())},[]);return S.useLayoutEffect(()=>{const c=i.current;if(!c||(aa(c),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>aa(c));return u.observe(c,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),l.jsxs("div",{ref:s,className:H("cny-sidebar-section",n),...o,children:[e&&l.jsx("div",{className:"cny-sidebar-title",children:e}),l.jsx("nav",{ref:i,className:"cny-sidebar-nav",onKeyDown:a,children:r})]})}),vP=S.forwardRef(function({active:e=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){const u=S.useRef(null),d=S.useId();S.useLayoutEffect(()=>{const h=u.current;if(!h)return;const m=h.closest('[class*="cny-sidebar-nav"]');m&&aa(m)},[e,n]);const f=typeof i=="string"&&!a["aria-label"]?i:void 0;return l.jsxs("a",{ref:h=>{u.current=h,typeof c=="function"?c(h):c&&(c.current=h)},"data-cny-sidebar-item":d,"aria-current":e?"page":void 0,"aria-disabled":n||void 0,"aria-label":f,className:H("cny-sidebar-item",e&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{className:"cny-sidebar-item-label",children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function xP(t){const e=[];return t.display&&e.push(t.display),t.direction==="row"?e.push("flex-row"):t.direction==="column"?e.push("flex-col"):t.direction==="row-reverse"?e.push("flex-row-reverse"):t.direction==="column-reverse"&&e.push("flex-col-reverse"),t.align&&e.push(`items-${t.align==="start"||t.align==="end",t.align}`),t.justify&&e.push(`justify-${t.justify}`),t.wrap&&e.push("flex-wrap"),t.p!==void 0&&e.push(`p-${t.p}`),t.px!==void 0&&e.push(`px-${t.px}`),t.py!==void 0&&e.push(`py-${t.py}`),t.pt!==void 0&&e.push(`pt-${t.pt}`),t.pr!==void 0&&e.push(`pr-${t.pr}`),t.pb!==void 0&&e.push(`pb-${t.pb}`),t.pl!==void 0&&e.push(`pl-${t.pl}`),t.m!==void 0&&e.push(`m-${t.m}`),t.mx!==void 0&&e.push(`mx-${t.mx}`),t.my!==void 0&&e.push(`my-${t.my}`),t.mt!==void 0&&e.push(`mt-${t.mt}`),t.mr!==void 0&&e.push(`mr-${t.mr}`),t.mb!==void 0&&e.push(`mb-${t.mb}`),t.ml!==void 0&&e.push(`ml-${t.ml}`),t.gap!==void 0&&e.push(`gap-${t.gap}`),t.gapX!==void 0&&e.push(`gap-x-${t.gapX}`),t.gapY!==void 0&&e.push(`gap-y-${t.gapY}`),t.w&&e.push(`w-${t.w}`),t.h&&e.push(`h-${t.h}`),t.grow&&e.push("flex-1"),e}const An=S.forwardRef(function({as:e,className:n,style:r,children:o,...s},i){const a=e??"div",{layoutProps:c,domProps:u}=bP(s),{sx:d,...f}=c,h=d?Ia(d):void 0,m=H(...xP(f),h==null?void 0:h.className,n),g=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,y=S.createElement(a,{ref:i,className:m||void 0,style:g,...u},o);return h!=null&&h.css?S.createElement(S.Fragment,null,S.createElement("style",{dangerouslySetInnerHTML:{__html:h.css}}),y):y});function bP(t){const e=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h","grow","sx"]),n={},r={};for(const[o,s]of Object.entries(t))e.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const wP=S.forwardRef(function(e,n){return l.jsx(An,{ref:n,display:"flex",direction:"column",...e})}),CP=S.forwardRef(function(e,n){const{align:r="center",...o}=e;return l.jsx(An,{ref:n,display:"flex",direction:"row",align:r,...o})}),rd=t=>t.map(e=>`minmax(0,${e}fr)`).join(" "),SP=S.forwardRef(function({cols:e,minColWidth:n,ratio:r,template:o,className:s,sx:i,...a},c){let u;if(o)u=o;else if(r)if(Array.isArray(r))u=rd(r);else{const f={};for(const[h,m]of Object.entries(r))m&&(f[h]=rd(m));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(An,{ref:c,display:"grid",className:H(!u&&e&&`grid-cols-${e}`,s),sx:d,...a})}),PP=S.forwardRef(function({size:e="lg",className:n,...r},o){return l.jsx(An,{ref:o,className:H("cny-container",e,n),...r})}),RP=S.forwardRef(function({orientation:e="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=ae(o,r,"cny-divider",e,n);return e==="vertical"?l.jsxs(l.Fragment,{children:[u,l.jsx("span",{ref:i,role:"separator","aria-orientation":"vertical",className:a,style:c,...s})]}):l.jsxs(l.Fragment,{children:[u,l.jsx("hr",{ref:i,className:a,style:c,...s})]})}),TP=S.forwardRef(function({className:e,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=ae(r,n,"cny-spacer",e);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),MP=S.forwardRef(function({ratio:e=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=ae(o,{aspectRatio:String(e),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),EP=S.forwardRef(function(e,n){return l.jsx(An,{ref:n,display:"flex",align:"center",justify:"center",...e})}),jP=S.forwardRef(function(e,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=e;return l.jsx(An,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),AP={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},DP=S.forwardRef(function({as:e,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m=e??AP[n],{className:g,style:y,styleTag:v}=ae(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return S.createElement(m,{ref:h,className:g,style:y,...f},v,d)});function IP({label:t,hint:e,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const m=S.useId(),g=S.Children.only(f),y=g.props.id??m,v=n!=null&&n!==!1,x=a??(v?"danger":"default"),w=e||n?`${y}-hint`:void 0,b=S.cloneElement(g,{id:y,"aria-invalid":v||g.props["aria-invalid"]||void 0,"aria-describedby":w??g.props["aria-describedby"],className:H(g.props.className,x!=="default"&&x)}),C=i!=null&&s!=null&&s>i?"danger":"default",{className:P,style:R,styleTag:M}=ae(d,u,"cny-field",c);return l.jsxs("div",{className:P,style:R,...h,children:[M,(t!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[t!=null?l.jsxs("label",{htmlFor:y,className:"cny-field-label",children:[t,r&&l.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&l.jsx("span",{className:"cny-field-optional",children:"optional"})]}):l.jsx("span",{}),s!=null&&l.jsx("span",{className:H("cny-field-counter",C==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),b,(n||e)&&l.jsx("span",{id:w,className:H("cny-field-hint",x!=="default"&&x),children:n??e})]})}const kP=S.forwardRef(function({color:e="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=S.useRef(null);S.useImperativeHandle(d,()=>f.current,[]);const h=S.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const b=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,b)}px`,x.style.overflowY=x.scrollHeight>b?"auto":"hidden"},[r,o]);S.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const m=x=>{c==null||c(x),r&&h()},{className:g,style:y,styleTag:v}=ae(a,i,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[v,l.jsx("textarea",{ref:f,className:g,style:y,onChange:m,...u})]})});var NP=Object.defineProperty,_P=(t,e)=>NP(t,"name",{value:e,configurable:!0});function jr(t,[e,n]){return Math.min(n,Math.max(e,t))}_P(jr,"clamp");var OP=Object.defineProperty,ke=(t,e)=>OP(t,"name",{value:e,configurable:!0}),ca="dismissableLayer.update",LP="dismissableLayer.pointerDownOutside",$P="dismissableLayer.focusOutside",od,Mp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zr=p.forwardRef(ke(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=e,f=p.useContext(Mp),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=p.useState({}),v=ce(n,m),x=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w?x.indexOf(w):-1,C=h?x.indexOf(h):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,R=C>=b,M=p.useRef(!1),j=jp(O=>{i==null||i(O),c==null||c(O),O.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(O=>{if(!(O instanceof Node))return!1;const $=[...f.branches].some(V=>V.contains(O));return R&&!$},[f.branches,R])}),T=Ap(O=>{if(o&&M.current)return;const $=O.target;[...f.branches].some(q=>q.contains($))||(a==null||a(O),c==null||c(O),O.defaultPrevented||u==null||u())},g),E=h?C===x.length-1:!1,N=qe(O=>{O.key==="Escape"&&(s==null||s(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))});return p.useEffect(()=>{if(E)return g.addEventListener("keydown",N,{capture:!0}),()=>g.removeEventListener("keydown",N,{capture:!0})},[g,E,N]),p.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(od=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),la(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=od))}},[h,g,r,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),la())},[h,f]),p.useEffect(()=>{const O=ke(()=>y({}),"handleUpdate");return document.addEventListener(ca,O),()=>document.removeEventListener(ca,O)},[]),l.jsx(te.div,{...d,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,T.onFocusCapture),onBlurCapture:U(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function Ep(){const t=p.useContext(Mp),[e,n]=p.useState(null);return p.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}ke(Ep,"useDismissableLayerSurface");var FP=ke(()=>!0,"IS_TRUE");function jp(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=FP}=e,a=qe(t),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}ke(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}ke(m,"isOutsideInteractionIntercepted");function g(b){if(!u.current)return;const C=b.target;C instanceof Node&&[...s].some(R=>R.contains(C))||d.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}ke(g,"handleInteractionCapture");function y(b){u.current&&d.current.set(b.type,!1)}ke(y,"handleInteractionBubble");const v=ke(b=>{if(b.target&&!c.current){let C=function(){n.removeEventListener("click",f.current);const R=m();h(),R||hc(LP,a,P,{discrete:!0})};if(ke(C,"handleAndDispatchPointerDownOutsideEvent"),!i(b.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const P={originalEvent:b};u.current=!0,o.current=r&&b.button===0,d.current.clear(),!r||b.button!==0?C():(n.removeEventListener("click",f.current),f.current=C,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,g,!0),n.addEventListener(b,y);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,g,!0),n.removeEventListener(b,y)}},[n,a,r,o,s,i]),{onPointerDownCapture:ke(()=>c.current=!0,"onPointerDownCapture")}}ke(jp,"usePointerDownOutside");function Ap(t,e=globalThis==null?void 0:globalThis.document){const n=qe(t),r=p.useRef(!1);return p.useEffect(()=>{const o=ke(s=>{s.target&&!r.current&&hc($P,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:ke(()=>r.current=!0,"onFocusCapture"),onBlurCapture:ke(()=>r.current=!1,"onBlurCapture")}}ke(Ap,"useFocusOutside");function la(){const t=new CustomEvent(ca);document.dispatchEvent(t)}ke(la,"dispatchUpdate");function hc(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?lc(o,s):o.dispatchEvent(s)}ke(hc,"handleAndDispatchCustomEvent");var VP=Object.defineProperty,pc=(t,e)=>VP(t,"name",{value:e,configurable:!0}),yo=0,Pt=null;function BP(t){return lr(),t.children}pc(BP,"FocusGuards");function lr(){p.useEffect(()=>{Pt||(Pt={start:ua(),end:ua()});const{start:t,end:e}=Pt;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),yo++,()=>{yo===1&&(Pt==null||Pt.start.remove(),Pt==null||Pt.end.remove(),Pt=null),yo=Math.max(0,yo-1)}},[])}pc(lr,"useFocusGuards");function ua(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}pc(ua,"createFocusGuard");var GP=Object.defineProperty,Ke=(t,e)=>GP(t,"name",{value:e,configurable:!0}),fi="focusScope.autoFocusOnMount",hi="focusScope.autoFocusOnUnmount",sd={bubbles:!1,cancelable:!0},hs=p.forwardRef(Ke(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,u]=p.useState(null),d=qe(s),f=qe(i),h=p.useRef(null),m=ce(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let v=function(C){if(g.paused||!c)return;const P=C.target;c.contains(P)?h.current=P:Lt(h.current,{select:!0})},x=function(C){if(g.paused||!c)return;const P=C.relatedTarget;P!==null&&(c.contains(P)||Lt(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&Lt(c)};Ke(v,"handleFocusIn"),Ke(x,"handleFocusOut"),Ke(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(w);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[o,c,g.paused]),p.useEffect(()=>{if(c){id.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(fi,sd);c.addEventListener(fi,d),c.dispatchEvent(w),w.defaultPrevented||(Dp(Op(mc(c)),{select:!0}),document.activeElement===v&&Lt(c))}return()=>{c.removeEventListener(fi,d),setTimeout(()=>{const w=new CustomEvent(hi,sd);c.addEventListener(hi,f),c.dispatchEvent(w),w.defaultPrevented||Lt(v??document.body,{select:!0}),c.removeEventListener(hi,f),id.remove(g)},0)}}},[c,d,f,g]);const y=p.useCallback(v=>{if(!r&&!o||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const b=v.currentTarget,[C,P]=Ip(b);C&&P?!v.shiftKey&&w===P?(v.preventDefault(),r&&Lt(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),r&&Lt(P,{select:!0})):w===b&&v.preventDefault()}},[r,o,g.paused]);return l.jsx(te.div,{tabIndex:-1,...a,ref:m,onKeyDown:y})},"FocusScope"));function Dp(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Lt(r,{select:e}),document.activeElement!==n)return}Ke(Dp,"focusFirst");function Ip(t){const e=mc(t),n=da(e,t),r=da(e.reverse(),t);return[n,r]}Ke(Ip,"getTabbableEdges");function mc(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Ke(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Ke(mc,"getTabbableCandidates");function da(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):kp(r,{upTo:e})))return r}Ke(da,"findVisible");function kp(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Ke(kp,"isHidden");function Np(t){return t instanceof HTMLInputElement&&"select"in t}Ke(Np,"isSelectableInput");function Lt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Np(t)&&e&&t.select()}}Ke(Lt,"focus");var id=_p();function _p(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=fa(t,e),t.unshift(e)},remove(e){var n;t=fa(t,e),(n=t[0])==null||n.resume()}}}Ke(_p,"createFocusScopesStack");function fa(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Ke(fa,"arrayRemove");function Op(t){return t.filter(e=>e.tagName!=="A")}Ke(Op,"removeLinks");const zP=["top","right","bottom","left"],on=Math.min,st=Math.max,es=Math.round,vo=Math.floor,It=t=>({x:t,y:t}),UP={left:"right",right:"left",bottom:"top",top:"bottom"};function ha(t,e,n){return st(t,on(e,n))}function Bt(t,e){return typeof t=="function"?t(e):t}function Gt(t){return t.split("-")[0]}function ur(t){return t.split("-")[1]}function gc(t){return t==="x"?"y":"x"}function yc(t){return t==="y"?"height":"width"}function At(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function vc(t){return gc(At(t))}function HP(t,e,n){n===void 0&&(n=!1);const r=ur(t),o=vc(t),s=yc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ts(i)),[i,ts(i)]}function WP(t){const e=ts(t);return[pa(t),e,pa(e)]}function pa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ad=["left","right"],cd=["right","left"],KP=["top","bottom"],YP=["bottom","top"];function XP(t,e,n){switch(t){case"top":case"bottom":return n?e?cd:ad:e?ad:cd;case"left":case"right":return e?KP:YP;default:return[]}}function qP(t,e,n,r){const o=ur(t);let s=XP(Gt(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(pa)))),s}function ts(t){const e=Gt(t);return UP[e]+t.slice(e.length)}function ZP(t){return{top:0,right:0,bottom:0,left:0,...t}}function Lp(t){return typeof t!="number"?ZP(t):{top:t,right:t,bottom:t,left:t}}function ns(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function ld(t,e,n){let{reference:r,floating:o}=t;const s=At(e),i=vc(e),a=yc(i),c=Gt(e),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(ur(e)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function QP(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Bt(e,t),g=Lp(m),v=a[h?f==="floating"?"reference":"floating":f],x=ns(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},P=ns(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-P.top+g.top)/C.y,bottom:(P.bottom-x.bottom+g.bottom)/C.y,left:(x.left-P.left+g.left)/C.x,right:(P.right-x.right+g.right)/C.x}}const JP=50,eR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:QP},c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=ld(u,r,c),h=r,m=0;const g={};for(let y=0;y<s.length;y++){const v=s[y];if(!v)continue;const{name:x,fn:w}=v,{x:b,y:C,data:P,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:u,platform:a,elements:{reference:t,floating:e}});d=b??d,f=C??f,g[x]={...g[x],...P},R&&m<JP&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:d,y:f}=ld(u,h,c)),y=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:g}},tR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=Bt(t,e)||{};if(u==null)return{};const f=Lp(d),h={x:n,y:r},m=vc(o),g=yc(m),y=await i.getDimensions(u),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[m]-h[m]-s.floating[g],P=h[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=R?R[b]:0;(!M||!await(i.isElement==null?void 0:i.isElement(R)))&&(M=a.floating[b]||s.floating[g]);const j=C/2-P/2,T=M/2-y[g]/2-1,E=on(f[x],T),N=on(f[w],T),O=E,$=M-y[g]-N,V=M/2-y[g]/2+j,q=ha(O,V,$),G=!c.arrow&&ur(o)!=null&&V!==q&&s.reference[g]/2-(V<O?E:N)-y[g]/2<0,k=G?V<O?V-O:V-$:0;return{[m]:h[m]+k,data:{[m]:q,centerOffset:V-q-k,...G&&{alignmentOffset:k}},reset:G}}}),nR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=Bt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Gt(o),w=At(a),b=Gt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),P=h||(b||!y?[ts(a)]:WP(a)),R=g!=="none";!h&&R&&P.push(...qP(a,y,g,C));const M=[a,...P],j=await c.detectOverflow(e,v),T=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(j[x]),f){const V=HP(o,i,C);T.push(j[V[0]],j[V[1]])}if(E=[...E,{placement:o,overflows:T}],!T.every(V=>V<=0)){var N,O;const V=(((N=s.flip)==null?void 0:N.index)||0)+1,q=M[V];if(q&&(!(f==="alignment"?w!==At(q):!1)||E.every(F=>At(F.placement)===w?F.overflows[0]>0:!0)))return{data:{index:V,overflows:E},reset:{placement:q}};let G=(O=E.filter(k=>k.overflows[0]<=0).sort((k,F)=>k.overflows[1]-F.overflows[1])[0])==null?void 0:O.placement;if(!G)switch(m){case"bestFit":{var $;const k=($=E.filter(F=>{if(R){const L=At(F.placement);return L===w||L==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(L=>L>0).reduce((L,D)=>L+D,0)]).sort((F,L)=>F[1]-L[1])[0])==null?void 0:$[0];k&&(G=k);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function ud(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function dd(t){return zP.some(e=>t[e]>=0)}const rR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=Bt(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=ud(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:dd(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=ud(i,n.floating);return{data:{escapedOffsets:a,escaped:dd(a)}}}default:return{}}}}},$p=new Set(["left","top"]);async function oR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Gt(n),a=ur(n),c=At(n)==="y",u=$p.has(i)?-1:1,d=s&&c?-1:1,f=Bt(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const sR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=e,c=await oR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},iR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:w,y:b}=x;return{x:w,y:b}}},...u}=Bt(t,e),d={x:n,y:r},f=await s.detectOverflow(e,u),h=At(Gt(o)),m=gc(h);let g=d[m],y=d[h];if(i){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=g+f[x],C=g-f[w];g=ha(b,g,C)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=y+f[x],C=y-f[w];y=ha(b,y,C)}const v=c.fn({...e,[m]:g,[h]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},aR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Bt(t,e),d={x:n,y:r},f=At(o),h=gc(f);let m=d[h],g=d[f];const y=Bt(a,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const b=h==="y"?"height":"width",C=s.reference[h]-s.floating[b]+v.mainAxis,P=s.reference[h]+s.reference[b]-v.mainAxis;m<C?m=C:m>P&&(m=P)}if(u){var x,w;const b=h==="y"?"width":"height",C=$p.has(Gt(o)),P=s.reference[f]-s.floating[b]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),R=s.reference[f]+s.reference[b]+(C?0:((w=i.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);g<P?g=P:g>R&&(g=R)}return{[h]:m,[f]:g}}}},cR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:s,platform:i,elements:a}=e,{apply:c=()=>{},...u}=Bt(t,e),d=await i.detectOverflow(e,u),f=Gt(o),h=ur(o),m=At(o)==="y",{width:g,height:y}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const w=y-d.top-d.bottom,b=g-d.left-d.right,C=on(y-d[v],w),P=on(g-d[x],b),R=!e.middlewareData.shift;let M=C,j=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=w),R&&!h){const E=st(d.left,0),N=st(d.right,0),O=st(d.top,0),$=st(d.bottom,0);m?j=g-2*(E!==0||N!==0?E+N:st(d.left,d.right)):M=y-2*(O!==0||$!==0?O+$:st(d.top,d.bottom))}await c({...e,availableWidth:j,availableHeight:M});const T=await i.getDimensions(a.floating);return g!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function ps(){return typeof window<"u"}function dr(t){return Fp(t)?(t.nodeName||"").toLowerCase():"#document"}function it(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function _t(t){var e;return(e=(Fp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Fp(t){return ps()?t instanceof Node||t instanceof it(t).Node:!1}function xt(t){return ps()?t instanceof Element||t instanceof it(t).Element:!1}function Kt(t){return ps()?t instanceof HTMLElement||t instanceof it(t).HTMLElement:!1}function fd(t){return!ps()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof it(t).ShadowRoot}function Ur(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=bt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function lR(t){return/^(table|td|th)$/.test(dr(t))}function ms(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const uR=/transform|translate|scale|rotate|perspective|filter/,dR=/paint|layout|strict|content/,xn=t=>!!t&&t!=="none";let pi;function xc(t){const e=xt(t)?bt(t):t;return xn(e.transform)||xn(e.translate)||xn(e.scale)||xn(e.rotate)||xn(e.perspective)||!bc()&&(xn(e.backdropFilter)||xn(e.filter))||uR.test(e.willChange||"")||dR.test(e.contain||"")}function fR(t){let e=sn(t);for(;Kt(e)&&!Qn(e);){if(xc(e))return e;if(ms(e))return null;e=sn(e)}return null}function bc(){return pi==null&&(pi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pi}function Qn(t){return/^(html|body|#document)$/.test(dr(t))}function bt(t){return it(t).getComputedStyle(t)}function gs(t){return xt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function sn(t){if(dr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||fd(t)&&t.host||_t(t);return fd(e)?e.host:e}function Vp(t){const e=sn(t);return Qn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Kt(e)&&Ur(e)?e:Vp(e)}function Ar(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Vp(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=it(o);if(s){const a=ma(i);return e.concat(i,i.visualViewport||[],Ur(o)?o:[],a&&n?Ar(a):[])}else return e.concat(o,Ar(o,[],n))}function ma(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Bp(t){const e=bt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Kt(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=es(n)!==s||es(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function wc(t){return xt(t)?t:t.contextElement}function Kn(t){const e=wc(t);if(!Kt(e))return It(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=Bp(e);let i=(s?es(n.width):n.width)/r,a=(s?es(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const hR=It(0);function Gp(t){const e=it(t);return!bc()||!e.visualViewport?hR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function pR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==it(t)?!1:e}function Tn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=wc(t);let i=It(1);e&&(r?xt(r)&&(i=Kn(r)):i=Kn(t));const a=pR(s,n,r)?Gp(s):It(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=it(s),m=r&&xt(r)?it(r):r;let g=h,y=ma(g);for(;y&&r&&m!==g;){const v=Kn(y),x=y.getBoundingClientRect(),w=bt(y),b=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,C=x.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=b,u+=C,g=it(y),y=ma(g)}}return ns({width:d,height:f,x:c,y:u})}function ys(t,e){const n=gs(t).scrollLeft;return e?e.left+n:Tn(_t(t)).left+n}function zp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ys(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function mR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=_t(r),a=e?ms(e.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=It(1);const d=It(0),f=Kt(r);if((f||!f&&!s)&&((dr(r)!=="body"||Ur(i))&&(c=gs(r)),f)){const m=Tn(r);u=Kn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?zp(i,c):It(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function gR(t){return Array.from(t.getClientRects())}function yR(t){const e=_t(t),n=gs(t),r=t.ownerDocument.body,o=st(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=st(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ys(t);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(i+=st(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const hd=25;function vR(t,e){const n=it(t),r=_t(t),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=bc();(!d||d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=ys(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=hd&&(s-=g)}else u<=hd&&(s+=u);return{width:s,height:i,x:a,y:c}}function xR(t,e){const n=Tn(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Kt(t)?Kn(t):It(1),i=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function pd(t,e,n){let r;if(e==="viewport")r=vR(t,n);else if(e==="document")r=yR(_t(t));else if(xt(e))r=xR(e,n);else{const o=Gp(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return ns(r)}function Up(t,e){const n=sn(t);return n===e||!xt(n)||Qn(n)?!1:bt(n).position==="fixed"||Up(n,e)}function bR(t,e){const n=e.get(t);if(n)return n;let r=Ar(t,[],!1).filter(a=>xt(a)&&dr(a)!=="body"),o=null;const s=bt(t).position==="fixed";let i=s?sn(t):t;for(;xt(i)&&!Qn(i);){const a=bt(i),c=xc(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ur(i)&&!c&&Up(t,i))?r=r.filter(d=>d!==i):o=a,i=sn(i)}return e.set(t,r),r}function wR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?ms(e)?[]:bR(e,this._c):[].concat(n),r],a=pd(e,i[0],o);let c=a.top,u=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const m=pd(e,i[h],o);c=st(m.top,c),u=on(m.right,u),d=on(m.bottom,d),f=st(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function CR(t){const{width:e,height:n}=Bp(t);return{width:e,height:n}}function SR(t,e,n){const r=Kt(e),o=_t(e),s=n==="fixed",i=Tn(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=It(0);function u(){c.x=ys(o)}if(r||!r&&!s)if((dr(e)!=="body"||Ur(o))&&(a=gs(e)),r){const m=Tn(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?zp(o,a):It(0),f=i.left+a.scrollLeft-c.x-d.x,h=i.top+a.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function mi(t){return bt(t).position==="static"}function md(t,e){if(!Kt(t)||bt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return _t(t)===n&&(n=n.ownerDocument.body),n}function Hp(t,e){const n=it(t);if(ms(t))return n;if(!Kt(t)){let o=sn(t);for(;o&&!Qn(o);){if(xt(o)&&!mi(o))return o;o=sn(o)}return n}let r=md(t,e);for(;r&&lR(r)&&mi(r);)r=md(r,e);return r&&Qn(r)&&mi(r)&&!xc(r)?n:r||fR(t)||n}const PR=async function(t){const e=this.getOffsetParent||Hp,n=this.getDimensions,r=await n(t.floating);return{reference:SR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RR(t){return bt(t).direction==="rtl"}const TR={convertOffsetParentRelativeRectToViewportRelativeRect:mR,getDocumentElement:_t,getClippingRect:wR,getOffsetParent:Hp,getElementRects:PR,getClientRects:gR,getDimensions:CR,getScale:Kn,isElement:xt,isRTL:RR};function Wp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function MR(t,e){let n=null,r;const o=_t(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(a||e(),!h||!m)return;const g=vo(f),y=vo(o.clientWidth-(d+h)),v=vo(o.clientHeight-(f+m)),x=vo(d),b={rootMargin:-g+"px "+-y+"px "+-v+"px "+-x+"px",threshold:st(0,on(1,c))||1};let C=!0;function P(R){const M=R[0].intersectionRatio;if(M!==c){if(!C)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!Wp(u,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(t)}return i(!0),s}function ER(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=wc(t),d=o||s?[...u?Ar(u):[],...e?Ar(e):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?MR(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),n()}),u&&!c&&m.observe(u),e&&m.observe(e));let g,y=c?Tn(t):null;c&&v();function v(){const x=Tn(t);y&&!Wp(y,x)&&n(),y=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const jR=sR,AR=iR,DR=nR,IR=cR,kR=rR,gd=tR,NR=aR,_R=(t,e,n)=>{const r=new Map,o={platform:TR,...n},s={...o.platform,_c:r};return eR(t,e,{...o,platform:s})};var OR=typeof document<"u",LR=function(){},Bo=OR?S.useLayoutEffect:LR;function rs(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!rs(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!rs(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Kp(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function yd(t,e){const n=Kp(t);return Math.round(e*n)/n}function gi(t){const e=p.useRef(t);return Bo(()=>{e.current=t}),e}function $R(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[d,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);rs(h,r)||m(r);const[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useCallback(F=>{F!==R.current&&(R.current=F,y(F))},[]),b=p.useCallback(F=>{F!==M.current&&(M.current=F,x(F))},[]),C=s||g,P=i||v,R=p.useRef(null),M=p.useRef(null),j=p.useRef(d),T=c!=null,E=gi(c),N=gi(o),O=gi(u),$=p.useCallback(()=>{if(!R.current||!M.current)return;const F={placement:e,strategy:n,middleware:h};N.current&&(F.platform=N.current),_R(R.current,M.current,F).then(L=>{const D={...L,isPositioned:O.current!==!1};V.current&&!rs(j.current,D)&&(j.current=D,Or.flushSync(()=>{f(D)}))})},[h,e,n,N,O]);Bo(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[u]);const V=p.useRef(!1);Bo(()=>(V.current=!0,()=>{V.current=!1}),[]),Bo(()=>{if(C&&(R.current=C),P&&(M.current=P),C&&P){if(E.current)return E.current(C,P,$);$()}},[C,P,$,E,T]);const q=p.useMemo(()=>({reference:R,floating:M,setReference:w,setFloating:b}),[w,b]),G=p.useMemo(()=>({reference:C,floating:P}),[C,P]),k=p.useMemo(()=>{const F={position:n,left:0,top:0};if(!G.floating)return F;const L=yd(G.floating,d.x),D=yd(G.floating,d.y);return a?{...F,transform:"translate("+L+"px, "+D+"px)",...Kp(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:D}},[n,a,G.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:$,refs:q,elements:G,floatingStyles:k}),[d,$,q,G,k])}const FR=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?gd({element:r.current,padding:o}).fn(n):{}:r?gd({element:r,padding:o}).fn(n):{}}}},VR=(t,e)=>{const n=jR(t);return{name:n.name,fn:n.fn,options:[t,e]}},BR=(t,e)=>{const n=AR(t);return{name:n.name,fn:n.fn,options:[t,e]}},GR=(t,e)=>({fn:NR(t).fn,options:[t,e]}),zR=(t,e)=>{const n=DR(t);return{name:n.name,fn:n.fn,options:[t,e]}},UR=(t,e)=>{const n=IR(t);return{name:n.name,fn:n.fn,options:[t,e]}},HR=(t,e)=>{const n=kR(t);return{name:n.name,fn:n.fn,options:[t,e]}},WR=(t,e)=>{const n=FR(t);return{name:n.name,fn:n.fn,options:[t,e]}};var KR=Object.defineProperty,YR=(t,e)=>KR(t,"name",{value:e,configurable:!0}),XR=p.forwardRef(YR(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return l.jsx(te.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),qR=XR,ZR=Object.defineProperty,QR=(t,e)=>ZR(t,"name",{value:e,configurable:!0});function fr(t){const[e,n]=p.useState(void 0);return Te(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}QR(fr,"useSize");var JR=Object.defineProperty,$t=(t,e)=>JR(t,"name",{value:e,configurable:!0}),Yp="Popper",[Xp,dn]=Ce(Yp),[eT,qp]=Xp(Yp),tT=$t(t=>{const{__scopePopper:e,children:n}=t,[r,o]=p.useState(null),[s,i]=p.useState(void 0);return l.jsx(eT,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),nT="PopperAnchor",rT=p.forwardRef($t(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=qp(nT,r),a=p.useRef(null),c=i.onAnchorChange,u=p.useCallback(y=>{a.current=y,y&&c(y)},[c]),d=ce(n,u),f=p.useRef(null);p.useEffect(()=>{if(!o)return;const y=f.current;f.current=o.current,y!==f.current&&c(f.current)});const h=i.placementState&&vs(i.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return o?null:l.jsx(te.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),Zp="PopperContent",[oT,sT]=Xp(Zp),iT=p.forwardRef($t(function(e,n){var z,I,ne,ie,oe,se,Me;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,x=qp(Zp,r),[w,b]=p.useState(null),C=ce(n,b),[P,R]=p.useState(null),M=fr(P),j=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,E=o+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(d)?d:[d],$=O.length>0,V={padding:N,boundary:O.filter(Qp),altBoundary:$},{refs:q,floatingStyles:G,placement:k,isPositioned:F,middlewareData:L}=$R({strategy:"fixed",placement:E,whileElementsMounted:$t((...lt)=>ER(...lt,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[VR({mainAxis:s+T,alignmentAxis:a}),u&&BR({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?GR():void 0,...V}),u&&zR({...V}),UR({...V,apply:$t(({elements:lt,rects:ht,availableWidth:me,availableHeight:Ye})=>{const{width:ro,height:ge}=ht.reference,Se=lt.floating.style;Se.setProperty("--radix-popper-available-width",`${me}px`),Se.setProperty("--radix-popper-available-height",`${Ye}px`),Se.setProperty("--radix-popper-anchor-width",`${ro}px`),Se.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),P&&WR({element:P,padding:c}),uT({arrowWidth:j,arrowHeight:T}),m&&HR({strategy:"referenceHidden",...V,boundary:$?V.boundary:void 0})]}),D=x.setPlacementState;Te(()=>(D(k),()=>{D(void 0)}),[k,D]);const[X,A]=vs(k),B=qe(y);Te(()=>{F&&(B==null||B())},[F,B]);const Q=(z=L.arrow)==null?void 0:z.x,K=(I=L.arrow)==null?void 0:I.y,W=((ne=L.arrow)==null?void 0:ne.centerOffset)!==0,[re,Y]=p.useState();return Te(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:F?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ie=L.transformOrigin)==null?void 0:ie.x,(oe=L.transformOrigin)==null?void 0:oe.y].join(" "),...((se=L.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(oT,{scope:r,placedSide:X,placedAlign:A,onArrowChange:R,arrowX:Q,arrowY:K,shouldHideArrow:W,children:l.jsx(te.div,{"data-side":X,"data-align":A,...v,ref:C,style:{...v.style,animation:F?(Me=v.style)==null?void 0:Me.animation:"none"}})})})},"PopperContent")),aT="PopperArrow",cT={top:"bottom",right:"left",bottom:"top",left:"right"},lT=p.forwardRef($t(function(e,n){const{__scopePopper:r,...o}=e,s=sT(aT,r),i=cT[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(qR,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function Qp(t){return t!==null}$t(Qp,"isNotNull");var uT=$t(t=>({name:"transformOrigin",options:t,fn(e){var v,x,w;const{placement:n,rects:r,middlewareData:o}=e,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,d]=vs(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let g="",y="";return u==="bottom"?(g=i?f:`${h}px`,y=`${-c}px`):u==="top"?(g=i?f:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,y=i?f:`${m}px`):u==="left"&&(g=`${r.floating.width+c}px`,y=i?f:`${m}px`),{data:{x:g,y}}}}),"transformOrigin");function vs(t){const[e,n="center"]=t.split("-");return[e,n]}$t(vs,"getSideAndAlignFromPlacement");var Hr=tT,Wr=rT,xs=iT,Jp=lT,dT=Object.defineProperty,fT=(t,e)=>dT(t,"name",{value:e,configurable:!0}),Kr=p.forwardRef(fT(function(e,n){var c;const{container:r,...o}=e,[s,i]=p.useState(!1);Te(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Or.createPortal(l.jsx(te.div,{...o,ref:n}),a):null},"Portal")),hT=Object.defineProperty,zt=(t,e)=>hT(t,"name",{value:e,configurable:!0});function em(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}zt(em,"useStateMachine");var ze=zt(t=>{const{present:e,children:n}=t,r=tm(e),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=nm(r.ref,rm(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null},"Presence");function tm(t){const[e,n]=p.useState(),r=p.useRef(null),o=p.useRef(t),s=p.useRef("none"),i=p.useRef(void 0),a=t?"mounted":"unmounted",[c,u]=em(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=i.current??Vn(r.current),i.current=void 0):s.current="none"},[c]),Te(()=>{const d=r.current,f=o.current;if(f!==t){const m=s.current,g=Vn(d);t?(i.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),Te(()=>{if(e){let d;const f=e.ownerDocument.defaultView??window,h=zt(g=>{const v=Vn(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&v&&(u("ANIMATION_END"),!o.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",d=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),m=zt(g=>{g.target===e&&(s.current=Vn(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(d),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Vn(f)}else r.current=null;n(d)},[])}}zt(tm,"usePresence");function ga(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}zt(ga,"setRef");function nm(...t){const e=p.useRef(t);return e.current=t,p.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const a=ga(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():ga(r[i],null)}}},[])}zt(nm,"useStableComposedRefs");function Vn(t){return(t==null?void 0:t.animationName)||"none"}zt(Vn,"getAnimationName");function rm(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}zt(rm,"getElementRef");var pT=Object.defineProperty,mT=(t,e)=>pT(t,"name",{value:e,configurable:!0});function Cc(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}mT(Cc,"usePrevious");var gT=Object.defineProperty,yT=(t,e)=>gT(t,"name",{value:e,configurable:!0}),om=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sm=p.forwardRef(yT(function(e,n){return l.jsx(te.span,{...e,ref:n,style:{...om,...e.style}})},"VisuallyHidden")),vT=sm,xT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},On=new WeakMap,xo=new WeakMap,bo={},yi=0,im=function(t){return t&&(t.host||im(t.parentNode))},bT=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=im(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},wT=function(t,e,n,r){var o=bT(e,Array.isArray(t)?t:[t]);bo[n]||(bo[n]=new WeakMap);var s=bo[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),g=m!==null&&m!=="false",y=(On.get(h)||0)+1,v=(s.get(h)||0)+1;On.set(h,y),s.set(h,v),i.push(h),y===1&&g&&xo.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(e),a.clear(),yi++,function(){i.forEach(function(f){var h=On.get(f)-1,m=s.get(f)-1;On.set(f,h),s.set(f,m),h||(xo.has(f)||f.removeAttribute(r),xo.delete(f)),m||f.removeAttribute(n)}),yi--,yi||(On=new WeakMap,On=new WeakMap,xo=new WeakMap,bo={})}},bs=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=xT(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),wT(r,o,n,"aria-hidden")):function(){return null}},jt=function(){return jt=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},jt.apply(this,arguments)};function am(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function CT(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Go="right-scroll-bar-position",zo="width-before-scroll-bar",ST="with-scroll-bars-hidden",PT="--removed-body-scroll-bar-size";function vi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function RT(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var TT=typeof window<"u"?p.useLayoutEffect:p.useEffect,vd=new WeakMap;function MT(t,e){var n=RT(null,function(r){return t.forEach(function(o){return vi(o,r)})});return TT(function(){var r=vd.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||vi(a,null)}),s.forEach(function(a){o.has(a)||vi(a,i)})}vd.set(n,t)},[t]),n}function ET(t){return t}function jT(t,e){e===void 0&&(e=ET);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function AT(t){t===void 0&&(t={});var e=jT(null);return e.options=jt({async:!0,ssr:!1},t),e}var cm=function(t){var e=t.sideCar,n=am(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,jt({},n))};cm.isSideCarExport=!0;function DT(t,e){return t.useMedium(e),cm}var lm=AT(),xi=function(){},ws=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:xi,onWheelCapture:xi,onTouchMoveCapture:xi}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,m=t.noRelative,g=t.noIsolation,y=t.inert,v=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,b=t.gapMode,C=am(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,R=MT([n,e]),M=jt(jt({},C),o);return p.createElement(p.Fragment,null,d&&p.createElement(P,{sideCar:lm,removeScrollBar:u,shards:f,noRelative:m,noIsolation:g,inert:y,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:b}),i?p.cloneElement(p.Children.only(a),jt(jt({},M),{ref:R})):p.createElement(w,jt({},M,{className:c,ref:R}),a))});ws.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ws.classNames={fullWidth:zo,zeroRight:Go};var IT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function kT(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=IT();return e&&t.setAttribute("nonce",e),t}function NT(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function _T(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var OT=function(){var t=0,e=null;return{add:function(n){t==0&&(e=kT())&&(NT(e,n),_T(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},LT=function(){var t=OT();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},um=function(){var t=LT(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},$T={left:0,top:0,right:0,gap:0},bi=function(t){return parseInt(t||"",10)||0},FT=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[bi(n),bi(r),bi(o)]},VT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return $T;var e=FT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},BT=um(),Yn="data-scroll-locked",GT=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
170
- .`.concat(ST,` {
169
+ */const eP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wt=be("x",eP),tP=S.forwardRef(function({color:e="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,filled:c=!1,type:u="text",disabled:d,className:f,style:h,sx:m,value:g,defaultValue:y,onChange:v,...x},w){const b=g!==void 0,[C,P]=S.useState(y!=null?String(y):""),R=b?String(g??""):C,M=S.useRef(null);S.useImperativeHandle(w,()=>M.current,[]);const[j,T]=S.useState(!1),E=a&&j&&u==="password"?"text":u,k=s&&!d&&R!=="",_=k||a,$=r!=null||o!=null||_,G=O=>{b||P(O.target.value),v==null||v(O)},Q=O=>{var X;O.preventDefault(),b||P("");const D=M.current;if(D){const A=(X=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:X.set;A==null||A.call(D,""),D.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},V=se($?void 0:m,$?void 0:h,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,c&&"filled",f),I=l.jsx("input",{ref:M,type:E,className:V.className,style:V.style,disabled:d,value:b?g:void 0,defaultValue:b?void 0:y,onChange:G,...x});if(!$)return l.jsxs(l.Fragment,{children:[V.styleTag,I]});const L=se(m,h,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!_&&"has-suffix",_&&"has-action");return l.jsxs("span",{className:L.className,style:L.style,children:[L.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),I,o!=null&&!_&&l.jsx("span",{className:"cny-input-suffix",children:o}),k&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:Q,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})}),a&&u==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>T(O=>!O),"aria-label":j?"Hide password":"Show password","aria-pressed":j,children:j?l.jsx(LS,{size:14,"aria-hidden":"true"}):l.jsx(FS,{size:14,"aria-hidden":"true"})})]})}),nP=S.forwardRef(function({color:e="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"card",e!=="default"&&e,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),rP={info:Rp,success:Sp,warning:Ep,danger:Cp};function oP({color:t}){const e=rP[t];return l.jsx(e,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const sP=S.forwardRef(function({color:e="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},m){const g=c!==!1,y=c&&c!==!0?c:l.jsx(oP,{color:e}),{className:v,style:x,styleTag:w}=se(i,s,"alert",e,n&&"solid",o),b=e==="danger"?"alert":"status";return l.jsxs("div",{ref:m,role:b,className:v,style:x,...h,children:[w,g&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"alert-content",children:[r&&l.jsx("p",{className:"alert-title",children:r}),a&&l.jsx("p",{className:"alert-body",children:a})]}),u&&l.jsx("div",{className:"alert-action",children:u}),d&&l.jsx("button",{type:"button",className:"alert-close",onClick:d,"aria-label":f,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}),iP=S.forwardRef(function({size:e="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=se(a,i,"avatar",e!=="md"&&e,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[m,r?l.jsx("img",{src:r,alt:o??""}):c]})}),aP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:W("avatar-stack",e),...r,children:n})}),cP=S.forwardRef(function({value:e=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:m}=se(i,d,"progress",r&&"indeterminate",n!=="primary"&&n,o);return l.jsxs("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:u,className:f,style:h,...a,children:[m,l.jsx("span",{className:"progress-bar"})]})}),lP=S.forwardRef(function({value:e,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d={...s??{},"--value":u},{className:f,style:h,styleTag:m}=se(i,d,"progress-ring",n==="lg"&&"lg",o);return l.jsxs("span",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u,className:f,style:h,...a,children:[m,r&&l.jsxs("span",{children:[u,"%"]})]})}),uP={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},jp=S.forwardRef(function({variant:e="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m={...uP[r],maxHeight:o,maxWidth:s,...c??{}},{className:g,style:y,styleTag:v}=se(u,m,i?"cny-scroll-region":"cny-scroll",e!=="default"&&e,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:g,style:y,...f,children:[v,d]})}),dP=S.forwardRef(function(e,n){return l.jsx(jp,{ref:n,region:!0,...e})}),ia=S.forwardRef(function({shape:e="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=se(i,{...s??{},width:n,height:r},"skeleton",e,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),fP=S.forwardRef(function({solid:e=!1,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"cny-navbar",e&&"solid",n);return l.jsxs("header",{ref:a,className:c,style:u,...i,children:[d,s]})}),hP=S.forwardRef(function({mark:e=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:W("cny-navbar-brand",n),...o,children:[e&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),pP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("nav",{ref:o,className:W("cny-navbar-nav",e),...r,children:n})}),mP=S.forwardRef(function({active:e=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":e?"page":void 0,className:W("cny-navbar-item",e&&"active",n),...o,children:r})}),gP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:W("cny-navbar-actions",e),...r,children:n})}),yP=S.forwardRef(function({width:e="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=se(a,i,"cny-sidebar",e!=="default"&&e,n&&"sticky",r&&"collapsed",o&&"responsive",s);return l.jsxs("aside",{ref:d,className:f,style:h,...u,children:[m,c]})}),vP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:W("cny-sidebar-header",e),...r,children:n})}),xP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:W("cny-sidebar-footer",e),...r,children:n})}),bP=S.forwardRef(function({collapsed:e=!1,onClick:n,className:r,children:o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":!e,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:W("cny-sidebar-toggle",e&&"collapsed",r),onClick:n,...s,children:o??l.jsx(ZS,{size:16,"aria-hidden":"true"})})});function aa(t){const e=Array.from(t.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(e.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const wP=S.forwardRef(function({title:e,className:n,children:r,...o},s){const i=S.useRef(null),a=S.useCallback(c=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(y=>!y.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(y=>y===document.activeElement);let m=h;switch(c.key){case"ArrowDown":c.preventDefault(),m=h<f.length-1?h+1:0;break;case"ArrowUp":c.preventDefault(),m=h<=0?f.length-1:h-1;break;case"Home":c.preventDefault(),m=0;break;case"End":c.preventDefault(),m=f.length-1;break;default:return}const g=f[m];g&&g!==document.activeElement&&(f.forEach(y=>y.setAttribute("tabindex","-1")),g.setAttribute("tabindex","0"),g.focus())},[]);return S.useLayoutEffect(()=>{const c=i.current;if(!c||(aa(c),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>aa(c));return u.observe(c,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),l.jsxs("div",{ref:s,className:W("cny-sidebar-section",n),...o,children:[e&&l.jsx("div",{className:"cny-sidebar-title",children:e}),l.jsx("nav",{ref:i,className:"cny-sidebar-nav",onKeyDown:a,children:r})]})}),CP=S.forwardRef(function({active:e=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){const u=S.useRef(null),d=S.useId();S.useLayoutEffect(()=>{const h=u.current;if(!h)return;const m=h.closest('[class*="cny-sidebar-nav"]');m&&aa(m)},[e,n]);const f=typeof i=="string"&&!a["aria-label"]?i:void 0;return l.jsxs("a",{ref:h=>{u.current=h,typeof c=="function"?c(h):c&&(c.current=h)},"data-cny-sidebar-item":d,"aria-current":e?"page":void 0,"aria-disabled":n||void 0,"aria-label":f,className:W("cny-sidebar-item",e&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{className:"cny-sidebar-item-label",children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function SP(t){const e=[];return t.display&&e.push(t.display),t.direction==="row"?e.push("flex-row"):t.direction==="column"?e.push("flex-col"):t.direction==="row-reverse"?e.push("flex-row-reverse"):t.direction==="column-reverse"&&e.push("flex-col-reverse"),t.align&&e.push(`items-${t.align==="start"||t.align==="end",t.align}`),t.justify&&e.push(`justify-${t.justify}`),t.wrap&&e.push("flex-wrap"),t.p!==void 0&&e.push(`p-${t.p}`),t.px!==void 0&&e.push(`px-${t.px}`),t.py!==void 0&&e.push(`py-${t.py}`),t.pt!==void 0&&e.push(`pt-${t.pt}`),t.pr!==void 0&&e.push(`pr-${t.pr}`),t.pb!==void 0&&e.push(`pb-${t.pb}`),t.pl!==void 0&&e.push(`pl-${t.pl}`),t.m!==void 0&&e.push(`m-${t.m}`),t.mx!==void 0&&e.push(`mx-${t.mx}`),t.my!==void 0&&e.push(`my-${t.my}`),t.mt!==void 0&&e.push(`mt-${t.mt}`),t.mr!==void 0&&e.push(`mr-${t.mr}`),t.mb!==void 0&&e.push(`mb-${t.mb}`),t.ml!==void 0&&e.push(`ml-${t.ml}`),t.gap!==void 0&&e.push(`gap-${t.gap}`),t.gapX!==void 0&&e.push(`gap-x-${t.gapX}`),t.gapY!==void 0&&e.push(`gap-y-${t.gapY}`),t.w&&e.push(`w-${t.w}`),t.h&&e.push(`h-${t.h}`),t.grow&&e.push("flex-1"),e}const Dn=S.forwardRef(function({as:e,className:n,style:r,children:o,...s},i){const a=e??"div",{layoutProps:c,domProps:u}=PP(s),{sx:d,...f}=c,h=d?Na(d):void 0,m=W(...SP(f),h==null?void 0:h.className,n),g=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,y=S.createElement(a,{ref:i,className:m||void 0,style:g,...u},o);return h!=null&&h.css?S.createElement(S.Fragment,null,S.createElement(ka,{css:h.css}),y):y});function PP(t){const e=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h","grow","sx"]),n={},r={};for(const[o,s]of Object.entries(t))e.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const RP=S.forwardRef(function(e,n){return l.jsx(Dn,{ref:n,display:"flex",direction:"column",...e})}),TP=S.forwardRef(function(e,n){const{align:r="center",...o}=e;return l.jsx(Dn,{ref:n,display:"flex",direction:"row",align:r,...o})}),sd=t=>t.map(e=>`minmax(0,${e}fr)`).join(" "),MP=S.forwardRef(function({cols:e,minColWidth:n,ratio:r,template:o,className:s,sx:i,...a},c){let u;if(o)u=o;else if(r)if(Array.isArray(r))u=sd(r);else{const f={};for(const[h,m]of Object.entries(r))m&&(f[h]=sd(m));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(Dn,{ref:c,display:"grid",className:W(!u&&e&&`grid-cols-${e}`,s),sx:d,...a})}),EP=S.forwardRef(function({size:e="lg",className:n,...r},o){return l.jsx(Dn,{ref:o,className:W("cny-container",e,n),...r})}),jP=S.forwardRef(function({orientation:e="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=se(o,r,"cny-divider",e,n);return e==="vertical"?l.jsxs(l.Fragment,{children:[u,l.jsx("span",{ref:i,role:"separator","aria-orientation":"vertical",className:a,style:c,...s})]}):l.jsxs(l.Fragment,{children:[u,l.jsx("hr",{ref:i,className:a,style:c,...s})]})}),AP=S.forwardRef(function({className:e,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=se(r,n,"cny-spacer",e);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),DP=S.forwardRef(function({ratio:e=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,{aspectRatio:String(e),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),IP=S.forwardRef(function(e,n){return l.jsx(Dn,{ref:n,display:"flex",align:"center",justify:"center",...e})}),kP=S.forwardRef(function(e,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=e;return l.jsx(Dn,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),NP={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},_P=S.forwardRef(function({as:e,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m=e??NP[n],{className:g,style:y,styleTag:v}=se(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return S.createElement(m,{ref:h,className:g,style:y,...f},v,d)});function OP({label:t,hint:e,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const m=S.useId(),g=S.Children.only(f),y=g.props.id??m,v=n!=null&&n!==!1,x=a??(v?"danger":"default"),w=e||n?`${y}-hint`:void 0,b=S.cloneElement(g,{id:y,"aria-invalid":v||g.props["aria-invalid"]||void 0,"aria-describedby":w??g.props["aria-describedby"],className:W(g.props.className,x!=="default"&&x)}),C=i!=null&&s!=null&&s>i?"danger":"default",{className:P,style:R,styleTag:M}=se(d,u,"cny-field",c);return l.jsxs("div",{className:P,style:R,...h,children:[M,(t!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[t!=null?l.jsxs("label",{htmlFor:y,className:"cny-field-label",children:[t,r&&l.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&l.jsx("span",{className:"cny-field-optional",children:"optional"})]}):l.jsx("span",{}),s!=null&&l.jsx("span",{className:W("cny-field-counter",C==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),b,(n||e)&&l.jsx("span",{id:w,className:W("cny-field-hint",x!=="default"&&x),children:n??e})]})}const LP=S.forwardRef(function({color:e="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=S.useRef(null);S.useImperativeHandle(d,()=>f.current,[]);const h=S.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const b=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,b)}px`,x.style.overflowY=x.scrollHeight>b?"auto":"hidden"},[r,o]);S.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const m=x=>{c==null||c(x),r&&h()},{className:g,style:y,styleTag:v}=se(a,i,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[v,l.jsx("textarea",{ref:f,className:g,style:y,onChange:m,...u})]})});var $P=Object.defineProperty,FP=(t,e)=>$P(t,"name",{value:e,configurable:!0});function Ar(t,[e,n]){return Math.min(n,Math.max(e,t))}FP(Ar,"clamp");var VP=Object.defineProperty,Ne=(t,e)=>VP(t,"name",{value:e,configurable:!0}),ca="dismissableLayer.update",BP="dismissableLayer.pointerDownOutside",GP="dismissableLayer.focusOutside",id,Ap=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ur=p.forwardRef(Ne(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=e,f=p.useContext(Ap),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=p.useState({}),v=ie(n,m),x=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w?x.indexOf(w):-1,C=h?x.indexOf(h):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,R=C>=b,M=p.useRef(!1),j=Ip(_=>{i==null||i(_),c==null||c(_),_.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(_=>{if(!(_ instanceof Node))return!1;const $=[...f.branches].some(G=>G.contains(_));return R&&!$},[f.branches,R])}),T=kp(_=>{if(o&&M.current)return;const $=_.target;[...f.branches].some(Q=>Q.contains($))||(a==null||a(_),c==null||c(_),_.defaultPrevented||u==null||u())},g),E=h?C===x.length-1:!1,k=Qe(_=>{_.key==="Escape"&&(s==null||s(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))});return p.useEffect(()=>{if(E)return g.addEventListener("keydown",k,{capture:!0}),()=>g.removeEventListener("keydown",k,{capture:!0})},[g,E,k]),p.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(id=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),la(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=id))}},[h,g,r,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),la())},[h,f]),p.useEffect(()=>{const _=Ne(()=>y({}),"handleUpdate");return document.addEventListener(ca,_),()=>document.removeEventListener(ca,_)},[]),l.jsx(re.div,{...d,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,T.onFocusCapture),onBlurCapture:U(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function Dp(){const t=p.useContext(Ap),[e,n]=p.useState(null);return p.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Ne(Dp,"useDismissableLayerSurface");var zP=Ne(()=>!0,"IS_TRUE");function Ip(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=zP}=e,a=Qe(t),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}Ne(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ne(m,"isOutsideInteractionIntercepted");function g(b){if(!u.current)return;const C=b.target;C instanceof Node&&[...s].some(R=>R.contains(C))||d.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ne(g,"handleInteractionCapture");function y(b){u.current&&d.current.set(b.type,!1)}Ne(y,"handleInteractionBubble");const v=Ne(b=>{if(b.target&&!c.current){let C=function(){n.removeEventListener("click",f.current);const R=m();h(),R||mc(BP,a,P,{discrete:!0})};if(Ne(C,"handleAndDispatchPointerDownOutsideEvent"),!i(b.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const P={originalEvent:b};u.current=!0,o.current=r&&b.button===0,d.current.clear(),!r||b.button!==0?C():(n.removeEventListener("click",f.current),f.current=C,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,g,!0),n.addEventListener(b,y);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,g,!0),n.removeEventListener(b,y)}},[n,a,r,o,s,i]),{onPointerDownCapture:Ne(()=>c.current=!0,"onPointerDownCapture")}}Ne(Ip,"usePointerDownOutside");function kp(t,e=globalThis==null?void 0:globalThis.document){const n=Qe(t),r=p.useRef(!1);return p.useEffect(()=>{const o=Ne(s=>{s.target&&!r.current&&mc(GP,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:Ne(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ne(()=>r.current=!1,"onBlurCapture")}}Ne(kp,"useFocusOutside");function la(){const t=new CustomEvent(ca);document.dispatchEvent(t)}Ne(la,"dispatchUpdate");function mc(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?dc(o,s):o.dispatchEvent(s)}Ne(mc,"handleAndDispatchCustomEvent");var UP=Object.defineProperty,gc=(t,e)=>UP(t,"name",{value:e,configurable:!0}),yo=0,Pt=null;function HP(t){return ur(),t.children}gc(HP,"FocusGuards");function ur(){p.useEffect(()=>{Pt||(Pt={start:ua(),end:ua()});const{start:t,end:e}=Pt;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),yo++,()=>{yo===1&&(Pt==null||Pt.start.remove(),Pt==null||Pt.end.remove(),Pt=null),yo=Math.max(0,yo-1)}},[])}gc(ur,"useFocusGuards");function ua(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}gc(ua,"createFocusGuard");var WP=Object.defineProperty,Xe=(t,e)=>WP(t,"name",{value:e,configurable:!0}),fi="focusScope.autoFocusOnMount",hi="focusScope.autoFocusOnUnmount",ad={bubbles:!1,cancelable:!0},hs=p.forwardRef(Xe(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,u]=p.useState(null),d=Qe(s),f=Qe(i),h=p.useRef(null),m=ie(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let v=function(C){if(g.paused||!c)return;const P=C.target;c.contains(P)?h.current=P:Lt(h.current,{select:!0})},x=function(C){if(g.paused||!c)return;const P=C.relatedTarget;P!==null&&(c.contains(P)||Lt(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&Lt(c)};Xe(v,"handleFocusIn"),Xe(x,"handleFocusOut"),Xe(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(w);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[o,c,g.paused]),p.useEffect(()=>{if(c){cd.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(fi,ad);c.addEventListener(fi,d),c.dispatchEvent(w),w.defaultPrevented||(Np(Fp(yc(c)),{select:!0}),document.activeElement===v&&Lt(c))}return()=>{c.removeEventListener(fi,d),setTimeout(()=>{const w=new CustomEvent(hi,ad);c.addEventListener(hi,f),c.dispatchEvent(w),w.defaultPrevented||Lt(v??document.body,{select:!0}),c.removeEventListener(hi,f),cd.remove(g)},0)}}},[c,d,f,g]);const y=p.useCallback(v=>{if(!r&&!o||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const b=v.currentTarget,[C,P]=_p(b);C&&P?!v.shiftKey&&w===P?(v.preventDefault(),r&&Lt(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),r&&Lt(P,{select:!0})):w===b&&v.preventDefault()}},[r,o,g.paused]);return l.jsx(re.div,{tabIndex:-1,...a,ref:m,onKeyDown:y})},"FocusScope"));function Np(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Lt(r,{select:e}),document.activeElement!==n)return}Xe(Np,"focusFirst");function _p(t){const e=yc(t),n=da(e,t),r=da(e.reverse(),t);return[n,r]}Xe(_p,"getTabbableEdges");function yc(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Xe(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Xe(yc,"getTabbableCandidates");function da(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Op(r,{upTo:e})))return r}Xe(da,"findVisible");function Op(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Xe(Op,"isHidden");function Lp(t){return t instanceof HTMLInputElement&&"select"in t}Xe(Lp,"isSelectableInput");function Lt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Lp(t)&&e&&t.select()}}Xe(Lt,"focus");var cd=$p();function $p(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=fa(t,e),t.unshift(e)},remove(e){var n;t=fa(t,e),(n=t[0])==null||n.resume()}}}Xe($p,"createFocusScopesStack");function fa(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Xe(fa,"arrayRemove");function Fp(t){return t.filter(e=>e.tagName!=="A")}Xe(Fp,"removeLinks");const KP=["top","right","bottom","left"],on=Math.min,at=Math.max,es=Math.round,vo=Math.floor,It=t=>({x:t,y:t}),YP={left:"right",right:"left",bottom:"top",top:"bottom"};function ha(t,e,n){return at(t,on(e,n))}function Bt(t,e){return typeof t=="function"?t(e):t}function Gt(t){return t.split("-")[0]}function dr(t){return t.split("-")[1]}function vc(t){return t==="x"?"y":"x"}function xc(t){return t==="y"?"height":"width"}function At(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function bc(t){return vc(At(t))}function XP(t,e,n){n===void 0&&(n=!1);const r=dr(t),o=bc(t),s=xc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ts(i)),[i,ts(i)]}function qP(t){const e=ts(t);return[pa(t),e,pa(e)]}function pa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ld=["left","right"],ud=["right","left"],ZP=["top","bottom"],QP=["bottom","top"];function JP(t,e,n){switch(t){case"top":case"bottom":return n?e?ud:ld:e?ld:ud;case"left":case"right":return e?ZP:QP;default:return[]}}function eR(t,e,n,r){const o=dr(t);let s=JP(Gt(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(pa)))),s}function ts(t){const e=Gt(t);return YP[e]+t.slice(e.length)}function tR(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vp(t){return typeof t!="number"?tR(t):{top:t,right:t,bottom:t,left:t}}function ns(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function dd(t,e,n){let{reference:r,floating:o}=t;const s=At(e),i=bc(e),a=xc(i),c=Gt(e),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(dr(e)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function nR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Bt(e,t),g=Vp(m),v=a[h?f==="floating"?"reference":"floating":f],x=ns(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},P=ns(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-P.top+g.top)/C.y,bottom:(P.bottom-x.bottom+g.bottom)/C.y,left:(x.left-P.left+g.left)/C.x,right:(P.right-x.right+g.right)/C.x}}const rR=50,oR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:nR},c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=dd(u,r,c),h=r,m=0;const g={};for(let y=0;y<s.length;y++){const v=s[y];if(!v)continue;const{name:x,fn:w}=v,{x:b,y:C,data:P,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:u,platform:a,elements:{reference:t,floating:e}});d=b??d,f=C??f,g[x]={...g[x],...P},R&&m<rR&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:d,y:f}=dd(u,h,c)),y=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:g}},sR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=Bt(t,e)||{};if(u==null)return{};const f=Vp(d),h={x:n,y:r},m=bc(o),g=xc(m),y=await i.getDimensions(u),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[m]-h[m]-s.floating[g],P=h[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=R?R[b]:0;(!M||!await(i.isElement==null?void 0:i.isElement(R)))&&(M=a.floating[b]||s.floating[g]);const j=C/2-P/2,T=M/2-y[g]/2-1,E=on(f[x],T),k=on(f[w],T),_=E,$=M-y[g]-k,G=M/2-y[g]/2+j,Q=ha(_,G,$),V=!c.arrow&&dr(o)!=null&&G!==Q&&s.reference[g]/2-(G<_?E:k)-y[g]/2<0,I=V?G<_?G-_:G-$:0;return{[m]:h[m]+I,data:{[m]:Q,centerOffset:G-Q-I,...V&&{alignmentOffset:I}},reset:V}}}),iR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=Bt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Gt(o),w=At(a),b=Gt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),P=h||(b||!y?[ts(a)]:qP(a)),R=g!=="none";!h&&R&&P.push(...eR(a,y,g,C));const M=[a,...P],j=await c.detectOverflow(e,v),T=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(j[x]),f){const G=XP(o,i,C);T.push(j[G[0]],j[G[1]])}if(E=[...E,{placement:o,overflows:T}],!T.every(G=>G<=0)){var k,_;const G=(((k=s.flip)==null?void 0:k.index)||0)+1,Q=M[G];if(Q&&(!(f==="alignment"?w!==At(Q):!1)||E.every(L=>At(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:G,overflows:E},reset:{placement:Q}};let V=(_=E.filter(I=>I.overflows[0]<=0).sort((I,L)=>I.overflows[1]-L.overflows[1])[0])==null?void 0:_.placement;if(!V)switch(m){case"bestFit":{var $;const I=($=E.filter(L=>{if(R){const O=At(L.placement);return O===w||O==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(O=>O>0).reduce((O,D)=>O+D,0)]).sort((L,O)=>L[1]-O[1])[0])==null?void 0:$[0];I&&(V=I);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function fd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hd(t){return KP.some(e=>t[e]>=0)}const aR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=Bt(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=fd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hd(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=fd(i,n.floating);return{data:{escapedOffsets:a,escaped:hd(a)}}}default:return{}}}}},Bp=new Set(["left","top"]);async function cR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Gt(n),a=dr(n),c=At(n)==="y",u=Bp.has(i)?-1:1,d=s&&c?-1:1,f=Bt(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const lR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=e,c=await cR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},uR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:w,y:b}=x;return{x:w,y:b}}},...u}=Bt(t,e),d={x:n,y:r},f=await s.detectOverflow(e,u),h=At(Gt(o)),m=vc(h);let g=d[m],y=d[h];if(i){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=g+f[x],C=g-f[w];g=ha(b,g,C)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=y+f[x],C=y-f[w];y=ha(b,y,C)}const v=c.fn({...e,[m]:g,[h]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},dR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Bt(t,e),d={x:n,y:r},f=At(o),h=vc(f);let m=d[h],g=d[f];const y=Bt(a,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const b=h==="y"?"height":"width",C=s.reference[h]-s.floating[b]+v.mainAxis,P=s.reference[h]+s.reference[b]-v.mainAxis;m<C?m=C:m>P&&(m=P)}if(u){var x,w;const b=h==="y"?"width":"height",C=Bp.has(Gt(o)),P=s.reference[f]-s.floating[b]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),R=s.reference[f]+s.reference[b]+(C?0:((w=i.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);g<P?g=P:g>R&&(g=R)}return{[h]:m,[f]:g}}}},fR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:s,platform:i,elements:a}=e,{apply:c=()=>{},...u}=Bt(t,e),d=await i.detectOverflow(e,u),f=Gt(o),h=dr(o),m=At(o)==="y",{width:g,height:y}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const w=y-d.top-d.bottom,b=g-d.left-d.right,C=on(y-d[v],w),P=on(g-d[x],b),R=!e.middlewareData.shift;let M=C,j=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=w),R&&!h){const E=at(d.left,0),k=at(d.right,0),_=at(d.top,0),$=at(d.bottom,0);m?j=g-2*(E!==0||k!==0?E+k:at(d.left,d.right)):M=y-2*(_!==0||$!==0?_+$:at(d.top,d.bottom))}await c({...e,availableWidth:j,availableHeight:M});const T=await i.getDimensions(a.floating);return g!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function ps(){return typeof window<"u"}function fr(t){return Gp(t)?(t.nodeName||"").toLowerCase():"#document"}function ct(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function _t(t){var e;return(e=(Gp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gp(t){return ps()?t instanceof Node||t instanceof ct(t).Node:!1}function xt(t){return ps()?t instanceof Element||t instanceof ct(t).Element:!1}function Kt(t){return ps()?t instanceof HTMLElement||t instanceof ct(t).HTMLElement:!1}function pd(t){return!ps()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ct(t).ShadowRoot}function Hr(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=bt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function hR(t){return/^(table|td|th)$/.test(fr(t))}function ms(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const pR=/transform|translate|scale|rotate|perspective|filter/,mR=/paint|layout|strict|content/,bn=t=>!!t&&t!=="none";let pi;function wc(t){const e=xt(t)?bt(t):t;return bn(e.transform)||bn(e.translate)||bn(e.scale)||bn(e.rotate)||bn(e.perspective)||!Cc()&&(bn(e.backdropFilter)||bn(e.filter))||pR.test(e.willChange||"")||mR.test(e.contain||"")}function gR(t){let e=sn(t);for(;Kt(e)&&!Jn(e);){if(wc(e))return e;if(ms(e))return null;e=sn(e)}return null}function Cc(){return pi==null&&(pi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pi}function Jn(t){return/^(html|body|#document)$/.test(fr(t))}function bt(t){return ct(t).getComputedStyle(t)}function gs(t){return xt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function sn(t){if(fr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||_t(t);return pd(e)?e.host:e}function zp(t){const e=sn(t);return Jn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Kt(e)&&Hr(e)?e:zp(e)}function Dr(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=zp(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=ct(o);if(s){const a=ma(i);return e.concat(i,i.visualViewport||[],Hr(o)?o:[],a&&n?Dr(a):[])}else return e.concat(o,Dr(o,[],n))}function ma(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Up(t){const e=bt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Kt(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=es(n)!==s||es(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Sc(t){return xt(t)?t:t.contextElement}function Yn(t){const e=Sc(t);if(!Kt(e))return It(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=Up(e);let i=(s?es(n.width):n.width)/r,a=(s?es(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const yR=It(0);function Hp(t){const e=ct(t);return!Cc()||!e.visualViewport?yR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function vR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ct(t)?!1:e}function Mn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Sc(t);let i=It(1);e&&(r?xt(r)&&(i=Yn(r)):i=Yn(t));const a=vR(s,n,r)?Hp(s):It(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=ct(s),m=r&&xt(r)?ct(r):r;let g=h,y=ma(g);for(;y&&r&&m!==g;){const v=Yn(y),x=y.getBoundingClientRect(),w=bt(y),b=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,C=x.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=b,u+=C,g=ct(y),y=ma(g)}}return ns({width:d,height:f,x:c,y:u})}function ys(t,e){const n=gs(t).scrollLeft;return e?e.left+n:Mn(_t(t)).left+n}function Wp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ys(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function xR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=_t(r),a=e?ms(e.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=It(1);const d=It(0),f=Kt(r);if((f||!f&&!s)&&((fr(r)!=="body"||Hr(i))&&(c=gs(r)),f)){const m=Mn(r);u=Yn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?Wp(i,c):It(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function bR(t){return Array.from(t.getClientRects())}function wR(t){const e=_t(t),n=gs(t),r=t.ownerDocument.body,o=at(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=at(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ys(t);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(i+=at(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const md=25;function CR(t,e){const n=ct(t),r=_t(t),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Cc();(!d||d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=ys(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=md&&(s-=g)}else u<=md&&(s+=u);return{width:s,height:i,x:a,y:c}}function SR(t,e){const n=Mn(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Kt(t)?Yn(t):It(1),i=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function gd(t,e,n){let r;if(e==="viewport")r=CR(t,n);else if(e==="document")r=wR(_t(t));else if(xt(e))r=SR(e,n);else{const o=Hp(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return ns(r)}function Kp(t,e){const n=sn(t);return n===e||!xt(n)||Jn(n)?!1:bt(n).position==="fixed"||Kp(n,e)}function PR(t,e){const n=e.get(t);if(n)return n;let r=Dr(t,[],!1).filter(a=>xt(a)&&fr(a)!=="body"),o=null;const s=bt(t).position==="fixed";let i=s?sn(t):t;for(;xt(i)&&!Jn(i);){const a=bt(i),c=wc(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Hr(i)&&!c&&Kp(t,i))?r=r.filter(d=>d!==i):o=a,i=sn(i)}return e.set(t,r),r}function RR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?ms(e)?[]:PR(e,this._c):[].concat(n),r],a=gd(e,i[0],o);let c=a.top,u=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const m=gd(e,i[h],o);c=at(m.top,c),u=on(m.right,u),d=on(m.bottom,d),f=at(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function TR(t){const{width:e,height:n}=Up(t);return{width:e,height:n}}function MR(t,e,n){const r=Kt(e),o=_t(e),s=n==="fixed",i=Mn(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=It(0);function u(){c.x=ys(o)}if(r||!r&&!s)if((fr(e)!=="body"||Hr(o))&&(a=gs(e)),r){const m=Mn(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Wp(o,a):It(0),f=i.left+a.scrollLeft-c.x-d.x,h=i.top+a.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function mi(t){return bt(t).position==="static"}function yd(t,e){if(!Kt(t)||bt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return _t(t)===n&&(n=n.ownerDocument.body),n}function Yp(t,e){const n=ct(t);if(ms(t))return n;if(!Kt(t)){let o=sn(t);for(;o&&!Jn(o);){if(xt(o)&&!mi(o))return o;o=sn(o)}return n}let r=yd(t,e);for(;r&&hR(r)&&mi(r);)r=yd(r,e);return r&&Jn(r)&&mi(r)&&!wc(r)?n:r||gR(t)||n}const ER=async function(t){const e=this.getOffsetParent||Yp,n=this.getDimensions,r=await n(t.floating);return{reference:MR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jR(t){return bt(t).direction==="rtl"}const AR={convertOffsetParentRelativeRectToViewportRelativeRect:xR,getDocumentElement:_t,getClippingRect:RR,getOffsetParent:Yp,getElementRects:ER,getClientRects:bR,getDimensions:TR,getScale:Yn,isElement:xt,isRTL:jR};function Xp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function DR(t,e){let n=null,r;const o=_t(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(a||e(),!h||!m)return;const g=vo(f),y=vo(o.clientWidth-(d+h)),v=vo(o.clientHeight-(f+m)),x=vo(d),b={rootMargin:-g+"px "+-y+"px "+-v+"px "+-x+"px",threshold:at(0,on(1,c))||1};let C=!0;function P(R){const M=R[0].intersectionRatio;if(M!==c){if(!C)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!Xp(u,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(t)}return i(!0),s}function IR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Sc(t),d=o||s?[...u?Dr(u):[],...e?Dr(e):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?DR(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),n()}),u&&!c&&m.observe(u),e&&m.observe(e));let g,y=c?Mn(t):null;c&&v();function v(){const x=Mn(t);y&&!Xp(y,x)&&n(),y=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const kR=lR,NR=uR,_R=iR,OR=fR,LR=aR,vd=sR,$R=dR,FR=(t,e,n)=>{const r=new Map,o={platform:AR,...n},s={...o.platform,_c:r};return oR(t,e,{...o,platform:s})};var VR=typeof document<"u",BR=function(){},Bo=VR?S.useLayoutEffect:BR;function rs(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!rs(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!rs(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function qp(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function xd(t,e){const n=qp(t);return Math.round(e*n)/n}function gi(t){const e=p.useRef(t);return Bo(()=>{e.current=t}),e}function GR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[d,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);rs(h,r)||m(r);const[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useCallback(L=>{L!==R.current&&(R.current=L,y(L))},[]),b=p.useCallback(L=>{L!==M.current&&(M.current=L,x(L))},[]),C=s||g,P=i||v,R=p.useRef(null),M=p.useRef(null),j=p.useRef(d),T=c!=null,E=gi(c),k=gi(o),_=gi(u),$=p.useCallback(()=>{if(!R.current||!M.current)return;const L={placement:e,strategy:n,middleware:h};k.current&&(L.platform=k.current),FR(R.current,M.current,L).then(O=>{const D={...O,isPositioned:_.current!==!1};G.current&&!rs(j.current,D)&&(j.current=D,Lr.flushSync(()=>{f(D)}))})},[h,e,n,k,_]);Bo(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const G=p.useRef(!1);Bo(()=>(G.current=!0,()=>{G.current=!1}),[]),Bo(()=>{if(C&&(R.current=C),P&&(M.current=P),C&&P){if(E.current)return E.current(C,P,$);$()}},[C,P,$,E,T]);const Q=p.useMemo(()=>({reference:R,floating:M,setReference:w,setFloating:b}),[w,b]),V=p.useMemo(()=>({reference:C,floating:P}),[C,P]),I=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!V.floating)return L;const O=xd(V.floating,d.x),D=xd(V.floating,d.y);return a?{...L,transform:"translate("+O+"px, "+D+"px)",...qp(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:D}},[n,a,V.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:$,refs:Q,elements:V,floatingStyles:I}),[d,$,Q,V,I])}const zR=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?vd({element:r.current,padding:o}).fn(n):{}:r?vd({element:r,padding:o}).fn(n):{}}}},UR=(t,e)=>{const n=kR(t);return{name:n.name,fn:n.fn,options:[t,e]}},HR=(t,e)=>{const n=NR(t);return{name:n.name,fn:n.fn,options:[t,e]}},WR=(t,e)=>({fn:$R(t).fn,options:[t,e]}),KR=(t,e)=>{const n=_R(t);return{name:n.name,fn:n.fn,options:[t,e]}},YR=(t,e)=>{const n=OR(t);return{name:n.name,fn:n.fn,options:[t,e]}},XR=(t,e)=>{const n=LR(t);return{name:n.name,fn:n.fn,options:[t,e]}},qR=(t,e)=>{const n=zR(t);return{name:n.name,fn:n.fn,options:[t,e]}};var ZR=Object.defineProperty,QR=(t,e)=>ZR(t,"name",{value:e,configurable:!0}),JR=p.forwardRef(QR(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return l.jsx(re.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),eT=JR,tT=Object.defineProperty,nT=(t,e)=>tT(t,"name",{value:e,configurable:!0});function hr(t){const[e,n]=p.useState(void 0);return Ee(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}nT(hr,"useSize");var rT=Object.defineProperty,$t=(t,e)=>rT(t,"name",{value:e,configurable:!0}),Zp="Popper",[Qp,dn]=Re(Zp),[oT,Jp]=Qp(Zp),sT=$t(t=>{const{__scopePopper:e,children:n}=t,[r,o]=p.useState(null),[s,i]=p.useState(void 0);return l.jsx(oT,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),iT="PopperAnchor",aT=p.forwardRef($t(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=Jp(iT,r),a=p.useRef(null),c=i.onAnchorChange,u=p.useCallback(y=>{a.current=y,y&&c(y)},[c]),d=ie(n,u),f=p.useRef(null);p.useEffect(()=>{if(!o)return;const y=f.current;f.current=o.current,y!==f.current&&c(f.current)});const h=i.placementState&&vs(i.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return o?null:l.jsx(re.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),em="PopperContent",[cT,lT]=Qp(em),uT=p.forwardRef($t(function(e,n){var z,Z,le,ce,F,q,he;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,x=Jp(em,r),[w,b]=p.useState(null),C=ie(n,b),[P,R]=p.useState(null),M=hr(P),j=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,E=o+(i!=="center"?"-"+i:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(d)?d:[d],$=_.length>0,G={padding:k,boundary:_.filter(tm),altBoundary:$},{refs:Q,floatingStyles:V,placement:I,isPositioned:L,middlewareData:O}=GR({strategy:"fixed",placement:E,whileElementsMounted:$t((...ue)=>IR(...ue,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[UR({mainAxis:s+T,alignmentAxis:a}),u&&HR({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?WR():void 0,...G}),u&&KR({...G}),YR({...G,apply:$t(({elements:ue,rects:He,availableWidth:ve,availableHeight:qe})=>{const{width:gn,height:pe}=He.reference,we=ue.floating.style;we.setProperty("--radix-popper-available-width",`${ve}px`),we.setProperty("--radix-popper-available-height",`${qe}px`),we.setProperty("--radix-popper-anchor-width",`${gn}px`),we.setProperty("--radix-popper-anchor-height",`${pe}px`)},"apply")}),P&&qR({element:P,padding:c}),pT({arrowWidth:j,arrowHeight:T}),m&&XR({strategy:"referenceHidden",...G,boundary:$?G.boundary:void 0})]}),D=x.setPlacementState;Ee(()=>(D(I),()=>{D(void 0)}),[I,D]);const[X,A]=vs(I),B=Qe(y);Ee(()=>{L&&(B==null||B())},[L,B]);const ee=(z=O.arrow)==null?void 0:z.x,K=(Z=O.arrow)==null?void 0:Z.y,H=((le=O.arrow)==null?void 0:le.centerOffset)!==0,[oe,Y]=p.useState();return Ee(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:L?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(ce=O.transformOrigin)==null?void 0:ce.x,(F=O.transformOrigin)==null?void 0:F.y].join(" "),...((q=O.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(cT,{scope:r,placedSide:X,placedAlign:A,onArrowChange:R,arrowX:ee,arrowY:K,shouldHideArrow:H,children:l.jsx(re.div,{"data-side":X,"data-align":A,...v,ref:C,style:{...v.style,animation:L?(he=v.style)==null?void 0:he.animation:"none"}})})})},"PopperContent")),dT="PopperArrow",fT={top:"bottom",right:"left",bottom:"top",left:"right"},hT=p.forwardRef($t(function(e,n){const{__scopePopper:r,...o}=e,s=lT(dT,r),i=fT[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(eT,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function tm(t){return t!==null}$t(tm,"isNotNull");var pT=$t(t=>({name:"transformOrigin",options:t,fn(e){var v,x,w;const{placement:n,rects:r,middlewareData:o}=e,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,d]=vs(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let g="",y="";return u==="bottom"?(g=i?f:`${h}px`,y=`${-c}px`):u==="top"?(g=i?f:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,y=i?f:`${m}px`):u==="left"&&(g=`${r.floating.width+c}px`,y=i?f:`${m}px`),{data:{x:g,y}}}}),"transformOrigin");function vs(t){const[e,n="center"]=t.split("-");return[e,n]}$t(vs,"getSideAndAlignFromPlacement");var Wr=sT,Kr=aT,xs=uT,nm=hT,mT=Object.defineProperty,gT=(t,e)=>mT(t,"name",{value:e,configurable:!0}),Yr=p.forwardRef(gT(function(e,n){var c;const{container:r,...o}=e,[s,i]=p.useState(!1);Ee(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Lr.createPortal(l.jsx(re.div,{...o,ref:n}),a):null},"Portal")),yT=Object.defineProperty,zt=(t,e)=>yT(t,"name",{value:e,configurable:!0});function rm(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}zt(rm,"useStateMachine");var Ue=zt(t=>{const{present:e,children:n}=t,r=om(e),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=sm(r.ref,im(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null},"Presence");function om(t){const[e,n]=p.useState(),r=p.useRef(null),o=p.useRef(t),s=p.useRef("none"),i=p.useRef(void 0),a=t?"mounted":"unmounted",[c,u]=rm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=i.current??Bn(r.current),i.current=void 0):s.current="none"},[c]),Ee(()=>{const d=r.current,f=o.current;if(f!==t){const m=s.current,g=Bn(d);t?(i.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),Ee(()=>{if(e){let d;const f=e.ownerDocument.defaultView??window,h=zt(g=>{const v=Bn(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&v&&(u("ANIMATION_END"),!o.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",d=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),m=zt(g=>{g.target===e&&(s.current=Bn(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(d),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Bn(f)}else r.current=null;n(d)},[])}}zt(om,"usePresence");function ga(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}zt(ga,"setRef");function sm(...t){const e=p.useRef(t);return e.current=t,p.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const a=ga(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():ga(r[i],null)}}},[])}zt(sm,"useStableComposedRefs");function Bn(t){return(t==null?void 0:t.animationName)||"none"}zt(Bn,"getAnimationName");function im(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}zt(im,"getElementRef");var vT=Object.defineProperty,xT=(t,e)=>vT(t,"name",{value:e,configurable:!0});function Pc(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}xT(Pc,"usePrevious");var bT=Object.defineProperty,wT=(t,e)=>bT(t,"name",{value:e,configurable:!0}),am=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cm=p.forwardRef(wT(function(e,n){return l.jsx(re.span,{...e,ref:n,style:{...am,...e.style}})},"VisuallyHidden")),CT=cm,ST=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ln=new WeakMap,xo=new WeakMap,bo={},yi=0,lm=function(t){return t&&(t.host||lm(t.parentNode))},PT=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=lm(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},RT=function(t,e,n,r){var o=PT(e,Array.isArray(t)?t:[t]);bo[n]||(bo[n]=new WeakMap);var s=bo[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),g=m!==null&&m!=="false",y=(Ln.get(h)||0)+1,v=(s.get(h)||0)+1;Ln.set(h,y),s.set(h,v),i.push(h),y===1&&g&&xo.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(e),a.clear(),yi++,function(){i.forEach(function(f){var h=Ln.get(f)-1,m=s.get(f)-1;Ln.set(f,h),s.set(f,m),h||(xo.has(f)||f.removeAttribute(r),xo.delete(f)),m||f.removeAttribute(n)}),yi--,yi||(Ln=new WeakMap,Ln=new WeakMap,xo=new WeakMap,bo={})}},bs=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=ST(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),RT(r,o,n,"aria-hidden")):function(){return null}},jt=function(){return jt=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},jt.apply(this,arguments)};function um(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function TT(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Go="right-scroll-bar-position",zo="width-before-scroll-bar",MT="with-scroll-bars-hidden",ET="--removed-body-scroll-bar-size";function vi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function jT(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var AT=typeof window<"u"?p.useLayoutEffect:p.useEffect,bd=new WeakMap;function DT(t,e){var n=jT(null,function(r){return t.forEach(function(o){return vi(o,r)})});return AT(function(){var r=bd.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||vi(a,null)}),s.forEach(function(a){o.has(a)||vi(a,i)})}bd.set(n,t)},[t]),n}function IT(t){return t}function kT(t,e){e===void 0&&(e=IT);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function NT(t){t===void 0&&(t={});var e=kT(null);return e.options=jt({async:!0,ssr:!1},t),e}var dm=function(t){var e=t.sideCar,n=um(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,jt({},n))};dm.isSideCarExport=!0;function _T(t,e){return t.useMedium(e),dm}var fm=NT(),xi=function(){},ws=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:xi,onWheelCapture:xi,onTouchMoveCapture:xi}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,m=t.noRelative,g=t.noIsolation,y=t.inert,v=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,b=t.gapMode,C=um(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,R=DT([n,e]),M=jt(jt({},C),o);return p.createElement(p.Fragment,null,d&&p.createElement(P,{sideCar:fm,removeScrollBar:u,shards:f,noRelative:m,noIsolation:g,inert:y,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:b}),i?p.cloneElement(p.Children.only(a),jt(jt({},M),{ref:R})):p.createElement(w,jt({},M,{className:c,ref:R}),a))});ws.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ws.classNames={fullWidth:zo,zeroRight:Go};var OT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function LT(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=OT();return e&&t.setAttribute("nonce",e),t}function $T(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function FT(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var VT=function(){var t=0,e=null;return{add:function(n){t==0&&(e=LT())&&($T(e,n),FT(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},BT=function(){var t=VT();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},hm=function(){var t=BT(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},GT={left:0,top:0,right:0,gap:0},bi=function(t){return parseInt(t||"",10)||0},zT=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[bi(n),bi(r),bi(o)]},UT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return GT;var e=zT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},HT=hm(),Xn="data-scroll-locked",WT=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
170
+ .`.concat(MT,` {
171
171
  overflow: hidden `).concat(r,`;
172
172
  padding-right: `).concat(a,"px ").concat(r,`;
173
173
  }
174
- body[`).concat(Yn,`] {
174
+ body[`).concat(Xn,`] {
175
175
  overflow: hidden `).concat(r,`;
176
176
  overscroll-behavior: contain;
177
177
  `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -200,13 +200,13 @@
200
200
  margin-right: 0 `).concat(r,`;
201
201
  }
202
202
 
203
- body[`).concat(Yn,`] {
204
- `).concat(PT,": ").concat(a,`px;
203
+ body[`).concat(Xn,`] {
204
+ `).concat(ET,": ").concat(a,`px;
205
205
  }
206
- `)},xd=function(){var t=parseInt(document.body.getAttribute(Yn)||"0",10);return isFinite(t)?t:0},zT=function(){p.useEffect(function(){return document.body.setAttribute(Yn,(xd()+1).toString()),function(){var t=xd()-1;t<=0?document.body.removeAttribute(Yn):document.body.setAttribute(Yn,t.toString())}},[])},UT=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;zT();var s=p.useMemo(function(){return VT(o)},[o]);return p.createElement(BT,{styles:GT(s,!e,o,n?"":"!important")})},ya=!1;if(typeof window<"u")try{var wo=Object.defineProperty({},"passive",{get:function(){return ya=!0,!0}});window.addEventListener("test",wo,wo),window.removeEventListener("test",wo,wo)}catch{ya=!1}var Ln=ya?{passive:!1}:!1,HT=function(t){return t.tagName==="TEXTAREA"},dm=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!HT(t)&&n[e]==="visible")},WT=function(t){return dm(t,"overflowY")},KT=function(t){return dm(t,"overflowX")},bd=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=fm(t,r);if(o){var s=hm(t,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},YT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},XT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},fm=function(t,e){return t==="v"?WT(e):KT(e)},hm=function(t,e){return t==="v"?YT(e):XT(e)},qT=function(t,e){return t==="h"&&e==="rtl"?-1:1},ZT=function(t,e,n,r,o){var s=qT(t,window.getComputedStyle(e).direction),i=s*r,a=n.target,c=e.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var m=hm(t,a),g=m[0],y=m[1],v=m[2],x=y-v-s*g;(g||x)&&fm(t,a)&&(f+=x,h+=g);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Co=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},wd=function(t){return[t.deltaX,t.deltaY]},Cd=function(t){return t&&"current"in t?t.current:t},QT=function(t,e){return t[0]===e[0]&&t[1]===e[1]},JT=function(t){return`
206
+ `)},wd=function(){var t=parseInt(document.body.getAttribute(Xn)||"0",10);return isFinite(t)?t:0},KT=function(){p.useEffect(function(){return document.body.setAttribute(Xn,(wd()+1).toString()),function(){var t=wd()-1;t<=0?document.body.removeAttribute(Xn):document.body.setAttribute(Xn,t.toString())}},[])},YT=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;KT();var s=p.useMemo(function(){return UT(o)},[o]);return p.createElement(HT,{styles:WT(s,!e,o,n?"":"!important")})},ya=!1;if(typeof window<"u")try{var wo=Object.defineProperty({},"passive",{get:function(){return ya=!0,!0}});window.addEventListener("test",wo,wo),window.removeEventListener("test",wo,wo)}catch{ya=!1}var $n=ya?{passive:!1}:!1,XT=function(t){return t.tagName==="TEXTAREA"},pm=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!XT(t)&&n[e]==="visible")},qT=function(t){return pm(t,"overflowY")},ZT=function(t){return pm(t,"overflowX")},Cd=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mm(t,r);if(o){var s=gm(t,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},QT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},JT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},mm=function(t,e){return t==="v"?qT(e):ZT(e)},gm=function(t,e){return t==="v"?QT(e):JT(e)},e1=function(t,e){return t==="h"&&e==="rtl"?-1:1},t1=function(t,e,n,r,o){var s=e1(t,window.getComputedStyle(e).direction),i=s*r,a=n.target,c=e.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var m=gm(t,a),g=m[0],y=m[1],v=m[2],x=y-v-s*g;(g||x)&&mm(t,a)&&(f+=x,h+=g);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Co=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Sd=function(t){return[t.deltaX,t.deltaY]},Pd=function(t){return t&&"current"in t?t.current:t},n1=function(t,e){return t[0]===e[0]&&t[1]===e[1]},r1=function(t){return`
207
207
  .block-interactivity-`.concat(t,` {pointer-events: none;}
208
208
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
209
- `)},e1=0,$n=[];function t1(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(e1++)[0],s=p.useState(um)[0],i=p.useRef(t);p.useEffect(function(){i.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var y=CT([t.lockRef.current],(t.shards||[]).map(Cd),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var x=Co(y),w=n.current,b="deltaX"in y?y.deltaX:w[0]-x[0],C="deltaY"in y?y.deltaY:w[1]-x[1],P,R=y.target,M=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in y&&M==="h"&&R.type==="range")return!1;var j=window.getSelection(),T=j&&j.anchorNode,E=T?T===R||T.contains(R):!1;if(E)return!1;var N=bd(M,R);if(!N)return!0;if(N?P=M:(P=M==="v"?"h":"v",N=bd(M,R)),!N)return!1;if(!r.current&&"changedTouches"in y&&(b||C)&&(r.current=P),!P)return!0;var O=r.current||P;return ZT(O,v,y,O==="h"?b:C)},[]),c=p.useCallback(function(y){var v=y;if(!(!$n.length||$n[$n.length-1]!==s)){var x="deltaY"in v?wd(v):Co(v),w=e.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&QT(P.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(Cd).filter(Boolean).filter(function(P){return P.contains(v.target)}),C=b.length>0?a(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(y,v,x,w){var b={name:y,delta:v,target:x,should:w,shadowParent:n1(x)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),d=p.useCallback(function(y){n.current=Co(y),r.current=void 0},[]),f=p.useCallback(function(y){u(y.type,wd(y),y.target,a(y,t.lockRef.current))},[]),h=p.useCallback(function(y){u(y.type,Co(y),y.target,a(y,t.lockRef.current))},[]);p.useEffect(function(){return $n.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ln),document.addEventListener("touchmove",c,Ln),document.addEventListener("touchstart",d,Ln),function(){$n=$n.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,Ln),document.removeEventListener("touchmove",c,Ln),document.removeEventListener("touchstart",d,Ln)}},[]);var m=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:JT(o)}):null,m?p.createElement(UT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function n1(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const r1=DT(lm,t1);var Yr=p.forwardRef(function(t,e){return p.createElement(ws,jt({},t,{ref:e,sideCar:r1}))});Yr.classNames=ws.classNames;var o1=Object.defineProperty,fe=(t,e)=>o1(t,"name",{value:e,configurable:!0}),s1=[" ","Enter","ArrowUp","ArrowDown"],i1=[" ","Enter"],Jn="Select",[Cs,Sc,a1]=ar(Jn),[Dn,lN]=Ce(Jn,[a1,dn]),Pc=dn(),[c1,fn]=Dn(Jn),[l1,u1]=Dn(Jn);function pm(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:g,internal_do_not_use_render:y}=t,v=Pc(e),[x,w]=p.useState(null),[b,C]=p.useState(null),[P,R]=p.useState(!1),M=Ht(u),[j,T]=we({prop:r,defaultProp:o??!1,onChange:s,caller:Jn}),[E,N]=we({prop:i,defaultProp:a,onChange:c,caller:Jn}),O=p.useRef(null),$=p.useRef(E);p.useEffect(()=>{const A=g?x==null?void 0:x.ownerDocument.getElementById(g):x==null?void 0:x.form;if(A instanceof HTMLFormElement){const B=fe(()=>N($.current),"reset");return A.addEventListener("reset",B),()=>A.removeEventListener("reset",B)}},[g,x,N]);const V=x?!!g||!!x.closest("form"):!0,[q,G]=p.useState(new Set),k=$e(),F=Array.from(q).map(A=>A.props.value).join(";"),L=p.useCallback(A=>{G(B=>new Set(B).add(A))},[]),D=p.useCallback(A=>{G(B=>{const Q=new Set(B);return Q.delete(A),Q})},[]),X={required:m,trigger:x,onTriggerChange:w,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:R,contentId:k,value:E,onValueChange:N,open:j,onOpenChange:T,dir:M,triggerPointerDownPosRef:O,disabled:h,name:d,autoComplete:f,form:g,nativeOptions:q,nativeSelectKey:F,isFormControl:V};return l.jsx(Hr,{...v,children:l.jsx(c1,{scope:e,...X,children:l.jsx(Cs.Provider,{scope:e,children:l.jsx(l1,{scope:e,onNativeOptionAdd:L,onNativeOptionRemove:D,children:ym(y)?y(X):n})})})})}fe(pm,"SelectProvider");var d1=fe(t=>{const{__scopeSelect:e,children:n,...r}=t;return l.jsx(pm,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>l.jsxs(l.Fragment,{children:[n,o?l.jsx(G1,{__scopeSelect:e}):null]})})},"Select"),f1="SelectTrigger",h1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Pc(r),a=fn(f1,r),c=a.disabled||o,u=ce(n,a.onTriggerChange),d=Sc(r),f=p.useRef("touch"),[h,m,g]=Rc(v=>{const x=d().filter(C=>!C.disabled),w=x.find(C=>C.value===a.value),b=Tc(x,v,w);b!==void 0&&a.onValueChange(b.value)}),y=fe(v=>{c||(a.onOpenChange(!0),g()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})},"handleOpen");return l.jsx(Wr,{asChild:!0,...i,children:l.jsx(te.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Xr(a.value)?"":void 0,...s,ref:u,onClick:U(s.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&y(v)}),onPointerDown:U(s.onPointerDown,v=>{f.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:U(s.onKeyDown,v=>{const x=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&s1.includes(v.key)&&(y(),v.preventDefault())})})})},"SelectTrigger")),p1="SelectValue",m1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...c}=e,u=fn(p1,r),{onValueNodeHasChildrenChange:d}=u,f=i!==void 0,h=ce(n,u.onValueNodeChange);Te(()=>{d(f)},[d,f]);const m=Xr(u.value);return l.jsx(te.span,{...c,asChild:m?!1:c.asChild,ref:h,style:{pointerEvents:"none"},children:l.jsx(p.Fragment,{children:m?a:i},m?"placeholder":"value")})},"SelectValue")),g1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return l.jsx(te.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),y1="SelectPortal",[v1,x1]=Dn(y1,{forceMount:void 0}),b1=fe(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return l.jsx(v1,{scope:t.__scopeSelect,forceMount:n,children:l.jsx(Kr,{asChild:!0,...r})})},"SelectPortal"),Mn="SelectContent",w1=p.forwardRef(fe(function(e,n){const r=x1(Mn,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=fn(Mn,e.__scopeSelect),[a,c]=p.useState();return Te(()=>{c(new DocumentFragment)},[]),l.jsx(ze,{present:o||i.open,children:({present:u})=>u?l.jsx(P1,{...s,ref:n}):l.jsx(C1,{...s,fragment:a})})},"SelectContent")),C1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Or.createPortal(l.jsx(mm,{scope:r,children:l.jsx(Cs.Slot,{scope:r,children:l.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),gt=10,[mm,Ss]=Dn(Mn),S1=Nt("SelectContent.RemoveScroll"),P1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x,...w}=e,b=fn(Mn,r),[C,P]=p.useState(null),[R,M]=p.useState(null),j=ce(n,P),[T,E]=p.useState(null),[N,O]=p.useState(null),$=Sc(r),[V,q]=p.useState(!1),G=p.useRef(!1);p.useEffect(()=>{if(C)return bs(C)},[C]),lr();const k=p.useCallback(Y=>{const[z,...I]=$().map(oe=>oe.ref.current),[ne]=I.slice(-1),ie=document.activeElement;for(const oe of Y)if(oe===ie||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===z&&R&&(R.scrollTop=0),oe===ne&&R&&(R.scrollTop=R.scrollHeight),oe==null||oe.focus(),document.activeElement!==ie))return},[$,R]),F=p.useCallback(()=>k([T,C]),[k,T,C]);p.useEffect(()=>{V&&F()},[V,F]);const{onOpenChange:L,triggerPointerDownPosRef:D}=b;p.useEffect(()=>{if(C){let Y={x:0,y:0};const z=fe(ne=>{var ie,oe;Y={x:Math.abs(Math.round(ne.pageX)-(((ie=D.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((oe=D.current)==null?void 0:oe.y)??0))}},"handlePointerMove"),I=fe(ne=>{Y.x<=10&&Y.y<=10?ne.preventDefault():ne.composedPath().includes(C)||L(!1),document.removeEventListener("pointermove",z),D.current=null},"handlePointerUp");return D.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",I,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",I,{capture:!0})}}},[C,L,D]),p.useEffect(()=>{const Y=fe(()=>L(!1),"close");return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[L]);const[X,A]=Rc(Y=>{const z=$().filter(ie=>!ie.disabled),I=z.find(ie=>ie.ref.current===document.activeElement),ne=Tc(z,Y,I);ne&&setTimeout(()=>{var ie;return(ie=ne.ref.current)==null?void 0:ie.focus()})}),B=p.useCallback((Y,z,I)=>{const ne=!G.current&&!I;(b.value!==void 0&&b.value===z||ne)&&(E(Y),ne&&(G.current=!0))},[b.value]),Q=p.useCallback(()=>C==null?void 0:C.focus(),[C]),K=p.useCallback((Y,z,I)=>{const ne=!G.current&&!I;(b.value!==void 0&&b.value===z||ne)&&O(Y)},[b.value]),W=o==="popper"?Sd:R1,re=W===Sd?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x}:{};return l.jsx(mm,{scope:r,content:C,viewport:R,onViewportChange:M,itemRefCallback:B,selectedItem:T,onItemLeave:Q,itemTextRefCallback:K,focusSelectedItem:F,selectedItemText:N,position:o,isPositioned:V,searchRef:X,children:l.jsx(Yr,{as:S1,allowPinchZoom:!0,children:l.jsx(hs,{asChild:!0,trapped:b.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:U(s,Y=>{var z;(z=b.trigger)==null||z.focus({preventScroll:!0}),Y.preventDefault()}),children:l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(W,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Y=>Y.preventDefault(),...w,...re,onPlaced:()=>q(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:U(w.onKeyDown,Y=>{const z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!z&&Y.key.length===1&&A(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let ne=$().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ie=Y.target,oe=ne.indexOf(ie);ne=ne.slice(oe+1)}setTimeout(()=>k(ne)),Y.preventDefault()}})})})})})})},"SelectContentImpl")),R1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=fn(Mn,r),a=Ss(Mn,r),[c,u]=p.useState(null),[d,f]=p.useState(null),h=ce(n,f),m=Sc(r),g=p.useRef(!1),y=p.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:w,focusSelectedItem:b}=a,C=p.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&v&&x&&w){const j=i.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),N=w.getBoundingClientRect();if(i.dir!=="rtl"){const ie=N.left-T.left,oe=E.left-ie,se=j.left-oe,Me=j.width+se,lt=Math.max(Me,T.width),ht=window.innerWidth-gt,me=jr(oe,[gt,Math.max(gt,ht-lt)]);c.style.minWidth=Me+"px",c.style.left=me+"px"}else{const ie=T.right-N.right,oe=window.innerWidth-E.right-ie,se=window.innerWidth-j.right-oe,Me=j.width+se,lt=Math.max(Me,T.width),ht=window.innerWidth-gt,me=jr(oe,[gt,Math.max(gt,ht-lt)]);c.style.minWidth=Me+"px",c.style.right=me+"px"}const O=m(),$=window.innerHeight-gt*2,V=v.scrollHeight,q=window.getComputedStyle(d),G=parseInt(q.borderTopWidth,10),k=parseInt(q.paddingTop,10),F=parseInt(q.borderBottomWidth,10),L=parseInt(q.paddingBottom,10),D=G+k+V+L+F,X=Math.min(x.offsetHeight*5,D),A=window.getComputedStyle(v),B=parseInt(A.paddingTop,10),Q=parseInt(A.paddingBottom,10),K=j.top+j.height/2-gt,W=$-K,re=x.offsetHeight/2,Y=x.offsetTop+re,z=G+k+Y,I=D-z;if(z<=K){const ie=O.length>0&&x===O[O.length-1].ref.current;c.style.bottom="0px";const oe=d.clientHeight-v.offsetTop-v.offsetHeight,se=Math.max(W,re+(ie?Q:0)+oe+F),Me=z+se;c.style.height=Me+"px"}else{const ie=O.length>0&&x===O[0].ref.current;c.style.top="0px";const se=Math.max(K,G+v.offsetTop+(ie?B:0)+re)+I;c.style.height=se+"px",v.scrollTop=z-K+v.offsetTop}c.style.margin=`${gt}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=$+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,c,d,v,x,w,i.dir,o]);Te(()=>C(),[C]);const[P,R]=p.useState();Te(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const M=p.useCallback(j=>{j&&y.current===!0&&(C(),b==null||b(),y.current=!1)},[C,b]);return l.jsx(T1,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:M,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:l.jsx(te.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),Sd=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=gt,...i}=e,a=Pc(r);return l.jsx(xs,{...a,...i,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[T1,M1]=Dn(Mn,{}),Pd="SelectViewport",E1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=Ss(Pd,r),a=M1(Pd,r),c=ce(n,i.onViewportChange),u=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Cs.Slot,{scope:r,children:l.jsx(te.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:U(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const g=Math.abs(u.current-f.scrollTop);if(g>0){const y=window.innerHeight-gt*2,v=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),w=Math.max(v,x);if(w<y){const b=w+g,C=Math.min(y,b),P=b-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=P>0?P:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})},"SelectViewport")),j1="SelectGroup",[A1,D1]=Dn(j1),I1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e,s=$e();return l.jsx(A1,{scope:r,id:s,children:l.jsx(te.div,{role:"group","aria-labelledby":s,...o,ref:n})})},"SelectGroup")),k1="SelectLabel",N1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e,s=D1(k1,r);return l.jsx(te.div,{id:s.id,...o,ref:n})},"SelectLabel")),va="SelectItem",[_1,gm]=Dn(va),O1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,c=fn(va,r),u=Ss(va,r),d=c.value===o,[f,h]=p.useState(i??""),[m,g]=p.useState(!1),y=qe(C=>{var P;return(P=u.itemRefCallback)==null?void 0:P.call(u,C,o,s)}),v=ce(n,y),x=$e(),w=p.useRef("touch"),b=fe(()=>{s||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return l.jsx(_1,{scope:r,value:o,disabled:s,textId:x,isSelected:d,onItemTextChange:p.useCallback(C=>{h(P=>P||((C==null?void 0:C.textContent)??"").trim())},[]),children:l.jsx(Cs.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:l.jsx(te.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:v,onFocus:U(a.onFocus,()=>g(!0)),onBlur:U(a.onBlur,()=>g(!1)),onClick:U(a.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:U(a.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:U(a.onPointerDown,C=>{w.current=C.pointerType}),onPointerMove:U(a.onPointerMove,C=>{var P;w.current=C.pointerType,s?(P=u.onItemLeave)==null||P.call(u):w.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(a.onPointerLeave,C=>{var P;C.currentTarget===document.activeElement&&((P=u.onItemLeave)==null||P.call(u))}),onKeyDown:U(a.onKeyDown,C=>{var R;s||C.target!==C.currentTarget||((R=u.searchRef)==null?void 0:R.current)!==""&&C.key===" "||(i1.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})},"SelectItem")),So="SelectItemText",L1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=fn(So,r),c=Ss(So,r),u=gm(So,r),d=u1(So,r),[f,h]=p.useState(null),m=qe(b=>{var C;return(C=c.itemTextRefCallback)==null?void 0:C.call(c,b,u.value,u.disabled)}),g=ce(n,h,u.onItemTextChange,m),y=f==null?void 0:f.textContent,v=p.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return Te(()=>(x(v),()=>w(v)),[x,w,v]),l.jsxs(l.Fragment,{children:[l.jsx(te.span,{id:u.textId,...i,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Xr(a.value)?Or.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),$1="SelectItemIndicator",F1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e;return gm($1,r).isSelected?l.jsx(te.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),V1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e;return l.jsx(te.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),B1="SelectBubbleInput",G1=p.forwardRef(fe(function({__scopeSelect:e,...n},r){const o=fn(B1,e),{value:s,onValueChange:i,required:a,disabled:c,name:u,autoComplete:d,form:f}=o,{nativeOptions:h,nativeSelectKey:m}=o,g=p.useRef(null),y=ce(r,g),v=s??"",x=Cc(v),w=Array.from(h).some(b=>(b.props.value??"")==="");return p.useEffect(()=>{const b=g.current;if(!b)return;const C=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(C,"value").set;if(x!==v&&R){const M=new Event("change",{bubbles:!0});R.call(b,v),b.dispatchEvent(M)}},[x,v]),l.jsxs(te.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:b=>i(b.target.value),...n,style:{...om,...n.style},ref:y,defaultValue:v,children:[Xr(s)&&!w?l.jsx("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function ym(t){return typeof t=="function"}fe(ym,"isFunction");function Xr(t){return t===""||t===void 0}fe(Xr,"shouldShowPlaceholder");function Rc(t){const e=qe(t),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;e(a),fe((function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch")(a)},[e]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}fe(Rc,"useTypeaheadSearch");function Tc(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=vm(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}fe(Tc,"findNextItem");function vm(t,e){return t.map((n,r)=>t[(e+r)%t.length])}fe(vm,"wrapArray");function z1({placeholder:t,size:e,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,style:c,sx:u,disabled:d,children:f,"aria-invalid":h,"aria-describedby":m,...g}){const{className:y,style:v,styleTag:x}=ae(u,c,"cny-select-trigger",e==="sm"||e==="lg"?e:null,n!=="primary"&&n,a,o);return l.jsxs(d1,{disabled:d,...g,children:[l.jsxs(h1,{id:i,"aria-invalid":h,"aria-describedby":m,className:y,style:v,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(m1,{placeholder:t}),l.jsx(g1,{className:"cny-select-chevron",asChild:!0,children:l.jsx(Gr,{size:14,"aria-hidden":"true"})})]}),l.jsx(b1,{children:l.jsx(w1,{position:"popper",sideOffset:4,className:H("cny-select-content",s),children:l.jsx(E1,{className:"cny-select-viewport",children:f})})})]})}const U1=S.forwardRef(function({className:e,children:n,...r},o){return l.jsxs(O1,{ref:o,className:H("cny-select-item",e),...r,children:[l.jsx(L1,{children:n}),l.jsx(F1,{className:"cny-select-indicator",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]})}),H1=S.forwardRef(function(e,n){return l.jsx(I1,{ref:n,...e})}),W1=S.forwardRef(function({className:e,...n},r){return l.jsx(N1,{ref:r,className:H("cny-select-group-label",e),...n})}),K1=S.forwardRef(function({className:e,...n},r){return l.jsx(V1,{ref:r,className:H("cny-select-separator",e),...n})});var Y1=Object.defineProperty,Ct=(t,e)=>Y1(t,"name",{value:e,configurable:!0}),Mc="Popover",[xm,uN]=Ce(Mc,[dn]),qr=dn(),[X1,hn]=xm(Mc),q1=Ct(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=t,a=qr(e),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=we({prop:r,defaultProp:o??!1,onChange:s,caller:Mc});return l.jsx(Hr,{...a,children:l.jsx(X1,{scope:e,contentId:$e(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),Z1="PopoverAnchor",Q1=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(Z1,r),i=qr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=s;return p.useEffect(()=>(a(),()=>c()),[a,c]),l.jsx(Wr,{...i,...o,ref:n})},"PopoverAnchor")),J1="PopoverTrigger",eM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(J1,r),i=qr(r),a=ce(n,s.triggerRef),c=l.jsx(te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ec(s.open),...o,ref:a,onClick:U(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:l.jsx(Wr,{asChild:!0,...i,children:c})},"PopoverTrigger")),bm="PopoverPortal",[tM,nM]=xm(bm,{forceMount:void 0}),rM=Ct(t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,s=hn(bm,e);return l.jsx(tM,{scope:e,forceMount:n,children:l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),Dr="PopoverContent",oM=p.forwardRef(Ct(function(e,n){const r=nM(Dr,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,i=hn(Dr,e.__scopePopover);return l.jsx(ze,{present:o||i.open,children:i.modal?l.jsx(iM,{...s,ref:n}):l.jsx(aM,{...s,ref:n})})},"PopoverContent")),sM=Nt("PopoverContent.RemoveScroll"),iM=p.forwardRef(Ct(function(e,n){const r=hn(Dr,e.__scopePopover),o=p.useRef(null),s=ce(n,o),i=p.useRef(!1);return p.useEffect(()=>{const a=o.current;if(a)return bs(a)},[]),l.jsx(Yr,{as:sM,allowPinchZoom:!0,children:l.jsx(wm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:U(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),aM=p.forwardRef(Ct(function(e,n){const r=hn(Dr,e.__scopePopover),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(wm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"PopoverContentNonModal")),wm=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=e,m=hn(Dr,r),g=qr(r);return lr(),l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:l.jsx(xs,{"data-state":Ec(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),cM="PopoverClose",lM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(cM,r);return l.jsx(te.button,{type:"button",...o,ref:n,onClick:U(e.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),uM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=qr(r);return l.jsx(Jp,{...s,...o,ref:n})},"PopoverArrow"));function Ec(t){return t?"open":"closed"}Ct(Ec,"getState");var jc=q1,dM=Q1,Ac=eM,Dc=rM,Ic=oM,fM=lM,hM=uM,Rd=1,pM=.9,mM=.8,gM=.17,wi=.1,Ci=.999,yM=.9999,vM=.99,xM=/[\\\/_+.#"@\[\(\{&]/,bM=/[\\\/_+.#"@\[\(\{&]/g,wM=/[\s-]/,Cm=/[\s-]/g;function xa(t,e,n,r,o,s,i){if(s===e.length)return o===t.length?Rd:vM;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,g;u>=0;)f=xa(t,e,n,r,u+1,s+1,i),f>d&&(u===o?f*=Rd:xM.test(t.charAt(u-1))?(f*=mM,m=t.slice(o,u-1).match(bM),m&&o>0&&(f*=Math.pow(Ci,m.length))):wM.test(t.charAt(u-1))?(f*=pM,g=t.slice(o,u-1).match(Cm),g&&o>0&&(f*=Math.pow(Ci,g.length))):(f*=gM,o>0&&(f*=Math.pow(Ci,u-o))),t.charAt(u)!==e.charAt(s)&&(f*=yM)),(f<wi&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=xa(t,e,n,r,u+1,s+2,i),h*wi>f&&(f=h*wi)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Td(t){return t.toLowerCase().replace(Cm," ")}function CM(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,xa(t,e,Td(t),Td(e),0,0,{})}var SM=Object.defineProperty,ct=(t,e)=>SM(t,"name",{value:e,configurable:!0}),kc="Dialog",[Sm,dN]=Ce(kc),[PM,St]=Sm(kc),Nc=ct(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=p.useRef(null),c=p.useRef(null),[u,d]=we({prop:r,defaultProp:o??!1,onChange:s,caller:kc}),[f,h]=p.useState(0),[m,g]=p.useState(0);return l.jsx(PM,{scope:e,triggerRef:a,contentRef:c,contentId:$e(),titleId:$e(),descriptionId:$e(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:g,open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(y=>!y),[d]),modal:i,children:n})},"Dialog"),RM="DialogTrigger",Pm=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(RM,r),i=ce(n,s.triggerRef);return l.jsx(te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Rs(s.open),...o,ref:i,onClick:U(e.onClick,s.onOpenToggle)})},"DialogTrigger")),Rm="DialogPortal",[TM,Tm]=Sm(Rm,{forceMount:void 0}),_c=ct(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=St(Rm,e);return l.jsx(TM,{scope:e,forceMount:n,children:p.Children.map(r,i=>l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),ba="DialogOverlay",Oc=p.forwardRef(ct(function(e,n){const r=Tm(ba,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(ba,e.__scopeDialog);return i.modal?l.jsx(ze,{present:o||i.open,children:l.jsx(EM,{...s,ref:n})}):null},"DialogOverlay")),MM=Nt("DialogOverlay.RemoveScroll"),EM=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(ba,r),i=Ep(),a=ce(n,i);return l.jsx(Yr,{as:MM,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(te.div,{"data-state":Rs(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Ir="DialogContent",Lc=p.forwardRef(ct(function(e,n){const r=Tm(Ir,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(Ir,e.__scopeDialog);return l.jsx(ze,{present:o||i.open,children:i.modal?l.jsx(jM,{...s,ref:n}):l.jsx(AM,{...s,ref:n})})},"DialogContent")),jM=p.forwardRef(ct(function(e,n){const r=St(Ir,e.__scopeDialog),o=p.useRef(null),s=ce(n,r.contentRef,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(Mm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:U(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:U(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),AM=p.forwardRef(ct(function(e,n){const r=St(Ir,e.__scopeDialog),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Mm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Mm=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,c=St(Ir,r);return lr(),l.jsx(l.Fragment,{children:l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(zr,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Rs(c.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),DM="DialogTitle",$c=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(DM,r),{setTitleCount:i}=s;return Te(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(te.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),IM="DialogDescription",Fc=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(IM,r),{setDescriptionCount:i}=s;return Te(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(te.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),kM="DialogClose",Ps=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(kM,r);return l.jsx(te.button,{type:"button",...o,ref:n,onClick:U(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Rs(t){return t?"open":"closed"}ct(Rs,"getState");function Md(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function er(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Md(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Md(t[o],null)}}}}function NM(t){const e=_M(t),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(LM);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(e,{...i,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function _M(t){const e=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=FM(o),a=$M(s,o.props);return o.type!==p.Fragment&&(a.ref=r?er(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var OM=Symbol("radix.slottable");function LM(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OM}function $M(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function FM(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var VM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=VM.reduce((t,e)=>{const n=NM(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),BM=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},GM=p[" useId ".trim().toString()]||(()=>{}),zM=0;function Xn(t){const[e,n]=p.useState(GM());return BM(()=>{n(r=>r??String(zM++))},[t]),e?`radix-${e}`:""}var yr='[cmdk-group=""]',Si='[cmdk-group-items=""]',UM='[cmdk-group-heading=""]',Em='[cmdk-item=""]',Ed=`${Em}:not([aria-disabled="true"])`,wa="cmdk-item-select",Bn="data-value",HM=(t,e,n)=>CM(t,e,n),jm=p.createContext(void 0),Zr=()=>p.useContext(jm),Am=p.createContext(void 0),Vc=()=>p.useContext(Am),Dm=p.createContext(void 0),Im=p.forwardRef((t,e)=>{let n=Gn(()=>{var A,B;return{search:"",value:(B=(A=t.value)!=null?A:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Gn(()=>new Set),o=Gn(()=>new Map),s=Gn(()=>new Map),i=Gn(()=>new Set),a=km(t),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:g,disablePointerSelection:y=!1,vimBindings:v=!0,...x}=t,w=Xn(),b=Xn(),C=Xn(),P=p.useRef(null),R=nE();En(()=>{if(d!==void 0){let A=d.trim();n.current.value=A,M.emit()}},[d]),En(()=>{R(6,$)},[]);let M=p.useMemo(()=>({subscribe:A=>(i.current.add(A),()=>i.current.delete(A)),snapshot:()=>n.current,setState:(A,B,Q)=>{var K,W,re,Y;if(!Object.is(n.current[A],B)){if(n.current[A]=B,A==="search")O(),E(),R(1,N);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let z=document.getElementById(C);z?z.focus():(K=document.getElementById(w))==null||K.focus()}if(R(7,()=>{var z;n.current.selectedItemId=(z=V())==null?void 0:z.id,M.emit()}),Q||R(5,$),((W=a.current)==null?void 0:W.value)!==void 0){let z=B??"";(Y=(re=a.current).onValueChange)==null||Y.call(re,z);return}}M.emit()}},emit:()=>{i.current.forEach(A=>A())}}),[]),j=p.useMemo(()=>({value:(A,B,Q)=>{var K;B!==((K=s.current.get(A))==null?void 0:K.value)&&(s.current.set(A,{value:B,keywords:Q}),n.current.filtered.items.set(A,T(B,Q)),R(2,()=>{E(),M.emit()}))},item:(A,B)=>(r.current.add(A),B&&(o.current.has(B)?o.current.get(B).add(A):o.current.set(B,new Set([A]))),R(3,()=>{O(),E(),n.current.value||N(),M.emit()}),()=>{s.current.delete(A),r.current.delete(A),n.current.filtered.items.delete(A);let Q=V();R(4,()=>{O(),(Q==null?void 0:Q.getAttribute("id"))===A&&N(),M.emit()})}),group:A=>(o.current.has(A)||o.current.set(A,new Set),()=>{s.current.delete(A),o.current.delete(A)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:b,listInnerRef:P}),[]);function T(A,B){var Q,K;let W=(K=(Q=a.current)==null?void 0:Q.filter)!=null?K:HM;return A?W(A,n.current.search,B):0}function E(){if(!n.current.search||a.current.shouldFilter===!1)return;let A=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(K=>{let W=o.current.get(K),re=0;W.forEach(Y=>{let z=A.get(Y);re=Math.max(z,re)}),B.push([K,re])});let Q=P.current;q().sort((K,W)=>{var re,Y;let z=K.getAttribute("id"),I=W.getAttribute("id");return((re=A.get(I))!=null?re:0)-((Y=A.get(z))!=null?Y:0)}).forEach(K=>{let W=K.closest(Si);W?W.appendChild(K.parentElement===W?K:K.closest(`${Si} > *`)):Q.appendChild(K.parentElement===Q?K:K.closest(`${Si} > *`))}),B.sort((K,W)=>W[1]-K[1]).forEach(K=>{var W;let re=(W=P.current)==null?void 0:W.querySelector(`${yr}[${Bn}="${encodeURIComponent(K[0])}"]`);re==null||re.parentElement.appendChild(re)})}function N(){let A=q().find(Q=>Q.getAttribute("aria-disabled")!=="true"),B=A==null?void 0:A.getAttribute(Bn);M.setState("value",B||void 0)}function O(){var A,B,Q,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let W=0;for(let re of r.current){let Y=(B=(A=s.current.get(re))==null?void 0:A.value)!=null?B:"",z=(K=(Q=s.current.get(re))==null?void 0:Q.keywords)!=null?K:[],I=T(Y,z);n.current.filtered.items.set(re,I),I>0&&W++}for(let[re,Y]of o.current)for(let z of Y)if(n.current.filtered.items.get(z)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=W}function $(){var A,B,Q;let K=V();K&&(((A=K.parentElement)==null?void 0:A.firstChild)===K&&((Q=(B=K.closest(yr))==null?void 0:B.querySelector(UM))==null||Q.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function V(){var A;return(A=P.current)==null?void 0:A.querySelector(`${Em}[aria-selected="true"]`)}function q(){var A;return Array.from(((A=P.current)==null?void 0:A.querySelectorAll(Ed))||[])}function G(A){let B=q()[A];B&&M.setState("value",B.getAttribute(Bn))}function k(A){var B;let Q=V(),K=q(),W=K.findIndex(Y=>Y===Q),re=K[W+A];(B=a.current)!=null&&B.loop&&(re=W+A<0?K[K.length-1]:W+A===K.length?K[0]:K[W+A]),re&&M.setState("value",re.getAttribute(Bn))}function F(A){let B=V(),Q=B==null?void 0:B.closest(yr),K;for(;Q&&!K;)Q=A>0?eE(Q,yr):tE(Q,yr),K=Q==null?void 0:Q.querySelector(Ed);K?M.setState("value",K.getAttribute(Bn)):k(A)}let L=()=>G(q().length-1),D=A=>{A.preventDefault(),A.metaKey?L():A.altKey?F(1):k(1)},X=A=>{A.preventDefault(),A.metaKey?G(0):A.altKey?F(-1):k(-1)};return p.createElement(pn.div,{ref:e,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:A=>{var B;(B=x.onKeyDown)==null||B.call(x,A);let Q=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||Q))switch(A.key){case"n":case"j":{v&&A.ctrlKey&&D(A);break}case"ArrowDown":{D(A);break}case"p":case"k":{v&&A.ctrlKey&&X(A);break}case"ArrowUp":{X(A);break}case"Home":{A.preventDefault(),G(0);break}case"End":{A.preventDefault(),L();break}case"Enter":{A.preventDefault();let K=V();if(K){let W=new Event(wa);K.dispatchEvent(W)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:oE},c),Ts(t,A=>p.createElement(Am.Provider,{value:M},p.createElement(jm.Provider,{value:j},A))))}),WM=p.forwardRef((t,e)=>{var n,r;let o=Xn(),s=p.useRef(null),i=p.useContext(Dm),a=Zr(),c=km(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;En(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=Nm(o,s,[t.value,t.children,s],t.keywords),f=Vc(),h=an(R=>R.value&&R.value===d.current),m=an(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);p.useEffect(()=>{let R=s.current;if(!(!R||t.disabled))return R.addEventListener(wa,g),()=>R.removeEventListener(wa,g)},[m,t.onSelect,t.disabled]);function g(){var R,M;y(),(M=(R=c.current).onSelect)==null||M.call(R,d.current)}function y(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:w,forceMount:b,keywords:C,...P}=t;return p.createElement(pn.div,{ref:er(s,e),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:y,onClick:v?void 0:g},t.children)}),KM=p.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...s}=t,i=Xn(),a=p.useRef(null),c=p.useRef(null),u=Xn(),d=Zr(),f=an(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);En(()=>d.group(i),[]),Nm(i,a,[t.value,t.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(pn.div,{ref:er(a,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ts(t,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(Dm.Provider,{value:h},m))))}),YM=p.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=p.useRef(null),s=an(i=>!i.search);return!n&&!s?null:p.createElement(pn.div,{ref:er(o,e),...r,"cmdk-separator":"",role:"separator"})}),XM=p.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,s=Vc(),i=an(u=>u.search),a=an(u=>u.selectedItemId),c=Zr();return p.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),p.createElement(pn.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?t.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),qM=p.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,s=p.useRef(null),i=p.useRef(null),a=an(u=>u.selectedItemId),c=Zr();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(pn.div,{ref:er(s,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Ts(t,u=>p.createElement("div",{ref:er(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),ZM=p.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=t;return p.createElement(Nc,{open:n,onOpenChange:r},p.createElement(_c,{container:i},p.createElement(Oc,{"cmdk-overlay":"",className:o}),p.createElement(Lc,{"aria-label":t.label,"cmdk-dialog":"",className:s},p.createElement(Im,{ref:e,...a}))))}),QM=p.forwardRef((t,e)=>an(n=>n.filtered.count===0)?p.createElement(pn.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),JM=p.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...s}=t;return p.createElement(pn.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ts(t,i=>p.createElement("div",{"aria-hidden":!0},i)))}),Ae=Object.assign(Im,{List:qM,Item:WM,Input:XM,Group:KM,Separator:YM,Dialog:ZM,Empty:QM,Loading:JM});function eE(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function tE(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function km(t){let e=p.useRef(t);return En(()=>{e.current=t}),e}var En=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Gn(t){let e=p.useRef();return e.current===void 0&&(e.current=t()),e}function an(t){let e=Vc(),n=()=>t(e.snapshot());return p.useSyncExternalStore(e.subscribe,n,n)}function Nm(t,e,n,r=[]){let o=p.useRef(),s=Zr();return En(()=>{var i;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(t,a,c),(i=e.current)==null||i.setAttribute(Bn,a),o.current=a}),o}var nE=()=>{let[t,e]=p.useState(),n=Gn(()=>new Map);return En(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function rE(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Ts({asChild:t,children:e},n){return t&&p.isValidElement(e)?p.cloneElement(rE(e),{ref:e.ref},n(e.props.children)):n(e)}var oE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function sE({options:t,value:e,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:u="primary",disabled:d=!1,id:f,className:h,style:m,sx:g,"aria-invalid":y,"aria-describedby":v,"aria-label":x}){const[w,b]=S.useState(!1),[C,P]=S.useState(n??[]),[R,M]=S.useState(""),j=S.useRef(null),T=e??C,E=S.useCallback(D=>{e===void 0&&P(D),r==null||r(D)},[e,r]),N=S.useCallback(D=>{T.includes(D)?E(T.filter(X=>X!==D)):(a==null||T.length<a)&&E([...T,D])},[T,E,a]),O=S.useCallback(D=>E(T.filter(X=>X!==D)),[T,E]),$=S.useMemo(()=>{const D=new Map;for(const X of t)D.set(X.value,X);return D},[t]),V=S.useMemo(()=>{const D=new Map;for(const X of t){const A=X.group??"";D.has(A)||D.set(A,[]),D.get(A).push(X)}return D},[t]),q=D=>{D.key==="Backspace"&&R===""&&T.length>0&&(D.preventDefault(),O(T[T.length-1]))};S.useEffect(()=>{w&&queueMicrotask(()=>{var D;return(D=j.current)==null?void 0:D.focus()})},[w]);const{className:G,style:k,styleTag:F}=ae(g,m,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),L=a!=null&&T.length>=a;return l.jsxs(jc,{open:w,onOpenChange:D=>!d&&b(D),children:[l.jsx(Ac,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-invalid":y,"aria-describedby":v,"aria-label":x,"data-state":w?"open":"closed","data-disabled":d||void 0,id:f,className:G,style:k,onClick:()=>!d&&b(D=>!D),tabIndex:d?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!w&&(D.preventDefault(),b(!0))},children:[F,T.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(D=>{const X=$.get(D);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(X==null?void 0:X.label)??D}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(X==null?void 0:X.label)??D}`,onClick:A=>{A.stopPropagation(),O(D)},children:l.jsx(Wt,{size:12,"aria-hidden":"true"})})]},D)}),l.jsx(Gr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(Dc,{children:l.jsx(Ic,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:l.jsxs(Ae,{shouldFilter:!0,label:"Options",children:[l.jsx(Ae.Input,{ref:j,placeholder:s,value:R,onValueChange:M,onKeyDown:q}),l.jsxs(Ae.List,{children:[l.jsx(Ae.Empty,{children:i}),Array.from(V.entries()).map(([D,X])=>l.jsx(Ae.Group,{heading:D||void 0,children:X.map(A=>{const B=T.includes(A.value),Q=A.disabled||!B&&L;return l.jsxs(Ae.Item,{value:`${A.label} ${A.description??""} ${A.value}`,disabled:Q,onSelect:()=>N(A.value),children:[A.icon&&l.jsx("span",{style:{display:"inline-flex"},children:A.icon}),l.jsx("span",{children:A.label}),A.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:A.description}),B&&l.jsx("span",{className:"cny-check",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]},A.value)})},D||"default"))]})]})})})]})}var iE=Object.defineProperty,Ut=(t,e)=>iE(t,"name",{value:e,configurable:!0}),Bc="Checkbox",[aE,fN]=Ce(Bc),[cE,Gc]=aE(Bc);function _m(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=we({prop:n,defaultProp:o??!1,onChange:c,caller:Bc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:Ft(o)?!1:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(cE,{scope:e,...R,children:Om(f)?f(R):r})}Ut(_m,"CheckboxProvider");var lE="CheckboxTrigger",uE=p.forwardRef(Ut(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},s){const{control:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Gc(lE,e),x=ce(s,f),w=p.useRef(u);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const C=Ut(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[i,h]),l.jsx(te.button,{type:"button",role:"checkbox","aria-checked":Ft(u)?"mixed":u,"aria-required":d,"data-state":zc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:x,onKeyDown:U(n,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:U(r,b=>{g(),h(C=>Ft(C)?!0:!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"CheckboxTrigger")),jd=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(_m,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(uE,{...h,ref:n,__scopeCheckbox:r}),m&&l.jsx(pE,{__scopeCheckbox:r})]})})},"Checkbox")),dE="CheckboxIndicator",fE=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,forceMount:o,...s}=e,i=Gc(dE,r);return l.jsx(ze,{present:o||Ft(i.checked)||i.checked===!0,children:l.jsx(te.span,{"data-state":zc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),hE="CheckboxBubbleInput",pE=p.forwardRef(Ut(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Gc(hE,e),x=ce(o,v),w=fr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,N=a!==P.current;P.current=a;const O=C.current!==c;C.current=c;const $=!(N&&i.current);if(O&&E){b.current=!N;const V=new Event("click",{bubbles:$});M.indeterminate=Ft(c),E.call(M,Ft(c)?!1:c),M.dispatchEvent(V),b.current=!1}},[y,c,i,a]);const R=p.useRef(Ft(c)?!1:c);return l.jsx(te.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:U(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Om(t){return typeof t=="function"}Ut(Om,"isFunction");function Ft(t){return t==="indeterminate"}Ut(Ft,"isIndeterminate");function zc(t){return Ft(t)?"indeterminate":t?"checked":"unchecked"}Ut(zc,"getState");const Ca=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){const a=l.jsx(fE,{children:s.checked==="indeterminate"?l.jsx(HS,{size:12,"aria-hidden":"true"}):l.jsx(rn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:m}=ae(r,n,"checkbox",e);return l.jsxs(jd,{ref:i,className:f,style:h,...s,children:[m,a]})}const{className:c,style:u,styleTag:d}=ae(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(jd,{ref:i,className:H("checkbox",e),...s,children:a}),l.jsx("span",{children:o})]})});var mE=Object.defineProperty,Ge=(t,e)=>mE(t,"name",{value:e,configurable:!0}),Lm="Radio",[gE,$m]=Ce(Lm),[yE,Ms]=gE(Lm);function Fm(t){const{__scopeRadio:e,checked:n=!1,children:r,disabled:o,form:s,name:i,onCheck:a,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=p.useState(null),[m,g]=p.useState(null),y=p.useRef(!1),[v,x]=p.useReducer(C=>C+1,0),w=f?!!s||!!f.closest("form"):!0,b={checked:n,disabled:o,required:c,name:i,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:y,userInteractionCount:v,onUserInteraction:x,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:Ge(()=>a==null?void 0:a(),"onCheck")};return l.jsx(yE,{scope:e,...b,children:Vm(d)?d(b):r})}Ge(Fm,"RadioProvider");var vE="RadioTrigger",xE=p.forwardRef(Ge(function({__scopeRadio:e,onClick:n,...r},o){const{checked:s,disabled:i,value:a,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=Ms(vE,e),g=ce(o,c);return l.jsx(te.button,{type:"button",role:"radio","aria-checked":s,"data-state":Uc(s),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:g,onClick:U(n,y=>{s||(f(),u()),m&&h&&(d.current=y.isPropagationStopped(),d.current||y.stopPropagation())})})},"RadioTrigger")),bE="RadioIndicator",wE=p.forwardRef(Ge(function(e,n){const{__scopeRadio:r,forceMount:o,...s}=e,i=Ms(bE,r);return l.jsx(ze,{present:o||i.checked,children:l.jsx(te.span,{"data-state":Uc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),CE="RadioBubbleInput",SE=p.forwardRef(Ge(function({__scopeRadio:e,onClick:n,...r},o){const{control:s,checked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:y}=Ms(CE,e),v=ce(o,m),x=fr(s),w=p.useRef(!1),b=p.useRef(i),C=p.useRef(y);p.useEffect(()=>{const R=h;if(!R)return;const M=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(M,"checked").set,E=y!==C.current;C.current=y;const N=b.current!==i;b.current=i;const O=!(E&&g.current);if(N&&T){w.current=!E;const $=new Event("click",{bubbles:O});T.call(R,i),R.dispatchEvent($),w.current=!1}},[h,i,g,y]);const P=p.useRef(i);return l.jsx(te.input,{type:"radio","aria-hidden":!0,defaultChecked:P.current,required:a,disabled:c,name:u,value:d,form:f,...r,tabIndex:-1,ref:v,onClick:U(n,R=>{w.current&&R.stopPropagation()}),style:{...r.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function Vm(t){return typeof t=="function"}Ge(Vm,"isFunction");function Uc(t){return t?"checked":"unchecked"}Ge(Uc,"getState");var PE=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Hc="RadioGroup",[RE,hN]=Ce(Hc,[un,$m]),Bm=un(),Es=$m(),[TE,ME]=RE(Hc),EE=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,name:o,form:s,defaultValue:i,value:a,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=e,y=Bm(r),v=Ht(f),[x,w]=we({prop:a,defaultProp:i??null,onChange:m,caller:Hc}),[b,C]=p.useState(null),P=ce(n,C),R=p.useRef(x);return p.useEffect(()=>{const M=s?b==null?void 0:b.ownerDocument.getElementById(s):b==null?void 0:b.closest("form");if(M instanceof HTMLFormElement){const j=Ge(()=>w(R.current),"reset");return M.addEventListener("reset",j),()=>M.removeEventListener("reset",j)}},[b,s,w]),l.jsx(TE,{scope:r,name:o,form:s,required:c,disabled:u,value:x,onValueChange:w,children:l.jsx(ds,{asChild:!0,...y,orientation:d,dir:v,loop:h,children:l.jsx(te.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:P})})})},"RadioGroup")),jE="RadioGroupItemProvider",AE="RadioGroupItemTrigger";function Gm(t){const{__scopeRadioGroup:e,value:n,disabled:r,children:o,internal_do_not_use_render:s}=t,i=ME(jE,e),a=Es(e),c=i.disabled||r;return l.jsx(Fm,{...a,checked:i.value===n,disabled:c,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:s,children:o})}Ge(Gm,"RadioGroupItemProvider");var DE=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Bm(r),i=Es(r),{checked:a,disabled:c}=Ms(AE,i.__scopeRadio),u=p.useRef(null),d=ce(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=Ge(g=>{PE.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=Ge(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),l.jsx(fs,{asChild:!0,...s,focusable:!c,active:a,children:l.jsx(xE,{...i,...o,ref:d,onKeyDown:U(o.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:U(o.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),Ad=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,value:o,disabled:s,...i}=e;return l.jsx(Gm,{__scopeRadioGroup:r,value:o,disabled:s,internal_do_not_use_render:({isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(DE,{...i,ref:n,__scopeRadioGroup:r}),a&&l.jsx(IE,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),IE=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(SE,{...s,...o,ref:n})},"RadioGroupItemBubbleInput")),Dd=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(wE,{...s,...o,ref:n})},"RadioGroupIndicator"));const kE=S.forwardRef(function({orientation:e="vertical",className:n,style:r,...o},s){return l.jsx(EE,{ref:s,className:H("cny-radio-group",e==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),NE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=ae(r,n,"radio",e);return l.jsxs(Ad,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Dd,{})]})}const{className:a,style:c,styleTag:u}=ae(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Ad,{ref:i,className:H("radio",e),...s,children:l.jsx(Dd,{})}),l.jsx("span",{children:o})]})});var _E=Object.defineProperty,cn=(t,e)=>_E(t,"name",{value:e,configurable:!0}),Wc="Switch",[OE,pN]=Ce(Wc),[LE,Kc]=OE(Wc);function zm(t){const{__scopeSwitch:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=we({prop:n,defaultProp:o??!1,onChange:c,caller:Wc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,setChecked:m,disabled:s,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(LE,{scope:e,...R,children:Um(f)?f(R):r})}cn(zm,"SwitchProvider");var $E="SwitchTrigger",FE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,form:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Kc($E,e),x=ce(o,f),w=p.useRef(u);return p.useEffect(()=>{const b=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(b instanceof HTMLFormElement){const C=cn(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[s,i,h]),l.jsx(te.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":Yc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:x,onClick:U(n,b=>{g(),h(C=>!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"SwitchTrigger")),Id=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(zm,{__scopeSwitch:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(FE,{...h,ref:n,__scopeSwitch:r}),m&&l.jsx(GE,{__scopeSwitch:r})]})})},"Switch")),VE="SwitchThumb",kd=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,...o}=e,s=Kc(VE,r);return l.jsx(te.span,{"data-state":Yc(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),BE="SwitchBubbleInput",GE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Kc(BE,e),x=ce(o,v),w=fr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,N=a!==P.current;P.current=a;const O=C.current!==c;C.current=c;const $=!(N&&i.current);if(O&&E){b.current=!N;const V=new Event("click",{bubbles:$});E.call(M,c),M.dispatchEvent(V),b.current=!1}},[y,c,i,a]);const R=p.useRef(c);return l.jsx(te.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:U(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Um(t){return typeof t=="function"}cn(Um,"isFunction");function Yc(t){return t?"checked":"unchecked"}cn(Yc,"getState");const zE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=ae(r,n,"switch",e);return l.jsxs(Id,{ref:i,className:d,style:f,...s,children:[h,l.jsx(kd,{className:"switch-thumb"})]})}const{className:a,style:c,styleTag:u}=ae(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Id,{ref:i,className:H("switch",e),...s,children:l.jsx(kd,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function Uo(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Nd(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function Po(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Pi(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function UE(t,e){return t.getFullYear()===e.getFullYear()}function Mt(t){return new Date(t.getFullYear(),t.getMonth(),1)}function HE(t){return new Date(t.getFullYear(),0,1)}function _d(t){return new Date(Math.floor(t.getFullYear()/10)*10,0,1)}function Ro(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function os(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Rt(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}function Ri(t,e,n,r=0){const o=new Date(t);return o.setHours(e,n,r,0),o}function Ue(t,e,n){return e&&t.getTime()<e.getTime()?new Date(e):n&&t.getTime()>n.getTime()?new Date(n):t}function WE(t,e){const n=Mt(t),r=(n.getDay()-e+7)%7,o=os(n,-r);return Array.from({length:42},(s,i)=>os(o,i))}function KE(t,e){const n=new Intl.DateTimeFormat(t,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=os(r,(s+e)%7);return n.format(i)})}function YE(t,e="short"){const n=new Intl.DateTimeFormat(t,{month:e});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function Od(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function XE(t,e){return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function qE(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Hm(t,e){return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}function Wm(t,e,n,r){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(t)}function ZE(t,e,n,r){return`${Hm(t,e)} · ${Wm(t,e,n,r)}`}function To(t){if(t==null||t==="")return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:new Date(t);const e=new Date(t);return Number.isNaN(e.getTime())?null:e}function Mo(t,e){return t.getTime()<e.getTime()}function Eo(t,e){return t.getTime()>e.getTime()}function jo(t){return t<10?`0${t}`:String(t)}function QE(t){return t||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function JE(t){try{return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function ej(t,e,n,r,o){switch(e){case"year":return XE(t,n);case"month":return qE(t,n);case"time":return Wm(t,n,r,o);case"datetime":return ZE(t,n,r,o);case"date":default:return Hm(t,n)}}function tj(t,e){switch(e){case"year":return HE(t);case"month":return Mt(t);case"date":return Uo(t);default:return new Date(t)}}const nj=S.forwardRef(function({mode:e="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:u,placeholder:d,size:f,color:h="primary",disabled:m=!1,clearable:g=!0,locale:y,weekStartsOn:v=0,hour12:x,showSeconds:w=!1,minuteStep:b=1,secondStep:C=1,format:P,icon:R,required:M=!1,validate:j,error:T,onValidate:E,id:N,className:O,style:$,sx:V,"aria-invalid":q,"aria-describedby":G,dialogLabel:k,name:F,open:L,onOpenChange:D,...X},A){const B=QE(y),Q=x??JE(B),K=S.useId(),W=N??`cny-dp-${K}`,re=`${W}-dialog`,Y=`${W}-hint`,z=S.useMemo(()=>{const _=To(s),Z=a==="future"||a==="current"?Uo(new Date):null;return _&&Z?_.getTime()>Z.getTime()?_:Z:_??Z},[s,a]),I=S.useMemo(()=>{const _=To(i),Z=a==="past"||a==="current"?Nd(new Date):null;return _&&Z?_.getTime()<Z.getTime()?_:Z:_??Z},[i,a]),ne=n!==void 0,[ie,oe]=S.useState(()=>To(r)),se=ne?To(n):ie,Me=L!==void 0,[lt,ht]=S.useState(!1),me=Me?L:lt,Ye=S.useCallback(_=>{Me||ht(_),D==null||D(_)},[Me,D]),ro=S.useMemo(()=>se??Ue(new Date,z,I),[se,z,I]),[ge,Se]=S.useState(()=>Mt(ro)),[be,Ie]=S.useState(()=>ro),$s=e==="month"?"month":e==="year"?"year":"date",[et,gn]=S.useState($s),Fs=S.useRef(null);S.useImperativeHandle(A,()=>Fs.current,[]);const pr=S.useRef(null),Vs=S.useRef(null),vl=S.useRef(null),Bs=S.useRef(null),[by,wy]=S.useState({}),[Cy,Sy]=S.useState(!1);S.useEffect(()=>Sy(!0),[]);const kn=S.useCallback(_=>z&&Mo(_,z)||I&&Eo(_,I)?!0:c?c(_):!1,[z,I,c]),oo=S.useCallback(_=>u?u(_):!1,[u]),Nn=S.useMemo(()=>{if(T)return typeof T=="string"?T:"Invalid";if(M&&!se)return"Required";if(se){const Z=Uo(new Date);if(a==="future"&&Mo(se,Z))return"Must be today or later";if(a==="past"&&Eo(se,Nd(new Date)))return"Must be today or earlier";if(a==="current"&&!Po(se,Z))return"Must be today";if(z&&Mo(se,z))return"Too early";if(I&&Eo(se,I))return"Too late";if(c&&c(se))return"Unavailable date";if(u&&u(se))return"Unavailable time"}const _=j==null?void 0:j(se);return _||null},[T,M,se,a,z,I,c,u,j]),xl=S.useRef(null);S.useEffect(()=>{xl.current!==Nn&&(xl.current=Nn,E==null||E(Nn))},[Nn,E]);const so=Nn!==null,bl=so?"danger":h,Py=se?P?P(se,e):ej(se,e,B,Q,w):"",Ry=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[e],Ty=k??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[e],Yt=S.useCallback(_=>{ne||oe(_),o==null||o(_)},[ne,o]),io=S.useCallback(()=>{var _;Ye(!1),(_=pr.current)==null||_.focus()},[Ye]),My=S.useCallback(_=>{var Z;_.stopPropagation(),Yt(null),(Z=pr.current)==null||Z.focus()},[Yt]),wl=S.useCallback(()=>{if(m)return;const _=se??Ue(new Date,z,I);Se(Mt(_)),Ie(_),gn($s),Ye(!0)},[m,se,z,I,Ye,$s]);S.useEffect(()=>{if(!me)return;const _=Z=>{var he,J;const le=Z.target;(he=Fs.current)!=null&&he.contains(le)||(J=Vs.current)!=null&&J.contains(le)||Ye(!1)};return document.addEventListener("pointerdown",_,!0),()=>document.removeEventListener("pointerdown",_,!0)},[me,Ye]);const ao=S.useCallback(()=>{const _=pr.current,Z=Vs.current;if(!_||!Z)return;const le=_.getBoundingClientRect(),he=Z.offsetHeight||340,J=Z.offsetWidth||264,tt=window.innerHeight,Ve=window.innerWidth,nt=4,Ee=8,Xt=tt-le.bottom,zs=le.top,Zy=Xt<he+nt&&zs>Xt?Math.max(Ee,le.top-nt-he):Math.min(tt-he-Ee,le.bottom+nt),Qy=Math.max(Ee,Math.min(le.left,Ve-J-Ee));wy({position:"fixed",top:Zy,left:Qy,width:J})},[]);S.useLayoutEffect(()=>{me&&ao()},[me,e,ao]),S.useEffect(()=>{if(!me)return;const _=()=>ao();return window.addEventListener("scroll",_,!0),window.addEventListener("resize",_),()=>{window.removeEventListener("scroll",_,!0),window.removeEventListener("resize",_)}},[me,ao]),S.useEffect(()=>{var _,Z;me&&(et==="date"&&(e==="date"||e==="datetime")?(_=vl.current)==null||_.focus():(et==="month"||et==="year")&&((Z=Bs.current)==null||Z.focus()))},[me,be,e,et]);const Cl=S.useCallback(()=>{var _;et==="year"&&e!=="year"?gn("month"):et==="month"&&e!=="month"?gn("date"):(Ye(!1),(_=pr.current)==null||_.focus())},[et,e,Ye]),co=S.useCallback(_=>{const Z=Ue(_,z,I);Ie(Z),Se(le=>Pi(le,Z)?le:Mt(Z))},[z,I]),mr=S.useCallback((_,Z)=>{const le=tj(_,e);if(e!=="time"&&kn(le))return;const he=e==="time"||e==="datetime"?Ri(le,(se??_).getHours(),(se??_).getMinutes(),w?(se??_).getSeconds():0):le;Yt(he),Ie(he),((Z==null?void 0:Z.close)??(e!=="datetime"&&e!=="time"))&&io()},[e,kn,Yt,se,w,io]),lo=S.useCallback((_,Z)=>{const le=se??Ue(new Date,z,I),he=_==="hour"?Z:le.getHours(),J=_==="minute"?Z:le.getMinutes(),tt=_==="second"?Z:w?le.getSeconds():0,Ve=Ri(le,he,J,tt);oo(Ve)||(Yt(Ve),Ie(Ve))},[se,z,I,w,oo,Yt]),_n=S.useCallback(_=>co(os(be,_)),[co,be]),Ey=_=>{switch(_.key){case"ArrowLeft":_.preventDefault(),_n(-1);break;case"ArrowRight":_.preventDefault(),_n(1);break;case"ArrowUp":_.preventDefault(),_n(-7);break;case"ArrowDown":_.preventDefault(),_n(7);break;case"Home":{_.preventDefault();const Z=(be.getDay()-v+7)%7;_n(-Z);break}case"End":{_.preventDefault();const Z=(be.getDay()-v+7)%7;_n(6-Z);break}case"PageUp":_.preventDefault(),co(_.shiftKey?Rt(be,-1):Ro(be,-1));break;case"PageDown":_.preventDefault(),co(_.shiftKey?Rt(be,1):Ro(be,1));break;case"Enter":case" ":_.preventDefault(),mr(be);break;case"Escape":_.preventDefault(),Cl();break}},jy=S.useMemo(()=>WE(ge,v),[ge,v]),Ay=S.useMemo(()=>KE(B,v),[B,v]),Dy=S.useMemo(()=>YE(B,"short"),[B]),Gs=S.useMemo(()=>Uo(new Date),[]),Iy=!z||!Mo(Mt(ge),Mt(z)),ky=!I||!Eo(Mt(ge),Mt(I)),Ny=!z||ge.getFullYear()-1>=z.getFullYear(),_y=!I||ge.getFullYear()+1<=I.getFullYear(),yn=_d(ge).getFullYear(),Oy=!z||yn-10+9>=z.getFullYear(),Ly=!I||yn+10<=I.getFullYear(),$y=e==="time"?!oo(new Date):!kn(Gs),Fy=()=>{if(e==="time"){const _=new Date;if(oo(_))return;const le=Ri(se??_,_.getHours(),_.getMinutes(),w?_.getSeconds():0);Yt(le),Ie(le);return}mr(Gs,{close:e!=="datetime"})},Vy=H("cny-datepicker-trigger","input",bl!=="primary"&&bl,f==="sm"||f==="lg"?f:null,se&&"has-value",me&&"is-open"),By=R??(e==="time"?l.jsx(MS,{size:15}):l.jsx(gS,{size:15})),Sl=(_,Z)=>{let he=!0;switch(_.key){case"ArrowLeft":Ie(Z==="month"?J=>Ue(new Date(ge.getFullYear(),(J.getMonth()+11)%12,Math.min(J.getDate(),28)),z,I):J=>Ue(new Date(J.getFullYear()-1,J.getMonth(),Math.min(J.getDate(),28)),z,I));break;case"ArrowRight":Ie(Z==="month"?J=>Ue(new Date(ge.getFullYear(),(J.getMonth()+1)%12,Math.min(J.getDate(),28)),z,I):J=>Ue(new Date(J.getFullYear()+1,J.getMonth(),Math.min(J.getDate(),28)),z,I));break;case"ArrowUp":Ie(Z==="month"?J=>Ue(new Date(ge.getFullYear(),(J.getMonth()-3+12)%12,Math.min(J.getDate(),28)),z,I):J=>Ue(new Date(J.getFullYear()-3,J.getMonth(),Math.min(J.getDate(),28)),z,I));break;case"ArrowDown":Ie(Z==="month"?J=>Ue(new Date(ge.getFullYear(),(J.getMonth()+3)%12,Math.min(J.getDate(),28)),z,I):J=>Ue(new Date(J.getFullYear()+3,J.getMonth(),Math.min(J.getDate(),28)),z,I));break;case"PageUp":Se(Z==="month"?J=>Rt(J,_.shiftKey?-10:-1):J=>Rt(J,_.shiftKey?-100:-10));break;case"PageDown":Se(Z==="month"?J=>Rt(J,_.shiftKey?10:1):J=>Rt(J,_.shiftKey?100:10));break;case"Enter":case" ":Z==="month"?Pl(new Date(ge.getFullYear(),be.getMonth(),1)):Rl(be.getFullYear());break;case"Escape":Cl();break;default:he=!1}he&&_.preventDefault()};S.useEffect(()=>{if(me&&et==="year"){const _=_d(ge).getFullYear(),Z=be.getFullYear();(Z<_-1||Z>_+10)&&Se(new Date(Z,0,1))}},[me,et,be,ge]);const Pl=_=>{e==="month"?mr(_):(Se(Mt(_)),Ie(Ue(_,z,I)),gn("date"))},Rl=_=>{if(e==="year")mr(new Date(_,0,1));else{const Z=new Date(_,ge.getMonth(),1);Se(Z),Ie(Ue(new Date(_,be.getMonth(),Math.min(be.getDate(),28)),z,I)),gn("month")}},Gy=()=>{const _=be.getMonth();return Dy.map((Z,le)=>{const he=new Date(ge.getFullYear(),le,1),J=!!se&&Pi(he,se)&&UE(he,se),tt=he.getMonth()===ge.getMonth()&&e!=="month",Ve=le===_,nt=kn(he);return l.jsx("button",{ref:Ve?Bs:void 0,type:"button",tabIndex:Ve?0:-1,className:H("cny-datepicker-chip",J&&"is-selected",tt&&!J&&"is-current"),disabled:nt,onClick:()=>Pl(he),onFocus:()=>Ie(new Date(ge.getFullYear(),le,Math.min(be.getDate(),28))),children:Z},le)})},zy=()=>{const _=yn-1,Z=be.getFullYear();return Array.from({length:12},(le,he)=>{const J=_+he,tt=new Date(J,0,1),Ve=!!se&&se.getFullYear()===J,nt=J===ge.getFullYear()&&e!=="year",Ee=J===Z,Xt=kn(tt),zs=J<yn||J>=yn+10;return l.jsx("button",{ref:Ee?Bs:void 0,type:"button",tabIndex:Ee?0:-1,className:H("cny-datepicker-chip",Ve&&"is-selected",nt&&!Ve&&"is-current",zs&&"is-outside"),disabled:Xt,onClick:()=>Rl(J),onFocus:()=>Ie(new Date(J,be.getMonth(),Math.min(be.getDate(),28))),children:J},J)})},Uy=S.useRef(null),Tl=S.useRef(null),Ml=S.useRef(null),El=()=>{const _=se??Ue(new Date,z,I),Z=_.getHours(),le=_.getMinutes(),he=_.getSeconds(),J=Z>=12,tt=Q?Z%12===0?12:Z%12:Z,Ve=Ee=>{const Xt=Q?J?Ee===12?12:Ee+12:Ee===12?0:Ee:Ee;lo("hour",Xt)},nt=Ee=>{const Xt=Ee?Z<12?Z+12:Z:Z>=12?Z-12:Z;lo("hour",Xt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Ti,{ref:Uy,ariaLabel:"Hour",value:tt,min:Q?1:0,max:Q?12:23,step:1,nextRef:Tl,onChange:Ve}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:Tl,ariaLabel:"Minute",value:le-le%Math.max(1,b),min:0,max:59,step:Math.max(1,b),nextRef:w?Ml:void 0,onChange:Ee=>lo("minute",Ee)}),w&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:Ml,ariaLabel:"Second",value:he-he%Math.max(1,C),min:0,max:59,step:Math.max(1,C),onChange:Ee=>lo("second",Ee)})]}),Q&&l.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[l.jsx("button",{type:"button",role:"radio","aria-checked":!J,className:H("cny-dp-ampm-btn",!J&&"is-active"),onClick:()=>nt(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":J,className:H("cny-dp-ampm-btn",J&&"is-active"),onClick:()=>nt(!0),children:"PM"})]})]})})},Hy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!Iy,onClick:()=>Se(_=>Ro(_,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${Od(ge,B)})`,onClick:()=>gn("month"),children:Od(ge,B)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!ky,onClick:()=>Se(_=>Ro(_,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:Ey,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:Ay.map((_,Z)=>l.jsx("span",{role:"columnheader","aria-label":_,className:"cny-datepicker-weekday",children:_.slice(0,2)},Z))}),Array.from({length:6},(_,Z)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:jy.slice(Z*7,Z*7+7).map(le=>{const he=!Pi(le,ge),J=Po(le,se),tt=Po(le,Gs),Ve=Po(le,be),nt=kn(le);return l.jsx("button",{ref:Ve?vl:void 0,type:"button",role:"gridcell",tabIndex:Ve?0:-1,"aria-selected":J,"aria-current":tt?"date":void 0,"aria-disabled":nt||void 0,disabled:nt,className:H("cny-datepicker-cell",he&&"is-outside",J&&"is-selected",tt&&"is-today"),onClick:()=>mr(le),onFocus:()=>Ie(le),children:le.getDate()},le.toISOString())})},Z))]})]}),Wy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!Ny,onClick:()=>Se(_=>Rt(_,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${ge.getFullYear()})`,onClick:()=>gn("year"),children:ge.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!_y,onClick:()=>Se(_=>Rt(_,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:_=>Sl(_,"month"),children:Gy()})]}),Ky=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!Oy,onClick:()=>Se(_=>Rt(_,-10)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${yn} – ${yn+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Ly,onClick:()=>Se(_=>Rt(_,10)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:_=>Sl(_,"year"),children:zy()})]}),{className:Yy,style:Xy,styleTag:qy}=ae(V,$,"cny-datepicker",`mode-${e}`,m&&"is-disabled",O);return l.jsxs("div",{ref:Fs,className:Yy,style:Xy,...X,children:[qy,F&&l.jsx("input",{type:"hidden",name:F,value:se?se.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:pr,type:"button",id:W,className:Vy,"aria-haspopup":"dialog","aria-expanded":me,"aria-controls":me?re:void 0,"aria-invalid":q||so,"aria-describedby":H(G,so?Y:void 0)||void 0,"aria-required":M||void 0,disabled:m,onClick:wl,onKeyDown:_=>{_.key==="ArrowDown"||_.key==="Enter"||_.key===" "?(_.preventDefault(),wl()):_.key==="Escape"&&me&&(_.preventDefault(),Ye(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:By}),l.jsx("span",{className:H("cny-datepicker-value",!se&&"is-placeholder"),children:Py||Ry}),g&&se&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:My,onPointerDown:_=>_.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})})]}),so&&T!==!1&&l.jsx("span",{id:Y,className:"cny-datepicker-error",role:"alert",children:typeof T=="string"?T:T??Nn}),me&&Cy&&Da.createPortal(l.jsxs("div",{ref:Vs,id:re,role:"dialog","aria-modal":"false","aria-label":Ty,className:H("cny-datepicker-panel",`is-${e}`),style:by,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(e==="date"||e==="datetime")&&et==="date"&&Hy(),(e==="date"||e==="datetime"||e==="month")&&et==="month"&&Wy(),(e==="date"||e==="datetime"||e==="month"||e==="year")&&et==="year"&&Ky(),e==="time"&&El(),e==="datetime"&&et==="date"&&El()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!$y,onClick:Fy,children:e==="time"?"Now":e==="year"?"This year":e==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),g&&se&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{Yt(null),io()},children:"Clear"}),(e==="datetime"||e==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:io,children:"Done"})]})]}),document.body)]})}),Ti=S.forwardRef(function({value:e,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=S.useRef(null);S.useImperativeHandle(c,()=>u.current,[]);const[d,f]=S.useState(()=>jo(e)),h=S.useRef(!1);S.useEffect(()=>{h.current||f(jo(e))},[e]);const m=S.useCallback(x=>{if(!Number.isFinite(x))return;let w=Math.max(n,Math.min(r,x));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),a(w),f(jo(w))},[n,r,o,a]),g=()=>{const x=e+o;m(x>r?n:x)},y=()=>{const x=e-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),g();break;case"ArrowDown":x.preventDefault(),y();break;case"PageUp":x.preventDefault(),m(e+o*5);break;case"PageDown":x.preventDefault(),m(e-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?g():x.deltaY>0&&y())},children:[l.jsx("input",{ref:u,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:d,"aria-label":s,"aria-valuenow":e,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var b;const w=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(w),w.length===2){const C=parseInt(w,10);Number.isFinite(C)&&C>=n&&C<=r&&(m(C),(b=i==null?void 0:i.current)==null||b.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f(jo(e))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(yp,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(Gr,{size:10,"aria-hidden":"true"})})]})]})});function rj({hotkey:t=!0}={}){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(!t)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),{open:e,setOpen:n,toggle:()=>n(r=>!r)}}function oj({open:t,onOpenChange:e,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:u}){const d=f=>{var h;f.disabled||((h=f.onSelect)==null||h.call(f),c==null||c(f),e(!1))};return l.jsxs(Ae.Dialog,{open:t,onOpenChange:e,label:o,contentClassName:H("cny-cmdk-content",u),children:[l.jsxs(sm,{children:[l.jsx($c,{children:o}),l.jsx(Fc,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Pp,{size:16,"aria-hidden":"true"}),l.jsx(Ae.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(Ae.List,{className:"cny-cmdk-list",children:[l.jsx(Ae.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(Ae.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(Ae.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function sj({onClick:t,label:e="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:t,className:H("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(Pp,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:e}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let ij=0;const aj=()=>`cny-toast-${Date.now().toString(36)}-${++ij}`,Km=S.createContext(null),cj={default:null,success:l.jsx(bp,{size:16,"aria-hidden":"true"}),info:l.jsx(Cp,{size:16,"aria-hidden":"true"}),warning:l.jsx(Rp,{size:16,"aria-hidden":"true"}),danger:l.jsx(xp,{size:16,"aria-hidden":"true"}),loading:l.jsx(Sp,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function lj({children:t,position:e="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=S.useState([]),[a,c]=S.useState(!1);S.useEffect(()=>c(!0),[]);const u=S.useCallback(y=>{i(v=>v.map(x=>y==null||x.id===y?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>y==null?!1:x.id!==y||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(y==null||x.id===y)).forEach(x=>{var w;return(w=x.onDismiss)==null?void 0:w.call(x)}),v.filter(x=>!x.exiting||y!=null&&x.id!==y)))},200)},[]),d=S.useCallback(y=>{const v=y.id??aj(),x={id:v,title:y.title,description:y.description,action:y.action,icon:y.icon,variant:y.variant??"default",duration:y.duration??n,dismissible:y.dismissible??!0,onDismiss:y.onDismiss,sx:y.sx};return i(w=>{const C=[...w.filter(P=>P.id!==v),x];return C.length>r?C.slice(C.length-r):C}),v},[n,r]),f=S.useCallback((y,v)=>{i(x=>x.map(w=>w.id===y?{...w,...v,variant:v.variant??w.variant,duration:v.duration??w.duration,dismissible:v.dismissible??w.dismissible}:w))},[]),h=S.useMemo(()=>{const y=(v=>d(typeof v=="string"?{title:v}:v));return y.success=(v,x)=>d({...x,title:v,variant:"success"}),y.info=(v,x)=>d({...x,title:v,variant:"info"}),y.warning=(v,x)=>d({...x,title:v,variant:"warning"}),y.error=(v,x)=>d({...x,title:v,variant:"danger"}),y.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),y},[d]),m=S.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),g=e.startsWith("top-");return l.jsxs(Km.Provider,{value:m,children:[t,a&&Da.createPortal(l.jsx("ol",{className:H("cny-toast-viewport",`pos-${e}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(g?[...s].reverse():s).map(y=>l.jsx(uj,{toast:y,onDismiss:()=>u(y.id)},y.id))}),document.body)]})}function uj({toast:t,onDismiss:e}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=t,[d,f]=S.useState(!1),h=S.useRef(null);S.useEffect(()=>{if(!t.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(e,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,e,t.exiting]);const m=n==="danger"||n==="warning"?"alert":"status",g=i!==!1,y=i!==void 0&&i!==!1?i:cj[n],{className:v,style:x,styleTag:w}=ae(u,void 0,"cny-toast",n,t.exiting&&"is-exiting");return l.jsxs("li",{role:m,"aria-atomic":"true",className:v,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[w,g&&y&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"cny-toast-body",children:[r!=null&&l.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&l.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&l.jsx("div",{className:"cny-toast-action",children:s}),c&&l.jsx("button",{type:"button",className:"cny-toast-close","aria-label":"Dismiss",onClick:e,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}function dj(){const t=S.useContext(Km);if(!t)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return t}const Ym=S.forwardRef(function({title:e,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:m,styleTag:g}=ae(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Nc,{...d,children:l.jsxs(_c,{children:[l.jsx(Oc,{className:"cny-dialog-overlay"}),l.jsxs(Lc,{ref:f,className:h,style:m,children:[g,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx($c,{className:"cny-dialog-title",children:e}),n&&l.jsx(Fc,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Ps,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-dialog-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-dialog-footer",children:o})]})]})})}),fj=Pm,hj=Ps;function Xm({open:t,onOpenChange:e,title:n,message:r,children:o,confirmLabel:s="Confirm",cancelLabel:i="Cancel",danger:a=!1,loading:c=!1,onConfirm:u,onCancel:d,className:f,style:h,sx:m}){const g=()=>{d==null||d(),e(!1)};return l.jsx(Ym,{open:t,onOpenChange:e,size:"sm",title:n,className:H("cny-confirm",f),style:h,sx:m,footer:l.jsxs(l.Fragment,{children:[l.jsx(Er,{variant:"ghost",color:"primary",onClick:g,disabled:c,children:i}),l.jsx(Er,{variant:"solid",color:a?"danger":"primary",loading:c,onClick:u,children:s})]}),children:o??l.jsx("p",{className:"cny-confirm-message",children:r})})}function pj(){const[t,e]=S.useState(null),n=S.useCallback(i=>new Promise(a=>{e({...i,resolve:a})}),[]),r=S.useCallback(i=>{i||e(a=>(a==null||a.resolve(!1),null))},[]),o=S.useCallback(()=>{e(i=>(i==null||i.resolve(!0),null))},[]),s=t?l.jsx(Xm,{open:!0,onOpenChange:r,title:t.title,message:t.message,confirmLabel:t.confirmLabel,cancelLabel:t.cancelLabel,danger:t.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const mj=S.forwardRef(function({title:e,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:m,style:g,styleTag:y}=ae(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Nc,{...f,children:l.jsxs(_c,{children:[l.jsx(Oc,{className:"cny-drawer-overlay"}),l.jsxs(Lc,{ref:h,className:m,style:g,children:[y,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx($c,{className:"cny-drawer-title",children:e}),n&&l.jsx(Fc,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Ps,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-drawer-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-drawer-footer",children:o})]})]})})}),gj=Pm,yj=Ps;var vj=Object.defineProperty,ue=(t,e)=>vj(t,"name",{value:e,configurable:!0}),Sa=["Enter"," "],xj=["ArrowDown","PageUp","Home"],qm=["ArrowUp","PageDown","End"],bj=[...xj,...qm],wj={ltr:[...Sa,"ArrowRight"],rtl:[...Sa,"ArrowLeft"]},Cj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},js="Menu",[kr,Sj,Pj]=ar(js),[In,As]=Ce(js,[Pj,dn,un]),Ds=dn(),Zm=un(),[Qm,mn]=In(js),[Rj,Qr]=In(js),Tj=ue(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=Ds(e),[c,u]=p.useState(null),d=p.useRef(!1),f=qe(s),h=Ht(o);return p.useEffect(()=>{const m=ue(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=ue(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=ue(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),l.jsx(Hr,{...a,children:l.jsx(Qm,{scope:e,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(Rj,{scope:e,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),Jm=p.forwardRef(ue(function(e,n){const{__scopeMenu:r,...o}=e,s=Ds(r);return l.jsx(Wr,{...s,...o,ref:n})},"MenuAnchor")),eg="MenuPortal",[Mj,tg]=In(eg,{forceMount:void 0}),Ej=ue(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=mn(eg,e);return l.jsx(Mj,{scope:e,forceMount:n,children:l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:r})})})},"MenuPortal"),vt="MenuContent",[jj,Xc]=In(vt),Aj=p.forwardRef(ue(function(e,n){const r=tg(vt,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=mn(vt,e.__scopeMenu),a=Qr(vt,e.__scopeMenu);return l.jsx(kr.Provider,{scope:e.__scopeMenu,children:l.jsx(ze,{present:o||i.open,children:l.jsx(kr.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(Dj,{...s,ref:n}):l.jsx(Ij,{...s,ref:n})})})})},"MenuContent")),Dj=p.forwardRef(ue(function(e,n){const r=mn(vt,e.__scopeMenu),o=p.useRef(null),s=ce(n,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(qc,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Ij=p.forwardRef(ue(function(e,n){const r=mn(vt,e.__scopeMenu);return l.jsx(qc,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),kj=Nt("MenuContent.ScrollLock"),qc=p.forwardRef(ue(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:y,...v}=e,x=mn(vt,r),w=Qr(vt,r),b=Ds(r),C=Zm(r),P=Sj(r),[R,M]=p.useState(null),j=p.useRef(null),T=ce(n,j,x.onContentChange),E=p.useRef(0),N=p.useRef(""),O=p.useRef(0),$=p.useRef(null),V=p.useRef("right"),q=p.useRef(0),G=y?Yr:p.Fragment,k=y?{as:kj,allowPinchZoom:!0}:void 0,F=ue(D=>{var Y,z;const X=N.current+D,A=P().filter(I=>!I.disabled),B=document.activeElement,Q=(Y=A.find(I=>I.ref.current===B))==null?void 0:Y.textValue,K=A.map(I=>I.textValue),W=lg(K,X,Q),re=(z=A.find(I=>I.textValue===W))==null?void 0:z.ref.current;ue((function I(ne){N.current=ne,window.clearTimeout(E.current),ne!==""&&(E.current=window.setTimeout(()=>I(""),1e3))}),"updateSearch")(X),re&&setTimeout(()=>re.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(E.current),[]),lr();const L=p.useCallback(D=>{var A,B;return V.current===((A=$.current)==null?void 0:A.side)&&dg(D,(B=$.current)==null?void 0:B.area)},[]);return l.jsx(jj,{scope:r,searchRef:N,onItemEnter:p.useCallback(D=>{L(D)&&D.preventDefault()},[L]),onItemLeave:p.useCallback(D=>{var X;L(D)||((X=j.current)==null||X.focus(),M(null))},[L]),onTriggerLeave:p.useCallback(D=>{L(D)&&D.preventDefault()},[L]),pointerGraceTimerRef:O,onPointerGraceIntentChange:p.useCallback(D=>{$.current=D},[]),children:l.jsx(G,{...k,children:l.jsx(hs,{asChild:!0,trapped:s,onMountAutoFocus:U(i,D=>{var X;D.preventDefault(),(X=j.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:l.jsx(ds,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:M,onEntryFocus:U(u,D=>{w.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(xs,{role:"menu","aria-orientation":"vertical","data-state":Qc(x.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:U(v.onKeyDown,D=>{const A=D.target.closest("[data-radix-menu-content]")===D.currentTarget,B=D.ctrlKey||D.altKey||D.metaKey,Q=D.key.length===1;A&&(D.key==="Tab"&&D.preventDefault(),!B&&Q&&F(D.key));const K=j.current;if(D.target!==K||!bj.includes(D.key))return;D.preventDefault();const re=P().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);qm.includes(D.key)&&re.reverse(),ag(re)}),onBlur:U(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),N.current="")}),onPointerMove:U(e.onPointerMove,tr(D=>{const X=D.target,A=q.current!==D.clientX;if(D.currentTarget.contains(X)&&A){const B=D.clientX>q.current?"right":"left";V.current=B,q.current=D.clientX}}))})})})})})})},"MenuContentImpl")),Nj=p.forwardRef(ue(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(te.div,{role:"group",...o,ref:n})},"MenuGroup")),_j=p.forwardRef(ue(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(te.div,{...o,ref:n})},"MenuLabel")),Pa="MenuItem",Ld="menu.itemSelect",Zc=p.forwardRef(ue(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=p.useRef(null),a=Qr(Pa,e.__scopeMenu),c=Xc(Pa,e.__scopeMenu),u=ce(n,i),d=p.useRef(!1),f=ue(()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(Ld,{bubbles:!0,cancelable:!0});h.addEventListener(Ld,g=>o==null?void 0:o(g),{once:!0}),lc(h,m),m.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return l.jsx(ng,{...s,ref:u,disabled:r,onClick:U(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:U(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:U(e.onKeyDown,h=>{r||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||Sa.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),ng=p.forwardRef(ue(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=Xc(Pa,r),c=Zm(r),u=p.useRef(null),d=ce(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const y=u.current;y&&g((y.textContent??"").trim())},[i.children]),l.jsx(kr.ItemSlot,{scope:r,disabled:o,textValue:s??m,children:l.jsx(fs,{asChild:!0,...c,focusable:!o,children:l.jsx(te.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:U(e.onPointerMove,tr(y=>{o?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,tr(y=>a.onItemLeave(y))),onFocus:U(e.onFocus,()=>h(!0)),onBlur:U(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Oj=p.forwardRef(ue(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return l.jsx(og,{scope:e.__scopeMenu,checked:r,children:l.jsx(Zc,{role:"menuitemcheckbox","aria-checked":Nr(r)?"mixed":r,...s,ref:n,"data-state":Is(r),onSelect:U(s.onSelect,()=>o==null?void 0:o(Nr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Lj="MenuRadioGroup",[$j,Fj]=In(Lj,{value:void 0,onValueChange:ue(()=>{},"onValueChange")}),Vj=p.forwardRef(ue(function(e,n){const{value:r,onValueChange:o,...s}=e,i=qe(o);return l.jsx($j,{scope:e.__scopeMenu,value:r,onValueChange:i,children:l.jsx(Nj,{...s,ref:n})})},"MenuRadioGroup")),Bj="MenuRadioItem",Gj=p.forwardRef(ue(function(e,n){const{value:r,...o}=e,s=Fj(Bj,e.__scopeMenu),i=r===s.value;return l.jsx(og,{scope:e.__scopeMenu,checked:i,children:l.jsx(Zc,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":Is(i),onSelect:U(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),rg="MenuItemIndicator",[og,zj]=In(rg,{checked:!1}),Uj=p.forwardRef(ue(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=zj(rg,r);return l.jsx(ze,{present:o||Nr(i.checked)||i.checked===!0,children:l.jsx(te.span,{...s,ref:n,"data-state":Is(i.checked)})})},"MenuItemIndicator")),Hj=p.forwardRef(ue(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(te.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),sg="MenuSub",[Wj,ig]=In(sg),Kj=ue(t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,s=mn(sg,e),i=Ds(e),[a,c]=p.useState(null),[u,d]=p.useState(null),f=qe(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Hr,{...i,children:l.jsx(Qm,{scope:e,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(Wj,{scope:e,contentId:$e(),triggerId:$e(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),Ao="MenuSubTrigger",Yj=p.forwardRef(ue(function(e,n){const r=mn(Ao,e.__scopeMenu),o=Qr(Ao,e.__scopeMenu),s=ig(Ao,e.__scopeMenu),i=Xc(Ao,e.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=ce(n,s.onTriggerChange);return l.jsx(Jm,{asChild:!0,...d,children:l.jsx(ng,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Qc(r.open),...e,ref:h,onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,tr(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:U(e.onPointerLeave,tr(m=>{var y,v;f();const g=(y=r.content)==null?void 0:y.getBoundingClientRect();if(g){const x=(v=r.content)==null?void 0:v.dataset.side,w=x==="right",b=w?-5:5,C=g[w?"left":"right"],P=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x:C,y:g.top},{x:P,y:g.top},{x:P,y:g.bottom},{x:C,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,m=>{var y;e.disabled||m.target!==m.currentTarget||i.searchRef.current!==""&&m.key===" "||wj[o.dir].includes(m.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),m.preventDefault())})})})},"MenuSubTrigger")),Xj="MenuSubContent",qj=p.forwardRef(ue(function(e,n){const r=tg(vt,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=e,a=mn(vt,e.__scopeMenu),c=Qr(vt,e.__scopeMenu),u=ig(Xj,e.__scopeMenu),d=p.useRef(null),f=ce(n,d);return l.jsx(kr.Provider,{scope:e.__scopeMenu,children:l.jsx(ze,{present:o||a.open,children:l.jsx(kr.Slot,{scope:e.__scopeMenu,children:l.jsx(qc,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:U(e.onFocusOutside,h=>{h.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:U(e.onKeyDown,h=>{var y;const m=h.currentTarget.contains(h.target),g=Cj[c.dir].includes(h.key);m&&g&&(a.onOpenChange(!1),(y=u.trigger)==null||y.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function Qc(t){return t?"open":"closed"}ue(Qc,"getOpenState");function Nr(t){return t==="indeterminate"}ue(Nr,"isIndeterminate");function Is(t){return Nr(t)?"indeterminate":t?"checked":"unchecked"}ue(Is,"getCheckedState");function ag(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}ue(ag,"focusFirst");function cg(t,e){return t.map((n,r)=>t[(e+r)%t.length])}ue(cg,"wrapArray");function lg(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=cg(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}ue(lg,"getNextMatch");function ug(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}ue(ug,"isPointInPolygon");function dg(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return ug(n,e)}ue(dg,"isPointerInGraceArea");function tr(t){return e=>e.pointerType==="mouse"?t(e):void 0}ue(tr,"whenMouse");var fg=Tj,hg=Jm,pg=Ej,mg=Aj,gg=_j,yg=Zc,vg=Oj,xg=Vj,bg=Gj,wg=Uj,Cg=Hj,Sg=Kj,Pg=Yj,Rg=qj,Zj=Object.defineProperty,Ze=(t,e)=>Zj(t,"name",{value:e,configurable:!0}),Jc="DropdownMenu",[Qj,mN]=Ce(Jc,[As]),Qe=As(),[Jj,Tg]=Qj(Jc),eA=Ze(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=Qe(e),u=p.useRef(null),[d,f]=we({prop:o,defaultProp:s??!1,onChange:i,caller:Jc});return l.jsx(Jj,{scope:e,triggerId:$e(),triggerRef:u,contentId:$e(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(fg,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),tA="DropdownMenuTrigger",nA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=Tg(tA,r),a=Qe(r),c=ce(n,i.triggerRef);return l.jsx(hg,{asChild:!0,...a,children:l.jsx(te.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:U(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:U(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),rA=Ze(t=>{const{__scopeDropdownMenu:e,...n}=t,r=Qe(e);return l.jsx(pg,{...r,...n})},"DropdownMenuPortal"),oA="DropdownMenuContent",sA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Tg(oA,r),i=Qe(r),a=p.useRef(!1);return l.jsx(mg,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:U(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:U(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),iA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(gg,{...s,...o,ref:n})},"DropdownMenuLabel")),aA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(yg,{...s,...o,ref:n})},"DropdownMenuItem")),cA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(vg,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),lA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(xg,{...s,...o,ref:n})},"DropdownMenuRadioGroup")),uA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(bg,{...s,...o,ref:n})},"DropdownMenuRadioItem")),dA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(wg,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),fA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(Cg,{...s,...o,ref:n})},"DropdownMenuSeparator")),hA=Ze(t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:s}=t,i=Qe(e),[a,c]=we({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(Sg,{...i,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),pA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(Pg,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),mA=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(Rg,{...s,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),gA=eA,yA=nA,Mg=rA,vA=sA,xA=iA,bA=aA,wA=cA,CA=lA,SA=uA,Eg=dA,PA=fA,RA=hA,TA=pA,MA=mA;const EA=gA,jA=yA,AA=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=ae(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(Mg,{children:l.jsxs(vA,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),DA=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(bA,{ref:a,className:H("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),IA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(wA,{ref:s,className:H("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Eg,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),kA=CA,NA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(SA,{ref:s,className:H("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Eg,{children:l.jsx(wp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),_A=S.forwardRef(function({className:e,...n},r){return l.jsx(xA,{ref:r,className:H("cny-menu-label",e),...n})}),OA=S.forwardRef(function({className:e,...n},r){return l.jsx(PA,{ref:r,className:H("cny-menu-separator",e),...n})}),LA=RA,$A=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(TA,{ref:s,className:H("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),FA=S.forwardRef(function({className:e,...n},r){return l.jsx(Mg,{children:l.jsx(MA,{ref:r,className:H("cny-menu-content",e),...n})})});var VA=Object.defineProperty,Fe=(t,e)=>VA(t,"name",{value:e,configurable:!0}),el="ContextMenu",[BA,gN]=Ce(el,[As]),Je=As(),[GA,jg]=BA(el),zA=Fe(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=t,a=p.useRef(!1),[c,u]=we({prop:o,defaultProp:!1,onChange:r,caller:el}),d=Je(e);return l.jsx(GA,{scope:e,open:c,onOpenChange:u,modal:i,hasInteractedRef:a,children:l.jsx(fg,{...d,dir:s,open:c,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),UA="ContextMenuTrigger",HA=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=e,i=jg(UA,r),a=Je(r),[c,u]=p.useState({x:0,y:0}),d=p.useMemo(()=>({current:{getBoundingClientRect:Fe(()=>DOMRect.fromRect({width:0,height:0,...c}),"getBoundingClientRect")}}),[c]),f=p.useRef(0),h=p.useCallback(()=>window.clearTimeout(f.current),[]),m=Fe(g=>{i.hasInteractedRef.current=!0,u({x:g.clientX,y:g.clientY}),i.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>h,[h]),p.useEffect(()=>void(o&&h()),[o,h]),l.jsxs(l.Fragment,{children:[l.jsx(hg,{...a,virtualRef:d}),l.jsx(te.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:U(e.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:o?e.onPointerDown:U(e.onPointerDown,xr(g=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>m(g),700)})),onPointerMove:o?e.onPointerMove:U(e.onPointerMove,xr(h)),onPointerCancel:o?e.onPointerCancel:U(e.onPointerCancel,xr(h)),onPointerUp:o?e.onPointerUp:U(e.onPointerUp,xr(h))})]})},"ContextMenuTrigger")),WA=Fe(t=>{const{__scopeContextMenu:e,...n}=t,r=Je(e);return l.jsx(pg,{...r,...n})},"ContextMenuPortal"),KA="ContextMenuContent",YA=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=jg(KA,r),i=Je(r),a=p.useRef(!1);return l.jsx(mg,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),XA=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(gg,{...s,...o,ref:n})},"ContextMenuLabel")),qA=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(yg,{...s,...o,ref:n})},"ContextMenuItem")),ZA=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(vg,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),QA=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(xg,{...s,...o,ref:n})},"ContextMenuRadioGroup")),JA=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(bg,{...s,...o,ref:n})},"ContextMenuRadioItem")),eD=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(wg,{...s,...o,ref:n})},"ContextMenuItemIndicator")),tD=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(Cg,{...s,...o,ref:n})},"ContextMenuSeparator")),nD="ContextMenuSub",rD=Fe(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:s}=t,i=Je(e),[a,c]=we({prop:o,defaultProp:s??!1,onChange:r,caller:nD});return l.jsx(Sg,{...i,open:a,onOpenChange:c,children:n})},"ContextMenuSub"),oD=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(Pg,{...s,...o,ref:n})},"ContextMenuSubTrigger")),sD=p.forwardRef(Fe(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(Rg,{...s,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function xr(t){return e=>e.pointerType!=="mouse"?t(e):void 0}Fe(xr,"whenTouchOrPen");var iD=zA,aD=HA,Ag=WA,cD=YA,lD=XA,uD=qA,dD=ZA,fD=QA,hD=JA,Dg=eD,pD=tD,mD=rD,gD=oD,yD=sD;const vD=iD,xD=aD,bD=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...a},c){const{className:u,style:d,styleTag:f}=ae(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(Ag,{children:l.jsxs(cD,{ref:c,className:u,style:d,alignOffset:s,...a,children:[f,i]})})}),wD=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(uD,{ref:a,className:H("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),CD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(dD,{ref:s,className:H("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),SD=fD,PD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(hD,{ref:s,className:H("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(wp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),RD=S.forwardRef(function({className:e,...n},r){return l.jsx(lD,{ref:r,className:H("cny-menu-label",e),...n})}),TD=S.forwardRef(function({className:e,...n},r){return l.jsx(pD,{ref:r,className:H("cny-menu-separator",e),...n})}),MD=mD,ED=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(gD,{ref:s,className:H("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),jD=S.forwardRef(function({className:e,...n},r){return l.jsx(Ag,{children:l.jsx(yD,{ref:r,className:H("cny-menu-content",e),...n})})});var AD=Object.defineProperty,De=(t,e)=>AD(t,"name",{value:e,configurable:!0}),[tl,yN]=Ce("Tooltip",[dn]),ks=dn(),DD="TooltipProvider",ID=700,Ra="tooltip.open",[kD,nl]=tl(DD),ND=De(t=>{const{__scopeTooltip:e,delayDuration:n=ID,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(kD,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),Ta="Tooltip",[_D,Jr]=tl(Ta),OD=De(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,c=nl(Ta,t.__scopeTooltip),u=ks(e),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=$e(),y=p.useRef(0),v=i??c.disableHoverableContent,x=a??c.delayDuration,w=p.useRef(!1),[b,C]=we({prop:r,defaultProp:o??!1,onChange:De(E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ra))):c.onClose(),s==null||s(E)},"onChange"),caller:Ta}),P=p.useMemo(()=>b?w.current?"delayed-open":"instant-open":"closed",[b]),R=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,C(!0)},[C]),M=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),j=p.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,C(!0),y.current=0},x)},[x,C]);p.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const T=h??g;return l.jsx(Hr,{...u,children:l.jsx(_D,{scope:e,contentId:T,setContentId:m,open:b,stateAttribute:P,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?j():R()},[c.isOpenDelayedRef,j,R]),onTriggerLeave:p.useCallback(()=>{v?M():(window.clearTimeout(y.current),y.current=0)},[M,v]),onOpen:R,onClose:M,disableHoverableContent:v,children:n})})},"Tooltip"),$d="TooltipTrigger",LD=p.forwardRef(De(function(e,n){const{__scopeTooltip:r,...o}=e,s=Jr($d,r),i=nl($d,r),a=ks(r),c=p.useRef(null),u=ce(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(Wr,{asChild:!0,...a,children:l.jsx(te.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:U(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:U(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:U(e.onBlur,s.onClose),onClick:U(e.onClick,s.onClose)})})},"TooltipTrigger")),Ig="TooltipPortal",[$D,FD]=tl(Ig,{forceMount:void 0}),VD=De(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=Jr(Ig,e);return l.jsx($D,{scope:e,forceMount:n,children:l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),_r="TooltipContent",BD=p.forwardRef(De(function(e,n){const r=FD(_r,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=Jr(_r,e.__scopeTooltip);return l.jsx(ze,{present:o||a.open,children:a.disableHoverableContent?l.jsx(kg,{side:s,...i,ref:n}):l.jsx(GD,{side:s,...i,ref:n})})},"TooltipContent")),GD=p.forwardRef(De(function(e,n){const r=Jr(_r,e.__scopeTooltip),o=nl(_r,e.__scopeTooltip),s=p.useRef(null),i=ce(n,s),[a,c]=p.useState(null),{trigger:u,onClose:d}=r,f=s.current,{onPointerInTransitChange:h}=o,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((y,v)=>{const x=y.currentTarget,w={x:y.clientX,y:y.clientY},b=Ng(w,x.getBoundingClientRect()),C=_g(w,b),P=Og(v.getBoundingClientRect()),R=$g([...C,...P]);c(R),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const y=De(x=>g(x,f),"handleTriggerLeave"),v=De(x=>g(x,u),"handleContentLeave");return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(a){const y=De(v=>{const x=v.target,w={x:v.clientX,y:v.clientY},b=(u==null?void 0:u.contains(x))||(f==null?void 0:f.contains(x)),C=!Lg(w,a);b?m():C&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,a,d,m]),l.jsx(kg,{...e,ref:i})},"TooltipContentHoverable")),zD=Hh("TooltipContent"),kg=p.forwardRef(De(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=e,d=Jr(_r,r),f=ks(r),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Ra,h),()=>document.removeEventListener(Ra,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=De(y=>{y.target instanceof Node&&y.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Te(()=>(m(i),()=>{m(void 0)}),[i,m]),l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:l.jsxs(xs,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(zD,{children:o}),s?l.jsx(vT,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),UD=p.forwardRef(De(function(e,n){const{__scopeTooltip:r,...o}=e,s=ks(r);return l.jsx(Jp,{...s,...o,ref:n})},"TooltipArrow"));function Ng(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}De(Ng,"getExitSideFromRect");function _g(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}De(_g,"getPaddedExitPoints");function Og(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}De(Og,"getPointsFromRect");function Lg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}De(Lg,"isPointInPolygon");function $g(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Fg(e)}De($g,"getHull");function Fg(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}De(Fg,"getHullPresorted");var HD=ND,Vg=OD,Bg=LD,Gg=VD,zg=BD,WD=UD;const KD=HD,YD=S.forwardRef(function({children:e,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:a,disabled:c,contentClassName:u,contentStyle:d,sx:f},h){const{className:m,style:g,styleTag:y}=ae(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:e}):l.jsxs(Vg,{delayDuration:i,open:a,children:[l.jsx(Bg,{asChild:!0,children:e}),l.jsx(Gg,{children:l.jsxs(zg,{ref:h,side:r,align:o,sideOffset:s,className:m,style:g,children:[y,n,l.jsx(WD,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),XD=Vg,qD=Bg,ZD=S.forwardRef(function({className:e,...n},r){return l.jsx(Gg,{children:l.jsx(zg,{ref:r,className:H("cny-tooltip-content",e),...n})})}),QD=jc,JD=Ac,eI=dM,tI=fM,nI=S.forwardRef(function({className:e,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=ae(r,n,"cny-popover-content",e);return l.jsx(Dc,{children:l.jsxs(Ic,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(hM,{className:"cny-popover-arrow",width:12,height:6})]})})}),rI=S.forwardRef(function({color:e="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:a="Remove",onClick:c,disabled:u,className:d,style:f,sx:h,children:m,...g},y){const v=!u&&c!=null,{className:x,style:w,styleTag:b}=ae(h,f,"cny-chip",e,n,r==="sm"&&"sm",v&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:y,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,onKeyDown:v?C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),c==null||c(C))}:void 0,className:x,style:w,...g,children:[b,s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:m}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:C=>{C.stopPropagation(),i(C)},children:l.jsx(Wt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),oI=S.forwardRef(function({count:e,dot:n=!1,max:r=99,showZero:o=!1,color:s="danger",placement:i="top-right",standalone:a=!1,children:c,className:u,style:d,sx:f,...h},m){const g=typeof e=="number",y=g&&e>r?`${r}+`:e,x=!n&&g&&e===0&&!o?null:l.jsx("span",{className:H("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!a&&`cny-badge-${i}`),children:n?null:y});if(a){const{className:P,style:R,styleTag:M}=ae(f,d,"cny-badge","cny-badge-standalone",u);return l.jsxs("span",{ref:m,className:P,style:R,...h,children:[M,x]})}const{className:w,style:b,styleTag:C}=ae(f,d,"cny-badge",u);return l.jsxs("span",{ref:m,className:w,style:b,...h,children:[C,c,x]})}),sI=S.forwardRef(function({position:e="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=ae(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${e}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),iI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,className:H("cny-timeline-item",e),...n})}),aI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:H("cny-timeline-separator",e),...n})}),cI=S.forwardRef(function({color:e="neutral",variant:n="filled",icon:r,active:o=!1,className:s,children:i,...a},c){const u=r??i;return l.jsx("span",{ref:c,className:H("cny-timeline-dot",`cny-timeline-dot-${e}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),lI=S.forwardRef(function({color:e,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:H("cny-timeline-connector",e&&`cny-timeline-connector-${e}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),uI=S.forwardRef(function({variant:e="plain",accentColor:n,className:r,...o},s){const i=e==="card"||e==="elevated";return l.jsx("div",{ref:s,className:H("cny-timeline-content",i&&"cny-timeline-content-card",e==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),dI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:H("cny-timeline-opposite-content",e),...n})}),Ug=S.createContext(null);function fI(){const t=S.useContext(Ug);if(!t)throw new Error("TreeItem must be used within a <TreeView>.");return t}const Hg=S.forwardRef(function({expandedIds:e,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...m},g){const[y,v]=S.useState(n??[]),[x,w]=S.useState(s),[b,C]=S.useState(null),P=e??y,R=o!==void 0?o:x,M=S.useMemo(()=>new Set(P),[P]),j=S.useCallback(k=>M.has(k),[M]),T=S.useCallback(k=>{const F=!M.has(k),L=F?[...P,k]:P.filter(D=>D!==k);e===void 0&&v(L),r==null||r(L),a==null||a(k,F)},[P,M,e,r,a]),E=S.useCallback(k=>{o===void 0&&w(k),i==null||i(k)},[o,i]),N=S.useMemo(()=>({isExpanded:j,toggle:T,selectedId:R,select:E,activeId:b,setActive:C,defaultIcons:c}),[j,T,R,E,b,c]),O=S.useRef(null),$=S.useCallback(k=>{O.current=k,typeof g=="function"?g(k):g&&(g.current=k)},[g]);S.useEffect(()=>{var L;if(b!==null)return;const k=(L=O.current)==null?void 0:L.querySelector('[role="treeitem"]'),F=k==null?void 0:k.dataset.treeId;F&&C(F)},[b]);const{className:V,style:q,styleTag:G}=ae(f,d,"cny-tree",u);return l.jsx(Ug.Provider,{value:N,children:l.jsxs("ul",{ref:$,role:"tree",className:V,style:q,...m,children:[G,h]})})});function hI(t){return t?Array.from(t.querySelectorAll('[role="treeitem"]')):[]}const Wg=S.forwardRef(function({itemId:e,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:m,defaultIcons:g}=fI(),y=!!o,v=y&&c(e),x=d===e,w=h===e,b=r??(g?y?v?l.jsx(FS,{size:16}):l.jsx(BS,{size:16}):l.jsx(LS,{size:16}):null),C=()=>{m(e),f(e),y&&u(e)},P=M=>{M.preventDefault(),M.stopPropagation(),m(e),u(e)},R=M=>{var T;const j=M.currentTarget.closest('[role="tree"]');switch(M.key){case"ArrowRight":if(M.preventDefault(),y&&!v)u(e);else if(v){const E=M.currentTarget.querySelector('[role="treeitem"]');E==null||E.focus()}break;case"ArrowLeft":if(M.preventDefault(),y&&v)u(e);else{const E=(T=M.currentTarget.parentElement)==null?void 0:T.closest('[role="treeitem"]');E==null||E.focus()}break;case"ArrowDown":case"ArrowUp":{M.preventDefault();const E=hI(j),N=E.indexOf(M.currentTarget),O=E[N+(M.key==="ArrowDown"?1:-1)];O==null||O.focus();break}case"Enter":case" ":M.preventDefault(),f(e),y&&u(e);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":e,"aria-expanded":y?v:void 0,"aria-selected":x,tabIndex:w?0:-1,className:H("cny-tree-item",s),onKeyDown:R,onFocus:M=>{M.target===M.currentTarget&&m(e)},...i,children:[l.jsxs("div",{className:H("cny-tree-row",x&&"is-selected"),onClick:C,children:[y?l.jsx("button",{type:"button",tabIndex:-1,className:H("cny-tree-toggle",v&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:e}`,onClick:P,children:l.jsx(Jt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),b!=null&&l.jsx("span",{className:"cny-tree-icon",children:b}),l.jsx("span",{className:"cny-tree-label",children:n})]}),v&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),pI=S.forwardRef(function({items:e,getItemId:n=c=>String(c.id),getItemLabel:r=c=>c.label,getItemChildren:o=c=>c.children,getItemIcon:s,...i},a){const c=u=>u.map(d=>{const f=n(d),h=o(d);return l.jsx(Wg,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?c(h):null},f)});return l.jsx(Hg,{ref:a,...i,children:c(e)})});function mI(t){if(!t)return[];if(typeof t=="string")return t.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(t))return t.map(n=>n.trim()).filter(Boolean);const e=[];for(const[n,r]of Object.entries(t)){e.push(n);for(const o of r)e.push(o)}return e}function gI(t,e){if(e.length===0)return!0;const n=t.name.toLowerCase(),r=(t.type||"").toLowerCase();return e.some(o=>{const s=o.toLowerCase();return s==="*"||s==="*/*"?!0:s.startsWith(".")?n.endsWith(s):s.endsWith("/*")?r.startsWith(s.slice(0,-1)):r===s})}function Kg(t={}){const{accept:e,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=t,[d,f]=S.useState(!1),h=S.useRef(null),m=S.useRef(0),g=S.useMemo(()=>mI(e),[e]),y=g.join(",")||void 0,v=S.useCallback(P=>{const R=[];return gI(P,g)||R.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&P.size>n&&R.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&P.size<r&&R.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),R},[g,n,r]),x=S.useCallback(P=>{if(i||P.length===0)return;const R=[],M=[];if(!o&&P.length>1||typeof s=="number"&&P.length>s)for(const T of P)M.push({file:T,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const T of P){const E=v(T);E.length?M.push({file:T,errors:E}):R.push(T)}a==null||a(R,M),R.length&&(c==null||c(R)),M.length&&(u==null||u(M))},[i,o,s,v,a,c,u]),w=S.useCallback(()=>{var P;i||(P=h.current)==null||P.click()},[i]),b=S.useCallback((P={})=>{const{onClick:R,onKeyDown:M,onDragOver:j,onDragEnter:T,onDragLeave:E,onDrop:N,...O}=P;return{...O,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:$=>{R==null||R($),i||w()},onKeyDown:$=>{M==null||M($),($.key==="Enter"||$.key===" ")&&($.preventDefault(),w())},onDragOver:$=>{j==null||j($),$.preventDefault(),i||f(!0)},onDragEnter:$=>{T==null||T($),$.preventDefault(),!i&&(m.current+=1,f(!0))},onDragLeave:$=>{E==null||E($),m.current=Math.max(0,m.current-1),m.current===0&&f(!1)},onDrop:$=>{var V;N==null||N($),$.preventDefault(),m.current=0,f(!1),!i&&x(Array.from(((V=$.dataTransfer)==null?void 0:V.files)??[]))}}},[i,w,x]),C=S.useCallback((P={})=>{const{onChange:R,...M}=P;return{...M,ref:h,type:"file",accept:y,multiple:o,style:{display:"none"},onChange:j=>{R==null||R(j),x(Array.from(j.target.files??[])),j.target.value=""}}},[y,o,x]);return{getRootProps:b,getInputProps:C,open:w,isDragActive:d,inputRef:h}}const yI=S.forwardRef(function({onDrop:e,label:n="Drop files here or click to upload",hint:r,icon:o,children:s,buttonLabel:i="Browse files",size:a="md",accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,className:g,style:y,sx:v},x){const{getRootProps:w,getInputProps:b,isDragActive:C,open:P}=Kg({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,onDrop:e}),{className:R,style:M,styleTag:j}=ae(v,y,"cny-uploader",`cny-uploader-${a}`,C&&"is-dragging",m&&"is-disabled",g);return l.jsxs("div",{...w(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:R,style:M,children:[j,l.jsx("input",{...b()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(jS,{})}),l.jsxs("span",{className:"cny-uploader-text",children:[l.jsx("span",{className:"cny-uploader-label",children:n}),r!=null&&l.jsx("span",{className:"cny-uploader-hint",children:r})]}),i!==!1&&l.jsx(Er,{type:"button",variant:"outline",size:a==="sm"?"sm":"md",disabled:m,tabIndex:-1,onClick:T=>{T.stopPropagation(),P()},children:i})]})]})}),vI=5;function Fd(t){if(t.length===0)return[];const n=t.reduce((a,c)=>a+(c.def??0),0),r=t.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=t.map(a=>a.def==null?o:a.def),i=s.reduce((a,c)=>a+c,0)||1;return s.map(a=>a/i*100)}function Vd(t,e,n,r){if(e<0||e+1>=t.length)return t;const o=t[e]+t[e+1];let s=Math.max(r[e].min,Math.min(r[e].max,t[e]+n));const i=Math.max(r[e+1].min,Math.min(r[e+1].max,o-s));s=Math.max(r[e].min,Math.min(r[e].max,o-i));const a=[...t];return a[e]=s,a[e+1]=i,a}const Ma=S.forwardRef(function({defaultSize:e,minSize:n,maxSize:r,className:o,style:s,...i},a){return l.jsx("div",{ref:a,className:H("cny-panel",o),style:s,...i})}),Yg=S.forwardRef(function({disabled:e,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||e)return;const u=i?"ArrowRight":"ArrowDown",d=i?"ArrowLeft":"ArrowUp";c.key===u?(c.preventDefault(),r.onKeyResize(1)):c.key===d&&(c.preventDefault(),r.onKeyResize(-1))};return l.jsx("div",{ref:s,role:"separator",tabIndex:e?-1:0,"aria-orientation":i?"vertical":"horizontal","aria-valuenow":r==null?void 0:r.valueNow,"aria-valuemin":r==null?void 0:r.valueMin,"aria-valuemax":r==null?void 0:r.valueMax,"aria-disabled":e||void 0,className:H("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{e||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),xI=S.forwardRef(function({direction:e="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=S.useRef(null),u=S.Children.toArray(s).filter(S.isValidElement),d=u.filter(j=>j.type===Ma).map(j=>{const T=j.props;return{min:T.minSize??10,max:T.maxSize??90,def:T.defaultSize??null}}),[f,h]=S.useState(()=>Fd(d)),m=f.length===d.length?f:Fd(d),g=S.useRef(null),y=(j,T)=>{const E=e==="horizontal"?T.clientX:T.clientY;g.current={g:j,start:E,startSizes:m};const N=$=>{var L;const V=g.current,q=(L=c.current)==null?void 0:L.getBoundingClientRect();if(!V||!q)return;const G=e==="horizontal"?q.width:q.height;if(!G)return;const F=((e==="horizontal"?$.clientX:$.clientY)-V.start)/G*100;h(Vd(V.startSizes,V.g,F,d))},O=()=>{g.current=null,window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",O)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",O)},v=(j,T)=>{h(Vd(m,j,T*vI,d))},x=j=>{c.current=j,typeof a=="function"?a(j):a&&(a.current=j)};let w=-1,b=-1;const C=u.map(j=>{var T,E;if(j.type===Ma){w+=1;const N=w,O={...j.props.style,flexBasis:`${m[N]??0}%`,flexGrow:0,flexShrink:0};return S.cloneElement(j,{key:j.key??`panel-${N}`,style:O})}if(j.type===Yg){b+=1;const N=b,O={direction:e,valueNow:Math.round(m[N]??0),valueMin:((T=d[N])==null?void 0:T.min)??0,valueMax:((E=d[N])==null?void 0:E.max)??100,onResizeStart:$=>y(N,$),onKeyResize:$=>v(N,$)};return S.cloneElement(j,{key:j.key??`handle-${N}`,__internal:O})}return j}),{className:P,style:R,styleTag:M}=ae(o,r,"cny-panel-group",e==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:P,style:R,...i,children:[M,C]})});function bI(){}function wI(t,e,n,r){if(e<1)return[];if(e===1)return[{type:"page",page:1}];const o=e,s=Math.max(1,t-n),i=Math.min(o,t+n),a=[],c=r&&s>1,u=r&&i<o,d=c&&s>2,f=u&&i<o-1;c&&a.push({type:"page",page:1}),d&&a.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)a.push({type:"page",page:h});return f&&a.push({type:"ellipsis",key:"r"}),u&&a.push({type:"page",page:o}),a.filter((h,m,g)=>h.type!=="page"?!0:g.findIndex(y=>y.type==="page"&&y.page===h.page)===m)}const Xg=S.forwardRef(function({page:e,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:a="md",className:c,style:u,sx:d,"aria-label":f="Pagination"},h){const m=S.useMemo(()=>wI(e,n,o,s),[e,n,o,s]),g=w=>{w<1||w>n||w===e||r(w)},{className:y,style:v,styleTag:x}=ae(d,u,"cny-pagination",`cny-pagination-${a}`,c);return l.jsxs("nav",{ref:h,role:"navigation","aria-label":f,className:y,style:v,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e-1),disabled:e<=1,"aria-label":"Previous page",children:l.jsx(Vo,{size:14,"aria-hidden":"true"})}),m.map(w=>w.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(DS,{size:14})},`e-${w.key}`):l.jsx("button",{type:"button",className:H("cny-pagination-btn",w.page===e&&"is-active"),"aria-current":w.page===e?"page":void 0,onClick:()=>g(w.page),children:w.page},w.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e+1),disabled:e>=n,"aria-label":"Next page",children:l.jsx(Jt,{size:14,"aria-hidden":"true"})})]})}),Mi={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function CI(t){return t.id}function SI(t,e){return!t||t.field!==e?{field:e,sort:"asc"}:t.sort==="asc"?{field:e,sort:"desc"}:null}const PI=S.forwardRef(function({columns:e,rows:n,getRowId:r=CI,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:m,noRowsLabel:g="No rows",disableColumnResize:y=!1,density:v="standard",tableLayout:x="auto",getRowClassName:w,className:b,style:C,sx:P},R){const M=e.length+(c?1:0),j=S.useRef(null),[T,E]=S.useState(null),N=(I,ne)=>{var ht;ne.preventDefault(),ne.stopPropagation();const ie={};(ht=j.current)==null||ht.querySelectorAll("thead th[data-field]").forEach(me=>{const Ye=me.dataset.field;Ye&&(ie[Ye]=me.getBoundingClientRect().width)});const oe=ne.clientX,se=ie[I]??0;E(ie);const Me=me=>{E({...ie,[I]:Math.max(60,se+(me.clientX-oe))})},lt=()=>{window.removeEventListener("pointermove",Me),window.removeEventListener("pointerup",lt)};window.addEventListener("pointermove",Me),window.addEventListener("pointerup",lt)},O=I=>!y&&I.resizable!==!1,$=u??[],V=new Set($),q=n.map(I=>r(I)),G=q.length>0&&q.every(I=>V.has(I)),k=q.some(I=>V.has(I)),F=G?!0:k?"indeterminate":!1,L=()=>{if(d)if(G)d($.filter(I=>!q.includes(I)));else{const I=new Set($);q.forEach(ne=>I.add(ne)),d([...I])}},D=I=>{d&&(V.has(I)?d($.filter(ne=>ne!==I)):d([...$,I]))},X=I=>{!I.sortable||!h||h(SI(f,I.field))},A=x==="fixed",B=e.reduce((I,ne)=>ne.width!=null?I:I+(ne.flex??1),0),Q=I=>{if(I.width!=null)return I.width;if(!(B<=0))return`${((I.flex??1)/B*100).toFixed(4)}%`},K=I=>I.width!=null?{width:I.width,minWidth:I.width}:{flex:I.flex??1},W=()=>{if(!i||s==null)return null;const{page:I,pageSize:ne}=i,ie=Math.max(1,Math.ceil(s/ne)),oe=s===0?0:I*ne+1,se=Math.min(s,(I+1)*ne);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[oe,"–",se," of ",s]}),l.jsx(Xg,{page:I+1,pageCount:ie,size:"sm",onPageChange:Me=>a==null?void 0:a({page:Me-1,pageSize:ne})})]})},{className:re,style:Y,styleTag:z}=ae(P,C,"cny-dt",v==="compact"&&"cny-dt-compact",b);return l.jsxs("div",{ref:R,className:re,style:Y,children:[z,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:j,className:"cny-dt-table",style:T?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:A?{tableLayout:"fixed",width:"100%"}:void 0,children:[(T||A)&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:44}}),e.map(I=>l.jsx("col",{style:{width:T?T[I.field]:Q(I)}},I.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(Ca,{checked:F,onCheckedChange:L,"aria-label":"Select all rows"})}),e.map(I=>{const ne=(f==null?void 0:f.field)===I.field,ie=I.headerAlign??I.align;return l.jsxs("th",{scope:"col","data-field":I.field,style:T?void 0:K(I),"aria-sort":ne?f.sort==="asc"?"ascending":"descending":void 0,className:H(ie&&Mi[ie],I.sortable&&"cny-dt-sortable",ne&&"is-sorted"),children:[I.sortable?l.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>X(I),children:l.jsxs("span",{className:"cny-dt-th-inner",children:[I.headerName??I.field,l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:ne?f.sort==="desc"?l.jsx(Gr,{size:14}):l.jsx(yp,{size:14}):l.jsx(vp,{size:14})})]})}):l.jsx("span",{className:"cny-dt-th-inner",children:I.headerName??I.field}),O(I)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:oe=>oe.stopPropagation(),onPointerDown:oe=>N(I.field,oe)})]},I.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((I,ne)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(ia,{shape:"avatar",width:16,height:16})}),e.map(ie=>l.jsx("td",{className:ie.align&&Mi[ie.align],children:l.jsx(ia,{width:"70%"})},ie.field))]},`sk-${ne}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:M,children:g})}):n.map(I=>{const ne=r(I),ie=V.has(ne);return l.jsxs("tr",{className:H("cny-dt-row",ie&&"is-selected",m&&"is-clickable",w==null?void 0:w(I)),onClick:()=>m==null?void 0:m(I),tabIndex:m?0:void 0,onKeyDown:m?oe=>{oe.target===oe.currentTarget&&(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),m(I))}:void 0,children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:oe=>oe.stopPropagation(),children:l.jsx(Ca,{checked:ie,onCheckedChange:()=>D(ne),"aria-label":`Select row ${String(ne)}`})}),e.map(oe=>{const se=oe.valueGetter?oe.valueGetter({row:I,field:oe.field}):I[oe.field];return l.jsx("td",{className:oe.align&&Mi[oe.align],children:oe.renderCell?oe.renderCell({row:I,value:se,field:oe.field}):se},oe.field)})]},String(ne))})})]})}),W()]})}),Ea=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Rn(t,e){return e??Ea[t%Ea.length]}function rl(t=600){const e=S.useRef(null),[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{var c;const a=Math.round(((c=i[0])==null?void 0:c.contentRect.width)??0);a>0&&r(u=>u===a?u:a)});return s.observe(o),()=>s.disconnect()},[]),[e,n]}function qg(t,e=4){if(t<=0)return{max:1,ticks:[0,1]};const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r,s=(o<=1?1:o<=2?2:o<=5?5:10)*r,i=Math.ceil(t/s)*s,a=[];for(let c=0;c<=i+1e-9;c+=s)a.push(Number(c.toFixed(6)));return{max:i,ticks:a}}function RI(t,e,n,r,o,s){const i=(v,x)=>[t+v*Math.sin(x),e-v*Math.cos(x)],a=s-o>Math.PI?1:0,[c,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${t} ${e} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,m]=i(r,s),[g,y]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${m}`,`A ${r} ${r} 0 ${a} 0 ${g} ${y}`,"Z"].join(" ")}function ol({caption:t,head:e,rows:n}){return l.jsxs("table",{className:"cny-sr-only",children:[l.jsx("caption",{children:t}),l.jsx("thead",{children:l.jsx("tr",{children:e.map((r,o)=>l.jsx("th",{scope:"col",children:r},o))})}),l.jsx("tbody",{children:n.map((r,o)=>l.jsx("tr",{children:r.map((s,i)=>l.jsx("td",{children:s},i))},o))})]})}const _e={top:12,right:14,bottom:28,left:40};function TI({data:t,xKey:e,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:a=!0,yTickFormatter:c=g=>String(g),xTickFormatter:u=g=>g,renderTooltip:d,className:f,style:h,sx:m}){const[g,y]=rl(),[v,x]=S.useState(null),w=Math.max(0,y-_e.left-_e.right),b=Math.max(0,r-_e.top-_e.bottom),C=(k,F)=>Number(k[F]??0),P=t.length?Math.max(0,...t.map(k=>s?n.reduce((F,L)=>F+C(k,L.key),0):Math.max(...n.map(F=>C(k,F.key))))):0,{max:R,ticks:M}=qg(P),j=k=>_e.top+b*(1-k/R),T=t.length,E=T?w/T:0,N=E*.68,O=k=>_e.left+k*E+(E-N)/2,$=s?N:N/Math.max(1,n.length),{className:V,style:q,styleTag:G}=ae(m,{position:"relative",...h},"cny-chart",f);return l.jsxs("div",{ref:g,className:V,style:q,children:[G,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${y} ${r}`,role:"img","aria-label":o,children:[i&&M.map(k=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:_e.left,x2:y-_e.right,y1:j(k),y2:j(k)}),l.jsx("text",{className:"cny-chart-axis",x:_e.left-6,y:j(k),dy:"0.32em",textAnchor:"end",children:c(k)})]},k)),t.map((k,F)=>{let L=0;return l.jsx("g",{children:n.map((D,X)=>{const A=C(k,D.key),B=A/R*b;let Q,K;return s?(Q=O(F),K=j(L+A),L+=A):(Q=O(F)+X*$,K=j(A)),l.jsx("rect",{className:"cny-chart-bar",x:Q,y:K,width:Math.max(0,$-(s?0:2)),height:Math.max(0,B),rx:2,fill:Rn(X,D.color)},D.key)})},F)}),t.map((k,F)=>{const L=u(String(k[e]??"")),D=`${L}: ${n.map(X=>`${X.label??X.key} ${C(k,X.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:_e.left+F*E+E/2,y:r-_e.bottom+16,textAnchor:"middle",children:L}),l.jsx("rect",{className:"cny-chart-hit",x:_e.left+F*E,y:_e.top,width:E,height:b,fill:"transparent",tabIndex:0,"aria-label":D,onMouseEnter:()=>x({index:F,x:_e.left+F*E+E/2,y:_e.top}),onMouseLeave:()=>x(null),onFocus:()=>x({index:F,x:_e.left+F*E+E/2,y:_e.top}),onBlur:()=>x(null)})]},`x-${F}`)})]}),l.jsx(ol,{caption:o,head:[String(e),...n.map(k=>k.label??k.key)],rows:t.map(k=>[u(String(k[e]??"")),...n.map(F=>C(k,F.key))])}),v&&t[v.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${v.x/y*100}%`,top:v.y},children:d?d({label:String(t[v.index][e]),datum:t[v.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[v.index][e])}),n.map((k,F)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(F,k.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:k.label??k.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(t[v.index],k.key)})]},k.key))]})}),a&&l.jsx("div",{className:"cny-chart-legend",children:n.map((k,F)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(F,k.color)}}),k.label??k.key]},k.key))})]})}const rt={top:12,right:14,bottom:28,left:40};function Zg({data:t,xKey:e,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:a=!0,grid:c=!0,legend:u=!0,yTickFormatter:d=v=>String(v),xTickFormatter:f=v=>v,renderTooltip:h,className:m,style:g,sx:y}){const[v,x]=rl(),[w,b]=S.useState(null),C=Math.max(0,x-rt.left-rt.right),P=Math.max(0,r-rt.top-rt.bottom),R=(L,D)=>Number(L[D]??0),M=t.length?Math.max(0,...t.map(L=>i?n.reduce((D,X)=>D+R(L,X.key),0):Math.max(...n.map(D=>R(L,D.key))))):0,{max:j,ticks:T}=qg(M),E=L=>rt.top+P*(1-L/j),N=t.length,O=N?C/N:0,$=L=>rt.left+L*O+O/2,V=E(0),q=t.map(()=>0),{className:G,style:k,styleTag:F}=ae(y,{position:"relative",...g},"cny-chart",m);return l.jsxs("div",{ref:v,className:G,style:k,children:[F,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,role:"img","aria-label":o,children:[c&&T.map(L=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:rt.left,x2:x-rt.right,y1:E(L),y2:E(L)}),l.jsx("text",{className:"cny-chart-axis",x:rt.left-6,y:E(L),dy:"0.32em",textAnchor:"end",children:d(L)})]},L)),n.map((L,D)=>{const X=Rn(D,L.color),A=t.map((K,W)=>{const re=R(K,L.key),Y=i?q[W]:0,z=Y+re;return i&&(q[W]=z),{x:$(W),y:E(z),yBase:E(Y)}});if(A.length===0)return null;const B=A.map(K=>`${K.x},${K.y}`).join(" "),Q=`M ${A[0].x} ${i?A[0].yBase:V} `+A.map(K=>`L ${K.x} ${K.y}`).join(" ")+` L ${A[A.length-1].x} ${i?A[A.length-1].yBase:V} Z`;return l.jsxs("g",{children:[s&&l.jsx("path",{className:"cny-chart-area",d:Q,fill:X}),l.jsx("polyline",{className:"cny-chart-line",points:B,fill:"none",stroke:X}),a&&A.map((K,W)=>l.jsx("circle",{className:"cny-chart-dot",cx:K.x,cy:K.y,r:3,fill:X},W))]},L.key)}),t.map((L,D)=>{const X=f(String(L[e]??"")),A=`${X}: ${n.map(B=>`${B.label??B.key} ${R(L,B.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:$(D),y:r-rt.bottom+16,textAnchor:"middle",children:X}),l.jsx("rect",{className:"cny-chart-hit",x:rt.left+D*O,y:rt.top,width:O,height:P,fill:"transparent",tabIndex:0,"aria-label":A,onMouseEnter:()=>b({index:D,x:$(D)}),onMouseLeave:()=>b(null),onFocus:()=>b({index:D,x:$(D)}),onBlur:()=>b(null)})]},`x-${D}`)})]}),l.jsx(ol,{caption:o,head:[String(e),...n.map(L=>L.label??L.key)],rows:t.map(L=>[f(String(L[e]??"")),...n.map(D=>R(L,D.key))])}),w&&t[w.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${w.x/x*100}%`,top:rt.top},children:h?h({label:String(t[w.index][e]),datum:t[w.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[w.index][e])}),n.map((L,D)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(D,L.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:L.label??L.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:R(t[w.index],L.key)})]},L.key))]})}),u&&l.jsx("div",{className:"cny-chart-legend",children:n.map((L,D)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(D,L.color)}}),L.label??L.key]},L.key))})]})}function MI(t){return l.jsx(Zg,{...t,area:!1})}function EI(t){return l.jsx(Zg,{...t,area:!0})}function jI({data:t,height:e=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,renderTooltip:s,centerLabel:i,className:a,style:c,sx:u}){const[d,f]=rl(360),[h,m]=S.useState(null),g=t.reduce((T,E)=>T+Math.max(0,E.value),0),y=Math.min(f,e),v=f/2,x=e/2,w=y/2*.86,b=r>0?w*r:0;let C=0;const P=t.map((T,E)=>{const N=g>0?Math.max(0,T.value)/g:0,O=C,$=C+N*Math.PI*2;return C=$,{d:T,i:E,start:O,end:$,frac:N,color:Rn(E,T.color)}}),{className:R,style:M,styleTag:j}=ae(u,{position:"relative",...c},"cny-chart",a);return l.jsxs("div",{ref:d,className:R,style:M,children:[j,l.jsxs("svg",{width:"100%",height:e,viewBox:`0 0 ${f} ${e}`,role:"img","aria-label":n,children:[P.map(T=>T.frac>=.9999?l.jsx("circle",{className:H("cny-chart-slice",h===T.i&&"is-active"),cx:v,cy:x,r:b>0?(w+b)/2:w,fill:b>0?"none":T.color,stroke:b>0?T.color:void 0,strokeWidth:b>0?w-b:void 0,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i):l.jsx("path",{className:H("cny-chart-slice",h===T.i&&"is-active"),d:RI(v,x,w,b,T.start,T.end),fill:T.color,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i)),i!=null&&b>0&&l.jsx("foreignObject",{x:v-b,y:x-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:i})})]}),l.jsx(ol,{caption:n,head:["Slice","Value","Share"],rows:P.map(T=>[T.d.label,T.d.value,`${Math.round(T.frac*100)}%`])}),h!=null&&P[h]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:s?s({datum:P[h].d,percent:P[h].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P[h].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:P[h].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[P[h].d.value," (",Math.round(P[h].frac*100),"%)"]})]})}),o&&l.jsx("div",{className:"cny-chart-legend",children:P.map(T=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:T.color}}),T.d.label]},T.i))})]})}function AI({height:t=300,children:e,className:n,style:r,sx:o}){const s=S.Children.only(e),{className:i,style:a,styleTag:c}=ae(o,{width:"100%",height:t,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,S.isValidElement(s)?S.cloneElement(s,{height:t}):s]})}const DI=S.forwardRef(function({variant:e="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=ae(i,s,"cny-list",e,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),II=S.forwardRef(function({leading:e,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},m){const g=u??(i?"a":s?"button":"li"),y=!a&&(i!=null||s!=null),v=d??l.jsxs(l.Fragment,{children:[e&&l.jsx("span",{className:"cny-list-item-leading",children:e}),l.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&l.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&l.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&l.jsx("span",{className:"cny-list-item-trailing",children:n})]}),x=l.jsx(g,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:y&&g==="div"?0:void 0,className:H("cny-list-item",c&&"is-active",a&&"is-disabled",y&&"is-interactive",f),...h,children:v});return g==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),kI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,role:"separator",className:H("cny-list-separator",e),...n})}),NI=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("li",{ref:o,className:H("cny-list-subheader",e),...r,children:n})});var _I=Object.defineProperty,hr=(t,e)=>_I(t,"name",{value:e,configurable:!0}),sl="Tabs",[OI,vN]=Ce(sl,[un]),Qg=un(),[LI,il]=OI(sl),$I=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,f=Ht(c),[h,m]=we({prop:o,onChange:s,defaultProp:i??"",caller:sl});return l.jsx(LI,{scope:r,baseId:$e(),value:h,onValueChange:m,orientation:a,dir:f,activationMode:u,children:l.jsx(te.div,{dir:f,"data-orientation":a,...d,ref:n})})},"Tabs")),FI="TabsList",VI=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,loop:o=!0,...s}=e,i=il(FI,r),a=Qg(r);return l.jsx(ds,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:o,children:l.jsx(te.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:n})})},"TabsList")),BI="TabsTrigger",GI=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,value:o,disabled:s=!1,...i}=e,a=il(BI,r),c=Qg(r),u=al(a.baseId,o),d=cl(a.baseId,o),f=o===a.value;return l.jsx(fs,{asChild:!0,...c,focusable:!s,active:f,children:l.jsx(te.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:n,onMouseDown:U(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(o):h.preventDefault()}),onKeyDown:U(e.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&a.onValueChange(o)}),onFocus:U(e.onFocus,()=>{const h=a.activationMode!=="manual";!f&&!s&&h&&a.onValueChange(o)})})})},"TabsTrigger")),zI="TabsContent",UI=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,value:o,forceMount:s,children:i,...a}=e,c=il(zI,r),u=al(c.baseId,o),d=cl(c.baseId,o),f=o===c.value,h=p.useRef(f);return p.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(ze,{present:s||f,children:({present:m})=>l.jsx(te.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})},"TabsContent"));function al(t,e){return`${t}-trigger-${e}`}hr(al,"makeTriggerId");function cl(t,e){return`${t}-content-${e}`}hr(cl,"makeContentId");var HI=$I,WI=VI,KI=GI,YI=UI;const XI=S.forwardRef(function({variant:e="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=ae(s,o,"cny-tabs",`variant-${e}`,`size-${n}`,r);return l.jsxs(HI,{ref:c,className:u,style:d,...a,children:[f,i]})}),qI=S.forwardRef(function({className:e,...n},r){return l.jsx(WI,{ref:r,className:H("cny-tabs-list",e),...n})}),ZI=S.forwardRef(function({icon:e,badge:n,className:r,children:o,...s},i){return l.jsxs(KI,{ref:i,className:H("cny-tabs-trigger",r),...s,children:[e&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:e}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),QI=S.forwardRef(function({className:e,...n},r){return l.jsx(YI,{ref:r,className:H("cny-tabs-content",e),...n})});function JI(t){return t.multiple===!0}const ek=S.forwardRef(function(e,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:a=!1,loadingText:c="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,id:m,"aria-invalid":g,"aria-describedby":y,"aria-label":v,className:x,style:w,sx:b}=e,C=S.useId(),P=m??`cny-ac-${C}`,[R,M]=S.useState(!1),[j,T]=S.useState(""),E=S.useRef(null),N=JI(e),[O,$]=S.useState(!N&&e.defaultValue!==void 0?e.defaultValue??null:null),[V,q]=S.useState(N&&e.defaultValue!==void 0?e.defaultValue??[]:[]),G=N?e.value!==void 0?e.value:V:(()=>{const W=e.value!==void 0?e.value:O;return W==null?[]:[W]})(),k=S.useCallback(W=>{var re,Y;if(N)e.value===void 0&&q(W),(re=e.onValueChange)==null||re.call(e,W);else{const z=W[0]??null;e.value===void 0&&$(z),(Y=e.onValueChange)==null||Y.call(e,z)}},[N,e]),F=S.useCallback(W=>{if(!W.disabled)if(N){const re=e.maxItems,Y=G.includes(W.value);let z;if(Y)z=G.filter(I=>I!==W.value);else{if(re!=null&&G.length>=re)return;z=[...G,W.value]}k(z)}else k([W.value]),M(!1)},[k,N,G,e]),L=S.useCallback(W=>{var re;W.stopPropagation(),k([]),(re=E.current)==null||re.focus()},[k]),D=S.useMemo(()=>{const W=new Map;for(const re of r){const Y=re.group??"";W.has(Y)||W.set(Y,[]),W.get(Y).push(re)}return Array.from(W.entries())},[r]),X=W=>{var re;return((re=r.find(Y=>Y.value===W))==null?void 0:re.label)??W},A=G.length===0?o:N?G.length===1?X(G[0]):`${X(G[0])} +${G.length-1}`:X(G[0]),{className:B,style:Q,styleTag:K}=ae(b,w,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,G.length>0&&"has-value",R&&"is-open",x);return l.jsxs(jc,{open:R,onOpenChange:M,children:[l.jsx(Ac,{asChild:!0,children:l.jsxs("button",{ref:W=>{E.current=W,typeof n=="function"?n(W):n&&(n.current=W)},type:"button",id:P,className:B,style:Q,disabled:f,"aria-label":v,"aria-invalid":g,"aria-describedby":y,"aria-haspopup":"listbox","aria-expanded":R,children:[K,l.jsx("span",{className:H("cny-ac-value",G.length===0&&"is-placeholder"),children:A}),h&&G.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:L,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),L(W))},onPointerDown:W=>W.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})}),l.jsx(vp,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(Dc,{children:l.jsx(Ic,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(Ae,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(Ae.Input,{value:j,onValueChange:T,placeholder:s})}),l.jsx(Ae.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Sp,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(Ae.Empty,{className:"cny-ac-empty",children:i},"empty"),D.map(([W,re],Y)=>{const z=re.map((I,ne)=>{const ie=G.includes(I.value);return l.jsxs(Ae.Item,{value:`${W} ${I.label} ${I.value}`,disabled:I.disabled,onSelect:()=>F(I),className:H("cny-ac-item",ie&&"is-checked"),children:[N?l.jsx("span",{className:H("cny-ac-checkbox",ie&&"is-checked"),children:ie&&l.jsx(rn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[I.icon??null,!I.icon&&ie&&l.jsx(rn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:I.label}),I.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:I.hint})]},I.value||`opt-${Y}-${ne}`)});return W===""?l.jsx(Ae.Group,{children:z},`__ungrouped_${Y}`):l.jsx(Ae.Group,{heading:W,children:z},W||`group_${Y}`)})]})})]})})})]})}),tk=S.forwardRef(function({items:e,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Jt,{size:12,"aria-hidden":"true"}),{className:d,style:f,styleTag:h}=ae(i,s,"cny-breadcrumb",`cny-breadcrumb-${r}`,o);return l.jsxs("nav",{ref:c,"aria-label":"Breadcrumb",className:d,style:f,...a,children:[h,l.jsx("ol",{className:"cny-breadcrumb-list",children:e.map((m,g)=>{const y=g===e.length-1,v=l.jsx("span",{className:H("cny-breadcrumb-label",y&&"is-current"),children:m.label}),x=m.render?m.render(v):m.href&&!y?l.jsx("a",{href:m.href,className:"cny-breadcrumb-link",children:v}):v;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[y?l.jsx("span",{"aria-current":"page",children:v}):x,!y&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},g)})})]})});var nk=Object.defineProperty,eo=(t,e)=>nk(t,"name",{value:e,configurable:!0}),ll="Collapsible",[rk,Jg]=Ce(ll),[ok,ul]=rk(ll),sk=p.forwardRef(eo(function(e,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:i,onOpenChange:a,...c}=e,[u,d]=we({prop:o,defaultProp:s??!1,onChange:a,caller:ll});return l.jsx(ok,{scope:r,disabled:i,contentId:$e(),open:u,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),children:l.jsx(te.div,{"data-state":Ns(u),"data-disabled":i?"":void 0,...c,ref:n})})},"Collapsible")),ik="CollapsibleTrigger",ak=p.forwardRef(eo(function(e,n){const{__scopeCollapsible:r,...o}=e,s=ul(ik,r);return l.jsx(te.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Ns(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:U(e.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),ey="CollapsibleContent",ck=p.forwardRef(eo(function(e,n){const{forceMount:r,...o}=e,s=ul(ey,e.__scopeCollapsible);return l.jsx(ze,{present:r||s.open,children:({present:i})=>l.jsx(lk,{...o,ref:n,present:i})})},"CollapsibleContent")),lk=p.forwardRef(eo(function(e,n){const{__scopeCollapsible:r,present:o,children:s,...i}=e,a=ul(ey,r),[c,u]=p.useState(o),d=p.useRef(null),f=ce(n,d),h=p.useRef(0),m=h.current,g=p.useRef(0),y=g.current,v=a.open||c,x=p.useRef(v),w=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Te(()=>{const b=d.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();h.current=C.height,g.current=C.width,x.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),u(o)}},[a.open,o]),l.jsx(te.div,{"data-state":Ns(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...i,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:v&&s})},"CollapsibleContentImpl"));function Ns(t){return t?"open":"closed"}eo(Ns,"getState");var uk=sk,dk=ak,fk=ck,hk=Object.defineProperty,at=(t,e)=>hk(t,"name",{value:e,configurable:!0}),Ot="Accordion",pk=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[dl,mk,gk]=ar(Ot),[_s,xN]=Ce(Ot,[gk,Jg]),fl=Jg(),yk=p.forwardRef(at(function(e,n){const{type:r,...o}=e,s=o,i=o;return l.jsx(dl.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(wk,{...i,ref:n}):l.jsx(bk,{...s,ref:n})})},"Accordion")),[ty,vk]=_s(Ot),[ny,xk]=_s(Ot,{collapsible:!1}),bk=p.forwardRef(at(function(e,n){const{value:r,defaultValue:o,onValueChange:s=at(()=>{},"onValueChange"),collapsible:i=!1,...a}=e,[c,u]=we({prop:r,defaultProp:o??"",onChange:s,caller:Ot});return l.jsx(ty,{scope:e.__scopeAccordion,value:p.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:p.useCallback(()=>i&&u(""),[i,u]),children:l.jsx(ny,{scope:e.__scopeAccordion,collapsible:i,children:l.jsx(ry,{...a,ref:n})})})},"AccordionImplSingle")),wk=p.forwardRef(at(function(e,n){const{value:r,defaultValue:o,onValueChange:s=at(()=>{},"onValueChange"),...i}=e,[a,c]=we({prop:r,defaultProp:o??[],onChange:s,caller:Ot}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(ty,{scope:e.__scopeAccordion,value:a,onItemOpen:u,onItemClose:d,children:l.jsx(ny,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(ry,{...i,ref:n})})})},"AccordionImplMultiple")),[Ck,Os]=_s(Ot),ry=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:i="vertical",...a}=e,c=p.useRef(null),u=ce(c,n),d=mk(r),h=Ht(s)==="ltr",m=U(e.onKeyDown,g=>{var T;if(!pk.includes(g.key))return;const y=g.target,v=d().filter(E=>{var N;return!((N=E.ref.current)!=null&&N.disabled)}),x=v.findIndex(E=>E.ref.current===y),w=v.length;if(x===-1)return;g.preventDefault();let b=x;const C=0,P=w-1,R=at(()=>{b=x+1,b>P&&(b=C)},"moveNext"),M=at(()=>{b=x-1,b<C&&(b=P)},"movePrev");switch(g.key){case"Home":b=C;break;case"End":b=P;break;case"ArrowRight":i==="horizontal"&&(h?R():M());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(h?M():R());break;case"ArrowUp":i==="vertical"&&M();break}const j=b%w;(T=v[j].ref.current)==null||T.focus()});return l.jsx(Ck,{scope:r,disabled:o,direction:s,orientation:i,children:l.jsx(dl.Slot,{scope:r,children:l.jsx(te.div,{...a,"data-orientation":i,ref:u,onKeyDown:o?void 0:m})})})},"AccordionImpl")),ja="AccordionItem",[Sk,hl]=_s(ja),Pk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,value:o,...s}=e,i=Os(ja,r),a=vk(ja,r),c=fl(r),u=$e(),d=o&&a.value.includes(o)||!1,f=i.disabled||e.disabled;return l.jsx(Sk,{scope:r,open:d,disabled:f,triggerId:u,children:l.jsx(uk,{"data-orientation":i.orientation,"data-state":pl(d),...c,...s,ref:n,disabled:f,open:d,onOpenChange:h=>{h?a.onItemOpen(o):a.onItemClose(o)}})})},"AccordionItem")),Rk="AccordionHeader",Tk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=hl(Rk,r);return l.jsx(te.h3,{"data-orientation":s.orientation,"data-state":pl(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),Bd="AccordionTrigger",Mk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=hl(Bd,r),a=xk(Bd,r),c=fl(r);return l.jsx(dl.ItemSlot,{scope:r,children:l.jsx(dk,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...c,...o,ref:n})})},"AccordionTrigger")),Ek="AccordionContent",jk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=hl(Ek,r),a=fl(r);return l.jsx(fk,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function pl(t){return t?"open":"closed"}at(pl,"getState");var Ak=yk,Dk=Pk,Ik=Tk,kk=Mk,Nk=jk;const _k=S.forwardRef(function({variant:e="plain",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=ae(o,r,"cny-accordion",`cny-accordion-${e}`,n);return l.jsxs(Ak,{ref:a,className:c,style:u,...i,children:[d,s]})}),Ok=S.forwardRef(function({className:e,...n},r){return l.jsx(Dk,{ref:r,className:H("cny-accordion-item",e),...n})}),Lk=S.forwardRef(function({children:e,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(Ik,{className:"cny-accordion-header",children:l.jsxs(kk,{ref:i,className:H("cny-accordion-trigger",n),...s,children:[r&&l.jsx("span",{className:"cny-accordion-trigger-icon",children:r}),l.jsx("span",{className:"cny-accordion-trigger-label",children:e}),!o&&l.jsx(Gr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),$k=S.forwardRef(function({children:e,className:n,...r},o){return l.jsx(Nk,{ref:o,className:H("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:e})})});var Fk=Object.defineProperty,de=(t,e)=>Fk(t,"name",{value:e,configurable:!0}),oy=["PageUp","PageDown"],sy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},to="Slider",[Aa,Vk,Bk]=ar(to),[ml,bN]=Ce(to,[Bk]),[Gk,no]=ml(to),zk=p.forwardRef(de(function(e,n){const{name:r,min:o=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:f,onValueChange:h=de(()=>{},"onValueChange"),onValueCommit:m=de(()=>{},"onValueCommit"),inverted:g=!1,form:y,...v}=e,x=p.useRef(new Set),w=p.useRef(0),b=p.useRef(!1),P=a==="horizontal"?Uk:Hk,[R,M]=p.useState(null),j=ce(n,M),[T=[],E]=we({prop:f,defaultProp:d,onChange:de(k=>{var L;(L=[...x.current][w.current])==null||L.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,h(k)},"onChange")}),N=p.useRef(T),O=p.useRef(T);p.useEffect(()=>{const k=y?R==null?void 0:R.ownerDocument.getElementById(y):R==null?void 0:R.closest("form");if(k instanceof HTMLFormElement){const F=de(()=>E(O.current),"reset");return k.addEventListener("reset",F),()=>k.removeEventListener("reset",F)}},[R,y,E]);function $(k){const F=py(T,k);G(k,F)}de($,"handleSlideStart");function V(k){G(k,w.current)}de(V,"handleSlideMove");function q(){String(T)!==String(N.current)&&m(T)}de(q,"handleSlideEnd");function G(k,F,{commit:L}={commit:!1}){const D=yl(i),X=Sr(Math.round((k-o)/i)*i+o,D),A=jr(X,[o,s]);E((B=[])=>{const Q=fy(B,A,F);if(yy(Q,u*i)){w.current=Q.indexOf(A);const K=String(Q)!==String(B);return K&&L&&m(Q),K?Q:B}else return B})}return de(G,"updateValues"),l.jsx(Gk,{scope:e.__scopeSlider,name:r,disabled:c,min:o,max:s,valueIndexToChangeRef:w,thumbs:x.current,values:T,orientation:a,form:y,children:l.jsx(Aa.Provider,{scope:e.__scopeSlider,children:l.jsx(Aa.Slot,{scope:e.__scopeSlider,children:l.jsx(P,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:j,onPointerDown:U(v.onPointerDown,()=>{c||(N.current=T,b.current=!1)}),min:o,max:s,inverted:g,onSlideStart:c?void 0:$,onSlideMove:c?void 0:V,onSlideEnd:c?void 0:q,onHomeKeyDown:()=>{c||(b.current=!0,G(o,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,G(s,T.length-1,{commit:!0}))},onStepKeyDown:({event:k,direction:F})=>{if(!c){b.current=!0;const X=oy.includes(k.key)||k.shiftKey&&sy.includes(k.key)?10:1,A=w.current,B=T[A],Q=vy(B,{min:o,step:i,direction:F,multiplier:X});G(Q,A,{commit:!0})}}})})})})},"Slider")),[ay,cy]=ml(to,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Uk=p.forwardRef(de(function(e,n){const{min:r,max:o,dir:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[h,m]=p.useState(null),g=ce(n,m),y=p.useRef(void 0),v=Ht(s),x=v==="ltr",w=x&&!i||!x&&i;function b(C){const P=y.current||h.getBoundingClientRect(),R=[0,P.width],j=Ls(R,w?[r,o]:[o,r]);return y.current=P,j(C-P.left)}return de(b,"getValueFromPointer"),l.jsx(ay,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:l.jsx(ly,{dir:v,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const P=b(C.clientX);a==null||a(P)},onSlideMove:C=>{const P=b(C.clientX);c==null||c(P)},onSlideEnd:()=>{y.current=void 0,u==null||u()},onStepKeyDown:C=>{const R=iy[w?"from-left":"from-right"].includes(C.key);d==null||d({event:C,direction:R?-1:1})}})})},"SliderHorizontal")),Hk=p.forwardRef(de(function(e,n){const{min:r,max:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=p.useRef(null),h=ce(n,f),m=p.useRef(void 0),g=!s;function y(v){const x=m.current||f.current.getBoundingClientRect(),w=[0,x.height],C=Ls(w,g?[o,r]:[r,o]);return m.current=x,C(v-x.top)}return de(y,"getValueFromPointer"),l.jsx(ay,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:l.jsx(ly,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const x=y(v.clientY);i==null||i(x)},onSlideMove:v=>{const x=y(v.clientY);a==null||a(x)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:v=>{const w=iy[g?"from-bottom":"from-top"].includes(v.key);u==null||u({event:v,direction:w?-1:1})}})})},"SliderVertical")),ly=p.forwardRef(de(function(e,n){const{__scopeSlider:r,onSlideStart:o,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:u,...d}=e,f=no(to,r);return l.jsx(te.span,{...d,ref:n,onKeyDown:U(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(c(h),h.preventDefault()):oy.concat(sy).includes(h.key)&&(u(h),h.preventDefault())}),onPointerDown:U(e.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(h)}),onPointerMove:U(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:U(e.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),i(h))})})},"SliderImpl")),Wk="SliderTrack",Kk=p.forwardRef(de(function(e,n){const{__scopeSlider:r,...o}=e,s=no(Wk,r);return l.jsx(te.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:n})},"SliderTrack")),Gd="SliderRange",Yk=p.forwardRef(de(function(e,n){const{__scopeSlider:r,...o}=e,s=no(Gd,r),i=cy(Gd,r),a=p.useRef(null),c=ce(n,a),u=s.values.length,d=s.values.map(m=>gl(m,s.min,s.max)),f=u>1?Math.min(...d):0,h=100-Math.max(...d);return l.jsx(te.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:c,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:h+"%"}})},"SliderRange")),Xk="SliderThumb",[qk,uy]=ml(Xk),Zk="SliderThumbProvider";function dy(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:o}=t,s=no(Zk,e),i=Vk(e),[a,c]=p.useState(null),u=p.useMemo(()=>a?i().findIndex(v=>v.ref.current===a):-1,[i,a]),d=fr(a),f=a?!!s.form||!!a.closest("form"):!0,h=s.values[u],m=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),g=h===void 0?0:gl(h,s.min,s.max);p.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]);const y={value:h,name:m,form:s.form,isFormControl:f,index:u,thumb:a,onThumbChange:c,percent:g,size:d};return l.jsx(qk,{scope:e,...y,children:xy(o)?o(y):r})}de(dy,"SliderThumbProvider");var Ei="SliderThumbTrigger",Qk=p.forwardRef(de(function(e,n){const{__scopeSlider:r,...o}=e,s=no(Ei,r),i=cy(Ei,r),{index:a,value:c,percent:u,size:d,onThumbChange:f}=uy(Ei,r),h=ce(n,f),m=hy(a,s.values.length),g=d==null?void 0:d[i.size],y=g?my(g,u,i.direction):0;return l.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${u}% + ${y}px)`},children:l.jsx(Aa.ItemSlot,{scope:r,children:l.jsx(te.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":c,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:c===void 0?{display:"none"}:e.style,onFocus:U(e.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})},"SliderThumbTrigger")),Jk=p.forwardRef(de(function(e,n){const{__scopeSlider:r,name:o,...s}=e;return l.jsx(dy,{__scopeSlider:r,name:o,internal_do_not_use_render:({index:i,isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(Qk,{...s,ref:n,__scopeSlider:r}),a?l.jsx(tN,{__scopeSlider:r},i):null]})})},"SliderThumb")),eN="SliderBubbleInput",tN=p.forwardRef(de(function({__scopeSlider:e,...n},r){const{value:o,name:s,form:i}=uy(eN,e),a=p.useRef(null),c=ce(a,r),u=Cc(o);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==o&&m){const g=new Event("input",{bubbles:!0});m.call(d,o),d.dispatchEvent(g)}},[u,o]),l.jsx(te.input,{style:{display:"none"},name:s,form:i,...n,ref:c,defaultValue:o})},"SliderBubbleInput"));function fy(t=[],e,n){const r=[...t];return r[n]=e,r.sort((o,s)=>o-s)}de(fy,"getNextSortedValues");function gl(t,e,n){const s=100/(n-e)*(t-e);return jr(s,[0,100])}de(gl,"convertValueToPercentage");function hy(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}de(hy,"getLabel");function py(t,e){if(t.length===1)return 0;const n=t.map(o=>Math.abs(o-e)),r=Math.min(...n);return n.indexOf(r)}de(py,"getClosestValueIndex");function my(t,e,n){const r=t/2,s=Ls([0,50],[0,r]);return(r-s(e)*n)*n}de(my,"getThumbInBoundsOffset");function gy(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}de(gy,"getStepsBetweenValues");function yy(t,e){if(e>0){const n=gy(t);return Math.min(...n)>=e}return!0}de(yy,"hasMinStepsBetweenValues");function Ls(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}de(Ls,"linearScale");function yl(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,o]=e.split("e"),s=r.split(".")[1]||"",i=Number(o);return Math.max(0,s.length-i)}const n=e.split(".")[1];return n?n.length:0}de(yl,"getDecimalCount");function Sr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}de(Sr,"roundValue");function vy(t,{min:e,step:n,direction:r,multiplier:o}){const s=yl(n),i=(t-e)/n,a=Math.round(i),c=Sr(a*n+e,s)===Sr(t,s);let u;return c?u=a+o*r:r>0?u=Math.ceil(i):u=Math.floor(i),Sr(u*n+e,s)}de(vy,"getNextStepValue");function xy(t){return typeof t=="function"}de(xy,"isFunction");const nN=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",color:s="primary",showValue:i=!1,formatValue:a,value:c,defaultValue:u,...d},f){const h=c??u??[0],m=a??(x=>x),{className:g,style:y,styleTag:v}=ae(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,e);return l.jsxs(zk,{ref:f,className:g,style:y,value:c,defaultValue:u,...d,children:[v,l.jsx(Kk,{className:"cny-slider-track",children:l.jsx(Yk,{className:"cny-slider-range"})}),h.map((x,w)=>l.jsx(Jk,{className:"cny-slider-thumb","aria-label":`Value ${w+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:m(x)})},w))]})}),rN=S.forwardRef(function({steps:e,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:m}=ae(c,a,"cny-stepper",`cny-stepper-${r}`,`cny-stepper-${o}`,i);return l.jsxs("ol",{ref:d,className:f,style:h,"aria-label":"Progress",...u,children:[m,e.map((g,y)=>{const v=y<n?"complete":y===n?"active":"upcoming",x=v==="complete"&&!!s;return l.jsxs("li",{className:H("cny-stepper-step",`is-${v}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:x?()=>s==null?void 0:s(y):void 0,disabled:!x,"aria-current":v==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:v==="complete"?l.jsx(rn,{size:14}):g.icon??y+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:g.label}),g.description&&l.jsx("span",{className:"cny-stepper-desc",children:g.description})]})]}),y<e.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},y)})]})}),oN=S.forwardRef(function({size:e=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const a=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),c=`cny-loader-fade-reveal-${a}`,u=`cny-loader-${a}`;return l.jsxs("div",{ref:i,className:H("cny-loader",u,r),style:{width:e,height:e*(24/21.635),color:n,...o},...s,children:[l.jsx("style",{children:`
209
+ `)},o1=0,Fn=[];function s1(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(o1++)[0],s=p.useState(hm)[0],i=p.useRef(t);p.useEffect(function(){i.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var y=TT([t.lockRef.current],(t.shards||[]).map(Pd),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var x=Co(y),w=n.current,b="deltaX"in y?y.deltaX:w[0]-x[0],C="deltaY"in y?y.deltaY:w[1]-x[1],P,R=y.target,M=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in y&&M==="h"&&R.type==="range")return!1;var j=window.getSelection(),T=j&&j.anchorNode,E=T?T===R||T.contains(R):!1;if(E)return!1;var k=Cd(M,R);if(!k)return!0;if(k?P=M:(P=M==="v"?"h":"v",k=Cd(M,R)),!k)return!1;if(!r.current&&"changedTouches"in y&&(b||C)&&(r.current=P),!P)return!0;var _=r.current||P;return t1(_,v,y,_==="h"?b:C)},[]),c=p.useCallback(function(y){var v=y;if(!(!Fn.length||Fn[Fn.length-1]!==s)){var x="deltaY"in v?Sd(v):Co(v),w=e.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&n1(P.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(Pd).filter(Boolean).filter(function(P){return P.contains(v.target)}),C=b.length>0?a(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(y,v,x,w){var b={name:y,delta:v,target:x,should:w,shadowParent:i1(x)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),d=p.useCallback(function(y){n.current=Co(y),r.current=void 0},[]),f=p.useCallback(function(y){u(y.type,Sd(y),y.target,a(y,t.lockRef.current))},[]),h=p.useCallback(function(y){u(y.type,Co(y),y.target,a(y,t.lockRef.current))},[]);p.useEffect(function(){return Fn.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,$n),document.addEventListener("touchmove",c,$n),document.addEventListener("touchstart",d,$n),function(){Fn=Fn.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,$n),document.removeEventListener("touchmove",c,$n),document.removeEventListener("touchstart",d,$n)}},[]);var m=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:r1(o)}):null,m?p.createElement(YT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function i1(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const a1=_T(fm,s1);var Xr=p.forwardRef(function(t,e){return p.createElement(ws,jt({},t,{ref:e,sideCar:a1}))});Xr.classNames=ws.classNames;var c1=Object.defineProperty,me=(t,e)=>c1(t,"name",{value:e,configurable:!0}),l1=[" ","Enter","ArrowUp","ArrowDown"],u1=[" ","Enter"],er="Select",[Cs,Rc,d1]=cr(er),[In,hN]=Re(er,[d1,dn]),Tc=dn(),[f1,fn]=In(er),[h1,p1]=In(er);function ym(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:g,internal_do_not_use_render:y}=t,v=Tc(e),[x,w]=p.useState(null),[b,C]=p.useState(null),[P,R]=p.useState(!1),M=Ht(u),[j,T]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:er}),[E,k]=Pe({prop:i,defaultProp:a,onChange:c,caller:er}),_=p.useRef(null),$=p.useRef(E);p.useEffect(()=>{const A=g?x==null?void 0:x.ownerDocument.getElementById(g):x==null?void 0:x.form;if(A instanceof HTMLFormElement){const B=me(()=>k($.current),"reset");return A.addEventListener("reset",B),()=>A.removeEventListener("reset",B)}},[g,x,k]);const G=x?!!g||!!x.closest("form"):!0,[Q,V]=p.useState(new Set),I=Fe(),L=Array.from(Q).map(A=>A.props.value).join(";"),O=p.useCallback(A=>{V(B=>new Set(B).add(A))},[]),D=p.useCallback(A=>{V(B=>{const ee=new Set(B);return ee.delete(A),ee})},[]),X={required:m,trigger:x,onTriggerChange:w,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:R,contentId:I,value:E,onValueChange:k,open:j,onOpenChange:T,dir:M,triggerPointerDownPosRef:_,disabled:h,name:d,autoComplete:f,form:g,nativeOptions:Q,nativeSelectKey:L,isFormControl:G};return l.jsx(Wr,{...v,children:l.jsx(f1,{scope:e,...X,children:l.jsx(Cs.Provider,{scope:e,children:l.jsx(h1,{scope:e,onNativeOptionAdd:O,onNativeOptionRemove:D,children:bm(y)?y(X):n})})})})}me(ym,"SelectProvider");var m1=me(t=>{const{__scopeSelect:e,children:n,...r}=t;return l.jsx(ym,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>l.jsxs(l.Fragment,{children:[n,o?l.jsx(W1,{__scopeSelect:e}):null]})})},"Select"),g1="SelectTrigger",y1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Tc(r),a=fn(g1,r),c=a.disabled||o,u=ie(n,a.onTriggerChange),d=Rc(r),f=p.useRef("touch"),[h,m,g]=Mc(v=>{const x=d().filter(C=>!C.disabled),w=x.find(C=>C.value===a.value),b=Ec(x,v,w);b!==void 0&&a.onValueChange(b.value)}),y=me(v=>{c||(a.onOpenChange(!0),g()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})},"handleOpen");return l.jsx(Kr,{asChild:!0,...i,children:l.jsx(re.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":qr(a.value)?"":void 0,...s,ref:u,onClick:U(s.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&y(v)}),onPointerDown:U(s.onPointerDown,v=>{f.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:U(s.onKeyDown,v=>{const x=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&l1.includes(v.key)&&(y(),v.preventDefault())})})})},"SelectTrigger")),v1="SelectValue",x1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...c}=e,u=fn(v1,r),{onValueNodeHasChildrenChange:d}=u,f=i!==void 0,h=ie(n,u.onValueNodeChange);Ee(()=>{d(f)},[d,f]);const m=qr(u.value);return l.jsx(re.span,{...c,asChild:m?!1:c.asChild,ref:h,style:{pointerEvents:"none"},children:l.jsx(p.Fragment,{children:m?a:i},m?"placeholder":"value")})},"SelectValue")),b1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return l.jsx(re.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),w1="SelectPortal",[C1,S1]=In(w1,{forceMount:void 0}),P1=me(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return l.jsx(C1,{scope:t.__scopeSelect,forceMount:n,children:l.jsx(Yr,{asChild:!0,...r})})},"SelectPortal"),En="SelectContent",R1=p.forwardRef(me(function(e,n){const r=S1(En,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=fn(En,e.__scopeSelect),[a,c]=p.useState();return Ee(()=>{c(new DocumentFragment)},[]),l.jsx(Ue,{present:o||i.open,children:({present:u})=>u?l.jsx(E1,{...s,ref:n}):l.jsx(T1,{...s,fragment:a})})},"SelectContent")),T1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Lr.createPortal(l.jsx(vm,{scope:r,children:l.jsx(Cs.Slot,{scope:r,children:l.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),gt=10,[vm,Ss]=In(En),M1=Nt("SelectContent.RemoveScroll"),E1=p.forwardRef(me(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x,...w}=e,b=fn(En,r),[C,P]=p.useState(null),[R,M]=p.useState(null),j=ie(n,P),[T,E]=p.useState(null),[k,_]=p.useState(null),$=Rc(r),[G,Q]=p.useState(!1),V=p.useRef(!1);p.useEffect(()=>{if(C)return bs(C)},[C]),ur();const I=p.useCallback(Y=>{const[z,...Z]=$().map(F=>F.ref.current),[le]=Z.slice(-1),ce=document.activeElement;for(const F of Y)if(F===ce||(F==null||F.scrollIntoView({block:"nearest"}),F===z&&R&&(R.scrollTop=0),F===le&&R&&(R.scrollTop=R.scrollHeight),F==null||F.focus(),document.activeElement!==ce))return},[$,R]),L=p.useCallback(()=>I([T,C]),[I,T,C]);p.useEffect(()=>{G&&L()},[G,L]);const{onOpenChange:O,triggerPointerDownPosRef:D}=b;p.useEffect(()=>{if(C){let Y={x:0,y:0};const z=me(le=>{var ce,F;Y={x:Math.abs(Math.round(le.pageX)-(((ce=D.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(le.pageY)-(((F=D.current)==null?void 0:F.y)??0))}},"handlePointerMove"),Z=me(le=>{Y.x<=10&&Y.y<=10?le.preventDefault():le.composedPath().includes(C)||O(!1),document.removeEventListener("pointermove",z),D.current=null},"handlePointerUp");return D.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",Z,{capture:!0})}}},[C,O,D]),p.useEffect(()=>{const Y=me(()=>O(!1),"close");return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[O]);const[X,A]=Mc(Y=>{const z=$().filter(ce=>!ce.disabled),Z=z.find(ce=>ce.ref.current===document.activeElement),le=Ec(z,Y,Z);le&&setTimeout(()=>{var ce;return(ce=le.ref.current)==null?void 0:ce.focus()})}),B=p.useCallback((Y,z,Z)=>{const le=!V.current&&!Z;(b.value!==void 0&&b.value===z||le)&&(E(Y),le&&(V.current=!0))},[b.value]),ee=p.useCallback(()=>C==null?void 0:C.focus(),[C]),K=p.useCallback((Y,z,Z)=>{const le=!V.current&&!Z;(b.value!==void 0&&b.value===z||le)&&_(Y)},[b.value]),H=o==="popper"?Rd:j1,oe=H===Rd?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x}:{};return l.jsx(vm,{scope:r,content:C,viewport:R,onViewportChange:M,itemRefCallback:B,selectedItem:T,onItemLeave:ee,itemTextRefCallback:K,focusSelectedItem:L,selectedItemText:k,position:o,isPositioned:G,searchRef:X,children:l.jsx(Xr,{as:M1,allowPinchZoom:!0,children:l.jsx(hs,{asChild:!0,trapped:b.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:U(s,Y=>{var z;(z=b.trigger)==null||z.focus({preventScroll:!0}),Y.preventDefault()}),children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Y=>Y.preventDefault(),...w,...oe,onPlaced:()=>Q(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:U(w.onKeyDown,Y=>{const z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!z&&Y.key.length===1&&A(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let le=$().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ce=Y.target,F=le.indexOf(ce);le=le.slice(F+1)}setTimeout(()=>I(le)),Y.preventDefault()}})})})})})})},"SelectContentImpl")),j1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=fn(En,r),a=Ss(En,r),[c,u]=p.useState(null),[d,f]=p.useState(null),h=ie(n,f),m=Rc(r),g=p.useRef(!1),y=p.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:w,focusSelectedItem:b}=a,C=p.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&v&&x&&w){const j=i.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),k=w.getBoundingClientRect();if(i.dir!=="rtl"){const ce=k.left-T.left,F=E.left-ce,q=j.left-F,he=j.width+q,ue=Math.max(he,T.width),He=window.innerWidth-gt,ve=Ar(F,[gt,Math.max(gt,He-ue)]);c.style.minWidth=he+"px",c.style.left=ve+"px"}else{const ce=T.right-k.right,F=window.innerWidth-E.right-ce,q=window.innerWidth-j.right-F,he=j.width+q,ue=Math.max(he,T.width),He=window.innerWidth-gt,ve=Ar(F,[gt,Math.max(gt,He-ue)]);c.style.minWidth=he+"px",c.style.right=ve+"px"}const _=m(),$=window.innerHeight-gt*2,G=v.scrollHeight,Q=window.getComputedStyle(d),V=parseInt(Q.borderTopWidth,10),I=parseInt(Q.paddingTop,10),L=parseInt(Q.borderBottomWidth,10),O=parseInt(Q.paddingBottom,10),D=V+I+G+O+L,X=Math.min(x.offsetHeight*5,D),A=window.getComputedStyle(v),B=parseInt(A.paddingTop,10),ee=parseInt(A.paddingBottom,10),K=j.top+j.height/2-gt,H=$-K,oe=x.offsetHeight/2,Y=x.offsetTop+oe,z=V+I+Y,Z=D-z;if(z<=K){const ce=_.length>0&&x===_[_.length-1].ref.current;c.style.bottom="0px";const F=d.clientHeight-v.offsetTop-v.offsetHeight,q=Math.max(H,oe+(ce?ee:0)+F+L),he=z+q;c.style.height=he+"px"}else{const ce=_.length>0&&x===_[0].ref.current;c.style.top="0px";const q=Math.max(K,V+v.offsetTop+(ce?B:0)+oe)+Z;c.style.height=q+"px",v.scrollTop=z-K+v.offsetTop}c.style.margin=`${gt}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=$+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,c,d,v,x,w,i.dir,o]);Ee(()=>C(),[C]);const[P,R]=p.useState();Ee(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const M=p.useCallback(j=>{j&&y.current===!0&&(C(),b==null||b(),y.current=!1)},[C,b]);return l.jsx(A1,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:M,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:l.jsx(re.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),Rd=p.forwardRef(me(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=gt,...i}=e,a=Tc(r);return l.jsx(xs,{...a,...i,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[A1,D1]=In(En,{}),Td="SelectViewport",I1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=Ss(Td,r),a=D1(Td,r),c=ie(n,i.onViewportChange),u=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Cs.Slot,{scope:r,children:l.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:U(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const g=Math.abs(u.current-f.scrollTop);if(g>0){const y=window.innerHeight-gt*2,v=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),w=Math.max(v,x);if(w<y){const b=w+g,C=Math.min(y,b),P=b-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=P>0?P:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})},"SelectViewport")),k1="SelectGroup",[N1,_1]=In(k1),O1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=Fe();return l.jsx(N1,{scope:r,id:s,children:l.jsx(re.div,{role:"group","aria-labelledby":s,...o,ref:n})})},"SelectGroup")),L1="SelectLabel",$1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=_1(L1,r);return l.jsx(re.div,{id:s.id,...o,ref:n})},"SelectLabel")),va="SelectItem",[F1,xm]=In(va),V1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,c=fn(va,r),u=Ss(va,r),d=c.value===o,[f,h]=p.useState(i??""),[m,g]=p.useState(!1),y=Qe(C=>{var P;return(P=u.itemRefCallback)==null?void 0:P.call(u,C,o,s)}),v=ie(n,y),x=Fe(),w=p.useRef("touch"),b=me(()=>{s||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return l.jsx(F1,{scope:r,value:o,disabled:s,textId:x,isSelected:d,onItemTextChange:p.useCallback(C=>{h(P=>P||((C==null?void 0:C.textContent)??"").trim())},[]),children:l.jsx(Cs.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:l.jsx(re.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:v,onFocus:U(a.onFocus,()=>g(!0)),onBlur:U(a.onBlur,()=>g(!1)),onClick:U(a.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:U(a.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:U(a.onPointerDown,C=>{w.current=C.pointerType}),onPointerMove:U(a.onPointerMove,C=>{var P;w.current=C.pointerType,s?(P=u.onItemLeave)==null||P.call(u):w.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(a.onPointerLeave,C=>{var P;C.currentTarget===document.activeElement&&((P=u.onItemLeave)==null||P.call(u))}),onKeyDown:U(a.onKeyDown,C=>{var R;s||C.target!==C.currentTarget||((R=u.searchRef)==null?void 0:R.current)!==""&&C.key===" "||(u1.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})},"SelectItem")),So="SelectItemText",B1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=fn(So,r),c=Ss(So,r),u=xm(So,r),d=p1(So,r),[f,h]=p.useState(null),m=Qe(b=>{var C;return(C=c.itemTextRefCallback)==null?void 0:C.call(c,b,u.value,u.disabled)}),g=ie(n,h,u.onItemTextChange,m),y=f==null?void 0:f.textContent,v=p.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return Ee(()=>(x(v),()=>w(v)),[x,w,v]),l.jsxs(l.Fragment,{children:[l.jsx(re.span,{id:u.textId,...i,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!qr(a.value)?Lr.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),G1="SelectItemIndicator",z1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return xm(G1,r).isSelected?l.jsx(re.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),U1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return l.jsx(re.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),H1="SelectBubbleInput",W1=p.forwardRef(me(function({__scopeSelect:e,...n},r){const o=fn(H1,e),{value:s,onValueChange:i,required:a,disabled:c,name:u,autoComplete:d,form:f}=o,{nativeOptions:h,nativeSelectKey:m}=o,g=p.useRef(null),y=ie(r,g),v=s??"",x=Pc(v),w=Array.from(h).some(b=>(b.props.value??"")==="");return p.useEffect(()=>{const b=g.current;if(!b)return;const C=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(C,"value").set;if(x!==v&&R){const M=new Event("change",{bubbles:!0});R.call(b,v),b.dispatchEvent(M)}},[x,v]),l.jsxs(re.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:b=>i(b.target.value),...n,style:{...am,...n.style},ref:y,defaultValue:v,children:[qr(s)&&!w?l.jsx("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function bm(t){return typeof t=="function"}me(bm,"isFunction");function qr(t){return t===""||t===void 0}me(qr,"shouldShowPlaceholder");function Mc(t){const e=Qe(t),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;e(a),me((function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch")(a)},[e]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}me(Mc,"useTypeaheadSearch");function Ec(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=wm(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}me(Ec,"findNextItem");function wm(t,e){return t.map((n,r)=>t[(e+r)%t.length])}me(wm,"wrapArray");function K1({placeholder:t,size:e,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,style:c,sx:u,disabled:d,children:f,"aria-invalid":h,"aria-describedby":m,...g}){const{className:y,style:v,styleTag:x}=se(u,c,"cny-select-trigger",e==="sm"||e==="lg"?e:null,n!=="primary"&&n,a,o),w=Ia();return l.jsxs(m1,{disabled:d,...g,children:[l.jsxs(y1,{id:i,"aria-invalid":h,"aria-describedby":m,className:y,style:v,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(x1,{placeholder:t}),l.jsx(b1,{className:"cny-select-chevron",asChild:!0,children:l.jsx(zr,{size:14,"aria-hidden":"true"})})]}),l.jsx(P1,{children:l.jsx(R1,{position:"popper",sideOffset:4,className:W("cny-select-content",s),children:l.jsx(I1,{className:"cny-select-viewport",nonce:w,children:f})})})]})}const Y1=S.forwardRef(function({className:e,children:n,...r},o){return l.jsxs(V1,{ref:o,className:W("cny-select-item",e),...r,children:[l.jsx(B1,{children:n}),l.jsx(z1,{className:"cny-select-indicator",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]})}),X1=S.forwardRef(function(e,n){return l.jsx(O1,{ref:n,...e})}),q1=S.forwardRef(function({className:e,...n},r){return l.jsx($1,{ref:r,className:W("cny-select-group-label",e),...n})}),Z1=S.forwardRef(function({className:e,...n},r){return l.jsx(U1,{ref:r,className:W("cny-select-separator",e),...n})});var Q1=Object.defineProperty,Ct=(t,e)=>Q1(t,"name",{value:e,configurable:!0}),jc="Popover",[Cm,pN]=Re(jc,[dn]),Zr=dn(),[J1,hn]=Cm(jc),eM=Ct(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=t,a=Zr(e),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:jc});return l.jsx(Wr,{...a,children:l.jsx(J1,{scope:e,contentId:Fe(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),tM="PopoverAnchor",nM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(tM,r),i=Zr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=s;return p.useEffect(()=>(a(),()=>c()),[a,c]),l.jsx(Kr,{...i,...o,ref:n})},"PopoverAnchor")),rM="PopoverTrigger",oM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(rM,r),i=Zr(r),a=ie(n,s.triggerRef),c=l.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ac(s.open),...o,ref:a,onClick:U(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:l.jsx(Kr,{asChild:!0,...i,children:c})},"PopoverTrigger")),Sm="PopoverPortal",[sM,iM]=Cm(Sm,{forceMount:void 0}),aM=Ct(t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,s=hn(Sm,e);return l.jsx(sM,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),Ir="PopoverContent",cM=p.forwardRef(Ct(function(e,n){const r=iM(Ir,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,i=hn(Ir,e.__scopePopover);return l.jsx(Ue,{present:o||i.open,children:i.modal?l.jsx(uM,{...s,ref:n}):l.jsx(dM,{...s,ref:n})})},"PopoverContent")),lM=Nt("PopoverContent.RemoveScroll"),uM=p.forwardRef(Ct(function(e,n){const r=hn(Ir,e.__scopePopover),o=p.useRef(null),s=ie(n,o),i=p.useRef(!1);return p.useEffect(()=>{const a=o.current;if(a)return bs(a)},[]),l.jsx(Xr,{as:lM,allowPinchZoom:!0,children:l.jsx(Pm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:U(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),dM=p.forwardRef(Ct(function(e,n){const r=hn(Ir,e.__scopePopover),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Pm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"PopoverContentNonModal")),Pm=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=e,m=hn(Ir,r),g=Zr(r);return ur(),l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:l.jsx(xs,{"data-state":Ac(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),fM="PopoverClose",hM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(fM,r);return l.jsx(re.button,{type:"button",...o,ref:n,onClick:U(e.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),pM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=Zr(r);return l.jsx(nm,{...s,...o,ref:n})},"PopoverArrow"));function Ac(t){return t?"open":"closed"}Ct(Ac,"getState");var Dc=eM,mM=nM,Ic=oM,kc=aM,Nc=cM,gM=hM,yM=pM,Md=1,vM=.9,xM=.8,bM=.17,wi=.1,Ci=.999,wM=.9999,CM=.99,SM=/[\\\/_+.#"@\[\(\{&]/,PM=/[\\\/_+.#"@\[\(\{&]/g,RM=/[\s-]/,Rm=/[\s-]/g;function xa(t,e,n,r,o,s,i){if(s===e.length)return o===t.length?Md:CM;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,g;u>=0;)f=xa(t,e,n,r,u+1,s+1,i),f>d&&(u===o?f*=Md:SM.test(t.charAt(u-1))?(f*=xM,m=t.slice(o,u-1).match(PM),m&&o>0&&(f*=Math.pow(Ci,m.length))):RM.test(t.charAt(u-1))?(f*=vM,g=t.slice(o,u-1).match(Rm),g&&o>0&&(f*=Math.pow(Ci,g.length))):(f*=bM,o>0&&(f*=Math.pow(Ci,u-o))),t.charAt(u)!==e.charAt(s)&&(f*=wM)),(f<wi&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=xa(t,e,n,r,u+1,s+2,i),h*wi>f&&(f=h*wi)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Ed(t){return t.toLowerCase().replace(Rm," ")}function TM(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,xa(t,e,Ed(t),Ed(e),0,0,{})}var MM=Object.defineProperty,ut=(t,e)=>MM(t,"name",{value:e,configurable:!0}),_c="Dialog",[Tm,mN]=Re(_c),[EM,St]=Tm(_c),Oc=ut(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=p.useRef(null),c=p.useRef(null),[u,d]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:_c}),[f,h]=p.useState(0),[m,g]=p.useState(0);return l.jsx(EM,{scope:e,triggerRef:a,contentRef:c,contentId:Fe(),titleId:Fe(),descriptionId:Fe(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:g,open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(y=>!y),[d]),modal:i,children:n})},"Dialog"),jM="DialogTrigger",Mm=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(jM,r),i=ie(n,s.triggerRef);return l.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Rs(s.open),...o,ref:i,onClick:U(e.onClick,s.onOpenToggle)})},"DialogTrigger")),Em="DialogPortal",[AM,jm]=Tm(Em,{forceMount:void 0}),Lc=ut(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=St(Em,e);return l.jsx(AM,{scope:e,forceMount:n,children:p.Children.map(r,i=>l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),ba="DialogOverlay",$c=p.forwardRef(ut(function(e,n){const r=jm(ba,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(ba,e.__scopeDialog);return i.modal?l.jsx(Ue,{present:o||i.open,children:l.jsx(IM,{...s,ref:n})}):null},"DialogOverlay")),DM=Nt("DialogOverlay.RemoveScroll"),IM=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(ba,r),i=Dp(),a=ie(n,i);return l.jsx(Xr,{as:DM,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(re.div,{"data-state":Rs(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),kr="DialogContent",Fc=p.forwardRef(ut(function(e,n){const r=jm(kr,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(kr,e.__scopeDialog);return l.jsx(Ue,{present:o||i.open,children:i.modal?l.jsx(kM,{...s,ref:n}):l.jsx(NM,{...s,ref:n})})},"DialogContent")),kM=p.forwardRef(ut(function(e,n){const r=St(kr,e.__scopeDialog),o=p.useRef(null),s=ie(n,r.contentRef,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(Am,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:U(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:U(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),NM=p.forwardRef(ut(function(e,n){const r=St(kr,e.__scopeDialog),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Am,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Am=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,c=St(kr,r);return ur(),l.jsx(l.Fragment,{children:l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Ur,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Rs(c.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),_M="DialogTitle",Vc=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(_M,r),{setTitleCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(re.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),OM="DialogDescription",Bc=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(OM,r),{setDescriptionCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(re.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),LM="DialogClose",Ps=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(LM,r);return l.jsx(re.button,{type:"button",...o,ref:n,onClick:U(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Rs(t){return t?"open":"closed"}ut(Rs,"getState");function jd(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function tr(...t){return e=>{let n=!1;const r=t.map(o=>{const s=jd(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():jd(t[o],null)}}}}function $M(t){const e=FM(t),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(BM);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(e,{...i,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function FM(t){const e=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=zM(o),a=GM(s,o.props);return o.type!==p.Fragment&&(a.ref=r?tr(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var VM=Symbol("radix.slottable");function BM(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===VM}function GM(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function zM(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var UM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=UM.reduce((t,e)=>{const n=$M(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),HM=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},WM=p[" useId ".trim().toString()]||(()=>{}),KM=0;function qn(t){const[e,n]=p.useState(WM());return HM(()=>{n(r=>r??String(KM++))},[t]),e?`radix-${e}`:""}var vr='[cmdk-group=""]',Si='[cmdk-group-items=""]',YM='[cmdk-group-heading=""]',Dm='[cmdk-item=""]',Ad=`${Dm}:not([aria-disabled="true"])`,wa="cmdk-item-select",Gn="data-value",XM=(t,e,n)=>TM(t,e,n),Im=p.createContext(void 0),Qr=()=>p.useContext(Im),km=p.createContext(void 0),Gc=()=>p.useContext(km),Nm=p.createContext(void 0),_m=p.forwardRef((t,e)=>{let n=zn(()=>{var A,B;return{search:"",value:(B=(A=t.value)!=null?A:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=zn(()=>new Set),o=zn(()=>new Map),s=zn(()=>new Map),i=zn(()=>new Set),a=Om(t),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:g,disablePointerSelection:y=!1,vimBindings:v=!0,...x}=t,w=qn(),b=qn(),C=qn(),P=p.useRef(null),R=iE();jn(()=>{if(d!==void 0){let A=d.trim();n.current.value=A,M.emit()}},[d]),jn(()=>{R(6,$)},[]);let M=p.useMemo(()=>({subscribe:A=>(i.current.add(A),()=>i.current.delete(A)),snapshot:()=>n.current,setState:(A,B,ee)=>{var K,H,oe,Y;if(!Object.is(n.current[A],B)){if(n.current[A]=B,A==="search")_(),E(),R(1,k);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let z=document.getElementById(C);z?z.focus():(K=document.getElementById(w))==null||K.focus()}if(R(7,()=>{var z;n.current.selectedItemId=(z=G())==null?void 0:z.id,M.emit()}),ee||R(5,$),((H=a.current)==null?void 0:H.value)!==void 0){let z=B??"";(Y=(oe=a.current).onValueChange)==null||Y.call(oe,z);return}}M.emit()}},emit:()=>{i.current.forEach(A=>A())}}),[]),j=p.useMemo(()=>({value:(A,B,ee)=>{var K;B!==((K=s.current.get(A))==null?void 0:K.value)&&(s.current.set(A,{value:B,keywords:ee}),n.current.filtered.items.set(A,T(B,ee)),R(2,()=>{E(),M.emit()}))},item:(A,B)=>(r.current.add(A),B&&(o.current.has(B)?o.current.get(B).add(A):o.current.set(B,new Set([A]))),R(3,()=>{_(),E(),n.current.value||k(),M.emit()}),()=>{s.current.delete(A),r.current.delete(A),n.current.filtered.items.delete(A);let ee=G();R(4,()=>{_(),(ee==null?void 0:ee.getAttribute("id"))===A&&k(),M.emit()})}),group:A=>(o.current.has(A)||o.current.set(A,new Set),()=>{s.current.delete(A),o.current.delete(A)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:b,listInnerRef:P}),[]);function T(A,B){var ee,K;let H=(K=(ee=a.current)==null?void 0:ee.filter)!=null?K:XM;return A?H(A,n.current.search,B):0}function E(){if(!n.current.search||a.current.shouldFilter===!1)return;let A=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(K=>{let H=o.current.get(K),oe=0;H.forEach(Y=>{let z=A.get(Y);oe=Math.max(z,oe)}),B.push([K,oe])});let ee=P.current;Q().sort((K,H)=>{var oe,Y;let z=K.getAttribute("id"),Z=H.getAttribute("id");return((oe=A.get(Z))!=null?oe:0)-((Y=A.get(z))!=null?Y:0)}).forEach(K=>{let H=K.closest(Si);H?H.appendChild(K.parentElement===H?K:K.closest(`${Si} > *`)):ee.appendChild(K.parentElement===ee?K:K.closest(`${Si} > *`))}),B.sort((K,H)=>H[1]-K[1]).forEach(K=>{var H;let oe=(H=P.current)==null?void 0:H.querySelector(`${vr}[${Gn}="${encodeURIComponent(K[0])}"]`);oe==null||oe.parentElement.appendChild(oe)})}function k(){let A=Q().find(ee=>ee.getAttribute("aria-disabled")!=="true"),B=A==null?void 0:A.getAttribute(Gn);M.setState("value",B||void 0)}function _(){var A,B,ee,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let H=0;for(let oe of r.current){let Y=(B=(A=s.current.get(oe))==null?void 0:A.value)!=null?B:"",z=(K=(ee=s.current.get(oe))==null?void 0:ee.keywords)!=null?K:[],Z=T(Y,z);n.current.filtered.items.set(oe,Z),Z>0&&H++}for(let[oe,Y]of o.current)for(let z of Y)if(n.current.filtered.items.get(z)>0){n.current.filtered.groups.add(oe);break}n.current.filtered.count=H}function $(){var A,B,ee;let K=G();K&&(((A=K.parentElement)==null?void 0:A.firstChild)===K&&((ee=(B=K.closest(vr))==null?void 0:B.querySelector(YM))==null||ee.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function G(){var A;return(A=P.current)==null?void 0:A.querySelector(`${Dm}[aria-selected="true"]`)}function Q(){var A;return Array.from(((A=P.current)==null?void 0:A.querySelectorAll(Ad))||[])}function V(A){let B=Q()[A];B&&M.setState("value",B.getAttribute(Gn))}function I(A){var B;let ee=G(),K=Q(),H=K.findIndex(Y=>Y===ee),oe=K[H+A];(B=a.current)!=null&&B.loop&&(oe=H+A<0?K[K.length-1]:H+A===K.length?K[0]:K[H+A]),oe&&M.setState("value",oe.getAttribute(Gn))}function L(A){let B=G(),ee=B==null?void 0:B.closest(vr),K;for(;ee&&!K;)ee=A>0?oE(ee,vr):sE(ee,vr),K=ee==null?void 0:ee.querySelector(Ad);K?M.setState("value",K.getAttribute(Gn)):I(A)}let O=()=>V(Q().length-1),D=A=>{A.preventDefault(),A.metaKey?O():A.altKey?L(1):I(1)},X=A=>{A.preventDefault(),A.metaKey?V(0):A.altKey?L(-1):I(-1)};return p.createElement(pn.div,{ref:e,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:A=>{var B;(B=x.onKeyDown)==null||B.call(x,A);let ee=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||ee))switch(A.key){case"n":case"j":{v&&A.ctrlKey&&D(A);break}case"ArrowDown":{D(A);break}case"p":case"k":{v&&A.ctrlKey&&X(A);break}case"ArrowUp":{X(A);break}case"Home":{A.preventDefault(),V(0);break}case"End":{A.preventDefault(),O();break}case"Enter":{A.preventDefault();let K=G();if(K){let H=new Event(wa);K.dispatchEvent(H)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:cE},c),Ts(t,A=>p.createElement(km.Provider,{value:M},p.createElement(Im.Provider,{value:j},A))))}),qM=p.forwardRef((t,e)=>{var n,r;let o=qn(),s=p.useRef(null),i=p.useContext(Nm),a=Qr(),c=Om(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;jn(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=Lm(o,s,[t.value,t.children,s],t.keywords),f=Gc(),h=an(R=>R.value&&R.value===d.current),m=an(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);p.useEffect(()=>{let R=s.current;if(!(!R||t.disabled))return R.addEventListener(wa,g),()=>R.removeEventListener(wa,g)},[m,t.onSelect,t.disabled]);function g(){var R,M;y(),(M=(R=c.current).onSelect)==null||M.call(R,d.current)}function y(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:w,forceMount:b,keywords:C,...P}=t;return p.createElement(pn.div,{ref:tr(s,e),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:y,onClick:v?void 0:g},t.children)}),ZM=p.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...s}=t,i=qn(),a=p.useRef(null),c=p.useRef(null),u=qn(),d=Qr(),f=an(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);jn(()=>d.group(i),[]),Lm(i,a,[t.value,t.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(pn.div,{ref:tr(a,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ts(t,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(Nm.Provider,{value:h},m))))}),QM=p.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=p.useRef(null),s=an(i=>!i.search);return!n&&!s?null:p.createElement(pn.div,{ref:tr(o,e),...r,"cmdk-separator":"",role:"separator"})}),JM=p.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,s=Gc(),i=an(u=>u.search),a=an(u=>u.selectedItemId),c=Qr();return p.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),p.createElement(pn.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?t.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),eE=p.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,s=p.useRef(null),i=p.useRef(null),a=an(u=>u.selectedItemId),c=Qr();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(pn.div,{ref:tr(s,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Ts(t,u=>p.createElement("div",{ref:tr(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),tE=p.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=t;return p.createElement(Oc,{open:n,onOpenChange:r},p.createElement(Lc,{container:i},p.createElement($c,{"cmdk-overlay":"",className:o}),p.createElement(Fc,{"aria-label":t.label,"cmdk-dialog":"",className:s},p.createElement(_m,{ref:e,...a}))))}),nE=p.forwardRef((t,e)=>an(n=>n.filtered.count===0)?p.createElement(pn.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),rE=p.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...s}=t;return p.createElement(pn.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ts(t,i=>p.createElement("div",{"aria-hidden":!0},i)))}),De=Object.assign(_m,{List:eE,Item:qM,Input:JM,Group:ZM,Separator:QM,Dialog:tE,Empty:nE,Loading:rE});function oE(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function sE(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Om(t){let e=p.useRef(t);return jn(()=>{e.current=t}),e}var jn=typeof window>"u"?p.useEffect:p.useLayoutEffect;function zn(t){let e=p.useRef();return e.current===void 0&&(e.current=t()),e}function an(t){let e=Gc(),n=()=>t(e.snapshot());return p.useSyncExternalStore(e.subscribe,n,n)}function Lm(t,e,n,r=[]){let o=p.useRef(),s=Qr();return jn(()=>{var i;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(t,a,c),(i=e.current)==null||i.setAttribute(Gn,a),o.current=a}),o}var iE=()=>{let[t,e]=p.useState(),n=zn(()=>new Map);return jn(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function aE(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Ts({asChild:t,children:e},n){return t&&p.isValidElement(e)?p.cloneElement(aE(e),{ref:e.ref},n(e.props.children)):n(e)}var cE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function lE({options:t,value:e,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:u="primary",disabled:d=!1,id:f,className:h,style:m,sx:g,"aria-invalid":y,"aria-describedby":v,"aria-label":x}){const[w,b]=S.useState(!1),[C,P]=S.useState(n??[]),[R,M]=S.useState(""),j=S.useRef(null),T=e??C,E=S.useCallback(D=>{e===void 0&&P(D),r==null||r(D)},[e,r]),k=S.useCallback(D=>{T.includes(D)?E(T.filter(X=>X!==D)):(a==null||T.length<a)&&E([...T,D])},[T,E,a]),_=S.useCallback(D=>E(T.filter(X=>X!==D)),[T,E]),$=S.useMemo(()=>{const D=new Map;for(const X of t)D.set(X.value,X);return D},[t]),G=S.useMemo(()=>{const D=new Map;for(const X of t){const A=X.group??"";D.has(A)||D.set(A,[]),D.get(A).push(X)}return D},[t]),Q=D=>{D.key==="Backspace"&&R===""&&T.length>0&&(D.preventDefault(),_(T[T.length-1]))};S.useEffect(()=>{w&&queueMicrotask(()=>{var D;return(D=j.current)==null?void 0:D.focus()})},[w]);const{className:V,style:I,styleTag:L}=se(g,m,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),O=a!=null&&T.length>=a;return l.jsxs(Dc,{open:w,onOpenChange:D=>!d&&b(D),children:[l.jsx(Ic,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-invalid":y,"aria-describedby":v,"aria-label":x,"data-state":w?"open":"closed","data-disabled":d||void 0,id:f,className:V,style:I,onClick:()=>!d&&b(D=>!D),tabIndex:d?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!w&&(D.preventDefault(),b(!0))},children:[L,T.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(D=>{const X=$.get(D);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(X==null?void 0:X.label)??D}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(X==null?void 0:X.label)??D}`,onClick:A=>{A.stopPropagation(),_(D)},children:l.jsx(Wt,{size:12,"aria-hidden":"true"})})]},D)}),l.jsx(zr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(kc,{children:l.jsx(Nc,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:l.jsxs(De,{shouldFilter:!0,label:"Options",children:[l.jsx(De.Input,{ref:j,placeholder:s,value:R,onValueChange:M,onKeyDown:Q}),l.jsxs(De.List,{children:[l.jsx(De.Empty,{children:i}),Array.from(G.entries()).map(([D,X])=>l.jsx(De.Group,{heading:D||void 0,children:X.map(A=>{const B=T.includes(A.value),ee=A.disabled||!B&&O;return l.jsxs(De.Item,{value:`${A.label} ${A.description??""} ${A.value}`,disabled:ee,onSelect:()=>k(A.value),children:[A.icon&&l.jsx("span",{style:{display:"inline-flex"},children:A.icon}),l.jsx("span",{children:A.label}),A.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:A.description}),B&&l.jsx("span",{className:"cny-check",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]},A.value)})},D||"default"))]})]})})})]})}var uE=Object.defineProperty,Ut=(t,e)=>uE(t,"name",{value:e,configurable:!0}),zc="Checkbox",[dE,gN]=Re(zc),[fE,Uc]=dE(zc);function $m(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Pe({prop:n,defaultProp:o??!1,onChange:c,caller:zc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:Ft(o)?!1:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(fE,{scope:e,...R,children:Fm(f)?f(R):r})}Ut($m,"CheckboxProvider");var hE="CheckboxTrigger",pE=p.forwardRef(Ut(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},s){const{control:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Uc(hE,e),x=ie(s,f),w=p.useRef(u);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const C=Ut(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[i,h]),l.jsx(re.button,{type:"button",role:"checkbox","aria-checked":Ft(u)?"mixed":u,"aria-required":d,"data-state":Hc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:x,onKeyDown:U(n,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:U(r,b=>{g(),h(C=>Ft(C)?!0:!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"CheckboxTrigger")),Dd=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx($m,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(pE,{...h,ref:n,__scopeCheckbox:r}),m&&l.jsx(vE,{__scopeCheckbox:r})]})})},"Checkbox")),mE="CheckboxIndicator",gE=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,forceMount:o,...s}=e,i=Uc(mE,r);return l.jsx(Ue,{present:o||Ft(i.checked)||i.checked===!0,children:l.jsx(re.span,{"data-state":Hc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),yE="CheckboxBubbleInput",vE=p.forwardRef(Ut(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Uc(yE,e),x=ie(o,v),w=hr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,k=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(k&&i.current);if(_&&E){b.current=!k;const G=new Event("click",{bubbles:$});M.indeterminate=Ft(c),E.call(M,Ft(c)?!1:c),M.dispatchEvent(G),b.current=!1}},[y,c,i,a]);const R=p.useRef(Ft(c)?!1:c);return l.jsx(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:U(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Fm(t){return typeof t=="function"}Ut(Fm,"isFunction");function Ft(t){return t==="indeterminate"}Ut(Ft,"isIndeterminate");function Hc(t){return Ft(t)?"indeterminate":t?"checked":"unchecked"}Ut(Hc,"getState");const Ca=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){const a=l.jsx(gE,{children:s.checked==="indeterminate"?l.jsx(XS,{size:12,"aria-hidden":"true"}):l.jsx(rn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:m}=se(r,n,"checkbox",e);return l.jsxs(Dd,{ref:i,className:f,style:h,...s,children:[m,a]})}const{className:c,style:u,styleTag:d}=se(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(Dd,{ref:i,className:W("checkbox",e),...s,children:a}),l.jsx("span",{children:o})]})});var xE=Object.defineProperty,ze=(t,e)=>xE(t,"name",{value:e,configurable:!0}),Vm="Radio",[bE,Bm]=Re(Vm),[wE,Ms]=bE(Vm);function Gm(t){const{__scopeRadio:e,checked:n=!1,children:r,disabled:o,form:s,name:i,onCheck:a,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=p.useState(null),[m,g]=p.useState(null),y=p.useRef(!1),[v,x]=p.useReducer(C=>C+1,0),w=f?!!s||!!f.closest("form"):!0,b={checked:n,disabled:o,required:c,name:i,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:y,userInteractionCount:v,onUserInteraction:x,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:ze(()=>a==null?void 0:a(),"onCheck")};return l.jsx(wE,{scope:e,...b,children:zm(d)?d(b):r})}ze(Gm,"RadioProvider");var CE="RadioTrigger",SE=p.forwardRef(ze(function({__scopeRadio:e,onClick:n,...r},o){const{checked:s,disabled:i,value:a,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=Ms(CE,e),g=ie(o,c);return l.jsx(re.button,{type:"button",role:"radio","aria-checked":s,"data-state":Wc(s),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:g,onClick:U(n,y=>{s||(f(),u()),m&&h&&(d.current=y.isPropagationStopped(),d.current||y.stopPropagation())})})},"RadioTrigger")),PE="RadioIndicator",RE=p.forwardRef(ze(function(e,n){const{__scopeRadio:r,forceMount:o,...s}=e,i=Ms(PE,r);return l.jsx(Ue,{present:o||i.checked,children:l.jsx(re.span,{"data-state":Wc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),TE="RadioBubbleInput",ME=p.forwardRef(ze(function({__scopeRadio:e,onClick:n,...r},o){const{control:s,checked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:y}=Ms(TE,e),v=ie(o,m),x=hr(s),w=p.useRef(!1),b=p.useRef(i),C=p.useRef(y);p.useEffect(()=>{const R=h;if(!R)return;const M=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(M,"checked").set,E=y!==C.current;C.current=y;const k=b.current!==i;b.current=i;const _=!(E&&g.current);if(k&&T){w.current=!E;const $=new Event("click",{bubbles:_});T.call(R,i),R.dispatchEvent($),w.current=!1}},[h,i,g,y]);const P=p.useRef(i);return l.jsx(re.input,{type:"radio","aria-hidden":!0,defaultChecked:P.current,required:a,disabled:c,name:u,value:d,form:f,...r,tabIndex:-1,ref:v,onClick:U(n,R=>{w.current&&R.stopPropagation()}),style:{...r.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function zm(t){return typeof t=="function"}ze(zm,"isFunction");function Wc(t){return t?"checked":"unchecked"}ze(Wc,"getState");var EE=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Kc="RadioGroup",[jE,yN]=Re(Kc,[un,Bm]),Um=un(),Es=Bm(),[AE,DE]=jE(Kc),IE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,name:o,form:s,defaultValue:i,value:a,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=e,y=Um(r),v=Ht(f),[x,w]=Pe({prop:a,defaultProp:i??null,onChange:m,caller:Kc}),[b,C]=p.useState(null),P=ie(n,C),R=p.useRef(x);return p.useEffect(()=>{const M=s?b==null?void 0:b.ownerDocument.getElementById(s):b==null?void 0:b.closest("form");if(M instanceof HTMLFormElement){const j=ze(()=>w(R.current),"reset");return M.addEventListener("reset",j),()=>M.removeEventListener("reset",j)}},[b,s,w]),l.jsx(AE,{scope:r,name:o,form:s,required:c,disabled:u,value:x,onValueChange:w,children:l.jsx(ds,{asChild:!0,...y,orientation:d,dir:v,loop:h,children:l.jsx(re.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:P})})})},"RadioGroup")),kE="RadioGroupItemProvider",NE="RadioGroupItemTrigger";function Hm(t){const{__scopeRadioGroup:e,value:n,disabled:r,children:o,internal_do_not_use_render:s}=t,i=DE(kE,e),a=Es(e),c=i.disabled||r;return l.jsx(Gm,{...a,checked:i.value===n,disabled:c,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:s,children:o})}ze(Hm,"RadioGroupItemProvider");var _E=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Um(r),i=Es(r),{checked:a,disabled:c}=Ms(NE,i.__scopeRadio),u=p.useRef(null),d=ie(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=ze(g=>{EE.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=ze(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),l.jsx(fs,{asChild:!0,...s,focusable:!c,active:a,children:l.jsx(SE,{...i,...o,ref:d,onKeyDown:U(o.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:U(o.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),Id=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,value:o,disabled:s,...i}=e;return l.jsx(Hm,{__scopeRadioGroup:r,value:o,disabled:s,internal_do_not_use_render:({isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(_E,{...i,ref:n,__scopeRadioGroup:r}),a&&l.jsx(OE,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),OE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(ME,{...s,...o,ref:n})},"RadioGroupItemBubbleInput")),kd=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(RE,{...s,...o,ref:n})},"RadioGroupIndicator"));const LE=S.forwardRef(function({orientation:e="vertical",className:n,style:r,...o},s){return l.jsx(IE,{ref:s,className:W("cny-radio-group",e==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),$E=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=se(r,n,"radio",e);return l.jsxs(Id,{ref:i,className:d,style:f,...s,children:[h,l.jsx(kd,{})]})}const{className:a,style:c,styleTag:u}=se(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Id,{ref:i,className:W("radio",e),...s,children:l.jsx(kd,{})}),l.jsx("span",{children:o})]})});var FE=Object.defineProperty,cn=(t,e)=>FE(t,"name",{value:e,configurable:!0}),Yc="Switch",[VE,vN]=Re(Yc),[BE,Xc]=VE(Yc);function Wm(t){const{__scopeSwitch:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Pe({prop:n,defaultProp:o??!1,onChange:c,caller:Yc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,setChecked:m,disabled:s,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(BE,{scope:e,...R,children:Km(f)?f(R):r})}cn(Wm,"SwitchProvider");var GE="SwitchTrigger",zE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,form:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Xc(GE,e),x=ie(o,f),w=p.useRef(u);return p.useEffect(()=>{const b=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(b instanceof HTMLFormElement){const C=cn(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[s,i,h]),l.jsx(re.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":qc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:x,onClick:U(n,b=>{g(),h(C=>!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"SwitchTrigger")),Nd=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(Wm,{__scopeSwitch:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(zE,{...h,ref:n,__scopeSwitch:r}),m&&l.jsx(WE,{__scopeSwitch:r})]})})},"Switch")),UE="SwitchThumb",_d=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,...o}=e,s=Xc(UE,r);return l.jsx(re.span,{"data-state":qc(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),HE="SwitchBubbleInput",WE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Xc(HE,e),x=ie(o,v),w=hr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,k=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(k&&i.current);if(_&&E){b.current=!k;const G=new Event("click",{bubbles:$});E.call(M,c),M.dispatchEvent(G),b.current=!1}},[y,c,i,a]);const R=p.useRef(c);return l.jsx(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:U(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Km(t){return typeof t=="function"}cn(Km,"isFunction");function qc(t){return t?"checked":"unchecked"}cn(qc,"getState");const KE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=se(r,n,"switch",e);return l.jsxs(Nd,{ref:i,className:d,style:f,...s,children:[h,l.jsx(_d,{className:"switch-thumb"})]})}const{className:a,style:c,styleTag:u}=se(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Nd,{ref:i,className:W("switch",e),...s,children:l.jsx(_d,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function Uo(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Od(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function Po(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Pi(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function YE(t,e){return t.getFullYear()===e.getFullYear()}function Mt(t){return new Date(t.getFullYear(),t.getMonth(),1)}function XE(t){return new Date(t.getFullYear(),0,1)}function Ld(t){return new Date(Math.floor(t.getFullYear()/10)*10,0,1)}function Ro(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function os(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Rt(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}function Ri(t,e,n,r=0){const o=new Date(t);return o.setHours(e,n,r,0),o}function We(t,e,n){return e&&t.getTime()<e.getTime()?new Date(e):n&&t.getTime()>n.getTime()?new Date(n):t}function qE(t,e){const n=Mt(t),r=(n.getDay()-e+7)%7,o=os(n,-r);return Array.from({length:42},(s,i)=>os(o,i))}function ZE(t,e){const n=new Intl.DateTimeFormat(t,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=os(r,(s+e)%7);return n.format(i)})}function QE(t,e="short"){const n=new Intl.DateTimeFormat(t,{month:e});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function $d(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function JE(t,e){return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function ej(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Ym(t,e){return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}function Xm(t,e,n,r){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(t)}function tj(t,e,n,r){return`${Ym(t,e)} · ${Xm(t,e,n,r)}`}function To(t){if(t==null||t==="")return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:new Date(t);const e=new Date(t);return Number.isNaN(e.getTime())?null:e}function Mo(t,e){return t.getTime()<e.getTime()}function Eo(t,e){return t.getTime()>e.getTime()}function jo(t){return t<10?`0${t}`:String(t)}function nj(t){return t||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function rj(t){try{return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function oj(t,e,n,r,o){switch(e){case"year":return JE(t,n);case"month":return ej(t,n);case"time":return Xm(t,n,r,o);case"datetime":return tj(t,n,r,o);case"date":default:return Ym(t,n)}}function sj(t,e){switch(e){case"year":return XE(t);case"month":return Mt(t);case"date":return Uo(t);default:return new Date(t)}}const ij=S.forwardRef(function({mode:e="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:u,placeholder:d,size:f,color:h="primary",disabled:m=!1,clearable:g=!0,locale:y,weekStartsOn:v=0,hour12:x,showSeconds:w=!1,minuteStep:b=1,secondStep:C=1,format:P,icon:R,required:M=!1,validate:j,error:T,onValidate:E,id:k,className:_,style:$,sx:G,"aria-invalid":Q,"aria-describedby":V,dialogLabel:I,name:L,open:O,onOpenChange:D,...X},A){const B=nj(y),ee=x??rj(B),K=S.useId(),H=k??`cny-dp-${K}`,oe=`${H}-dialog`,Y=`${H}-hint`,z=S.useMemo(()=>{const N=To(s),J=a==="future"||a==="current"?Uo(new Date):null;return N&&J?N.getTime()>J.getTime()?N:J:N??J},[s,a]),Z=S.useMemo(()=>{const N=To(i),J=a==="past"||a==="current"?Od(new Date):null;return N&&J?N.getTime()<J.getTime()?N:J:N??J},[i,a]),le=n!==void 0,[ce,F]=S.useState(()=>To(r)),q=le?To(n):ce,he=O!==void 0,[ue,He]=S.useState(!1),ve=he?O:ue,qe=S.useCallback(N=>{he||He(N),D==null||D(N)},[he,D]),gn=S.useMemo(()=>q??We(new Date,z,Z),[q,z,Z]),[pe,we]=S.useState(()=>Mt(gn)),[Se,ke]=S.useState(()=>gn),$s=e==="month"?"month":e==="year"?"year":"date",[nt,yn]=S.useState($s),Fs=S.useRef(null);S.useImperativeHandle(A,()=>Fs.current,[]);const mr=S.useRef(null),Vs=S.useRef(null),bl=S.useRef(null),Bs=S.useRef(null),[Sy,Py]=S.useState({}),[Ry,Ty]=S.useState(!1);S.useEffect(()=>Ty(!0),[]);const Nn=S.useCallback(N=>z&&Mo(N,z)||Z&&Eo(N,Z)?!0:c?c(N):!1,[z,Z,c]),oo=S.useCallback(N=>u?u(N):!1,[u]),_n=S.useMemo(()=>{if(T)return typeof T=="string"?T:"Invalid";if(M&&!q)return"Required";if(q){const J=Uo(new Date);if(a==="future"&&Mo(q,J))return"Must be today or later";if(a==="past"&&Eo(q,Od(new Date)))return"Must be today or earlier";if(a==="current"&&!Po(q,J))return"Must be today";if(z&&Mo(q,z))return"Too early";if(Z&&Eo(q,Z))return"Too late";if(c&&c(q))return"Unavailable date";if(u&&u(q))return"Unavailable time"}const N=j==null?void 0:j(q);return N||null},[T,M,q,a,z,Z,c,u,j]),wl=S.useRef(null);S.useEffect(()=>{wl.current!==_n&&(wl.current=_n,E==null||E(_n))},[_n,E]);const so=_n!==null,Cl=so?"danger":h,My=q?P?P(q,e):oj(q,e,B,ee,w):"",Ey=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[e],jy=I??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[e],Yt=S.useCallback(N=>{le||F(N),o==null||o(N)},[le,o]),io=S.useCallback(()=>{var N;qe(!1),(N=mr.current)==null||N.focus()},[qe]),Ay=S.useCallback(N=>{var J;N.stopPropagation(),Yt(null),(J=mr.current)==null||J.focus()},[Yt]),Sl=S.useCallback(()=>{if(m)return;const N=q??We(new Date,z,Z);we(Mt(N)),ke(N),yn($s),qe(!0)},[m,q,z,Z,qe,$s]);S.useEffect(()=>{if(!ve)return;const N=J=>{var ge,te;const ae=J.target;(ge=Fs.current)!=null&&ge.contains(ae)||(te=Vs.current)!=null&&te.contains(ae)||qe(!1)};return document.addEventListener("pointerdown",N,!0),()=>document.removeEventListener("pointerdown",N,!0)},[ve,qe]);const ao=S.useCallback(()=>{const N=mr.current,J=Vs.current;if(!N||!J)return;const ae=N.getBoundingClientRect(),ge=J.offsetHeight||340,te=J.offsetWidth||264,rt=window.innerHeight,Be=window.innerWidth,ot=4,je=8,Xt=rt-ae.bottom,zs=ae.top,ev=Xt<ge+ot&&zs>Xt?Math.max(je,ae.top-ot-ge):Math.min(rt-ge-je,ae.bottom+ot),tv=Math.max(je,Math.min(ae.left,Be-te-je));Py({position:"fixed",top:ev,left:tv,width:te})},[]);S.useLayoutEffect(()=>{ve&&ao()},[ve,e,ao]),S.useEffect(()=>{if(!ve)return;const N=()=>ao();return window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[ve,ao]),S.useEffect(()=>{var N,J;ve&&(nt==="date"&&(e==="date"||e==="datetime")?(N=bl.current)==null||N.focus():(nt==="month"||nt==="year")&&((J=Bs.current)==null||J.focus()))},[ve,Se,e,nt]);const Pl=S.useCallback(()=>{var N;nt==="year"&&e!=="year"?yn("month"):nt==="month"&&e!=="month"?yn("date"):(qe(!1),(N=mr.current)==null||N.focus())},[nt,e,qe]),co=S.useCallback(N=>{const J=We(N,z,Z);ke(J),we(ae=>Pi(ae,J)?ae:Mt(J))},[z,Z]),gr=S.useCallback((N,J)=>{const ae=sj(N,e);if(e!=="time"&&Nn(ae))return;const ge=e==="time"||e==="datetime"?Ri(ae,(q??N).getHours(),(q??N).getMinutes(),w?(q??N).getSeconds():0):ae;Yt(ge),ke(ge),((J==null?void 0:J.close)??(e!=="datetime"&&e!=="time"))&&io()},[e,Nn,Yt,q,w,io]),lo=S.useCallback((N,J)=>{const ae=q??We(new Date,z,Z),ge=N==="hour"?J:ae.getHours(),te=N==="minute"?J:ae.getMinutes(),rt=N==="second"?J:w?ae.getSeconds():0,Be=Ri(ae,ge,te,rt);oo(Be)||(Yt(Be),ke(Be))},[q,z,Z,w,oo,Yt]),On=S.useCallback(N=>co(os(Se,N)),[co,Se]),Dy=N=>{switch(N.key){case"ArrowLeft":N.preventDefault(),On(-1);break;case"ArrowRight":N.preventDefault(),On(1);break;case"ArrowUp":N.preventDefault(),On(-7);break;case"ArrowDown":N.preventDefault(),On(7);break;case"Home":{N.preventDefault();const J=(Se.getDay()-v+7)%7;On(-J);break}case"End":{N.preventDefault();const J=(Se.getDay()-v+7)%7;On(6-J);break}case"PageUp":N.preventDefault(),co(N.shiftKey?Rt(Se,-1):Ro(Se,-1));break;case"PageDown":N.preventDefault(),co(N.shiftKey?Rt(Se,1):Ro(Se,1));break;case"Enter":case" ":N.preventDefault(),gr(Se);break;case"Escape":N.preventDefault(),Pl();break}},Iy=S.useMemo(()=>qE(pe,v),[pe,v]),ky=S.useMemo(()=>ZE(B,v),[B,v]),Ny=S.useMemo(()=>QE(B,"short"),[B]),Gs=S.useMemo(()=>Uo(new Date),[]),_y=!z||!Mo(Mt(pe),Mt(z)),Oy=!Z||!Eo(Mt(pe),Mt(Z)),Ly=!z||pe.getFullYear()-1>=z.getFullYear(),$y=!Z||pe.getFullYear()+1<=Z.getFullYear(),vn=Ld(pe).getFullYear(),Fy=!z||vn-10+9>=z.getFullYear(),Vy=!Z||vn+10<=Z.getFullYear(),By=e==="time"?!oo(new Date):!Nn(Gs),Gy=()=>{if(e==="time"){const N=new Date;if(oo(N))return;const ae=Ri(q??N,N.getHours(),N.getMinutes(),w?N.getSeconds():0);Yt(ae),ke(ae);return}gr(Gs,{close:e!=="datetime"})},zy=W("cny-datepicker-trigger","input",Cl!=="primary"&&Cl,f==="sm"||f==="lg"?f:null,q&&"has-value",ve&&"is-open"),Uy=R??(e==="time"?l.jsx(DS,{size:15}):l.jsx(bS,{size:15})),Rl=(N,J)=>{let ge=!0;switch(N.key){case"ArrowLeft":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+11)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()-1,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowRight":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+1)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()+1,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowUp":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()-3+12)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()-3,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowDown":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+3)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()+3,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"PageUp":we(J==="month"?te=>Rt(te,N.shiftKey?-10:-1):te=>Rt(te,N.shiftKey?-100:-10));break;case"PageDown":we(J==="month"?te=>Rt(te,N.shiftKey?10:1):te=>Rt(te,N.shiftKey?100:10));break;case"Enter":case" ":J==="month"?Tl(new Date(pe.getFullYear(),Se.getMonth(),1)):Ml(Se.getFullYear());break;case"Escape":Pl();break;default:ge=!1}ge&&N.preventDefault()};S.useEffect(()=>{if(ve&&nt==="year"){const N=Ld(pe).getFullYear(),J=Se.getFullYear();(J<N-1||J>N+10)&&we(new Date(J,0,1))}},[ve,nt,Se,pe]);const Tl=N=>{e==="month"?gr(N):(we(Mt(N)),ke(We(N,z,Z)),yn("date"))},Ml=N=>{if(e==="year")gr(new Date(N,0,1));else{const J=new Date(N,pe.getMonth(),1);we(J),ke(We(new Date(N,Se.getMonth(),Math.min(Se.getDate(),28)),z,Z)),yn("month")}},Hy=()=>{const N=Se.getMonth();return Ny.map((J,ae)=>{const ge=new Date(pe.getFullYear(),ae,1),te=!!q&&Pi(ge,q)&&YE(ge,q),rt=ge.getMonth()===pe.getMonth()&&e!=="month",Be=ae===N,ot=Nn(ge);return l.jsx("button",{ref:Be?Bs:void 0,type:"button",tabIndex:Be?0:-1,className:W("cny-datepicker-chip",te&&"is-selected",rt&&!te&&"is-current"),disabled:ot,onClick:()=>Tl(ge),onFocus:()=>ke(new Date(pe.getFullYear(),ae,Math.min(Se.getDate(),28))),children:J},ae)})},Wy=()=>{const N=vn-1,J=Se.getFullYear();return Array.from({length:12},(ae,ge)=>{const te=N+ge,rt=new Date(te,0,1),Be=!!q&&q.getFullYear()===te,ot=te===pe.getFullYear()&&e!=="year",je=te===J,Xt=Nn(rt),zs=te<vn||te>=vn+10;return l.jsx("button",{ref:je?Bs:void 0,type:"button",tabIndex:je?0:-1,className:W("cny-datepicker-chip",Be&&"is-selected",ot&&!Be&&"is-current",zs&&"is-outside"),disabled:Xt,onClick:()=>Ml(te),onFocus:()=>ke(new Date(te,Se.getMonth(),Math.min(Se.getDate(),28))),children:te},te)})},Ky=S.useRef(null),El=S.useRef(null),jl=S.useRef(null),Al=()=>{const N=q??We(new Date,z,Z),J=N.getHours(),ae=N.getMinutes(),ge=N.getSeconds(),te=J>=12,rt=ee?J%12===0?12:J%12:J,Be=je=>{const Xt=ee?te?je===12?12:je+12:je===12?0:je:je;lo("hour",Xt)},ot=je=>{const Xt=je?J<12?J+12:J:J>=12?J-12:J;lo("hour",Xt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Ti,{ref:Ky,ariaLabel:"Hour",value:rt,min:ee?1:0,max:ee?12:23,step:1,nextRef:El,onChange:Be}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:El,ariaLabel:"Minute",value:ae-ae%Math.max(1,b),min:0,max:59,step:Math.max(1,b),nextRef:w?jl:void 0,onChange:je=>lo("minute",je)}),w&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:jl,ariaLabel:"Second",value:ge-ge%Math.max(1,C),min:0,max:59,step:Math.max(1,C),onChange:je=>lo("second",je)})]}),ee&&l.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[l.jsx("button",{type:"button",role:"radio","aria-checked":!te,className:W("cny-dp-ampm-btn",!te&&"is-active"),onClick:()=>ot(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":te,className:W("cny-dp-ampm-btn",te&&"is-active"),onClick:()=>ot(!0),children:"PM"})]})]})})},Yy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!_y,onClick:()=>we(N=>Ro(N,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${$d(pe,B)})`,onClick:()=>yn("month"),children:$d(pe,B)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Oy,onClick:()=>we(N=>Ro(N,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:Dy,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:ky.map((N,J)=>l.jsx("span",{role:"columnheader","aria-label":N,className:"cny-datepicker-weekday",children:N.slice(0,2)},J))}),Array.from({length:6},(N,J)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:Iy.slice(J*7,J*7+7).map(ae=>{const ge=!Pi(ae,pe),te=Po(ae,q),rt=Po(ae,Gs),Be=Po(ae,Se),ot=Nn(ae);return l.jsx("button",{ref:Be?bl:void 0,type:"button",role:"gridcell",tabIndex:Be?0:-1,"aria-selected":te,"aria-current":rt?"date":void 0,"aria-disabled":ot||void 0,disabled:ot,className:W("cny-datepicker-cell",ge&&"is-outside",te&&"is-selected",rt&&"is-today"),onClick:()=>gr(ae),onFocus:()=>ke(ae),children:ae.getDate()},ae.toISOString())})},J))]})]}),Xy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!Ly,onClick:()=>we(N=>Rt(N,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${pe.getFullYear()})`,onClick:()=>yn("year"),children:pe.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!$y,onClick:()=>we(N=>Rt(N,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:N=>Rl(N,"month"),children:Hy()})]}),qy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!Fy,onClick:()=>we(N=>Rt(N,-10)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${vn} – ${vn+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Vy,onClick:()=>we(N=>Rt(N,10)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:N=>Rl(N,"year"),children:Wy()})]}),{className:Zy,style:Qy,styleTag:Jy}=se(G,$,"cny-datepicker",`mode-${e}`,m&&"is-disabled",_);return l.jsxs("div",{ref:Fs,className:Zy,style:Qy,...X,children:[Jy,L&&l.jsx("input",{type:"hidden",name:L,value:q?q.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:mr,type:"button",id:H,className:zy,"aria-haspopup":"dialog","aria-expanded":ve,"aria-controls":ve?oe:void 0,"aria-invalid":Q||so,"aria-describedby":W(V,so?Y:void 0)||void 0,"aria-required":M||void 0,disabled:m,onClick:Sl,onKeyDown:N=>{N.key==="ArrowDown"||N.key==="Enter"||N.key===" "?(N.preventDefault(),Sl()):N.key==="Escape"&&ve&&(N.preventDefault(),qe(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Uy}),l.jsx("span",{className:W("cny-datepicker-value",!q&&"is-placeholder"),children:My||Ey}),g&&q&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:Ay,onPointerDown:N=>N.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})})]}),so&&T!==!1&&l.jsx("span",{id:Y,className:"cny-datepicker-error",role:"alert",children:typeof T=="string"?T:T??_n}),ve&&Ry&&Da.createPortal(l.jsxs("div",{ref:Vs,id:oe,role:"dialog","aria-modal":"false","aria-label":jy,className:W("cny-datepicker-panel",`is-${e}`),style:Sy,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(e==="date"||e==="datetime")&&nt==="date"&&Yy(),(e==="date"||e==="datetime"||e==="month")&&nt==="month"&&Xy(),(e==="date"||e==="datetime"||e==="month"||e==="year")&&nt==="year"&&qy(),e==="time"&&Al(),e==="datetime"&&nt==="date"&&Al()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!By,onClick:Gy,children:e==="time"?"Now":e==="year"?"This year":e==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),g&&q&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{Yt(null),io()},children:"Clear"}),(e==="datetime"||e==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:io,children:"Done"})]})]}),document.body)]})}),Ti=S.forwardRef(function({value:e,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=S.useRef(null);S.useImperativeHandle(c,()=>u.current,[]);const[d,f]=S.useState(()=>jo(e)),h=S.useRef(!1);S.useEffect(()=>{h.current||f(jo(e))},[e]);const m=S.useCallback(x=>{if(!Number.isFinite(x))return;let w=Math.max(n,Math.min(r,x));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),a(w),f(jo(w))},[n,r,o,a]),g=()=>{const x=e+o;m(x>r?n:x)},y=()=>{const x=e-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),g();break;case"ArrowDown":x.preventDefault(),y();break;case"PageUp":x.preventDefault(),m(e+o*5);break;case"PageDown":x.preventDefault(),m(e-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?g():x.deltaY>0&&y())},children:[l.jsx("input",{ref:u,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:d,"aria-label":s,"aria-valuenow":e,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var b;const w=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(w),w.length===2){const C=parseInt(w,10);Number.isFinite(C)&&C>=n&&C<=r&&(m(C),(b=i==null?void 0:i.current)==null||b.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f(jo(e))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(bp,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(zr,{size:10,"aria-hidden":"true"})})]})]})});function aj({hotkey:t=!0}={}){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(!t)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),{open:e,setOpen:n,toggle:()=>n(r=>!r)}}function cj({open:t,onOpenChange:e,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:u}){const d=f=>{var h;f.disabled||((h=f.onSelect)==null||h.call(f),c==null||c(f),e(!1))};return l.jsxs(De.Dialog,{open:t,onOpenChange:e,label:o,contentClassName:W("cny-cmdk-content",u),children:[l.jsxs(cm,{children:[l.jsx(Vc,{children:o}),l.jsx(Bc,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Mp,{size:16,"aria-hidden":"true"}),l.jsx(De.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(De.List,{className:"cny-cmdk-list",children:[l.jsx(De.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(De.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(De.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function lj({onClick:t,label:e="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:t,className:W("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(Mp,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:e}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let uj=0;const dj=()=>`cny-toast-${Date.now().toString(36)}-${++uj}`,qm=S.createContext(null),fj={default:null,success:l.jsx(Sp,{size:16,"aria-hidden":"true"}),info:l.jsx(Rp,{size:16,"aria-hidden":"true"}),warning:l.jsx(Ep,{size:16,"aria-hidden":"true"}),danger:l.jsx(Cp,{size:16,"aria-hidden":"true"}),loading:l.jsx(Tp,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function hj({children:t,position:e="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=S.useState([]),[a,c]=S.useState(!1);S.useEffect(()=>c(!0),[]);const u=S.useCallback(y=>{i(v=>v.map(x=>y==null||x.id===y?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>y==null?!1:x.id!==y||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(y==null||x.id===y)).forEach(x=>{var w;return(w=x.onDismiss)==null?void 0:w.call(x)}),v.filter(x=>!x.exiting||y!=null&&x.id!==y)))},200)},[]),d=S.useCallback(y=>{const v=y.id??dj(),x={id:v,title:y.title,description:y.description,action:y.action,icon:y.icon,variant:y.variant??"default",duration:y.duration??n,dismissible:y.dismissible??!0,onDismiss:y.onDismiss,sx:y.sx};return i(w=>{const C=[...w.filter(P=>P.id!==v),x];return C.length>r?C.slice(C.length-r):C}),v},[n,r]),f=S.useCallback((y,v)=>{i(x=>x.map(w=>w.id===y?{...w,...v,variant:v.variant??w.variant,duration:v.duration??w.duration,dismissible:v.dismissible??w.dismissible}:w))},[]),h=S.useMemo(()=>{const y=(v=>d(typeof v=="string"?{title:v}:v));return y.success=(v,x)=>d({...x,title:v,variant:"success"}),y.info=(v,x)=>d({...x,title:v,variant:"info"}),y.warning=(v,x)=>d({...x,title:v,variant:"warning"}),y.error=(v,x)=>d({...x,title:v,variant:"danger"}),y.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),y},[d]),m=S.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),g=e.startsWith("top-");return l.jsxs(qm.Provider,{value:m,children:[t,a&&Da.createPortal(l.jsx("ol",{className:W("cny-toast-viewport",`pos-${e}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(g?[...s].reverse():s).map(y=>l.jsx(pj,{toast:y,onDismiss:()=>u(y.id)},y.id))}),document.body)]})}function pj({toast:t,onDismiss:e}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=t,[d,f]=S.useState(!1),h=S.useRef(null);S.useEffect(()=>{if(!t.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(e,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,e,t.exiting]);const m=n==="danger"||n==="warning"?"alert":"status",g=i!==!1,y=i!==void 0&&i!==!1?i:fj[n],{className:v,style:x,styleTag:w}=se(u,void 0,"cny-toast",n,t.exiting&&"is-exiting");return l.jsxs("li",{role:m,"aria-atomic":"true",className:v,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[w,g&&y&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"cny-toast-body",children:[r!=null&&l.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&l.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&l.jsx("div",{className:"cny-toast-action",children:s}),c&&l.jsx("button",{type:"button",className:"cny-toast-close","aria-label":"Dismiss",onClick:e,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}function mj(){const t=S.useContext(qm);if(!t)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return t}const Zm=S.forwardRef(function({title:e,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:m,styleTag:g}=se(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Oc,{...d,children:l.jsxs(Lc,{children:[l.jsx($c,{className:"cny-dialog-overlay"}),l.jsxs(Fc,{ref:f,className:h,style:m,children:[g,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(Vc,{className:"cny-dialog-title",children:e}),n&&l.jsx(Bc,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Ps,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-dialog-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-dialog-footer",children:o})]})]})})}),gj=Mm,yj=Ps;function Qm({open:t,onOpenChange:e,title:n,message:r,children:o,confirmLabel:s="Confirm",cancelLabel:i="Cancel",danger:a=!1,loading:c=!1,onConfirm:u,onCancel:d,className:f,style:h,sx:m}){const g=()=>{d==null||d(),e(!1)};return l.jsx(Zm,{open:t,onOpenChange:e,size:"sm",title:n,className:W("cny-confirm",f),style:h,sx:m,footer:l.jsxs(l.Fragment,{children:[l.jsx(jr,{variant:"ghost",color:"primary",onClick:g,disabled:c,children:i}),l.jsx(jr,{variant:"solid",color:a?"danger":"primary",loading:c,onClick:u,children:s})]}),children:o??l.jsx("p",{className:"cny-confirm-message",children:r})})}function vj(){const[t,e]=S.useState(null),n=S.useCallback(i=>new Promise(a=>{e({...i,resolve:a})}),[]),r=S.useCallback(i=>{i||e(a=>(a==null||a.resolve(!1),null))},[]),o=S.useCallback(()=>{e(i=>(i==null||i.resolve(!0),null))},[]),s=t?l.jsx(Qm,{open:!0,onOpenChange:r,title:t.title,message:t.message,confirmLabel:t.confirmLabel,cancelLabel:t.cancelLabel,danger:t.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const xj=S.forwardRef(function({title:e,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:m,style:g,styleTag:y}=se(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Oc,{...f,children:l.jsxs(Lc,{children:[l.jsx($c,{className:"cny-drawer-overlay"}),l.jsxs(Fc,{ref:h,className:m,style:g,children:[y,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(Vc,{className:"cny-drawer-title",children:e}),n&&l.jsx(Bc,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Ps,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-drawer-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-drawer-footer",children:o})]})]})})}),bj=Mm,wj=Ps;var Cj=Object.defineProperty,de=(t,e)=>Cj(t,"name",{value:e,configurable:!0}),Sa=["Enter"," "],Sj=["ArrowDown","PageUp","Home"],Jm=["ArrowUp","PageDown","End"],Pj=[...Sj,...Jm],Rj={ltr:[...Sa,"ArrowRight"],rtl:[...Sa,"ArrowLeft"]},Tj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},js="Menu",[Nr,Mj,Ej]=cr(js),[kn,As]=Re(js,[Ej,dn,un]),Ds=dn(),eg=un(),[tg,mn]=kn(js),[jj,Jr]=kn(js),Aj=de(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=Ds(e),[c,u]=p.useState(null),d=p.useRef(!1),f=Qe(s),h=Ht(o);return p.useEffect(()=>{const m=de(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=de(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=de(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),l.jsx(Wr,{...a,children:l.jsx(tg,{scope:e,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(jj,{scope:e,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),ng=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e,s=Ds(r);return l.jsx(Kr,{...s,...o,ref:n})},"MenuAnchor")),rg="MenuPortal",[Dj,og]=kn(rg,{forceMount:void 0}),Ij=de(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=mn(rg,e);return l.jsx(Dj,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"MenuPortal"),vt="MenuContent",[kj,Zc]=kn(vt),Nj=p.forwardRef(de(function(e,n){const r=og(vt,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=mn(vt,e.__scopeMenu),a=Jr(vt,e.__scopeMenu);return l.jsx(Nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ue,{present:o||i.open,children:l.jsx(Nr.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(_j,{...s,ref:n}):l.jsx(Oj,{...s,ref:n})})})})},"MenuContent")),_j=p.forwardRef(de(function(e,n){const r=mn(vt,e.__scopeMenu),o=p.useRef(null),s=ie(n,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(Qc,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Oj=p.forwardRef(de(function(e,n){const r=mn(vt,e.__scopeMenu);return l.jsx(Qc,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Lj=Nt("MenuContent.ScrollLock"),Qc=p.forwardRef(de(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:y,...v}=e,x=mn(vt,r),w=Jr(vt,r),b=Ds(r),C=eg(r),P=Mj(r),[R,M]=p.useState(null),j=p.useRef(null),T=ie(n,j,x.onContentChange),E=p.useRef(0),k=p.useRef(""),_=p.useRef(0),$=p.useRef(null),G=p.useRef("right"),Q=p.useRef(0),V=y?Xr:p.Fragment,I=y?{as:Lj,allowPinchZoom:!0}:void 0,L=de(D=>{var Y,z;const X=k.current+D,A=P().filter(Z=>!Z.disabled),B=document.activeElement,ee=(Y=A.find(Z=>Z.ref.current===B))==null?void 0:Y.textValue,K=A.map(Z=>Z.textValue),H=fg(K,X,ee),oe=(z=A.find(Z=>Z.textValue===H))==null?void 0:z.ref.current;de((function Z(le){k.current=le,window.clearTimeout(E.current),le!==""&&(E.current=window.setTimeout(()=>Z(""),1e3))}),"updateSearch")(X),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(E.current),[]),ur();const O=p.useCallback(D=>{var A,B;return G.current===((A=$.current)==null?void 0:A.side)&&pg(D,(B=$.current)==null?void 0:B.area)},[]);return l.jsx(kj,{scope:r,searchRef:k,onItemEnter:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),onItemLeave:p.useCallback(D=>{var X;O(D)||((X=j.current)==null||X.focus(),M(null))},[O]),onTriggerLeave:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),pointerGraceTimerRef:_,onPointerGraceIntentChange:p.useCallback(D=>{$.current=D},[]),children:l.jsx(V,{...I,children:l.jsx(hs,{asChild:!0,trapped:s,onMountAutoFocus:U(i,D=>{var X;D.preventDefault(),(X=j.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:l.jsx(ds,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:M,onEntryFocus:U(u,D=>{w.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(xs,{role:"menu","aria-orientation":"vertical","data-state":el(x.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:U(v.onKeyDown,D=>{const A=D.target.closest("[data-radix-menu-content]")===D.currentTarget,B=D.ctrlKey||D.altKey||D.metaKey,ee=D.key.length===1;A&&(D.key==="Tab"&&D.preventDefault(),!B&&ee&&L(D.key));const K=j.current;if(D.target!==K||!Pj.includes(D.key))return;D.preventDefault();const oe=P().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);Jm.includes(D.key)&&oe.reverse(),ug(oe)}),onBlur:U(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),k.current="")}),onPointerMove:U(e.onPointerMove,nr(D=>{const X=D.target,A=Q.current!==D.clientX;if(D.currentTarget.contains(X)&&A){const B=D.clientX>Q.current?"right":"left";G.current=B,Q.current=D.clientX}}))})})})})})})},"MenuContentImpl")),$j=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{role:"group",...o,ref:n})},"MenuGroup")),Fj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{...o,ref:n})},"MenuLabel")),Pa="MenuItem",Fd="menu.itemSelect",Jc=p.forwardRef(de(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=p.useRef(null),a=Jr(Pa,e.__scopeMenu),c=Zc(Pa,e.__scopeMenu),u=ie(n,i),d=p.useRef(!1),f=de(()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(Fd,{bubbles:!0,cancelable:!0});h.addEventListener(Fd,g=>o==null?void 0:o(g),{once:!0}),dc(h,m),m.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return l.jsx(sg,{...s,ref:u,disabled:r,onClick:U(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:U(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:U(e.onKeyDown,h=>{r||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||Sa.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),sg=p.forwardRef(de(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=Zc(Pa,r),c=eg(r),u=p.useRef(null),d=ie(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const y=u.current;y&&g((y.textContent??"").trim())},[i.children]),l.jsx(Nr.ItemSlot,{scope:r,disabled:o,textValue:s??m,children:l.jsx(fs,{asChild:!0,...c,focusable:!o,children:l.jsx(re.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:U(e.onPointerMove,nr(y=>{o?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,nr(y=>a.onItemLeave(y))),onFocus:U(e.onFocus,()=>h(!0)),onBlur:U(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Vj=p.forwardRef(de(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return l.jsx(ag,{scope:e.__scopeMenu,checked:r,children:l.jsx(Jc,{role:"menuitemcheckbox","aria-checked":_r(r)?"mixed":r,...s,ref:n,"data-state":Is(r),onSelect:U(s.onSelect,()=>o==null?void 0:o(_r(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Bj="MenuRadioGroup",[Gj,zj]=kn(Bj,{value:void 0,onValueChange:de(()=>{},"onValueChange")}),Uj=p.forwardRef(de(function(e,n){const{value:r,onValueChange:o,...s}=e,i=Qe(o);return l.jsx(Gj,{scope:e.__scopeMenu,value:r,onValueChange:i,children:l.jsx($j,{...s,ref:n})})},"MenuRadioGroup")),Hj="MenuRadioItem",Wj=p.forwardRef(de(function(e,n){const{value:r,...o}=e,s=zj(Hj,e.__scopeMenu),i=r===s.value;return l.jsx(ag,{scope:e.__scopeMenu,checked:i,children:l.jsx(Jc,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":Is(i),onSelect:U(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),ig="MenuItemIndicator",[ag,Kj]=kn(ig,{checked:!1}),Yj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=Kj(ig,r);return l.jsx(Ue,{present:o||_r(i.checked)||i.checked===!0,children:l.jsx(re.span,{...s,ref:n,"data-state":Is(i.checked)})})},"MenuItemIndicator")),Xj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),cg="MenuSub",[qj,lg]=kn(cg),Zj=de(t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,s=mn(cg,e),i=Ds(e),[a,c]=p.useState(null),[u,d]=p.useState(null),f=Qe(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Wr,{...i,children:l.jsx(tg,{scope:e,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(qj,{scope:e,contentId:Fe(),triggerId:Fe(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),Ao="MenuSubTrigger",Qj=p.forwardRef(de(function(e,n){const r=mn(Ao,e.__scopeMenu),o=Jr(Ao,e.__scopeMenu),s=lg(Ao,e.__scopeMenu),i=Zc(Ao,e.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=ie(n,s.onTriggerChange);return l.jsx(ng,{asChild:!0,...d,children:l.jsx(sg,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":el(r.open),...e,ref:h,onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,nr(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:U(e.onPointerLeave,nr(m=>{var y,v;f();const g=(y=r.content)==null?void 0:y.getBoundingClientRect();if(g){const x=(v=r.content)==null?void 0:v.dataset.side,w=x==="right",b=w?-5:5,C=g[w?"left":"right"],P=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x:C,y:g.top},{x:P,y:g.top},{x:P,y:g.bottom},{x:C,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,m=>{var y;e.disabled||m.target!==m.currentTarget||i.searchRef.current!==""&&m.key===" "||Rj[o.dir].includes(m.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),m.preventDefault())})})})},"MenuSubTrigger")),Jj="MenuSubContent",eA=p.forwardRef(de(function(e,n){const r=og(vt,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=e,a=mn(vt,e.__scopeMenu),c=Jr(vt,e.__scopeMenu),u=lg(Jj,e.__scopeMenu),d=p.useRef(null),f=ie(n,d);return l.jsx(Nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ue,{present:o||a.open,children:l.jsx(Nr.Slot,{scope:e.__scopeMenu,children:l.jsx(Qc,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:U(e.onFocusOutside,h=>{h.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:U(e.onKeyDown,h=>{var y;const m=h.currentTarget.contains(h.target),g=Tj[c.dir].includes(h.key);m&&g&&(a.onOpenChange(!1),(y=u.trigger)==null||y.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function el(t){return t?"open":"closed"}de(el,"getOpenState");function _r(t){return t==="indeterminate"}de(_r,"isIndeterminate");function Is(t){return _r(t)?"indeterminate":t?"checked":"unchecked"}de(Is,"getCheckedState");function ug(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}de(ug,"focusFirst");function dg(t,e){return t.map((n,r)=>t[(e+r)%t.length])}de(dg,"wrapArray");function fg(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=dg(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}de(fg,"getNextMatch");function hg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}de(hg,"isPointInPolygon");function pg(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return hg(n,e)}de(pg,"isPointerInGraceArea");function nr(t){return e=>e.pointerType==="mouse"?t(e):void 0}de(nr,"whenMouse");var mg=Aj,gg=ng,yg=Ij,vg=Nj,xg=Fj,bg=Jc,wg=Vj,Cg=Uj,Sg=Wj,Pg=Yj,Rg=Xj,Tg=Zj,Mg=Qj,Eg=eA,tA=Object.defineProperty,Je=(t,e)=>tA(t,"name",{value:e,configurable:!0}),tl="DropdownMenu",[nA,xN]=Re(tl,[As]),et=As(),[rA,jg]=nA(tl),oA=Je(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=et(e),u=p.useRef(null),[d,f]=Pe({prop:o,defaultProp:s??!1,onChange:i,caller:tl});return l.jsx(rA,{scope:e,triggerId:Fe(),triggerRef:u,contentId:Fe(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(mg,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),sA="DropdownMenuTrigger",iA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=jg(sA,r),a=et(r),c=ie(n,i.triggerRef);return l.jsx(gg,{asChild:!0,...a,children:l.jsx(re.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:U(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:U(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),aA=Je(t=>{const{__scopeDropdownMenu:e,...n}=t,r=et(e);return l.jsx(yg,{...r,...n})},"DropdownMenuPortal"),cA="DropdownMenuContent",lA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=jg(cA,r),i=et(r),a=p.useRef(!1);return l.jsx(vg,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:U(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:U(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),uA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(xg,{...s,...o,ref:n})},"DropdownMenuLabel")),dA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(bg,{...s,...o,ref:n})},"DropdownMenuItem")),fA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(wg,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),hA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Cg,{...s,...o,ref:n})},"DropdownMenuRadioGroup")),pA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Sg,{...s,...o,ref:n})},"DropdownMenuRadioItem")),mA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Pg,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),gA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Rg,{...s,...o,ref:n})},"DropdownMenuSeparator")),yA=Je(t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:s}=t,i=et(e),[a,c]=Pe({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),vA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Mg,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),xA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Eg,{...s,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),bA=oA,wA=iA,Ag=aA,CA=lA,SA=uA,PA=dA,RA=fA,TA=hA,MA=pA,Dg=mA,EA=gA,jA=yA,AA=vA,DA=xA;const IA=bA,kA=wA,NA=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(Ag,{children:l.jsxs(CA,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),_A=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(PA,{ref:a,className:W("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),OA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(RA,{ref:s,className:W("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),LA=TA,$A=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(MA,{ref:s,className:W("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(Pp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),FA=S.forwardRef(function({className:e,...n},r){return l.jsx(SA,{ref:r,className:W("cny-menu-label",e),...n})}),VA=S.forwardRef(function({className:e,...n},r){return l.jsx(EA,{ref:r,className:W("cny-menu-separator",e),...n})}),BA=jA,GA=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(AA,{ref:s,className:W("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),zA=S.forwardRef(function({className:e,...n},r){return l.jsx(Ag,{children:l.jsx(DA,{ref:r,className:W("cny-menu-content",e),...n})})});var UA=Object.defineProperty,Ve=(t,e)=>UA(t,"name",{value:e,configurable:!0}),nl="ContextMenu",[HA,bN]=Re(nl,[As]),tt=As(),[WA,Ig]=HA(nl),KA=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=t,a=p.useRef(!1),[c,u]=Pe({prop:o,defaultProp:!1,onChange:r,caller:nl}),d=tt(e);return l.jsx(WA,{scope:e,open:c,onOpenChange:u,modal:i,hasInteractedRef:a,children:l.jsx(mg,{...d,dir:s,open:c,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),YA="ContextMenuTrigger",XA=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=e,i=Ig(YA,r),a=tt(r),[c,u]=p.useState({x:0,y:0}),d=p.useMemo(()=>({current:{getBoundingClientRect:Ve(()=>DOMRect.fromRect({width:0,height:0,...c}),"getBoundingClientRect")}}),[c]),f=p.useRef(0),h=p.useCallback(()=>window.clearTimeout(f.current),[]),m=Ve(g=>{i.hasInteractedRef.current=!0,u({x:g.clientX,y:g.clientY}),i.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>h,[h]),p.useEffect(()=>void(o&&h()),[o,h]),l.jsxs(l.Fragment,{children:[l.jsx(gg,{...a,virtualRef:d}),l.jsx(re.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:U(e.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:o?e.onPointerDown:U(e.onPointerDown,br(g=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>m(g),700)})),onPointerMove:o?e.onPointerMove:U(e.onPointerMove,br(h)),onPointerCancel:o?e.onPointerCancel:U(e.onPointerCancel,br(h)),onPointerUp:o?e.onPointerUp:U(e.onPointerUp,br(h))})]})},"ContextMenuTrigger")),qA=Ve(t=>{const{__scopeContextMenu:e,...n}=t,r=tt(e);return l.jsx(yg,{...r,...n})},"ContextMenuPortal"),ZA="ContextMenuContent",QA=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Ig(ZA,r),i=tt(r),a=p.useRef(!1);return l.jsx(vg,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),JA=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(xg,{...s,...o,ref:n})},"ContextMenuLabel")),eD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(bg,{...s,...o,ref:n})},"ContextMenuItem")),tD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(wg,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),nD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Cg,{...s,...o,ref:n})},"ContextMenuRadioGroup")),rD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Sg,{...s,...o,ref:n})},"ContextMenuRadioItem")),oD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Pg,{...s,...o,ref:n})},"ContextMenuItemIndicator")),sD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Rg,{...s,...o,ref:n})},"ContextMenuSeparator")),iD="ContextMenuSub",aD=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:s}=t,i=tt(e),[a,c]=Pe({prop:o,defaultProp:s??!1,onChange:r,caller:iD});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"ContextMenuSub"),cD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Mg,{...s,...o,ref:n})},"ContextMenuSubTrigger")),lD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Eg,{...s,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function br(t){return e=>e.pointerType!=="mouse"?t(e):void 0}Ve(br,"whenTouchOrPen");var uD=KA,dD=XA,kg=qA,fD=QA,hD=JA,pD=eD,mD=tD,gD=nD,yD=rD,Ng=oD,vD=sD,xD=aD,bD=cD,wD=lD;const CD=uD,SD=dD,PD=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(kg,{children:l.jsxs(fD,{ref:c,className:u,style:d,alignOffset:s,...a,children:[f,i]})})}),RD=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(pD,{ref:a,className:W("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),TD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(mD,{ref:s,className:W("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),MD=gD,ED=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(yD,{ref:s,className:W("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(Pp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),jD=S.forwardRef(function({className:e,...n},r){return l.jsx(hD,{ref:r,className:W("cny-menu-label",e),...n})}),AD=S.forwardRef(function({className:e,...n},r){return l.jsx(vD,{ref:r,className:W("cny-menu-separator",e),...n})}),DD=xD,ID=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(bD,{ref:s,className:W("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),kD=S.forwardRef(function({className:e,...n},r){return l.jsx(kg,{children:l.jsx(wD,{ref:r,className:W("cny-menu-content",e),...n})})});var ND=Object.defineProperty,Ie=(t,e)=>ND(t,"name",{value:e,configurable:!0}),[rl,wN]=Re("Tooltip",[dn]),ks=dn(),_D="TooltipProvider",OD=700,Ra="tooltip.open",[LD,ol]=rl(_D),$D=Ie(t=>{const{__scopeTooltip:e,delayDuration:n=OD,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(LD,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),Ta="Tooltip",[FD,eo]=rl(Ta),VD=Ie(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,c=ol(Ta,t.__scopeTooltip),u=ks(e),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=Fe(),y=p.useRef(0),v=i??c.disableHoverableContent,x=a??c.delayDuration,w=p.useRef(!1),[b,C]=Pe({prop:r,defaultProp:o??!1,onChange:Ie(E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ra))):c.onClose(),s==null||s(E)},"onChange"),caller:Ta}),P=p.useMemo(()=>b?w.current?"delayed-open":"instant-open":"closed",[b]),R=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,C(!0)},[C]),M=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),j=p.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,C(!0),y.current=0},x)},[x,C]);p.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const T=h??g;return l.jsx(Wr,{...u,children:l.jsx(FD,{scope:e,contentId:T,setContentId:m,open:b,stateAttribute:P,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?j():R()},[c.isOpenDelayedRef,j,R]),onTriggerLeave:p.useCallback(()=>{v?M():(window.clearTimeout(y.current),y.current=0)},[M,v]),onOpen:R,onClose:M,disableHoverableContent:v,children:n})})},"Tooltip"),Vd="TooltipTrigger",BD=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,...o}=e,s=eo(Vd,r),i=ol(Vd,r),a=ks(r),c=p.useRef(null),u=ie(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(Kr,{asChild:!0,...a,children:l.jsx(re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:U(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:U(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:U(e.onBlur,s.onClose),onClick:U(e.onClick,s.onClose)})})},"TooltipTrigger")),_g="TooltipPortal",[GD,zD]=rl(_g,{forceMount:void 0}),UD=Ie(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=eo(_g,e);return l.jsx(GD,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Or="TooltipContent",HD=p.forwardRef(Ie(function(e,n){const r=zD(Or,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=eo(Or,e.__scopeTooltip);return l.jsx(Ue,{present:o||a.open,children:a.disableHoverableContent?l.jsx(Og,{side:s,...i,ref:n}):l.jsx(WD,{side:s,...i,ref:n})})},"TooltipContent")),WD=p.forwardRef(Ie(function(e,n){const r=eo(Or,e.__scopeTooltip),o=ol(Or,e.__scopeTooltip),s=p.useRef(null),i=ie(n,s),[a,c]=p.useState(null),{trigger:u,onClose:d}=r,f=s.current,{onPointerInTransitChange:h}=o,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((y,v)=>{const x=y.currentTarget,w={x:y.clientX,y:y.clientY},b=Lg(w,x.getBoundingClientRect()),C=$g(w,b),P=Fg(v.getBoundingClientRect()),R=Bg([...C,...P]);c(R),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const y=Ie(x=>g(x,f),"handleTriggerLeave"),v=Ie(x=>g(x,u),"handleContentLeave");return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(a){const y=Ie(v=>{const x=v.target,w={x:v.clientX,y:v.clientY},b=(u==null?void 0:u.contains(x))||(f==null?void 0:f.contains(x)),C=!Vg(w,a);b?m():C&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,a,d,m]),l.jsx(Og,{...e,ref:i})},"TooltipContentHoverable")),KD=Yh("TooltipContent"),Og=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=e,d=eo(Or,r),f=ks(r),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Ra,h),()=>document.removeEventListener(Ra,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=Ie(y=>{y.target instanceof Node&&y.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Ee(()=>(m(i),()=>{m(void 0)}),[i,m]),l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:l.jsxs(xs,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(KD,{children:o}),s?l.jsx(CT,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),YD=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,...o}=e,s=ks(r);return l.jsx(nm,{...s,...o,ref:n})},"TooltipArrow"));function Lg(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ie(Lg,"getExitSideFromRect");function $g(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Ie($g,"getPaddedExitPoints");function Fg(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}Ie(Fg,"getPointsFromRect");function Vg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}Ie(Vg,"isPointInPolygon");function Bg(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Gg(e)}Ie(Bg,"getHull");function Gg(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Ie(Gg,"getHullPresorted");var XD=$D,zg=VD,Ug=BD,Hg=UD,Wg=HD,qD=YD;const ZD=XD,QD=S.forwardRef(function({children:e,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:a,disabled:c,contentClassName:u,contentStyle:d,sx:f},h){const{className:m,style:g,styleTag:y}=se(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:e}):l.jsxs(zg,{delayDuration:i,open:a,children:[l.jsx(Ug,{asChild:!0,children:e}),l.jsx(Hg,{children:l.jsxs(Wg,{ref:h,side:r,align:o,sideOffset:s,className:m,style:g,children:[y,n,l.jsx(qD,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),JD=zg,eI=Ug,tI=S.forwardRef(function({className:e,...n},r){return l.jsx(Hg,{children:l.jsx(Wg,{ref:r,className:W("cny-tooltip-content",e),...n})})}),nI=Dc,rI=Ic,oI=mM,sI=gM,iI=S.forwardRef(function({className:e,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-popover-content",e);return l.jsx(kc,{children:l.jsxs(Nc,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(yM,{className:"cny-popover-arrow",width:12,height:6})]})})}),aI=S.forwardRef(function({color:e="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:a="Remove",onClick:c,disabled:u,className:d,style:f,sx:h,children:m,...g},y){const v=!u&&c!=null,{className:x,style:w,styleTag:b}=se(h,f,"cny-chip",e,n,r==="sm"&&"sm",v&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:y,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,onKeyDown:v?C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),c==null||c(C))}:void 0,className:x,style:w,...g,children:[b,s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:m}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:C=>{C.stopPropagation(),i(C)},children:l.jsx(Wt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),cI=S.forwardRef(function({count:e,dot:n=!1,max:r=99,showZero:o=!1,color:s="danger",placement:i="top-right",standalone:a=!1,children:c,className:u,style:d,sx:f,...h},m){const g=typeof e=="number",y=g&&e>r?`${r}+`:e,x=!n&&g&&e===0&&!o?null:l.jsx("span",{className:W("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!a&&`cny-badge-${i}`),children:n?null:y});if(a){const{className:P,style:R,styleTag:M}=se(f,d,"cny-badge","cny-badge-standalone",u);return l.jsxs("span",{ref:m,className:P,style:R,...h,children:[M,x]})}const{className:w,style:b,styleTag:C}=se(f,d,"cny-badge",u);return l.jsxs("span",{ref:m,className:w,style:b,...h,children:[C,c,x]})}),lI=S.forwardRef(function({position:e="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${e}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),uI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,className:W("cny-timeline-item",e),...n})}),dI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:W("cny-timeline-separator",e),...n})}),fI=S.forwardRef(function({color:e="neutral",variant:n="filled",icon:r,active:o=!1,className:s,children:i,...a},c){const u=r??i;return l.jsx("span",{ref:c,className:W("cny-timeline-dot",`cny-timeline-dot-${e}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),hI=S.forwardRef(function({color:e,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:W("cny-timeline-connector",e&&`cny-timeline-connector-${e}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),pI=S.forwardRef(function({variant:e="plain",accentColor:n,className:r,...o},s){const i=e==="card"||e==="elevated";return l.jsx("div",{ref:s,className:W("cny-timeline-content",i&&"cny-timeline-content-card",e==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),mI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:W("cny-timeline-opposite-content",e),...n})}),Kg=S.createContext(null);function gI(){const t=S.useContext(Kg);if(!t)throw new Error("TreeItem must be used within a <TreeView>.");return t}const Yg=S.forwardRef(function({expandedIds:e,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...m},g){const[y,v]=S.useState(n??[]),[x,w]=S.useState(s),[b,C]=S.useState(null),P=e??y,R=o!==void 0?o:x,M=S.useMemo(()=>new Set(P),[P]),j=S.useCallback(I=>M.has(I),[M]),T=S.useCallback(I=>{const L=!M.has(I),O=L?[...P,I]:P.filter(D=>D!==I);e===void 0&&v(O),r==null||r(O),a==null||a(I,L)},[P,M,e,r,a]),E=S.useCallback(I=>{o===void 0&&w(I),i==null||i(I)},[o,i]),k=S.useMemo(()=>({isExpanded:j,toggle:T,selectedId:R,select:E,activeId:b,setActive:C,defaultIcons:c}),[j,T,R,E,b,c]),_=S.useRef(null),$=S.useCallback(I=>{_.current=I,typeof g=="function"?g(I):g&&(g.current=I)},[g]);S.useEffect(()=>{var O;if(b!==null)return;const I=(O=_.current)==null?void 0:O.querySelector('[role="treeitem"]'),L=I==null?void 0:I.dataset.treeId;L&&C(L)},[b]);const{className:G,style:Q,styleTag:V}=se(f,d,"cny-tree",u);return l.jsx(Kg.Provider,{value:k,children:l.jsxs("ul",{ref:$,role:"tree",className:G,style:Q,...m,children:[V,h]})})});function yI(t){return t?Array.from(t.querySelectorAll('[role="treeitem"]')):[]}const Xg=S.forwardRef(function({itemId:e,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:m,defaultIcons:g}=gI(),y=!!o,v=y&&c(e),x=d===e,w=h===e,b=r??(g?y?v?l.jsx(zS,{size:16}):l.jsx(HS,{size:16}):l.jsx(BS,{size:16}):null),C=()=>{m(e),f(e),y&&u(e)},P=M=>{M.preventDefault(),M.stopPropagation(),m(e),u(e)},R=M=>{var T;const j=M.currentTarget.closest('[role="tree"]');switch(M.key){case"ArrowRight":if(M.preventDefault(),y&&!v)u(e);else if(v){const E=M.currentTarget.querySelector('[role="treeitem"]');E==null||E.focus()}break;case"ArrowLeft":if(M.preventDefault(),y&&v)u(e);else{const E=(T=M.currentTarget.parentElement)==null?void 0:T.closest('[role="treeitem"]');E==null||E.focus()}break;case"ArrowDown":case"ArrowUp":{M.preventDefault();const E=yI(j),k=E.indexOf(M.currentTarget),_=E[k+(M.key==="ArrowDown"?1:-1)];_==null||_.focus();break}case"Enter":case" ":M.preventDefault(),f(e),y&&u(e);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":e,"aria-expanded":y?v:void 0,"aria-selected":x,tabIndex:w?0:-1,className:W("cny-tree-item",s),onKeyDown:R,onFocus:M=>{M.target===M.currentTarget&&m(e)},...i,children:[l.jsxs("div",{className:W("cny-tree-row",x&&"is-selected"),onClick:C,children:[y?l.jsx("button",{type:"button",tabIndex:-1,className:W("cny-tree-toggle",v&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:e}`,onClick:P,children:l.jsx(Jt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),b!=null&&l.jsx("span",{className:"cny-tree-icon",children:b}),l.jsx("span",{className:"cny-tree-label",children:n})]}),v&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),vI=S.forwardRef(function({items:e,getItemId:n=c=>String(c.id),getItemLabel:r=c=>c.label,getItemChildren:o=c=>c.children,getItemIcon:s,...i},a){const c=u=>u.map(d=>{const f=n(d),h=o(d);return l.jsx(Xg,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?c(h):null},f)});return l.jsx(Yg,{ref:a,...i,children:c(e)})});function xI(t){if(!t)return[];if(typeof t=="string")return t.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(t))return t.map(n=>n.trim()).filter(Boolean);const e=[];for(const[n,r]of Object.entries(t)){e.push(n);for(const o of r)e.push(o)}return e}function bI(t,e){if(e.length===0)return!0;const n=t.name.toLowerCase(),r=(t.type||"").toLowerCase();return e.some(o=>{const s=o.toLowerCase();return s==="*"||s==="*/*"?!0:s.startsWith(".")?n.endsWith(s):s.endsWith("/*")?r.startsWith(s.slice(0,-1)):r===s})}function qg(t={}){const{accept:e,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=t,[d,f]=S.useState(!1),h=S.useRef(null),m=S.useRef(0),g=S.useMemo(()=>xI(e),[e]),y=g.join(",")||void 0,v=S.useCallback(P=>{const R=[];return bI(P,g)||R.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&P.size>n&&R.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&P.size<r&&R.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),R},[g,n,r]),x=S.useCallback(P=>{if(i||P.length===0)return;const R=[],M=[];if(!o&&P.length>1||typeof s=="number"&&P.length>s)for(const T of P)M.push({file:T,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const T of P){const E=v(T);E.length?M.push({file:T,errors:E}):R.push(T)}a==null||a(R,M),R.length&&(c==null||c(R)),M.length&&(u==null||u(M))},[i,o,s,v,a,c,u]),w=S.useCallback(()=>{var P;i||(P=h.current)==null||P.click()},[i]),b=S.useCallback((P={})=>{const{onClick:R,onKeyDown:M,onDragOver:j,onDragEnter:T,onDragLeave:E,onDrop:k,..._}=P;return{..._,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:$=>{R==null||R($),i||w()},onKeyDown:$=>{M==null||M($),($.key==="Enter"||$.key===" ")&&($.preventDefault(),w())},onDragOver:$=>{j==null||j($),$.preventDefault(),i||f(!0)},onDragEnter:$=>{T==null||T($),$.preventDefault(),!i&&(m.current+=1,f(!0))},onDragLeave:$=>{E==null||E($),m.current=Math.max(0,m.current-1),m.current===0&&f(!1)},onDrop:$=>{var G;k==null||k($),$.preventDefault(),m.current=0,f(!1),!i&&x(Array.from(((G=$.dataTransfer)==null?void 0:G.files)??[]))}}},[i,w,x]),C=S.useCallback((P={})=>{const{onChange:R,...M}=P;return{...M,ref:h,type:"file",accept:y,multiple:o,style:{display:"none"},onChange:j=>{R==null||R(j),x(Array.from(j.target.files??[])),j.target.value=""}}},[y,o,x]);return{getRootProps:b,getInputProps:C,open:w,isDragActive:d,inputRef:h}}const wI=S.forwardRef(function({onDrop:e,label:n="Drop files here or click to upload",hint:r,icon:o,children:s,buttonLabel:i="Browse files",size:a="md",accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,className:g,style:y,sx:v},x){const{getRootProps:w,getInputProps:b,isDragActive:C,open:P}=qg({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,onDrop:e}),{className:R,style:M,styleTag:j}=se(v,y,"cny-uploader",`cny-uploader-${a}`,C&&"is-dragging",m&&"is-disabled",g);return l.jsxs("div",{...w(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:R,style:M,children:[j,l.jsx("input",{...b()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(kS,{})}),l.jsxs("span",{className:"cny-uploader-text",children:[l.jsx("span",{className:"cny-uploader-label",children:n}),r!=null&&l.jsx("span",{className:"cny-uploader-hint",children:r})]}),i!==!1&&l.jsx(jr,{type:"button",variant:"outline",size:a==="sm"?"sm":"md",disabled:m,tabIndex:-1,onClick:T=>{T.stopPropagation(),P()},children:i})]})]})}),CI=5;function Bd(t){if(t.length===0)return[];const n=t.reduce((a,c)=>a+(c.def??0),0),r=t.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=t.map(a=>a.def==null?o:a.def),i=s.reduce((a,c)=>a+c,0)||1;return s.map(a=>a/i*100)}function Gd(t,e,n,r){if(e<0||e+1>=t.length)return t;const o=t[e]+t[e+1];let s=Math.max(r[e].min,Math.min(r[e].max,t[e]+n));const i=Math.max(r[e+1].min,Math.min(r[e+1].max,o-s));s=Math.max(r[e].min,Math.min(r[e].max,o-i));const a=[...t];return a[e]=s,a[e+1]=i,a}const Ma=S.forwardRef(function({defaultSize:e,minSize:n,maxSize:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-panel",o);return l.jsxs("div",{ref:u,className:d,style:f,...c,children:[h,a]})}),Zg=S.forwardRef(function({disabled:e,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||e)return;const u=i?"ArrowRight":"ArrowDown",d=i?"ArrowLeft":"ArrowUp";c.key===u?(c.preventDefault(),r.onKeyResize(1)):c.key===d&&(c.preventDefault(),r.onKeyResize(-1))};return l.jsx("div",{ref:s,role:"separator",tabIndex:e?-1:0,"aria-orientation":i?"vertical":"horizontal","aria-valuenow":r==null?void 0:r.valueNow,"aria-valuemin":r==null?void 0:r.valueMin,"aria-valuemax":r==null?void 0:r.valueMax,"aria-disabled":e||void 0,className:W("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{e||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),SI=S.forwardRef(function({direction:e="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=S.useRef(null),u=S.Children.toArray(s).filter(S.isValidElement),d=u.filter(j=>j.type===Ma).map(j=>{const T=j.props;return{min:T.minSize??10,max:T.maxSize??90,def:T.defaultSize??null}}),[f,h]=S.useState(()=>Bd(d)),m=f.length===d.length?f:Bd(d),g=S.useRef(null),y=(j,T)=>{const E=e==="horizontal"?T.clientX:T.clientY;g.current={g:j,start:E,startSizes:m};const k=$=>{var O;const G=g.current,Q=(O=c.current)==null?void 0:O.getBoundingClientRect();if(!G||!Q)return;const V=e==="horizontal"?Q.width:Q.height;if(!V)return;const L=((e==="horizontal"?$.clientX:$.clientY)-G.start)/V*100;h(Gd(G.startSizes,G.g,L,d))},_=()=>{g.current=null,window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",k),window.addEventListener("pointerup",_)},v=(j,T)=>{h(Gd(m,j,T*CI,d))},x=j=>{c.current=j,typeof a=="function"?a(j):a&&(a.current=j)};let w=-1,b=-1;const C=u.map(j=>{var T,E;if(j.type===Ma){w+=1;const k=w,_={...j.props.style,flexBasis:`${m[k]??0}%`,flexGrow:0,flexShrink:0};return S.cloneElement(j,{key:j.key??`panel-${k}`,style:_})}if(j.type===Zg){b+=1;const k=b,_={direction:e,valueNow:Math.round(m[k]??0),valueMin:((T=d[k])==null?void 0:T.min)??0,valueMax:((E=d[k])==null?void 0:E.max)??100,onResizeStart:$=>y(k,$),onKeyResize:$=>v(k,$)};return S.cloneElement(j,{key:j.key??`handle-${k}`,__internal:_})}return j}),{className:P,style:R,styleTag:M}=se(o,r,"cny-panel-group",e==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:P,style:R,...i,children:[M,C]})});function PI(){}function RI(t,e,n,r){if(e<1)return[];if(e===1)return[{type:"page",page:1}];const o=e,s=Math.max(1,t-n),i=Math.min(o,t+n),a=[],c=r&&s>1,u=r&&i<o,d=c&&s>2,f=u&&i<o-1;c&&a.push({type:"page",page:1}),d&&a.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)a.push({type:"page",page:h});return f&&a.push({type:"ellipsis",key:"r"}),u&&a.push({type:"page",page:o}),a.filter((h,m,g)=>h.type!=="page"?!0:g.findIndex(y=>y.type==="page"&&y.page===h.page)===m)}const Qg=S.forwardRef(function({page:e,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:a="md",className:c,style:u,sx:d,"aria-label":f="Pagination"},h){const m=S.useMemo(()=>RI(e,n,o,s),[e,n,o,s]),g=w=>{w<1||w>n||w===e||r(w)},{className:y,style:v,styleTag:x}=se(d,u,"cny-pagination",`cny-pagination-${a}`,c);return l.jsxs("nav",{ref:h,role:"navigation","aria-label":f,className:y,style:v,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e-1),disabled:e<=1,"aria-label":"Previous page",children:l.jsx(Vo,{size:14,"aria-hidden":"true"})}),m.map(w=>w.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(_S,{size:14})},`e-${w.key}`):l.jsx("button",{type:"button",className:W("cny-pagination-btn",w.page===e&&"is-active"),"aria-current":w.page===e?"page":void 0,onClick:()=>g(w.page),children:w.page},w.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e+1),disabled:e>=n,"aria-label":"Next page",children:l.jsx(Jt,{size:14,"aria-hidden":"true"})})]})}),Mi={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function TI(t){return t.id}function MI(t,e){return!t||t.field!==e?{field:e,sort:"asc"}:t.sort==="asc"?{field:e,sort:"desc"}:null}const EI=S.forwardRef(function({columns:e,rows:n,getRowId:r=TI,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:m,noRowsLabel:g="No rows",disableColumnResize:y=!1,density:v="standard",checkboxColumnWidth:x=44,stickyHeader:w=!1,tableLayout:b="auto",getRowClassName:C,className:P,style:R,sx:M},j){const T=e.length+(c?1:0),E=S.useRef(null),[k,_]=S.useState(null),$=(F,q)=>{var gn;q.preventDefault(),q.stopPropagation();const he={};(gn=E.current)==null||gn.querySelectorAll("thead th[data-field]").forEach(pe=>{const we=pe.dataset.field;we&&(he[we]=pe.getBoundingClientRect().width)});const ue=q.clientX,He=he[F]??0;_(he);const ve=pe=>{_({...he,[F]:Math.max(60,He+(pe.clientX-ue))})},qe=()=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",qe)};window.addEventListener("pointermove",ve),window.addEventListener("pointerup",qe)},G=F=>!y&&F.resizable!==!1,Q=u??[],V=new Set(Q),I=n.map(F=>r(F)),L=I.length>0&&I.every(F=>V.has(F)),O=I.some(F=>V.has(F)),D=L?!0:O?"indeterminate":!1,X=()=>{if(d)if(L)d(Q.filter(F=>!I.includes(F)));else{const F=new Set(Q);I.forEach(q=>F.add(q)),d([...F])}},A=F=>{d&&(V.has(F)?d(Q.filter(q=>q!==F)):d([...Q,F]))},B=F=>{!F.sortable||!h||h(MI(f,F.field))},ee=b==="fixed",K=e.reduce((F,q)=>q.width!=null?F:F+(q.flex??1),0),H=(c?x:0)+e.reduce((F,q)=>typeof q.width=="number"?F+q.width:F,0),oe=F=>{if(F.width!=null)return F.width;if(K<=0)return;const q=(F.flex??1)/K;return H>0?`calc((100% - ${H}px) * ${q.toFixed(6)})`:`${(q*100).toFixed(4)}%`},Y=F=>F.width!=null?{width:F.width,minWidth:F.width}:{flex:F.flex??1},z=()=>{if(!i||s==null)return null;const{page:F,pageSize:q}=i,he=Math.max(1,Math.ceil(s/q)),ue=s===0?0:F*q+1,He=Math.min(s,(F+1)*q);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[ue,"–",He," of ",s]}),l.jsx(Qg,{page:F+1,pageCount:he,size:"sm",onPageChange:ve=>a==null?void 0:a({page:ve-1,pageSize:q})})]})},{className:Z,style:le,styleTag:ce}=se(M,R,"cny-dt",v==="compact"&&"cny-dt-compact",w&&"cny-dt-sticky",P);return l.jsxs("div",{ref:j,className:Z,style:le,children:[ce,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:E,className:"cny-dt-table",style:k?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:ee?{tableLayout:"fixed",width:"100%"}:void 0,children:[(k||ee)&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:x}}),e.map(F=>l.jsx("col",{style:{width:k?k[F.field]:oe(F)}},F.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(Ca,{checked:D,onCheckedChange:X,"aria-label":"Select all rows"})}),e.map(F=>{const q=(f==null?void 0:f.field)===F.field,he=F.headerAlign??F.align;return l.jsxs("th",{scope:"col","data-field":F.field,style:k?void 0:Y(F),"aria-sort":q?f.sort==="asc"?"ascending":"descending":void 0,className:W(he&&Mi[he],F.sortable&&"cny-dt-sortable",q&&"is-sorted"),children:[F.sortable?l.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>B(F),children:l.jsxs("span",{className:"cny-dt-th-inner",children:[F.headerName??F.field,l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:q?f.sort==="desc"?l.jsx(zr,{size:14}):l.jsx(bp,{size:14}):l.jsx(wp,{size:14})})]})}):l.jsx("span",{className:"cny-dt-th-inner",children:F.headerName??F.field}),G(F)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:ue=>ue.stopPropagation(),onPointerDown:ue=>$(F.field,ue)})]},F.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((F,q)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(ia,{shape:"avatar",width:16,height:16})}),e.map(he=>l.jsx("td",{className:he.align&&Mi[he.align],children:l.jsx(ia,{width:"70%"})},he.field))]},`sk-${q}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:T,children:g})}):n.map(F=>{const q=r(F),he=V.has(q);return l.jsxs("tr",{className:W("cny-dt-row",he&&"is-selected",m&&"is-clickable",C==null?void 0:C(F)),onClick:()=>m==null?void 0:m(F),tabIndex:m?0:void 0,onKeyDown:m?ue=>{ue.target===ue.currentTarget&&(ue.key==="Enter"||ue.key===" ")&&(ue.preventDefault(),m(F))}:void 0,children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:ue=>ue.stopPropagation(),children:l.jsx(Ca,{checked:he,onCheckedChange:()=>A(q),"aria-label":`Select row ${String(q)}`})}),e.map(ue=>{const He=ue.valueGetter?ue.valueGetter({row:F,field:ue.field}):F[ue.field];return l.jsx("td",{className:ue.align&&Mi[ue.align],children:ue.renderCell?ue.renderCell({row:F,value:He,field:ue.field}):He},ue.field)})]},String(q))})})]})}),z()]})}),Ea=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Tn(t,e){return e??Ea[t%Ea.length]}function sl(t=600){const e=S.useRef(null),[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{var c;const a=Math.round(((c=i[0])==null?void 0:c.contentRect.width)??0);a>0&&r(u=>u===a?u:a)});return s.observe(o),()=>s.disconnect()},[]),[e,n]}function Jg(t,e=4){if(t<=0)return{max:1,ticks:[0,1]};const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r,s=(o<=1?1:o<=2?2:o<=5?5:10)*r,i=Math.ceil(t/s)*s,a=[];for(let c=0;c<=i+1e-9;c+=s)a.push(Number(c.toFixed(6)));return{max:i,ticks:a}}function jI(t,e,n,r,o,s){const i=(v,x)=>[t+v*Math.sin(x),e-v*Math.cos(x)],a=s-o>Math.PI?1:0,[c,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${t} ${e} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,m]=i(r,s),[g,y]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${m}`,`A ${r} ${r} 0 ${a} 0 ${g} ${y}`,"Z"].join(" ")}function il({caption:t,head:e,rows:n}){return l.jsxs("table",{className:"cny-sr-only",children:[l.jsx("caption",{children:t}),l.jsx("thead",{children:l.jsx("tr",{children:e.map((r,o)=>l.jsx("th",{scope:"col",children:r},o))})}),l.jsx("tbody",{children:n.map((r,o)=>l.jsx("tr",{children:r.map((s,i)=>l.jsx("td",{children:s},i))},o))})]})}const Oe={top:12,right:14,bottom:28,left:40};function AI({data:t,xKey:e,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:a=!0,yTickFormatter:c=g=>String(g),xTickFormatter:u=g=>g,renderTooltip:d,className:f,style:h,sx:m}){const[g,y]=sl(),[v,x]=S.useState(null),w=Math.max(0,y-Oe.left-Oe.right),b=Math.max(0,r-Oe.top-Oe.bottom),C=(I,L)=>Number(I[L]??0),P=t.length?Math.max(0,...t.map(I=>s?n.reduce((L,O)=>L+C(I,O.key),0):Math.max(...n.map(L=>C(I,L.key))))):0,{max:R,ticks:M}=Jg(P),j=I=>Oe.top+b*(1-I/R),T=t.length,E=T?w/T:0,k=E*.68,_=I=>Oe.left+I*E+(E-k)/2,$=s?k:k/Math.max(1,n.length),{className:G,style:Q,styleTag:V}=se(m,{position:"relative",...h},"cny-chart",f);return l.jsxs("div",{ref:g,className:G,style:Q,children:[V,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${y} ${r}`,role:"img","aria-label":o,children:[i&&M.map(I=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:Oe.left,x2:y-Oe.right,y1:j(I),y2:j(I)}),l.jsx("text",{className:"cny-chart-axis",x:Oe.left-6,y:j(I),dy:"0.32em",textAnchor:"end",children:c(I)})]},I)),t.map((I,L)=>{let O=0;return l.jsx("g",{children:n.map((D,X)=>{const A=C(I,D.key),B=A/R*b;let ee,K;return s?(ee=_(L),K=j(O+A),O+=A):(ee=_(L)+X*$,K=j(A)),l.jsx("rect",{className:"cny-chart-bar",x:ee,y:K,width:Math.max(0,$-(s?0:2)),height:Math.max(0,B),rx:2,fill:Tn(X,D.color)},D.key)})},L)}),t.map((I,L)=>{const O=u(String(I[e]??"")),D=`${O}: ${n.map(X=>`${X.label??X.key} ${C(I,X.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:Oe.left+L*E+E/2,y:r-Oe.bottom+16,textAnchor:"middle",children:O}),l.jsx("rect",{className:"cny-chart-hit",x:Oe.left+L*E,y:Oe.top,width:E,height:b,fill:"transparent",tabIndex:0,"aria-label":D,onMouseEnter:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onMouseLeave:()=>x(null),onFocus:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onBlur:()=>x(null)})]},`x-${L}`)})]}),l.jsx(il,{caption:o,head:[String(e),...n.map(I=>I.label??I.key)],rows:t.map(I=>[u(String(I[e]??"")),...n.map(L=>C(I,L.key))])}),v&&t[v.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${v.x/y*100}%`,top:v.y},children:d?d({label:String(t[v.index][e]),datum:t[v.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[v.index][e])}),n.map((I,L)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(L,I.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:I.label??I.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(t[v.index],I.key)})]},I.key))]})}),a&&l.jsx("div",{className:"cny-chart-legend",children:n.map((I,L)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(L,I.color)}}),I.label??I.key]},I.key))})]})}const st={top:12,right:14,bottom:28,left:40};function ey({data:t,xKey:e,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:a=!0,grid:c=!0,legend:u=!0,yTickFormatter:d=v=>String(v),xTickFormatter:f=v=>v,renderTooltip:h,className:m,style:g,sx:y}){const[v,x]=sl(),[w,b]=S.useState(null),C=Math.max(0,x-st.left-st.right),P=Math.max(0,r-st.top-st.bottom),R=(O,D)=>Number(O[D]??0),M=t.length?Math.max(0,...t.map(O=>i?n.reduce((D,X)=>D+R(O,X.key),0):Math.max(...n.map(D=>R(O,D.key))))):0,{max:j,ticks:T}=Jg(M),E=O=>st.top+P*(1-O/j),k=t.length,_=k?C/k:0,$=O=>st.left+O*_+_/2,G=E(0),Q=t.map(()=>0),{className:V,style:I,styleTag:L}=se(y,{position:"relative",...g},"cny-chart",m);return l.jsxs("div",{ref:v,className:V,style:I,children:[L,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,role:"img","aria-label":o,children:[c&&T.map(O=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:st.left,x2:x-st.right,y1:E(O),y2:E(O)}),l.jsx("text",{className:"cny-chart-axis",x:st.left-6,y:E(O),dy:"0.32em",textAnchor:"end",children:d(O)})]},O)),n.map((O,D)=>{const X=Tn(D,O.color),A=t.map((K,H)=>{const oe=R(K,O.key),Y=i?Q[H]:0,z=Y+oe;return i&&(Q[H]=z),{x:$(H),y:E(z),yBase:E(Y)}});if(A.length===0)return null;const B=A.map(K=>`${K.x},${K.y}`).join(" "),ee=`M ${A[0].x} ${i?A[0].yBase:G} `+A.map(K=>`L ${K.x} ${K.y}`).join(" ")+` L ${A[A.length-1].x} ${i?A[A.length-1].yBase:G} Z`;return l.jsxs("g",{children:[s&&l.jsx("path",{className:"cny-chart-area",d:ee,fill:X}),l.jsx("polyline",{className:"cny-chart-line",points:B,fill:"none",stroke:X}),a&&A.map((K,H)=>l.jsx("circle",{className:"cny-chart-dot",cx:K.x,cy:K.y,r:3,fill:X},H))]},O.key)}),t.map((O,D)=>{const X=f(String(O[e]??"")),A=`${X}: ${n.map(B=>`${B.label??B.key} ${R(O,B.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:$(D),y:r-st.bottom+16,textAnchor:"middle",children:X}),l.jsx("rect",{className:"cny-chart-hit",x:st.left+D*_,y:st.top,width:_,height:P,fill:"transparent",tabIndex:0,"aria-label":A,onMouseEnter:()=>b({index:D,x:$(D)}),onMouseLeave:()=>b(null),onFocus:()=>b({index:D,x:$(D)}),onBlur:()=>b(null)})]},`x-${D}`)})]}),l.jsx(il,{caption:o,head:[String(e),...n.map(O=>O.label??O.key)],rows:t.map(O=>[f(String(O[e]??"")),...n.map(D=>R(O,D.key))])}),w&&t[w.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${w.x/x*100}%`,top:st.top},children:h?h({label:String(t[w.index][e]),datum:t[w.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[w.index][e])}),n.map((O,D)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(D,O.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:O.label??O.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:R(t[w.index],O.key)})]},O.key))]})}),u&&l.jsx("div",{className:"cny-chart-legend",children:n.map((O,D)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(D,O.color)}}),O.label??O.key]},O.key))})]})}function DI(t){return l.jsx(ey,{...t,area:!1})}function II(t){return l.jsx(ey,{...t,area:!0})}function kI({data:t,height:e=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,renderTooltip:s,centerLabel:i,className:a,style:c,sx:u}){const[d,f]=sl(360),[h,m]=S.useState(null),g=t.reduce((T,E)=>T+Math.max(0,E.value),0),y=Math.min(f,e),v=f/2,x=e/2,w=y/2*.86,b=r>0?w*r:0;let C=0;const P=t.map((T,E)=>{const k=g>0?Math.max(0,T.value)/g:0,_=C,$=C+k*Math.PI*2;return C=$,{d:T,i:E,start:_,end:$,frac:k,color:Tn(E,T.color)}}),{className:R,style:M,styleTag:j}=se(u,{position:"relative",...c},"cny-chart",a);return l.jsxs("div",{ref:d,className:R,style:M,children:[j,l.jsxs("svg",{width:"100%",height:e,viewBox:`0 0 ${f} ${e}`,role:"img","aria-label":n,children:[P.map(T=>T.frac>=.9999?l.jsx("circle",{className:W("cny-chart-slice",h===T.i&&"is-active"),cx:v,cy:x,r:b>0?(w+b)/2:w,fill:b>0?"none":T.color,stroke:b>0?T.color:void 0,strokeWidth:b>0?w-b:void 0,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i):l.jsx("path",{className:W("cny-chart-slice",h===T.i&&"is-active"),d:jI(v,x,w,b,T.start,T.end),fill:T.color,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i)),i!=null&&b>0&&l.jsx("foreignObject",{x:v-b,y:x-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:i})})]}),l.jsx(il,{caption:n,head:["Slice","Value","Share"],rows:P.map(T=>[T.d.label,T.d.value,`${Math.round(T.frac*100)}%`])}),h!=null&&P[h]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:s?s({datum:P[h].d,percent:P[h].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P[h].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:P[h].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[P[h].d.value," (",Math.round(P[h].frac*100),"%)"]})]})}),o&&l.jsx("div",{className:"cny-chart-legend",children:P.map(T=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:T.color}}),T.d.label]},T.i))})]})}function NI({height:t=300,children:e,className:n,style:r,sx:o}){const s=S.Children.only(e),{className:i,style:a,styleTag:c}=se(o,{width:"100%",height:t,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,S.isValidElement(s)?S.cloneElement(s,{height:t}):s]})}const _I=S.forwardRef(function({variant:e="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-list",e,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),OI=S.forwardRef(function({leading:e,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},m){const g=u??(i?"a":s?"button":"li"),y=!a&&(i!=null||s!=null),v=d??l.jsxs(l.Fragment,{children:[e&&l.jsx("span",{className:"cny-list-item-leading",children:e}),l.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&l.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&l.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&l.jsx("span",{className:"cny-list-item-trailing",children:n})]}),x=l.jsx(g,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:y&&g==="div"?0:void 0,className:W("cny-list-item",c&&"is-active",a&&"is-disabled",y&&"is-interactive",f),...h,children:v});return g==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),LI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,role:"separator",className:W("cny-list-separator",e),...n})}),$I=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("li",{ref:o,className:W("cny-list-subheader",e),...r,children:n})});var FI=Object.defineProperty,pr=(t,e)=>FI(t,"name",{value:e,configurable:!0}),al="Tabs",[VI,CN]=Re(al,[un]),ty=un(),[BI,cl]=VI(al),GI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,f=Ht(c),[h,m]=Pe({prop:o,onChange:s,defaultProp:i??"",caller:al});return l.jsx(BI,{scope:r,baseId:Fe(),value:h,onValueChange:m,orientation:a,dir:f,activationMode:u,children:l.jsx(re.div,{dir:f,"data-orientation":a,...d,ref:n})})},"Tabs")),zI="TabsList",UI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,loop:o=!0,...s}=e,i=cl(zI,r),a=ty(r);return l.jsx(ds,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:o,children:l.jsx(re.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:n})})},"TabsList")),HI="TabsTrigger",WI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,disabled:s=!1,...i}=e,a=cl(HI,r),c=ty(r),u=ll(a.baseId,o),d=ul(a.baseId,o),f=o===a.value;return l.jsx(fs,{asChild:!0,...c,focusable:!s,active:f,children:l.jsx(re.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:n,onMouseDown:U(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(o):h.preventDefault()}),onKeyDown:U(e.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&a.onValueChange(o)}),onFocus:U(e.onFocus,()=>{const h=a.activationMode!=="manual";!f&&!s&&h&&a.onValueChange(o)})})})},"TabsTrigger")),KI="TabsContent",YI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,forceMount:s,children:i,...a}=e,c=cl(KI,r),u=ll(c.baseId,o),d=ul(c.baseId,o),f=o===c.value,h=p.useRef(f);return p.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Ue,{present:s||f,children:({present:m})=>l.jsx(re.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})},"TabsContent"));function ll(t,e){return`${t}-trigger-${e}`}pr(ll,"makeTriggerId");function ul(t,e){return`${t}-content-${e}`}pr(ul,"makeContentId");var XI=GI,qI=UI,ZI=WI,QI=YI;const JI=S.forwardRef(function({variant:e="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(s,o,"cny-tabs",`variant-${e}`,`size-${n}`,r);return l.jsxs(XI,{ref:c,className:u,style:d,...a,children:[f,i]})}),ek=S.forwardRef(function({className:e,...n},r){return l.jsx(qI,{ref:r,className:W("cny-tabs-list",e),...n})}),tk=S.forwardRef(function({icon:e,badge:n,className:r,children:o,...s},i){return l.jsxs(ZI,{ref:i,className:W("cny-tabs-trigger",r),...s,children:[e&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:e}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),nk=S.forwardRef(function({className:e,...n},r){return l.jsx(QI,{ref:r,className:W("cny-tabs-content",e),...n})});function rk(t){return t.multiple===!0}const ok=S.forwardRef(function(e,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:a=!1,loadingText:c="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,id:m,"aria-invalid":g,"aria-describedby":y,"aria-label":v,className:x,style:w,sx:b}=e,C=S.useId(),P=m??`cny-ac-${C}`,[R,M]=S.useState(!1),[j,T]=S.useState(""),E=S.useRef(null),k=rk(e),[_,$]=S.useState(!k&&e.defaultValue!==void 0?e.defaultValue??null:null),[G,Q]=S.useState(k&&e.defaultValue!==void 0?e.defaultValue??[]:[]),V=k?e.value!==void 0?e.value:G:(()=>{const H=e.value!==void 0?e.value:_;return H==null?[]:[H]})(),I=S.useCallback(H=>{var oe,Y;if(k)e.value===void 0&&Q(H),(oe=e.onValueChange)==null||oe.call(e,H);else{const z=H[0]??null;e.value===void 0&&$(z),(Y=e.onValueChange)==null||Y.call(e,z)}},[k,e]),L=S.useCallback(H=>{if(!H.disabled)if(k){const oe=e.maxItems,Y=V.includes(H.value);let z;if(Y)z=V.filter(Z=>Z!==H.value);else{if(oe!=null&&V.length>=oe)return;z=[...V,H.value]}I(z)}else I([H.value]),M(!1)},[I,k,V,e]),O=S.useCallback(H=>{var oe;H.stopPropagation(),I([]),(oe=E.current)==null||oe.focus()},[I]),D=S.useMemo(()=>{const H=new Map;for(const oe of r){const Y=oe.group??"";H.has(Y)||H.set(Y,[]),H.get(Y).push(oe)}return Array.from(H.entries())},[r]),X=H=>{var oe;return((oe=r.find(Y=>Y.value===H))==null?void 0:oe.label)??H},A=V.length===0?o:k?V.length===1?X(V[0]):`${X(V[0])} +${V.length-1}`:X(V[0]),{className:B,style:ee,styleTag:K}=se(b,w,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,V.length>0&&"has-value",R&&"is-open",x);return l.jsxs(Dc,{open:R,onOpenChange:M,children:[l.jsx(Ic,{asChild:!0,children:l.jsxs("button",{ref:H=>{E.current=H,typeof n=="function"?n(H):n&&(n.current=H)},type:"button",id:P,className:B,style:ee,disabled:f,"aria-label":v,"aria-invalid":g,"aria-describedby":y,"aria-haspopup":"listbox","aria-expanded":R,children:[K,l.jsx("span",{className:W("cny-ac-value",V.length===0&&"is-placeholder"),children:A}),h&&V.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:O,onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),O(H))},onPointerDown:H=>H.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})}),l.jsx(wp,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(kc,{children:l.jsx(Nc,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(De,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(De.Input,{value:j,onValueChange:T,placeholder:s})}),l.jsx(De.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Tp,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(De.Empty,{className:"cny-ac-empty",children:i},"empty"),D.map(([H,oe],Y)=>{const z=oe.map((Z,le)=>{const ce=V.includes(Z.value);return l.jsxs(De.Item,{value:`${H} ${Z.label} ${Z.value}`,disabled:Z.disabled,onSelect:()=>L(Z),className:W("cny-ac-item",ce&&"is-checked"),children:[k?l.jsx("span",{className:W("cny-ac-checkbox",ce&&"is-checked"),children:ce&&l.jsx(rn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[Z.icon??null,!Z.icon&&ce&&l.jsx(rn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:Z.label}),Z.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:Z.hint})]},Z.value||`opt-${Y}-${le}`)});return H===""?l.jsx(De.Group,{children:z},`__ungrouped_${Y}`):l.jsx(De.Group,{heading:H,children:z},H||`group_${Y}`)})]})})]})})})]})}),sk=S.forwardRef(function({items:e,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Jt,{size:12,"aria-hidden":"true"}),{className:d,style:f,styleTag:h}=se(i,s,"cny-breadcrumb",`cny-breadcrumb-${r}`,o);return l.jsxs("nav",{ref:c,"aria-label":"Breadcrumb",className:d,style:f,...a,children:[h,l.jsx("ol",{className:"cny-breadcrumb-list",children:e.map((m,g)=>{const y=g===e.length-1,v=l.jsx("span",{className:W("cny-breadcrumb-label",y&&"is-current"),children:m.label}),x=m.render?m.render(v):m.href&&!y?l.jsx("a",{href:m.href,className:"cny-breadcrumb-link",children:v}):v;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[y?l.jsx("span",{"aria-current":"page",children:v}):x,!y&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},g)})})]})});var ik=Object.defineProperty,to=(t,e)=>ik(t,"name",{value:e,configurable:!0}),dl="Collapsible",[ak,ny]=Re(dl),[ck,fl]=ak(dl),lk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:i,onOpenChange:a,...c}=e,[u,d]=Pe({prop:o,defaultProp:s??!1,onChange:a,caller:dl});return l.jsx(ck,{scope:r,disabled:i,contentId:Fe(),open:u,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),children:l.jsx(re.div,{"data-state":Ns(u),"data-disabled":i?"":void 0,...c,ref:n})})},"Collapsible")),uk="CollapsibleTrigger",dk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,...o}=e,s=fl(uk,r);return l.jsx(re.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Ns(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:U(e.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),ry="CollapsibleContent",fk=p.forwardRef(to(function(e,n){const{forceMount:r,...o}=e,s=fl(ry,e.__scopeCollapsible);return l.jsx(Ue,{present:r||s.open,children:({present:i})=>l.jsx(hk,{...o,ref:n,present:i})})},"CollapsibleContent")),hk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,present:o,children:s,...i}=e,a=fl(ry,r),[c,u]=p.useState(o),d=p.useRef(null),f=ie(n,d),h=p.useRef(0),m=h.current,g=p.useRef(0),y=g.current,v=a.open||c,x=p.useRef(v),w=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Ee(()=>{const b=d.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();h.current=C.height,g.current=C.width,x.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),u(o)}},[a.open,o]),l.jsx(re.div,{"data-state":Ns(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...i,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:v&&s})},"CollapsibleContentImpl"));function Ns(t){return t?"open":"closed"}to(Ns,"getState");var pk=lk,mk=dk,gk=fk,yk=Object.defineProperty,lt=(t,e)=>yk(t,"name",{value:e,configurable:!0}),Ot="Accordion",vk=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[hl,xk,bk]=cr(Ot),[_s,SN]=Re(Ot,[bk,ny]),pl=ny(),wk=p.forwardRef(lt(function(e,n){const{type:r,...o}=e,s=o,i=o;return l.jsx(hl.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(Rk,{...i,ref:n}):l.jsx(Pk,{...s,ref:n})})},"Accordion")),[oy,Ck]=_s(Ot),[sy,Sk]=_s(Ot,{collapsible:!1}),Pk=p.forwardRef(lt(function(e,n){const{value:r,defaultValue:o,onValueChange:s=lt(()=>{},"onValueChange"),collapsible:i=!1,...a}=e,[c,u]=Pe({prop:r,defaultProp:o??"",onChange:s,caller:Ot});return l.jsx(oy,{scope:e.__scopeAccordion,value:p.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:p.useCallback(()=>i&&u(""),[i,u]),children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:i,children:l.jsx(iy,{...a,ref:n})})})},"AccordionImplSingle")),Rk=p.forwardRef(lt(function(e,n){const{value:r,defaultValue:o,onValueChange:s=lt(()=>{},"onValueChange"),...i}=e,[a,c]=Pe({prop:r,defaultProp:o??[],onChange:s,caller:Ot}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(oy,{scope:e.__scopeAccordion,value:a,onItemOpen:u,onItemClose:d,children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(iy,{...i,ref:n})})})},"AccordionImplMultiple")),[Tk,Os]=_s(Ot),iy=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:i="vertical",...a}=e,c=p.useRef(null),u=ie(c,n),d=xk(r),h=Ht(s)==="ltr",m=U(e.onKeyDown,g=>{var T;if(!vk.includes(g.key))return;const y=g.target,v=d().filter(E=>{var k;return!((k=E.ref.current)!=null&&k.disabled)}),x=v.findIndex(E=>E.ref.current===y),w=v.length;if(x===-1)return;g.preventDefault();let b=x;const C=0,P=w-1,R=lt(()=>{b=x+1,b>P&&(b=C)},"moveNext"),M=lt(()=>{b=x-1,b<C&&(b=P)},"movePrev");switch(g.key){case"Home":b=C;break;case"End":b=P;break;case"ArrowRight":i==="horizontal"&&(h?R():M());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(h?M():R());break;case"ArrowUp":i==="vertical"&&M();break}const j=b%w;(T=v[j].ref.current)==null||T.focus()});return l.jsx(Tk,{scope:r,disabled:o,direction:s,orientation:i,children:l.jsx(hl.Slot,{scope:r,children:l.jsx(re.div,{...a,"data-orientation":i,ref:u,onKeyDown:o?void 0:m})})})},"AccordionImpl")),ja="AccordionItem",[Mk,ml]=_s(ja),Ek=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,value:o,...s}=e,i=Os(ja,r),a=Ck(ja,r),c=pl(r),u=Fe(),d=o&&a.value.includes(o)||!1,f=i.disabled||e.disabled;return l.jsx(Mk,{scope:r,open:d,disabled:f,triggerId:u,children:l.jsx(pk,{"data-orientation":i.orientation,"data-state":gl(d),...c,...s,ref:n,disabled:f,open:d,onOpenChange:h=>{h?a.onItemOpen(o):a.onItemClose(o)}})})},"AccordionItem")),jk="AccordionHeader",Ak=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(jk,r);return l.jsx(re.h3,{"data-orientation":s.orientation,"data-state":gl(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),zd="AccordionTrigger",Dk=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(zd,r),a=Sk(zd,r),c=pl(r);return l.jsx(hl.ItemSlot,{scope:r,children:l.jsx(mk,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...c,...o,ref:n})})},"AccordionTrigger")),Ik="AccordionContent",kk=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(Ik,r),a=pl(r);return l.jsx(gk,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function gl(t){return t?"open":"closed"}lt(gl,"getState");var Nk=wk,_k=Ek,Ok=Ak,Lk=Dk,$k=kk;const Fk=S.forwardRef(function({variant:e="plain",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"cny-accordion",`cny-accordion-${e}`,n);return l.jsxs(Nk,{ref:a,className:c,style:u,...i,children:[d,s]})}),Vk=S.forwardRef(function({className:e,...n},r){return l.jsx(_k,{ref:r,className:W("cny-accordion-item",e),...n})}),Bk=S.forwardRef(function({children:e,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(Ok,{className:"cny-accordion-header",children:l.jsxs(Lk,{ref:i,className:W("cny-accordion-trigger",n),...s,children:[r&&l.jsx("span",{className:"cny-accordion-trigger-icon",children:r}),l.jsx("span",{className:"cny-accordion-trigger-label",children:e}),!o&&l.jsx(zr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),Gk=S.forwardRef(function({children:e,className:n,...r},o){return l.jsx($k,{ref:o,className:W("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:e})})});var zk=Object.defineProperty,fe=(t,e)=>zk(t,"name",{value:e,configurable:!0}),ay=["PageUp","PageDown"],cy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ly={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},no="Slider",[Aa,Uk,Hk]=cr(no),[yl,PN]=Re(no,[Hk]),[Wk,ro]=yl(no),Kk=p.forwardRef(fe(function(e,n){const{name:r,min:o=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:f,onValueChange:h=fe(()=>{},"onValueChange"),onValueCommit:m=fe(()=>{},"onValueCommit"),inverted:g=!1,form:y,...v}=e,x=p.useRef(new Set),w=p.useRef(0),b=p.useRef(!1),P=a==="horizontal"?Yk:Xk,[R,M]=p.useState(null),j=ie(n,M),[T=[],E]=Pe({prop:f,defaultProp:d,onChange:fe(I=>{var O;(O=[...x.current][w.current])==null||O.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,h(I)},"onChange")}),k=p.useRef(T),_=p.useRef(T);p.useEffect(()=>{const I=y?R==null?void 0:R.ownerDocument.getElementById(y):R==null?void 0:R.closest("form");if(I instanceof HTMLFormElement){const L=fe(()=>E(_.current),"reset");return I.addEventListener("reset",L),()=>I.removeEventListener("reset",L)}},[R,y,E]);function $(I){const L=yy(T,I);V(I,L)}fe($,"handleSlideStart");function G(I){V(I,w.current)}fe(G,"handleSlideMove");function Q(){String(T)!==String(k.current)&&m(T)}fe(Q,"handleSlideEnd");function V(I,L,{commit:O}={commit:!1}){const D=xl(i),X=Pr(Math.round((I-o)/i)*i+o,D),A=Ar(X,[o,s]);E((B=[])=>{const ee=my(B,A,L);if(by(ee,u*i)){w.current=ee.indexOf(A);const K=String(ee)!==String(B);return K&&O&&m(ee),K?ee:B}else return B})}return fe(V,"updateValues"),l.jsx(Wk,{scope:e.__scopeSlider,name:r,disabled:c,min:o,max:s,valueIndexToChangeRef:w,thumbs:x.current,values:T,orientation:a,form:y,children:l.jsx(Aa.Provider,{scope:e.__scopeSlider,children:l.jsx(Aa.Slot,{scope:e.__scopeSlider,children:l.jsx(P,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:j,onPointerDown:U(v.onPointerDown,()=>{c||(k.current=T,b.current=!1)}),min:o,max:s,inverted:g,onSlideStart:c?void 0:$,onSlideMove:c?void 0:G,onSlideEnd:c?void 0:Q,onHomeKeyDown:()=>{c||(b.current=!0,V(o,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,V(s,T.length-1,{commit:!0}))},onStepKeyDown:({event:I,direction:L})=>{if(!c){b.current=!0;const X=ay.includes(I.key)||I.shiftKey&&cy.includes(I.key)?10:1,A=w.current,B=T[A],ee=wy(B,{min:o,step:i,direction:L,multiplier:X});V(ee,A,{commit:!0})}}})})})})},"Slider")),[uy,dy]=yl(no,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Yk=p.forwardRef(fe(function(e,n){const{min:r,max:o,dir:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[h,m]=p.useState(null),g=ie(n,m),y=p.useRef(void 0),v=Ht(s),x=v==="ltr",w=x&&!i||!x&&i;function b(C){const P=y.current||h.getBoundingClientRect(),R=[0,P.width],j=Ls(R,w?[r,o]:[o,r]);return y.current=P,j(C-P.left)}return fe(b,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:l.jsx(fy,{dir:v,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const P=b(C.clientX);a==null||a(P)},onSlideMove:C=>{const P=b(C.clientX);c==null||c(P)},onSlideEnd:()=>{y.current=void 0,u==null||u()},onStepKeyDown:C=>{const R=ly[w?"from-left":"from-right"].includes(C.key);d==null||d({event:C,direction:R?-1:1})}})})},"SliderHorizontal")),Xk=p.forwardRef(fe(function(e,n){const{min:r,max:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=p.useRef(null),h=ie(n,f),m=p.useRef(void 0),g=!s;function y(v){const x=m.current||f.current.getBoundingClientRect(),w=[0,x.height],C=Ls(w,g?[o,r]:[r,o]);return m.current=x,C(v-x.top)}return fe(y,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:l.jsx(fy,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const x=y(v.clientY);i==null||i(x)},onSlideMove:v=>{const x=y(v.clientY);a==null||a(x)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:v=>{const w=ly[g?"from-bottom":"from-top"].includes(v.key);u==null||u({event:v,direction:w?-1:1})}})})},"SliderVertical")),fy=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,onSlideStart:o,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:u,...d}=e,f=ro(no,r);return l.jsx(re.span,{...d,ref:n,onKeyDown:U(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(c(h),h.preventDefault()):ay.concat(cy).includes(h.key)&&(u(h),h.preventDefault())}),onPointerDown:U(e.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(h)}),onPointerMove:U(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:U(e.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),i(h))})})},"SliderImpl")),qk="SliderTrack",Zk=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(qk,r);return l.jsx(re.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:n})},"SliderTrack")),Ud="SliderRange",Qk=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(Ud,r),i=dy(Ud,r),a=p.useRef(null),c=ie(n,a),u=s.values.length,d=s.values.map(m=>vl(m,s.min,s.max)),f=u>1?Math.min(...d):0,h=100-Math.max(...d);return l.jsx(re.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:c,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:h+"%"}})},"SliderRange")),Jk="SliderThumb",[eN,hy]=yl(Jk),tN="SliderThumbProvider";function py(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:o}=t,s=ro(tN,e),i=Uk(e),[a,c]=p.useState(null),u=p.useMemo(()=>a?i().findIndex(v=>v.ref.current===a):-1,[i,a]),d=hr(a),f=a?!!s.form||!!a.closest("form"):!0,h=s.values[u],m=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),g=h===void 0?0:vl(h,s.min,s.max);p.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]);const y={value:h,name:m,form:s.form,isFormControl:f,index:u,thumb:a,onThumbChange:c,percent:g,size:d};return l.jsx(eN,{scope:e,...y,children:Cy(o)?o(y):r})}fe(py,"SliderThumbProvider");var Ei="SliderThumbTrigger",nN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(Ei,r),i=dy(Ei,r),{index:a,value:c,percent:u,size:d,onThumbChange:f}=hy(Ei,r),h=ie(n,f),m=gy(a,s.values.length),g=d==null?void 0:d[i.size],y=g?vy(g,u,i.direction):0;return l.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${u}% + ${y}px)`},children:l.jsx(Aa.ItemSlot,{scope:r,children:l.jsx(re.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":c,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:c===void 0?{display:"none"}:e.style,onFocus:U(e.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})},"SliderThumbTrigger")),rN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,name:o,...s}=e;return l.jsx(py,{__scopeSlider:r,name:o,internal_do_not_use_render:({index:i,isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(nN,{...s,ref:n,__scopeSlider:r}),a?l.jsx(sN,{__scopeSlider:r},i):null]})})},"SliderThumb")),oN="SliderBubbleInput",sN=p.forwardRef(fe(function({__scopeSlider:e,...n},r){const{value:o,name:s,form:i}=hy(oN,e),a=p.useRef(null),c=ie(a,r),u=Pc(o);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==o&&m){const g=new Event("input",{bubbles:!0});m.call(d,o),d.dispatchEvent(g)}},[u,o]),l.jsx(re.input,{style:{display:"none"},name:s,form:i,...n,ref:c,defaultValue:o})},"SliderBubbleInput"));function my(t=[],e,n){const r=[...t];return r[n]=e,r.sort((o,s)=>o-s)}fe(my,"getNextSortedValues");function vl(t,e,n){const s=100/(n-e)*(t-e);return Ar(s,[0,100])}fe(vl,"convertValueToPercentage");function gy(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}fe(gy,"getLabel");function yy(t,e){if(t.length===1)return 0;const n=t.map(o=>Math.abs(o-e)),r=Math.min(...n);return n.indexOf(r)}fe(yy,"getClosestValueIndex");function vy(t,e,n){const r=t/2,s=Ls([0,50],[0,r]);return(r-s(e)*n)*n}fe(vy,"getThumbInBoundsOffset");function xy(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}fe(xy,"getStepsBetweenValues");function by(t,e){if(e>0){const n=xy(t);return Math.min(...n)>=e}return!0}fe(by,"hasMinStepsBetweenValues");function Ls(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}fe(Ls,"linearScale");function xl(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,o]=e.split("e"),s=r.split(".")[1]||"",i=Number(o);return Math.max(0,s.length-i)}const n=e.split(".")[1];return n?n.length:0}fe(xl,"getDecimalCount");function Pr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}fe(Pr,"roundValue");function wy(t,{min:e,step:n,direction:r,multiplier:o}){const s=xl(n),i=(t-e)/n,a=Math.round(i),c=Pr(a*n+e,s)===Pr(t,s);let u;return c?u=a+o*r:r>0?u=Math.ceil(i):u=Math.floor(i),Pr(u*n+e,s)}fe(wy,"getNextStepValue");function Cy(t){return typeof t=="function"}fe(Cy,"isFunction");const iN=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",color:s="primary",showValue:i=!1,formatValue:a,value:c,defaultValue:u,...d},f){const h=c??u??[0],m=a??(x=>x),{className:g,style:y,styleTag:v}=se(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,e);return l.jsxs(Kk,{ref:f,className:g,style:y,value:c,defaultValue:u,...d,children:[v,l.jsx(Zk,{className:"cny-slider-track",children:l.jsx(Qk,{className:"cny-slider-range"})}),h.map((x,w)=>l.jsx(rN,{className:"cny-slider-thumb","aria-label":`Value ${w+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:m(x)})},w))]})}),aN=S.forwardRef(function({steps:e,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:m}=se(c,a,"cny-stepper",`cny-stepper-${r}`,`cny-stepper-${o}`,i);return l.jsxs("ol",{ref:d,className:f,style:h,"aria-label":"Progress",...u,children:[m,e.map((g,y)=>{const v=y<n?"complete":y===n?"active":"upcoming",x=v==="complete"&&!!s;return l.jsxs("li",{className:W("cny-stepper-step",`is-${v}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:x?()=>s==null?void 0:s(y):void 0,disabled:!x,"aria-current":v==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:v==="complete"?l.jsx(rn,{size:14}):g.icon??y+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:g.label}),g.description&&l.jsx("span",{className:"cny-stepper-desc",children:g.description})]})]}),y<e.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},y)})]})}),cN=S.forwardRef(function({size:e=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const a=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),c=`cny-loader-fade-reveal-${a}`,u=`cny-loader-${a}`;return l.jsxs("div",{ref:i,className:W("cny-loader",u,r),style:{width:e,height:e*(24/21.635),color:n,...o},...s,children:[l.jsx(ka,{css:`
210
210
  @keyframes ${c} {
211
211
  0%, 100% { opacity: 0; transform: translateY(8px); }
212
212
  15%, 70% { opacity: 1; transform: translateY(0); }
@@ -224,5 +224,5 @@
224
224
  @media (prefers-reduced-motion: reduce) {
225
225
  .${u} .cny-loader-path { animation: none; opacity: 1; transform: none; }
226
226
  }
227
- `}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21.635 24",width:"100%",height:"100%","aria-label":"Loading",role:"img",children:l.jsxs("g",{transform:"translate(-1.257)",children:[l.jsx("path",{className:"cny-loader-path cny-loader-path-1",d:"M12.1,0c.164.445.331.89.492,1.336.395,1.1.182.893,1.3,1.1a10.661,10.661,0,0,1,6.248,3.545,10.889,10.889,0,0,1,2.635,5.742,11.121,11.121,0,0,1-1.05,6.511.338.338,0,0,1-.5.2q-2.952-1.155-5.91-2.295c-.974-.376-1.947-.76-2.935-1.1a1.239,1.239,0,0,0-.776.039c-2.143.806-4.276,1.636-6.413,2.457-.779.3-1.56.59-2.336.895-.21.082-.342.07-.45-.159a11.861,11.861,0,0,1-1.136-5.711A10.322,10.322,0,0,1,3.325,6.821,10.552,10.552,0,0,1,8.058,3.065a20.428,20.428,0,0,1,2.754-.7.587.587,0,0,0,.5-.418c.226-.649.475-1.291.714-1.936ZM6.638,14.907l-.087-.079c.11-.279.224-.557.328-.838q1.362-3.7,2.721-7.4c.349-.948.7-1.893,1.052-2.841.142-.386.071-.465-.339-.4-.046.008-.093.015-.138.025A9.679,9.679,0,0,0,3.769,7.9,10.238,10.238,0,0,0,3,17.173a.353.353,0,0,0,.529.229c.5-.193,1.014-.372,1.518-.566,2.225-.856,4.446-1.722,6.676-2.564a1.115,1.115,0,0,1,.706.006c.984.351,1.954.739,2.93,1.114q2.6,1,5.191,2c.272.106.438.057.553-.224a10.579,10.579,0,0,0,.7-5.15,9.587,9.587,0,0,0-1.536-4.234,9.885,9.885,0,0,0-6.433-4.434c-.4-.087-.492.014-.355.4.368,1.027.75,2.049,1.128,3.073l2.272,6.144c.238.645.474,1.29.733,1.995-.154-.045-.241-.064-.323-.1-1.632-.629-3.262-1.266-4.9-1.883a.949.949,0,0,0-.6-.03c-.973.348-1.932.731-2.9,1.1C8.146,14.339,7.392,14.622,6.638,14.907Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-2",d:"M20.8,19.615a.488.488,0,0,1-.668.472c-2.54-.979-5.081-1.953-7.617-2.941a1.3,1.3,0,0,0-1.016.02q-3.751,1.468-7.516,2.9a.6.6,0,0,1-.5-.082c-.266-.217-.214-.414.108-.538,2.737-1.054,5.474-2.11,8.218-3.147a.99.99,0,0,1,.637.044c1.494.561,2.979,1.144,4.468,1.718,1.193.459,2.389.912,3.582,1.373A1.853,1.853,0,0,1,20.8,19.615Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-3",d:"M19.535,21.173c-.368.517-.49.556-1,.357-1.969-.764-3.952-1.5-5.9-2.306a2.146,2.146,0,0,0-1.741.243c-1.8.675-3.589,1.391-5.383,2.087-.418.162-.556.106-.924-.359.239-.109.461-.225.693-.315,2.145-.83,4.288-1.664,6.441-2.473a1.151,1.151,0,0,1,.742.014c2.252.847,4.5,1.718,6.739,2.585C19.311,21.051,19.419,21.115,19.535,21.173Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-4",d:"M6.313,22.58a2.5,2.5,0,0,1,.265-.145c1.686-.65,3.375-1.293,5.058-1.949a1.127,1.127,0,0,1,.881,0c1.649.649,3.3,1.282,4.956,1.923a2.96,2.96,0,0,1,.274.14.807.807,0,0,1-1.033.324c-1.184-.45-2.365-.909-3.548-1.363a5.8,5.8,0,0,0-.826-.3,1.219,1.219,0,0,0-.646.028c-1.407.522-2.812,1.053-4.2,1.613A1.082,1.082,0,0,1,6.313,22.58Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-5",d:"M8.657,23.713c.369-.141.659-.254.949-.364.745-.283,1.489-.57,2.238-.843a.633.633,0,0,1,.4-.027c1.012.375,2.017.767,3.024,1.157.03.011.052.043.126.106a1.809,1.809,0,0,1-1.424.168c-.51-.208-1.012-.442-1.535-.612a1.356,1.356,0,0,0-.742,0,6.489,6.489,0,0,0-1.177.461A2.017,2.017,0,0,1,8.657,23.713Z"})]})})]})});exports.Accordion=_k;exports.AccordionContent=$k;exports.AccordionItem=Ok;exports.AccordionTrigger=Lk;exports.Alert=tP;exports.AreaChart=EI;exports.AspectRatio=MP;exports.Autocomplete=ek;exports.Avatar=nP;exports.AvatarStack=rP;exports.BREAKPOINTS=Hd;exports.Badge=oI;exports.BarChart=TI;exports.Box=An;exports.Breadcrumb=tk;exports.Button=Er;exports.ButtonGroup=oC;exports.CHART_COLORS=Ea;exports.CannyLoader=oN;exports.Card=QS;exports.Center=EP;exports.Checkbox=Ca;exports.Chip=rI;exports.CommandPalette=oj;exports.CommandPaletteTrigger=sj;exports.ConfirmDialog=Xm;exports.Container=PP;exports.ContextMenu=vD;exports.ContextMenuCheckboxItem=CD;exports.ContextMenuContent=bD;exports.ContextMenuItem=wD;exports.ContextMenuLabel=RD;exports.ContextMenuRadioGroup=SD;exports.ContextMenuRadioItem=PD;exports.ContextMenuSeparator=TD;exports.ContextMenuSub=MD;exports.ContextMenuSubContent=jD;exports.ContextMenuSubTrigger=ED;exports.ContextMenuTrigger=xD;exports.DataTable=PI;exports.DatePicker=nj;exports.Dialog=Ym;exports.DialogClose=hj;exports.DialogTrigger=fj;exports.Divider=RP;exports.Drawer=mj;exports.DrawerClose=yj;exports.DrawerTrigger=gj;exports.FAB=sC;exports.Field=IP;exports.FileUploader=yI;exports.Grid=SP;exports.Group=jP;exports.IconButton=iC;exports.Input=ZS;exports.LineChart=MI;exports.List=DI;exports.ListItem=II;exports.ListSeparator=kI;exports.ListSubheader=NI;exports.Menu=EA;exports.MenuCheckboxItem=IA;exports.MenuContent=AA;exports.MenuItem=DA;exports.MenuLabel=_A;exports.MenuRadioGroup=kA;exports.MenuRadioItem=NA;exports.MenuSeparator=OA;exports.MenuSub=LA;exports.MenuSubContent=FA;exports.MenuSubTrigger=$A;exports.MenuTrigger=jA;exports.MultiSelect=sE;exports.Navbar=cP;exports.NavbarActions=fP;exports.NavbarBrand=lP;exports.NavbarItem=dP;exports.NavbarNav=uP;exports.Pagination=Xg;exports.Panel=Ma;exports.PanelGroup=xI;exports.PanelResizeHandle=Yg;exports.PieChart=jI;exports.Popover=QD;exports.PopoverAnchor=eI;exports.PopoverClose=tI;exports.PopoverContent=nI;exports.PopoverTrigger=JD;exports.Progress=oP;exports.ProgressRing=sP;exports.Radio=NE;exports.RadioGroup=kE;exports.ResponsiveContainer=AI;exports.RichTreeView=pI;exports.Row=CP;exports.Scroll=Tp;exports.ScrollRegion=aP;exports.Select=z1;exports.SelectGroup=H1;exports.SelectItem=U1;exports.SelectLabel=W1;exports.SelectSeparator=K1;exports.Sidebar=hP;exports.SidebarFooter=mP;exports.SidebarHeader=pP;exports.SidebarItem=vP;exports.SidebarSection=yP;exports.SidebarToggle=gP;exports.Skeleton=ia;exports.Slider=nN;exports.Spacer=TP;exports.Stack=wP;exports.Stepper=rN;exports.Switch=zE;exports.Tabs=XI;exports.TabsContent=QI;exports.TabsList=qI;exports.TabsTrigger=ZI;exports.Text=DP;exports.Textarea=kP;exports.Timeline=sI;exports.TimelineConnector=lI;exports.TimelineContent=uI;exports.TimelineDot=cI;exports.TimelineItem=iI;exports.TimelineOppositeContent=dI;exports.TimelineSeparator=aI;exports.ToastProvider=lj;exports.ToggleButton=MC;exports.ToggleButtonGroup=aS;exports.ToggleButtonGroupItem=cS;exports.Tooltip=YD;exports.TooltipContent=ZD;exports.TooltipProvider=KD;exports.TooltipRoot=XD;exports.TooltipTrigger=qD;exports.TreeItem=Wg;exports.TreeView=Hg;exports.disableGlobalCursorStyles=bI;exports.resolveSx=Ia;exports.useCommandPalette=rj;exports.useConfirm=pj;exports.useFileDrop=Kg;exports.useToast=dj;
227
+ `}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21.635 24",width:"100%",height:"100%","aria-label":"Loading",role:"img",children:l.jsxs("g",{transform:"translate(-1.257)",children:[l.jsx("path",{className:"cny-loader-path cny-loader-path-1",d:"M12.1,0c.164.445.331.89.492,1.336.395,1.1.182.893,1.3,1.1a10.661,10.661,0,0,1,6.248,3.545,10.889,10.889,0,0,1,2.635,5.742,11.121,11.121,0,0,1-1.05,6.511.338.338,0,0,1-.5.2q-2.952-1.155-5.91-2.295c-.974-.376-1.947-.76-2.935-1.1a1.239,1.239,0,0,0-.776.039c-2.143.806-4.276,1.636-6.413,2.457-.779.3-1.56.59-2.336.895-.21.082-.342.07-.45-.159a11.861,11.861,0,0,1-1.136-5.711A10.322,10.322,0,0,1,3.325,6.821,10.552,10.552,0,0,1,8.058,3.065a20.428,20.428,0,0,1,2.754-.7.587.587,0,0,0,.5-.418c.226-.649.475-1.291.714-1.936ZM6.638,14.907l-.087-.079c.11-.279.224-.557.328-.838q1.362-3.7,2.721-7.4c.349-.948.7-1.893,1.052-2.841.142-.386.071-.465-.339-.4-.046.008-.093.015-.138.025A9.679,9.679,0,0,0,3.769,7.9,10.238,10.238,0,0,0,3,17.173a.353.353,0,0,0,.529.229c.5-.193,1.014-.372,1.518-.566,2.225-.856,4.446-1.722,6.676-2.564a1.115,1.115,0,0,1,.706.006c.984.351,1.954.739,2.93,1.114q2.6,1,5.191,2c.272.106.438.057.553-.224a10.579,10.579,0,0,0,.7-5.15,9.587,9.587,0,0,0-1.536-4.234,9.885,9.885,0,0,0-6.433-4.434c-.4-.087-.492.014-.355.4.368,1.027.75,2.049,1.128,3.073l2.272,6.144c.238.645.474,1.29.733,1.995-.154-.045-.241-.064-.323-.1-1.632-.629-3.262-1.266-4.9-1.883a.949.949,0,0,0-.6-.03c-.973.348-1.932.731-2.9,1.1C8.146,14.339,7.392,14.622,6.638,14.907Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-2",d:"M20.8,19.615a.488.488,0,0,1-.668.472c-2.54-.979-5.081-1.953-7.617-2.941a1.3,1.3,0,0,0-1.016.02q-3.751,1.468-7.516,2.9a.6.6,0,0,1-.5-.082c-.266-.217-.214-.414.108-.538,2.737-1.054,5.474-2.11,8.218-3.147a.99.99,0,0,1,.637.044c1.494.561,2.979,1.144,4.468,1.718,1.193.459,2.389.912,3.582,1.373A1.853,1.853,0,0,1,20.8,19.615Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-3",d:"M19.535,21.173c-.368.517-.49.556-1,.357-1.969-.764-3.952-1.5-5.9-2.306a2.146,2.146,0,0,0-1.741.243c-1.8.675-3.589,1.391-5.383,2.087-.418.162-.556.106-.924-.359.239-.109.461-.225.693-.315,2.145-.83,4.288-1.664,6.441-2.473a1.151,1.151,0,0,1,.742.014c2.252.847,4.5,1.718,6.739,2.585C19.311,21.051,19.419,21.115,19.535,21.173Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-4",d:"M6.313,22.58a2.5,2.5,0,0,1,.265-.145c1.686-.65,3.375-1.293,5.058-1.949a1.127,1.127,0,0,1,.881,0c1.649.649,3.3,1.282,4.956,1.923a2.96,2.96,0,0,1,.274.14.807.807,0,0,1-1.033.324c-1.184-.45-2.365-.909-3.548-1.363a5.8,5.8,0,0,0-.826-.3,1.219,1.219,0,0,0-.646.028c-1.407.522-2.812,1.053-4.2,1.613A1.082,1.082,0,0,1,6.313,22.58Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-5",d:"M8.657,23.713c.369-.141.659-.254.949-.364.745-.283,1.489-.57,2.238-.843a.633.633,0,0,1,.4-.027c1.012.375,2.017.767,3.024,1.157.03.011.052.043.126.106a1.809,1.809,0,0,1-1.424.168c-.51-.208-1.012-.442-1.535-.612a1.356,1.356,0,0,0-.742,0,6.489,6.489,0,0,0-1.177.461A2.017,2.017,0,0,1,8.657,23.713Z"})]})})]})});exports.Accordion=Fk;exports.AccordionContent=Gk;exports.AccordionItem=Vk;exports.AccordionTrigger=Bk;exports.Alert=sP;exports.AreaChart=II;exports.AspectRatio=DP;exports.Autocomplete=ok;exports.Avatar=iP;exports.AvatarStack=aP;exports.BREAKPOINTS=Yd;exports.Badge=cI;exports.BarChart=AI;exports.Box=Dn;exports.Breadcrumb=sk;exports.Button=jr;exports.ButtonGroup=cC;exports.CHART_COLORS=Ea;exports.CannyLoader=cN;exports.Card=nP;exports.Center=IP;exports.Checkbox=Ca;exports.Chip=aI;exports.CommandPalette=cj;exports.CommandPaletteTrigger=lj;exports.ConfirmDialog=Qm;exports.Container=EP;exports.ContextMenu=CD;exports.ContextMenuCheckboxItem=TD;exports.ContextMenuContent=PD;exports.ContextMenuItem=RD;exports.ContextMenuLabel=jD;exports.ContextMenuRadioGroup=MD;exports.ContextMenuRadioItem=ED;exports.ContextMenuSeparator=AD;exports.ContextMenuSub=DD;exports.ContextMenuSubContent=kD;exports.ContextMenuSubTrigger=ID;exports.ContextMenuTrigger=SD;exports.CspNonceProvider=nv;exports.DataTable=EI;exports.DatePicker=ij;exports.Dialog=Zm;exports.DialogClose=yj;exports.DialogTrigger=gj;exports.Divider=jP;exports.Drawer=xj;exports.DrawerClose=wj;exports.DrawerTrigger=bj;exports.FAB=lC;exports.Field=OP;exports.FileUploader=wI;exports.Grid=MP;exports.Group=kP;exports.IconButton=uC;exports.Input=tP;exports.LineChart=DI;exports.List=_I;exports.ListItem=OI;exports.ListSeparator=LI;exports.ListSubheader=$I;exports.Menu=IA;exports.MenuCheckboxItem=OA;exports.MenuContent=NA;exports.MenuItem=_A;exports.MenuLabel=FA;exports.MenuRadioGroup=LA;exports.MenuRadioItem=$A;exports.MenuSeparator=VA;exports.MenuSub=BA;exports.MenuSubContent=zA;exports.MenuSubTrigger=GA;exports.MenuTrigger=kA;exports.MultiSelect=lE;exports.Navbar=fP;exports.NavbarActions=gP;exports.NavbarBrand=hP;exports.NavbarItem=mP;exports.NavbarNav=pP;exports.Pagination=Qg;exports.Panel=Ma;exports.PanelGroup=SI;exports.PanelResizeHandle=Zg;exports.PieChart=kI;exports.Popover=nI;exports.PopoverAnchor=oI;exports.PopoverClose=sI;exports.PopoverContent=iI;exports.PopoverTrigger=rI;exports.Progress=cP;exports.ProgressRing=lP;exports.Radio=$E;exports.RadioGroup=LE;exports.ResponsiveContainer=NI;exports.RichTreeView=vI;exports.Row=TP;exports.Scroll=jp;exports.ScrollRegion=dP;exports.Select=K1;exports.SelectGroup=X1;exports.SelectItem=Y1;exports.SelectLabel=q1;exports.SelectSeparator=Z1;exports.Sidebar=yP;exports.SidebarFooter=xP;exports.SidebarHeader=vP;exports.SidebarItem=CP;exports.SidebarSection=wP;exports.SidebarToggle=bP;exports.Skeleton=ia;exports.Slider=iN;exports.Spacer=AP;exports.Stack=RP;exports.Stepper=aN;exports.Switch=KE;exports.Tabs=JI;exports.TabsContent=nk;exports.TabsList=ek;exports.TabsTrigger=tk;exports.Text=_P;exports.Textarea=LP;exports.Timeline=lI;exports.TimelineConnector=hI;exports.TimelineContent=pI;exports.TimelineDot=fI;exports.TimelineItem=uI;exports.TimelineOppositeContent=mI;exports.TimelineSeparator=dI;exports.ToastProvider=hj;exports.ToggleButton=DC;exports.ToggleButtonGroup=dS;exports.ToggleButtonGroupItem=fS;exports.Tooltip=QD;exports.TooltipContent=tI;exports.TooltipProvider=ZD;exports.TooltipRoot=JD;exports.TooltipTrigger=eI;exports.TreeItem=Xg;exports.TreeView=Yg;exports.disableGlobalCursorStyles=PI;exports.resolveSx=Na;exports.useCommandPalette=aj;exports.useConfirm=vj;exports.useCspNonce=Ia;exports.useFileDrop=qg;exports.useToast=mj;
228
228
  //# sourceMappingURL=index.cjs.map