canny-ui-react 6.1.0 → 6.1.1

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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),w=require("react"),Ao=require("react-dom");function Fu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=Fu(w),No=Fu(Ao);function K(...e){return e.filter(Boolean).join(" ")}const Vu={sm:640,md:768,lg:1024,xl:1280},vs=["base","sm","md","lg","xl"],Hy=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),Ky=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Yy=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^ms-/,"-ms-"),Xy=e=>e.replace(/[<>]/g,""),qy=(e,t)=>typeof t=="number"&&t!==0&&!Hy.has(e)?`${t}px`:Xy(String(t)),Dc=e=>Object.entries(e).filter(([,t])=>t!==void 0).map(([t,n])=>`${Yy(t)}:${qy(t,n)};`).join(""),Zy=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return(t>>>0).toString(36)};function qi(e){const t={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[a,c]of Object.entries(e))if(Ky(c)){r=!0;for(const u of vs){const d=c[u];d!==void 0&&(n[u][a]=d)}}else t[a]=c;if(!r)return{style:t};Object.assign(n.base,t);const o=[];for(const a of vs){const c=Dc(n[a]);c&&o.push(`${a}{${c}}`)}const s=`cny-sx-${Zy(o.join(""))}`;let i="";for(const a of vs){const c=Dc(n[a]);c&&(i+=a==="base"?`.${s}{${c}}`:`@media (min-width:${Vu[a]}px){.${s}{${c}}}`)}return{className:s,css:i}}function re(e,t,...n){const r=e?qi(e):void 0;return{className:K(...n,r==null?void 0:r.className),style:r!=null&&r.style||t?{...r==null?void 0:r.style,...t}:void 0,styleTag:r!=null&&r.css?l.jsx("style",{dangerouslySetInnerHTML:{__html:r.css}}):null}}const Zi=w.createContext({});function Qi(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qy=typeof window<"u",$u=Qy?w.useLayoutEffect:w.useEffect,jo=w.createContext(null);function Ji(e,t){e.indexOf(t)===-1&&e.push(t)}function ao(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const dt=(e,t,n)=>n>t?t:n<e?e:n;function ei(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Nn=()=>{},pt=()=>{};var Lu;typeof process<"u"&&((Lu=process.env)==null?void 0:Lu.NODE_ENV)!=="production"&&(Nn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ei(t,n))},pt=(e,t,n)=>{if(!e)throw new Error(ei(t,n))});const Pt={},Bu=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Wu(e){return typeof e=="object"&&e!==null}const Gu=e=>/^0[^.\s]+$/u.test(e);function Uu(e){let t;return()=>(t===void 0&&(t=e()),t)}const He=e=>e,Jy=(e,t)=>n=>t(e(n)),sr=(...e)=>e.reduce(Jy),qn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class ea{constructor(){this.subscriptions=[]}add(t){return Ji(this.subscriptions,t),()=>ao(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Fe=e=>e*1e3,ze=e=>e/1e3;function zu(e,t){return t?e*(1e3/t):0}const kc=new Set;function ta(e,t,n){e||kc.has(t)||(console.warn(ei(t,n)),kc.add(t))}const Hu=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ev=1e-7,tv=12;function nv(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Hu(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>ev&&++a<tv);return i}function ir(e,t,n,r){if(e===t&&n===r)return He;const o=s=>nv(s,0,1,e,n);return s=>s===0||s===1?s:Hu(o(s),t,r)}const Ku=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Yu=e=>t=>1-e(1-t),Xu=ir(.33,1.53,.69,.99),na=Yu(Xu),qu=Ku(na),Zu=e=>e>=1?1:(e*=2)<1?.5*na(e):.5*(2-Math.pow(2,-10*(e-1))),ra=e=>1-Math.sin(Math.acos(e)),Qu=Yu(ra),Ju=Ku(ra),rv=ir(.42,0,1,1),ov=ir(0,0,.58,1),ed=ir(.42,0,.58,1),sv=e=>Array.isArray(e)&&typeof e[0]!="number",td=e=>Array.isArray(e)&&typeof e[0]=="number",Ic={linear:He,easeIn:rv,easeInOut:ed,easeOut:ov,circIn:ra,circInOut:Ju,circOut:Qu,backIn:na,backInOut:qu,backOut:Xu,anticipate:Zu},iv=e=>typeof e=="string",Oc=e=>{if(td(e)){pt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return ir(t,n,r,o)}else if(iv(e))return pt(Ic[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ic[e];return e},jr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function av(e,t){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),e()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const v=h&&o?n:r;return f&&i.add(d),v.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 cv=40;function nd(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=jr.reduce((C,S)=>(C[S]=av(s),C),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:p,postRender:v}=i,g=()=>{const C=Pt.useManualTiming,S=C?o.timestamp:performance.now();n=!1,C||(o.delta=r?1e3/60:Math.max(Math.min(S-o.timestamp,cv),1)),o.timestamp=S,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),p.process(o),v.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(g))},y=()=>{n=!0,r=!0,o.isProcessing||e(g)};return{schedule:jr.reduce((C,S)=>{const T=i[S];return C[S]=(E,R=!1,P=!1)=>(n||y(),T.schedule(E,R,P)),C},{}),cancel:C=>{for(let S=0;S<jr.length;S++)i[jr[S]].cancel(C)},state:o,steps:i}}const{schedule:ue,cancel:Et,state:Pe,steps:xs}=nd(typeof requestAnimationFrame<"u"?requestAnimationFrame:He,!0);let Yr;function lv(){Yr=void 0}const Oe={now:()=>(Yr===void 0&&Oe.set(Pe.isProcessing||Pt.useManualTiming?Pe.timestamp:performance.now()),Yr),set:e=>{Yr=e,queueMicrotask(lv)}},rd=e=>t=>typeof t=="string"&&t.startsWith(e),od=rd("--"),uv=rd("var(--"),oa=e=>uv(e)?dv.test(e.split("/*")[0].trim()):!1,dv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _c(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const jn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Zn={...jn,transform:e=>dt(0,1,e)},Dr={...jn,default:1},Kn=e=>Math.round(e*1e5)/1e5,sa=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function fv(e){return e==null}const hv=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ia=(e,t)=>n=>!!(typeof n=="string"&&hv.test(n)&&n.startsWith(e)||t&&!fv(n)&&Object.prototype.hasOwnProperty.call(n,t)),sd=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(sa);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},pv=e=>dt(0,255,e),bs={...jn,transform:e=>Math.round(pv(e))},Yt={test:ia("rgb","red"),parse:sd("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+bs.transform(e)+", "+bs.transform(t)+", "+bs.transform(n)+", "+Kn(Zn.transform(r))+")"};function mv(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ti={test:ia("#"),parse:mv,transform:Yt.transform},ar=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wt=ar("deg"),lt=ar("%"),ne=ar("px"),gv=ar("vh"),yv=ar("vw"),Lc={...lt,parse:e=>lt.parse(e)/100,transform:e=>lt.transform(e*100)},xn={test:ia("hsl","hue"),parse:sd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lt.transform(Kn(t))+", "+lt.transform(Kn(n))+", "+Kn(Zn.transform(r))+")"},ye={test:e=>Yt.test(e)||ti.test(e)||xn.test(e),parse:e=>Yt.test(e)?Yt.parse(e):xn.test(e)?xn.parse(e):ti.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Yt.transform(e):xn.transform(e),getAnimatableNone:e=>{const t=ye.parse(e);return t.alpha=0,ye.transform(t)}},vv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xv(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sa))==null?void 0:t.length)||0)+(((n=e.match(vv))==null?void 0:n.length)||0)>0}const id="number",ad="color",bv="var",wv="var(",Fc="${}",Cv=/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 Rn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Cv,c=>(ye.test(c)?(r.color.push(s),o.push(ad),n.push(ye.parse(c))):c.startsWith(wv)?(r.var.push(s),o.push(bv),n.push(c)):(r.number.push(s),o.push(id),n.push(parseFloat(c))),++s,Fc)).split(Fc);return{values:n,split:a,indexes:r,types:o}}function Sv(e){return Rn(e).values}function cd({split:e,types:t}){const n=e.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],r[s]!==void 0){const i=t[s];i===id?o+=Kn(r[s]):i===ad?o+=ye.transform(r[s]):o+=r[s]}return o}}function Tv(e){return cd(Rn(e))}const Rv=e=>typeof e=="number"?0:ye.test(e)?ye.getAnimatableNone(e):e,Pv=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Rv(e);function Ev(e){const t=Rn(e);return cd(t)(t.values.map((r,o)=>Pv(r,t.split[o])))}const Ze={test:xv,parse:Sv,createTransformer:Tv,getAnimatableNone:Ev};function ws(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Mv({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;o=ws(c,a,e+1/3),s=ws(c,a,e),i=ws(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function co(e,t){return n=>n>0?t:e}const de=(e,t,n)=>e+(t-e)*n,Cs=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Av=[ti,Yt,xn],Nv=e=>Av.find(t=>t.test(e));function Vc(e){const t=Nv(e);if(Nn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===xn&&(n=Mv(n)),n}const $c=(e,t)=>{const n=Vc(e),r=Vc(t);if(!n||!r)return co(e,t);const o={...n};return s=>(o.red=Cs(n.red,r.red,s),o.green=Cs(n.green,r.green,s),o.blue=Cs(n.blue,r.blue,s),o.alpha=de(n.alpha,r.alpha,s),Yt.transform(o))},ni=new Set(["none","hidden"]);function jv(e,t){return ni.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Dv(e,t){return n=>de(e,t,n)}function aa(e){return typeof e=="number"?Dv:typeof e=="string"?oa(e)?co:ye.test(e)?$c:Ov:Array.isArray(e)?ld:typeof e=="object"?ye.test(e)?$c:kv:co}function ld(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>aa(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function kv(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=aa(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Iv(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const Ov=(e,t)=>{const n=Ze.createTransformer(t),r=Rn(e),o=Rn(t);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?ni.has(e)&&!o.values.length||ni.has(t)&&!r.values.length?jv(e,t):sr(ld(Iv(r,o),o.values),n):(Nn(!0,`Complex values '${e}' and '${t}' 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"),co(e,t))};function ud(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?de(e,t,n):aa(e)(e,t)}const _v=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ue.update(t,n),stop:()=>Et(t),now:()=>Pe.isProcessing?Pe.timestamp:Oe.now()}},dd=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},lo=2e4;function ca(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<lo;)t+=n,r=e.next(t);return t>=lo?1/0:t}function Lv(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(ca(r),lo);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:ze(o)}}const pe={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 ri(e,t){return e*Math.sqrt(1-t*t)}const Fv=12;function Vv(e,t,n){let r=n;for(let o=1;o<Fv;o++)r=r-e(r)/t(r);return r}const Ss=.001;function $v({duration:e=pe.duration,bounce:t=pe.bounce,velocity:n=pe.velocity,mass:r=pe.mass}){let o,s;Nn(e<=Fe(pe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=dt(pe.minDamping,pe.maxDamping,i),e=dt(pe.minDuration,pe.maxDuration,ze(e)),i<1?(o=u=>{const d=u*i,f=d*e,h=d-n,p=ri(u,i),v=Math.exp(-f);return Ss-h/p*v},s=u=>{const f=u*i*e,h=f*n+n,p=Math.pow(i,2)*Math.pow(u,2)*e,v=Math.exp(-f),g=ri(Math.pow(u,2),i);return(-o(u)+Ss>0?-1:1)*((h-p)*v)/g}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Ss+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,c=Vv(o,s,a);if(e=Fe(e),isNaN(c))return{stiffness:pe.stiffness,damping:pe.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:e}}}const Bv=["duration","bounce"],Wv=["stiffness","damping","mass"];function Bc(e,t){return t.some(n=>e[n]!==void 0)}function Gv(e){let t={velocity:pe.velocity,stiffness:pe.stiffness,damping:pe.damping,mass:pe.mass,isResolvedFromDuration:!1,...e};if(!Bc(e,Wv)&&Bc(e,Bv))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*dt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:pe.mass,stiffness:o,damping:s}}else{const n=$v({...e,velocity:0});t={...t,...n,mass:pe.mass},t.isResolvedFromDuration=!0}return t}function uo(e=pe.visualDuration,t=pe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;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:p}=Gv({...n,velocity:-ze(n.velocity||0)}),v=h||0,g=u/(2*Math.sqrt(c*d)),y=i-s,x=ze(Math.sqrt(c/d)),b=Math.abs(y)<5;r||(r=b?pe.restSpeed.granular:pe.restSpeed.default),o||(o=b?pe.restDelta.granular:pe.restDelta.default);let C,S,T,E,R,P;if(g<1)T=ri(x,g),E=(v+g*x*y)/T,C=A=>{const j=Math.exp(-g*x*A);return i-j*(E*Math.sin(T*A)+y*Math.cos(T*A))},R=g*x*E+y*T,P=g*x*y-E*T,S=A=>Math.exp(-g*x*A)*(R*Math.sin(T*A)+P*Math.cos(T*A));else if(g===1){C=j=>i-Math.exp(-x*j)*(y+(v+x*y)*j);const A=v+x*y;S=j=>Math.exp(-x*j)*(x*A*j-v)}else{const A=x*Math.sqrt(g*g-1);C=H=>{const J=Math.exp(-g*x*H),O=Math.min(A*H,300);return i-J*((v+g*x*y)*Math.sinh(O)+A*y*Math.cosh(O))/A};const j=(v+g*x*y)/A,F=g*x*j-y*A,G=g*x*y-j*A;S=H=>{const J=Math.exp(-g*x*H),O=Math.min(A*H,300);return J*(F*Math.sinh(O)+G*Math.cosh(O))}}const M={calculatedDuration:p&&f||null,velocity:A=>Fe(S(A)),next:A=>{if(!p&&g<1){const F=Math.exp(-g*x*A),G=Math.sin(T*A),H=Math.cos(T*A),J=i-F*(E*G+y*H),O=Fe(F*(R*G+P*H));return a.done=Math.abs(O)<=r&&Math.abs(i-J)<=o,a.value=a.done?i:J,a}const j=C(A);if(p)a.done=A>=f;else{const F=Fe(S(A));a.done=Math.abs(F)<=r&&Math.abs(i-j)<=o}return a.value=a.done?i:j,a},toString:()=>{const A=Math.min(ca(M),lo),j=dd(F=>M.next(A*F).value,A,30);return A+"ms "+j},toTransition:()=>{}};return M}uo.applyToOptions=e=>{const t=Lv(e,100,uo);return e.ease=t.ease,e.duration=Fe(t.duration),e.type="keyframes",e};const Uv=5;function fd(e,t,n){const r=Math.max(t-Uv,0);return zu(n-e(r),t-r)}function oi({keyframes:e,velocity:t=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=e[0],h={done:!1,value:f},p=P=>a!==void 0&&P<a||c!==void 0&&P>c,v=P=>a===void 0?c:c===void 0||Math.abs(a-P)<Math.abs(c-P)?a:c;let g=n*t;const y=f+g,x=i===void 0?y:i(y);x!==y&&(g=x-f);const b=P=>-g*Math.exp(-P/r),C=P=>x+b(P),S=P=>{const M=b(P),A=C(P);h.done=Math.abs(M)<=u,h.value=h.done?x:A};let T,E;const R=P=>{p(h.value)&&(T=P,E=uo({keyframes:[h.value,v(h.value)],velocity:fd(C,P,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return R(0),{calculatedDuration:null,next:P=>{let M=!1;return!E&&T===void 0&&(M=!0,S(P),R(P)),T!==void 0&&P>=T?E.next(P-T):(!M&&S(P),h)}}}function zv(e,t,n){const r=[],o=n||Pt.mix||ud,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||He:t;a=sr(c,a)}r.push(a)}return r}function Hv(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(pt(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=zv(t,r,o),c=a.length,u=d=>{if(i&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=qn(e[f],e[f+1],d);return a[f](h)};return n?d=>u(dt(e[0],e[s-1],d)):u}function Kv(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=qn(0,t,r);e.push(de(n,1,o))}}function Yv(e){const t=[0];return Kv(t,e.length-1),t}function Xv(e,t){return e.map(n=>n*t)}function qv(e,t){return e.map(()=>t||ed).splice(0,e.length-1)}function bn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=sv(r)?r.map(Oc):Oc(r),s={done:!1,value:t[0]},i=Xv(n&&n.length===t.length?n:Yv(t),e),a=Hv(i,t,{ease:Array.isArray(o)?o:qv(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const Zv=e=>e!==null;function Do(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(Zv),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Qv={decay:oi,inertia:oi,tween:bn,keyframes:bn,spring:uo};function hd(e){typeof e.type=="string"&&(e.type=Qv[e.type])}class la{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Jv=e=>e/100;class fo extends la{constructor(t){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!==Oe.now()&&this.tick(Oe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;hd(t);const{type:n=bn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||bn;process.env.NODE_ENV!=="production"&&c!==bn&&pt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==bn&&typeof a[0]!="number"&&(this.mixKeyframes=sr(Jv,ud(a[0],a[1])),a=[0,100]);const u=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=ca(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,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:p,type:v,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let C=this.currentTime,S=r;if(f){const P=Math.min(this.currentTime,o)/a;let M=Math.floor(P),A=P%1;!A&&P>=1&&(A=1),A===1&&M--,M=Math.min(M,f+1),!!(M%2)&&(h==="reverse"?(A=1-A,p&&(A-=p/a)):h==="mirror"&&(S=i)),C=dt(0,1,A)*a}let T;b?(this.delayState.value=d[0],T=this.delayState):T=S.next(C),s&&!b&&(T.value=s(T.value));let{done:E}=T;!b&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return R&&v!==oi&&(T.value=Do(d,this.options,y,this.speed)),g&&g(T.value),R&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return ze(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ze(t)}get time(){return ze(this.currentTime)}set time(t){t=Fe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return fd(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Oe.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=ze(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=_v,startTime:n}=this.options;this.driver||(this.driver=t(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(Oe.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function ex(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Xt=e=>e*180/Math.PI,si=e=>{const t=Xt(Math.atan2(e[1],e[0]));return ii(t)},tx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:si,rotateZ:si,skewX:e=>Xt(Math.atan(e[1])),skewY:e=>Xt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ii=e=>(e=e%360,e<0&&(e+=360),e),Wc=si,Gc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Uc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),nx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gc,scaleY:Uc,scale:e=>(Gc(e)+Uc(e))/2,rotateX:e=>ii(Xt(Math.atan2(e[6],e[5]))),rotateY:e=>ii(Xt(Math.atan2(-e[2],e[0]))),rotateZ:Wc,rotate:Wc,skewX:e=>Xt(Math.atan(e[4])),skewY:e=>Xt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ai(e){return e.includes("scale")?1:0}function ci(e,t){if(!e||e==="none")return ai(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=nx,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=tx,o=a}if(!o)return ai(t);const s=r[t],i=o[1].split(",").map(ox);return typeof s=="function"?s(i):i[s]}const rx=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ci(n,t)};function ox(e){return parseFloat(e.trim())}const Dn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],kn=new Set(Dn),zc=e=>e===jn||e===ne,sx=new Set(["x","y","z"]),ix=Dn.filter(e=>!sx.has(e));function ax(e){const t=[];return ix.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Tt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ci(t,"x"),y:(e,{transform:t})=>ci(t,"y")};Tt.translateX=Tt.x;Tt.translateY=Tt.y;const qt=new Set;let li=!1,ui=!1,di=!1;function pd(){if(ui){const e=Array.from(qt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=ax(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ui=!1,li=!1,qt.forEach(e=>e.complete(di)),qt.clear()}function md(){qt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ui=!0)})}function cx(){di=!0,md(),pd(),di=!1}class ua{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(qt.add(this),li||(li=!0,ue.read(md),ue.resolveKeyframes(pd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}ex(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),qt.delete(this)}cancel(){this.state==="scheduled"&&(qt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const lx=e=>e.startsWith("--");function gd(e,t,n){lx(t)?e.style.setProperty(t,n):e.style[t]=n}const ux={};function yd(e,t){const n=Uu(e);return()=>ux[t]??n()}const dx=yd(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),vd=yd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Un=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Hc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Un([0,.65,.55,1]),circOut:Un([.55,0,1,.45]),backIn:Un([.31,.01,.66,-.59]),backOut:Un([.33,1.53,.69,.99])};function xd(e,t){if(e)return typeof e=="function"?vd()?dd(e,t):"ease-out":td(e)?Un(e):Array.isArray(e)?e.map(n=>xd(n,t)||Hc.easeOut):Hc[e]}function fx(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=xd(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),e.animate(d,h)}function bd(e){return typeof e=="function"&&"applyToOptions"in e}function hx({type:e,...t}){return bd(e)&&vd()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class wd extends la{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,pt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=hx(t);this.animation=fx(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Do(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),gd(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 t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ze(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ze(t)}get time(){return ze(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Fe(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&dx()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),He):o(this)}}const Cd={anticipate:Zu,backInOut:qu,circInOut:Ju};function px(e){return e in Cd}function mx(e){typeof e.ease=="string"&&px(e.ease)&&(e.ease=Cd[e.ease])}const Ts=10;class gx extends wd{constructor(t){mx(t),hd(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new fo({...i,autoplay:!1}),c=Math.max(Ts,Oe.now()-this.startTime),u=dt(0,Ts,c-Ts),d=a.sample(c).value,{name:f}=this.options;s&&f&&gd(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const Kc=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ze.test(e)||e==="0")&&!e.startsWith("url("));function yx(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function vx(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Kc(o,t),a=Kc(s,t);return Nn(i===a,`You are trying to animate ${t} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:yx(e)||(n==="spring"||bd(n))&&r}function fi(e){e.duration=0,e.type="keyframes"}const Sd=new Set(["opacity","clipPath","filter","transform"]),xx=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function bx(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&xx.test(e[t]))return!0;return!1}const wx=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Cx=Uu(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Sx(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return Cx()&&n&&(Sd.has(n)||wx.has(n)&&bx(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const Tx=40;class Rx extends la{constructor({autoplay:t=!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 v;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=Oe.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||ua;this.keyframeResolver=new p(a,(g,y,x)=>this.onKeyframesResolved(g,y,h,!x),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,o){var x,b;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Oe.now();let f=!0;vx(t,s,i,a)||(f=!1,(Pt.instantAnimations||!c)&&(d==null||d(Do(t,r,n))),t[0]=t[t.length-1],fi(r),r.repeat=0);const p={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Tx?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},v=f&&!u&&Sx(p),g=(b=(x=p.motionValue)==null?void 0:x.owner)==null?void 0:b.current;let y;if(v)try{y=new gx({...p,element:g})}catch{y=new fo(p)}else y=new fo(p);y.finished.then(()=>{this.notifyFinished()}).catch(He),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),cx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Td(e,t,n,r=0,o=1){const s=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const Px=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ex(e){const t=Px.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const Mx=4;function Rd(e,t,n=1){pt(n<=Mx,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Ex(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Bu(i)?parseFloat(i):i}return oa(o)?Rd(o,t,n+1):o}const Ax={type:"spring",stiffness:500,damping:25,restSpeed:10},Nx=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),jx={type:"keyframes",duration:.8},Dx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kx=(e,{keyframes:t})=>t.length>2?jx:kn.has(e)?e.startsWith("scale")?Nx(t[1]):Ax:Dx;function Pd(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function da(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Pd(n,e):n}const Ix=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ox(e){for(const t in e)if(!Ix.has(t))return!0;return!1}const fa=(e,t,n,r={},o,s)=>i=>{const a=da(r,e)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Fe(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Ox(a)||Object.assign(d,kx(e,d)),d.duration&&(d.duration=Fe(d.duration)),d.repeatDelay&&(d.repeatDelay=Fe(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(fi(d),d.delay===0&&(f=!0)),(Pt.instantAnimations||Pt.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,fi(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const h=Do(d.keyframes,a);if(h!==void 0){ue.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new fo(d):new Rx(d)};function Yc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ha(e,t,n,r){if(typeof t=="function"){const[o,s]=Yc(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Yc(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Zt(e,t,n){const r=e.getProps();return ha(r,t,n!==void 0?n:r.custom,e)}const Ed=new Set(["width","height","top","left","right","bottom",...Dn]),Xc=30,_x=e=>!isNaN(parseFloat(e));class Lx{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Oe.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(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Oe.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=_x(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&ta(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ea);const r=this.events[t].add(n);return t==="change"?()=>{r(),ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Oe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Xc)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xc);return zu(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pn(e,t){return new Lx(e,t)}const hi=e=>Array.isArray(e);function Fx(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pn(n))}function Vx(e){return hi(e)?e[e.length-1]||0:e}function $x(e,t){const n=Zt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=Vx(s[i]);Fx(e,i,a)}}const Ee=e=>!!(e&&e.getVelocity);function Bx(e){return!!(Ee(e)&&e.add)}function pi(e,t){const n=e.getValue("willChange");if(Bx(n))return n.add(t);if(!n&&Pt.WillChange){const r=new Pt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function pa(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Wx="framerAppearId",Md="data-"+pa(Wx);function Ad(e){return e.props[Md]}function Gx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Nd(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=t;const c=e.getDefaultTransition();s=s?Pd(s,c):c;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&e.animationState&&e.animationState.getState()[o];for(const h in a){const p=e.getValue(h,e.latestValues[h]??null),v=a[h];if(v===void 0||f&&Gx(f,h))continue;const g={delay:n,...da(s||{},h)},y=p.get();if(y!==void 0&&!p.isAnimating()&&!Array.isArray(v)&&v===y&&!g.velocity){ue.update(()=>p.set(v));continue}let x=!1;if(window.MotionHandoffAnimation){const S=Ad(e);if(S){const T=window.MotionHandoffAnimation(S,h,ue);T!==null&&(g.startTime=T,x=!0)}}pi(e,h);const b=u??e.shouldReduceMotion;p.start(fa(h,p,v,b&&Ed.has(h)?{type:!1}:g,e,x));const C=p.animation;C&&d.push(C)}if(i){const h=()=>ue.update(()=>{i&&$x(e,i)});d.length?Promise.all(d).then(h):h()}return d}function mi(e,t,n={}){var c;const r=Zt(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Nd(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return Ux(e,t,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 Ux(e,t,n=0,r=0,o=0,s=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(mi(c,t,{...i,delay:n+(typeof r=="function"?0:r)+Td(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function zx(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>mi(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=mi(e,t,n);else{const o=typeof t=="function"?Zt(e,t,n.custom):t;r=Promise.all(Nd(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Hx={test:e=>e==="auto",parse:e=>e},jd=e=>t=>t.test(e),Dd=[jn,ne,lt,wt,yv,gv,Hx],qc=e=>Dd.find(jd(e));function Kx(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Gu(e):!0}const Yx=new Set(["brightness","contrast","saturate","opacity"]);function Xx(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(sa)||[];if(!r)return e;const o=n.replace(r,"");let s=Yx.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const qx=/\b([a-z-]*)\(.*?\)/gu,gi={...Ze,getAnimatableNone:e=>{const t=e.match(qx);return t?t.map(Xx).join(" "):e}},yi={...Ze,getAnimatableNone:e=>{const t=Ze.parse(e);return Ze.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Zc={...jn,transform:Math.round},Zx={rotate:wt,rotateX:wt,rotateY:wt,rotateZ:wt,scale:Dr,scaleX:Dr,scaleY:Dr,scaleZ:Dr,skew:wt,skewX:wt,skewY:wt,distance:ne,translateX:ne,translateY:ne,translateZ:ne,x:ne,y:ne,z:ne,perspective:ne,transformPerspective:ne,opacity:Zn,originX:Lc,originY:Lc,originZ:ne},ma={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,...Zx,zIndex:Zc,fillOpacity:Zn,strokeOpacity:Zn,numOctaves:Zc},Qx={...ma,color:ye,backgroundColor:ye,outlineColor:ye,fill:ye,stroke:ye,borderColor:ye,borderTopColor:ye,borderRightColor:ye,borderBottomColor:ye,borderLeftColor:ye,filter:gi,WebkitFilter:gi,mask:yi,WebkitMask:yi},kd=e=>Qx[e],Jx=new Set([gi,yi]);function Id(e,t){let n=kd(e);return Jx.has(n)||(n=Ze),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const eb=new Set(["auto","none","0"]);function tb(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!eb.has(s)&&Rn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Id(n,o)}class nb extends ua{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),oa(f))){const h=Rd(f,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Ed.has(r)||t.length!==2)return;const[o,s]=t,i=qc(o),a=qc(s),c=_c(o),u=_c(s);if(c!==u&&Tt[r]){this.needsMeasurement=!0;return}if(i!==a)if(zc(i)&&zc(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else Tt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||Kx(t[o]))&&r.push(o);r.length&&tb(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Tt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=Tt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Od(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const _d=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Xr(e){return Wu(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:ga}=nd(queueMicrotask,!1),Xe={x:!1,y:!1};function Ld(){return Xe.x||Xe.y}function rb(e){return e==="x"||e==="y"?Xe[e]?null:(Xe[e]=!0,()=>{Xe[e]=!1}):Xe.x||Xe.y?null:(Xe.x=Xe.y=!0,()=>{Xe.x=Xe.y=!1})}function Fd(e,t){const n=Od(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function ob(e){return!(e.pointerType==="touch"||Ld())}function sb(e,t,n={}){const[r,o,s]=Fd(e,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",v)},f=y=>{u&&(u(y),u=void 0),d()},h=y=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(y))},p=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},v=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}f(y)}},g=y=>{if(!ob(y))return;c=!1;const x=t(i,y);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",v,o))};i.addEventListener("pointerenter",g,o),i.addEventListener("pointerdown",p,o)}),s}const Vd=(e,t)=>t?e===t?!0:Vd(e,t.parentElement):!1,ya=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ib=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ab(e){return ib.has(e.tagName)||e.isContentEditable===!0}const cb=new Set(["INPUT","SELECT","TEXTAREA"]);function lb(e){return cb.has(e.tagName)||e.isContentEditable===!0}const qr=new WeakSet;function Qc(e){return t=>{t.key==="Enter"&&e(t)}}function Rs(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ub=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Qc(()=>{if(qr.has(n))return;Rs(n,"down");const o=Qc(()=>{Rs(n,"up")}),s=()=>Rs(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Jc(e){return ya(e)&&!Ld()}const el=new WeakSet;function db(e,t,n={}){const[r,o,s]=Fd(e,n),i=a=>{const c=a.currentTarget;if(!Jc(a)||el.has(a))return;qr.add(c),n.stopPropagation&&el.add(a);const u=t(c,a),d=(p,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),qr.has(c)&&qr.delete(c),Jc(p)&&typeof u=="function"&&u(p,{success:v})},f=p=>{d(p,c===window||c===document||n.useGlobalTarget||Vd(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Xr(a)&&(a.addEventListener("focus",u=>ub(u,o)),!ab(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function va(e){return Wu(e)&&"ownerSVGElement"in e}const Zr=new WeakMap;let Ct;const $d=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:va(r)&&"getBBox"in r?r.getBBox()[t]:r[n],fb=$d("inline","width","offsetWidth"),hb=$d("block","height","offsetHeight");function pb({target:e,borderBoxSize:t}){var n;(n=Zr.get(e))==null||n.forEach(r=>{r(e,{get width(){return fb(e,t)},get height(){return hb(e,t)}})})}function mb(e){e.forEach(pb)}function gb(){typeof ResizeObserver>"u"||(Ct=new ResizeObserver(mb))}function yb(e,t){Ct||gb();const n=Od(e);return n.forEach(r=>{let o=Zr.get(r);o||(o=new Set,Zr.set(r,o)),o.add(t),Ct==null||Ct.observe(r)}),()=>{n.forEach(r=>{const o=Zr.get(r);o==null||o.delete(t),o!=null&&o.size||Ct==null||Ct.unobserve(r)})}}const Qr=new Set;let wn;function vb(){wn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Qr.forEach(t=>t(e))},window.addEventListener("resize",wn)}function xb(e){return Qr.add(e),wn||vb(),()=>{Qr.delete(e),!Qr.size&&typeof wn=="function"&&(window.removeEventListener("resize",wn),wn=void 0)}}function tl(e,t){return typeof e=="function"?xb(e):yb(e,t)}function bb(e){return va(e)&&e.tagName==="svg"}const wb=[...Dd,ye,Ze],Cb=e=>wb.find(jd(e)),nl=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cn=()=>({x:nl(),y:nl()}),rl=()=>({min:0,max:0}),xe=()=>({x:rl(),y:rl()}),Sb=new WeakMap;function ko(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Qn(e){return typeof e=="string"||Array.isArray(e)}const xa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ba=["initial",...xa];function Io(e){return ko(e.animate)||ba.some(t=>Qn(e[t]))}function Bd(e){return!!(Io(e)||e.variants)}function Tb(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Ee(o))e.addValue(r,o);else if(Ee(s))e.addValue(r,Pn(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,Pn(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const vi={current:null},Wd={current:!1},Rb=typeof window<"u";function Pb(){if(Wd.current=!0,!!Rb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>vi.current=e.matches;e.addEventListener("change",t),t()}else vi.current=!1}const ol=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ho={};function Gd(e){ho=e}function Eb(){return ho}class Mb{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,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=ua,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 p=Oe.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ue.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=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=Io(n),this.isVariantNode=Bd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const v=h[p];u[p]!==void 0&&Ee(v)&&v.set(u[p])}}mount(t){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=t,Sb.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),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:(Wd.current||Pb(),this.shouldReduceMotion=vi.current),process.env.NODE_ENV!=="production"&&ta(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 t;this.projection&&this.projection.unmount(),Et(this.notifyUpdate),Et(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.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(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Sd.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new wd({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:Fe(d)}),h=i(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=kn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ho){const n=ho[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];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):xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<ol.length;r++){const o=ol[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Tb(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Bu(r)||Gu(r))?r=parseFloat(r):!Cb(r)&&Ze.test(n)&&(r=Id(t,n)),this.setBaseTarget(t,Ee(r)?r.get():r)),Ee(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ha(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Ee(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ea),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ga.render(this.render)}}class Ud extends Mb{constructor(){super(...arguments),this.KeyframeResolver=nb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ee(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class jt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function zd({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ab({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Nb(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ps(e){return e===void 0||e===1}function xi({scale:e,scaleX:t,scaleY:n}){return!Ps(e)||!Ps(t)||!Ps(n)}function Kt(e){return xi(e)||Hd(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Hd(e){return sl(e.x)||sl(e.y)}function sl(e){return e&&e!=="0%"}function po(e,t,n){const r=e-n,o=t*r;return n+o}function il(e,t,n,r,o){return o!==void 0&&(e=po(e,o,r)),po(e,n,r)+t}function bi(e,t=0,n=1,r,o){e.min=il(e.min,t,n,r,o),e.max=il(e.max,t,n,r,o)}function Kd(e,{x:t,y:n}){bi(e.x,t.translate,t.scale,t.originPoint),bi(e.y,n.translate,n.scale,n.originPoint)}const al=.999999999999,cl=1.0000000000001;function jb(e,t,n,r=!1){var a;const o=n.length;if(!o)return;t.x=t.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&&(it(e.x,-s.scroll.offset.x),it(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Kd(e,i)),r&&Kt(s.latestValues)&&Jr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<cl&&t.x>al&&(t.x=1),t.y<cl&&t.y>al&&(t.y=1)}function it(e,t){e.min+=t,e.max+=t}function ll(e,t,n,r,o=.5){const s=de(e.min,e.max,o);bi(e,t,n,s,r)}function ul(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Jr(e,t,n){const r=n??e;ll(e.x,ul(t.x,r.x),t.scaleX,t.scale,t.originX),ll(e.y,ul(t.y,r.y),t.scaleY,t.scale,t.originY)}function Yd(e,t){return zd(Nb(e.getBoundingClientRect(),t))}function Db(e,t,n){const r=Yd(e,n),{scroll:o}=t;return o&&(it(r.x,o.offset.x),it(r.y,o.offset.y)),r}const kb={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ib=Dn.length;function Ob(e,t,n){let r="",o=!0;for(let s=0;s<Ib;s++){const i=Dn[s],a=e[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=_d(a,ma[i]);if(!c){o=!1;const d=kb[i]||i;r+=`${d}(${u}) `}n&&(t[i]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function wa(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const u=t[c];if(kn.has(c)){i=!0;continue}else if(od(c)){o[c]=u;continue}else{const d=_d(u,ma[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(t.transform||(i||n?r.transform=Ob(t,e.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 Xd(e,{style:t,vars:n},r,o){const s=e.style;let i;for(i in t)s[i]=t[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function dl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ne.test(e))e=parseFloat(e);else return e;const n=dl(e,t.target.x),r=dl(e,t.target.y);return`${n}% ${r}%`}},_b={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ze.parse(e);if(o.length>5)return r;const s=Ze.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const u=de(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},wi={borderRadius:{...Wn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wn,borderTopRightRadius:Wn,borderBottomLeftRadius:Wn,borderBottomRightRadius:Wn,boxShadow:_b};function qd(e,{layout:t,layoutId:n}){return kn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!wi[e]||e==="opacity")}function Ca(e,t,n){var i;const r=e.style,o=t==null?void 0:t.style,s={};if(!r)return s;for(const a in r)(Ee(r[a])||o&&Ee(o[a])||qd(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Lb(e){return window.getComputedStyle(e)}class Fb extends Ud{constructor(){super(...arguments),this.type="html",this.renderInstance=Xd}readValueFromInstance(t,n){var r;if(kn.has(n))return(r=this.projection)!=null&&r.isProjecting?ai(n):rx(t,n);{const o=Lb(t),s=(od(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Yd(t,n)}build(t,n,r){wa(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ca(t,n,r)}}const Vb={offset:"stroke-dashoffset",array:"stroke-dasharray"},$b={offset:"strokeDashoffset",array:"strokeDasharray"};function Bb(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?Vb:$b;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const Wb=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Zd(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(wa(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;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 p of Wb)f[p]!==void 0&&(h[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Bb(f,o,s,i,!1)}const Qd=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"]),Jd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Gb(e,t,n,r){Xd(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Qd.has(o)?o:pa(o),t.attrs[o])}function ef(e,t,n){const r=Ca(e,t,n);for(const o in e)if(Ee(e[o])||Ee(t[o])){const s=Dn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}class Ub extends Ud{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(kn.has(n)){const r=kd(n);return r&&r.default||0}return n=Qd.has(n)?n:pa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ef(t,n,r)}build(t,n,r){Zd(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){Gb(t,n,r,o)}mount(t){this.isSVGTag=Jd(t.tagName),super.mount(t)}}const zb=ba.length;function tf(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?tf(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<zb;n++){const r=ba[n],o=e.props[r];(Qn(o)||o===!1)&&(t[r]=o)}return t}function nf(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Hb=[...xa].reverse(),Kb=xa.length;function Yb(e){return t=>Promise.all(t.map(({animation:n,options:r})=>zx(e,n,r)))}function Xb(e){let t=Yb(e),n=fl(),r=!0,o=!1;const s=u=>(d,f)=>{var p;const h=Zt(e,f,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:v,transitionEnd:g,...y}=h;d={...d,...y,...g}}return d};function i(u){t=u(e)}function a(u){const{props:d}=e,f=tf(e.parent)||{},h=[],p=new Set;let v={},g=1/0;for(let x=0;x<Kb;x++){const b=Hb[x],C=n[b],S=d[b]!==void 0?d[b]:f[b],T=Qn(S),E=b===u?C.isActive:null;E===!1&&(g=x);let R=S===f[b]&&S!==d[b]&&T;if(R&&(r||o)&&e.manuallyAnimateOnMount&&(R=!1),C.protectedKeys={...v},!C.isActive&&E===null||!S&&!C.prevProp||ko(S)||typeof S=="boolean")continue;if(b==="exit"&&C.isActive&&E!==!0){C.prevResolvedValues&&(v={...v,...C.prevResolvedValues});continue}const P=qb(C.prevProp,S);let M=P||b===u&&C.isActive&&!R&&T||x>g&&T,A=!1;const j=Array.isArray(S)?S:[S];let F=j.reduce(s(b),{});E===!1&&(F={});const{prevResolvedValues:G={}}=C,H={...G,...F},J=N=>{M=!0,p.has(N)&&(A=!0,p.delete(N)),C.needsAnimating[N]=!0;const I=e.getValue(N);I&&(I.liveStyle=!1)};for(const N in H){const I=F[N],V=G[N];if(v.hasOwnProperty(N))continue;let Y=!1;hi(I)&&hi(V)?Y=!nf(I,V):Y=I!==V,Y?I!=null?J(N):p.add(N):I!==void 0&&p.has(N)?J(N):C.protectedKeys[N]=!0}C.prevProp=S,C.prevResolvedValues=F,C.isActive&&(v={...v,...F}),(r||o)&&e.blockInitialAnimation&&(M=!1);const O=R&&P;M&&(!O||A)&&h.push(...j.map(N=>{const I={type:b};if(typeof N=="string"&&(r||o)&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,Y=Zt(V,N);if(V.enteringChildren&&Y){const{delayChildren:k}=Y.transition||{};I.delay=Td(V.enteringChildren,e,k)}}return{animation:N,options:I}}))}if(p.size){const x={};if(typeof d.initial!="boolean"){const b=Zt(e,Array.isArray(d.initial)?d.initial[0]:d.initial);b&&b.transition&&(x.transition=b.transition)}p.forEach(b=>{const C=e.getBaseTarget(b),S=e.getValue(b);S&&(S.liveStyle=!0),x[b]=C??null}),h.push({animation:x})}let y=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,o=!1,y?t(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var v;return(v=p.animationState)==null?void 0:v.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=fl(),o=!0}}}function qb(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nf(t,e):!1}function zt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fl(){return{animate:zt(!0),whileInView:zt(),whileHover:zt(),whileTap:zt(),whileDrag:zt(),whileFocus:zt(),exit:zt()}}function Ci(e,t){e.min=t.min,e.max=t.max}function Ye(e,t){Ci(e.x,t.x),Ci(e.y,t.y)}function hl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const rf=1e-4,Zb=1-rf,Qb=1+rf,of=.01,Jb=0-of,ew=0+of;function _e(e){return e.max-e.min}function tw(e,t,n){return Math.abs(e-t)<=n}function pl(e,t,n,r=.5){e.origin=r,e.originPoint=de(t.min,t.max,e.origin),e.scale=_e(n)/_e(t),e.translate=de(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Zb&&e.scale<=Qb||isNaN(e.scale))&&(e.scale=1),(e.translate>=Jb&&e.translate<=ew||isNaN(e.translate))&&(e.translate=0)}function Yn(e,t,n,r){pl(e.x,t.x,n.x,r?r.originX:void 0),pl(e.y,t.y,n.y,r?r.originY:void 0)}function ml(e,t,n,r=0){const o=r?de(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+_e(t)}function nw(e,t,n,r){ml(e.x,t.x,n.x,r==null?void 0:r.x),ml(e.y,t.y,n.y,r==null?void 0:r.y)}function gl(e,t,n,r=0){const o=r?de(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+_e(t)}function mo(e,t,n,r){gl(e.x,t.x,n.x,r==null?void 0:r.x),gl(e.y,t.y,n.y,r==null?void 0:r.y)}function yl(e,t,n,r,o){return e-=t,e=po(e,1/n,r),o!==void 0&&(e=po(e,1/o,r)),e}function rw(e,t=0,n=1,r=.5,o,s=e,i=e){if(lt.test(t)&&(t=parseFloat(t),t=de(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=de(s.min,s.max,r);e===s&&(a-=t),e.min=yl(e.min,t,n,a,o),e.max=yl(e.max,t,n,a,o)}function vl(e,t,[n,r,o],s,i){rw(e,t[n],t[r],t[o],t.scale,s,i)}const ow=["x","scaleX","originX"],sw=["y","scaleY","originY"];function xl(e,t,n,r){vl(e.x,t,ow,n?n.x:void 0,r?r.x:void 0),vl(e.y,t,sw,n?n.y:void 0,r?r.y:void 0)}function bl(e){return e.translate===0&&e.scale===1}function sf(e){return bl(e.x)&&bl(e.y)}function wl(e,t){return e.min===t.min&&e.max===t.max}function iw(e,t){return wl(e.x,t.x)&&wl(e.y,t.y)}function Cl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function af(e,t){return Cl(e.x,t.x)&&Cl(e.y,t.y)}function Sl(e){return _e(e.x)/_e(e.y)}function Tl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ot(e){return[e("x"),e("y")]}function aw(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const cf=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],cw=cf.length,Rl=e=>typeof e=="string"?parseFloat(e):e,Pl=e=>typeof e=="number"||ne.test(e);function lw(e,t,n,r,o,s){o?(e.opacity=de(0,n.opacity??1,uw(r)),e.opacityExit=de(t.opacity??1,0,dw(r))):s&&(e.opacity=de(t.opacity??1,n.opacity??1,r));for(let i=0;i<cw;i++){const a=cf[i];let c=El(t,a),u=El(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Pl(c)===Pl(u)?(e[a]=Math.max(de(Rl(c),Rl(u),r),0),(lt.test(u)||lt.test(c))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=de(t.rotate||0,n.rotate||0,r))}function El(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const uw=lf(0,.5,Qu),dw=lf(.5,.95,He);function lf(e,t,n){return r=>r<e?0:r>t?1:n(qn(e,t,r))}function fw(e,t,n){const r=Ee(e)?e:Pn(e);return r.start(fa("",r,t,n)),r.animation}function Jn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const hw=(e,t)=>e.depth-t.depth;class pw{constructor(){this.children=[],this.isDirty=!1}add(t){Ji(this.children,t),this.isDirty=!0}remove(t){ao(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hw),this.isDirty=!1,this.children.forEach(t)}}function mw(e,t){const n=Oe.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Et(r),e(s-t))};return ue.setup(r,!0),()=>Et(r)}function eo(e){return Ee(e)?e.get():e}class gw{constructor(){this.members=[]}add(t){Ji(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(ao(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(ao(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-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(t,n){var o;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=t.options;(s===void 0||s!==i)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,o,s,i;(r=(n=t.options).onExitComplete)==null||r.call(n),(i=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const to={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Es=["","X","Y","Z"],yw=1e3;let vw=0;function Ms(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function uf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ad(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ue,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&uf(r)}function df({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=vw++,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(ww),this.nodes.forEach(Ew),this.nodes.forEach(Mw),this.nodes.forEach(Cw)},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 pw)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new ea),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=va(i)&&!bb(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),e){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;ue.read(()=>{f=window.innerWidth}),e(i,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=mw(h,250),to.hasAnimatedSinceResize&&(to.hasAnimatedSinceResize=!1,this.nodes.forEach(Nl)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||kw,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),x=!this.targetLayout||!af(this.targetLayout,p),b=!f&&h;if(this.options.layoutRoot||this.resumeFrom||b||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...da(v,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(d,b)}else f||Nl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}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(),Et(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(Aw),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&&uf(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(Tw),this.nodes.forEach(Ml);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Al);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Rw),this.nodes.forEach(Pw),this.nodes.forEach(xw),this.nodes.forEach(bw)):this.nodes.forEach(Al),this.clearAllSnapshots();const a=Oe.now();Pe.delta=dt(0,1e3/60,a-Pe.timestamp),Pe.timestamp=a,Pe.isProcessing=!0,xs.update.process(Pe),xs.preRender.process(Pe),xs.render.process(Pe),Pe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ga.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Sw),this.sharedNodes.forEach(Nw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_e(this.snapshot.measuredBox.x)&&!_e(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=xe()),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&&!sf(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||Kt(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)),Iw(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return xe();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Ow))){const{scroll:d}=this.root;d&&(it(a.x,d.offset.x),it(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=xe();if(Ye(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&&Ye(a,i),it(a.x,f.offset.x),it(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||xe();Ye(u,i);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(it(u.x,-p.scroll.offset.x),it(u.y,-p.scroll.offset.y)),Kt(p.latestValues)&&Jr(u,p.latestValues,(d=p.layout)==null?void 0:d.layoutBox)}return Kt(this.latestValues)&&Jr(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=xe();Ye(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!Kt(d.latestValues))continue;let f;d.instance&&(xi(d.latestValues)&&d.updateSnapshot(),f=xe(),Ye(f,d.measurePageBox())),xl(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return Kt(this.latestValues)&&xl(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!==Pe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var p;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||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Pe.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=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nw(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ye(this.target,this.layout.layoutBox),Kd(this.target,this.targetDelta)):Ye(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||xi(this.parent.latestValues)||Hd(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=xe(),this.relativeTargetOrigin=xe(),mo(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Ye(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Pe.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;Ye(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;jb(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=xe());const{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(hl(this.prevProjectionDelta.x,this.projectionDelta.x),hl(this.prevProjectionDelta.y,this.projectionDelta.y)),Yn(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Tl(this.projectionDelta.x,this.prevProjectionDelta.x)||!Tl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}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=Cn(),this.projectionDelta=Cn(),this.projectionDeltaWithTransform=Cn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=Cn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=xe(),p=c?c.source:void 0,v=this.layout?this.layout.source:void 0,g=p!==v,y=this.getStack(),x=!y||y.members.length<=1,b=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(Dw));this.animationProgress=0;let C;this.mixTargetDelta=S=>{const T=S/1e3;jl(f.x,i.x,T),jl(f.y,i.y,T),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mo(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),jw(this.relativeTarget,this.relativeTargetOrigin,h,T),C&&iw(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=xe()),Ye(C,this.relativeTarget)),g&&(this.animationValues=d,lw(d,u,this.latestValues,T,b,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},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&&(Et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ue.update(()=>{to.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pn(0)),this.motionValue.jump(0,!1),this.currentAnimation=fw(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(yw),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&&ff(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||xe();const f=_e(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=_e(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Ye(a,c),Jr(a,d),Yn(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new gw),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&&Ms("z",i,u,this.animationValues);for(let d=0;d<Es.length;d++)Ms(`rotate${Es[d]}`,i,u,this.animationValues),Ms(`skew${Es[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=eo(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=eo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Kt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=aw(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:p}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${p.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 v in wi){if(d[v]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:x}=wi[v],b=f==="none"?d[v]:g(d[v],u);if(y){const C=y.length;for(let S=0;S<C;S++)i[y[S]]=b}else x?this.options.visualElement.renderState.vars[v]=b:i[v]=b}this.options.layoutId&&(i.pointerEvents=u===this?eo(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(Ml),this.root.sharedNodes.clear()}}}function xw(e){e.updateLayout()}function bw(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")ot(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],p=_e(h);h.min=r[f].min,h.max=h.min+p});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";Ci(i?t.measuredBox[f]:t.layoutBox[f],r[f])}else ff(s,t.layoutBox,r)&&ot(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],p=_e(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=Cn();Yn(a,r,t.layoutBox);const c=Cn();i?Yn(c,e.applyTransform(o,!0),t.measuredBox):Yn(c,r,t.layoutBox);const u=!sf(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const v=e.options.layoutAnchor||void 0,g=xe();mo(g,t.layoutBox,h.layoutBox,v);const y=xe();mo(y,r,p.layoutBox,v),af(g,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ww(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Cw(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Sw(e){e.clearSnapshot()}function Ml(e){e.clearMeasurements()}function Tw(e){e.isLayoutDirty=!0,e.updateLayout()}function Al(e){e.isLayoutDirty=!1}function Rw(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Pw(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Nl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ew(e){e.resolveTargetDelta()}function Mw(e){e.calcProjection()}function Aw(e){e.resetSkewAndRotation()}function Nw(e){e.removeLeadSnapshot()}function jl(e,t,n){e.translate=de(t.translate,0,n),e.scale=de(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Dl(e,t,n,r){e.min=de(t.min,n.min,r),e.max=de(t.max,n.max,r)}function jw(e,t,n,r){Dl(e.x,t.x,n.x,r),Dl(e.y,t.y,n.y,r)}function Dw(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const kw={duration:.45,ease:[.4,0,.1,1]},kl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Il=kl("applewebkit/")&&!kl("chrome/")?Math.round:He;function Ol(e){e.min=Il(e.min),e.max=Il(e.max)}function Iw(e){Ol(e.x),Ol(e.y)}function ff(e,t,n){return e==="position"||e==="preserve-aspect"&&!tw(Sl(t),Sl(n),.2)}function Ow(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const _w=df({attachResizeListener:(e,t)=>Jn(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),As={current:void 0},hf=df({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!As.current){const e=new _w({});e.mount(window),e.setOptions({layoutScroll:!0}),As.current=e}return As.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Sa=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function _l(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=_l(o,t);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():_l(e[o],null)}}}}function Fw(...e){return m.useCallback(Lw(...e),e)}class Vw extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Xr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Xr(r)&&r.offsetWidth||0,s=Xr(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 $w({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=w.useId(),a=w.useRef(null),c=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=w.useContext(Sa),d=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=Fw(a,d);return w.useInsertionEffect(()=>{const{width:p,height:v,top:g,left:y,right:x,bottom:b}=c.current;if(t||s===!1||!a.current||!p||!v)return;const C=n==="left"?`left: ${y}`:`right: ${x}`,S=r==="bottom"?`bottom: ${b}`:`top: ${g}`;a.current.dataset.motionPopId=i;const T=document.createElement("style");u&&(T.nonce=u);const E=o??document.head;return E.appendChild(T),T.sheet&&T.sheet.insertRule(`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),w=require("react"),Ao=require("react-dom");function Fu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=Fu(w),No=Fu(Ao);function Y(...e){return e.filter(Boolean).join(" ")}const $u={sm:640,md:768,lg:1024,xl:1280},vs=["base","sm","md","lg","xl"],Hy=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),Ky=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Yy=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^ms-/,"-ms-"),Xy=e=>e.replace(/[<>]/g,""),qy=(e,t)=>typeof t=="number"&&t!==0&&!Hy.has(e)?`${t}px`:Xy(String(t)),Dc=e=>Object.entries(e).filter(([,t])=>t!==void 0).map(([t,n])=>`${Yy(t)}:${qy(t,n)};`).join(""),Zy=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return(t>>>0).toString(36)};function qi(e){const t={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[a,c]of Object.entries(e))if(Ky(c)){r=!0;for(const u of vs){const d=c[u];d!==void 0&&(n[u][a]=d)}}else t[a]=c;if(!r)return{style:t};Object.assign(n.base,t);const o=[];for(const a of vs){const c=Dc(n[a]);c&&o.push(`${a}{${c}}`)}const s=`cny-sx-${Zy(o.join(""))}`;let i="";for(const a of vs){const c=Dc(n[a]);c&&(i+=a==="base"?`.${s}{${c}}`:`@media (min-width:${$u[a]}px){.${s}{${c}}}`)}return{className:s,css:i}}function re(e,t,...n){const r=e?qi(e):void 0;return{className:Y(...n,r==null?void 0:r.className),style:r!=null&&r.style||t?{...r==null?void 0:r.style,...t}:void 0,styleTag:r!=null&&r.css?l.jsx("style",{dangerouslySetInnerHTML:{__html:r.css}}):null}}const Zi=w.createContext({});function Qi(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qy=typeof window<"u",Vu=Qy?w.useLayoutEffect:w.useEffect,jo=w.createContext(null);function Ji(e,t){e.indexOf(t)===-1&&e.push(t)}function ao(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const dt=(e,t,n)=>n>t?t:n<e?e:n;function ei(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Nn=()=>{},pt=()=>{};var Lu;typeof process<"u"&&((Lu=process.env)==null?void 0:Lu.NODE_ENV)!=="production"&&(Nn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ei(t,n))},pt=(e,t,n)=>{if(!e)throw new Error(ei(t,n))});const Pt={},Bu=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Wu(e){return typeof e=="object"&&e!==null}const Gu=e=>/^0[^.\s]+$/u.test(e);function Uu(e){let t;return()=>(t===void 0&&(t=e()),t)}const He=e=>e,Jy=(e,t)=>n=>t(e(n)),sr=(...e)=>e.reduce(Jy),qn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class ea{constructor(){this.subscriptions=[]}add(t){return Ji(this.subscriptions,t),()=>ao(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Fe=e=>e*1e3,ze=e=>e/1e3;function zu(e,t){return t?e*(1e3/t):0}const kc=new Set;function ta(e,t,n){e||kc.has(t)||(console.warn(ei(t,n)),kc.add(t))}const Hu=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ev=1e-7,tv=12;function nv(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Hu(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>ev&&++a<tv);return i}function ir(e,t,n,r){if(e===t&&n===r)return He;const o=s=>nv(s,0,1,e,n);return s=>s===0||s===1?s:Hu(o(s),t,r)}const Ku=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Yu=e=>t=>1-e(1-t),Xu=ir(.33,1.53,.69,.99),na=Yu(Xu),qu=Ku(na),Zu=e=>e>=1?1:(e*=2)<1?.5*na(e):.5*(2-Math.pow(2,-10*(e-1))),ra=e=>1-Math.sin(Math.acos(e)),Qu=Yu(ra),Ju=Ku(ra),rv=ir(.42,0,1,1),ov=ir(0,0,.58,1),ed=ir(.42,0,.58,1),sv=e=>Array.isArray(e)&&typeof e[0]!="number",td=e=>Array.isArray(e)&&typeof e[0]=="number",Ic={linear:He,easeIn:rv,easeInOut:ed,easeOut:ov,circIn:ra,circInOut:Ju,circOut:Qu,backIn:na,backInOut:qu,backOut:Xu,anticipate:Zu},iv=e=>typeof e=="string",Oc=e=>{if(td(e)){pt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return ir(t,n,r,o)}else if(iv(e))return pt(Ic[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ic[e];return e},jr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function av(e,t){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),e()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const v=h&&o?n:r;return f&&i.add(d),v.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 cv=40;function nd(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=jr.reduce((C,S)=>(C[S]=av(s),C),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:p,postRender:v}=i,g=()=>{const C=Pt.useManualTiming,S=C?o.timestamp:performance.now();n=!1,C||(o.delta=r?1e3/60:Math.max(Math.min(S-o.timestamp,cv),1)),o.timestamp=S,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),p.process(o),v.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(g))},y=()=>{n=!0,r=!0,o.isProcessing||e(g)};return{schedule:jr.reduce((C,S)=>{const T=i[S];return C[S]=(E,R=!1,P=!1)=>(n||y(),T.schedule(E,R,P)),C},{}),cancel:C=>{for(let S=0;S<jr.length;S++)i[jr[S]].cancel(C)},state:o,steps:i}}const{schedule:ue,cancel:Et,state:Pe,steps:xs}=nd(typeof requestAnimationFrame<"u"?requestAnimationFrame:He,!0);let Yr;function lv(){Yr=void 0}const Oe={now:()=>(Yr===void 0&&Oe.set(Pe.isProcessing||Pt.useManualTiming?Pe.timestamp:performance.now()),Yr),set:e=>{Yr=e,queueMicrotask(lv)}},rd=e=>t=>typeof t=="string"&&t.startsWith(e),od=rd("--"),uv=rd("var(--"),oa=e=>uv(e)?dv.test(e.split("/*")[0].trim()):!1,dv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _c(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const jn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Zn={...jn,transform:e=>dt(0,1,e)},Dr={...jn,default:1},Kn=e=>Math.round(e*1e5)/1e5,sa=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function fv(e){return e==null}const hv=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ia=(e,t)=>n=>!!(typeof n=="string"&&hv.test(n)&&n.startsWith(e)||t&&!fv(n)&&Object.prototype.hasOwnProperty.call(n,t)),sd=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(sa);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},pv=e=>dt(0,255,e),bs={...jn,transform:e=>Math.round(pv(e))},Yt={test:ia("rgb","red"),parse:sd("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+bs.transform(e)+", "+bs.transform(t)+", "+bs.transform(n)+", "+Kn(Zn.transform(r))+")"};function mv(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ti={test:ia("#"),parse:mv,transform:Yt.transform},ar=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wt=ar("deg"),lt=ar("%"),ne=ar("px"),gv=ar("vh"),yv=ar("vw"),Lc={...lt,parse:e=>lt.parse(e)/100,transform:e=>lt.transform(e*100)},xn={test:ia("hsl","hue"),parse:sd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lt.transform(Kn(t))+", "+lt.transform(Kn(n))+", "+Kn(Zn.transform(r))+")"},ye={test:e=>Yt.test(e)||ti.test(e)||xn.test(e),parse:e=>Yt.test(e)?Yt.parse(e):xn.test(e)?xn.parse(e):ti.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Yt.transform(e):xn.transform(e),getAnimatableNone:e=>{const t=ye.parse(e);return t.alpha=0,ye.transform(t)}},vv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xv(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sa))==null?void 0:t.length)||0)+(((n=e.match(vv))==null?void 0:n.length)||0)>0}const id="number",ad="color",bv="var",wv="var(",Fc="${}",Cv=/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 Rn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Cv,c=>(ye.test(c)?(r.color.push(s),o.push(ad),n.push(ye.parse(c))):c.startsWith(wv)?(r.var.push(s),o.push(bv),n.push(c)):(r.number.push(s),o.push(id),n.push(parseFloat(c))),++s,Fc)).split(Fc);return{values:n,split:a,indexes:r,types:o}}function Sv(e){return Rn(e).values}function cd({split:e,types:t}){const n=e.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],r[s]!==void 0){const i=t[s];i===id?o+=Kn(r[s]):i===ad?o+=ye.transform(r[s]):o+=r[s]}return o}}function Tv(e){return cd(Rn(e))}const Rv=e=>typeof e=="number"?0:ye.test(e)?ye.getAnimatableNone(e):e,Pv=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Rv(e);function Ev(e){const t=Rn(e);return cd(t)(t.values.map((r,o)=>Pv(r,t.split[o])))}const Ze={test:xv,parse:Sv,createTransformer:Tv,getAnimatableNone:Ev};function ws(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Mv({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;o=ws(c,a,e+1/3),s=ws(c,a,e),i=ws(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function co(e,t){return n=>n>0?t:e}const de=(e,t,n)=>e+(t-e)*n,Cs=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Av=[ti,Yt,xn],Nv=e=>Av.find(t=>t.test(e));function $c(e){const t=Nv(e);if(Nn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===xn&&(n=Mv(n)),n}const Vc=(e,t)=>{const n=$c(e),r=$c(t);if(!n||!r)return co(e,t);const o={...n};return s=>(o.red=Cs(n.red,r.red,s),o.green=Cs(n.green,r.green,s),o.blue=Cs(n.blue,r.blue,s),o.alpha=de(n.alpha,r.alpha,s),Yt.transform(o))},ni=new Set(["none","hidden"]);function jv(e,t){return ni.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Dv(e,t){return n=>de(e,t,n)}function aa(e){return typeof e=="number"?Dv:typeof e=="string"?oa(e)?co:ye.test(e)?Vc:Ov:Array.isArray(e)?ld:typeof e=="object"?ye.test(e)?Vc:kv:co}function ld(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>aa(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function kv(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=aa(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Iv(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const Ov=(e,t)=>{const n=Ze.createTransformer(t),r=Rn(e),o=Rn(t);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?ni.has(e)&&!o.values.length||ni.has(t)&&!r.values.length?jv(e,t):sr(ld(Iv(r,o),o.values),n):(Nn(!0,`Complex values '${e}' and '${t}' 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"),co(e,t))};function ud(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?de(e,t,n):aa(e)(e,t)}const _v=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ue.update(t,n),stop:()=>Et(t),now:()=>Pe.isProcessing?Pe.timestamp:Oe.now()}},dd=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},lo=2e4;function ca(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<lo;)t+=n,r=e.next(t);return t>=lo?1/0:t}function Lv(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(ca(r),lo);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:ze(o)}}const pe={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 ri(e,t){return e*Math.sqrt(1-t*t)}const Fv=12;function $v(e,t,n){let r=n;for(let o=1;o<Fv;o++)r=r-e(r)/t(r);return r}const Ss=.001;function Vv({duration:e=pe.duration,bounce:t=pe.bounce,velocity:n=pe.velocity,mass:r=pe.mass}){let o,s;Nn(e<=Fe(pe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=dt(pe.minDamping,pe.maxDamping,i),e=dt(pe.minDuration,pe.maxDuration,ze(e)),i<1?(o=u=>{const d=u*i,f=d*e,h=d-n,p=ri(u,i),v=Math.exp(-f);return Ss-h/p*v},s=u=>{const f=u*i*e,h=f*n+n,p=Math.pow(i,2)*Math.pow(u,2)*e,v=Math.exp(-f),g=ri(Math.pow(u,2),i);return(-o(u)+Ss>0?-1:1)*((h-p)*v)/g}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Ss+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,c=$v(o,s,a);if(e=Fe(e),isNaN(c))return{stiffness:pe.stiffness,damping:pe.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:e}}}const Bv=["duration","bounce"],Wv=["stiffness","damping","mass"];function Bc(e,t){return t.some(n=>e[n]!==void 0)}function Gv(e){let t={velocity:pe.velocity,stiffness:pe.stiffness,damping:pe.damping,mass:pe.mass,isResolvedFromDuration:!1,...e};if(!Bc(e,Wv)&&Bc(e,Bv))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*dt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:pe.mass,stiffness:o,damping:s}}else{const n=Vv({...e,velocity:0});t={...t,...n,mass:pe.mass},t.isResolvedFromDuration=!0}return t}function uo(e=pe.visualDuration,t=pe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;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:p}=Gv({...n,velocity:-ze(n.velocity||0)}),v=h||0,g=u/(2*Math.sqrt(c*d)),y=i-s,x=ze(Math.sqrt(c/d)),b=Math.abs(y)<5;r||(r=b?pe.restSpeed.granular:pe.restSpeed.default),o||(o=b?pe.restDelta.granular:pe.restDelta.default);let C,S,T,E,R,P;if(g<1)T=ri(x,g),E=(v+g*x*y)/T,C=A=>{const j=Math.exp(-g*x*A);return i-j*(E*Math.sin(T*A)+y*Math.cos(T*A))},R=g*x*E+y*T,P=g*x*y-E*T,S=A=>Math.exp(-g*x*A)*(R*Math.sin(T*A)+P*Math.cos(T*A));else if(g===1){C=j=>i-Math.exp(-x*j)*(y+(v+x*y)*j);const A=v+x*y;S=j=>Math.exp(-x*j)*(x*A*j-v)}else{const A=x*Math.sqrt(g*g-1);C=K=>{const ee=Math.exp(-g*x*K),O=Math.min(A*K,300);return i-ee*((v+g*x*y)*Math.sinh(O)+A*y*Math.cosh(O))/A};const j=(v+g*x*y)/A,F=g*x*j-y*A,W=g*x*y-j*A;S=K=>{const ee=Math.exp(-g*x*K),O=Math.min(A*K,300);return ee*(F*Math.sinh(O)+W*Math.cosh(O))}}const M={calculatedDuration:p&&f||null,velocity:A=>Fe(S(A)),next:A=>{if(!p&&g<1){const F=Math.exp(-g*x*A),W=Math.sin(T*A),K=Math.cos(T*A),ee=i-F*(E*W+y*K),O=Fe(F*(R*W+P*K));return a.done=Math.abs(O)<=r&&Math.abs(i-ee)<=o,a.value=a.done?i:ee,a}const j=C(A);if(p)a.done=A>=f;else{const F=Fe(S(A));a.done=Math.abs(F)<=r&&Math.abs(i-j)<=o}return a.value=a.done?i:j,a},toString:()=>{const A=Math.min(ca(M),lo),j=dd(F=>M.next(A*F).value,A,30);return A+"ms "+j},toTransition:()=>{}};return M}uo.applyToOptions=e=>{const t=Lv(e,100,uo);return e.ease=t.ease,e.duration=Fe(t.duration),e.type="keyframes",e};const Uv=5;function fd(e,t,n){const r=Math.max(t-Uv,0);return zu(n-e(r),t-r)}function oi({keyframes:e,velocity:t=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=e[0],h={done:!1,value:f},p=P=>a!==void 0&&P<a||c!==void 0&&P>c,v=P=>a===void 0?c:c===void 0||Math.abs(a-P)<Math.abs(c-P)?a:c;let g=n*t;const y=f+g,x=i===void 0?y:i(y);x!==y&&(g=x-f);const b=P=>-g*Math.exp(-P/r),C=P=>x+b(P),S=P=>{const M=b(P),A=C(P);h.done=Math.abs(M)<=u,h.value=h.done?x:A};let T,E;const R=P=>{p(h.value)&&(T=P,E=uo({keyframes:[h.value,v(h.value)],velocity:fd(C,P,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return R(0),{calculatedDuration:null,next:P=>{let M=!1;return!E&&T===void 0&&(M=!0,S(P),R(P)),T!==void 0&&P>=T?E.next(P-T):(!M&&S(P),h)}}}function zv(e,t,n){const r=[],o=n||Pt.mix||ud,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||He:t;a=sr(c,a)}r.push(a)}return r}function Hv(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(pt(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=zv(t,r,o),c=a.length,u=d=>{if(i&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=qn(e[f],e[f+1],d);return a[f](h)};return n?d=>u(dt(e[0],e[s-1],d)):u}function Kv(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=qn(0,t,r);e.push(de(n,1,o))}}function Yv(e){const t=[0];return Kv(t,e.length-1),t}function Xv(e,t){return e.map(n=>n*t)}function qv(e,t){return e.map(()=>t||ed).splice(0,e.length-1)}function bn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=sv(r)?r.map(Oc):Oc(r),s={done:!1,value:t[0]},i=Xv(n&&n.length===t.length?n:Yv(t),e),a=Hv(i,t,{ease:Array.isArray(o)?o:qv(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const Zv=e=>e!==null;function Do(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(Zv),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Qv={decay:oi,inertia:oi,tween:bn,keyframes:bn,spring:uo};function hd(e){typeof e.type=="string"&&(e.type=Qv[e.type])}class la{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Jv=e=>e/100;class fo extends la{constructor(t){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!==Oe.now()&&this.tick(Oe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;hd(t);const{type:n=bn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||bn;process.env.NODE_ENV!=="production"&&c!==bn&&pt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==bn&&typeof a[0]!="number"&&(this.mixKeyframes=sr(Jv,ud(a[0],a[1])),a=[0,100]);const u=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=ca(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,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:p,type:v,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let C=this.currentTime,S=r;if(f){const P=Math.min(this.currentTime,o)/a;let M=Math.floor(P),A=P%1;!A&&P>=1&&(A=1),A===1&&M--,M=Math.min(M,f+1),!!(M%2)&&(h==="reverse"?(A=1-A,p&&(A-=p/a)):h==="mirror"&&(S=i)),C=dt(0,1,A)*a}let T;b?(this.delayState.value=d[0],T=this.delayState):T=S.next(C),s&&!b&&(T.value=s(T.value));let{done:E}=T;!b&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return R&&v!==oi&&(T.value=Do(d,this.options,y,this.speed)),g&&g(T.value),R&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return ze(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ze(t)}get time(){return ze(this.currentTime)}set time(t){t=Fe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return fd(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Oe.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=ze(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=_v,startTime:n}=this.options;this.driver||(this.driver=t(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(Oe.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function ex(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Xt=e=>e*180/Math.PI,si=e=>{const t=Xt(Math.atan2(e[1],e[0]));return ii(t)},tx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:si,rotateZ:si,skewX:e=>Xt(Math.atan(e[1])),skewY:e=>Xt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ii=e=>(e=e%360,e<0&&(e+=360),e),Wc=si,Gc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Uc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),nx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gc,scaleY:Uc,scale:e=>(Gc(e)+Uc(e))/2,rotateX:e=>ii(Xt(Math.atan2(e[6],e[5]))),rotateY:e=>ii(Xt(Math.atan2(-e[2],e[0]))),rotateZ:Wc,rotate:Wc,skewX:e=>Xt(Math.atan(e[4])),skewY:e=>Xt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ai(e){return e.includes("scale")?1:0}function ci(e,t){if(!e||e==="none")return ai(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=nx,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=tx,o=a}if(!o)return ai(t);const s=r[t],i=o[1].split(",").map(ox);return typeof s=="function"?s(i):i[s]}const rx=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ci(n,t)};function ox(e){return parseFloat(e.trim())}const Dn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],kn=new Set(Dn),zc=e=>e===jn||e===ne,sx=new Set(["x","y","z"]),ix=Dn.filter(e=>!sx.has(e));function ax(e){const t=[];return ix.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Tt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ci(t,"x"),y:(e,{transform:t})=>ci(t,"y")};Tt.translateX=Tt.x;Tt.translateY=Tt.y;const qt=new Set;let li=!1,ui=!1,di=!1;function pd(){if(ui){const e=Array.from(qt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=ax(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ui=!1,li=!1,qt.forEach(e=>e.complete(di)),qt.clear()}function md(){qt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ui=!0)})}function cx(){di=!0,md(),pd(),di=!1}class ua{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(qt.add(this),li||(li=!0,ue.read(md),ue.resolveKeyframes(pd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}ex(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),qt.delete(this)}cancel(){this.state==="scheduled"&&(qt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const lx=e=>e.startsWith("--");function gd(e,t,n){lx(t)?e.style.setProperty(t,n):e.style[t]=n}const ux={};function yd(e,t){const n=Uu(e);return()=>ux[t]??n()}const dx=yd(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),vd=yd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Un=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Hc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Un([0,.65,.55,1]),circOut:Un([.55,0,1,.45]),backIn:Un([.31,.01,.66,-.59]),backOut:Un([.33,1.53,.69,.99])};function xd(e,t){if(e)return typeof e=="function"?vd()?dd(e,t):"ease-out":td(e)?Un(e):Array.isArray(e)?e.map(n=>xd(n,t)||Hc.easeOut):Hc[e]}function fx(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=xd(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),e.animate(d,h)}function bd(e){return typeof e=="function"&&"applyToOptions"in e}function hx({type:e,...t}){return bd(e)&&vd()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class wd extends la{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,pt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=hx(t);this.animation=fx(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Do(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),gd(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 t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ze(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ze(t)}get time(){return ze(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Fe(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&dx()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),He):o(this)}}const Cd={anticipate:Zu,backInOut:qu,circInOut:Ju};function px(e){return e in Cd}function mx(e){typeof e.ease=="string"&&px(e.ease)&&(e.ease=Cd[e.ease])}const Ts=10;class gx extends wd{constructor(t){mx(t),hd(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new fo({...i,autoplay:!1}),c=Math.max(Ts,Oe.now()-this.startTime),u=dt(0,Ts,c-Ts),d=a.sample(c).value,{name:f}=this.options;s&&f&&gd(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const Kc=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ze.test(e)||e==="0")&&!e.startsWith("url("));function yx(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function vx(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Kc(o,t),a=Kc(s,t);return Nn(i===a,`You are trying to animate ${t} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:yx(e)||(n==="spring"||bd(n))&&r}function fi(e){e.duration=0,e.type="keyframes"}const Sd=new Set(["opacity","clipPath","filter","transform"]),xx=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function bx(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&xx.test(e[t]))return!0;return!1}const wx=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Cx=Uu(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Sx(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return Cx()&&n&&(Sd.has(n)||wx.has(n)&&bx(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const Tx=40;class Rx extends la{constructor({autoplay:t=!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 v;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=Oe.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||ua;this.keyframeResolver=new p(a,(g,y,x)=>this.onKeyframesResolved(g,y,h,!x),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,o){var x,b;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Oe.now();let f=!0;vx(t,s,i,a)||(f=!1,(Pt.instantAnimations||!c)&&(d==null||d(Do(t,r,n))),t[0]=t[t.length-1],fi(r),r.repeat=0);const p={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Tx?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},v=f&&!u&&Sx(p),g=(b=(x=p.motionValue)==null?void 0:x.owner)==null?void 0:b.current;let y;if(v)try{y=new gx({...p,element:g})}catch{y=new fo(p)}else y=new fo(p);y.finished.then(()=>{this.notifyFinished()}).catch(He),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),cx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Td(e,t,n,r=0,o=1){const s=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const Px=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ex(e){const t=Px.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const Mx=4;function Rd(e,t,n=1){pt(n<=Mx,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Ex(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Bu(i)?parseFloat(i):i}return oa(o)?Rd(o,t,n+1):o}const Ax={type:"spring",stiffness:500,damping:25,restSpeed:10},Nx=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),jx={type:"keyframes",duration:.8},Dx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kx=(e,{keyframes:t})=>t.length>2?jx:kn.has(e)?e.startsWith("scale")?Nx(t[1]):Ax:Dx;function Pd(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function da(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Pd(n,e):n}const Ix=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ox(e){for(const t in e)if(!Ix.has(t))return!0;return!1}const fa=(e,t,n,r={},o,s)=>i=>{const a=da(r,e)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Fe(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Ox(a)||Object.assign(d,kx(e,d)),d.duration&&(d.duration=Fe(d.duration)),d.repeatDelay&&(d.repeatDelay=Fe(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(fi(d),d.delay===0&&(f=!0)),(Pt.instantAnimations||Pt.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,fi(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const h=Do(d.keyframes,a);if(h!==void 0){ue.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new fo(d):new Rx(d)};function Yc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ha(e,t,n,r){if(typeof t=="function"){const[o,s]=Yc(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Yc(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Zt(e,t,n){const r=e.getProps();return ha(r,t,n!==void 0?n:r.custom,e)}const Ed=new Set(["width","height","top","left","right","bottom",...Dn]),Xc=30,_x=e=>!isNaN(parseFloat(e));class Lx{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Oe.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(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Oe.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=_x(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&ta(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ea);const r=this.events[t].add(n);return t==="change"?()=>{r(),ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Oe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Xc)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xc);return zu(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pn(e,t){return new Lx(e,t)}const hi=e=>Array.isArray(e);function Fx(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pn(n))}function $x(e){return hi(e)?e[e.length-1]||0:e}function Vx(e,t){const n=Zt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=$x(s[i]);Fx(e,i,a)}}const Ee=e=>!!(e&&e.getVelocity);function Bx(e){return!!(Ee(e)&&e.add)}function pi(e,t){const n=e.getValue("willChange");if(Bx(n))return n.add(t);if(!n&&Pt.WillChange){const r=new Pt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function pa(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Wx="framerAppearId",Md="data-"+pa(Wx);function Ad(e){return e.props[Md]}function Gx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Nd(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=t;const c=e.getDefaultTransition();s=s?Pd(s,c):c;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&e.animationState&&e.animationState.getState()[o];for(const h in a){const p=e.getValue(h,e.latestValues[h]??null),v=a[h];if(v===void 0||f&&Gx(f,h))continue;const g={delay:n,...da(s||{},h)},y=p.get();if(y!==void 0&&!p.isAnimating()&&!Array.isArray(v)&&v===y&&!g.velocity){ue.update(()=>p.set(v));continue}let x=!1;if(window.MotionHandoffAnimation){const S=Ad(e);if(S){const T=window.MotionHandoffAnimation(S,h,ue);T!==null&&(g.startTime=T,x=!0)}}pi(e,h);const b=u??e.shouldReduceMotion;p.start(fa(h,p,v,b&&Ed.has(h)?{type:!1}:g,e,x));const C=p.animation;C&&d.push(C)}if(i){const h=()=>ue.update(()=>{i&&Vx(e,i)});d.length?Promise.all(d).then(h):h()}return d}function mi(e,t,n={}){var c;const r=Zt(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Nd(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return Ux(e,t,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 Ux(e,t,n=0,r=0,o=0,s=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(mi(c,t,{...i,delay:n+(typeof r=="function"?0:r)+Td(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function zx(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>mi(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=mi(e,t,n);else{const o=typeof t=="function"?Zt(e,t,n.custom):t;r=Promise.all(Nd(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Hx={test:e=>e==="auto",parse:e=>e},jd=e=>t=>t.test(e),Dd=[jn,ne,lt,wt,yv,gv,Hx],qc=e=>Dd.find(jd(e));function Kx(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Gu(e):!0}const Yx=new Set(["brightness","contrast","saturate","opacity"]);function Xx(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(sa)||[];if(!r)return e;const o=n.replace(r,"");let s=Yx.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const qx=/\b([a-z-]*)\(.*?\)/gu,gi={...Ze,getAnimatableNone:e=>{const t=e.match(qx);return t?t.map(Xx).join(" "):e}},yi={...Ze,getAnimatableNone:e=>{const t=Ze.parse(e);return Ze.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Zc={...jn,transform:Math.round},Zx={rotate:wt,rotateX:wt,rotateY:wt,rotateZ:wt,scale:Dr,scaleX:Dr,scaleY:Dr,scaleZ:Dr,skew:wt,skewX:wt,skewY:wt,distance:ne,translateX:ne,translateY:ne,translateZ:ne,x:ne,y:ne,z:ne,perspective:ne,transformPerspective:ne,opacity:Zn,originX:Lc,originY:Lc,originZ:ne},ma={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,...Zx,zIndex:Zc,fillOpacity:Zn,strokeOpacity:Zn,numOctaves:Zc},Qx={...ma,color:ye,backgroundColor:ye,outlineColor:ye,fill:ye,stroke:ye,borderColor:ye,borderTopColor:ye,borderRightColor:ye,borderBottomColor:ye,borderLeftColor:ye,filter:gi,WebkitFilter:gi,mask:yi,WebkitMask:yi},kd=e=>Qx[e],Jx=new Set([gi,yi]);function Id(e,t){let n=kd(e);return Jx.has(n)||(n=Ze),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const eb=new Set(["auto","none","0"]);function tb(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!eb.has(s)&&Rn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Id(n,o)}class nb extends ua{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),oa(f))){const h=Rd(f,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Ed.has(r)||t.length!==2)return;const[o,s]=t,i=qc(o),a=qc(s),c=_c(o),u=_c(s);if(c!==u&&Tt[r]){this.needsMeasurement=!0;return}if(i!==a)if(zc(i)&&zc(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else Tt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||Kx(t[o]))&&r.push(o);r.length&&tb(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Tt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=Tt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Od(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const _d=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Xr(e){return Wu(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:ga}=nd(queueMicrotask,!1),Xe={x:!1,y:!1};function Ld(){return Xe.x||Xe.y}function rb(e){return e==="x"||e==="y"?Xe[e]?null:(Xe[e]=!0,()=>{Xe[e]=!1}):Xe.x||Xe.y?null:(Xe.x=Xe.y=!0,()=>{Xe.x=Xe.y=!1})}function Fd(e,t){const n=Od(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function ob(e){return!(e.pointerType==="touch"||Ld())}function sb(e,t,n={}){const[r,o,s]=Fd(e,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",v)},f=y=>{u&&(u(y),u=void 0),d()},h=y=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(y))},p=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},v=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}f(y)}},g=y=>{if(!ob(y))return;c=!1;const x=t(i,y);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",v,o))};i.addEventListener("pointerenter",g,o),i.addEventListener("pointerdown",p,o)}),s}const $d=(e,t)=>t?e===t?!0:$d(e,t.parentElement):!1,ya=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ib=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ab(e){return ib.has(e.tagName)||e.isContentEditable===!0}const cb=new Set(["INPUT","SELECT","TEXTAREA"]);function lb(e){return cb.has(e.tagName)||e.isContentEditable===!0}const qr=new WeakSet;function Qc(e){return t=>{t.key==="Enter"&&e(t)}}function Rs(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ub=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Qc(()=>{if(qr.has(n))return;Rs(n,"down");const o=Qc(()=>{Rs(n,"up")}),s=()=>Rs(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Jc(e){return ya(e)&&!Ld()}const el=new WeakSet;function db(e,t,n={}){const[r,o,s]=Fd(e,n),i=a=>{const c=a.currentTarget;if(!Jc(a)||el.has(a))return;qr.add(c),n.stopPropagation&&el.add(a);const u=t(c,a),d=(p,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),qr.has(c)&&qr.delete(c),Jc(p)&&typeof u=="function"&&u(p,{success:v})},f=p=>{d(p,c===window||c===document||n.useGlobalTarget||$d(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Xr(a)&&(a.addEventListener("focus",u=>ub(u,o)),!ab(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function va(e){return Wu(e)&&"ownerSVGElement"in e}const Zr=new WeakMap;let Ct;const Vd=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:va(r)&&"getBBox"in r?r.getBBox()[t]:r[n],fb=Vd("inline","width","offsetWidth"),hb=Vd("block","height","offsetHeight");function pb({target:e,borderBoxSize:t}){var n;(n=Zr.get(e))==null||n.forEach(r=>{r(e,{get width(){return fb(e,t)},get height(){return hb(e,t)}})})}function mb(e){e.forEach(pb)}function gb(){typeof ResizeObserver>"u"||(Ct=new ResizeObserver(mb))}function yb(e,t){Ct||gb();const n=Od(e);return n.forEach(r=>{let o=Zr.get(r);o||(o=new Set,Zr.set(r,o)),o.add(t),Ct==null||Ct.observe(r)}),()=>{n.forEach(r=>{const o=Zr.get(r);o==null||o.delete(t),o!=null&&o.size||Ct==null||Ct.unobserve(r)})}}const Qr=new Set;let wn;function vb(){wn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Qr.forEach(t=>t(e))},window.addEventListener("resize",wn)}function xb(e){return Qr.add(e),wn||vb(),()=>{Qr.delete(e),!Qr.size&&typeof wn=="function"&&(window.removeEventListener("resize",wn),wn=void 0)}}function tl(e,t){return typeof e=="function"?xb(e):yb(e,t)}function bb(e){return va(e)&&e.tagName==="svg"}const wb=[...Dd,ye,Ze],Cb=e=>wb.find(jd(e)),nl=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cn=()=>({x:nl(),y:nl()}),rl=()=>({min:0,max:0}),xe=()=>({x:rl(),y:rl()}),Sb=new WeakMap;function ko(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Qn(e){return typeof e=="string"||Array.isArray(e)}const xa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ba=["initial",...xa];function Io(e){return ko(e.animate)||ba.some(t=>Qn(e[t]))}function Bd(e){return!!(Io(e)||e.variants)}function Tb(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Ee(o))e.addValue(r,o);else if(Ee(s))e.addValue(r,Pn(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,Pn(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const vi={current:null},Wd={current:!1},Rb=typeof window<"u";function Pb(){if(Wd.current=!0,!!Rb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>vi.current=e.matches;e.addEventListener("change",t),t()}else vi.current=!1}const ol=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ho={};function Gd(e){ho=e}function Eb(){return ho}class Mb{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,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=ua,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 p=Oe.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ue.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=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=Io(n),this.isVariantNode=Bd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const v=h[p];u[p]!==void 0&&Ee(v)&&v.set(u[p])}}mount(t){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=t,Sb.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),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:(Wd.current||Pb(),this.shouldReduceMotion=vi.current),process.env.NODE_ENV!=="production"&&ta(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 t;this.projection&&this.projection.unmount(),Et(this.notifyUpdate),Et(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.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(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Sd.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new wd({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:Fe(d)}),h=i(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=kn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ho){const n=ho[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];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):xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<ol.length;r++){const o=ol[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Tb(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Bu(r)||Gu(r))?r=parseFloat(r):!Cb(r)&&Ze.test(n)&&(r=Id(t,n)),this.setBaseTarget(t,Ee(r)?r.get():r)),Ee(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ha(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Ee(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ea),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ga.render(this.render)}}class Ud extends Mb{constructor(){super(...arguments),this.KeyframeResolver=nb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ee(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class jt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function zd({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ab({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Nb(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ps(e){return e===void 0||e===1}function xi({scale:e,scaleX:t,scaleY:n}){return!Ps(e)||!Ps(t)||!Ps(n)}function Kt(e){return xi(e)||Hd(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Hd(e){return sl(e.x)||sl(e.y)}function sl(e){return e&&e!=="0%"}function po(e,t,n){const r=e-n,o=t*r;return n+o}function il(e,t,n,r,o){return o!==void 0&&(e=po(e,o,r)),po(e,n,r)+t}function bi(e,t=0,n=1,r,o){e.min=il(e.min,t,n,r,o),e.max=il(e.max,t,n,r,o)}function Kd(e,{x:t,y:n}){bi(e.x,t.translate,t.scale,t.originPoint),bi(e.y,n.translate,n.scale,n.originPoint)}const al=.999999999999,cl=1.0000000000001;function jb(e,t,n,r=!1){var a;const o=n.length;if(!o)return;t.x=t.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&&(it(e.x,-s.scroll.offset.x),it(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Kd(e,i)),r&&Kt(s.latestValues)&&Jr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<cl&&t.x>al&&(t.x=1),t.y<cl&&t.y>al&&(t.y=1)}function it(e,t){e.min+=t,e.max+=t}function ll(e,t,n,r,o=.5){const s=de(e.min,e.max,o);bi(e,t,n,s,r)}function ul(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Jr(e,t,n){const r=n??e;ll(e.x,ul(t.x,r.x),t.scaleX,t.scale,t.originX),ll(e.y,ul(t.y,r.y),t.scaleY,t.scale,t.originY)}function Yd(e,t){return zd(Nb(e.getBoundingClientRect(),t))}function Db(e,t,n){const r=Yd(e,n),{scroll:o}=t;return o&&(it(r.x,o.offset.x),it(r.y,o.offset.y)),r}const kb={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ib=Dn.length;function Ob(e,t,n){let r="",o=!0;for(let s=0;s<Ib;s++){const i=Dn[s],a=e[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=_d(a,ma[i]);if(!c){o=!1;const d=kb[i]||i;r+=`${d}(${u}) `}n&&(t[i]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function wa(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const u=t[c];if(kn.has(c)){i=!0;continue}else if(od(c)){o[c]=u;continue}else{const d=_d(u,ma[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(t.transform||(i||n?r.transform=Ob(t,e.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 Xd(e,{style:t,vars:n},r,o){const s=e.style;let i;for(i in t)s[i]=t[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function dl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ne.test(e))e=parseFloat(e);else return e;const n=dl(e,t.target.x),r=dl(e,t.target.y);return`${n}% ${r}%`}},_b={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ze.parse(e);if(o.length>5)return r;const s=Ze.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const u=de(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},wi={borderRadius:{...Wn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wn,borderTopRightRadius:Wn,borderBottomLeftRadius:Wn,borderBottomRightRadius:Wn,boxShadow:_b};function qd(e,{layout:t,layoutId:n}){return kn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!wi[e]||e==="opacity")}function Ca(e,t,n){var i;const r=e.style,o=t==null?void 0:t.style,s={};if(!r)return s;for(const a in r)(Ee(r[a])||o&&Ee(o[a])||qd(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Lb(e){return window.getComputedStyle(e)}class Fb extends Ud{constructor(){super(...arguments),this.type="html",this.renderInstance=Xd}readValueFromInstance(t,n){var r;if(kn.has(n))return(r=this.projection)!=null&&r.isProjecting?ai(n):rx(t,n);{const o=Lb(t),s=(od(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Yd(t,n)}build(t,n,r){wa(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ca(t,n,r)}}const $b={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vb={offset:"strokeDashoffset",array:"strokeDasharray"};function Bb(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?$b:Vb;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const Wb=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Zd(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(wa(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;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 p of Wb)f[p]!==void 0&&(h[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Bb(f,o,s,i,!1)}const Qd=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"]),Jd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Gb(e,t,n,r){Xd(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Qd.has(o)?o:pa(o),t.attrs[o])}function ef(e,t,n){const r=Ca(e,t,n);for(const o in e)if(Ee(e[o])||Ee(t[o])){const s=Dn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}class Ub extends Ud{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(kn.has(n)){const r=kd(n);return r&&r.default||0}return n=Qd.has(n)?n:pa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ef(t,n,r)}build(t,n,r){Zd(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){Gb(t,n,r,o)}mount(t){this.isSVGTag=Jd(t.tagName),super.mount(t)}}const zb=ba.length;function tf(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?tf(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<zb;n++){const r=ba[n],o=e.props[r];(Qn(o)||o===!1)&&(t[r]=o)}return t}function nf(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Hb=[...xa].reverse(),Kb=xa.length;function Yb(e){return t=>Promise.all(t.map(({animation:n,options:r})=>zx(e,n,r)))}function Xb(e){let t=Yb(e),n=fl(),r=!0,o=!1;const s=u=>(d,f)=>{var p;const h=Zt(e,f,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:v,transitionEnd:g,...y}=h;d={...d,...y,...g}}return d};function i(u){t=u(e)}function a(u){const{props:d}=e,f=tf(e.parent)||{},h=[],p=new Set;let v={},g=1/0;for(let x=0;x<Kb;x++){const b=Hb[x],C=n[b],S=d[b]!==void 0?d[b]:f[b],T=Qn(S),E=b===u?C.isActive:null;E===!1&&(g=x);let R=S===f[b]&&S!==d[b]&&T;if(R&&(r||o)&&e.manuallyAnimateOnMount&&(R=!1),C.protectedKeys={...v},!C.isActive&&E===null||!S&&!C.prevProp||ko(S)||typeof S=="boolean")continue;if(b==="exit"&&C.isActive&&E!==!0){C.prevResolvedValues&&(v={...v,...C.prevResolvedValues});continue}const P=qb(C.prevProp,S);let M=P||b===u&&C.isActive&&!R&&T||x>g&&T,A=!1;const j=Array.isArray(S)?S:[S];let F=j.reduce(s(b),{});E===!1&&(F={});const{prevResolvedValues:W={}}=C,K={...W,...F},ee=N=>{M=!0,p.has(N)&&(A=!0,p.delete(N)),C.needsAnimating[N]=!0;const I=e.getValue(N);I&&(I.liveStyle=!1)};for(const N in K){const I=F[N],$=W[N];if(v.hasOwnProperty(N))continue;let X=!1;hi(I)&&hi($)?X=!nf(I,$):X=I!==$,X?I!=null?ee(N):p.add(N):I!==void 0&&p.has(N)?ee(N):C.protectedKeys[N]=!0}C.prevProp=S,C.prevResolvedValues=F,C.isActive&&(v={...v,...F}),(r||o)&&e.blockInitialAnimation&&(M=!1);const O=R&&P;M&&(!O||A)&&h.push(...j.map(N=>{const I={type:b};if(typeof N=="string"&&(r||o)&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,X=Zt($,N);if($.enteringChildren&&X){const{delayChildren:k}=X.transition||{};I.delay=Td($.enteringChildren,e,k)}}return{animation:N,options:I}}))}if(p.size){const x={};if(typeof d.initial!="boolean"){const b=Zt(e,Array.isArray(d.initial)?d.initial[0]:d.initial);b&&b.transition&&(x.transition=b.transition)}p.forEach(b=>{const C=e.getBaseTarget(b),S=e.getValue(b);S&&(S.liveStyle=!0),x[b]=C??null}),h.push({animation:x})}let y=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,o=!1,y?t(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var v;return(v=p.animationState)==null?void 0:v.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=fl(),o=!0}}}function qb(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nf(t,e):!1}function zt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fl(){return{animate:zt(!0),whileInView:zt(),whileHover:zt(),whileTap:zt(),whileDrag:zt(),whileFocus:zt(),exit:zt()}}function Ci(e,t){e.min=t.min,e.max=t.max}function Ye(e,t){Ci(e.x,t.x),Ci(e.y,t.y)}function hl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const rf=1e-4,Zb=1-rf,Qb=1+rf,of=.01,Jb=0-of,ew=0+of;function _e(e){return e.max-e.min}function tw(e,t,n){return Math.abs(e-t)<=n}function pl(e,t,n,r=.5){e.origin=r,e.originPoint=de(t.min,t.max,e.origin),e.scale=_e(n)/_e(t),e.translate=de(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Zb&&e.scale<=Qb||isNaN(e.scale))&&(e.scale=1),(e.translate>=Jb&&e.translate<=ew||isNaN(e.translate))&&(e.translate=0)}function Yn(e,t,n,r){pl(e.x,t.x,n.x,r?r.originX:void 0),pl(e.y,t.y,n.y,r?r.originY:void 0)}function ml(e,t,n,r=0){const o=r?de(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+_e(t)}function nw(e,t,n,r){ml(e.x,t.x,n.x,r==null?void 0:r.x),ml(e.y,t.y,n.y,r==null?void 0:r.y)}function gl(e,t,n,r=0){const o=r?de(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+_e(t)}function mo(e,t,n,r){gl(e.x,t.x,n.x,r==null?void 0:r.x),gl(e.y,t.y,n.y,r==null?void 0:r.y)}function yl(e,t,n,r,o){return e-=t,e=po(e,1/n,r),o!==void 0&&(e=po(e,1/o,r)),e}function rw(e,t=0,n=1,r=.5,o,s=e,i=e){if(lt.test(t)&&(t=parseFloat(t),t=de(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=de(s.min,s.max,r);e===s&&(a-=t),e.min=yl(e.min,t,n,a,o),e.max=yl(e.max,t,n,a,o)}function vl(e,t,[n,r,o],s,i){rw(e,t[n],t[r],t[o],t.scale,s,i)}const ow=["x","scaleX","originX"],sw=["y","scaleY","originY"];function xl(e,t,n,r){vl(e.x,t,ow,n?n.x:void 0,r?r.x:void 0),vl(e.y,t,sw,n?n.y:void 0,r?r.y:void 0)}function bl(e){return e.translate===0&&e.scale===1}function sf(e){return bl(e.x)&&bl(e.y)}function wl(e,t){return e.min===t.min&&e.max===t.max}function iw(e,t){return wl(e.x,t.x)&&wl(e.y,t.y)}function Cl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function af(e,t){return Cl(e.x,t.x)&&Cl(e.y,t.y)}function Sl(e){return _e(e.x)/_e(e.y)}function Tl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ot(e){return[e("x"),e("y")]}function aw(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const cf=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],cw=cf.length,Rl=e=>typeof e=="string"?parseFloat(e):e,Pl=e=>typeof e=="number"||ne.test(e);function lw(e,t,n,r,o,s){o?(e.opacity=de(0,n.opacity??1,uw(r)),e.opacityExit=de(t.opacity??1,0,dw(r))):s&&(e.opacity=de(t.opacity??1,n.opacity??1,r));for(let i=0;i<cw;i++){const a=cf[i];let c=El(t,a),u=El(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Pl(c)===Pl(u)?(e[a]=Math.max(de(Rl(c),Rl(u),r),0),(lt.test(u)||lt.test(c))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=de(t.rotate||0,n.rotate||0,r))}function El(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const uw=lf(0,.5,Qu),dw=lf(.5,.95,He);function lf(e,t,n){return r=>r<e?0:r>t?1:n(qn(e,t,r))}function fw(e,t,n){const r=Ee(e)?e:Pn(e);return r.start(fa("",r,t,n)),r.animation}function Jn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const hw=(e,t)=>e.depth-t.depth;class pw{constructor(){this.children=[],this.isDirty=!1}add(t){Ji(this.children,t),this.isDirty=!0}remove(t){ao(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hw),this.isDirty=!1,this.children.forEach(t)}}function mw(e,t){const n=Oe.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Et(r),e(s-t))};return ue.setup(r,!0),()=>Et(r)}function eo(e){return Ee(e)?e.get():e}class gw{constructor(){this.members=[]}add(t){Ji(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(ao(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(ao(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-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(t,n){var o;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=t.options;(s===void 0||s!==i)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,o,s,i;(r=(n=t.options).onExitComplete)==null||r.call(n),(i=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const to={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Es=["","X","Y","Z"],yw=1e3;let vw=0;function Ms(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function uf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ad(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ue,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&uf(r)}function df({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=vw++,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(ww),this.nodes.forEach(Ew),this.nodes.forEach(Mw),this.nodes.forEach(Cw)},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 pw)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new ea),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=va(i)&&!bb(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),e){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;ue.read(()=>{f=window.innerWidth}),e(i,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=mw(h,250),to.hasAnimatedSinceResize&&(to.hasAnimatedSinceResize=!1,this.nodes.forEach(Nl)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||kw,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),x=!this.targetLayout||!af(this.targetLayout,p),b=!f&&h;if(this.options.layoutRoot||this.resumeFrom||b||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...da(v,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(d,b)}else f||Nl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}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(),Et(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(Aw),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&&uf(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(Tw),this.nodes.forEach(Ml);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Al);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Rw),this.nodes.forEach(Pw),this.nodes.forEach(xw),this.nodes.forEach(bw)):this.nodes.forEach(Al),this.clearAllSnapshots();const a=Oe.now();Pe.delta=dt(0,1e3/60,a-Pe.timestamp),Pe.timestamp=a,Pe.isProcessing=!0,xs.update.process(Pe),xs.preRender.process(Pe),xs.render.process(Pe),Pe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ga.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Sw),this.sharedNodes.forEach(Nw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_e(this.snapshot.measuredBox.x)&&!_e(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=xe()),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&&!sf(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||Kt(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)),Iw(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return xe();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Ow))){const{scroll:d}=this.root;d&&(it(a.x,d.offset.x),it(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=xe();if(Ye(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&&Ye(a,i),it(a.x,f.offset.x),it(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||xe();Ye(u,i);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(it(u.x,-p.scroll.offset.x),it(u.y,-p.scroll.offset.y)),Kt(p.latestValues)&&Jr(u,p.latestValues,(d=p.layout)==null?void 0:d.layoutBox)}return Kt(this.latestValues)&&Jr(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=xe();Ye(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!Kt(d.latestValues))continue;let f;d.instance&&(xi(d.latestValues)&&d.updateSnapshot(),f=xe(),Ye(f,d.measurePageBox())),xl(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return Kt(this.latestValues)&&xl(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!==Pe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var p;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||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Pe.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=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nw(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ye(this.target,this.layout.layoutBox),Kd(this.target,this.targetDelta)):Ye(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||xi(this.parent.latestValues)||Hd(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=xe(),this.relativeTargetOrigin=xe(),mo(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),Ye(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Pe.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;Ye(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;jb(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=xe());const{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(hl(this.prevProjectionDelta.x,this.projectionDelta.x),hl(this.prevProjectionDelta.y,this.projectionDelta.y)),Yn(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Tl(this.projectionDelta.x,this.prevProjectionDelta.x)||!Tl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}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=Cn(),this.projectionDelta=Cn(),this.projectionDeltaWithTransform=Cn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=Cn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=xe(),p=c?c.source:void 0,v=this.layout?this.layout.source:void 0,g=p!==v,y=this.getStack(),x=!y||y.members.length<=1,b=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(Dw));this.animationProgress=0;let C;this.mixTargetDelta=S=>{const T=S/1e3;jl(f.x,i.x,T),jl(f.y,i.y,T),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mo(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),jw(this.relativeTarget,this.relativeTargetOrigin,h,T),C&&iw(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=xe()),Ye(C,this.relativeTarget)),g&&(this.animationValues=d,lw(d,u,this.latestValues,T,b,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},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&&(Et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ue.update(()=>{to.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pn(0)),this.motionValue.jump(0,!1),this.currentAnimation=fw(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(yw),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&&ff(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||xe();const f=_e(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=_e(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Ye(a,c),Jr(a,d),Yn(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new gw),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&&Ms("z",i,u,this.animationValues);for(let d=0;d<Es.length;d++)Ms(`rotate${Es[d]}`,i,u,this.animationValues),Ms(`skew${Es[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=eo(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=eo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Kt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=aw(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:p}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${p.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 v in wi){if(d[v]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:x}=wi[v],b=f==="none"?d[v]:g(d[v],u);if(y){const C=y.length;for(let S=0;S<C;S++)i[y[S]]=b}else x?this.options.visualElement.renderState.vars[v]=b:i[v]=b}this.options.layoutId&&(i.pointerEvents=u===this?eo(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(Ml),this.root.sharedNodes.clear()}}}function xw(e){e.updateLayout()}function bw(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")ot(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],p=_e(h);h.min=r[f].min,h.max=h.min+p});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";Ci(i?t.measuredBox[f]:t.layoutBox[f],r[f])}else ff(s,t.layoutBox,r)&&ot(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],p=_e(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=Cn();Yn(a,r,t.layoutBox);const c=Cn();i?Yn(c,e.applyTransform(o,!0),t.measuredBox):Yn(c,r,t.layoutBox);const u=!sf(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const v=e.options.layoutAnchor||void 0,g=xe();mo(g,t.layoutBox,h.layoutBox,v);const y=xe();mo(y,r,p.layoutBox,v),af(g,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ww(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Cw(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Sw(e){e.clearSnapshot()}function Ml(e){e.clearMeasurements()}function Tw(e){e.isLayoutDirty=!0,e.updateLayout()}function Al(e){e.isLayoutDirty=!1}function Rw(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Pw(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Nl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ew(e){e.resolveTargetDelta()}function Mw(e){e.calcProjection()}function Aw(e){e.resetSkewAndRotation()}function Nw(e){e.removeLeadSnapshot()}function jl(e,t,n){e.translate=de(t.translate,0,n),e.scale=de(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Dl(e,t,n,r){e.min=de(t.min,n.min,r),e.max=de(t.max,n.max,r)}function jw(e,t,n,r){Dl(e.x,t.x,n.x,r),Dl(e.y,t.y,n.y,r)}function Dw(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const kw={duration:.45,ease:[.4,0,.1,1]},kl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Il=kl("applewebkit/")&&!kl("chrome/")?Math.round:He;function Ol(e){e.min=Il(e.min),e.max=Il(e.max)}function Iw(e){Ol(e.x),Ol(e.y)}function ff(e,t,n){return e==="position"||e==="preserve-aspect"&&!tw(Sl(t),Sl(n),.2)}function Ow(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const _w=df({attachResizeListener:(e,t)=>Jn(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),As={current:void 0},hf=df({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!As.current){const e=new _w({});e.mount(window),e.setOptions({layoutScroll:!0}),As.current=e}return As.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Sa=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function _l(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=_l(o,t);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():_l(e[o],null)}}}}function Fw(...e){return m.useCallback(Lw(...e),e)}class $w extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Xr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Xr(r)&&r.offsetWidth||0,s=Xr(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 Vw({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=w.useId(),a=w.useRef(null),c=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=w.useContext(Sa),d=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=Fw(a,d);return w.useInsertionEffect(()=>{const{width:p,height:v,top:g,left:y,right:x,bottom:b}=c.current;if(t||s===!1||!a.current||!p||!v)return;const C=n==="left"?`left: ${y}`:`right: ${x}`,S=r==="bottom"?`bottom: ${b}`:`top: ${g}`;a.current.dataset.motionPopId=i;const T=document.createElement("style");u&&(T.nonce=u);const E=o??document.head;return E.appendChild(T),T.sheet&&T.sheet.insertRule(`
2
2
  [data-motion-pop-id="${i}"] {
3
3
  position: absolute !important;
4
4
  width: ${p}px !important;
@@ -6,7 +6,7 @@
6
6
  ${C}px !important;
7
7
  ${S}px !important;
8
8
  }
9
- `),()=>{var R;(R=a.current)==null||R.removeAttribute("data-motion-pop-id"),E.contains(T)&&E.removeChild(T)}},[t]),l.jsx(Vw,{isPresent:t,childRef:a,sizeRef:c,pop:s,children:s===!1?e:m.cloneElement(e,{ref:f})})}const Bw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=Qi(Ww),f=w.useId();let h=!0,p=w.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:o,onExitComplete:v=>{d.set(v,!0);for(const g of d.values())if(!g)return;r&&r()},register:v=>(d.set(v,!1),()=>d.delete(v))}),[n,d,r]);return s&&h&&(p={...p}),w.useMemo(()=>{d.forEach((v,g)=>d.set(g,!1))},[n]),m.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=l.jsx($w,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:e}),l.jsx(jo.Provider,{value:p,children:e})};function Ww(){return new Map}function pf(e=!0){const t=w.useContext(jo);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const i=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const kr=e=>e.key||"";function Ll(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const mf=({children:e,custom:t,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]=pf(i),h=w.useMemo(()=>Ll(e),[e]),p=i&&!d?[]:h.map(kr),v=w.useRef(!0),g=w.useRef(h),y=Qi(()=>new Map),x=w.useRef(new Set),[b,C]=w.useState(h),[S,T]=w.useState(h);$u(()=>{v.current=!1,g.current=h;for(let P=0;P<S.length;P++){const M=kr(S[P]);p.includes(M)?(y.delete(M),x.current.delete(M)):y.get(M)!==!0&&y.set(M,!1)}},[S,p.length,p.join("-")]);const E=[];if(h!==b){let P=[...h];for(let M=0;M<S.length;M++){const A=S[M],j=kr(A);p.includes(j)||(P.splice(M,0,A),E.push(A))}return s==="wait"&&E.length&&(P=E),T(Ll(P)),C(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&S.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:R}=w.useContext(Zi);return l.jsx(l.Fragment,{children:S.map(P=>{const M=kr(P),A=i&&!d?!1:h===S||p.includes(M),j=()=>{if(x.current.has(M))return;if(y.has(M))x.current.add(M),y.set(M,!0);else return;let F=!0;y.forEach(G=>{G||(F=!1)}),F&&(R==null||R(),T(g.current),i&&(f==null||f()),r&&r())};return l.jsx(Bw,{isPresent:A,initial:!v.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:A?void 0:j,anchorX:a,anchorY:c,children:P},M)})})},gf=w.createContext({strict:!1}),Fl={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 Vl=!1;function Gw(){if(Vl)return;const e={};for(const t in Fl)e[t]={isEnabled:n=>Fl[t].some(r=>!!n[r])};Gd(e),Vl=!0}function yf(){return Gw(),Eb()}function Uw(e){const t=yf();for(const n in e)t[n]={...t[n],...e[n]};Gd(t)}const zw=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 go(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||zw.has(e)}let vf=e=>!go(e);function Hw(e){typeof e=="function"&&(vf=t=>t.startsWith("on")?!go(t):e(t))}try{Hw(require("@emotion/is-prop-valid").default)}catch{}function Kw(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||Ee(e[o])||(vf(o)||n===!0&&go(o)||!t&&!go(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Oo=w.createContext({});function Yw(e,t){if(Io(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qn(n)?n:void 0,animate:Qn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xw(e){const{initial:t,animate:n}=Yw(e,w.useContext(Oo));return w.useMemo(()=>({initial:t,animate:n}),[$l(t),$l(n)])}function $l(e){return Array.isArray(e)?e.join(" "):e}const Ta=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xf(e,t,n){for(const r in t)!Ee(t[r])&&!qd(r,n)&&(e[r]=t[r])}function qw({transformTemplate:e},t){return w.useMemo(()=>{const n=Ta();return wa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Zw(e,t){const n=e.style||{},r={};return xf(r,n,e),Object.assign(r,qw(e,t)),r}function Qw(e,t){const n={},r=Zw(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const bf=()=>({...Ta(),attrs:{}});function Jw(e,t,n,r){const o=w.useMemo(()=>{const s=bf();return Zd(s,t,Jd(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};xf(s,e.style,e),o.style={...s,...o.style}}return o}const e0=["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 Ra(e){return typeof e!="string"||e.includes("-")?!1:!!(e0.indexOf(e)>-1||/[A-Z]/u.test(e))}function t0(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??Ra(e)?Jw:Qw)(t,r,o,e),u=Kw(t,typeof e=="string",s),d=e!==w.Fragment?{...u,...c,ref:n}:{},{children:f}=t,h=w.useMemo(()=>Ee(f)?f.get():f,[f]);return w.createElement(e,{...d,children:h})}function n0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:r0(n,r,o,e),renderState:t()}}function r0(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=eo(s[h]);let{initial:i,animate:a}=e;const c=Io(e),u=Bd(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!ko(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const v=ha(e,h[p]);if(v){const{transitionEnd:g,transition:y,...x}=v;for(const b in x){let C=x[b];if(Array.isArray(C)){const S=d?C.length-1:0;C=C[S]}C!==null&&(o[b]=C)}for(const b in g)o[b]=g[b]}}}return o}const wf=e=>(t,n)=>{const r=w.useContext(Oo),o=w.useContext(jo),s=()=>n0(e,t,r,o);return n?s():Qi(s)},o0=wf({scrapeMotionValuesFromProps:Ca,createRenderState:Ta}),s0=wf({scrapeMotionValuesFromProps:ef,createRenderState:bf}),i0=Symbol.for("motionComponentSymbol");function a0(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const o=w.useRef(null);return w.useCallback(s=>{var a;s&&((a=e.onMount)==null||a.call(e,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);t&&(s?t.mount(s):t.unmount())},[t])}const Cf=w.createContext({});function gn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function c0(e,t,n,r,o,s){var C,S;const{visualElement:i}=w.useContext(Oo),a=w.useContext(gf),c=w.useContext(jo),u=w.useContext(Sa),d=u.reducedMotion,f=u.skipAnimations,h=w.useRef(null),p=w.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const v=h.current,g=w.useContext(Cf);v&&!v.projection&&o&&(v.type==="html"||v.type==="svg")&&l0(h.current,n,o,g);const y=w.useRef(!1);w.useInsertionEffect(()=>{v&&y.current&&v.update(n,c)});const x=n[Md],b=w.useRef(!!x&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,x))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,x)));return $u(()=>{p.current=!0,v&&(y.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),b.current&&v.animationState&&v.animationState.animateChanges())}),w.useEffect(()=>{v&&(!b.current&&v.animationState&&v.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,x)}),b.current=!1),v.enteringChildren=void 0)}),v}function l0(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Sf(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&gn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function Sf(e){if(e)return e.options.allowProjection!==!1?e.projection:Sf(e.parent)}function Ns(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&Uw(r);const s=n?n==="svg":Ra(e),i=s?s0:o0;function a(u,d){let f;const h={...w.useContext(Sa),...u,layoutId:u0(u)},{isStatic:p}=h,v=Xw(u),g=i(u,p);if(!p&&typeof window<"u"){d0(h,r);const y=f0(h);f=y.MeasureLayout,v.visualElement=c0(e,g,h,o,y.ProjectionNode,s)}return l.jsxs(Oo.Provider,{value:v,children:[f&&v.visualElement?l.jsx(f,{visualElement:v.visualElement,...h}):null,t0(e,u,a0(g,v.visualElement,d),g,p,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=w.forwardRef(a);return c[i0]=e,c}function u0({layoutId:e}){const t=w.useContext(Zi).id;return t&&e!==void 0?t+"-"+e:e}function d0(e,t){const n=w.useContext(gf).strict;if(process.env.NODE_ENV!=="production"&&t&&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.";e.ignoreStrict?Nn(!1,r,"lazy-strict-mode"):pt(!1,r,"lazy-strict-mode")}}function f0(e){const t=yf(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function h0(e,t){if(typeof Proxy>"u")return Ns;const n=new Map,r=(s,i)=>Ns(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&ta(!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,Ns(i,void 0,e,t)),n.get(i))})}const p0=(e,t)=>t.isSVG??Ra(e)?new Ub(t):new Fb(t,{allowProjection:e!==w.Fragment});class m0 extends jt{constructor(t){super(t),t.animationState||(t.animationState=Xb(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ko(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let g0=0;class y0 extends jt{constructor(){super(...arguments),this.id=g0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Zt(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",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const v0={animation:{Feature:m0},exit:{Feature:y0}};function cr(e){return{point:{x:e.pageX,y:e.pageY}}}const x0=e=>t=>ya(t)&&e(t,cr(t));function Xn(e,t,n,r){return Jn(e,t,x0(n),r)}const Tf=({current:e})=>e?e.ownerDocument.defaultView:null,Bl=(e,t)=>Math.abs(e-t);function b0(e,t){const n=Bl(e.x,t.x),r=Bl(e.y,t.y);return Math.sqrt(n**2+r**2)}const Wl=new Set(["auto","scroll"]);class Rf{constructor(t,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=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ir(this.lastRawMoveEventInfo,this.transformPagePoint));const p=js(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,g=b0(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!g)return;const{point:y}=p,{timestamp:x}=Pe;this.history.push({...y,timestamp:x});const{onStart:b,onMove:C}=this.handlers;v||(b&&b(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,p)},this.handlePointerMove=(p,v)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=Ir(v,this.transformPagePoint),ue.update(this.updatePoint,!0)},this.handlePointerUp=(p,v)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=js(p.type==="pointercancel"?this.lastMoveEventInfo:Ir(v,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,b),y&&y(p,b)},!ya(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=cr(t),u=Ir(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=Pe;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,js(u,this.history)),this.removeListeners=sr(Xn(this.contextWindow,"pointermove",this.handlePointerMove),Xn(this.contextWindow,"pointerup",this.handlePointerUp),Xn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Wl.has(r.overflowX)||Wl.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(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.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(t,o),ue.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Et(this.updatePoint)}}function Ir(e,t){return t?{point:t(e.point)}:e}function Gl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function js({point:e},t){return{point:e,delta:Gl(e,Pf(t)),offset:Gl(e,w0(t)),velocity:C0(t,.1)}}function w0(e){return e[0]}function Pf(e){return e[e.length-1]}function C0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Pf(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Fe(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>Fe(t)*2&&(r=e[1]);const s=ze(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 S0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?de(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?de(n,e,r.max):Math.min(e,n)),e}function Ul(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function T0(e,{top:t,left:n,bottom:r,right:o}){return{x:Ul(e.x,n,o),y:Ul(e.y,t,r)}}function zl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function R0(e,t){return{x:zl(e.x,t.x),y:zl(e.y,t.y)}}function P0(e,t){let n=.5;const r=_e(e),o=_e(t);return o>r?n=qn(t.min,t.max-r,e.min):r>o&&(n=qn(e.min,e.max-o,t.min)),dt(0,1,n)}function E0(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Si=.35;function M0(e=Si){return e===!1?e=0:e===!0&&(e=Si),{x:Hl(e,"left","right"),y:Hl(e,"top","bottom")}}function Hl(e,t,n){return{min:Kl(e,t),max:Kl(e,n)}}function Kl(e,t){return typeof e=="number"?e:e[t]||0}const A0=new WeakMap;class N0{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(cr(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:p,dragPropagation:v,onDragStart:g}=this.getProps();if(p&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rb(p),!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),ot(x=>{let b=this.getAxisMotionValue(x).get()||0;if(lt.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const S=C.layout.layoutBox[x];S&&(b=_e(S)*(parseFloat(b)/100))}}this.originPoint[x]=b}),g&&ue.update(()=>g(f,h),!1,!0),pi(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:v,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=h;if(v&&this.currentDirection===null){this.currentDirection=D0(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),y&&ue.update(()=>y(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 Rf(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Tf(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||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&&ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:o}=this.getProps();if(!r||!Or(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=S0(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,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;t&&gn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=T0(r.layoutBox,t):this.constraints=!1,this.elastic=M0(n),o!==this.constraints&&!gn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&ot(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=E0(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gn(t))return!1;const r=t.current;pt(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=Db(r,o.root,this.visualElement.getTransformPagePoint());let i=R0(o.layout.layoutBox,s);if(n){const a=n(Ab(i));this.hasMutatedConstraints=!!a,a&&(i=zd(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=ot(d=>{if(!Or(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,p=o?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pi(this.visualElement,t),r.start(fa(t,r,0,n,this.visualElement,!1))}stopAnimation(){ot(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ot(n=>{const{drag:r}=this.getProps();if(!Or(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(t[n]-de(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};ot(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=P0({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(),ot(i=>{if(!Or(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(de(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;A0.set(this.visualElement,this);const t=this.visualElement.current,n=Xn(t,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,p=h!==t&&lb(h);d&&f&&!p&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();gn(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=j0(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ue.read(o);const a=Jn(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(ot(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 t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Si,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Yl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function j0(e,t,n){const r=tl(e,Yl(n)),o=tl(t,Yl(n));return()=>{r(),o()}}function Or(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function D0(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class k0 extends jt{constructor(t){super(t),this.removeGroupControls=He,this.removeListeners=He,this.controls=new N0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||He}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ds=e=>(t,n)=>{e&&ue.update(()=>e(t,n),!1,!0)};class I0 extends jt{constructor(){super(...arguments),this.removePointerDownListener=He}onPointerDown(t){this.session=new Rf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Tf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ds(t),onStart:Ds(n),onMove:Ds(r),onEnd:(s,i)=>{delete this.session,o&&ue.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Xn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ks=!1;class O0 extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),ks&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),to.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),ks=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||ue.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ga.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;ks=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ef(e){const[t,n]=pf(),r=w.useContext(Zi);return l.jsx(O0,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(Cf),isPresent:t,safeToRemove:n})}const _0={pan:{Feature:I0},drag:{Feature:k0,ProjectionNode:hf,MeasureLayout:Ef}};function Xl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ue.postRender(()=>s(t,cr(t)))}class L0 extends jt{mount(){const{current:t}=this.node;t&&(this.unmount=sb(t,(n,r)=>(Xl(this.node,r,"Start"),o=>Xl(this.node,o,"End"))))}unmount(){}}class F0 extends jt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=sr(Jn(this.node.current,"focus",()=>this.onFocus()),Jn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ql(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&ue.postRender(()=>s(t,cr(t)))}class V0 extends jt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=db(t,(o,s)=>(ql(this.node,s,"Start"),(i,{success:a})=>ql(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Ti=new WeakMap,Is=new WeakMap,$0=e=>{const t=Ti.get(e.target);t&&t(e)},B0=e=>{e.forEach($0)};function W0({root:e,...t}){const n=e||document;Is.has(n)||Is.set(n,{});const r=Is.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(B0,{root:e,...t})),r[o]}function G0(e,t,n){const r=W0(t);return Ti.set(e,n),r.observe(e),()=>{Ti.delete(e),r.unobserve(e)}}const U0={some:0,all:1};class z0 extends jt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:U0[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(),p=d?f:h;p&&p(u)};this.stopObserver=G0(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(H0(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function H0({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const K0={inView:{Feature:z0},tap:{Feature:V0},focus:{Feature:F0},hover:{Feature:L0}},Y0={layout:{ProjectionNode:hf,MeasureLayout:Ef}},X0={...v0,...K0,..._0,...Y0},Mf=h0(X0,p0);function Af(){const[e,t]=w.useState([]),n=w.useRef(0),r=w.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++;t(h=>[...h,{id:f,x:u,y:d,size:c}])},[]),o=w.useCallback(s=>{t(i=>i.filter(a=>a.id!==s))},[]);return{ripples:e,add:r,remove:o}}function Nf({ripples:e,onDone:t}){return l.jsx(mf,{children:e.map(n=>l.jsx(Mf.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:()=>t(n.id)},n.id))})}const q0=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),er=w.forwardRef(function({variant:t="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:p,children:v,onClick:g,...y},x){const{ripples:b,add:C,remove:S}=Af(),T=d||i,E=F=>{T||(!u&&t!=="link"&&C(F),g==null||g(F))},{className:R,style:P,styleTag:M}=re(p,h,"btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",f),A=i?l.jsx(q0,{}):c==="start"?a:null,j=!i&&c==="end"?a:null;return l.jsxs("button",{ref:x,className:R,style:P,onClick:E,disabled:T,"aria-busy":i||void 0,...y,children:[M,l.jsxs("span",{className:"btn-content",children:[A,v,j]}),!u&&t!=="link"&&l.jsx(Nf,{ripples:b,onDone:S})]})}),Z0=w.forwardRef(function({orientation:t="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=K("btn-group",t==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return l.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),Q0=w.forwardRef(function({variant:t="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},p){const{ripples:v,add:g,remove:y}=Af(),x=S=>{f||(s||g(S),d==null||d(S))},b=a!=null,C=K("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",b&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(mf,{children:c&&l.jsxs(Mf.button,{ref:p,type:"button",className:C,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,b&&a]}),!s&&l.jsx(Nf,{ripples:v,onDone:y})]})})}),J0=w.forwardRef(function({icon:t,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(er,{ref:s,shape:n,variant:r,icon:t,...o})});function z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var Me=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},eC=m[" useInsertionEffect ".trim().toString()]||Me;function we({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=tC({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=m.useCallback(d=>{var f;if(a){const h=nC(d)?d(e):d;h!==e&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,e,s,i]);return[c,u]}function tC({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),s=m.useRef(t);return eC(()=>{s.current=t},[t]),m.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function nC(e){return typeof e=="function"}function Zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mt(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Zl(o,t);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():Zl(e[o],null)}}}}function se(...e){return m.useCallback(mt(...e),e)}function en(e){const t=rC(e),n=m.forwardRef((r,o)=>{const{children:s,...i}=r,a=m.Children.toArray(s),c=a.find(sC);if(c){const u=c.props.children,d=a.map(f=>f===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...i,ref:o,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function rC(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const i=aC(o),a=iC(s,o.props);return o.type!==m.Fragment&&(a.ref=r?mt(r,i):i),m.cloneElement(o,a)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jf=Symbol("radix.slottable");function oC(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=jf,t}function sC(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jf}function iC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[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{...e,...n}}function aC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=cC.reduce((e,t)=>{const n=en(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Df(e,t){e&&No.flushSync(()=>e.dispatchEvent(t))}var kf="Toggle",Pa=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=we({prop:n,onChange:o,defaultProp:r??!1,caller:kf});return l.jsx(Q.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:z(e.onClick,()=>{e.disabled||a(!i)})})});Pa.displayName=kf;var lC=Pa;const uC=w.forwardRef(function({variant:t="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},u){const d=K("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return l.jsx(lC,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});function dC(e,t){const n=m.createContext(t),r=s=>{const{children:i,...a}=s,c=m.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Te(e,t=[]){let n=[];function r(s,i){const a=m.createContext(i),c=n.length;n=[...n,i];const u=f=>{var x;const{scope:h,children:p,...v}=f,g=((x=h==null?void 0:h[e])==null?void 0:x[c])||a,y=m.useMemo(()=>v,Object.values(v));return l.jsx(g.Provider,{value:y,children:p})};u.displayName=s+"Provider";function d(f,h){var g;const p=((g=h==null?void 0:h[e])==null?void 0:g[c])||a,v=m.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>m.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,fC(o,...t)]}function fC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function lr(e){const t=e+"CollectionProvider",[n,r]=Te(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:x}=g,b=w.useRef(null),C=w.useRef(new Map).current;return l.jsx(o,{scope:y,itemMap:C,collectionRef:b,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=en(a),u=w.forwardRef((g,y)=>{const{scope:x,children:b}=g,C=s(a,x),S=se(y,C.collectionRef);return l.jsx(c,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=en(d),p=w.forwardRef((g,y)=>{const{scope:x,children:b,...C}=g,S=w.useRef(null),T=se(y,S),E=s(d,x);return w.useEffect(()=>(E.itemMap.set(S,{ref:S,...C}),()=>void E.itemMap.delete(S))),l.jsx(h,{[f]:"",ref:T,children:b})});p.displayName=d;function v(g){const y=s(e+"CollectionConsumer",g);return w.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const C=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((E,R)=>C.indexOf(E.ref.current)-C.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:p},v,r]}var hC=m[" useId ".trim().toString()]||(()=>{}),pC=0;function ge(e){const[t,n]=m.useState(hC());return Me(()=>{n(r=>r??String(pC++))},[e]),e||(t?`radix-${t}`:"")}function Qe(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var mC=m.createContext(void 0);function Dt(e){const t=m.useContext(mC);return e||t||"ltr"}var Os="rovingFocusGroup.onEntryFocus",gC={bubbles:!1,cancelable:!0},ur="RovingFocusGroup",[Ri,If,yC]=lr(ur),[vC,kt]=Te(ur,[yC]),[xC,bC]=vC(ur),Of=m.forwardRef((e,t)=>l.jsx(Ri.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ri.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(wC,{...e,ref:t})})}));Of.displayName=ur;var wC=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=m.useRef(null),p=se(t,h),v=Dt(s),[g,y]=we({prop:i,defaultProp:a??null,onChange:c,caller:ur}),[x,b]=m.useState(!1),C=Qe(u),S=If(n),T=m.useRef(!1),[E,R]=m.useState(0);return m.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Os,C),()=>P.removeEventListener(Os,C)},[C]),l.jsx(xC,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:m.useCallback(P=>y(P),[y]),onItemShiftTab:m.useCallback(()=>b(!0),[]),onFocusableItemAdd:m.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:m.useCallback(()=>R(P=>P-1),[]),children:l.jsx(Q.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{T.current=!0}),onFocus:z(e.onFocus,P=>{const M=!T.current;if(P.target===P.currentTarget&&M&&!x){const A=new CustomEvent(Os,gC);if(P.currentTarget.dispatchEvent(A),!A.defaultPrevented){const j=S().filter(O=>O.focusable),F=j.find(O=>O.active),G=j.find(O=>O.id===g),J=[F,G,...j].filter(Boolean).map(O=>O.ref.current);Ff(J,d)}}T.current=!1}),onBlur:z(e.onBlur,()=>b(!1))})})}),_f="RovingFocusGroupItem",Lf=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=ge(),u=s||c,d=bC(_f,n),f=d.currentTabStopId===u,h=If(n),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:g}=d;return m.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),l.jsx(Ri.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Q.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:z(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=TC(y,d.orientation,d.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=h().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const S=C.indexOf(y.currentTarget);C=d.loop?RC(C,S+1):C.slice(S+1)}setTimeout(()=>Ff(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});Lf.displayName=_f;var CC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TC(e,t,n){const r=SC(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return CC[r]}function Ff(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _o=Of,Lo=Lf,It="ToggleGroup",[Vf]=Te(It,[kt]),$f=kt(),Ea=w.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return l.jsx(PC,{...o,ref:t})}if(n==="multiple"){const o=r;return l.jsx(EC,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${It}\``)});Ea.displayName=It;var[Bf,Wf]=Vf(It),PC=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=we({prop:n,defaultProp:r??"",onChange:o,caller:It});return l.jsx(Bf,{scope:e.__scopeToggleGroup,type:"single",value:w.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:w.useCallback(()=>a(""),[a]),children:l.jsx(Gf,{...s,ref:t})})}),EC=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=we({prop:n,defaultProp:r??[],onChange:o,caller:It}),c=w.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=w.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(Bf,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:u,children:l.jsx(Gf,{...s,ref:t})})});Ea.displayName=It;var[MC,AC]=Vf(It),Gf=w.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,u=$f(n),d=Dt(i),f={role:"group",dir:d,...c};return l.jsx(MC,{scope:n,rovingFocus:o,disabled:r,children:o?l.jsx(_o,{asChild:!0,...u,orientation:s,dir:d,loop:a,children:l.jsx(Q.div,{...f,ref:t})}):l.jsx(Q.div,{...f,ref:t})})}),yo="ToggleGroupItem",Uf=w.forwardRef((e,t)=>{const n=Wf(yo,e.__scopeToggleGroup),r=AC(yo,e.__scopeToggleGroup),o=$f(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,a={...e,pressed:s,disabled:i},c=w.useRef(null);return r.rovingFocus?l.jsx(Lo,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:l.jsx(Ql,{...a,ref:t})}):l.jsx(Ql,{...a,ref:t})});Uf.displayName=yo;var Ql=w.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=Wf(yo,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return l.jsx(Pa,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),NC=Ea,jC=Uf;const zf=w.createContext({variant:"outline",color:"primary"}),DC=w.forwardRef(function({variant:t="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},u){const d=K("btn-group",o==="spaced"&&"spaced",s&&"round",i);return l.jsx(zf.Provider,{value:{variant:t,color:n,size:r},children:l.jsx(NC,{ref:u,className:d,...c,children:a})})}),kC=w.forwardRef(function({icon:t,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=w.useContext(zf),d=K("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(jC,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[t,o]})})});/**
9
+ `),()=>{var R;(R=a.current)==null||R.removeAttribute("data-motion-pop-id"),E.contains(T)&&E.removeChild(T)}},[t]),l.jsx($w,{isPresent:t,childRef:a,sizeRef:c,pop:s,children:s===!1?e:m.cloneElement(e,{ref:f})})}const Bw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=Qi(Ww),f=w.useId();let h=!0,p=w.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:o,onExitComplete:v=>{d.set(v,!0);for(const g of d.values())if(!g)return;r&&r()},register:v=>(d.set(v,!1),()=>d.delete(v))}),[n,d,r]);return s&&h&&(p={...p}),w.useMemo(()=>{d.forEach((v,g)=>d.set(g,!1))},[n]),m.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=l.jsx(Vw,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:e}),l.jsx(jo.Provider,{value:p,children:e})};function Ww(){return new Map}function pf(e=!0){const t=w.useContext(jo);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const i=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const kr=e=>e.key||"";function Ll(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const mf=({children:e,custom:t,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]=pf(i),h=w.useMemo(()=>Ll(e),[e]),p=i&&!d?[]:h.map(kr),v=w.useRef(!0),g=w.useRef(h),y=Qi(()=>new Map),x=w.useRef(new Set),[b,C]=w.useState(h),[S,T]=w.useState(h);Vu(()=>{v.current=!1,g.current=h;for(let P=0;P<S.length;P++){const M=kr(S[P]);p.includes(M)?(y.delete(M),x.current.delete(M)):y.get(M)!==!0&&y.set(M,!1)}},[S,p.length,p.join("-")]);const E=[];if(h!==b){let P=[...h];for(let M=0;M<S.length;M++){const A=S[M],j=kr(A);p.includes(j)||(P.splice(M,0,A),E.push(A))}return s==="wait"&&E.length&&(P=E),T(Ll(P)),C(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&S.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:R}=w.useContext(Zi);return l.jsx(l.Fragment,{children:S.map(P=>{const M=kr(P),A=i&&!d?!1:h===S||p.includes(M),j=()=>{if(x.current.has(M))return;if(y.has(M))x.current.add(M),y.set(M,!0);else return;let F=!0;y.forEach(W=>{W||(F=!1)}),F&&(R==null||R(),T(g.current),i&&(f==null||f()),r&&r())};return l.jsx(Bw,{isPresent:A,initial:!v.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:A?void 0:j,anchorX:a,anchorY:c,children:P},M)})})},gf=w.createContext({strict:!1}),Fl={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 $l=!1;function Gw(){if($l)return;const e={};for(const t in Fl)e[t]={isEnabled:n=>Fl[t].some(r=>!!n[r])};Gd(e),$l=!0}function yf(){return Gw(),Eb()}function Uw(e){const t=yf();for(const n in e)t[n]={...t[n],...e[n]};Gd(t)}const zw=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 go(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||zw.has(e)}let vf=e=>!go(e);function Hw(e){typeof e=="function"&&(vf=t=>t.startsWith("on")?!go(t):e(t))}try{Hw(require("@emotion/is-prop-valid").default)}catch{}function Kw(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||Ee(e[o])||(vf(o)||n===!0&&go(o)||!t&&!go(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Oo=w.createContext({});function Yw(e,t){if(Io(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qn(n)?n:void 0,animate:Qn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xw(e){const{initial:t,animate:n}=Yw(e,w.useContext(Oo));return w.useMemo(()=>({initial:t,animate:n}),[Vl(t),Vl(n)])}function Vl(e){return Array.isArray(e)?e.join(" "):e}const Ta=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xf(e,t,n){for(const r in t)!Ee(t[r])&&!qd(r,n)&&(e[r]=t[r])}function qw({transformTemplate:e},t){return w.useMemo(()=>{const n=Ta();return wa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Zw(e,t){const n=e.style||{},r={};return xf(r,n,e),Object.assign(r,qw(e,t)),r}function Qw(e,t){const n={},r=Zw(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const bf=()=>({...Ta(),attrs:{}});function Jw(e,t,n,r){const o=w.useMemo(()=>{const s=bf();return Zd(s,t,Jd(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};xf(s,e.style,e),o.style={...s,...o.style}}return o}const e0=["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 Ra(e){return typeof e!="string"||e.includes("-")?!1:!!(e0.indexOf(e)>-1||/[A-Z]/u.test(e))}function t0(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??Ra(e)?Jw:Qw)(t,r,o,e),u=Kw(t,typeof e=="string",s),d=e!==w.Fragment?{...u,...c,ref:n}:{},{children:f}=t,h=w.useMemo(()=>Ee(f)?f.get():f,[f]);return w.createElement(e,{...d,children:h})}function n0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:r0(n,r,o,e),renderState:t()}}function r0(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=eo(s[h]);let{initial:i,animate:a}=e;const c=Io(e),u=Bd(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!ko(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const v=ha(e,h[p]);if(v){const{transitionEnd:g,transition:y,...x}=v;for(const b in x){let C=x[b];if(Array.isArray(C)){const S=d?C.length-1:0;C=C[S]}C!==null&&(o[b]=C)}for(const b in g)o[b]=g[b]}}}return o}const wf=e=>(t,n)=>{const r=w.useContext(Oo),o=w.useContext(jo),s=()=>n0(e,t,r,o);return n?s():Qi(s)},o0=wf({scrapeMotionValuesFromProps:Ca,createRenderState:Ta}),s0=wf({scrapeMotionValuesFromProps:ef,createRenderState:bf}),i0=Symbol.for("motionComponentSymbol");function a0(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const o=w.useRef(null);return w.useCallback(s=>{var a;s&&((a=e.onMount)==null||a.call(e,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);t&&(s?t.mount(s):t.unmount())},[t])}const Cf=w.createContext({});function gn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function c0(e,t,n,r,o,s){var C,S;const{visualElement:i}=w.useContext(Oo),a=w.useContext(gf),c=w.useContext(jo),u=w.useContext(Sa),d=u.reducedMotion,f=u.skipAnimations,h=w.useRef(null),p=w.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const v=h.current,g=w.useContext(Cf);v&&!v.projection&&o&&(v.type==="html"||v.type==="svg")&&l0(h.current,n,o,g);const y=w.useRef(!1);w.useInsertionEffect(()=>{v&&y.current&&v.update(n,c)});const x=n[Md],b=w.useRef(!!x&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,x))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,x)));return Vu(()=>{p.current=!0,v&&(y.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),b.current&&v.animationState&&v.animationState.animateChanges())}),w.useEffect(()=>{v&&(!b.current&&v.animationState&&v.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,x)}),b.current=!1),v.enteringChildren=void 0)}),v}function l0(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Sf(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&gn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function Sf(e){if(e)return e.options.allowProjection!==!1?e.projection:Sf(e.parent)}function Ns(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&Uw(r);const s=n?n==="svg":Ra(e),i=s?s0:o0;function a(u,d){let f;const h={...w.useContext(Sa),...u,layoutId:u0(u)},{isStatic:p}=h,v=Xw(u),g=i(u,p);if(!p&&typeof window<"u"){d0(h,r);const y=f0(h);f=y.MeasureLayout,v.visualElement=c0(e,g,h,o,y.ProjectionNode,s)}return l.jsxs(Oo.Provider,{value:v,children:[f&&v.visualElement?l.jsx(f,{visualElement:v.visualElement,...h}):null,t0(e,u,a0(g,v.visualElement,d),g,p,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=w.forwardRef(a);return c[i0]=e,c}function u0({layoutId:e}){const t=w.useContext(Zi).id;return t&&e!==void 0?t+"-"+e:e}function d0(e,t){const n=w.useContext(gf).strict;if(process.env.NODE_ENV!=="production"&&t&&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.";e.ignoreStrict?Nn(!1,r,"lazy-strict-mode"):pt(!1,r,"lazy-strict-mode")}}function f0(e){const t=yf(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function h0(e,t){if(typeof Proxy>"u")return Ns;const n=new Map,r=(s,i)=>Ns(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&ta(!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,Ns(i,void 0,e,t)),n.get(i))})}const p0=(e,t)=>t.isSVG??Ra(e)?new Ub(t):new Fb(t,{allowProjection:e!==w.Fragment});class m0 extends jt{constructor(t){super(t),t.animationState||(t.animationState=Xb(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ko(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let g0=0;class y0 extends jt{constructor(){super(...arguments),this.id=g0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Zt(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",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const v0={animation:{Feature:m0},exit:{Feature:y0}};function cr(e){return{point:{x:e.pageX,y:e.pageY}}}const x0=e=>t=>ya(t)&&e(t,cr(t));function Xn(e,t,n,r){return Jn(e,t,x0(n),r)}const Tf=({current:e})=>e?e.ownerDocument.defaultView:null,Bl=(e,t)=>Math.abs(e-t);function b0(e,t){const n=Bl(e.x,t.x),r=Bl(e.y,t.y);return Math.sqrt(n**2+r**2)}const Wl=new Set(["auto","scroll"]);class Rf{constructor(t,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=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ir(this.lastRawMoveEventInfo,this.transformPagePoint));const p=js(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,g=b0(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!g)return;const{point:y}=p,{timestamp:x}=Pe;this.history.push({...y,timestamp:x});const{onStart:b,onMove:C}=this.handlers;v||(b&&b(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,p)},this.handlePointerMove=(p,v)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=Ir(v,this.transformPagePoint),ue.update(this.updatePoint,!0)},this.handlePointerUp=(p,v)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=js(p.type==="pointercancel"?this.lastMoveEventInfo:Ir(v,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,b),y&&y(p,b)},!ya(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=cr(t),u=Ir(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=Pe;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,js(u,this.history)),this.removeListeners=sr(Xn(this.contextWindow,"pointermove",this.handlePointerMove),Xn(this.contextWindow,"pointerup",this.handlePointerUp),Xn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Wl.has(r.overflowX)||Wl.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(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.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(t,o),ue.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Et(this.updatePoint)}}function Ir(e,t){return t?{point:t(e.point)}:e}function Gl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function js({point:e},t){return{point:e,delta:Gl(e,Pf(t)),offset:Gl(e,w0(t)),velocity:C0(t,.1)}}function w0(e){return e[0]}function Pf(e){return e[e.length-1]}function C0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Pf(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Fe(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>Fe(t)*2&&(r=e[1]);const s=ze(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 S0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?de(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?de(n,e,r.max):Math.min(e,n)),e}function Ul(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function T0(e,{top:t,left:n,bottom:r,right:o}){return{x:Ul(e.x,n,o),y:Ul(e.y,t,r)}}function zl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function R0(e,t){return{x:zl(e.x,t.x),y:zl(e.y,t.y)}}function P0(e,t){let n=.5;const r=_e(e),o=_e(t);return o>r?n=qn(t.min,t.max-r,e.min):r>o&&(n=qn(e.min,e.max-o,t.min)),dt(0,1,n)}function E0(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Si=.35;function M0(e=Si){return e===!1?e=0:e===!0&&(e=Si),{x:Hl(e,"left","right"),y:Hl(e,"top","bottom")}}function Hl(e,t,n){return{min:Kl(e,t),max:Kl(e,n)}}function Kl(e,t){return typeof e=="number"?e:e[t]||0}const A0=new WeakMap;class N0{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(cr(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:p,dragPropagation:v,onDragStart:g}=this.getProps();if(p&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rb(p),!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),ot(x=>{let b=this.getAxisMotionValue(x).get()||0;if(lt.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const S=C.layout.layoutBox[x];S&&(b=_e(S)*(parseFloat(b)/100))}}this.originPoint[x]=b}),g&&ue.update(()=>g(f,h),!1,!0),pi(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:v,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=h;if(v&&this.currentDirection===null){this.currentDirection=D0(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),y&&ue.update(()=>y(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 Rf(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Tf(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||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&&ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:o}=this.getProps();if(!r||!Or(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=S0(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,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;t&&gn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=T0(r.layoutBox,t):this.constraints=!1,this.elastic=M0(n),o!==this.constraints&&!gn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&ot(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=E0(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gn(t))return!1;const r=t.current;pt(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=Db(r,o.root,this.visualElement.getTransformPagePoint());let i=R0(o.layout.layoutBox,s);if(n){const a=n(Ab(i));this.hasMutatedConstraints=!!a,a&&(i=zd(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=ot(d=>{if(!Or(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,p=o?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pi(this.visualElement,t),r.start(fa(t,r,0,n,this.visualElement,!1))}stopAnimation(){ot(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ot(n=>{const{drag:r}=this.getProps();if(!Or(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(t[n]-de(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};ot(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=P0({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(),ot(i=>{if(!Or(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(de(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;A0.set(this.visualElement,this);const t=this.visualElement.current,n=Xn(t,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,p=h!==t&&lb(h);d&&f&&!p&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();gn(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=j0(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ue.read(o);const a=Jn(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(ot(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 t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Si,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Yl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function j0(e,t,n){const r=tl(e,Yl(n)),o=tl(t,Yl(n));return()=>{r(),o()}}function Or(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function D0(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class k0 extends jt{constructor(t){super(t),this.removeGroupControls=He,this.removeListeners=He,this.controls=new N0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||He}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ds=e=>(t,n)=>{e&&ue.update(()=>e(t,n),!1,!0)};class I0 extends jt{constructor(){super(...arguments),this.removePointerDownListener=He}onPointerDown(t){this.session=new Rf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Tf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ds(t),onStart:Ds(n),onMove:Ds(r),onEnd:(s,i)=>{delete this.session,o&&ue.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Xn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ks=!1;class O0 extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),ks&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),to.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),ks=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||ue.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ga.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;ks=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ef(e){const[t,n]=pf(),r=w.useContext(Zi);return l.jsx(O0,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(Cf),isPresent:t,safeToRemove:n})}const _0={pan:{Feature:I0},drag:{Feature:k0,ProjectionNode:hf,MeasureLayout:Ef}};function Xl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ue.postRender(()=>s(t,cr(t)))}class L0 extends jt{mount(){const{current:t}=this.node;t&&(this.unmount=sb(t,(n,r)=>(Xl(this.node,r,"Start"),o=>Xl(this.node,o,"End"))))}unmount(){}}class F0 extends jt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=sr(Jn(this.node.current,"focus",()=>this.onFocus()),Jn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ql(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&ue.postRender(()=>s(t,cr(t)))}class $0 extends jt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=db(t,(o,s)=>(ql(this.node,s,"Start"),(i,{success:a})=>ql(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Ti=new WeakMap,Is=new WeakMap,V0=e=>{const t=Ti.get(e.target);t&&t(e)},B0=e=>{e.forEach(V0)};function W0({root:e,...t}){const n=e||document;Is.has(n)||Is.set(n,{});const r=Is.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(B0,{root:e,...t})),r[o]}function G0(e,t,n){const r=W0(t);return Ti.set(e,n),r.observe(e),()=>{Ti.delete(e),r.unobserve(e)}}const U0={some:0,all:1};class z0 extends jt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:U0[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(),p=d?f:h;p&&p(u)};this.stopObserver=G0(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(H0(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function H0({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const K0={inView:{Feature:z0},tap:{Feature:$0},focus:{Feature:F0},hover:{Feature:L0}},Y0={layout:{ProjectionNode:hf,MeasureLayout:Ef}},X0={...v0,...K0,..._0,...Y0},Mf=h0(X0,p0);function Af(){const[e,t]=w.useState([]),n=w.useRef(0),r=w.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++;t(h=>[...h,{id:f,x:u,y:d,size:c}])},[]),o=w.useCallback(s=>{t(i=>i.filter(a=>a.id!==s))},[]);return{ripples:e,add:r,remove:o}}function Nf({ripples:e,onDone:t}){return l.jsx(mf,{children:e.map(n=>l.jsx(Mf.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:()=>t(n.id)},n.id))})}const q0=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),er=w.forwardRef(function({variant:t="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:p,children:v,onClick:g,...y},x){const{ripples:b,add:C,remove:S}=Af(),T=d||i,E=F=>{T||(!u&&t!=="link"&&C(F),g==null||g(F))},{className:R,style:P,styleTag:M}=re(p,h,"btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",f),A=i?l.jsx(q0,{}):c==="start"?a:null,j=!i&&c==="end"?a:null;return l.jsxs("button",{ref:x,className:R,style:P,onClick:E,disabled:T,"aria-busy":i||void 0,...y,children:[M,l.jsxs("span",{className:"btn-content",children:[A,v,j]}),!u&&t!=="link"&&l.jsx(Nf,{ripples:b,onDone:S})]})}),Z0=w.forwardRef(function({orientation:t="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=Y("btn-group",t==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return l.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),Q0=w.forwardRef(function({variant:t="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},p){const{ripples:v,add:g,remove:y}=Af(),x=S=>{f||(s||g(S),d==null||d(S))},b=a!=null,C=Y("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",b&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(mf,{children:c&&l.jsxs(Mf.button,{ref:p,type:"button",className:C,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,b&&a]}),!s&&l.jsx(Nf,{ripples:v,onDone:y})]})})}),J0=w.forwardRef(function({icon:t,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(er,{ref:s,shape:n,variant:r,icon:t,...o})});function z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var Me=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},eC=m[" useInsertionEffect ".trim().toString()]||Me;function we({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=tC({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=m.useCallback(d=>{var f;if(a){const h=nC(d)?d(e):d;h!==e&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,e,s,i]);return[c,u]}function tC({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),s=m.useRef(t);return eC(()=>{s.current=t},[t]),m.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function nC(e){return typeof e=="function"}function Zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mt(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Zl(o,t);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():Zl(e[o],null)}}}}function se(...e){return m.useCallback(mt(...e),e)}function en(e){const t=rC(e),n=m.forwardRef((r,o)=>{const{children:s,...i}=r,a=m.Children.toArray(s),c=a.find(sC);if(c){const u=c.props.children,d=a.map(f=>f===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...i,ref:o,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function rC(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const i=aC(o),a=iC(s,o.props);return o.type!==m.Fragment&&(a.ref=r?mt(r,i):i),m.cloneElement(o,a)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jf=Symbol("radix.slottable");function oC(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=jf,t}function sC(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jf}function iC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[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{...e,...n}}function aC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=cC.reduce((e,t)=>{const n=en(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Df(e,t){e&&No.flushSync(()=>e.dispatchEvent(t))}var kf="Toggle",Pa=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=we({prop:n,onChange:o,defaultProp:r??!1,caller:kf});return l.jsx(Q.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:z(e.onClick,()=>{e.disabled||a(!i)})})});Pa.displayName=kf;var lC=Pa;const uC=w.forwardRef(function({variant:t="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},u){const d=Y("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return l.jsx(lC,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});function dC(e,t){const n=m.createContext(t),r=s=>{const{children:i,...a}=s,c=m.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Te(e,t=[]){let n=[];function r(s,i){const a=m.createContext(i),c=n.length;n=[...n,i];const u=f=>{var x;const{scope:h,children:p,...v}=f,g=((x=h==null?void 0:h[e])==null?void 0:x[c])||a,y=m.useMemo(()=>v,Object.values(v));return l.jsx(g.Provider,{value:y,children:p})};u.displayName=s+"Provider";function d(f,h){var g;const p=((g=h==null?void 0:h[e])==null?void 0:g[c])||a,v=m.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>m.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,fC(o,...t)]}function fC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function lr(e){const t=e+"CollectionProvider",[n,r]=Te(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:x}=g,b=w.useRef(null),C=w.useRef(new Map).current;return l.jsx(o,{scope:y,itemMap:C,collectionRef:b,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=en(a),u=w.forwardRef((g,y)=>{const{scope:x,children:b}=g,C=s(a,x),S=se(y,C.collectionRef);return l.jsx(c,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=en(d),p=w.forwardRef((g,y)=>{const{scope:x,children:b,...C}=g,S=w.useRef(null),T=se(y,S),E=s(d,x);return w.useEffect(()=>(E.itemMap.set(S,{ref:S,...C}),()=>void E.itemMap.delete(S))),l.jsx(h,{[f]:"",ref:T,children:b})});p.displayName=d;function v(g){const y=s(e+"CollectionConsumer",g);return w.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const C=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((E,R)=>C.indexOf(E.ref.current)-C.indexOf(R.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:p},v,r]}var hC=m[" useId ".trim().toString()]||(()=>{}),pC=0;function ge(e){const[t,n]=m.useState(hC());return Me(()=>{n(r=>r??String(pC++))},[e]),e||(t?`radix-${t}`:"")}function Qe(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var mC=m.createContext(void 0);function Dt(e){const t=m.useContext(mC);return e||t||"ltr"}var Os="rovingFocusGroup.onEntryFocus",gC={bubbles:!1,cancelable:!0},ur="RovingFocusGroup",[Ri,If,yC]=lr(ur),[vC,kt]=Te(ur,[yC]),[xC,bC]=vC(ur),Of=m.forwardRef((e,t)=>l.jsx(Ri.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ri.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(wC,{...e,ref:t})})}));Of.displayName=ur;var wC=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=m.useRef(null),p=se(t,h),v=Dt(s),[g,y]=we({prop:i,defaultProp:a??null,onChange:c,caller:ur}),[x,b]=m.useState(!1),C=Qe(u),S=If(n),T=m.useRef(!1),[E,R]=m.useState(0);return m.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Os,C),()=>P.removeEventListener(Os,C)},[C]),l.jsx(xC,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:g,onItemFocus:m.useCallback(P=>y(P),[y]),onItemShiftTab:m.useCallback(()=>b(!0),[]),onFocusableItemAdd:m.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:m.useCallback(()=>R(P=>P-1),[]),children:l.jsx(Q.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{T.current=!0}),onFocus:z(e.onFocus,P=>{const M=!T.current;if(P.target===P.currentTarget&&M&&!x){const A=new CustomEvent(Os,gC);if(P.currentTarget.dispatchEvent(A),!A.defaultPrevented){const j=S().filter(O=>O.focusable),F=j.find(O=>O.active),W=j.find(O=>O.id===g),ee=[F,W,...j].filter(Boolean).map(O=>O.ref.current);Ff(ee,d)}}T.current=!1}),onBlur:z(e.onBlur,()=>b(!1))})})}),_f="RovingFocusGroupItem",Lf=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=ge(),u=s||c,d=bC(_f,n),f=d.currentTabStopId===u,h=If(n),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:g}=d;return m.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),l.jsx(Ri.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Q.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:z(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=TC(y,d.orientation,d.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=h().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const S=C.indexOf(y.currentTarget);C=d.loop?RC(C,S+1):C.slice(S+1)}setTimeout(()=>Ff(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});Lf.displayName=_f;var CC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TC(e,t,n){const r=SC(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return CC[r]}function Ff(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _o=Of,Lo=Lf,It="ToggleGroup",[$f]=Te(It,[kt]),Vf=kt(),Ea=w.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return l.jsx(PC,{...o,ref:t})}if(n==="multiple"){const o=r;return l.jsx(EC,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${It}\``)});Ea.displayName=It;var[Bf,Wf]=$f(It),PC=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=we({prop:n,defaultProp:r??"",onChange:o,caller:It});return l.jsx(Bf,{scope:e.__scopeToggleGroup,type:"single",value:w.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:w.useCallback(()=>a(""),[a]),children:l.jsx(Gf,{...s,ref:t})})}),EC=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=we({prop:n,defaultProp:r??[],onChange:o,caller:It}),c=w.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=w.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(Bf,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:u,children:l.jsx(Gf,{...s,ref:t})})});Ea.displayName=It;var[MC,AC]=$f(It),Gf=w.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,u=Vf(n),d=Dt(i),f={role:"group",dir:d,...c};return l.jsx(MC,{scope:n,rovingFocus:o,disabled:r,children:o?l.jsx(_o,{asChild:!0,...u,orientation:s,dir:d,loop:a,children:l.jsx(Q.div,{...f,ref:t})}):l.jsx(Q.div,{...f,ref:t})})}),yo="ToggleGroupItem",Uf=w.forwardRef((e,t)=>{const n=Wf(yo,e.__scopeToggleGroup),r=AC(yo,e.__scopeToggleGroup),o=Vf(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,a={...e,pressed:s,disabled:i},c=w.useRef(null);return r.rovingFocus?l.jsx(Lo,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:l.jsx(Ql,{...a,ref:t})}):l.jsx(Ql,{...a,ref:t})});Uf.displayName=yo;var Ql=w.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=Wf(yo,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return l.jsx(Pa,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),NC=Ea,jC=Uf;const zf=w.createContext({variant:"outline",color:"primary"}),DC=w.forwardRef(function({variant:t="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},u){const d=Y("btn-group",o==="spaced"&&"spaced",s&&"round",i);return l.jsx(zf.Provider,{value:{variant:t,color:n,size:r},children:l.jsx(NC,{ref:u,className:d,...c,children:a})})}),kC=w.forwardRef(function({icon:t,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=w.useContext(zf),d=Y("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(jC,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[t,o]})})});/**
10
10
  * @license lucide-react v1.8.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
@@ -36,17 +36,17 @@
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 _C=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},LC=w.createContext({}),FC=()=>w.useContext(LC),VC=w.forwardRef(({color:e,size:t,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:p=""}=FC()??{},v=r??f?Number(n??d)*24/Number(t??u):n??d;return w.createElement("svg",{ref:c,..._s,width:t??u??_s.width,height:t??u??_s.height,stroke:e??h,strokeWidth:v,className:Hf("lucide",p,o),...!s&&!_C(a)&&{"aria-hidden":"true"},...a},[...i.map(([g,y])=>w.createElement(g,y)),...Array.isArray(s)?s:[s]])});/**
39
+ */const _C=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},LC=w.createContext({}),FC=()=>w.useContext(LC),$C=w.forwardRef(({color:e,size:t,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:p=""}=FC()??{},v=r??f?Number(n??d)*24/Number(t??u):n??d;return w.createElement("svg",{ref:c,..._s,width:t??u??_s.width,height:t??u??_s.height,stroke:e??h,strokeWidth:v,className:Hf("lucide",p,o),...!s&&!_C(a)&&{"aria-hidden":"true"},...a},[...i.map(([g,y])=>w.createElement(g,y)),...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 he=(e,t)=>{const n=w.forwardRef(({className:r,...o},s)=>w.createElement(VC,{ref:s,iconNode:t,className:Hf(`lucide-${IC(Jl(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Jl(e),n};/**
44
+ */const he=(e,t)=>{const n=w.forwardRef(({className:r,...o},s)=>w.createElement($C,{ref:s,iconNode:t,className:Hf(`lucide-${IC(Jl(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Jl(e),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 $C=[["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"}]],BC=he("calendar",$C);/**
49
+ */const VC=[["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"}]],BC=he("calendar",VC);/**
50
50
  * @license lucide-react v1.8.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
@@ -161,8 +161,8 @@
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 TS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ot=he("x",TS),RS=w.forwardRef(function({color:t="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,type:c="text",disabled:u,className:d,style:f,sx:h,value:p,defaultValue:v,onChange:g,...y},x){const b=p!==void 0,[C,S]=w.useState(v!=null?String(v):""),T=b?String(p??""):C,E=w.useRef(null);w.useImperativeHandle(x,()=>E.current,[]);const[R,P]=w.useState(!1),M=a&&R&&c==="password"?"text":c,A=s&&!u&&T!=="",j=A||a,F=r!=null||o!=null||j,G=N=>{b||S(N.target.value),g==null||g(N)},H=N=>{var V;N.preventDefault(),b||S("");const I=E.current;if(I){const Y=(V=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:V.set;Y==null||Y.call(I,""),I.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},J=re(F?void 0:h,F?void 0:f,"input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,d),O=l.jsx("input",{ref:E,type:M,className:J.className,style:J.style,disabled:u,value:b?p:void 0,defaultValue:b?void 0:v,onChange:G,...y});if(!F)return l.jsxs(l.Fragment,{children:[J.styleTag,O]});const $=re(h,f,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!j&&"has-suffix",j&&"has-action");return l.jsxs("span",{className:$.className,style:$.style,children:[$.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),O,o!=null&&!j&&l.jsx("span",{className:"cny-input-suffix",children:o}),A&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:H,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Ot,{size:14,"aria-hidden":"true"})}),a&&c==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>P(N=>!N),"aria-label":R?"Hide password":"Show password","aria-pressed":R,style:A?{right:36}:void 0,children:R?l.jsx(aS,{size:14,"aria-hidden":"true"}):l.jsx(lS,{size:14,"aria-hidden":"true"})})]})}),PS=w.forwardRef(function({color:t="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"card",t!=="default"&&t,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),ES={info:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"M12 11v5"}),l.jsx("path",{d:"M12 8h.01"})]}),success:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"m8.5 12.5 2.5 2.5 4.5-5"})]}),warning:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),l.jsx("path",{d:"M12 9v4"}),l.jsx("path",{d:"M12 17h.01"})]}),danger:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"m9 9 6 6"}),l.jsx("path",{d:"m15 9-6 6"})]})};function MS({color:e}){return l.jsx("svg",{className:"alert-icon-glyph",viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:ES[e]})}const AS=w.forwardRef(function({color:t="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},p){const v=c!==!1,g=c&&c!==!0?c:l.jsx(MS,{color:t}),{className:y,style:x,styleTag:b}=re(i,s,"alert",t,n&&"solid",o),C=t==="danger"?"alert":"status";return l.jsxs("div",{ref:p,role:C,className:y,style:x,...h,children:[b,v&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:g}),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.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]})})]})}),NS=w.forwardRef(function({size:t="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:p}=re(a,i,"avatar",t!=="md"&&t,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[p,r?l.jsx("img",{src:r,alt:o??""}):c]})}),jS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:K("avatar-stack",t),...r,children:n})}),DS=w.forwardRef(function({value:t=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,t)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:p}=re(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:[p,l.jsx("span",{className:"progress-bar"})]})}),kS=w.forwardRef(function({value:t,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,t)),d={...s??{},"--value":u},{className:f,style:h,styleTag:p}=re(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:[p,r&&l.jsxs("span",{children:[u,"%"]})]})}),IS={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},Zf=w.forwardRef(function({variant:t="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 p={...IS[r],maxHeight:o,maxWidth:s,...c??{}},{className:v,style:g,styleTag:y}=re(u,p,i?"cny-scroll-region":"cny-scroll",t!=="default"&&t,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:v,style:g,...f,children:[y,d]})}),OS=w.forwardRef(function(t,n){return l.jsx(Zf,{ref:n,region:!0,...t})}),Pi=w.forwardRef(function({shape:t="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=re(i,{...s??{},width:n,height:r},"skeleton",t,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),_S=w.forwardRef(function({solid:t=!1,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"cny-navbar",t&&"solid",n);return l.jsxs("header",{ref:a,className:c,style:u,...i,children:[d,s]})}),LS=w.forwardRef(function({mark:t=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:K("cny-navbar-brand",n),...o,children:[t&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),FS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("nav",{ref:o,className:K("cny-navbar-nav",t),...r,children:n})}),VS=w.forwardRef(function({active:t=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":t?"page":void 0,className:K("cny-navbar-item",t&&"active",n),...o,children:r})}),$S=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:K("cny-navbar-actions",t),...r,children:n})}),BS=w.forwardRef(function({width:t="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:p}=re(a,i,"cny-sidebar",t!=="default"&&t,n&&"sticky",r&&"collapsed",o&&"responsive",s);return l.jsxs("aside",{ref:d,className:f,style:h,...u,children:[p,c]})}),WS=w.forwardRef(function({title:t,className:n,children:r,...o},s){return l.jsxs("div",{ref:s,className:K("cny-sidebar-section",n),...o,children:[t&&l.jsx("div",{className:"cny-sidebar-title",children:t}),l.jsx("nav",{className:"cny-sidebar-nav",children:r})]})}),GS=w.forwardRef(function({active:t=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){return l.jsxs("a",{ref:c,"aria-current":t?"page":void 0,"aria-disabled":n||void 0,className:K("cny-sidebar-item",t&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function US(e){const t=[];return e.display&&t.push(e.display),e.direction==="row"?t.push("flex-row"):e.direction==="column"?t.push("flex-col"):e.direction==="row-reverse"?t.push("flex-row-reverse"):e.direction==="column-reverse"&&t.push("flex-col-reverse"),e.align&&t.push(`items-${e.align==="start"||e.align==="end",e.align}`),e.justify&&t.push(`justify-${e.justify}`),e.wrap&&t.push("flex-wrap"),e.p!==void 0&&t.push(`p-${e.p}`),e.px!==void 0&&t.push(`px-${e.px}`),e.py!==void 0&&t.push(`py-${e.py}`),e.pt!==void 0&&t.push(`pt-${e.pt}`),e.pr!==void 0&&t.push(`pr-${e.pr}`),e.pb!==void 0&&t.push(`pb-${e.pb}`),e.pl!==void 0&&t.push(`pl-${e.pl}`),e.m!==void 0&&t.push(`m-${e.m}`),e.mx!==void 0&&t.push(`mx-${e.mx}`),e.my!==void 0&&t.push(`my-${e.my}`),e.mt!==void 0&&t.push(`mt-${e.mt}`),e.mr!==void 0&&t.push(`mr-${e.mr}`),e.mb!==void 0&&t.push(`mb-${e.mb}`),e.ml!==void 0&&t.push(`ml-${e.ml}`),e.gap!==void 0&&t.push(`gap-${e.gap}`),e.gapX!==void 0&&t.push(`gap-x-${e.gapX}`),e.gapY!==void 0&&t.push(`gap-y-${e.gapY}`),e.w&&t.push(`w-${e.w}`),e.h&&t.push(`h-${e.h}`),e.grow&&t.push("flex-1"),t}const cn=w.forwardRef(function({as:t,className:n,style:r,children:o,...s},i){const a=t??"div",{layoutProps:c,domProps:u}=zS(s),{sx:d,...f}=c,h=d?qi(d):void 0,p=K(...US(f),h==null?void 0:h.className,n),v=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,g=w.createElement(a,{ref:i,className:p||void 0,style:v,...u},o);return h!=null&&h.css?w.createElement(w.Fragment,null,w.createElement("style",{dangerouslySetInnerHTML:{__html:h.css}}),g):g});function zS(e){const t=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(e))t.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const HS=w.forwardRef(function(t,n){return l.jsx(cn,{ref:n,display:"flex",direction:"column",...t})}),KS=w.forwardRef(function(t,n){const{align:r="center",...o}=t;return l.jsx(cn,{ref:n,display:"flex",direction:"row",align:r,...o})}),eu=e=>e.map(t=>`minmax(0,${t}fr)`).join(" "),YS=w.forwardRef(function({cols:t,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=eu(r);else{const f={};for(const[h,p]of Object.entries(r))p&&(f[h]=eu(p));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(cn,{ref:c,display:"grid",className:K(!u&&t&&`grid-cols-${t}`,s),sx:d,...a})}),XS=w.forwardRef(function({size:t="lg",className:n,...r},o){return l.jsx(cn,{ref:o,className:K("cny-container",t,n),...r})}),qS=w.forwardRef(function({orientation:t="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=re(o,r,"cny-divider",t,n);return t==="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})]})}),ZS=w.forwardRef(function({className:t,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=re(r,n,"cny-spacer",t);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),QS=w.forwardRef(function({ratio:t=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,{aspectRatio:String(t),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),JS=w.forwardRef(function(t,n){return l.jsx(cn,{ref:n,display:"flex",align:"center",justify:"center",...t})}),eT=w.forwardRef(function(t,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=t;return l.jsx(cn,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),tT={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"},nT=w.forwardRef(function({as:t,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const p=t??tT[n],{className:v,style:g,styleTag:y}=re(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return w.createElement(p,{ref:h,className:v,style:g,...f},y,d)});function rT({label:e,hint:t,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const p=w.useId(),v=w.Children.only(f),g=v.props.id??p,y=n!=null&&n!==!1,x=a??(y?"danger":"default"),b=t||n?`${g}-hint`:void 0,C=w.cloneElement(v,{id:g,"aria-invalid":y||v.props["aria-invalid"]||void 0,"aria-describedby":b??v.props["aria-describedby"],className:K(v.props.className,x!=="default"&&x)}),S=i!=null&&s!=null&&s>i?"danger":"default",{className:T,style:E,styleTag:R}=re(d,u,"cny-field",c);return l.jsxs("div",{className:T,style:E,...h,children:[R,(e!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[e!=null?l.jsxs("label",{htmlFor:g,className:"cny-field-label",children:[e,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:K("cny-field-counter",S==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),C,(n||t)&&l.jsx("span",{id:b,className:K("cny-field-hint",x!=="default"&&x),children:n??t})]})}const oT=w.forwardRef(function({color:t="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=w.useRef(null);w.useImperativeHandle(d,()=>f.current,[]);const h=w.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const C=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,C)}px`,x.style.overflowY=x.scrollHeight>C?"auto":"hidden"},[r,o]);w.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const p=x=>{c==null||c(x),r&&h()},{className:v,style:g,styleTag:y}=re(a,i,"input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[y,l.jsx("textarea",{ref:f,className:v,style:g,onChange:p,...u})]})});function vo(e,[t,n]){return Math.min(n,Math.max(t,e))}function sT(e,t=globalThis==null?void 0:globalThis.document){const n=Qe(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var iT="DismissableLayer",Ei="dismissableLayer.update",aT="dismissableLayer.pointerDownOutside",cT="dismissableLayer.focusOutside",tu,Qf=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),In=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=m.useContext(Qf),[d,f]=m.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),v=se(t,R=>f(R)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),b=d?g.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,T=dT(R=>{const P=R.target,M=[...u.branches].some(A=>A.contains(P));!S||M||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},h),E=fT(R=>{const P=R.target;[...u.branches].some(A=>A.contains(P))||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},h);return sT(R=>{b===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(tu=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),nu(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=tu)}},[d,h,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),nu())},[d,u]),m.useEffect(()=>{const R=()=>p({});return document.addEventListener(Ei,R),()=>document.removeEventListener(Ei,R)},[]),l.jsx(Q.div,{...c,ref:v,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:z(e.onFocusCapture,E.onFocusCapture),onBlurCapture:z(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,T.onPointerDownCapture)})});In.displayName=iT;var lT="DismissableLayerBranch",uT=m.forwardRef((e,t)=>{const n=m.useContext(Qf),r=m.useRef(null),o=se(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Q.div,{...e,ref:o})});uT.displayName=lT;function dT(e,t=globalThis==null?void 0:globalThis.document){const n=Qe(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Jf(aT,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fT(e,t=globalThis==null?void 0:globalThis.document){const n=Qe(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&Jf(cT,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nu(){const e=new CustomEvent(Ei);document.dispatchEvent(e)}function Jf(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Df(o,s):o.dispatchEvent(s)}var Ls=0;function Fo(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ru()),document.body.insertAdjacentElement("beforeend",e[1]??ru()),Ls++,()=>{Ls===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ls--}},[])}function ru(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Fs="focusScope.autoFocusOnMount",Vs="focusScope.autoFocusOnUnmount",ou={bubbles:!1,cancelable:!0},hT="FocusScope",fr=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=m.useState(null),u=Qe(o),d=Qe(s),f=m.useRef(null),h=se(t,g=>c(g)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let g=function(C){if(p.paused||!a)return;const S=C.target;a.contains(S)?f.current=S:St(f.current,{select:!0})},y=function(C){if(p.paused||!a)return;const S=C.relatedTarget;S!==null&&(a.contains(S)||St(f.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&St(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){iu.add(p);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Fs,ou);a.addEventListener(Fs,u),a.dispatchEvent(x),x.defaultPrevented||(pT(xT(eh(a)),{select:!0}),document.activeElement===g&&St(a))}return()=>{a.removeEventListener(Fs,u),setTimeout(()=>{const x=new CustomEvent(Vs,ou);a.addEventListener(Vs,d),a.dispatchEvent(x),x.defaultPrevented||St(g??document.body,{select:!0}),a.removeEventListener(Vs,d),iu.remove(p)},0)}}},[a,u,d,p]);const v=m.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const b=g.currentTarget,[C,S]=mT(b);C&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&St(C,{select:!0})):g.shiftKey&&x===C&&(g.preventDefault(),n&&St(S,{select:!0})):x===b&&g.preventDefault()}},[n,r,p.paused]);return l.jsx(Q.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});fr.displayName=hT;function pT(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(St(r,{select:t}),document.activeElement!==n)return}function mT(e){const t=eh(e),n=su(t,e),r=su(t.reverse(),e);return[n,r]}function eh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function su(e,t){for(const n of e)if(!gT(n,{upTo:t}))return n}function gT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yT(e){return e instanceof HTMLInputElement&&"select"in e}function St(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yT(e)&&t&&e.select()}}var iu=vT();function vT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=au(e,t),e.unshift(t)},remove(t){var n;e=au(e,t),(n=e[0])==null||n.resume()}}}function au(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xT(e){return e.filter(t=>t.tagName!=="A")}const bT=["top","right","bottom","left"],Mt=Math.min,Ge=Math.max,xo=Math.round,_r=Math.floor,ut=e=>({x:e,y:e}),wT={left:"right",right:"left",bottom:"top",top:"bottom"};function Mi(e,t,n){return Ge(e,Mt(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function yt(e){return e.split("-")[0]}function On(e){return e.split("-")[1]}function Ma(e){return e==="x"?"y":"x"}function Aa(e){return e==="y"?"height":"width"}function ct(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Na(e){return Ma(ct(e))}function CT(e,t,n){n===void 0&&(n=!1);const r=On(e),o=Na(e),s=Aa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=bo(i)),[i,bo(i)]}function ST(e){const t=bo(e);return[Ai(e),t,Ai(t)]}function Ai(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const cu=["left","right"],lu=["right","left"],TT=["top","bottom"],RT=["bottom","top"];function PT(e,t,n){switch(e){case"top":case"bottom":return n?t?lu:cu:t?cu:lu;case"left":case"right":return t?TT:RT;default:return[]}}function ET(e,t,n,r){const o=On(e);let s=PT(yt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ai)))),s}function bo(e){const t=yt(e);return wT[t]+e.slice(t.length)}function MT(e){return{top:0,right:0,bottom:0,left:0,...e}}function th(e){return typeof e!="number"?MT(e):{top:e,right:e,bottom:e,left:e}}function wo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function uu(e,t,n){let{reference:r,floating:o}=e;const s=ct(t),i=Na(t),a=Aa(i),c=yt(t),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 p;switch(c){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(On(t)){case"start":p[i]-=h*(n&&u?-1:1);break;case"end":p[i]+=h*(n&&u?-1:1);break}return p}async function AT(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=gt(t,e),v=th(p),y=a[h?f==="floating"?"reference":"floating":f],x=wo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},T=wo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:C,strategy:c}):b);return{top:(x.top-T.top+v.top)/S.y,bottom:(T.bottom-x.bottom+v.bottom)/S.y,left:(x.left-T.left+v.left)/S.x,right:(T.right-x.right+v.right)/S.x}}const NT=50,jT=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:AT},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=uu(u,r,c),h=r,p=0;const v={};for(let g=0;g<s.length;g++){const y=s[g];if(!y)continue;const{name:x,fn:b}=y,{x:C,y:S,data:T,reset:E}=await b({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:v,rects:u,platform:a,elements:{reference:e,floating:t}});d=C??d,f=S??f,v[x]={...v[x],...T},E&&p<NT&&(p++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:d,y:f}=uu(u,h,c)),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:v}},DT=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=gt(e,t)||{};if(u==null)return{};const f=th(d),h={x:n,y:r},p=Na(o),v=Aa(p),g=await i.getDimensions(u),y=p==="y",x=y?"top":"left",b=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=s.reference[v]+s.reference[p]-h[p]-s.floating[v],T=h[p]-s.reference[p],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=E?E[C]:0;(!R||!await(i.isElement==null?void 0:i.isElement(E)))&&(R=a.floating[C]||s.floating[v]);const P=S/2-T/2,M=R/2-g[v]/2-1,A=Mt(f[x],M),j=Mt(f[b],M),F=A,G=R-g[v]-j,H=R/2-g[v]/2+P,J=Mi(F,H,G),O=!c.arrow&&On(o)!=null&&H!==J&&s.reference[v]/2-(H<F?A:j)-g[v]/2<0,$=O?H<F?H-F:H-G:0;return{[p]:h[p]+$,data:{[p]:J,centerOffset:H-J-$,...O&&{alignmentOffset:$}},reset:O}}}),kT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...y}=gt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=yt(o),b=ct(a),C=yt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),T=h||(C||!g?[bo(a)]:ST(a)),E=v!=="none";!h&&E&&T.push(...ET(a,g,v,S));const R=[a,...T],P=await c.detectOverflow(t,y),M=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&M.push(P[x]),f){const H=CT(o,i,S);M.push(P[H[0]],P[H[1]])}if(A=[...A,{placement:o,overflows:M}],!M.every(H=>H<=0)){var j,F;const H=(((j=s.flip)==null?void 0:j.index)||0)+1,J=R[H];if(J&&(!(f==="alignment"?b!==ct(J):!1)||A.every(N=>ct(N.placement)===b?N.overflows[0]>0:!0)))return{data:{index:H,overflows:A},reset:{placement:J}};let O=(F=A.filter($=>$.overflows[0]<=0).sort(($,N)=>$.overflows[1]-N.overflows[1])[0])==null?void 0:F.placement;if(!O)switch(p){case"bestFit":{var G;const $=(G=A.filter(N=>{if(E){const I=ct(N.placement);return I===b||I==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(I=>I>0).reduce((I,V)=>I+V,0)]).sort((N,I)=>N[1]-I[1])[0])==null?void 0:G[0];$&&(O=$);break}case"initialPlacement":O=a;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function du(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fu(e){return bT.some(t=>e[t]>=0)}const IT=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=gt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=du(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:fu(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=du(i,n.floating);return{data:{escapedOffsets:a,escaped:fu(a)}}}default:return{}}}}},nh=new Set(["left","top"]);async function OT(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=yt(n),a=On(n),c=ct(n)==="y",u=nh.has(i)?-1:1,d=s&&c?-1:1,f=gt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const _T=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await OT(t,e);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}}}}},LT=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:b,y:C}=x;return{x:b,y:C}}},...u}=gt(e,t),d={x:n,y:r},f=await s.detectOverflow(t,u),h=ct(yt(o)),p=Ma(h);let v=d[p],g=d[h];if(i){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",C=v+f[x],S=v-f[b];v=Mi(C,v,S)}if(a){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",C=g+f[x],S=g-f[b];g=Mi(C,g,S)}const y=c.fn({...t,[p]:v,[h]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:i,[h]:a}}}}}},FT=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=gt(e,t),d={x:n,y:r},f=ct(o),h=Ma(f);let p=d[h],v=d[f];const g=gt(a,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=h==="y"?"height":"width",S=s.reference[h]-s.floating[C]+y.mainAxis,T=s.reference[h]+s.reference[C]-y.mainAxis;p<S?p=S:p>T&&(p=T)}if(u){var x,b;const C=h==="y"?"width":"height",S=nh.has(yt(o)),T=s.reference[f]-s.floating[C]+(S&&((x=i.offset)==null?void 0:x[f])||0)+(S?0:y.crossAxis),E=s.reference[f]+s.reference[C]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?y.crossAxis:0);v<T?v=T:v>E&&(v=E)}return{[h]:p,[f]:v}}}},VT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=gt(e,t),d=await i.detectOverflow(t,u),f=yt(o),h=On(o),p=ct(o)==="y",{width:v,height:g}=s.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,y=h==="end"?"top":"bottom");const b=g-d.top-d.bottom,C=v-d.left-d.right,S=Mt(g-d[y],b),T=Mt(v-d[x],C),E=!t.middlewareData.shift;let R=S,P=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=b),E&&!h){const A=Ge(d.left,0),j=Ge(d.right,0),F=Ge(d.top,0),G=Ge(d.bottom,0);p?P=v-2*(A!==0||j!==0?A+j:Ge(d.left,d.right)):R=g-2*(F!==0||G!==0?F+G:Ge(d.top,d.bottom))}await c({...t,availableWidth:P,availableHeight:R});const M=await i.getDimensions(a.floating);return v!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Vo(){return typeof window<"u"}function _n(e){return rh(e)?(e.nodeName||"").toLowerCase():"#document"}function Ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ft(e){var t;return(t=(rh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rh(e){return Vo()?e instanceof Node||e instanceof Ue(e).Node:!1}function Je(e){return Vo()?e instanceof Element||e instanceof Ue(e).Element:!1}function vt(e){return Vo()?e instanceof HTMLElement||e instanceof Ue(e).HTMLElement:!1}function hu(e){return!Vo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot}function hr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function $T(e){return/^(table|td|th)$/.test(_n(e))}function $o(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const BT=/transform|translate|scale|rotate|perspective|filter/,WT=/paint|layout|strict|content/,Ht=e=>!!e&&e!=="none";let $s;function ja(e){const t=Je(e)?et(e):e;return Ht(t.transform)||Ht(t.translate)||Ht(t.scale)||Ht(t.rotate)||Ht(t.perspective)||!Da()&&(Ht(t.backdropFilter)||Ht(t.filter))||BT.test(t.willChange||"")||WT.test(t.contain||"")}function GT(e){let t=At(e);for(;vt(t)&&!En(t);){if(ja(t))return t;if($o(t))return null;t=At(t)}return null}function Da(){return $s==null&&($s=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$s}function En(e){return/^(html|body|#document)$/.test(_n(e))}function et(e){return Ue(e).getComputedStyle(e)}function Bo(e){return Je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function At(e){if(_n(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hu(e)&&e.host||ft(e);return hu(t)?t.host:t}function oh(e){const t=At(e);return En(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&hr(t)?t:oh(t)}function tr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=oh(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ue(o);if(s){const a=Ni(i);return t.concat(i,i.visualViewport||[],hr(o)?o:[],a&&n?tr(a):[])}else return t.concat(o,tr(o,[],n))}function Ni(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sh(e){const t=et(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=xo(n)!==s||xo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ka(e){return Je(e)?e:e.contextElement}function Sn(e){const t=ka(e);if(!vt(t))return ut(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=sh(t);let i=(s?xo(n.width):n.width)/r,a=(s?xo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const UT=ut(0);function ih(e){const t=Ue(e);return!Da()||!t.visualViewport?UT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zT(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ue(e)?!1:t}function nn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ka(e);let i=ut(1);t&&(r?Je(r)&&(i=Sn(r)):i=Sn(e));const a=zT(s,n,r)?ih(s):ut(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=Ue(s),p=r&&Je(r)?Ue(r):r;let v=h,g=Ni(v);for(;g&&r&&p!==v;){const y=Sn(g),x=g.getBoundingClientRect(),b=et(g),C=x.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,S=x.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=C,u+=S,v=Ue(g),g=Ni(v)}}return wo({width:d,height:f,x:c,y:u})}function Wo(e,t){const n=Bo(e).scrollLeft;return t?t.left+n:nn(ft(e)).left+n}function ah(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function HT(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ft(r),a=t?$o(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ut(1);const d=ut(0),f=vt(r);if((f||!f&&!s)&&((_n(r)!=="body"||hr(i))&&(c=Bo(r)),f)){const p=nn(r);u=Sn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=i&&!f&&!s?ah(i,c):ut(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 KT(e){return Array.from(e.getClientRects())}function YT(e){const t=ft(e),n=Bo(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Wo(e);const a=-n.scrollTop;return et(r).direction==="rtl"&&(i+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const pu=25;function XT(e,t){const n=Ue(e),r=ft(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Da();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=Wo(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-p);v<=pu&&(s-=v)}else u<=pu&&(s+=u);return{width:s,height:i,x:a,y:c}}function qT(e,t){const n=nn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=vt(e)?Sn(e):ut(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function mu(e,t,n){let r;if(t==="viewport")r=XT(e,n);else if(t==="document")r=YT(ft(e));else if(Je(t))r=qT(t,n);else{const o=ih(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return wo(r)}function ch(e,t){const n=At(e);return n===t||!Je(n)||En(n)?!1:et(n).position==="fixed"||ch(n,t)}function ZT(e,t){const n=t.get(e);if(n)return n;let r=tr(e,[],!1).filter(a=>Je(a)&&_n(a)!=="body"),o=null;const s=et(e).position==="fixed";let i=s?At(e):e;for(;Je(i)&&!En(i);){const a=et(i),c=ja(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||hr(i)&&!c&&ch(e,i))?r=r.filter(d=>d!==i):o=a,i=At(i)}return t.set(e,r),r}function QT(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?$o(t)?[]:ZT(t,this._c):[].concat(n),r],a=mu(t,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 p=mu(t,i[h],o);c=Ge(p.top,c),u=Mt(p.right,u),d=Mt(p.bottom,d),f=Ge(p.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function JT(e){const{width:t,height:n}=sh(e);return{width:t,height:n}}function eR(e,t,n){const r=vt(t),o=ft(t),s=n==="fixed",i=nn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=ut(0);function u(){c.x=Wo(o)}if(r||!r&&!s)if((_n(t)!=="body"||hr(o))&&(a=Bo(t)),r){const p=nn(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?ah(o,a):ut(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 Bs(e){return et(e).position==="static"}function gu(e,t){if(!vt(e)||et(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ft(e)===n&&(n=n.ownerDocument.body),n}function lh(e,t){const n=Ue(e);if($o(e))return n;if(!vt(e)){let o=At(e);for(;o&&!En(o);){if(Je(o)&&!Bs(o))return o;o=At(o)}return n}let r=gu(e,t);for(;r&&$T(r)&&Bs(r);)r=gu(r,t);return r&&En(r)&&Bs(r)&&!ja(r)?n:r||GT(e)||n}const tR=async function(e){const t=this.getOffsetParent||lh,n=this.getDimensions,r=await n(e.floating);return{reference:eR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nR(e){return et(e).direction==="rtl"}const rR={convertOffsetParentRelativeRectToViewportRelativeRect:HT,getDocumentElement:ft,getClippingRect:QT,getOffsetParent:lh,getElementRects:tR,getClientRects:KT,getDimensions:JT,getScale:Sn,isElement:Je,isRTL:nR};function uh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oR(e,t){let n=null,r;const o=ft(e);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=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=u;if(a||t(),!h||!p)return;const v=_r(f),g=_r(o.clientWidth-(d+h)),y=_r(o.clientHeight-(f+p)),x=_r(d),C={rootMargin:-v+"px "+-g+"px "+-y+"px "+-x+"px",threshold:Ge(0,Mt(1,c))||1};let S=!0;function T(E){const R=E[0].intersectionRatio;if(R!==c){if(!S)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!uh(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,C)}n.observe(e)}return i(!0),s}function sR(e,t,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=ka(e),d=o||s?[...u?tr(u):[],...t?tr(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?oR(u,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),u&&!c&&p.observe(u),t&&p.observe(t));let v,g=c?nn(e):null;c&&y();function y(){const x=nn(e);g&&!uh(g,x)&&n(),g=x,v=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(v)}}const iR=_T,aR=LT,cR=kT,lR=VT,uR=IT,yu=DT,dR=FT,fR=(e,t,n)=>{const r=new Map,o={platform:rR,...n},s={...o.platform,_c:r};return jT(e,t,{...o,platform:s})};var hR=typeof document<"u",pR=function(){},ro=hR?w.useLayoutEffect:pR;function Co(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Co(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Co(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function dh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vu(e,t){const n=dh(e);return Math.round(t*n)/n}function Ws(e){const t=m.useRef(e);return ro(()=>{t.current=e}),t}function mR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);Co(h,r)||p(r);const[v,g]=m.useState(null),[y,x]=m.useState(null),b=m.useCallback(N=>{N!==E.current&&(E.current=N,g(N))},[]),C=m.useCallback(N=>{N!==R.current&&(R.current=N,x(N))},[]),S=s||v,T=i||y,E=m.useRef(null),R=m.useRef(null),P=m.useRef(d),M=c!=null,A=Ws(c),j=Ws(o),F=Ws(u),G=m.useCallback(()=>{if(!E.current||!R.current)return;const N={placement:t,strategy:n,middleware:h};j.current&&(N.platform=j.current),fR(E.current,R.current,N).then(I=>{const V={...I,isPositioned:F.current!==!1};H.current&&!Co(P.current,V)&&(P.current=V,No.flushSync(()=>{f(V)}))})},[h,t,n,j,F]);ro(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[u]);const H=m.useRef(!1);ro(()=>(H.current=!0,()=>{H.current=!1}),[]),ro(()=>{if(S&&(E.current=S),T&&(R.current=T),S&&T){if(A.current)return A.current(S,T,G);G()}},[S,T,G,A,M]);const J=m.useMemo(()=>({reference:E,floating:R,setReference:b,setFloating:C}),[b,C]),O=m.useMemo(()=>({reference:S,floating:T}),[S,T]),$=m.useMemo(()=>{const N={position:n,left:0,top:0};if(!O.floating)return N;const I=vu(O.floating,d.x),V=vu(O.floating,d.y);return a?{...N,transform:"translate("+I+"px, "+V+"px)",...dh(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:V}},[n,a,O.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:G,refs:J,elements:O,floatingStyles:$}),[d,G,J,O,$])}const gR=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yu({element:r.current,padding:o}).fn(n):{}:r?yu({element:r,padding:o}).fn(n):{}}}},yR=(e,t)=>{const n=iR(e);return{name:n.name,fn:n.fn,options:[e,t]}},vR=(e,t)=>{const n=aR(e);return{name:n.name,fn:n.fn,options:[e,t]}},xR=(e,t)=>({fn:dR(e).fn,options:[e,t]}),bR=(e,t)=>{const n=cR(e);return{name:n.name,fn:n.fn,options:[e,t]}},wR=(e,t)=>{const n=lR(e);return{name:n.name,fn:n.fn,options:[e,t]}},CR=(e,t)=>{const n=uR(e);return{name:n.name,fn:n.fn,options:[e,t]}},SR=(e,t)=>{const n=gR(e);return{name:n.name,fn:n.fn,options:[e,t]}};var TR="Arrow",fh=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Q.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});fh.displayName=TR;var RR=fh;function pr(e){const[t,n]=m.useState(void 0);return Me(()=>{if(e){n({width:e.offsetWidth,height:e.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=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ia="Popper",[hh,_t]=Te(Ia),[PR,ph]=hh(Ia),mh=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return l.jsx(PR,{scope:t,anchor:r,onAnchorChange:o,children:n})};mh.displayName=Ia;var gh="PopperAnchor",yh=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ph(gh,n),i=m.useRef(null),a=se(t,i),c=m.useRef(null);return m.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(Q.div,{...o,ref:a})});yh.displayName=gh;var Oa="PopperContent",[ER,MR]=hh(Oa),vh=m.forwardRef((e,t)=>{var L,ee,W,X,ae,ce;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...g}=e,y=ph(Oa,n),[x,b]=m.useState(null),C=se(t,Ce=>b(Ce)),[S,T]=m.useState(null),E=pr(S),R=(E==null?void 0:E.width)??0,P=(E==null?void 0:E.height)??0,M=r+(s!=="center"?"-"+s:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],F=j.length>0,G={padding:A,boundary:j.filter(NR),altBoundary:F},{refs:H,floatingStyles:J,placement:O,isPositioned:$,middlewareData:N}=mR({strategy:"fixed",placement:M,whileElementsMounted:(...Ce)=>sR(...Ce,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[yR({mainAxis:o+P,alignmentAxis:i}),c&&vR({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?xR():void 0,...G}),c&&bR({...G}),wR({...G,apply:({elements:Ce,rects:oe,availableWidth:ht,availableHeight:Bt})=>{const{width:Wt,height:Re}=oe.reference,Le=Ce.floating.style;Le.setProperty("--radix-popper-available-width",`${ht}px`),Le.setProperty("--radix-popper-available-height",`${Bt}px`),Le.setProperty("--radix-popper-anchor-width",`${Wt}px`),Le.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),S&&SR({element:S,padding:a}),jR({arrowWidth:R,arrowHeight:P}),h&&CR({strategy:"referenceHidden",...G})]}),[I,V]=wh(O),Y=Qe(v);Me(()=>{$&&(Y==null||Y())},[$,Y]);const k=(L=N.arrow)==null?void 0:L.x,Z=(ee=N.arrow)==null?void 0:ee.y,_=((W=N.arrow)==null?void 0:W.centerOffset)!==0,[U,B]=m.useState();return Me(()=>{x&&B(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:$?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[(X=N.transformOrigin)==null?void 0:X.x,(ae=N.transformOrigin)==null?void 0:ae.y].join(" "),...((ce=N.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(ER,{scope:n,placedSide:I,onArrowChange:T,arrowX:k,arrowY:Z,shouldHideArrow:_,children:l.jsx(Q.div,{"data-side":I,"data-align":V,...g,ref:C,style:{...g.style,animation:$?void 0:"none"}})})})});vh.displayName=Oa;var xh="PopperArrow",AR={top:"bottom",right:"left",bottom:"top",left:"right"},bh=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=MR(xh,r),i=AR[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(RR,{...o,ref:n,style:{...o.style,display:"block"}})})});bh.displayName=xh;function NR(e){return e!==null}var jR=e=>({name:"transformOrigin",options:e,fn(t){var y,x,b;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=wh(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,p=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?f:`${h}px`,g=`${-c}px`):u==="top"?(v=i?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?f:`${p}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?f:`${p}px`),{data:{x:v,y:g}}}});function wh(e){const[t,n="center"]=e.split("-");return[t,n]}var mr=mh,gr=yh,Go=vh,Uo=bh,DR="Portal",Ln=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=m.useState(!1);Me(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Ao.createPortal(l.jsx(Q.div,{...r,ref:t}),i):null});Ln.displayName=DR;function yr(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ch=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"}),kR="VisuallyHidden",_a=m.forwardRef((e,t)=>l.jsx(Q.span,{...e,ref:t,style:{...Ch,...e.style}}));_a.displayName=kR;var IR=_a,OR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hn=new WeakMap,Lr=new WeakMap,Fr={},Gs=0,Sh=function(e){return e&&(e.host||Sh(e.parentNode))},_R=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},LR=function(e,t,n,r){var o=_R(t,Array.isArray(e)?e:[e]);Fr[n]||(Fr[n]=new WeakMap);var s=Fr[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 p=h.getAttribute(r),v=p!==null&&p!=="false",g=(hn.get(h)||0)+1,y=(s.get(h)||0)+1;hn.set(h,g),s.set(h,y),i.push(h),g===1&&v&&Lr.set(h,!0),y===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),a.clear(),Gs++,function(){i.forEach(function(f){var h=hn.get(f)-1,p=s.get(f)-1;hn.set(f,h),s.set(f,p),h||(Lr.has(f)||f.removeAttribute(r),Lr.delete(f)),p||f.removeAttribute(n)}),Gs--,Gs||(hn=new WeakMap,hn=new WeakMap,Lr=new WeakMap,Fr={})}},zo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=OR(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),LR(r,o,n,"aria-hidden")):function(){return null}},at=function(){return at=Object.assign||function(t){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)&&(t[s]=n[s])}return t},at.apply(this,arguments)};function Th(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function FR(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var oo="right-scroll-bar-position",so="width-before-scroll-bar",VR="with-scroll-bars-hidden",$R="--removed-body-scroll-bar-size";function Us(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function BR(e,t){var n=w.useState(function(){return{value:e,callback:t,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=t,n.facade}var WR=typeof window<"u"?m.useLayoutEffect:m.useEffect,xu=new WeakMap;function GR(e,t){var n=BR(null,function(r){return e.forEach(function(o){return Us(o,r)})});return WR(function(){var r=xu.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Us(a,null)}),s.forEach(function(a){o.has(a)||Us(a,i)})}xu.set(n,e)},[e]),n}function UR(e){return e}function zR(e,t){t===void 0&&(t=UR);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]:e},useMedium:function(s){var i=t(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 HR(e){e===void 0&&(e={});var t=zR(null);return t.options=at({async:!0,ssr:!1},e),t}var Rh=function(e){var t=e.sideCar,n=Th(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,at({},n))};Rh.isSideCarExport=!0;function KR(e,t){return e.useMedium(t),Rh}var Ph=HR(),zs=function(){},Ho=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:zs,onWheelCapture:zs,onTouchMoveCapture:zs}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,v=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,C=e.gapMode,S=Th(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,E=GR([n,t]),R=at(at({},S),o);return m.createElement(m.Fragment,null,d&&m.createElement(T,{sideCar:Ph,removeScrollBar:u,shards:f,noRelative:p,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:C}),i?m.cloneElement(m.Children.only(a),at(at({},R),{ref:E})):m.createElement(b,at({},R,{className:c,ref:E}),a))});Ho.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ho.classNames={fullWidth:so,zeroRight:oo};var YR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=YR();return t&&e.setAttribute("nonce",t),e}function qR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ZR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XR())&&(qR(t,n),ZR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},JR=function(){var e=QR();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Eh=function(){var e=JR(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},eP={left:0,top:0,right:0,gap:0},Hs=function(e){return parseInt(e||"",10)||0},tP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Hs(n),Hs(r),Hs(o)]},nP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eP;var t=tP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rP=Eh(),Tn="data-scroll-locked",oP=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
165
- .`.concat(VR,` {
164
+ */const TS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ot=he("x",TS),RS=w.forwardRef(function({color:t="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,type:c="text",disabled:u,className:d,style:f,sx:h,value:p,defaultValue:v,onChange:g,...y},x){const b=p!==void 0,[C,S]=w.useState(v!=null?String(v):""),T=b?String(p??""):C,E=w.useRef(null);w.useImperativeHandle(x,()=>E.current,[]);const[R,P]=w.useState(!1),M=a&&R&&c==="password"?"text":c,A=s&&!u&&T!=="",j=A||a,F=r!=null||o!=null||j,W=N=>{b||S(N.target.value),g==null||g(N)},K=N=>{var $;N.preventDefault(),b||S("");const I=E.current;if(I){const X=($=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:$.set;X==null||X.call(I,""),I.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},ee=re(F?void 0:h,F?void 0:f,"input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,d),O=l.jsx("input",{ref:E,type:M,className:ee.className,style:ee.style,disabled:u,value:b?p:void 0,defaultValue:b?void 0:v,onChange:W,...y});if(!F)return l.jsxs(l.Fragment,{children:[ee.styleTag,O]});const V=re(h,f,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!j&&"has-suffix",j&&"has-action");return l.jsxs("span",{className:V.className,style:V.style,children:[V.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),O,o!=null&&!j&&l.jsx("span",{className:"cny-input-suffix",children:o}),A&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:K,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Ot,{size:14,"aria-hidden":"true"})}),a&&c==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>P(N=>!N),"aria-label":R?"Hide password":"Show password","aria-pressed":R,style:A?{right:36}:void 0,children:R?l.jsx(aS,{size:14,"aria-hidden":"true"}):l.jsx(lS,{size:14,"aria-hidden":"true"})})]})}),PS=w.forwardRef(function({color:t="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"card",t!=="default"&&t,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),ES={info:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"M12 11v5"}),l.jsx("path",{d:"M12 8h.01"})]}),success:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"m8.5 12.5 2.5 2.5 4.5-5"})]}),warning:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),l.jsx("path",{d:"M12 9v4"}),l.jsx("path",{d:"M12 17h.01"})]}),danger:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"m9 9 6 6"}),l.jsx("path",{d:"m15 9-6 6"})]})};function MS({color:e}){return l.jsx("svg",{className:"alert-icon-glyph",viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:ES[e]})}const AS=w.forwardRef(function({color:t="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},p){const v=c!==!1,g=c&&c!==!0?c:l.jsx(MS,{color:t}),{className:y,style:x,styleTag:b}=re(i,s,"alert",t,n&&"solid",o),C=t==="danger"?"alert":"status";return l.jsxs("div",{ref:p,role:C,className:y,style:x,...h,children:[b,v&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:g}),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.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]})})]})}),NS=w.forwardRef(function({size:t="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:p}=re(a,i,"avatar",t!=="md"&&t,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[p,r?l.jsx("img",{src:r,alt:o??""}):c]})}),jS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("avatar-stack",t),...r,children:n})}),DS=w.forwardRef(function({value:t=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,t)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:p}=re(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:[p,l.jsx("span",{className:"progress-bar"})]})}),kS=w.forwardRef(function({value:t,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,t)),d={...s??{},"--value":u},{className:f,style:h,styleTag:p}=re(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:[p,r&&l.jsxs("span",{children:[u,"%"]})]})}),IS={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},Zf=w.forwardRef(function({variant:t="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 p={...IS[r],maxHeight:o,maxWidth:s,...c??{}},{className:v,style:g,styleTag:y}=re(u,p,i?"cny-scroll-region":"cny-scroll",t!=="default"&&t,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:v,style:g,...f,children:[y,d]})}),OS=w.forwardRef(function(t,n){return l.jsx(Zf,{ref:n,region:!0,...t})}),Pi=w.forwardRef(function({shape:t="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=re(i,{...s??{},width:n,height:r},"skeleton",t,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),_S=w.forwardRef(function({solid:t=!1,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"cny-navbar",t&&"solid",n);return l.jsxs("header",{ref:a,className:c,style:u,...i,children:[d,s]})}),LS=w.forwardRef(function({mark:t=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:Y("cny-navbar-brand",n),...o,children:[t&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),FS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("nav",{ref:o,className:Y("cny-navbar-nav",t),...r,children:n})}),$S=w.forwardRef(function({active:t=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":t?"page":void 0,className:Y("cny-navbar-item",t&&"active",n),...o,children:r})}),VS=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("cny-navbar-actions",t),...r,children:n})}),BS=w.forwardRef(function({width:t="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:p}=re(a,i,"cny-sidebar",t!=="default"&&t,n&&"sticky",r&&"collapsed",o&&"responsive",s);return l.jsxs("aside",{ref:d,className:f,style:h,...u,children:[p,c]})}),WS=w.forwardRef(function({title:t,className:n,children:r,...o},s){return l.jsxs("div",{ref:s,className:Y("cny-sidebar-section",n),...o,children:[t&&l.jsx("div",{className:"cny-sidebar-title",children:t}),l.jsx("nav",{className:"cny-sidebar-nav",children:r})]})}),GS=w.forwardRef(function({active:t=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){return l.jsxs("a",{ref:c,"aria-current":t?"page":void 0,"aria-disabled":n||void 0,className:Y("cny-sidebar-item",t&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function US(e){const t=[];return e.display&&t.push(e.display),e.direction==="row"?t.push("flex-row"):e.direction==="column"?t.push("flex-col"):e.direction==="row-reverse"?t.push("flex-row-reverse"):e.direction==="column-reverse"&&t.push("flex-col-reverse"),e.align&&t.push(`items-${e.align==="start"||e.align==="end",e.align}`),e.justify&&t.push(`justify-${e.justify}`),e.wrap&&t.push("flex-wrap"),e.p!==void 0&&t.push(`p-${e.p}`),e.px!==void 0&&t.push(`px-${e.px}`),e.py!==void 0&&t.push(`py-${e.py}`),e.pt!==void 0&&t.push(`pt-${e.pt}`),e.pr!==void 0&&t.push(`pr-${e.pr}`),e.pb!==void 0&&t.push(`pb-${e.pb}`),e.pl!==void 0&&t.push(`pl-${e.pl}`),e.m!==void 0&&t.push(`m-${e.m}`),e.mx!==void 0&&t.push(`mx-${e.mx}`),e.my!==void 0&&t.push(`my-${e.my}`),e.mt!==void 0&&t.push(`mt-${e.mt}`),e.mr!==void 0&&t.push(`mr-${e.mr}`),e.mb!==void 0&&t.push(`mb-${e.mb}`),e.ml!==void 0&&t.push(`ml-${e.ml}`),e.gap!==void 0&&t.push(`gap-${e.gap}`),e.gapX!==void 0&&t.push(`gap-x-${e.gapX}`),e.gapY!==void 0&&t.push(`gap-y-${e.gapY}`),e.w&&t.push(`w-${e.w}`),e.h&&t.push(`h-${e.h}`),e.grow&&t.push("flex-1"),t}const cn=w.forwardRef(function({as:t,className:n,style:r,children:o,...s},i){const a=t??"div",{layoutProps:c,domProps:u}=zS(s),{sx:d,...f}=c,h=d?qi(d):void 0,p=Y(...US(f),h==null?void 0:h.className,n),v=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,g=w.createElement(a,{ref:i,className:p||void 0,style:v,...u},o);return h!=null&&h.css?w.createElement(w.Fragment,null,w.createElement("style",{dangerouslySetInnerHTML:{__html:h.css}}),g):g});function zS(e){const t=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(e))t.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const HS=w.forwardRef(function(t,n){return l.jsx(cn,{ref:n,display:"flex",direction:"column",...t})}),KS=w.forwardRef(function(t,n){const{align:r="center",...o}=t;return l.jsx(cn,{ref:n,display:"flex",direction:"row",align:r,...o})}),eu=e=>e.map(t=>`minmax(0,${t}fr)`).join(" "),YS=w.forwardRef(function({cols:t,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=eu(r);else{const f={};for(const[h,p]of Object.entries(r))p&&(f[h]=eu(p));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(cn,{ref:c,display:"grid",className:Y(!u&&t&&`grid-cols-${t}`,s),sx:d,...a})}),XS=w.forwardRef(function({size:t="lg",className:n,...r},o){return l.jsx(cn,{ref:o,className:Y("cny-container",t,n),...r})}),qS=w.forwardRef(function({orientation:t="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=re(o,r,"cny-divider",t,n);return t==="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})]})}),ZS=w.forwardRef(function({className:t,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=re(r,n,"cny-spacer",t);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),QS=w.forwardRef(function({ratio:t=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,{aspectRatio:String(t),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),JS=w.forwardRef(function(t,n){return l.jsx(cn,{ref:n,display:"flex",align:"center",justify:"center",...t})}),eT=w.forwardRef(function(t,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=t;return l.jsx(cn,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),tT={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"},nT=w.forwardRef(function({as:t,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const p=t??tT[n],{className:v,style:g,styleTag:y}=re(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return w.createElement(p,{ref:h,className:v,style:g,...f},y,d)});function rT({label:e,hint:t,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const p=w.useId(),v=w.Children.only(f),g=v.props.id??p,y=n!=null&&n!==!1,x=a??(y?"danger":"default"),b=t||n?`${g}-hint`:void 0,C=w.cloneElement(v,{id:g,"aria-invalid":y||v.props["aria-invalid"]||void 0,"aria-describedby":b??v.props["aria-describedby"],className:Y(v.props.className,x!=="default"&&x)}),S=i!=null&&s!=null&&s>i?"danger":"default",{className:T,style:E,styleTag:R}=re(d,u,"cny-field",c);return l.jsxs("div",{className:T,style:E,...h,children:[R,(e!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[e!=null?l.jsxs("label",{htmlFor:g,className:"cny-field-label",children:[e,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:Y("cny-field-counter",S==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),C,(n||t)&&l.jsx("span",{id:b,className:Y("cny-field-hint",x!=="default"&&x),children:n??t})]})}const oT=w.forwardRef(function({color:t="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=w.useRef(null);w.useImperativeHandle(d,()=>f.current,[]);const h=w.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const C=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,C)}px`,x.style.overflowY=x.scrollHeight>C?"auto":"hidden"},[r,o]);w.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const p=x=>{c==null||c(x),r&&h()},{className:v,style:g,styleTag:y}=re(a,i,"input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[y,l.jsx("textarea",{ref:f,className:v,style:g,onChange:p,...u})]})});function vo(e,[t,n]){return Math.min(n,Math.max(t,e))}function sT(e,t=globalThis==null?void 0:globalThis.document){const n=Qe(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var iT="DismissableLayer",Ei="dismissableLayer.update",aT="dismissableLayer.pointerDownOutside",cT="dismissableLayer.focusOutside",tu,Qf=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),In=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=m.useContext(Qf),[d,f]=m.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),v=se(t,R=>f(R)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),b=d?g.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,T=dT(R=>{const P=R.target,M=[...u.branches].some(A=>A.contains(P));!S||M||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},h),E=fT(R=>{const P=R.target;[...u.branches].some(A=>A.contains(P))||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},h);return sT(R=>{b===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(tu=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),nu(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=tu)}},[d,h,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),nu())},[d,u]),m.useEffect(()=>{const R=()=>p({});return document.addEventListener(Ei,R),()=>document.removeEventListener(Ei,R)},[]),l.jsx(Q.div,{...c,ref:v,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:z(e.onFocusCapture,E.onFocusCapture),onBlurCapture:z(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,T.onPointerDownCapture)})});In.displayName=iT;var lT="DismissableLayerBranch",uT=m.forwardRef((e,t)=>{const n=m.useContext(Qf),r=m.useRef(null),o=se(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Q.div,{...e,ref:o})});uT.displayName=lT;function dT(e,t=globalThis==null?void 0:globalThis.document){const n=Qe(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Jf(aT,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fT(e,t=globalThis==null?void 0:globalThis.document){const n=Qe(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&Jf(cT,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nu(){const e=new CustomEvent(Ei);document.dispatchEvent(e)}function Jf(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Df(o,s):o.dispatchEvent(s)}var Ls=0;function Fo(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ru()),document.body.insertAdjacentElement("beforeend",e[1]??ru()),Ls++,()=>{Ls===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ls--}},[])}function ru(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Fs="focusScope.autoFocusOnMount",$s="focusScope.autoFocusOnUnmount",ou={bubbles:!1,cancelable:!0},hT="FocusScope",fr=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=m.useState(null),u=Qe(o),d=Qe(s),f=m.useRef(null),h=se(t,g=>c(g)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let g=function(C){if(p.paused||!a)return;const S=C.target;a.contains(S)?f.current=S:St(f.current,{select:!0})},y=function(C){if(p.paused||!a)return;const S=C.relatedTarget;S!==null&&(a.contains(S)||St(f.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&St(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){iu.add(p);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Fs,ou);a.addEventListener(Fs,u),a.dispatchEvent(x),x.defaultPrevented||(pT(xT(eh(a)),{select:!0}),document.activeElement===g&&St(a))}return()=>{a.removeEventListener(Fs,u),setTimeout(()=>{const x=new CustomEvent($s,ou);a.addEventListener($s,d),a.dispatchEvent(x),x.defaultPrevented||St(g??document.body,{select:!0}),a.removeEventListener($s,d),iu.remove(p)},0)}}},[a,u,d,p]);const v=m.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const b=g.currentTarget,[C,S]=mT(b);C&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&St(C,{select:!0})):g.shiftKey&&x===C&&(g.preventDefault(),n&&St(S,{select:!0})):x===b&&g.preventDefault()}},[n,r,p.paused]);return l.jsx(Q.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});fr.displayName=hT;function pT(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(St(r,{select:t}),document.activeElement!==n)return}function mT(e){const t=eh(e),n=su(t,e),r=su(t.reverse(),e);return[n,r]}function eh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function su(e,t){for(const n of e)if(!gT(n,{upTo:t}))return n}function gT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yT(e){return e instanceof HTMLInputElement&&"select"in e}function St(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yT(e)&&t&&e.select()}}var iu=vT();function vT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=au(e,t),e.unshift(t)},remove(t){var n;e=au(e,t),(n=e[0])==null||n.resume()}}}function au(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xT(e){return e.filter(t=>t.tagName!=="A")}const bT=["top","right","bottom","left"],Mt=Math.min,Ge=Math.max,xo=Math.round,_r=Math.floor,ut=e=>({x:e,y:e}),wT={left:"right",right:"left",bottom:"top",top:"bottom"};function Mi(e,t,n){return Ge(e,Mt(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function yt(e){return e.split("-")[0]}function On(e){return e.split("-")[1]}function Ma(e){return e==="x"?"y":"x"}function Aa(e){return e==="y"?"height":"width"}function ct(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Na(e){return Ma(ct(e))}function CT(e,t,n){n===void 0&&(n=!1);const r=On(e),o=Na(e),s=Aa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=bo(i)),[i,bo(i)]}function ST(e){const t=bo(e);return[Ai(e),t,Ai(t)]}function Ai(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const cu=["left","right"],lu=["right","left"],TT=["top","bottom"],RT=["bottom","top"];function PT(e,t,n){switch(e){case"top":case"bottom":return n?t?lu:cu:t?cu:lu;case"left":case"right":return t?TT:RT;default:return[]}}function ET(e,t,n,r){const o=On(e);let s=PT(yt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ai)))),s}function bo(e){const t=yt(e);return wT[t]+e.slice(t.length)}function MT(e){return{top:0,right:0,bottom:0,left:0,...e}}function th(e){return typeof e!="number"?MT(e):{top:e,right:e,bottom:e,left:e}}function wo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function uu(e,t,n){let{reference:r,floating:o}=e;const s=ct(t),i=Na(t),a=Aa(i),c=yt(t),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 p;switch(c){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(On(t)){case"start":p[i]-=h*(n&&u?-1:1);break;case"end":p[i]+=h*(n&&u?-1:1);break}return p}async function AT(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=gt(t,e),v=th(p),y=a[h?f==="floating"?"reference":"floating":f],x=wo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},T=wo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:C,strategy:c}):b);return{top:(x.top-T.top+v.top)/S.y,bottom:(T.bottom-x.bottom+v.bottom)/S.y,left:(x.left-T.left+v.left)/S.x,right:(T.right-x.right+v.right)/S.x}}const NT=50,jT=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:AT},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=uu(u,r,c),h=r,p=0;const v={};for(let g=0;g<s.length;g++){const y=s[g];if(!y)continue;const{name:x,fn:b}=y,{x:C,y:S,data:T,reset:E}=await b({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:v,rects:u,platform:a,elements:{reference:e,floating:t}});d=C??d,f=S??f,v[x]={...v[x],...T},E&&p<NT&&(p++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:d,y:f}=uu(u,h,c)),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:v}},DT=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=gt(e,t)||{};if(u==null)return{};const f=th(d),h={x:n,y:r},p=Na(o),v=Aa(p),g=await i.getDimensions(u),y=p==="y",x=y?"top":"left",b=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=s.reference[v]+s.reference[p]-h[p]-s.floating[v],T=h[p]-s.reference[p],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=E?E[C]:0;(!R||!await(i.isElement==null?void 0:i.isElement(E)))&&(R=a.floating[C]||s.floating[v]);const P=S/2-T/2,M=R/2-g[v]/2-1,A=Mt(f[x],M),j=Mt(f[b],M),F=A,W=R-g[v]-j,K=R/2-g[v]/2+P,ee=Mi(F,K,W),O=!c.arrow&&On(o)!=null&&K!==ee&&s.reference[v]/2-(K<F?A:j)-g[v]/2<0,V=O?K<F?K-F:K-W:0;return{[p]:h[p]+V,data:{[p]:ee,centerOffset:K-ee-V,...O&&{alignmentOffset:V}},reset:O}}}),kT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...y}=gt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=yt(o),b=ct(a),C=yt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),T=h||(C||!g?[bo(a)]:ST(a)),E=v!=="none";!h&&E&&T.push(...ET(a,g,v,S));const R=[a,...T],P=await c.detectOverflow(t,y),M=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&M.push(P[x]),f){const K=CT(o,i,S);M.push(P[K[0]],P[K[1]])}if(A=[...A,{placement:o,overflows:M}],!M.every(K=>K<=0)){var j,F;const K=(((j=s.flip)==null?void 0:j.index)||0)+1,ee=R[K];if(ee&&(!(f==="alignment"?b!==ct(ee):!1)||A.every(N=>ct(N.placement)===b?N.overflows[0]>0:!0)))return{data:{index:K,overflows:A},reset:{placement:ee}};let O=(F=A.filter(V=>V.overflows[0]<=0).sort((V,N)=>V.overflows[1]-N.overflows[1])[0])==null?void 0:F.placement;if(!O)switch(p){case"bestFit":{var W;const V=(W=A.filter(N=>{if(E){const I=ct(N.placement);return I===b||I==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(I=>I>0).reduce((I,$)=>I+$,0)]).sort((N,I)=>N[1]-I[1])[0])==null?void 0:W[0];V&&(O=V);break}case"initialPlacement":O=a;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function du(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fu(e){return bT.some(t=>e[t]>=0)}const IT=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=gt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=du(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:fu(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=du(i,n.floating);return{data:{escapedOffsets:a,escaped:fu(a)}}}default:return{}}}}},nh=new Set(["left","top"]);async function OT(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=yt(n),a=On(n),c=ct(n)==="y",u=nh.has(i)?-1:1,d=s&&c?-1:1,f=gt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const _T=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await OT(t,e);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}}}}},LT=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:b,y:C}=x;return{x:b,y:C}}},...u}=gt(e,t),d={x:n,y:r},f=await s.detectOverflow(t,u),h=ct(yt(o)),p=Ma(h);let v=d[p],g=d[h];if(i){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",C=v+f[x],S=v-f[b];v=Mi(C,v,S)}if(a){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",C=g+f[x],S=g-f[b];g=Mi(C,g,S)}const y=c.fn({...t,[p]:v,[h]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:i,[h]:a}}}}}},FT=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=gt(e,t),d={x:n,y:r},f=ct(o),h=Ma(f);let p=d[h],v=d[f];const g=gt(a,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=h==="y"?"height":"width",S=s.reference[h]-s.floating[C]+y.mainAxis,T=s.reference[h]+s.reference[C]-y.mainAxis;p<S?p=S:p>T&&(p=T)}if(u){var x,b;const C=h==="y"?"width":"height",S=nh.has(yt(o)),T=s.reference[f]-s.floating[C]+(S&&((x=i.offset)==null?void 0:x[f])||0)+(S?0:y.crossAxis),E=s.reference[f]+s.reference[C]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?y.crossAxis:0);v<T?v=T:v>E&&(v=E)}return{[h]:p,[f]:v}}}},$T=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=gt(e,t),d=await i.detectOverflow(t,u),f=yt(o),h=On(o),p=ct(o)==="y",{width:v,height:g}=s.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,y=h==="end"?"top":"bottom");const b=g-d.top-d.bottom,C=v-d.left-d.right,S=Mt(g-d[y],b),T=Mt(v-d[x],C),E=!t.middlewareData.shift;let R=S,P=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=b),E&&!h){const A=Ge(d.left,0),j=Ge(d.right,0),F=Ge(d.top,0),W=Ge(d.bottom,0);p?P=v-2*(A!==0||j!==0?A+j:Ge(d.left,d.right)):R=g-2*(F!==0||W!==0?F+W:Ge(d.top,d.bottom))}await c({...t,availableWidth:P,availableHeight:R});const M=await i.getDimensions(a.floating);return v!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function $o(){return typeof window<"u"}function _n(e){return rh(e)?(e.nodeName||"").toLowerCase():"#document"}function Ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ft(e){var t;return(t=(rh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rh(e){return $o()?e instanceof Node||e instanceof Ue(e).Node:!1}function Je(e){return $o()?e instanceof Element||e instanceof Ue(e).Element:!1}function vt(e){return $o()?e instanceof HTMLElement||e instanceof Ue(e).HTMLElement:!1}function hu(e){return!$o()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot}function hr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function VT(e){return/^(table|td|th)$/.test(_n(e))}function Vo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const BT=/transform|translate|scale|rotate|perspective|filter/,WT=/paint|layout|strict|content/,Ht=e=>!!e&&e!=="none";let Vs;function ja(e){const t=Je(e)?et(e):e;return Ht(t.transform)||Ht(t.translate)||Ht(t.scale)||Ht(t.rotate)||Ht(t.perspective)||!Da()&&(Ht(t.backdropFilter)||Ht(t.filter))||BT.test(t.willChange||"")||WT.test(t.contain||"")}function GT(e){let t=At(e);for(;vt(t)&&!En(t);){if(ja(t))return t;if(Vo(t))return null;t=At(t)}return null}function Da(){return Vs==null&&(Vs=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Vs}function En(e){return/^(html|body|#document)$/.test(_n(e))}function et(e){return Ue(e).getComputedStyle(e)}function Bo(e){return Je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function At(e){if(_n(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hu(e)&&e.host||ft(e);return hu(t)?t.host:t}function oh(e){const t=At(e);return En(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&hr(t)?t:oh(t)}function tr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=oh(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ue(o);if(s){const a=Ni(i);return t.concat(i,i.visualViewport||[],hr(o)?o:[],a&&n?tr(a):[])}else return t.concat(o,tr(o,[],n))}function Ni(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sh(e){const t=et(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=xo(n)!==s||xo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ka(e){return Je(e)?e:e.contextElement}function Sn(e){const t=ka(e);if(!vt(t))return ut(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=sh(t);let i=(s?xo(n.width):n.width)/r,a=(s?xo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const UT=ut(0);function ih(e){const t=Ue(e);return!Da()||!t.visualViewport?UT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zT(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ue(e)?!1:t}function nn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ka(e);let i=ut(1);t&&(r?Je(r)&&(i=Sn(r)):i=Sn(e));const a=zT(s,n,r)?ih(s):ut(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=Ue(s),p=r&&Je(r)?Ue(r):r;let v=h,g=Ni(v);for(;g&&r&&p!==v;){const y=Sn(g),x=g.getBoundingClientRect(),b=et(g),C=x.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,S=x.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=C,u+=S,v=Ue(g),g=Ni(v)}}return wo({width:d,height:f,x:c,y:u})}function Wo(e,t){const n=Bo(e).scrollLeft;return t?t.left+n:nn(ft(e)).left+n}function ah(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function HT(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ft(r),a=t?Vo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ut(1);const d=ut(0),f=vt(r);if((f||!f&&!s)&&((_n(r)!=="body"||hr(i))&&(c=Bo(r)),f)){const p=nn(r);u=Sn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=i&&!f&&!s?ah(i,c):ut(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 KT(e){return Array.from(e.getClientRects())}function YT(e){const t=ft(e),n=Bo(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Wo(e);const a=-n.scrollTop;return et(r).direction==="rtl"&&(i+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const pu=25;function XT(e,t){const n=Ue(e),r=ft(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Da();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=Wo(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-p);v<=pu&&(s-=v)}else u<=pu&&(s+=u);return{width:s,height:i,x:a,y:c}}function qT(e,t){const n=nn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=vt(e)?Sn(e):ut(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function mu(e,t,n){let r;if(t==="viewport")r=XT(e,n);else if(t==="document")r=YT(ft(e));else if(Je(t))r=qT(t,n);else{const o=ih(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return wo(r)}function ch(e,t){const n=At(e);return n===t||!Je(n)||En(n)?!1:et(n).position==="fixed"||ch(n,t)}function ZT(e,t){const n=t.get(e);if(n)return n;let r=tr(e,[],!1).filter(a=>Je(a)&&_n(a)!=="body"),o=null;const s=et(e).position==="fixed";let i=s?At(e):e;for(;Je(i)&&!En(i);){const a=et(i),c=ja(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||hr(i)&&!c&&ch(e,i))?r=r.filter(d=>d!==i):o=a,i=At(i)}return t.set(e,r),r}function QT(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Vo(t)?[]:ZT(t,this._c):[].concat(n),r],a=mu(t,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 p=mu(t,i[h],o);c=Ge(p.top,c),u=Mt(p.right,u),d=Mt(p.bottom,d),f=Ge(p.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function JT(e){const{width:t,height:n}=sh(e);return{width:t,height:n}}function eR(e,t,n){const r=vt(t),o=ft(t),s=n==="fixed",i=nn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=ut(0);function u(){c.x=Wo(o)}if(r||!r&&!s)if((_n(t)!=="body"||hr(o))&&(a=Bo(t)),r){const p=nn(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?ah(o,a):ut(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 Bs(e){return et(e).position==="static"}function gu(e,t){if(!vt(e)||et(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ft(e)===n&&(n=n.ownerDocument.body),n}function lh(e,t){const n=Ue(e);if(Vo(e))return n;if(!vt(e)){let o=At(e);for(;o&&!En(o);){if(Je(o)&&!Bs(o))return o;o=At(o)}return n}let r=gu(e,t);for(;r&&VT(r)&&Bs(r);)r=gu(r,t);return r&&En(r)&&Bs(r)&&!ja(r)?n:r||GT(e)||n}const tR=async function(e){const t=this.getOffsetParent||lh,n=this.getDimensions,r=await n(e.floating);return{reference:eR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nR(e){return et(e).direction==="rtl"}const rR={convertOffsetParentRelativeRectToViewportRelativeRect:HT,getDocumentElement:ft,getClippingRect:QT,getOffsetParent:lh,getElementRects:tR,getClientRects:KT,getDimensions:JT,getScale:Sn,isElement:Je,isRTL:nR};function uh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oR(e,t){let n=null,r;const o=ft(e);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=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=u;if(a||t(),!h||!p)return;const v=_r(f),g=_r(o.clientWidth-(d+h)),y=_r(o.clientHeight-(f+p)),x=_r(d),C={rootMargin:-v+"px "+-g+"px "+-y+"px "+-x+"px",threshold:Ge(0,Mt(1,c))||1};let S=!0;function T(E){const R=E[0].intersectionRatio;if(R!==c){if(!S)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!uh(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,C)}n.observe(e)}return i(!0),s}function sR(e,t,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=ka(e),d=o||s?[...u?tr(u):[],...t?tr(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?oR(u,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),u&&!c&&p.observe(u),t&&p.observe(t));let v,g=c?nn(e):null;c&&y();function y(){const x=nn(e);g&&!uh(g,x)&&n(),g=x,v=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(v)}}const iR=_T,aR=LT,cR=kT,lR=$T,uR=IT,yu=DT,dR=FT,fR=(e,t,n)=>{const r=new Map,o={platform:rR,...n},s={...o.platform,_c:r};return jT(e,t,{...o,platform:s})};var hR=typeof document<"u",pR=function(){},ro=hR?w.useLayoutEffect:pR;function Co(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Co(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Co(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function dh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vu(e,t){const n=dh(e);return Math.round(t*n)/n}function Ws(e){const t=m.useRef(e);return ro(()=>{t.current=e}),t}function mR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);Co(h,r)||p(r);const[v,g]=m.useState(null),[y,x]=m.useState(null),b=m.useCallback(N=>{N!==E.current&&(E.current=N,g(N))},[]),C=m.useCallback(N=>{N!==R.current&&(R.current=N,x(N))},[]),S=s||v,T=i||y,E=m.useRef(null),R=m.useRef(null),P=m.useRef(d),M=c!=null,A=Ws(c),j=Ws(o),F=Ws(u),W=m.useCallback(()=>{if(!E.current||!R.current)return;const N={placement:t,strategy:n,middleware:h};j.current&&(N.platform=j.current),fR(E.current,R.current,N).then(I=>{const $={...I,isPositioned:F.current!==!1};K.current&&!Co(P.current,$)&&(P.current=$,No.flushSync(()=>{f($)}))})},[h,t,n,j,F]);ro(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[u]);const K=m.useRef(!1);ro(()=>(K.current=!0,()=>{K.current=!1}),[]),ro(()=>{if(S&&(E.current=S),T&&(R.current=T),S&&T){if(A.current)return A.current(S,T,W);W()}},[S,T,W,A,M]);const ee=m.useMemo(()=>({reference:E,floating:R,setReference:b,setFloating:C}),[b,C]),O=m.useMemo(()=>({reference:S,floating:T}),[S,T]),V=m.useMemo(()=>{const N={position:n,left:0,top:0};if(!O.floating)return N;const I=vu(O.floating,d.x),$=vu(O.floating,d.y);return a?{...N,transform:"translate("+I+"px, "+$+"px)",...dh(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:$}},[n,a,O.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:W,refs:ee,elements:O,floatingStyles:V}),[d,W,ee,O,V])}const gR=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yu({element:r.current,padding:o}).fn(n):{}:r?yu({element:r,padding:o}).fn(n):{}}}},yR=(e,t)=>{const n=iR(e);return{name:n.name,fn:n.fn,options:[e,t]}},vR=(e,t)=>{const n=aR(e);return{name:n.name,fn:n.fn,options:[e,t]}},xR=(e,t)=>({fn:dR(e).fn,options:[e,t]}),bR=(e,t)=>{const n=cR(e);return{name:n.name,fn:n.fn,options:[e,t]}},wR=(e,t)=>{const n=lR(e);return{name:n.name,fn:n.fn,options:[e,t]}},CR=(e,t)=>{const n=uR(e);return{name:n.name,fn:n.fn,options:[e,t]}},SR=(e,t)=>{const n=gR(e);return{name:n.name,fn:n.fn,options:[e,t]}};var TR="Arrow",fh=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Q.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});fh.displayName=TR;var RR=fh;function pr(e){const[t,n]=m.useState(void 0);return Me(()=>{if(e){n({width:e.offsetWidth,height:e.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=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ia="Popper",[hh,_t]=Te(Ia),[PR,ph]=hh(Ia),mh=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return l.jsx(PR,{scope:t,anchor:r,onAnchorChange:o,children:n})};mh.displayName=Ia;var gh="PopperAnchor",yh=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ph(gh,n),i=m.useRef(null),a=se(t,i),c=m.useRef(null);return m.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(Q.div,{...o,ref:a})});yh.displayName=gh;var Oa="PopperContent",[ER,MR]=hh(Oa),vh=m.forwardRef((e,t)=>{var L,J,U,H,ce,ae;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...g}=e,y=ph(Oa,n),[x,b]=m.useState(null),C=se(t,Ce=>b(Ce)),[S,T]=m.useState(null),E=pr(S),R=(E==null?void 0:E.width)??0,P=(E==null?void 0:E.height)??0,M=r+(s!=="center"?"-"+s:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],F=j.length>0,W={padding:A,boundary:j.filter(NR),altBoundary:F},{refs:K,floatingStyles:ee,placement:O,isPositioned:V,middlewareData:N}=mR({strategy:"fixed",placement:M,whileElementsMounted:(...Ce)=>sR(...Ce,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[yR({mainAxis:o+P,alignmentAxis:i}),c&&vR({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?xR():void 0,...W}),c&&bR({...W}),wR({...W,apply:({elements:Ce,rects:oe,availableWidth:ht,availableHeight:Bt})=>{const{width:Wt,height:Re}=oe.reference,Le=Ce.floating.style;Le.setProperty("--radix-popper-available-width",`${ht}px`),Le.setProperty("--radix-popper-available-height",`${Bt}px`),Le.setProperty("--radix-popper-anchor-width",`${Wt}px`),Le.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),S&&SR({element:S,padding:a}),jR({arrowWidth:R,arrowHeight:P}),h&&CR({strategy:"referenceHidden",...W})]}),[I,$]=wh(O),X=Qe(v);Me(()=>{V&&(X==null||X())},[V,X]);const k=(L=N.arrow)==null?void 0:L.x,Z=(J=N.arrow)==null?void 0:J.y,_=((U=N.arrow)==null?void 0:U.centerOffset)!==0,[G,B]=m.useState();return Me(()=>{x&&B(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:V?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(H=N.transformOrigin)==null?void 0:H.x,(ce=N.transformOrigin)==null?void 0:ce.y].join(" "),...((ae=N.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(ER,{scope:n,placedSide:I,onArrowChange:T,arrowX:k,arrowY:Z,shouldHideArrow:_,children:l.jsx(Q.div,{"data-side":I,"data-align":$,...g,ref:C,style:{...g.style,animation:V?void 0:"none"}})})})});vh.displayName=Oa;var xh="PopperArrow",AR={top:"bottom",right:"left",bottom:"top",left:"right"},bh=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=MR(xh,r),i=AR[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(RR,{...o,ref:n,style:{...o.style,display:"block"}})})});bh.displayName=xh;function NR(e){return e!==null}var jR=e=>({name:"transformOrigin",options:e,fn(t){var y,x,b;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=wh(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,p=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?f:`${h}px`,g=`${-c}px`):u==="top"?(v=i?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?f:`${p}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?f:`${p}px`),{data:{x:v,y:g}}}});function wh(e){const[t,n="center"]=e.split("-");return[t,n]}var mr=mh,gr=yh,Go=vh,Uo=bh,DR="Portal",Ln=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=m.useState(!1);Me(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Ao.createPortal(l.jsx(Q.div,{...r,ref:t}),i):null});Ln.displayName=DR;function yr(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ch=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"}),kR="VisuallyHidden",_a=m.forwardRef((e,t)=>l.jsx(Q.span,{...e,ref:t,style:{...Ch,...e.style}}));_a.displayName=kR;var IR=_a,OR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hn=new WeakMap,Lr=new WeakMap,Fr={},Gs=0,Sh=function(e){return e&&(e.host||Sh(e.parentNode))},_R=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},LR=function(e,t,n,r){var o=_R(t,Array.isArray(e)?e:[e]);Fr[n]||(Fr[n]=new WeakMap);var s=Fr[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 p=h.getAttribute(r),v=p!==null&&p!=="false",g=(hn.get(h)||0)+1,y=(s.get(h)||0)+1;hn.set(h,g),s.set(h,y),i.push(h),g===1&&v&&Lr.set(h,!0),y===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),a.clear(),Gs++,function(){i.forEach(function(f){var h=hn.get(f)-1,p=s.get(f)-1;hn.set(f,h),s.set(f,p),h||(Lr.has(f)||f.removeAttribute(r),Lr.delete(f)),p||f.removeAttribute(n)}),Gs--,Gs||(hn=new WeakMap,hn=new WeakMap,Lr=new WeakMap,Fr={})}},zo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=OR(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),LR(r,o,n,"aria-hidden")):function(){return null}},at=function(){return at=Object.assign||function(t){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)&&(t[s]=n[s])}return t},at.apply(this,arguments)};function Th(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function FR(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var oo="right-scroll-bar-position",so="width-before-scroll-bar",$R="with-scroll-bars-hidden",VR="--removed-body-scroll-bar-size";function Us(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function BR(e,t){var n=w.useState(function(){return{value:e,callback:t,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=t,n.facade}var WR=typeof window<"u"?m.useLayoutEffect:m.useEffect,xu=new WeakMap;function GR(e,t){var n=BR(null,function(r){return e.forEach(function(o){return Us(o,r)})});return WR(function(){var r=xu.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Us(a,null)}),s.forEach(function(a){o.has(a)||Us(a,i)})}xu.set(n,e)},[e]),n}function UR(e){return e}function zR(e,t){t===void 0&&(t=UR);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]:e},useMedium:function(s){var i=t(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 HR(e){e===void 0&&(e={});var t=zR(null);return t.options=at({async:!0,ssr:!1},e),t}var Rh=function(e){var t=e.sideCar,n=Th(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,at({},n))};Rh.isSideCarExport=!0;function KR(e,t){return e.useMedium(t),Rh}var Ph=HR(),zs=function(){},Ho=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:zs,onWheelCapture:zs,onTouchMoveCapture:zs}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,v=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,C=e.gapMode,S=Th(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,E=GR([n,t]),R=at(at({},S),o);return m.createElement(m.Fragment,null,d&&m.createElement(T,{sideCar:Ph,removeScrollBar:u,shards:f,noRelative:p,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:C}),i?m.cloneElement(m.Children.only(a),at(at({},R),{ref:E})):m.createElement(b,at({},R,{className:c,ref:E}),a))});Ho.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ho.classNames={fullWidth:so,zeroRight:oo};var YR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=YR();return t&&e.setAttribute("nonce",t),e}function qR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ZR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XR())&&(qR(t,n),ZR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},JR=function(){var e=QR();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Eh=function(){var e=JR(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},eP={left:0,top:0,right:0,gap:0},Hs=function(e){return parseInt(e||"",10)||0},tP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Hs(n),Hs(r),Hs(o)]},nP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eP;var t=tP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rP=Eh(),Tn="data-scroll-locked",oP=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
165
+ .`.concat($R,` {
166
166
  overflow: hidden `).concat(r,`;
167
167
  padding-right: `).concat(a,"px ").concat(r,`;
168
168
  }
@@ -196,14 +196,14 @@
196
196
  }
197
197
 
198
198
  body[`).concat(Tn,`] {
199
- `).concat($R,": ").concat(a,`px;
199
+ `).concat(VR,": ").concat(a,`px;
200
200
  }
201
- `)},bu=function(){var e=parseInt(document.body.getAttribute(Tn)||"0",10);return isFinite(e)?e:0},sP=function(){m.useEffect(function(){return document.body.setAttribute(Tn,(bu()+1).toString()),function(){var e=bu()-1;e<=0?document.body.removeAttribute(Tn):document.body.setAttribute(Tn,e.toString())}},[])},iP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;sP();var s=m.useMemo(function(){return nP(o)},[o]);return m.createElement(rP,{styles:oP(s,!t,o,n?"":"!important")})},ji=!1;if(typeof window<"u")try{var Vr=Object.defineProperty({},"passive",{get:function(){return ji=!0,!0}});window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{ji=!1}var pn=ji?{passive:!1}:!1,aP=function(e){return e.tagName==="TEXTAREA"},Mh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!aP(e)&&n[t]==="visible")},cP=function(e){return Mh(e,"overflowY")},lP=function(e){return Mh(e,"overflowX")},wu=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ah(e,r);if(o){var s=Nh(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ah=function(e,t){return e==="v"?cP(t):lP(t)},Nh=function(e,t){return e==="v"?uP(t):dP(t)},fP=function(e,t){return e==="h"&&t==="rtl"?-1:1},hP=function(e,t,n,r,o){var s=fP(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var p=Nh(e,a),v=p[0],g=p[1],y=p[2],x=g-y-s*v;(v||x)&&Ah(e,a)&&(f+=x,h+=v);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},$r=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cu=function(e){return[e.deltaX,e.deltaY]},Su=function(e){return e&&"current"in e?e.current:e},pP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mP=function(e){return`
201
+ `)},bu=function(){var e=parseInt(document.body.getAttribute(Tn)||"0",10);return isFinite(e)?e:0},sP=function(){m.useEffect(function(){return document.body.setAttribute(Tn,(bu()+1).toString()),function(){var e=bu()-1;e<=0?document.body.removeAttribute(Tn):document.body.setAttribute(Tn,e.toString())}},[])},iP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;sP();var s=m.useMemo(function(){return nP(o)},[o]);return m.createElement(rP,{styles:oP(s,!t,o,n?"":"!important")})},ji=!1;if(typeof window<"u")try{var $r=Object.defineProperty({},"passive",{get:function(){return ji=!0,!0}});window.addEventListener("test",$r,$r),window.removeEventListener("test",$r,$r)}catch{ji=!1}var pn=ji?{passive:!1}:!1,aP=function(e){return e.tagName==="TEXTAREA"},Mh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!aP(e)&&n[t]==="visible")},cP=function(e){return Mh(e,"overflowY")},lP=function(e){return Mh(e,"overflowX")},wu=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ah(e,r);if(o){var s=Nh(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ah=function(e,t){return e==="v"?cP(t):lP(t)},Nh=function(e,t){return e==="v"?uP(t):dP(t)},fP=function(e,t){return e==="h"&&t==="rtl"?-1:1},hP=function(e,t,n,r,o){var s=fP(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var p=Nh(e,a),v=p[0],g=p[1],y=p[2],x=g-y-s*v;(v||x)&&Ah(e,a)&&(f+=x,h+=v);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Vr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cu=function(e){return[e.deltaX,e.deltaY]},Su=function(e){return e&&"current"in e?e.current:e},pP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mP=function(e){return`
202
202
  .block-interactivity-`.concat(e,` {pointer-events: none;}
203
203
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
204
- `)},gP=0,mn=[];function yP(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(gP++)[0],s=m.useState(Eh)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=FR([e.lockRef.current],(e.shards||[]).map(Su),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=$r(g),b=n.current,C="deltaX"in g?g.deltaX:b[0]-x[0],S="deltaY"in g?g.deltaY:b[1]-x[1],T,E=g.target,R=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in g&&R==="h"&&E.type==="range")return!1;var P=window.getSelection(),M=P&&P.anchorNode,A=M?M===E||M.contains(E):!1;if(A)return!1;var j=wu(R,E);if(!j)return!0;if(j?T=R:(T=R==="v"?"h":"v",j=wu(R,E)),!j)return!1;if(!r.current&&"changedTouches"in g&&(C||S)&&(r.current=T),!T)return!0;var F=r.current||T;return hP(F,y,g,F==="h"?C:S)},[]),c=m.useCallback(function(g){var y=g;if(!(!mn.length||mn[mn.length-1]!==s)){var x="deltaY"in y?Cu(y):$r(y),b=t.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&pP(T.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var C=(i.current.shards||[]).map(Su).filter(Boolean).filter(function(T){return T.contains(y.target)}),S=C.length>0?a(y,C[0]):!i.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=m.useCallback(function(g,y,x,b){var C={name:g,delta:y,target:x,should:b,shadowParent:vP(x)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),d=m.useCallback(function(g){n.current=$r(g),r.current=void 0},[]),f=m.useCallback(function(g){u(g.type,Cu(g),g.target,a(g,e.lockRef.current))},[]),h=m.useCallback(function(g){u(g.type,$r(g),g.target,a(g,e.lockRef.current))},[]);m.useEffect(function(){return mn.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,pn),document.addEventListener("touchmove",c,pn),document.addEventListener("touchstart",d,pn),function(){mn=mn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,pn),document.removeEventListener("touchmove",c,pn),document.removeEventListener("touchstart",d,pn)}},[]);var p=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(s,{styles:mP(o)}):null,p?m.createElement(iP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xP=KR(Ph,yP);var vr=m.forwardRef(function(e,t){return m.createElement(Ho,at({},e,{ref:t,sideCar:xP}))});vr.classNames=Ho.classNames;var bP=[" ","Enter","ArrowUp","ArrowDown"],wP=[" ","Enter"],rn="Select",[Ko,Yo,CP]=lr(rn),[Fn]=Te(rn,[CP,_t]),Xo=_t(),[SP,Lt]=Fn(rn),[TP,RP]=Fn(rn),jh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:v}=e,g=Xo(t),[y,x]=m.useState(null),[b,C]=m.useState(null),[S,T]=m.useState(!1),E=Dt(u),[R,P]=we({prop:r,defaultProp:o??!1,onChange:s,caller:rn}),[M,A]=we({prop:i,defaultProp:a,onChange:c,caller:rn}),j=m.useRef(null),F=y?v||!!y.closest("form"):!0,[G,H]=m.useState(new Set),J=Array.from(G).map(O=>O.props.value).join(";");return l.jsx(mr,{...g,children:l.jsxs(SP,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:T,contentId:ge(),value:M,onValueChange:A,open:R,onOpenChange:P,dir:E,triggerPointerDownPosRef:j,disabled:h,children:[l.jsx(Ko.Provider,{scope:t,children:l.jsx(TP,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(O=>{H($=>new Set($).add(O))},[]),onNativeOptionRemove:m.useCallback(O=>{H($=>{const N=new Set($);return N.delete(O),N})},[]),children:n})}),F?l.jsxs(ep,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:O=>A(O.target.value),disabled:h,form:v,children:[M===void 0?l.jsx("option",{value:""}):null,Array.from(G)]},J):null]})})};jh.displayName=rn;var Dh="SelectTrigger",kh=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Xo(n),i=Lt(Dh,n),a=i.disabled||r,c=se(t,i.onTriggerChange),u=Yo(n),d=m.useRef("touch"),[f,h,p]=np(g=>{const y=u().filter(C=>!C.disabled),x=y.find(C=>C.value===i.value),b=rp(y,g,x);b!==void 0&&i.onValueChange(b.value)}),v=g=>{a||(i.onOpenChange(!0),p()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return l.jsx(gr,{asChild:!0,...s,children:l.jsx(Q.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tp(i.value)?"":void 0,...o,ref:c,onClick:z(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&v(g)}),onPointerDown:z(o.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:z(o.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(y&&g.key===" ")&&bP.includes(g.key)&&(v(),g.preventDefault())})})})});kh.displayName=Dh;var Ih="SelectValue",Oh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Lt(Ih,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=se(t,c.onValueNodeChange);return Me(()=>{u(d)},[u,d]),l.jsx(Q.span,{...a,ref:f,style:{pointerEvents:"none"},children:tp(c.value)?l.jsx(l.Fragment,{children:i}):s})});Oh.displayName=Ih;var PP="SelectIcon",_h=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Q.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});_h.displayName=PP;var EP="SelectPortal",Lh=e=>l.jsx(Ln,{asChild:!0,...e});Lh.displayName=EP;var on="SelectContent",Fh=m.forwardRef((e,t)=>{const n=Lt(on,e.__scopeSelect),[r,o]=m.useState();if(Me(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?No.createPortal(l.jsx(Vh,{scope:e.__scopeSelect,children:l.jsx(Ko.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx($h,{...e,ref:t})});Fh.displayName=on;var qe=10,[Vh,Ft]=Fn(on),MP="SelectContentImpl",AP=en("SelectContent.RemoveScroll"),$h=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:g,avoidCollisions:y,...x}=e,b=Lt(on,n),[C,S]=m.useState(null),[T,E]=m.useState(null),R=se(t,L=>S(L)),[P,M]=m.useState(null),[A,j]=m.useState(null),F=Yo(n),[G,H]=m.useState(!1),J=m.useRef(!1);m.useEffect(()=>{if(C)return zo(C)},[C]),Fo();const O=m.useCallback(L=>{const[ee,...W]=F().map(ce=>ce.ref.current),[X]=W.slice(-1),ae=document.activeElement;for(const ce of L)if(ce===ae||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===ee&&T&&(T.scrollTop=0),ce===X&&T&&(T.scrollTop=T.scrollHeight),ce==null||ce.focus(),document.activeElement!==ae))return},[F,T]),$=m.useCallback(()=>O([P,C]),[O,P,C]);m.useEffect(()=>{G&&$()},[G,$]);const{onOpenChange:N,triggerPointerDownPosRef:I}=b;m.useEffect(()=>{if(C){let L={x:0,y:0};const ee=X=>{var ae,ce;L={x:Math.abs(Math.round(X.pageX)-(((ae=I.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(X.pageY)-(((ce=I.current)==null?void 0:ce.y)??0))}},W=X=>{L.x<=10&&L.y<=10?X.preventDefault():C.contains(X.target)||N(!1),document.removeEventListener("pointermove",ee),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",W,{capture:!0})}}},[C,N,I]),m.useEffect(()=>{const L=()=>N(!1);return window.addEventListener("blur",L),window.addEventListener("resize",L),()=>{window.removeEventListener("blur",L),window.removeEventListener("resize",L)}},[N]);const[V,Y]=np(L=>{const ee=F().filter(ae=>!ae.disabled),W=ee.find(ae=>ae.ref.current===document.activeElement),X=rp(ee,L,W);X&&setTimeout(()=>X.ref.current.focus())}),k=m.useCallback((L,ee,W)=>{const X=!J.current&&!W;(b.value!==void 0&&b.value===ee||X)&&(M(L),X&&(J.current=!0))},[b.value]),Z=m.useCallback(()=>C==null?void 0:C.focus(),[C]),_=m.useCallback((L,ee,W)=>{const X=!J.current&&!W;(b.value!==void 0&&b.value===ee||X)&&j(L)},[b.value]),U=r==="popper"?Di:Bh,B=U===Di?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:g,avoidCollisions:y}:{};return l.jsx(Vh,{scope:n,content:C,viewport:T,onViewportChange:E,itemRefCallback:k,selectedItem:P,onItemLeave:Z,itemTextRefCallback:_,focusSelectedItem:$,selectedItemText:A,position:r,isPositioned:G,searchRef:V,children:l.jsx(vr,{as:AP,allowPinchZoom:!0,children:l.jsx(fr,{asChild:!0,trapped:b.open,onMountAutoFocus:L=>{L.preventDefault()},onUnmountAutoFocus:z(o,L=>{var ee;(ee=b.trigger)==null||ee.focus({preventScroll:!0}),L.preventDefault()}),children:l.jsx(In,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:L=>L.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(U,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:L=>L.preventDefault(),...x,...B,onPlaced:()=>H(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:z(x.onKeyDown,L=>{const ee=L.ctrlKey||L.altKey||L.metaKey;if(L.key==="Tab"&&L.preventDefault(),!ee&&L.key.length===1&&Y(L.key),["ArrowUp","ArrowDown","Home","End"].includes(L.key)){let X=F().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(L.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(L.key)){const ae=L.target,ce=X.indexOf(ae);X=X.slice(ce+1)}setTimeout(()=>O(X)),L.preventDefault()}})})})})})})});$h.displayName=MP;var NP="SelectItemAlignedPosition",Bh=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Lt(on,n),i=Ft(on,n),[a,c]=m.useState(null),[u,d]=m.useState(null),f=se(t,R=>d(R)),h=Yo(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:x,focusSelectedItem:b}=i,C=m.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&g&&y&&x){const R=s.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),A=x.getBoundingClientRect();if(s.dir!=="rtl"){const ae=A.left-P.left,ce=M.left-ae,Ce=R.left-ce,oe=R.width+Ce,ht=Math.max(oe,P.width),Bt=window.innerWidth-qe,Wt=vo(ce,[qe,Math.max(qe,Bt-ht)]);a.style.minWidth=oe+"px",a.style.left=Wt+"px"}else{const ae=P.right-A.right,ce=window.innerWidth-M.right-ae,Ce=window.innerWidth-R.right-ce,oe=R.width+Ce,ht=Math.max(oe,P.width),Bt=window.innerWidth-qe,Wt=vo(ce,[qe,Math.max(qe,Bt-ht)]);a.style.minWidth=oe+"px",a.style.right=Wt+"px"}const j=h(),F=window.innerHeight-qe*2,G=g.scrollHeight,H=window.getComputedStyle(u),J=parseInt(H.borderTopWidth,10),O=parseInt(H.paddingTop,10),$=parseInt(H.borderBottomWidth,10),N=parseInt(H.paddingBottom,10),I=J+O+G+N+$,V=Math.min(y.offsetHeight*5,I),Y=window.getComputedStyle(g),k=parseInt(Y.paddingTop,10),Z=parseInt(Y.paddingBottom,10),_=R.top+R.height/2-qe,U=F-_,B=y.offsetHeight/2,L=y.offsetTop+B,ee=J+O+L,W=I-ee;if(ee<=_){const ae=j.length>0&&y===j[j.length-1].ref.current;a.style.bottom="0px";const ce=u.clientHeight-g.offsetTop-g.offsetHeight,Ce=Math.max(U,B+(ae?Z:0)+ce+$),oe=ee+Ce;a.style.height=oe+"px"}else{const ae=j.length>0&&y===j[0].ref.current;a.style.top="0px";const Ce=Math.max(_,J+g.offsetTop+(ae?k:0)+B)+W;a.style.height=Ce+"px",g.scrollTop=ee-_+g.offsetTop}a.style.margin=`${qe}px 0`,a.style.minHeight=V+"px",a.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,a,u,g,y,x,s.dir,r]);Me(()=>C(),[C]);const[S,T]=m.useState();Me(()=>{u&&T(window.getComputedStyle(u).zIndex)},[u]);const E=m.useCallback(R=>{R&&v.current===!0&&(C(),b==null||b(),v.current=!1)},[C,b]);return l.jsx(DP,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(Q.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Bh.displayName=NP;var jP="SelectPopperPosition",Di=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=qe,...s}=e,i=Xo(n);return l.jsx(Go,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Di.displayName=jP;var[DP,La]=Fn(on,{}),ki="SelectViewport",Wh=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Ft(ki,n),i=La(ki,n),a=se(t,s.onViewportChange),c=m.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:r}),l.jsx(Ko.Slot,{scope:n,children:l.jsx(Q.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:z(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const v=window.innerHeight-qe*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),x=Math.max(g,y);if(x<v){const b=x+p,C=Math.min(v,b),S=b-C;f.style.height=C+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Wh.displayName=ki;var Gh="SelectGroup",[kP,IP]=Fn(Gh),Uh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ge();return l.jsx(kP,{scope:n,id:o,children:l.jsx(Q.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Uh.displayName=Gh;var zh="SelectLabel",Hh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=IP(zh,n);return l.jsx(Q.div,{id:o.id,...r,ref:t})});Hh.displayName=zh;var So="SelectItem",[OP,Kh]=Fn(So),Yh=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Lt(So,n),c=Ft(So,n),u=a.value===r,[d,f]=m.useState(s??""),[h,p]=m.useState(!1),v=se(t,b=>{var C;return(C=c.itemRefCallback)==null?void 0:C.call(c,b,r,o)}),g=ge(),y=m.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(OP,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:m.useCallback(b=>{f(C=>C||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(Ko.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:l.jsx(Q.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:z(i.onFocus,()=>p(!0)),onBlur:z(i.onBlur,()=>p(!1)),onClick:z(i.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:z(i.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:z(i.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:z(i.onPointerMove,b=>{var C;y.current=b.pointerType,o?(C=c.onItemLeave)==null||C.call(c):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(i.onPointerLeave,b=>{var C;b.currentTarget===document.activeElement&&((C=c.onItemLeave)==null||C.call(c))}),onKeyDown:z(i.onKeyDown,b=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(wP.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});Yh.displayName=So;var zn="SelectItemText",Xh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Lt(zn,n),a=Ft(zn,n),c=Kh(zn,n),u=RP(zn,n),[d,f]=m.useState(null),h=se(t,x=>f(x),c.onItemTextChange,x=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,x,c.value,c.disabled)}),p=d==null?void 0:d.textContent,v=m.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return Me(()=>(g(v),()=>y(v)),[g,y,v]),l.jsxs(l.Fragment,{children:[l.jsx(Q.span,{id:c.textId,...s,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?No.createPortal(s.children,i.valueNode):null]})});Xh.displayName=zn;var qh="SelectItemIndicator",Zh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Kh(qh,n).isSelected?l.jsx(Q.span,{"aria-hidden":!0,...r,ref:t}):null});Zh.displayName=qh;var Ii="SelectScrollUpButton",_P=m.forwardRef((e,t)=>{const n=Ft(Ii,e.__scopeSelect),r=La(Ii,e.__scopeSelect),[o,s]=m.useState(!1),i=se(t,r.onScrollButtonChange);return Me(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Qh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});_P.displayName=Ii;var Oi="SelectScrollDownButton",LP=m.forwardRef((e,t)=>{const n=Ft(Oi,e.__scopeSelect),r=La(Oi,e.__scopeSelect),[o,s]=m.useState(!1),i=se(t,r.onScrollButtonChange);return Me(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Qh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});LP.displayName=Oi;var Qh=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Ft("SelectScrollButton",n),i=m.useRef(null),a=Yo(n),c=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Me(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),l.jsx(Q.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:z(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:z(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:z(o.onPointerLeave,()=>{c()})})}),FP="SelectSeparator",Jh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Q.div,{"aria-hidden":!0,...r,ref:t})});Jh.displayName=FP;var _i="SelectArrow",VP=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Xo(n),s=Lt(_i,n),i=Ft(_i,n);return s.open&&i.position==="popper"?l.jsx(Uo,{...o,...r,ref:t}):null});VP.displayName=_i;var $P="SelectBubbleInput",ep=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=se(r,o),i=yr(t);return m.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(Q.select,{...n,style:{...Ch,...n.style},ref:s,defaultValue:t})});ep.displayName=$P;function tp(e){return e===""||e===void 0}function np(e){const t=Qe(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(i=>{const a=n.current+i;t(a),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function rp(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=BP(e,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}function BP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var WP=jh,GP=kh,UP=Oh,zP=_h,HP=Lh,KP=Fh,YP=Wh,XP=Uh,qP=Hh,ZP=Yh,QP=Xh,JP=Zh,eE=Jh;function tE({placeholder:e,size:t,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":p,...v}){const{className:g,style:y,styleTag:x}=re(u,c,"cny-select-trigger",t==="sm"||t==="lg"?t:null,n!=="primary"&&n,a,o);return l.jsxs(WP,{disabled:d,...v,children:[l.jsxs(GP,{id:i,"aria-invalid":h,"aria-describedby":p,className:g,style:y,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(UP,{placeholder:e}),l.jsx(zP,{className:"cny-select-chevron",asChild:!0,children:l.jsx(dr,{size:14,"aria-hidden":"true"})})]}),l.jsx(HP,{children:l.jsx(KP,{position:"popper",sideOffset:4,className:K("cny-select-content",s),children:l.jsx(YP,{className:"cny-select-viewport",children:f})})})]})}const nE=w.forwardRef(function({className:t,children:n,...r},o){return l.jsxs(ZP,{ref:o,className:K("cny-select-item",t),...r,children:[l.jsx(QP,{children:n}),l.jsx(JP,{className:"cny-select-indicator",children:l.jsx(tn,{size:14,"aria-hidden":"true"})})]})}),rE=w.forwardRef(function(t,n){return l.jsx(XP,{ref:n,...t})}),oE=w.forwardRef(function({className:t,...n},r){return l.jsx(qP,{ref:r,className:K("cny-select-group-label",t),...n})}),sE=w.forwardRef(function({className:t,...n},r){return l.jsx(eE,{ref:r,className:K("cny-select-separator",t),...n})});function iE(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Ne=e=>{const{present:t,children:n}=e,r=aE(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=se(r.ref,cE(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};Ne.displayName="Presence";function aE(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),i=e?"mounted":"unmounted",[a,c]=iE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Br(r.current);s.current=a==="mounted"?u:"none"},[a]),Me(()=>{const u=r.current,d=o.current;if(d!==e){const h=s.current,p=Br(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Me(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const g=Br(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(s.current=Br(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Br(e){return(e==null?void 0:e.animationName)||"none"}function cE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qo="Popover",[op]=Te(qo,[_t]),xr=_t(),[lE,Vt]=op(qo),sp=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=xr(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,h]=we({prop:r,defaultProp:o??!1,onChange:s,caller:qo});return l.jsx(mr,{...a,children:l.jsx(lE,{scope:t,contentId:ge(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:i,children:n})})};sp.displayName=qo;var ip="PopoverAnchor",ap=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Vt(ip,n),s=xr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return m.useEffect(()=>(i(),()=>a()),[i,a]),l.jsx(gr,{...s,...r,ref:t})});ap.displayName=ip;var cp="PopoverTrigger",lp=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Vt(cp,n),s=xr(n),i=se(t,o.triggerRef),a=l.jsx(Q.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gp(o.open),...r,ref:i,onClick:z(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:l.jsx(gr,{asChild:!0,...s,children:a})});lp.displayName=cp;var Fa="PopoverPortal",[uE,dE]=op(Fa,{forceMount:void 0}),up=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Vt(Fa,t);return l.jsx(uE,{scope:t,forceMount:n,children:l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:r})})})};up.displayName=Fa;var Mn="PopoverContent",dp=m.forwardRef((e,t)=>{const n=dE(Mn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Vt(Mn,e.__scopePopover);return l.jsx(Ne,{present:r||s.open,children:s.modal?l.jsx(hE,{...o,ref:t}):l.jsx(pE,{...o,ref:t})})});dp.displayName=Mn;var fE=en("PopoverContent.RemoveScroll"),hE=m.forwardRef((e,t)=>{const n=Vt(Mn,e.__scopePopover),r=m.useRef(null),o=se(t,r),s=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return zo(i)},[]),l.jsx(vr,{as:fE,allowPinchZoom:!0,children:l.jsx(fp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),pE=m.forwardRef((e,t)=>{const n=Vt(Mn,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return l.jsx(fp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),fp=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Vt(Mn,n),p=xr(n);return Fo(),l.jsx(fr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(In,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:l.jsx(Go,{"data-state":gp(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.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)"}})})})}),hp="PopoverClose",pp=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Vt(hp,n);return l.jsx(Q.button,{type:"button",...r,ref:t,onClick:z(e.onClick,()=>o.onOpenChange(!1))})});pp.displayName=hp;var mE="PopoverArrow",mp=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=xr(n);return l.jsx(Uo,{...o,...r,ref:t})});mp.displayName=mE;function gp(e){return e?"open":"closed"}var Va=sp,gE=ap,$a=lp,Ba=up,Wa=dp,yE=pp,vE=mp,Tu=1,xE=.9,bE=.8,wE=.17,Ks=.1,Ys=.999,CE=.9999,SE=.99,TE=/[\\\/_+.#"@\[\(\{&]/,RE=/[\\\/_+.#"@\[\(\{&]/g,PE=/[\s-]/,yp=/[\s-]/g;function Li(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?Tu:SE;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,p,v;u>=0;)f=Li(e,t,n,r,u+1,s+1,i),f>d&&(u===o?f*=Tu:TE.test(e.charAt(u-1))?(f*=bE,p=e.slice(o,u-1).match(RE),p&&o>0&&(f*=Math.pow(Ys,p.length))):PE.test(e.charAt(u-1))?(f*=xE,v=e.slice(o,u-1).match(yp),v&&o>0&&(f*=Math.pow(Ys,v.length))):(f*=wE,o>0&&(f*=Math.pow(Ys,u-o))),e.charAt(u)!==t.charAt(s)&&(f*=CE)),(f<Ks&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=Li(e,t,n,r,u+1,s+2,i),h*Ks>f&&(f=h*Ks)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Ru(e){return e.toLowerCase().replace(yp," ")}function EE(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Li(e,t,Ru(e),Ru(t),0,0,{})}var Zo="Dialog",[vp]=Te(Zo),[ME,tt]=vp(Zo),xp=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=m.useRef(null),c=m.useRef(null),[u,d]=we({prop:r,defaultProp:o??!1,onChange:s,caller:Zo});return l.jsx(ME,{scope:t,triggerRef:a,contentRef:c,contentId:ge(),titleId:ge(),descriptionId:ge(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};xp.displayName=Zo;var bp="DialogTrigger",wp=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(bp,n),s=se(t,o.triggerRef);return l.jsx(Q.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":za(o.open),...r,ref:s,onClick:z(e.onClick,o.onOpenToggle)})});wp.displayName=bp;var Ga="DialogPortal",[AE,Cp]=vp(Ga,{forceMount:void 0}),Sp=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=tt(Ga,t);return l.jsx(AE,{scope:t,forceMount:n,children:m.Children.map(r,i=>l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:i})}))})};Sp.displayName=Ga;var To="DialogOverlay",Tp=m.forwardRef((e,t)=>{const n=Cp(To,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=tt(To,e.__scopeDialog);return s.modal?l.jsx(Ne,{present:r||s.open,children:l.jsx(jE,{...o,ref:t})}):null});Tp.displayName=To;var NE=en("DialogOverlay.RemoveScroll"),jE=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(To,n);return l.jsx(vr,{as:NE,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(Q.div,{"data-state":za(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),sn="DialogContent",Rp=m.forwardRef((e,t)=>{const n=Cp(sn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=tt(sn,e.__scopeDialog);return l.jsx(Ne,{present:r||s.open,children:s.modal?l.jsx(DE,{...o,ref:t}):l.jsx(kE,{...o,ref:t})})});Rp.displayName=sn;var DE=m.forwardRef((e,t)=>{const n=tt(sn,e.__scopeDialog),r=m.useRef(null),o=se(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return zo(s)},[]),l.jsx(Pp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault())})}),kE=m.forwardRef((e,t)=>{const n=tt(sn,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return l.jsx(Pp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Pp=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=tt(sn,n),c=m.useRef(null),u=se(t,c);return Fo(),l.jsxs(l.Fragment,{children:[l.jsx(fr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(In,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":za(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(IE,{titleId:a.titleId}),l.jsx(_E,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Ua="DialogTitle",Ep=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(Ua,n);return l.jsx(Q.h2,{id:o.titleId,...r,ref:t})});Ep.displayName=Ua;var Mp="DialogDescription",Ap=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(Mp,n);return l.jsx(Q.p,{id:o.descriptionId,...r,ref:t})});Ap.displayName=Mp;var Np="DialogClose",jp=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(Np,n);return l.jsx(Q.button,{type:"button",...r,ref:t,onClick:z(e.onClick,()=>o.onOpenChange(!1))})});jp.displayName=Np;function za(e){return e?"open":"closed"}var Dp="DialogTitleWarning",[Oj,kp]=dC(Dp,{contentName:sn,titleName:Ua,docsSlug:"dialog"}),IE=({titleId:e})=>{const t=kp(Dp),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
204
+ `)},gP=0,mn=[];function yP(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(gP++)[0],s=m.useState(Eh)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=FR([e.lockRef.current],(e.shards||[]).map(Su),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=Vr(g),b=n.current,C="deltaX"in g?g.deltaX:b[0]-x[0],S="deltaY"in g?g.deltaY:b[1]-x[1],T,E=g.target,R=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in g&&R==="h"&&E.type==="range")return!1;var P=window.getSelection(),M=P&&P.anchorNode,A=M?M===E||M.contains(E):!1;if(A)return!1;var j=wu(R,E);if(!j)return!0;if(j?T=R:(T=R==="v"?"h":"v",j=wu(R,E)),!j)return!1;if(!r.current&&"changedTouches"in g&&(C||S)&&(r.current=T),!T)return!0;var F=r.current||T;return hP(F,y,g,F==="h"?C:S)},[]),c=m.useCallback(function(g){var y=g;if(!(!mn.length||mn[mn.length-1]!==s)){var x="deltaY"in y?Cu(y):Vr(y),b=t.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&pP(T.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var C=(i.current.shards||[]).map(Su).filter(Boolean).filter(function(T){return T.contains(y.target)}),S=C.length>0?a(y,C[0]):!i.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=m.useCallback(function(g,y,x,b){var C={name:g,delta:y,target:x,should:b,shadowParent:vP(x)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),d=m.useCallback(function(g){n.current=Vr(g),r.current=void 0},[]),f=m.useCallback(function(g){u(g.type,Cu(g),g.target,a(g,e.lockRef.current))},[]),h=m.useCallback(function(g){u(g.type,Vr(g),g.target,a(g,e.lockRef.current))},[]);m.useEffect(function(){return mn.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,pn),document.addEventListener("touchmove",c,pn),document.addEventListener("touchstart",d,pn),function(){mn=mn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,pn),document.removeEventListener("touchmove",c,pn),document.removeEventListener("touchstart",d,pn)}},[]);var p=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(s,{styles:mP(o)}):null,p?m.createElement(iP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xP=KR(Ph,yP);var vr=m.forwardRef(function(e,t){return m.createElement(Ho,at({},e,{ref:t,sideCar:xP}))});vr.classNames=Ho.classNames;var bP=[" ","Enter","ArrowUp","ArrowDown"],wP=[" ","Enter"],rn="Select",[Ko,Yo,CP]=lr(rn),[Fn]=Te(rn,[CP,_t]),Xo=_t(),[SP,Lt]=Fn(rn),[TP,RP]=Fn(rn),jh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:v}=e,g=Xo(t),[y,x]=m.useState(null),[b,C]=m.useState(null),[S,T]=m.useState(!1),E=Dt(u),[R,P]=we({prop:r,defaultProp:o??!1,onChange:s,caller:rn}),[M,A]=we({prop:i,defaultProp:a,onChange:c,caller:rn}),j=m.useRef(null),F=y?v||!!y.closest("form"):!0,[W,K]=m.useState(new Set),ee=Array.from(W).map(O=>O.props.value).join(";");return l.jsx(mr,{...g,children:l.jsxs(SP,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:T,contentId:ge(),value:M,onValueChange:A,open:R,onOpenChange:P,dir:E,triggerPointerDownPosRef:j,disabled:h,children:[l.jsx(Ko.Provider,{scope:t,children:l.jsx(TP,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(O=>{K(V=>new Set(V).add(O))},[]),onNativeOptionRemove:m.useCallback(O=>{K(V=>{const N=new Set(V);return N.delete(O),N})},[]),children:n})}),F?l.jsxs(ep,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:O=>A(O.target.value),disabled:h,form:v,children:[M===void 0?l.jsx("option",{value:""}):null,Array.from(W)]},ee):null]})})};jh.displayName=rn;var Dh="SelectTrigger",kh=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Xo(n),i=Lt(Dh,n),a=i.disabled||r,c=se(t,i.onTriggerChange),u=Yo(n),d=m.useRef("touch"),[f,h,p]=np(g=>{const y=u().filter(C=>!C.disabled),x=y.find(C=>C.value===i.value),b=rp(y,g,x);b!==void 0&&i.onValueChange(b.value)}),v=g=>{a||(i.onOpenChange(!0),p()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return l.jsx(gr,{asChild:!0,...s,children:l.jsx(Q.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tp(i.value)?"":void 0,...o,ref:c,onClick:z(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&v(g)}),onPointerDown:z(o.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:z(o.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(y&&g.key===" ")&&bP.includes(g.key)&&(v(),g.preventDefault())})})})});kh.displayName=Dh;var Ih="SelectValue",Oh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Lt(Ih,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=se(t,c.onValueNodeChange);return Me(()=>{u(d)},[u,d]),l.jsx(Q.span,{...a,ref:f,style:{pointerEvents:"none"},children:tp(c.value)?l.jsx(l.Fragment,{children:i}):s})});Oh.displayName=Ih;var PP="SelectIcon",_h=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Q.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});_h.displayName=PP;var EP="SelectPortal",Lh=e=>l.jsx(Ln,{asChild:!0,...e});Lh.displayName=EP;var on="SelectContent",Fh=m.forwardRef((e,t)=>{const n=Lt(on,e.__scopeSelect),[r,o]=m.useState();if(Me(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?No.createPortal(l.jsx($h,{scope:e.__scopeSelect,children:l.jsx(Ko.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(Vh,{...e,ref:t})});Fh.displayName=on;var qe=10,[$h,Ft]=Fn(on),MP="SelectContentImpl",AP=en("SelectContent.RemoveScroll"),Vh=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:g,avoidCollisions:y,...x}=e,b=Lt(on,n),[C,S]=m.useState(null),[T,E]=m.useState(null),R=se(t,L=>S(L)),[P,M]=m.useState(null),[A,j]=m.useState(null),F=Yo(n),[W,K]=m.useState(!1),ee=m.useRef(!1);m.useEffect(()=>{if(C)return zo(C)},[C]),Fo();const O=m.useCallback(L=>{const[J,...U]=F().map(ae=>ae.ref.current),[H]=U.slice(-1),ce=document.activeElement;for(const ae of L)if(ae===ce||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===J&&T&&(T.scrollTop=0),ae===H&&T&&(T.scrollTop=T.scrollHeight),ae==null||ae.focus(),document.activeElement!==ce))return},[F,T]),V=m.useCallback(()=>O([P,C]),[O,P,C]);m.useEffect(()=>{W&&V()},[W,V]);const{onOpenChange:N,triggerPointerDownPosRef:I}=b;m.useEffect(()=>{if(C){let L={x:0,y:0};const J=H=>{var ce,ae;L={x:Math.abs(Math.round(H.pageX)-(((ce=I.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(H.pageY)-(((ae=I.current)==null?void 0:ae.y)??0))}},U=H=>{L.x<=10&&L.y<=10?H.preventDefault():C.contains(H.target)||N(!1),document.removeEventListener("pointermove",J),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",U,{capture:!0})}}},[C,N,I]),m.useEffect(()=>{const L=()=>N(!1);return window.addEventListener("blur",L),window.addEventListener("resize",L),()=>{window.removeEventListener("blur",L),window.removeEventListener("resize",L)}},[N]);const[$,X]=np(L=>{const J=F().filter(ce=>!ce.disabled),U=J.find(ce=>ce.ref.current===document.activeElement),H=rp(J,L,U);H&&setTimeout(()=>H.ref.current.focus())}),k=m.useCallback((L,J,U)=>{const H=!ee.current&&!U;(b.value!==void 0&&b.value===J||H)&&(M(L),H&&(ee.current=!0))},[b.value]),Z=m.useCallback(()=>C==null?void 0:C.focus(),[C]),_=m.useCallback((L,J,U)=>{const H=!ee.current&&!U;(b.value!==void 0&&b.value===J||H)&&j(L)},[b.value]),G=r==="popper"?Di:Bh,B=G===Di?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:g,avoidCollisions:y}:{};return l.jsx($h,{scope:n,content:C,viewport:T,onViewportChange:E,itemRefCallback:k,selectedItem:P,onItemLeave:Z,itemTextRefCallback:_,focusSelectedItem:V,selectedItemText:A,position:r,isPositioned:W,searchRef:$,children:l.jsx(vr,{as:AP,allowPinchZoom:!0,children:l.jsx(fr,{asChild:!0,trapped:b.open,onMountAutoFocus:L=>{L.preventDefault()},onUnmountAutoFocus:z(o,L=>{var J;(J=b.trigger)==null||J.focus({preventScroll:!0}),L.preventDefault()}),children:l.jsx(In,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:L=>L.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(G,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:L=>L.preventDefault(),...x,...B,onPlaced:()=>K(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:z(x.onKeyDown,L=>{const J=L.ctrlKey||L.altKey||L.metaKey;if(L.key==="Tab"&&L.preventDefault(),!J&&L.key.length===1&&X(L.key),["ArrowUp","ArrowDown","Home","End"].includes(L.key)){let H=F().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(L.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(L.key)){const ce=L.target,ae=H.indexOf(ce);H=H.slice(ae+1)}setTimeout(()=>O(H)),L.preventDefault()}})})})})})})});Vh.displayName=MP;var NP="SelectItemAlignedPosition",Bh=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Lt(on,n),i=Ft(on,n),[a,c]=m.useState(null),[u,d]=m.useState(null),f=se(t,R=>d(R)),h=Yo(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:x,focusSelectedItem:b}=i,C=m.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&g&&y&&x){const R=s.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),A=x.getBoundingClientRect();if(s.dir!=="rtl"){const ce=A.left-P.left,ae=M.left-ce,Ce=R.left-ae,oe=R.width+Ce,ht=Math.max(oe,P.width),Bt=window.innerWidth-qe,Wt=vo(ae,[qe,Math.max(qe,Bt-ht)]);a.style.minWidth=oe+"px",a.style.left=Wt+"px"}else{const ce=P.right-A.right,ae=window.innerWidth-M.right-ce,Ce=window.innerWidth-R.right-ae,oe=R.width+Ce,ht=Math.max(oe,P.width),Bt=window.innerWidth-qe,Wt=vo(ae,[qe,Math.max(qe,Bt-ht)]);a.style.minWidth=oe+"px",a.style.right=Wt+"px"}const j=h(),F=window.innerHeight-qe*2,W=g.scrollHeight,K=window.getComputedStyle(u),ee=parseInt(K.borderTopWidth,10),O=parseInt(K.paddingTop,10),V=parseInt(K.borderBottomWidth,10),N=parseInt(K.paddingBottom,10),I=ee+O+W+N+V,$=Math.min(y.offsetHeight*5,I),X=window.getComputedStyle(g),k=parseInt(X.paddingTop,10),Z=parseInt(X.paddingBottom,10),_=R.top+R.height/2-qe,G=F-_,B=y.offsetHeight/2,L=y.offsetTop+B,J=ee+O+L,U=I-J;if(J<=_){const ce=j.length>0&&y===j[j.length-1].ref.current;a.style.bottom="0px";const ae=u.clientHeight-g.offsetTop-g.offsetHeight,Ce=Math.max(G,B+(ce?Z:0)+ae+V),oe=J+Ce;a.style.height=oe+"px"}else{const ce=j.length>0&&y===j[0].ref.current;a.style.top="0px";const Ce=Math.max(_,ee+g.offsetTop+(ce?k:0)+B)+U;a.style.height=Ce+"px",g.scrollTop=J-_+g.offsetTop}a.style.margin=`${qe}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,a,u,g,y,x,s.dir,r]);Me(()=>C(),[C]);const[S,T]=m.useState();Me(()=>{u&&T(window.getComputedStyle(u).zIndex)},[u]);const E=m.useCallback(R=>{R&&v.current===!0&&(C(),b==null||b(),v.current=!1)},[C,b]);return l.jsx(DP,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(Q.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Bh.displayName=NP;var jP="SelectPopperPosition",Di=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=qe,...s}=e,i=Xo(n);return l.jsx(Go,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Di.displayName=jP;var[DP,La]=Fn(on,{}),ki="SelectViewport",Wh=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Ft(ki,n),i=La(ki,n),a=se(t,s.onViewportChange),c=m.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:r}),l.jsx(Ko.Slot,{scope:n,children:l.jsx(Q.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:z(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const v=window.innerHeight-qe*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),x=Math.max(g,y);if(x<v){const b=x+p,C=Math.min(v,b),S=b-C;f.style.height=C+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Wh.displayName=ki;var Gh="SelectGroup",[kP,IP]=Fn(Gh),Uh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ge();return l.jsx(kP,{scope:n,id:o,children:l.jsx(Q.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Uh.displayName=Gh;var zh="SelectLabel",Hh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=IP(zh,n);return l.jsx(Q.div,{id:o.id,...r,ref:t})});Hh.displayName=zh;var So="SelectItem",[OP,Kh]=Fn(So),Yh=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Lt(So,n),c=Ft(So,n),u=a.value===r,[d,f]=m.useState(s??""),[h,p]=m.useState(!1),v=se(t,b=>{var C;return(C=c.itemRefCallback)==null?void 0:C.call(c,b,r,o)}),g=ge(),y=m.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(OP,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:m.useCallback(b=>{f(C=>C||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(Ko.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:l.jsx(Q.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:z(i.onFocus,()=>p(!0)),onBlur:z(i.onBlur,()=>p(!1)),onClick:z(i.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:z(i.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:z(i.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:z(i.onPointerMove,b=>{var C;y.current=b.pointerType,o?(C=c.onItemLeave)==null||C.call(c):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(i.onPointerLeave,b=>{var C;b.currentTarget===document.activeElement&&((C=c.onItemLeave)==null||C.call(c))}),onKeyDown:z(i.onKeyDown,b=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(wP.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});Yh.displayName=So;var zn="SelectItemText",Xh=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Lt(zn,n),a=Ft(zn,n),c=Kh(zn,n),u=RP(zn,n),[d,f]=m.useState(null),h=se(t,x=>f(x),c.onItemTextChange,x=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,x,c.value,c.disabled)}),p=d==null?void 0:d.textContent,v=m.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return Me(()=>(g(v),()=>y(v)),[g,y,v]),l.jsxs(l.Fragment,{children:[l.jsx(Q.span,{id:c.textId,...s,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?No.createPortal(s.children,i.valueNode):null]})});Xh.displayName=zn;var qh="SelectItemIndicator",Zh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Kh(qh,n).isSelected?l.jsx(Q.span,{"aria-hidden":!0,...r,ref:t}):null});Zh.displayName=qh;var Ii="SelectScrollUpButton",_P=m.forwardRef((e,t)=>{const n=Ft(Ii,e.__scopeSelect),r=La(Ii,e.__scopeSelect),[o,s]=m.useState(!1),i=se(t,r.onScrollButtonChange);return Me(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Qh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});_P.displayName=Ii;var Oi="SelectScrollDownButton",LP=m.forwardRef((e,t)=>{const n=Ft(Oi,e.__scopeSelect),r=La(Oi,e.__scopeSelect),[o,s]=m.useState(!1),i=se(t,r.onScrollButtonChange);return Me(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Qh,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});LP.displayName=Oi;var Qh=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Ft("SelectScrollButton",n),i=m.useRef(null),a=Yo(n),c=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Me(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),l.jsx(Q.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:z(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:z(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:z(o.onPointerLeave,()=>{c()})})}),FP="SelectSeparator",Jh=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Q.div,{"aria-hidden":!0,...r,ref:t})});Jh.displayName=FP;var _i="SelectArrow",$P=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Xo(n),s=Lt(_i,n),i=Ft(_i,n);return s.open&&i.position==="popper"?l.jsx(Uo,{...o,...r,ref:t}):null});$P.displayName=_i;var VP="SelectBubbleInput",ep=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=se(r,o),i=yr(t);return m.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(Q.select,{...n,style:{...Ch,...n.style},ref:s,defaultValue:t})});ep.displayName=VP;function tp(e){return e===""||e===void 0}function np(e){const t=Qe(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(i=>{const a=n.current+i;t(a),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function rp(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=BP(e,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}function BP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var WP=jh,GP=kh,UP=Oh,zP=_h,HP=Lh,KP=Fh,YP=Wh,XP=Uh,qP=Hh,ZP=Yh,QP=Xh,JP=Zh,eE=Jh;function tE({placeholder:e,size:t,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":p,...v}){const{className:g,style:y,styleTag:x}=re(u,c,"cny-select-trigger",t==="sm"||t==="lg"?t:null,n!=="primary"&&n,a,o);return l.jsxs(WP,{disabled:d,...v,children:[l.jsxs(GP,{id:i,"aria-invalid":h,"aria-describedby":p,className:g,style:y,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(UP,{placeholder:e}),l.jsx(zP,{className:"cny-select-chevron",asChild:!0,children:l.jsx(dr,{size:14,"aria-hidden":"true"})})]}),l.jsx(HP,{children:l.jsx(KP,{position:"popper",sideOffset:4,className:Y("cny-select-content",s),children:l.jsx(YP,{className:"cny-select-viewport",children:f})})})]})}const nE=w.forwardRef(function({className:t,children:n,...r},o){return l.jsxs(ZP,{ref:o,className:Y("cny-select-item",t),...r,children:[l.jsx(QP,{children:n}),l.jsx(JP,{className:"cny-select-indicator",children:l.jsx(tn,{size:14,"aria-hidden":"true"})})]})}),rE=w.forwardRef(function(t,n){return l.jsx(XP,{ref:n,...t})}),oE=w.forwardRef(function({className:t,...n},r){return l.jsx(qP,{ref:r,className:Y("cny-select-group-label",t),...n})}),sE=w.forwardRef(function({className:t,...n},r){return l.jsx(eE,{ref:r,className:Y("cny-select-separator",t),...n})});function iE(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Ne=e=>{const{present:t,children:n}=e,r=aE(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=se(r.ref,cE(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};Ne.displayName="Presence";function aE(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),i=e?"mounted":"unmounted",[a,c]=iE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Br(r.current);s.current=a==="mounted"?u:"none"},[a]),Me(()=>{const u=r.current,d=o.current;if(d!==e){const h=s.current,p=Br(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Me(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const g=Br(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(s.current=Br(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Br(e){return(e==null?void 0:e.animationName)||"none"}function cE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qo="Popover",[op]=Te(qo,[_t]),xr=_t(),[lE,$t]=op(qo),sp=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=xr(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,h]=we({prop:r,defaultProp:o??!1,onChange:s,caller:qo});return l.jsx(mr,{...a,children:l.jsx(lE,{scope:t,contentId:ge(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:i,children:n})})};sp.displayName=qo;var ip="PopoverAnchor",ap=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=$t(ip,n),s=xr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return m.useEffect(()=>(i(),()=>a()),[i,a]),l.jsx(gr,{...s,...r,ref:t})});ap.displayName=ip;var cp="PopoverTrigger",lp=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=$t(cp,n),s=xr(n),i=se(t,o.triggerRef),a=l.jsx(Q.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gp(o.open),...r,ref:i,onClick:z(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:l.jsx(gr,{asChild:!0,...s,children:a})});lp.displayName=cp;var Fa="PopoverPortal",[uE,dE]=op(Fa,{forceMount:void 0}),up=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=$t(Fa,t);return l.jsx(uE,{scope:t,forceMount:n,children:l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:r})})})};up.displayName=Fa;var Mn="PopoverContent",dp=m.forwardRef((e,t)=>{const n=dE(Mn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=$t(Mn,e.__scopePopover);return l.jsx(Ne,{present:r||s.open,children:s.modal?l.jsx(hE,{...o,ref:t}):l.jsx(pE,{...o,ref:t})})});dp.displayName=Mn;var fE=en("PopoverContent.RemoveScroll"),hE=m.forwardRef((e,t)=>{const n=$t(Mn,e.__scopePopover),r=m.useRef(null),o=se(t,r),s=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return zo(i)},[]),l.jsx(vr,{as:fE,allowPinchZoom:!0,children:l.jsx(fp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),pE=m.forwardRef((e,t)=>{const n=$t(Mn,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return l.jsx(fp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),fp=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=$t(Mn,n),p=xr(n);return Fo(),l.jsx(fr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(In,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:l.jsx(Go,{"data-state":gp(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.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)"}})})})}),hp="PopoverClose",pp=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=$t(hp,n);return l.jsx(Q.button,{type:"button",...r,ref:t,onClick:z(e.onClick,()=>o.onOpenChange(!1))})});pp.displayName=hp;var mE="PopoverArrow",mp=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=xr(n);return l.jsx(Uo,{...o,...r,ref:t})});mp.displayName=mE;function gp(e){return e?"open":"closed"}var $a=sp,gE=ap,Va=lp,Ba=up,Wa=dp,yE=pp,vE=mp,Tu=1,xE=.9,bE=.8,wE=.17,Ks=.1,Ys=.999,CE=.9999,SE=.99,TE=/[\\\/_+.#"@\[\(\{&]/,RE=/[\\\/_+.#"@\[\(\{&]/g,PE=/[\s-]/,yp=/[\s-]/g;function Li(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?Tu:SE;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,p,v;u>=0;)f=Li(e,t,n,r,u+1,s+1,i),f>d&&(u===o?f*=Tu:TE.test(e.charAt(u-1))?(f*=bE,p=e.slice(o,u-1).match(RE),p&&o>0&&(f*=Math.pow(Ys,p.length))):PE.test(e.charAt(u-1))?(f*=xE,v=e.slice(o,u-1).match(yp),v&&o>0&&(f*=Math.pow(Ys,v.length))):(f*=wE,o>0&&(f*=Math.pow(Ys,u-o))),e.charAt(u)!==t.charAt(s)&&(f*=CE)),(f<Ks&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=Li(e,t,n,r,u+1,s+2,i),h*Ks>f&&(f=h*Ks)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Ru(e){return e.toLowerCase().replace(yp," ")}function EE(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Li(e,t,Ru(e),Ru(t),0,0,{})}var Zo="Dialog",[vp]=Te(Zo),[ME,tt]=vp(Zo),xp=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=m.useRef(null),c=m.useRef(null),[u,d]=we({prop:r,defaultProp:o??!1,onChange:s,caller:Zo});return l.jsx(ME,{scope:t,triggerRef:a,contentRef:c,contentId:ge(),titleId:ge(),descriptionId:ge(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};xp.displayName=Zo;var bp="DialogTrigger",wp=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(bp,n),s=se(t,o.triggerRef);return l.jsx(Q.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":za(o.open),...r,ref:s,onClick:z(e.onClick,o.onOpenToggle)})});wp.displayName=bp;var Ga="DialogPortal",[AE,Cp]=vp(Ga,{forceMount:void 0}),Sp=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=tt(Ga,t);return l.jsx(AE,{scope:t,forceMount:n,children:m.Children.map(r,i=>l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:i})}))})};Sp.displayName=Ga;var To="DialogOverlay",Tp=m.forwardRef((e,t)=>{const n=Cp(To,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=tt(To,e.__scopeDialog);return s.modal?l.jsx(Ne,{present:r||s.open,children:l.jsx(jE,{...o,ref:t})}):null});Tp.displayName=To;var NE=en("DialogOverlay.RemoveScroll"),jE=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(To,n);return l.jsx(vr,{as:NE,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(Q.div,{"data-state":za(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),sn="DialogContent",Rp=m.forwardRef((e,t)=>{const n=Cp(sn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=tt(sn,e.__scopeDialog);return l.jsx(Ne,{present:r||s.open,children:s.modal?l.jsx(DE,{...o,ref:t}):l.jsx(kE,{...o,ref:t})})});Rp.displayName=sn;var DE=m.forwardRef((e,t)=>{const n=tt(sn,e.__scopeDialog),r=m.useRef(null),o=se(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return zo(s)},[]),l.jsx(Pp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault())})}),kE=m.forwardRef((e,t)=>{const n=tt(sn,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return l.jsx(Pp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Pp=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=tt(sn,n),c=m.useRef(null),u=se(t,c);return Fo(),l.jsxs(l.Fragment,{children:[l.jsx(fr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(In,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":za(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(IE,{titleId:a.titleId}),l.jsx(_E,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Ua="DialogTitle",Ep=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(Ua,n);return l.jsx(Q.h2,{id:o.titleId,...r,ref:t})});Ep.displayName=Ua;var Mp="DialogDescription",Ap=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(Mp,n);return l.jsx(Q.p,{id:o.descriptionId,...r,ref:t})});Ap.displayName=Mp;var Np="DialogClose",jp=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tt(Np,n);return l.jsx(Q.button,{type:"button",...r,ref:t,onClick:z(e.onClick,()=>o.onOpenChange(!1))})});jp.displayName=Np;function za(e){return e?"open":"closed"}var Dp="DialogTitleWarning",[Oj,kp]=dC(Dp,{contentName:sn,titleName:Ua,docsSlug:"dialog"}),IE=({titleId:e})=>{const t=kp(Dp),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
205
205
 
206
206
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
207
207
 
208
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},OE="DialogDescriptionWarning",_E=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kp(OE).contentName}}.`;return m.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ha=xp,Ip=wp,Ka=Sp,Ya=Tp,Xa=Rp,qa=Ep,Za=Ap,Qo=jp,Gn='[cmdk-group=""]',Xs='[cmdk-group-items=""]',LE='[cmdk-group-heading=""]',Op='[cmdk-item=""]',Pu=`${Op}:not([aria-disabled="true"])`,Fi="cmdk-item-select",yn="data-value",FE=(e,t,n)=>EE(e,t,n),_p=m.createContext(void 0),br=()=>m.useContext(_p),Lp=m.createContext(void 0),Qa=()=>m.useContext(Lp),Fp=m.createContext(void 0),Vp=m.forwardRef((e,t)=>{let n=vn(()=>{var k,Z;return{search:"",value:(Z=(k=e.value)!=null?k:e.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=vn(()=>new Set),o=vn(()=>new Map),s=vn(()=>new Map),i=vn(()=>new Set),a=$p(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,loop:v,disablePointerSelection:g=!1,vimBindings:y=!0,...x}=e,b=ge(),C=ge(),S=ge(),T=m.useRef(null),E=XE();an(()=>{if(d!==void 0){let k=d.trim();n.current.value=k,R.emit()}},[d]),an(()=>{E(6,G)},[]);let R=m.useMemo(()=>({subscribe:k=>(i.current.add(k),()=>i.current.delete(k)),snapshot:()=>n.current,setState:(k,Z,_)=>{var U,B,L,ee;if(!Object.is(n.current[k],Z)){if(n.current[k]=Z,k==="search")F(),A(),E(1,j);else if(k==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let W=document.getElementById(S);W?W.focus():(U=document.getElementById(b))==null||U.focus()}if(E(7,()=>{var W;n.current.selectedItemId=(W=H())==null?void 0:W.id,R.emit()}),_||E(5,G),((B=a.current)==null?void 0:B.value)!==void 0){let W=Z??"";(ee=(L=a.current).onValueChange)==null||ee.call(L,W);return}}R.emit()}},emit:()=>{i.current.forEach(k=>k())}}),[]),P=m.useMemo(()=>({value:(k,Z,_)=>{var U;Z!==((U=s.current.get(k))==null?void 0:U.value)&&(s.current.set(k,{value:Z,keywords:_}),n.current.filtered.items.set(k,M(Z,_)),E(2,()=>{A(),R.emit()}))},item:(k,Z)=>(r.current.add(k),Z&&(o.current.has(Z)?o.current.get(Z).add(k):o.current.set(Z,new Set([k]))),E(3,()=>{F(),A(),n.current.value||j(),R.emit()}),()=>{s.current.delete(k),r.current.delete(k),n.current.filtered.items.delete(k);let _=H();E(4,()=>{F(),(_==null?void 0:_.getAttribute("id"))===k&&j(),R.emit()})}),group:k=>(o.current.has(k)||o.current.set(k,new Set),()=>{s.current.delete(k),o.current.delete(k)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:S,labelId:C,listInnerRef:T}),[]);function M(k,Z){var _,U;let B=(U=(_=a.current)==null?void 0:_.filter)!=null?U:FE;return k?B(k,n.current.search,Z):0}function A(){if(!n.current.search||a.current.shouldFilter===!1)return;let k=n.current.filtered.items,Z=[];n.current.filtered.groups.forEach(U=>{let B=o.current.get(U),L=0;B.forEach(ee=>{let W=k.get(ee);L=Math.max(W,L)}),Z.push([U,L])});let _=T.current;J().sort((U,B)=>{var L,ee;let W=U.getAttribute("id"),X=B.getAttribute("id");return((L=k.get(X))!=null?L:0)-((ee=k.get(W))!=null?ee:0)}).forEach(U=>{let B=U.closest(Xs);B?B.appendChild(U.parentElement===B?U:U.closest(`${Xs} > *`)):_.appendChild(U.parentElement===_?U:U.closest(`${Xs} > *`))}),Z.sort((U,B)=>B[1]-U[1]).forEach(U=>{var B;let L=(B=T.current)==null?void 0:B.querySelector(`${Gn}[${yn}="${encodeURIComponent(U[0])}"]`);L==null||L.parentElement.appendChild(L)})}function j(){let k=J().find(_=>_.getAttribute("aria-disabled")!=="true"),Z=k==null?void 0:k.getAttribute(yn);R.setState("value",Z||void 0)}function F(){var k,Z,_,U;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let B=0;for(let L of r.current){let ee=(Z=(k=s.current.get(L))==null?void 0:k.value)!=null?Z:"",W=(U=(_=s.current.get(L))==null?void 0:_.keywords)!=null?U:[],X=M(ee,W);n.current.filtered.items.set(L,X),X>0&&B++}for(let[L,ee]of o.current)for(let W of ee)if(n.current.filtered.items.get(W)>0){n.current.filtered.groups.add(L);break}n.current.filtered.count=B}function G(){var k,Z,_;let U=H();U&&(((k=U.parentElement)==null?void 0:k.firstChild)===U&&((_=(Z=U.closest(Gn))==null?void 0:Z.querySelector(LE))==null||_.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function H(){var k;return(k=T.current)==null?void 0:k.querySelector(`${Op}[aria-selected="true"]`)}function J(){var k;return Array.from(((k=T.current)==null?void 0:k.querySelectorAll(Pu))||[])}function O(k){let Z=J()[k];Z&&R.setState("value",Z.getAttribute(yn))}function $(k){var Z;let _=H(),U=J(),B=U.findIndex(ee=>ee===_),L=U[B+k];(Z=a.current)!=null&&Z.loop&&(L=B+k<0?U[U.length-1]:B+k===U.length?U[0]:U[B+k]),L&&R.setState("value",L.getAttribute(yn))}function N(k){let Z=H(),_=Z==null?void 0:Z.closest(Gn),U;for(;_&&!U;)_=k>0?KE(_,Gn):YE(_,Gn),U=_==null?void 0:_.querySelector(Pu);U?R.setState("value",U.getAttribute(yn)):$(k)}let I=()=>O(J().length-1),V=k=>{k.preventDefault(),k.metaKey?I():k.altKey?N(1):$(1)},Y=k=>{k.preventDefault(),k.metaKey?O(0):k.altKey?N(-1):$(-1)};return m.createElement(Q.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:k=>{var Z;(Z=x.onKeyDown)==null||Z.call(x,k);let _=k.nativeEvent.isComposing||k.keyCode===229;if(!(k.defaultPrevented||_))switch(k.key){case"n":case"j":{y&&k.ctrlKey&&V(k);break}case"ArrowDown":{V(k);break}case"p":case"k":{y&&k.ctrlKey&&Y(k);break}case"ArrowUp":{Y(k);break}case"Home":{k.preventDefault(),O(0);break}case"End":{k.preventDefault(),I();break}case"Enter":{k.preventDefault();let U=H();if(U){let B=new Event(Fi);U.dispatchEvent(B)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:ZE},c),Jo(e,k=>m.createElement(Lp.Provider,{value:R},m.createElement(_p.Provider,{value:P},k))))}),VE=m.forwardRef((e,t)=>{var n,r;let o=ge(),s=m.useRef(null),i=m.useContext(Fp),a=br(),c=$p(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;an(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=Bp(o,s,[e.value,e.children,s],e.keywords),f=Qa(),h=Nt(E=>E.value&&E.value===d.current),p=Nt(E=>u||a.filter()===!1?!0:E.search?E.filtered.items.get(o)>0:!0);m.useEffect(()=>{let E=s.current;if(!(!E||e.disabled))return E.addEventListener(Fi,v),()=>E.removeEventListener(Fi,v)},[p,e.onSelect,e.disabled]);function v(){var E,R;g(),(R=(E=c.current).onSelect)==null||R.call(E,d.current)}function g(){f.setState("value",d.current,!0)}if(!p)return null;let{disabled:y,value:x,onSelect:b,forceMount:C,keywords:S,...T}=e;return m.createElement(Q.div,{ref:mt(s,t),...T,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||a.getDisablePointerSelection()?void 0:g,onClick:y?void 0:v},e.children)}),$E=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=ge(),a=m.useRef(null),c=m.useRef(null),u=ge(),d=br(),f=Nt(p=>o||d.filter()===!1?!0:p.search?p.filtered.groups.has(i):!0);an(()=>d.group(i),[]),Bp(i,a,[e.value,e.heading,c]);let h=m.useMemo(()=>({id:i,forceMount:o}),[o]);return m.createElement(Q.div,{ref:mt(a,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Jo(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(Fp.Provider,{value:h},p))))}),BE=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=m.useRef(null),s=Nt(i=>!i.search);return!n&&!s?null:m.createElement(Q.div,{ref:mt(o,t),...r,"cmdk-separator":"",role:"separator"})}),WE=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=Qa(),i=Nt(u=>u.search),a=Nt(u=>u.selectedItemId),c=br();return m.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),m.createElement(Q.input,{ref:t,...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?e.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),GE=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=m.useRef(null),i=m.useRef(null),a=Nt(u=>u.selectedItemId),c=br();return m.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let p=u.offsetHeight;d.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),m.createElement(Q.div,{ref:mt(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Jo(e,u=>m.createElement("div",{ref:mt(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),UE=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return m.createElement(Ha,{open:n,onOpenChange:r},m.createElement(Ka,{container:i},m.createElement(Ya,{"cmdk-overlay":"",className:o}),m.createElement(Xa,{"aria-label":e.label,"cmdk-dialog":"",className:s},m.createElement(Vp,{ref:t,...a}))))}),zE=m.forwardRef((e,t)=>Nt(n=>n.filtered.count===0)?m.createElement(Q.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),HE=m.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return m.createElement(Q.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Jo(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),be=Object.assign(Vp,{List:GE,Item:VE,Input:WE,Group:$E,Separator:BE,Dialog:UE,Empty:zE,Loading:HE});function KE(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function YE(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $p(e){let t=m.useRef(e);return an(()=>{t.current=e}),t}var an=typeof window>"u"?m.useEffect:m.useLayoutEffect;function vn(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Nt(e){let t=Qa(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function Bp(e,t,n,r=[]){let o=m.useRef(),s=br();return an(()=>{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(e,a,c),(i=t.current)==null||i.setAttribute(yn,a),o.current=a}),o}var XE=()=>{let[e,t]=m.useState(),n=vn(()=>new Map);return an(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function qE(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jo({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(qE(t),{ref:t.ref},n(t.props.children)):n(t)}var ZE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function QE({options:e,value:t,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:p,sx:v,"aria-invalid":g,"aria-describedby":y,"aria-label":x}){const[b,C]=w.useState(!1),[S,T]=w.useState(n??[]),[E,R]=w.useState(""),P=w.useRef(null),M=t??S,A=w.useCallback(V=>{t===void 0&&T(V),r==null||r(V)},[t,r]),j=w.useCallback(V=>{M.includes(V)?A(M.filter(Y=>Y!==V)):(a==null||M.length<a)&&A([...M,V])},[M,A,a]),F=w.useCallback(V=>A(M.filter(Y=>Y!==V)),[M,A]),G=w.useMemo(()=>{const V=new Map;for(const Y of e)V.set(Y.value,Y);return V},[e]),H=w.useMemo(()=>{const V=new Map;for(const Y of e){const k=Y.group??"";V.has(k)||V.set(k,[]),V.get(k).push(Y)}return V},[e]),J=V=>{V.key==="Backspace"&&E===""&&M.length>0&&(V.preventDefault(),F(M[M.length-1]))};w.useEffect(()=>{b&&queueMicrotask(()=>{var V;return(V=P.current)==null?void 0:V.focus()})},[b]);const{className:O,style:$,styleTag:N}=re(v,p,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),I=a!=null&&M.length>=a;return l.jsxs(Va,{open:b,onOpenChange:V=>!d&&C(V),children:[l.jsx($a,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":b,"aria-haspopup":"listbox","aria-invalid":g,"aria-describedby":y,"aria-label":x,"data-state":b?"open":"closed","data-disabled":d||void 0,id:f,className:O,style:$,onClick:()=>!d&&C(V=>!V),tabIndex:d?-1:0,onKeyDown:V=>{(V.key==="Enter"||V.key===" "||V.key==="ArrowDown")&&!b&&(V.preventDefault(),C(!0))},children:[N,M.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),M.map(V=>{const Y=G.get(V);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(Y==null?void 0:Y.label)??V}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(Y==null?void 0:Y.label)??V}`,onClick:k=>{k.stopPropagation(),F(V)},children:l.jsx(Ot,{size:12,"aria-hidden":"true"})})]},V)}),l.jsx(dr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(Ba,{children:l.jsx(Wa,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:V=>V.preventDefault(),children:l.jsxs(be,{shouldFilter:!0,label:"Options",children:[l.jsx(be.Input,{ref:P,placeholder:s,value:E,onValueChange:R,onKeyDown:J}),l.jsxs(be.List,{children:[l.jsx(be.Empty,{children:i}),Array.from(H.entries()).map(([V,Y])=>l.jsx(be.Group,{heading:V||void 0,children:Y.map(k=>{const Z=M.includes(k.value),_=k.disabled||!Z&&I;return l.jsxs(be.Item,{value:`${k.label} ${k.description??""} ${k.value}`,disabled:_,onSelect:()=>j(k.value),children:[k.icon&&l.jsx("span",{style:{display:"inline-flex"},children:k.icon}),l.jsx("span",{children:k.label}),k.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:k.description}),Z&&l.jsx("span",{className:"cny-check",children:l.jsx(tn,{size:14,"aria-hidden":"true"})})]},k.value)})},V||"default"))]})]})})})]})}var es="Checkbox",[JE]=Te(es),[eM,Ja]=JE(es);function tM(e){const{__scopeCheckbox:t,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}=e,[h,p]=we({prop:n,defaultProp:o??!1,onChange:c,caller:es}),[v,g]=m.useState(null),[y,x]=m.useState(null),b=m.useRef(!1),C=v?!!i||!!v.closest("form"):!0,S={checked:h,disabled:s,setChecked:p,control:v,setControl:g,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Rt(o)?!1:o,isFormControl:C,bubbleInput:y,setBubbleInput:x};return l.jsx(eM,{scope:t,...S,children:nM(f)?f(S):r})}var Wp="CheckboxTrigger",Gp=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:v}=Ja(Wp,e),g=se(o,d),y=m.useRef(c);return m.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const b=()=>f(y.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[s,f]),l.jsx(Q.button,{type:"button",role:"checkbox","aria-checked":Rt(c)?"mixed":c,"aria-required":u,"data-state":Yp(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:g,onKeyDown:z(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:z(n,x=>{f(b=>Rt(b)?!0:!b),v&&p&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});Gp.displayName=Wp;var Vi=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:u,form:d,...f}=e;return l.jsx(tM,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>l.jsxs(l.Fragment,{children:[l.jsx(Gp,{...f,ref:t,__scopeCheckbox:n}),h&&l.jsx(Kp,{__scopeCheckbox:n})]})})});Vi.displayName=es;var Up="CheckboxIndicator",zp=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Ja(Up,n);return l.jsx(Ne,{present:r||Rt(s.checked)||s.checked===!0,children:l.jsx(Q.span,{"data-state":Yp(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});zp.displayName=Up;var Hp="CheckboxBubbleInput",Kp=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p}=Ja(Hp,e),v=se(n,p),g=yr(s),y=pr(r);m.useEffect(()=>{const b=h;if(!b)return;const C=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(C,"checked").set,E=!o.current;if(g!==s&&T){const R=new Event("click",{bubbles:E});b.indeterminate=Rt(s),T.call(b,Rt(s)?!1:s),b.dispatchEvent(R)}},[h,g,s,o]);const x=m.useRef(Rt(s)?!1:s);return l.jsx(Q.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Kp.displayName=Hp;function nM(e){return typeof e=="function"}function Rt(e){return e==="indeterminate"}function Yp(e){return Rt(e)?"indeterminate":e?"checked":"unchecked"}const $i=w.forwardRef(function({className:t,style:n,sx:r,children:o,...s},i){const a=l.jsx(zp,{children:s.checked==="indeterminate"?l.jsx(bS,{size:12,"aria-hidden":"true"}):l.jsx(tn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:p}=re(r,n,"checkbox",t);return l.jsxs(Vi,{ref:i,className:f,style:h,...s,children:[p,a]})}const{className:c,style:u,styleTag:d}=re(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(Vi,{ref:i,className:K("checkbox",t),...s,children:a}),l.jsx("span",{children:o})]})});var ec="Radio",[rM,Xp]=Te(ec),[oM,sM]=rM(ec),qp=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:c,form:u,...d}=e,[f,h]=m.useState(null),p=se(t,y=>h(y)),v=m.useRef(!1),g=f?u||!!f.closest("form"):!0;return l.jsxs(oM,{scope:n,checked:o,disabled:i,children:[l.jsx(Q.button,{type:"button",role:"radio","aria-checked":o,"data-state":em(o),"data-disabled":i?"":void 0,disabled:i,value:a,...d,ref:p,onClick:z(e.onClick,y=>{o||c==null||c(),g&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),g&&l.jsx(Jp,{control:f,bubbles:!v.current,name:r,value:a,checked:o,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});qp.displayName=ec;var Zp="RadioIndicator",Qp=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=sM(Zp,n);return l.jsx(Ne,{present:r||s.checked,children:l.jsx(Q.span,{"data-state":em(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Qp.displayName=Zp;var iM="RadioBubbleInput",Jp=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=m.useRef(null),a=se(i,s),c=yr(n),u=pr(t);return m.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const v=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(v)}},[c,n,r]),l.jsx(Q.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Jp.displayName=iM;function em(e){return e?"checked":"unchecked"}var aM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ts="RadioGroup",[cM]=Te(ts,[kt,Xp]),tm=kt(),nm=Xp(),[lM,uM]=cM(ts),rm=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,p=tm(n),v=Dt(u),[g,y]=we({prop:s,defaultProp:o??null,onChange:f,caller:ts});return l.jsx(lM,{scope:n,name:r,required:i,disabled:a,value:g,onValueChange:y,children:l.jsx(_o,{asChild:!0,...p,orientation:c,dir:v,loop:d,children:l.jsx(Q.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:v,...h,ref:t})})})});rm.displayName=ts;var om="RadioGroupItem",sm=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=uM(om,n),i=s.disabled||r,a=tm(n),c=nm(n),u=m.useRef(null),d=se(t,u),f=s.value===o.value,h=m.useRef(!1);return m.useEffect(()=>{const p=g=>{aM.includes(g.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),l.jsx(Lo,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(qp,{disabled:i,required:s.required,checked:f,...c,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:z(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:z(o.onFocus,()=>{var p;h.current&&((p=u.current)==null||p.click())})})})});sm.displayName=om;var dM="RadioGroupIndicator",im=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=nm(n);return l.jsx(Qp,{...o,...r,ref:t})});im.displayName=dM;var fM=rm,Eu=sm,Mu=im;const hM=w.forwardRef(function({orientation:t="vertical",className:n,style:r,...o},s){return l.jsx(fM,{ref:s,className:n,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:t==="horizontal"?16:8,...r},...o})}),pM=w.forwardRef(function({className:t,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=re(r,n,"radio",t);return l.jsxs(Eu,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Mu,{})]})}const{className:a,style:c,styleTag:u}=re(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Eu,{ref:i,className:K("radio",t),...s,children:l.jsx(Mu,{})}),l.jsx("span",{children:o})]})});var ns="Switch",[mM]=Te(ns),[gM,yM]=mM(ns),am=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=m.useState(null),v=se(t,C=>p(C)),g=m.useRef(!1),y=h?d||!!h.closest("form"):!0,[x,b]=we({prop:o,defaultProp:s??!1,onChange:u,caller:ns});return l.jsxs(gM,{scope:n,checked:x,disabled:a,children:[l.jsx(Q.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":dm(x),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:v,onClick:z(e.onClick,C=>{b(S=>!S),y&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),y&&l.jsx(um,{control:h,bubbles:!g.current,name:r,value:c,checked:x,required:i,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});am.displayName=ns;var cm="SwitchThumb",lm=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=yM(cm,n);return l.jsx(Q.span,{"data-state":dm(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});lm.displayName=cm;var vM="SwitchBubbleInput",um=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=m.useRef(null),a=se(i,s),c=yr(n),u=pr(t);return m.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const v=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(v)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});um.displayName=vM;function dm(e){return e?"checked":"unchecked"}var Au=am,Nu=lm;const xM=w.forwardRef(function({className:t,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=re(r,n,"switch",t);return l.jsxs(Au,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Nu,{className:"switch-thumb"})]})}const{className:a,style:c,styleTag:u}=re(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Au,{ref:i,className:K("switch",t),...s,children:l.jsx(Nu,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function io(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function ju(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function Wr(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function qs(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function bM(e,t){return e.getFullYear()===t.getFullYear()}function st(e){return new Date(e.getFullYear(),e.getMonth(),1)}function wM(e){return new Date(e.getFullYear(),0,1)}function Du(e){return new Date(Math.floor(e.getFullYear()/10)*10,0,1)}function Gr(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function Ro(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function rt(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}function Zs(e,t,n,r=0){const o=new Date(e);return o.setHours(t,n,r,0),o}function ke(e,t,n){return t&&e.getTime()<t.getTime()?new Date(t):n&&e.getTime()>n.getTime()?new Date(n):e}function CM(e,t){const n=st(e),r=(n.getDay()-t+7)%7,o=Ro(n,-r);return Array.from({length:42},(s,i)=>Ro(o,i))}function SM(e,t){const n=new Intl.DateTimeFormat(e,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=Ro(r,(s+t)%7);return n.format(i)})}function TM(e,t="short"){const n=new Intl.DateTimeFormat(e,{month:t});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function ku(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function RM(e,t){return new Intl.DateTimeFormat(t,{year:"numeric"}).format(e)}function PM(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function fm(e,t){return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}function hm(e,t,n,r){return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(e)}function EM(e,t,n,r){return`${fm(e,t)} · ${hm(e,t,n,r)}`}function Ur(e){if(e==null||e==="")return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e);const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function zr(e,t){return e.getTime()<t.getTime()}function Hr(e,t){return e.getTime()>t.getTime()}function Kr(e){return e<10?`0${e}`:String(e)}function MM(e){return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function AM(e){try{return new Intl.DateTimeFormat(e,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function NM(e,t,n,r,o){switch(t){case"year":return RM(e,n);case"month":return PM(e,n);case"time":return hm(e,n,r,o);case"datetime":return EM(e,n,r,o);case"date":default:return fm(e,n)}}function jM(e,t){switch(t){case"year":return wM(e);case"month":return st(e);case"date":return io(e);default:return new Date(e)}}const DM=w.forwardRef(function({mode:t="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:p=!1,clearable:v=!0,locale:g,weekStartsOn:y=0,hour12:x,showSeconds:b=!1,minuteStep:C=1,secondStep:S=1,format:T,icon:E,required:R=!1,validate:P,error:M,onValidate:A,id:j,className:F,style:G,sx:H,"aria-invalid":J,"aria-describedby":O,dialogLabel:$,name:N,open:I,onOpenChange:V,...Y},k){const Z=MM(g),_=x??AM(Z),U=w.useId(),B=j??`cny-dp-${U}`,L=`${B}-dialog`,ee=`${B}-hint`,W=w.useMemo(()=>{const D=Ur(s),q=a==="future"||a==="current"?io(new Date):null;return D&&q?D.getTime()>q.getTime()?D:q:D??q},[s,a]),X=w.useMemo(()=>{const D=Ur(i),q=a==="past"||a==="current"?ju(new Date):null;return D&&q?D.getTime()<q.getTime()?D:q:D??q},[i,a]),ae=n!==void 0,[ce,Ce]=w.useState(()=>Ur(r)),oe=ae?Ur(n):ce,ht=I!==void 0,[Bt,Wt]=w.useState(!1),Re=ht?I:Bt,Le=w.useCallback(D=>{ht||Wt(D),V==null||V(D)},[ht,V]),bc=w.useMemo(()=>oe??ke(new Date,W,X),[oe,W,X]),[fe,De]=w.useState(()=>st(bc)),[me,Se]=w.useState(()=>bc),fs=t==="month"?"month":t==="year"?"year":"date",[Ve,Gt]=w.useState(fs),hs=w.useRef(null);w.useImperativeHandle(k,()=>hs.current,[]);const $n=w.useRef(null),ps=w.useRef(null),wc=w.useRef(null),ms=w.useRef(null),[hy,py]=w.useState({}),[my,gy]=w.useState(!1);w.useEffect(()=>gy(!0),[]);const un=w.useCallback(D=>W&&zr(D,W)||X&&Hr(D,X)?!0:c?c(D):!1,[W,X,c]),Rr=w.useCallback(D=>u?u(D):!1,[u]),dn=w.useMemo(()=>{if(M)return typeof M=="string"?M:"Invalid";if(R&&!oe)return"Required";if(oe){const q=io(new Date);if(a==="future"&&zr(oe,q))return"Must be today or later";if(a==="past"&&Hr(oe,ju(new Date)))return"Must be today or earlier";if(a==="current"&&!Wr(oe,q))return"Must be today";if(W&&zr(oe,W))return"Too early";if(X&&Hr(oe,X))return"Too late";if(c&&c(oe))return"Unavailable date";if(u&&u(oe))return"Unavailable time"}const D=P==null?void 0:P(oe);return D||null},[M,R,oe,a,W,X,c,u,P]),Cc=w.useRef(null);w.useEffect(()=>{Cc.current!==dn&&(Cc.current=dn,A==null||A(dn))},[dn,A]);const Pr=dn!==null,Sc=Pr?"danger":h,yy=oe?T?T(oe,t):NM(oe,t,Z,_,b):"",vy=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[t],xy=$??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[t],xt=w.useCallback(D=>{ae||Ce(D),o==null||o(D)},[ae,o]),Er=w.useCallback(()=>{var D;Le(!1),(D=$n.current)==null||D.focus()},[Le]),by=w.useCallback(D=>{var q;D.stopPropagation(),xt(null),(q=$n.current)==null||q.focus()},[xt]),Tc=w.useCallback(()=>{if(p)return;const D=oe??ke(new Date,W,X);De(st(D)),Se(D),Gt(fs),Le(!0)},[p,oe,W,X,Le,fs]);w.useEffect(()=>{if(!Re)return;const D=q=>{var le,te;const ie=q.target;(le=hs.current)!=null&&le.contains(ie)||(te=ps.current)!=null&&te.contains(ie)||Le(!1)};return document.addEventListener("pointerdown",D,!0),()=>document.removeEventListener("pointerdown",D,!0)},[Re,Le]);const Mr=w.useCallback(()=>{const D=$n.current,q=ps.current;if(!D||!q)return;const ie=D.getBoundingClientRect(),le=q.offsetHeight||340,te=q.offsetWidth||264,$e=window.innerHeight,Ae=window.innerWidth,Be=4,ve=8,bt=$e-ie.bottom,ys=ie.top,Uy=bt<le+Be&&ys>bt?Math.max(ve,ie.top-Be-le):Math.min($e-le-ve,ie.bottom+Be),zy=Math.max(ve,Math.min(ie.left,Ae-te-ve));py({position:"fixed",top:Uy,left:zy,width:te})},[]);w.useLayoutEffect(()=>{Re&&Mr()},[Re,t,Mr]),w.useEffect(()=>{if(!Re)return;const D=()=>Mr();return window.addEventListener("scroll",D,!0),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",D)}},[Re,Mr]),w.useEffect(()=>{var D,q;Re&&(Ve==="date"&&(t==="date"||t==="datetime")?(D=wc.current)==null||D.focus():(Ve==="month"||Ve==="year")&&((q=ms.current)==null||q.focus()))},[Re,me,t,Ve]);const Rc=w.useCallback(()=>{var D;Ve==="year"&&t!=="year"?Gt("month"):Ve==="month"&&t!=="month"?Gt("date"):(Le(!1),(D=$n.current)==null||D.focus())},[Ve,t,Le]),Ar=w.useCallback(D=>{const q=ke(D,W,X);Se(q),De(ie=>qs(ie,q)?ie:st(q))},[W,X]),Bn=w.useCallback((D,q)=>{const ie=jM(D,t);if(t!=="time"&&un(ie))return;const le=t==="time"||t==="datetime"?Zs(ie,(oe??D).getHours(),(oe??D).getMinutes(),b?(oe??D).getSeconds():0):ie;xt(le),Se(le),((q==null?void 0:q.close)??(t!=="datetime"&&t!=="time"))&&Er()},[t,un,xt,oe,b,Er]),Nr=w.useCallback((D,q)=>{const ie=oe??ke(new Date,W,X),le=D==="hour"?q:ie.getHours(),te=D==="minute"?q:ie.getMinutes(),$e=D==="second"?q:b?ie.getSeconds():0,Ae=Zs(ie,le,te,$e);Rr(Ae)||(xt(Ae),Se(Ae))},[oe,W,X,b,Rr,xt]),fn=w.useCallback(D=>Ar(Ro(me,D)),[Ar,me]),wy=D=>{switch(D.key){case"ArrowLeft":D.preventDefault(),fn(-1);break;case"ArrowRight":D.preventDefault(),fn(1);break;case"ArrowUp":D.preventDefault(),fn(-7);break;case"ArrowDown":D.preventDefault(),fn(7);break;case"Home":{D.preventDefault();const q=(me.getDay()-y+7)%7;fn(-q);break}case"End":{D.preventDefault();const q=(me.getDay()-y+7)%7;fn(6-q);break}case"PageUp":D.preventDefault(),Ar(D.shiftKey?rt(me,-1):Gr(me,-1));break;case"PageDown":D.preventDefault(),Ar(D.shiftKey?rt(me,1):Gr(me,1));break;case"Enter":case" ":D.preventDefault(),Bn(me);break;case"Escape":D.preventDefault(),Rc();break}},Cy=w.useMemo(()=>CM(fe,y),[fe,y]),Sy=w.useMemo(()=>SM(Z,y),[Z,y]),Ty=w.useMemo(()=>TM(Z,"short"),[Z]),gs=w.useMemo(()=>io(new Date),[]),Ry=!W||!zr(st(fe),st(W)),Py=!X||!Hr(st(fe),st(X)),Ey=!W||fe.getFullYear()-1>=W.getFullYear(),My=!X||fe.getFullYear()+1<=X.getFullYear(),Ut=Du(fe).getFullYear(),Ay=!W||Ut-10+9>=W.getFullYear(),Ny=!X||Ut+10<=X.getFullYear(),jy=t==="time"?!Rr(new Date):!un(gs),Dy=()=>{if(t==="time"){const D=new Date;if(Rr(D))return;const ie=Zs(oe??D,D.getHours(),D.getMinutes(),b?D.getSeconds():0);xt(ie),Se(ie);return}Bn(gs,{close:t!=="datetime"})},ky=K("cny-datepicker-trigger","input",Sc!=="primary"&&Sc,f==="sm"||f==="lg"?f:null,oe&&"has-value",Re&&"is-open"),Iy=E??(t==="time"?l.jsx(tS,{size:15}):l.jsx(BC,{size:15})),Pc=(D,q)=>{let le=!0;switch(D.key){case"ArrowLeft":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()+11)%12,Math.min(te.getDate(),28)),W,X):te=>ke(new Date(te.getFullYear()-1,te.getMonth(),Math.min(te.getDate(),28)),W,X));break;case"ArrowRight":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()+1)%12,Math.min(te.getDate(),28)),W,X):te=>ke(new Date(te.getFullYear()+1,te.getMonth(),Math.min(te.getDate(),28)),W,X));break;case"ArrowUp":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()-3+12)%12,Math.min(te.getDate(),28)),W,X):te=>ke(new Date(te.getFullYear()-3,te.getMonth(),Math.min(te.getDate(),28)),W,X));break;case"ArrowDown":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()+3)%12,Math.min(te.getDate(),28)),W,X):te=>ke(new Date(te.getFullYear()+3,te.getMonth(),Math.min(te.getDate(),28)),W,X));break;case"PageUp":De(q==="month"?te=>rt(te,D.shiftKey?-10:-1):te=>rt(te,D.shiftKey?-100:-10));break;case"PageDown":De(q==="month"?te=>rt(te,D.shiftKey?10:1):te=>rt(te,D.shiftKey?100:10));break;case"Enter":case" ":q==="month"?Ec(new Date(fe.getFullYear(),me.getMonth(),1)):Mc(me.getFullYear());break;case"Escape":Rc();break;default:le=!1}le&&D.preventDefault()};w.useEffect(()=>{if(Re&&Ve==="year"){const D=Du(fe).getFullYear(),q=me.getFullYear();(q<D-1||q>D+10)&&De(new Date(q,0,1))}},[Re,Ve,me,fe]);const Ec=D=>{t==="month"?Bn(D):(De(st(D)),Se(ke(D,W,X)),Gt("date"))},Mc=D=>{if(t==="year")Bn(new Date(D,0,1));else{const q=new Date(D,fe.getMonth(),1);De(q),Se(ke(new Date(D,me.getMonth(),Math.min(me.getDate(),28)),W,X)),Gt("month")}},Oy=()=>{const D=me.getMonth();return Ty.map((q,ie)=>{const le=new Date(fe.getFullYear(),ie,1),te=!!oe&&qs(le,oe)&&bM(le,oe),$e=le.getMonth()===fe.getMonth()&&t!=="month",Ae=ie===D,Be=un(le);return l.jsx("button",{ref:Ae?ms:void 0,type:"button",tabIndex:Ae?0:-1,className:K("cny-datepicker-chip",te&&"is-selected",$e&&!te&&"is-current"),disabled:Be,onClick:()=>Ec(le),onFocus:()=>Se(new Date(fe.getFullYear(),ie,Math.min(me.getDate(),28))),children:q},ie)})},_y=()=>{const D=Ut-1,q=me.getFullYear();return Array.from({length:12},(ie,le)=>{const te=D+le,$e=new Date(te,0,1),Ae=!!oe&&oe.getFullYear()===te,Be=te===fe.getFullYear()&&t!=="year",ve=te===q,bt=un($e),ys=te<Ut||te>=Ut+10;return l.jsx("button",{ref:ve?ms:void 0,type:"button",tabIndex:ve?0:-1,className:K("cny-datepicker-chip",Ae&&"is-selected",Be&&!Ae&&"is-current",ys&&"is-outside"),disabled:bt,onClick:()=>Mc(te),onFocus:()=>Se(new Date(te,me.getMonth(),Math.min(me.getDate(),28))),children:te},te)})},Ly=w.useRef(null),Ac=w.useRef(null),Nc=w.useRef(null),jc=()=>{const D=oe??ke(new Date,W,X),q=D.getHours(),ie=D.getMinutes(),le=D.getSeconds(),te=q>=12,$e=_?q%12===0?12:q%12:q,Ae=ve=>{const bt=_?te?ve===12?12:ve+12:ve===12?0:ve:ve;Nr("hour",bt)},Be=ve=>{const bt=ve?q<12?q+12:q:q>=12?q-12:q;Nr("hour",bt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Qs,{ref:Ly,ariaLabel:"Hour",value:$e,min:_?1:0,max:_?12:23,step:1,nextRef:Ac,onChange:Ae}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Qs,{ref:Ac,ariaLabel:"Minute",value:ie-ie%Math.max(1,C),min:0,max:59,step:Math.max(1,C),nextRef:b?Nc:void 0,onChange:ve=>Nr("minute",ve)}),b&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Qs,{ref:Nc,ariaLabel:"Second",value:le-le%Math.max(1,S),min:0,max:59,step:Math.max(1,S),onChange:ve=>Nr("second",ve)})]}),_&&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:K("cny-dp-ampm-btn",!te&&"is-active"),onClick:()=>Be(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":te,className:K("cny-dp-ampm-btn",te&&"is-active"),onClick:()=>Be(!0),children:"PM"})]})]})})},Fy=()=>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:!Ry,onClick:()=>De(D=>Gr(D,-1)),children:l.jsx(no,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${ku(fe,Z)})`,onClick:()=>Gt("month"),children:ku(fe,Z)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Py,onClick:()=>De(D=>Gr(D,1)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:wy,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:Sy.map((D,q)=>l.jsx("span",{role:"columnheader","aria-label":D,className:"cny-datepicker-weekday",children:D.slice(0,2)},q))}),Array.from({length:6},(D,q)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:Cy.slice(q*7,q*7+7).map(ie=>{const le=!qs(ie,fe),te=Wr(ie,oe),$e=Wr(ie,gs),Ae=Wr(ie,me),Be=un(ie);return l.jsx("button",{ref:Ae?wc:void 0,type:"button",role:"gridcell",tabIndex:Ae?0:-1,"aria-selected":te,"aria-current":$e?"date":void 0,"aria-disabled":Be||void 0,disabled:Be,className:K("cny-datepicker-cell",le&&"is-outside",te&&"is-selected",$e&&"is-today"),onClick:()=>Bn(ie),onFocus:()=>Se(ie),children:ie.getDate()},ie.toISOString())})},q))]})]}),Vy=()=>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:!Ey,onClick:()=>De(D=>rt(D,-1)),children:l.jsx(no,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${fe.getFullYear()})`,onClick:()=>Gt("year"),children:fe.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!My,onClick:()=>De(D=>rt(D,1)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:D=>Pc(D,"month"),children:Oy()})]}),$y=()=>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:!Ay,onClick:()=>De(D=>rt(D,-10)),children:l.jsx(no,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${Ut} – ${Ut+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Ny,onClick:()=>De(D=>rt(D,10)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:D=>Pc(D,"year"),children:_y()})]}),{className:By,style:Wy,styleTag:Gy}=re(H,G,"cny-datepicker",`mode-${t}`,p&&"is-disabled",F);return l.jsxs("div",{ref:hs,className:By,style:Wy,...Y,children:[Gy,N&&l.jsx("input",{type:"hidden",name:N,value:oe?oe.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:$n,type:"button",id:B,className:ky,"aria-haspopup":"dialog","aria-expanded":Re,"aria-controls":Re?L:void 0,"aria-invalid":J||Pr,"aria-describedby":K(O,Pr?ee:void 0)||void 0,"aria-required":R||void 0,disabled:p,onClick:Tc,onKeyDown:D=>{D.key==="ArrowDown"||D.key==="Enter"||D.key===" "?(D.preventDefault(),Tc()):D.key==="Escape"&&Re&&(D.preventDefault(),Le(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Iy}),l.jsx("span",{className:K("cny-datepicker-value",!oe&&"is-placeholder"),children:yy||vy}),v&&oe&&!p&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:by,onPointerDown:D=>D.stopPropagation(),children:l.jsx(Ot,{size:13,"aria-hidden":"true"})})]}),Pr&&M!==!1&&l.jsx("span",{id:ee,className:"cny-datepicker-error",role:"alert",children:typeof M=="string"?M:M??dn}),Re&&my&&Ao.createPortal(l.jsxs("div",{ref:ps,id:L,role:"dialog","aria-modal":"false","aria-label":xy,className:K("cny-datepicker-panel",`is-${t}`),style:hy,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(t==="date"||t==="datetime")&&Ve==="date"&&Fy(),(t==="date"||t==="datetime"||t==="month")&&Ve==="month"&&Vy(),(t==="date"||t==="datetime"||t==="month"||t==="year")&&Ve==="year"&&$y(),t==="time"&&jc(),t==="datetime"&&Ve==="date"&&jc()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!jy,onClick:Dy,children:t==="time"?"Now":t==="year"?"This year":t==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),v&&oe&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{xt(null),Er()},children:"Clear"}),(t==="datetime"||t==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:Er,children:"Done"})]})]}),document.body)]})}),Qs=w.forwardRef(function({value:t,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=w.useRef(null);w.useImperativeHandle(c,()=>u.current,[]);const[d,f]=w.useState(()=>Kr(t)),h=w.useRef(!1);w.useEffect(()=>{h.current||f(Kr(t))},[t]);const p=w.useCallback(x=>{if(!Number.isFinite(x))return;let b=Math.max(n,Math.min(r,x));b=Math.round(b/o)*o,b>r&&(b=Math.floor(r/o)*o),a(b),f(Kr(b))},[n,r,o,a]),v=()=>{const x=t+o;p(x>r?n:x)},g=()=>{const x=t-o;p(x<n?Math.floor(r/o)*o:x)},y=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),v();break;case"ArrowDown":x.preventDefault(),g();break;case"PageUp":x.preventDefault(),p(t+o*5);break;case"PageDown":x.preventDefault(),p(t-o*5);break;case"Home":x.preventDefault(),p(n);break;case"End":x.preventDefault(),p(r);break;case"Enter":x.preventDefault(),p(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?v():x.deltaY>0&&g())},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":t,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var C;const b=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(b),b.length===2){const S=parseInt(b,10);Number.isFinite(S)&&S>=n&&S<=r&&(p(S),(C=i==null?void 0:i.current)==null||C.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?p(x):f(Kr(t))},onKeyDown:y}),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:v,onMouseDown:x=>x.preventDefault(),children:l.jsx(Kf,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(dr,{size:10,"aria-hidden":"true"})})]})]})});function kM({hotkey:e=!0}={}){const[t,n]=w.useState(!1);return w.useEffect(()=>{if(!e)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)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}function IM({open:e,onOpenChange:t,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),t(!1))};return l.jsxs(be.Dialog,{open:e,onOpenChange:t,label:o,contentClassName:K("cny-cmdk-content",u),children:[l.jsxs(_a,{children:[l.jsx(qa,{children:o}),l.jsx(Za,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(qf,{size:16,"aria-hidden":"true"}),l.jsx(be.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(be.List,{className:"cny-cmdk-list",children:[l.jsx(be.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(be.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var p;return l.jsxs(be.Item,{value:`${f.title} ${h.label} ${((p=h.keywords)==null?void 0:p.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 OM({onClick:e,label:t="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:e,className:K("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(qf,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:t}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let _M=0;const LM=()=>`cny-toast-${Date.now().toString(36)}-${++_M}`,pm=w.createContext(null),FM={default:null,success:l.jsx(ZC,{size:16,"aria-hidden":"true"}),info:l.jsx(yS,{size:16,"aria-hidden":"true"}),warning:l.jsx(SS,{size:16,"aria-hidden":"true"}),danger:l.jsx(XC,{size:16,"aria-hidden":"true"}),loading:l.jsx(Xf,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function VM({children:e,position:t="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=w.useState([]),[a,c]=w.useState(!1);w.useEffect(()=>c(!0),[]);const u=w.useCallback(g=>{i(y=>y.map(x=>g==null||x.id===g?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(y=>y.filter(x=>g==null?!1:x.id!==g||!x.exiting)),i(y=>(y.filter(x=>x.exiting&&(g==null||x.id===g)).forEach(x=>{var b;return(b=x.onDismiss)==null?void 0:b.call(x)}),y.filter(x=>!x.exiting||g!=null&&x.id!==g)))},200)},[]),d=w.useCallback(g=>{const y=g.id??LM(),x={id:y,title:g.title,description:g.description,action:g.action,icon:g.icon,variant:g.variant??"default",duration:g.duration??n,dismissible:g.dismissible??!0,onDismiss:g.onDismiss,sx:g.sx};return i(b=>{const S=[...b.filter(T=>T.id!==y),x];return S.length>r?S.slice(S.length-r):S}),y},[n,r]),f=w.useCallback((g,y)=>{i(x=>x.map(b=>b.id===g?{...b,...y,variant:y.variant??b.variant,duration:y.duration??b.duration,dismissible:y.dismissible??b.dismissible}:b))},[]),h=w.useMemo(()=>{const g=(y=>d(typeof y=="string"?{title:y}:y));return g.success=(y,x)=>d({...x,title:y,variant:"success"}),g.info=(y,x)=>d({...x,title:y,variant:"info"}),g.warning=(y,x)=>d({...x,title:y,variant:"warning"}),g.error=(y,x)=>d({...x,title:y,variant:"danger"}),g.loading=(y,x)=>d({...x,title:y,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),g},[d]),p=w.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),v=t.startsWith("top-");return l.jsxs(pm.Provider,{value:p,children:[e,a&&Ao.createPortal(l.jsx("ol",{className:K("cny-toast-viewport",`pos-${t}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(v?[...s].reverse():s).map(g=>l.jsx($M,{toast:g,onDismiss:()=>u(g.id)},g.id))}),document.body)]})}function $M({toast:e,onDismiss:t}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=e,[d,f]=w.useState(!1),h=w.useRef(null);w.useEffect(()=>{if(!e.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(t,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,t,e.exiting]);const p=n==="danger"||n==="warning"?"alert":"status",v=i!==!1,g=i!==void 0&&i!==!1?i:FM[n],{className:y,style:x,styleTag:b}=re(u,void 0,"cny-toast",n,e.exiting&&"is-exiting");return l.jsxs("li",{role:p,"aria-atomic":"true",className:y,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[b,v&&g&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:g}),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:t,children:l.jsx(Ot,{size:14,"aria-hidden":"true"})})]})}function BM(){const e=w.useContext(pm);if(!e)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return e}const mm=w.forwardRef(function({title:t,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:p,styleTag:v}=re(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Ha,{...d,children:l.jsxs(Ka,{children:[l.jsx(Ya,{className:"cny-dialog-overlay"}),l.jsxs(Xa,{ref:f,className:h,style:p,children:[v,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(qa,{className:"cny-dialog-title",children:t}),n&&l.jsx(Za,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Qo,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Ot,{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})]})]})})}),WM=Ip,GM=Qo;function gm({open:e,onOpenChange:t,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:p}){const v=()=>{d==null||d(),t(!1)};return l.jsx(mm,{open:e,onOpenChange:t,size:"sm",title:n,className:K("cny-confirm",f),style:h,sx:p,footer:l.jsxs(l.Fragment,{children:[l.jsx(er,{variant:"ghost",color:"primary",onClick:v,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 UM(){const[e,t]=w.useState(null),n=w.useCallback(i=>new Promise(a=>{t({...i,resolve:a})}),[]),r=w.useCallback(i=>{i||t(a=>(a==null||a.resolve(!1),null))},[]),o=w.useCallback(()=>{t(i=>(i==null||i.resolve(!0),null))},[]),s=e?l.jsx(gm,{open:!0,onOpenChange:r,title:e.title,message:e.message,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,danger:e.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const zM=w.forwardRef(function({title:t,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:p,style:v,styleTag:g}=re(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Ha,{...f,children:l.jsxs(Ka,{children:[l.jsx(Ya,{className:"cny-drawer-overlay"}),l.jsxs(Xa,{ref:h,className:p,style:v,children:[g,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(qa,{className:"cny-drawer-title",children:t}),n&&l.jsx(Za,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Qo,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Ot,{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})]})]})})}),HM=Ip,KM=Qo;var Bi=["Enter"," "],YM=["ArrowDown","PageUp","Home"],ym=["ArrowUp","PageDown","End"],XM=[...YM,...ym],qM={ltr:[...Bi,"ArrowRight"],rtl:[...Bi,"ArrowLeft"]},ZM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wr="Menu",[nr,QM,JM]=lr(wr),[ln,vm]=Te(wr,[JM,_t,kt]),Cr=_t(),xm=kt(),[bm,$t]=ln(wr),[eA,Sr]=ln(wr),wm=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Cr(t),[c,u]=m.useState(null),d=m.useRef(!1),f=Qe(s),h=Dt(o);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),l.jsx(mr,{...a,children:l.jsx(bm,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(eA,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};wm.displayName=wr;var tA="MenuAnchor",tc=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Cr(n);return l.jsx(gr,{...o,...r,ref:t})});tc.displayName=tA;var nc="MenuPortal",[nA,Cm]=ln(nc,{forceMount:void 0}),Sm=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=$t(nc,t);return l.jsx(nA,{scope:t,forceMount:n,children:l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:r})})})};Sm.displayName=nc;var Ke="MenuContent",[rA,rc]=ln(Ke),Tm=m.forwardRef((e,t)=>{const n=Cm(Ke,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=$t(Ke,e.__scopeMenu),i=Sr(Ke,e.__scopeMenu);return l.jsx(nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ne,{present:r||s.open,children:l.jsx(nr.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(oA,{...o,ref:t}):l.jsx(sA,{...o,ref:t})})})})}),oA=m.forwardRef((e,t)=>{const n=$t(Ke,e.__scopeMenu),r=m.useRef(null),o=se(t,r);return m.useEffect(()=>{const s=r.current;if(s)return zo(s)},[]),l.jsx(oc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),sA=m.forwardRef((e,t)=>{const n=$t(Ke,e.__scopeMenu);return l.jsx(oc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),iA=en("MenuContent.ScrollLock"),oc=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:v,...g}=e,y=$t(Ke,n),x=Sr(Ke,n),b=Cr(n),C=xm(n),S=QM(n),[T,E]=m.useState(null),R=m.useRef(null),P=se(t,R,y.onContentChange),M=m.useRef(0),A=m.useRef(""),j=m.useRef(0),F=m.useRef(null),G=m.useRef("right"),H=m.useRef(0),J=v?vr:m.Fragment,O=v?{as:iA,allowPinchZoom:!0}:void 0,$=I=>{var L,ee;const V=A.current+I,Y=S().filter(W=>!W.disabled),k=document.activeElement,Z=(L=Y.find(W=>W.ref.current===k))==null?void 0:L.textValue,_=Y.map(W=>W.textValue),U=vA(_,V,Z),B=(ee=Y.find(W=>W.textValue===U))==null?void 0:ee.ref.current;(function W(X){A.current=X,window.clearTimeout(M.current),X!==""&&(M.current=window.setTimeout(()=>W(""),1e3))})(V),B&&setTimeout(()=>B.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),Fo();const N=m.useCallback(I=>{var Y,k;return G.current===((Y=F.current)==null?void 0:Y.side)&&bA(I,(k=F.current)==null?void 0:k.area)},[]);return l.jsx(rA,{scope:n,searchRef:A,onItemEnter:m.useCallback(I=>{N(I)&&I.preventDefault()},[N]),onItemLeave:m.useCallback(I=>{var V;N(I)||((V=R.current)==null||V.focus(),E(null))},[N]),onTriggerLeave:m.useCallback(I=>{N(I)&&I.preventDefault()},[N]),pointerGraceTimerRef:j,onPointerGraceIntentChange:m.useCallback(I=>{F.current=I},[]),children:l.jsx(J,{...O,children:l.jsx(fr,{asChild:!0,trapped:o,onMountAutoFocus:z(s,I=>{var V;I.preventDefault(),(V=R.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(In,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:l.jsx(_o,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:E,onEntryFocus:z(c,I=>{x.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Go,{role:"menu","aria-orientation":"vertical","data-state":Bm(y.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:z(g.onKeyDown,I=>{const Y=I.target.closest("[data-radix-menu-content]")===I.currentTarget,k=I.ctrlKey||I.altKey||I.metaKey,Z=I.key.length===1;Y&&(I.key==="Tab"&&I.preventDefault(),!k&&Z&&$(I.key));const _=R.current;if(I.target!==_||!XM.includes(I.key))return;I.preventDefault();const B=S().filter(L=>!L.disabled).map(L=>L.ref.current);ym.includes(I.key)&&B.reverse(),gA(B)}),onBlur:z(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(M.current),A.current="")}),onPointerMove:z(e.onPointerMove,rr(I=>{const V=I.target,Y=H.current!==I.clientX;if(I.currentTarget.contains(V)&&Y){const k=I.clientX>H.current?"right":"left";G.current=k,H.current=I.clientX}}))})})})})})})});Tm.displayName=Ke;var aA="MenuGroup",sc=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Q.div,{role:"group",...r,ref:t})});sc.displayName=aA;var cA="MenuLabel",Rm=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Q.div,{...r,ref:t})});Rm.displayName=cA;var Po="MenuItem",Iu="menu.itemSelect",rs=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=m.useRef(null),i=Sr(Po,e.__scopeMenu),a=rc(Po,e.__scopeMenu),c=se(t,s),u=m.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(Iu,{bubbles:!0,cancelable:!0});f.addEventListener(Iu,p=>r==null?void 0:r(p),{once:!0}),Df(f,h),h.defaultPrevented?u.current=!1:i.onClose()}};return l.jsx(Pm,{...o,ref:c,disabled:n,onClick:z(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:z(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:z(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||Bi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});rs.displayName=Po;var Pm=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=rc(Po,n),a=xm(n),c=m.useRef(null),u=se(t,c),[d,f]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const v=c.current;v&&p((v.textContent??"").trim())},[s.children]),l.jsx(nr.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:l.jsx(Lo,{asChild:!0,...a,focusable:!r,children:l.jsx(Q.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:z(e.onPointerMove,rr(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,rr(v=>i.onItemLeave(v))),onFocus:z(e.onFocus,()=>f(!0)),onBlur:z(e.onBlur,()=>f(!1))})})})}),lA="MenuCheckboxItem",Em=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return l.jsx(Dm,{scope:e.__scopeMenu,checked:n,children:l.jsx(rs,{role:"menuitemcheckbox","aria-checked":Eo(n)?"mixed":n,...o,ref:t,"data-state":cc(n),onSelect:z(o.onSelect,()=>r==null?void 0:r(Eo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Em.displayName=lA;var Mm="MenuRadioGroup",[uA,dA]=ln(Mm,{value:void 0,onValueChange:()=>{}}),Am=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Qe(r);return l.jsx(uA,{scope:e.__scopeMenu,value:n,onValueChange:s,children:l.jsx(sc,{...o,ref:t})})});Am.displayName=Mm;var Nm="MenuRadioItem",jm=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=dA(Nm,e.__scopeMenu),s=n===o.value;return l.jsx(Dm,{scope:e.__scopeMenu,checked:s,children:l.jsx(rs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":cc(s),onSelect:z(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});jm.displayName=Nm;var ic="MenuItemIndicator",[Dm,fA]=ln(ic,{checked:!1}),km=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=fA(ic,n);return l.jsx(Ne,{present:r||Eo(s.checked)||s.checked===!0,children:l.jsx(Q.span,{...o,ref:t,"data-state":cc(s.checked)})})});km.displayName=ic;var hA="MenuSeparator",Im=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Q.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Im.displayName=hA;var pA="MenuArrow",Om=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Cr(n);return l.jsx(Uo,{...o,...r,ref:t})});Om.displayName=pA;var ac="MenuSub",[mA,_m]=ln(ac),Lm=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=$t(ac,t),i=Cr(t),[a,c]=m.useState(null),[u,d]=m.useState(null),f=Qe(o);return m.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(mr,{...i,children:l.jsx(bm,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(mA,{scope:t,contentId:ge(),triggerId:ge(),trigger:a,onTriggerChange:c,children:n})})})};Lm.displayName=ac;var Hn="MenuSubTrigger",Fm=m.forwardRef((e,t)=>{const n=$t(Hn,e.__scopeMenu),r=Sr(Hn,e.__scopeMenu),o=_m(Hn,e.__scopeMenu),s=rc(Hn,e.__scopeMenu),i=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),l.jsx(tc,{asChild:!0,...u,children:l.jsx(Pm,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Bm(n.open),...e,ref:mt(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,rr(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:z(e.onPointerLeave,rr(f=>{var p,v;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const g=(v=n.content)==null?void 0:v.dataset.side,y=g==="right",x=y?-5:5,b=h[y?"left":"right"],C=h[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:b,y:h.top},{x:C,y:h.top},{x:C,y:h.bottom},{x:b,y:h.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,f=>{var p;const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||qM[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});Fm.displayName=Hn;var Vm="MenuSubContent",$m=m.forwardRef((e,t)=>{const n=Cm(Ke,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=$t(Ke,e.__scopeMenu),i=Sr(Ke,e.__scopeMenu),a=_m(Vm,e.__scopeMenu),c=m.useRef(null),u=se(t,c);return l.jsx(nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ne,{present:r||s.open,children:l.jsx(nr.Slot,{scope:e.__scopeMenu,children:l.jsx(oc,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:z(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:z(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=ZM[i.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),d.preventDefault())})})})})})});$m.displayName=Vm;function Bm(e){return e?"open":"closed"}function Eo(e){return e==="indeterminate"}function cc(e){return Eo(e)?"indeterminate":e?"checked":"unchecked"}function gA(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function yA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vA(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=yA(e,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}function xA(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[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}function bA(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return xA(n,t)}function rr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var wA=wm,CA=tc,SA=Sm,TA=Tm,RA=sc,PA=Rm,EA=rs,MA=Em,AA=Am,NA=jm,jA=km,DA=Im,kA=Om,IA=Lm,OA=Fm,_A=$m,os="DropdownMenu",[LA]=Te(os,[vm]),je=vm(),[FA,Wm]=LA(os),Gm=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=je(t),u=m.useRef(null),[d,f]=we({prop:o,defaultProp:s??!1,onChange:i,caller:os});return l.jsx(FA,{scope:t,triggerId:ge(),triggerRef:u,contentId:ge(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(wA,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};Gm.displayName=os;var Um="DropdownMenuTrigger",zm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Wm(Um,n),i=je(n);return l.jsx(CA,{asChild:!0,...i,children:l.jsx(Q.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:mt(t,s.triggerRef),onPointerDown:z(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:z(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});zm.displayName=Um;var VA="DropdownMenuPortal",Hm=e=>{const{__scopeDropdownMenu:t,...n}=e,r=je(t);return l.jsx(SA,{...r,...n})};Hm.displayName=VA;var Km="DropdownMenuContent",Ym=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wm(Km,n),s=je(n),i=m.useRef(!1);return l.jsx(TA,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:z(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!o.modal||d)&&(i.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)"}})});Ym.displayName=Km;var $A="DropdownMenuGroup",BA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(RA,{...o,...r,ref:t})});BA.displayName=$A;var WA="DropdownMenuLabel",Xm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(PA,{...o,...r,ref:t})});Xm.displayName=WA;var GA="DropdownMenuItem",qm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(EA,{...o,...r,ref:t})});qm.displayName=GA;var UA="DropdownMenuCheckboxItem",Zm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(MA,{...o,...r,ref:t})});Zm.displayName=UA;var zA="DropdownMenuRadioGroup",Qm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(AA,{...o,...r,ref:t})});Qm.displayName=zA;var HA="DropdownMenuRadioItem",Jm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(NA,{...o,...r,ref:t})});Jm.displayName=HA;var KA="DropdownMenuItemIndicator",eg=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(jA,{...o,...r,ref:t})});eg.displayName=KA;var YA="DropdownMenuSeparator",tg=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(DA,{...o,...r,ref:t})});tg.displayName=YA;var XA="DropdownMenuArrow",qA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(kA,{...o,...r,ref:t})});qA.displayName=XA;var ZA=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=je(t),[a,c]=we({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(IA,{...i,open:a,onOpenChange:c,children:n})},QA="DropdownMenuSubTrigger",ng=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(OA,{...o,...r,ref:t})});ng.displayName=QA;var JA="DropdownMenuSubContent",rg=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(_A,{...o,...r,ref:t,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)"}})});rg.displayName=JA;var eN=Gm,tN=zm,og=Hm,nN=Ym,rN=Xm,oN=qm,sN=Zm,iN=Qm,aN=Jm,sg=eg,cN=tg,lN=ZA,uN=ng,dN=rg;const fN=eN,hN=tN,pN=w.forwardRef(function({className:t,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-menu-content",`size-${o}`,t);return l.jsx(og,{children:l.jsxs(nN,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),mN=w.forwardRef(function({icon:t,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(oN,{ref:a,className:K("cny-menu-item",r&&"is-destructive",o),...i,children:[t&&l.jsx("span",{className:"cny-menu-item-icon",children:t}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),gN=w.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(sN,{ref:s,className:K("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(sg,{children:l.jsx(tn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),t&&l.jsx("span",{className:"cny-menu-item-shortcut",children:t})]})}),yN=iN,vN=w.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(aN,{ref:s,className:K("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(sg,{children:l.jsx(JC,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),t&&l.jsx("span",{className:"cny-menu-item-shortcut",children:t})]})}),xN=w.forwardRef(function({className:t,...n},r){return l.jsx(rN,{ref:r,className:K("cny-menu-label",t),...n})}),bN=w.forwardRef(function({className:t,...n},r){return l.jsx(cN,{ref:r,className:K("cny-menu-separator",t),...n})}),wN=lN,CN=w.forwardRef(function({icon:t,className:n,children:r,...o},s){return l.jsxs(uN,{ref:s,className:K("cny-menu-item is-sub",n),...o,children:[t&&l.jsx("span",{className:"cny-menu-item-icon",children:t}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Qt,{size:13,"aria-hidden":"true"})})]})}),SN=w.forwardRef(function({className:t,...n},r){return l.jsx(og,{children:l.jsx(dN,{ref:r,className:K("cny-menu-content",t),...n})})});var[ss]=Te("Tooltip",[_t]),is=_t(),ig="TooltipProvider",TN=700,Wi="tooltip.open",[RN,lc]=ss(ig),ag=e=>{const{__scopeTooltip:t,delayDuration:n=TN,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=m.useRef(!0),a=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(RN,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:m.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};ag.displayName=ig;var or="Tooltip",[PN,Tr]=ss(or),cg=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=lc(or,e.__scopeTooltip),u=is(t),[d,f]=m.useState(null),h=ge(),p=m.useRef(0),v=i??c.disableHoverableContent,g=a??c.delayDuration,y=m.useRef(!1),[x,b]=we({prop:r,defaultProp:o??!1,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(Wi))):c.onClose(),s==null||s(R)},caller:or}),C=m.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),S=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),T=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),E=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},g)},[g,b]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(mr,{...u,children:l.jsx(PN,{scope:t,contentId:h,open:x,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?E():S()},[c.isOpenDelayedRef,E,S]),onTriggerLeave:m.useCallback(()=>{v?T():(window.clearTimeout(p.current),p.current=0)},[T,v]),onOpen:S,onClose:T,disableHoverableContent:v,children:n})})};cg.displayName=or;var Gi="TooltipTrigger",lg=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Tr(Gi,n),s=lc(Gi,n),i=is(n),a=m.useRef(null),c=se(t,a,o.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(gr,{asChild:!0,...i,children:l.jsx(Q.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:z(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:z(e.onBlur,o.onClose),onClick:z(e.onClick,o.onClose)})})});lg.displayName=Gi;var uc="TooltipPortal",[EN,MN]=ss(uc,{forceMount:void 0}),ug=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Tr(uc,t);return l.jsx(EN,{scope:t,forceMount:n,children:l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:r})})})};ug.displayName=uc;var An="TooltipContent",dg=m.forwardRef((e,t)=>{const n=MN(An,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Tr(An,e.__scopeTooltip);return l.jsx(Ne,{present:r||i.open,children:i.disableHoverableContent?l.jsx(fg,{side:o,...s,ref:t}):l.jsx(AN,{side:o,...s,ref:t})})}),AN=m.forwardRef((e,t)=>{const n=Tr(An,e.__scopeTooltip),r=lc(An,e.__scopeTooltip),o=m.useRef(null),s=se(t,o),[i,a]=m.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,g)=>{const y=v.currentTarget,x={x:v.clientX,y:v.clientY},b=kN(x,y.getBoundingClientRect()),C=IN(x,b),S=ON(g.getBoundingClientRect()),T=LN([...C,...S]);a(T),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(c&&d){const v=y=>p(y,d),g=y=>p(y,c);return c.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[c,d,p,h]),m.useEffect(()=>{if(i){const v=g=>{const y=g.target,x={x:g.clientX,y:g.clientY},b=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),C=!_N(x,i);b?h():C&&(h(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,d,i,u,h]),l.jsx(fg,{...e,ref:s})}),[NN,jN]=ss(or,{isInside:!1}),DN=oC("TooltipContent"),fg=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Tr(An,n),u=is(n),{onClose:d}=c;return m.useEffect(()=>(document.addEventListener(Wi,d),()=>document.removeEventListener(Wi,d)),[d]),m.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(In,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(Go,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.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(DN,{children:r}),l.jsx(NN,{scope:n,isInside:!0,children:l.jsx(IR,{id:c.contentId,role:"tooltip",children:o||r})})]})})});dg.displayName=An;var hg="TooltipArrow",pg=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=is(n);return jN(hg,n).isInside?null:l.jsx(Uo,{...o,...r,ref:t})});pg.displayName=hg;function kN(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.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")}}function IN(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ON(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function _N(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[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}function LN(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),FN(t)}function FN(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[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(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var VN=ag,mg=cg,gg=lg,yg=ug,vg=dg,$N=pg;const BN=VN,WN=w.forwardRef(function({children:t,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:p,style:v,styleTag:g}=re(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:t}):l.jsxs(mg,{delayDuration:i,open:a,children:[l.jsx(gg,{asChild:!0,children:t}),l.jsx(yg,{children:l.jsxs(vg,{ref:h,side:r,align:o,sideOffset:s,className:p,style:v,children:[g,n,l.jsx($N,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),GN=mg,UN=gg,zN=w.forwardRef(function({className:t,...n},r){return l.jsx(yg,{children:l.jsx(vg,{ref:r,className:K("cny-tooltip-content",t),...n})})}),HN=Va,KN=$a,YN=gE,XN=yE,qN=w.forwardRef(function({className:t,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-popover-content",t);return l.jsx(Ba,{children:l.jsxs(Wa,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(vE,{className:"cny-popover-arrow",width:12,height:6})]})})}),ZN=w.forwardRef(function({color:t="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:p,...v},g){const y=!u&&c!=null,{className:x,style:b,styleTag:C}=re(h,f,"cny-chip",t,n,r==="sm"&&"sm",y&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:g,role:y?"button":void 0,tabIndex:y?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,className:x,style:b,...v,children:[C,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:p}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:S=>{S.stopPropagation(),i(S)},children:l.jsx(Ot,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),QN=w.forwardRef(function({count:t,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},p){const v=typeof t=="number",g=v&&t>r?`${r}+`:t,x=!n&&v&&t===0&&!o?null:l.jsx("span",{className:K("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!a&&`cny-badge-${i}`),children:n?null:g});if(a){const{className:T,style:E,styleTag:R}=re(f,d,"cny-badge","cny-badge-standalone",u);return l.jsxs("span",{ref:p,className:T,style:E,...h,children:[R,x]})}const{className:b,style:C,styleTag:S}=re(f,d,"cny-badge",u);return l.jsxs("span",{ref:p,className:b,style:C,...h,children:[S,c,x]})}),JN=w.forwardRef(function({position:t="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=re(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${t}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),e1=w.forwardRef(function({className:t,...n},r){return l.jsx("li",{ref:r,className:K("cny-timeline-item",t),...n})}),t1=w.forwardRef(function({className:t,...n},r){return l.jsx("div",{ref:r,className:K("cny-timeline-separator",t),...n})}),n1=w.forwardRef(function({color:t="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:K("cny-timeline-dot",`cny-timeline-dot-${t}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),r1=w.forwardRef(function({color:t,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:K("cny-timeline-connector",t&&`cny-timeline-connector-${t}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),o1=w.forwardRef(function({variant:t="plain",accentColor:n,className:r,...o},s){const i=t==="card"||t==="elevated";return l.jsx("div",{ref:s,className:K("cny-timeline-content",i&&"cny-timeline-content-card",t==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),s1=w.forwardRef(function({className:t,...n},r){return l.jsx("div",{ref:r,className:K("cny-timeline-opposite-content",t),...n})}),xg=w.createContext(null);function i1(){const e=w.useContext(xg);if(!e)throw new Error("TreeItem must be used within a <TreeView>.");return e}const bg=w.forwardRef(function({expandedIds:t,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...p},v){const[g,y]=w.useState(n??[]),[x,b]=w.useState(s),[C,S]=w.useState(null),T=t??g,E=o!==void 0?o:x,R=w.useMemo(()=>new Set(T),[T]),P=w.useCallback($=>R.has($),[R]),M=w.useCallback($=>{const N=!R.has($),I=N?[...T,$]:T.filter(V=>V!==$);t===void 0&&y(I),r==null||r(I),a==null||a($,N)},[T,R,t,r,a]),A=w.useCallback($=>{o===void 0&&b($),i==null||i($)},[o,i]),j=w.useMemo(()=>({isExpanded:P,toggle:M,selectedId:E,select:A,activeId:C,setActive:S,defaultIcons:c}),[P,M,E,A,C,c]),F=w.useRef(null),G=w.useCallback($=>{F.current=$,typeof v=="function"?v($):v&&(v.current=$)},[v]);w.useEffect(()=>{var I;if(C!==null)return;const $=(I=F.current)==null?void 0:I.querySelector('[role="treeitem"]'),N=$==null?void 0:$.dataset.treeId;N&&S(N)},[C]);const{className:H,style:J,styleTag:O}=re(f,d,"cny-tree",u);return l.jsx(xg.Provider,{value:j,children:l.jsxs("ul",{ref:G,role:"tree",className:H,style:J,...p,children:[O,h]})})});function a1(e){return e?Array.from(e.querySelectorAll('[role="treeitem"]')):[]}const wg=w.forwardRef(function({itemId:t,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:p,defaultIcons:v}=i1(),g=!!o,y=g&&c(t),x=d===t,b=h===t,C=r??(v?g?y?l.jsx(hS,{size:16}):l.jsx(mS,{size:16}):l.jsx(dS,{size:16}):null),S=()=>{p(t),f(t),g&&u(t)},T=R=>{R.preventDefault(),R.stopPropagation(),p(t),u(t)},E=R=>{var M;const P=R.currentTarget.closest('[role="tree"]');switch(R.key){case"ArrowRight":if(R.preventDefault(),g&&!y)u(t);else if(y){const A=R.currentTarget.querySelector('[role="treeitem"]');A==null||A.focus()}break;case"ArrowLeft":if(R.preventDefault(),g&&y)u(t);else{const A=(M=R.currentTarget.parentElement)==null?void 0:M.closest('[role="treeitem"]');A==null||A.focus()}break;case"ArrowDown":case"ArrowUp":{R.preventDefault();const A=a1(P),j=A.indexOf(R.currentTarget),F=A[j+(R.key==="ArrowDown"?1:-1)];F==null||F.focus();break}case"Enter":case" ":R.preventDefault(),f(t),g&&u(t);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":t,"aria-expanded":g?y:void 0,"aria-selected":x,tabIndex:b?0:-1,className:K("cny-tree-item",s),onKeyDown:E,onFocus:R=>{R.target===R.currentTarget&&p(t)},...i,children:[l.jsxs("div",{className:K("cny-tree-row",x&&"is-selected"),onClick:S,children:[g?l.jsx("button",{type:"button",tabIndex:-1,className:K("cny-tree-toggle",y&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:t}`,onClick:T,children:l.jsx(Qt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),C!=null&&l.jsx("span",{className:"cny-tree-icon",children:C}),l.jsx("span",{className:"cny-tree-label",children:n})]}),y&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),c1=w.forwardRef(function({items:t,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(bg,{ref:a,...i,children:c(t)})});function l1(e){if(!e)return[];if(typeof e=="string")return e.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(e))return e.map(n=>n.trim()).filter(Boolean);const t=[];for(const[n,r]of Object.entries(e)){t.push(n);for(const o of r)t.push(o)}return t}function u1(e,t){if(t.length===0)return!0;const n=e.name.toLowerCase(),r=(e.type||"").toLowerCase();return t.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 Cg(e={}){const{accept:t,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=e,[d,f]=w.useState(!1),h=w.useRef(null),p=w.useRef(0),v=w.useMemo(()=>l1(t),[t]),g=v.join(",")||void 0,y=w.useCallback(T=>{const E=[];return u1(T,v)||E.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&T.size>n&&E.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&T.size<r&&E.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),E},[v,n,r]),x=w.useCallback(T=>{if(i||T.length===0)return;const E=[],R=[];if(!o&&T.length>1||typeof s=="number"&&T.length>s)for(const M of T)R.push({file:M,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const M of T){const A=y(M);A.length?R.push({file:M,errors:A}):E.push(M)}a==null||a(E,R),E.length&&(c==null||c(E)),R.length&&(u==null||u(R))},[i,o,s,y,a,c,u]),b=w.useCallback(()=>{var T;i||(T=h.current)==null||T.click()},[i]),C=w.useCallback((T={})=>{const{onClick:E,onKeyDown:R,onDragOver:P,onDragEnter:M,onDragLeave:A,onDrop:j,...F}=T;return{...F,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:G=>{E==null||E(G),i||b()},onKeyDown:G=>{R==null||R(G),(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),b())},onDragOver:G=>{P==null||P(G),G.preventDefault(),i||f(!0)},onDragEnter:G=>{M==null||M(G),G.preventDefault(),!i&&(p.current+=1,f(!0))},onDragLeave:G=>{A==null||A(G),p.current=Math.max(0,p.current-1),p.current===0&&f(!1)},onDrop:G=>{var H;j==null||j(G),G.preventDefault(),p.current=0,f(!1),!i&&x(Array.from(((H=G.dataTransfer)==null?void 0:H.files)??[]))}}},[i,b,x]),S=w.useCallback((T={})=>{const{onChange:E,...R}=T;return{...R,ref:h,type:"file",accept:g,multiple:o,style:{display:"none"},onChange:P=>{E==null||E(P),x(Array.from(P.target.files??[])),P.target.value=""}}},[g,o,x]);return{getRootProps:C,getInputProps:S,open:b,isDragActive:d,inputRef:h}}const d1=w.forwardRef(function({onDrop:t,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:p,className:v,style:g,sx:y},x){const{getRootProps:b,getInputProps:C,isDragActive:S,open:T}=Cg({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:p,onDrop:t}),{className:E,style:R,styleTag:P}=re(y,g,"cny-uploader",`cny-uploader-${a}`,S&&"is-dragging",p&&"is-disabled",v);return l.jsxs("div",{...b(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:E,style:R,children:[P,l.jsx("input",{...C()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(rS,{})}),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:p,tabIndex:-1,onClick:M=>{M.stopPropagation(),T()},children:i})]})]})}),f1=5;function Ou(e){if(e.length===0)return[];const n=e.reduce((a,c)=>a+(c.def??0),0),r=e.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=e.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 _u(e,t,n,r){if(t<0||t+1>=e.length)return e;const o=e[t]+e[t+1];let s=Math.max(r[t].min,Math.min(r[t].max,e[t]+n));const i=Math.max(r[t+1].min,Math.min(r[t+1].max,o-s));s=Math.max(r[t].min,Math.min(r[t].max,o-i));const a=[...e];return a[t]=s,a[t+1]=i,a}const Ui=w.forwardRef(function({defaultSize:t,minSize:n,maxSize:r,className:o,style:s,...i},a){return l.jsx("div",{ref:a,className:K("cny-panel",o),style:s,...i})}),Sg=w.forwardRef(function({disabled:t,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||t)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:t?-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":t||void 0,className:K("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{t||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),h1=w.forwardRef(function({direction:t="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=w.useRef(null),u=w.Children.toArray(s).filter(w.isValidElement),d=u.filter(P=>P.type===Ui).map(P=>{const M=P.props;return{min:M.minSize??10,max:M.maxSize??90,def:M.defaultSize??null}}),[f,h]=w.useState(()=>Ou(d)),p=f.length===d.length?f:Ou(d),v=w.useRef(null),g=(P,M)=>{const A=t==="horizontal"?M.clientX:M.clientY;v.current={g:P,start:A,startSizes:p};const j=G=>{var I;const H=v.current,J=(I=c.current)==null?void 0:I.getBoundingClientRect();if(!H||!J)return;const O=t==="horizontal"?J.width:J.height;if(!O)return;const N=((t==="horizontal"?G.clientX:G.clientY)-H.start)/O*100;h(_u(H.startSizes,H.g,N,d))},F=()=>{v.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",F)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",F)},y=(P,M)=>{h(_u(p,P,M*f1,d))},x=P=>{c.current=P,typeof a=="function"?a(P):a&&(a.current=P)};let b=-1,C=-1;const S=u.map(P=>{var M,A;if(P.type===Ui){b+=1;const j=b,F={...P.props.style,flexBasis:`${p[j]??0}%`,flexGrow:0,flexShrink:0};return w.cloneElement(P,{key:P.key??`panel-${j}`,style:F})}if(P.type===Sg){C+=1;const j=C,F={direction:t,valueNow:Math.round(p[j]??0),valueMin:((M=d[j])==null?void 0:M.min)??0,valueMax:((A=d[j])==null?void 0:A.max)??100,onResizeStart:G=>g(j,G),onKeyResize:G=>y(j,G)};return w.cloneElement(P,{key:P.key??`handle-${j}`,__internal:F})}return P}),{className:T,style:E,styleTag:R}=re(o,r,"cny-panel-group",t==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:T,style:E,...i,children:[R,S]})});function p1(){}function m1(e,t,n,r){if(t<=1)return[{type:"page",page:1}];const o=t,s=Math.max(1,e-n),i=Math.min(o,e+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,p,v)=>h.type!=="page"?!0:v.findIndex(g=>g.type==="page"&&g.page===h.page)===p)}const Tg=w.forwardRef(function({page:t,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 p=w.useMemo(()=>m1(t,n,o,s),[t,n,o,s]),v=b=>{b<1||b>n||b===t||r(b)},{className:g,style:y,styleTag:x}=re(d,u,"cny-pagination",`cny-pagination-${a}`,c);return l.jsxs("nav",{ref:h,role:"navigation","aria-label":f,className:g,style:y,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>v(t-1),disabled:t<=1,"aria-label":"Previous page",children:l.jsx(no,{size:14,"aria-hidden":"true"})}),p.map(b=>b.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(sS,{size:14})},`e-${b.key}`):l.jsx("button",{type:"button",className:K("cny-pagination-btn",b.page===t&&"is-active"),"aria-current":b.page===t?"page":void 0,onClick:()=>v(b.page),children:b.page},b.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>v(t+1),disabled:t>=n,"aria-label":"Next page",children:l.jsx(Qt,{size:14,"aria-hidden":"true"})})]})}),Js={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function g1(e){return e.id}function y1(e,t){return!e||e.field!==t?{field:t,sort:"asc"}:e.sort==="asc"?{field:t,sort:"desc"}:null}const v1=w.forwardRef(function({columns:t,rows:n,getRowId:r=g1,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:p,noRowsLabel:v="No rows",disableColumnResize:g=!1,className:y,style:x,sx:b},C){const S=t.length+(c?1:0),T=w.useRef(null),[E,R]=w.useState(null),P=(_,U)=>{var ae;U.preventDefault(),U.stopPropagation();const B={};(ae=T.current)==null||ae.querySelectorAll("thead th[data-field]").forEach(ce=>{const Ce=ce.dataset.field;Ce&&(B[Ce]=ce.getBoundingClientRect().width)});const L=U.clientX,ee=B[_]??0;R(B);const W=ce=>{R({...B,[_]:Math.max(60,ee+(ce.clientX-L))})},X=()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",X)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",X)},M=_=>!g&&_.resizable!==!1,A=u??[],j=new Set(A),F=n.map(_=>r(_)),G=F.length>0&&F.every(_=>j.has(_)),H=F.some(_=>j.has(_)),J=G?!0:H?"indeterminate":!1,O=()=>{if(d)if(G)d(A.filter(_=>!F.includes(_)));else{const _=new Set(A);F.forEach(U=>_.add(U)),d([..._])}},$=_=>{d&&(j.has(_)?d(A.filter(U=>U!==_)):d([...A,_]))},N=_=>{!_.sortable||!h||h(y1(f,_.field))},I=_=>_.width!=null?{width:_.width,minWidth:_.width}:{flex:_.flex??1},V=()=>{if(!i||s==null)return null;const{page:_,pageSize:U}=i,B=Math.max(1,Math.ceil(s/U)),L=s===0?0:_*U+1,ee=Math.min(s,(_+1)*U);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[L,"–",ee," of ",s]}),l.jsx(Tg,{page:_+1,pageCount:B,size:"sm",onPageChange:W=>a==null?void 0:a({page:W-1,pageSize:U})})]})},{className:Y,style:k,styleTag:Z}=re(b,x,"cny-dt",y);return l.jsxs("div",{ref:C,className:Y,style:k,children:[Z,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:T,className:"cny-dt-table",style:E?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:void 0,children:[E&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:44}}),t.map(_=>l.jsx("col",{style:{width:E[_.field]}},_.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx($i,{checked:J,onCheckedChange:O,"aria-label":"Select all rows"})}),t.map(_=>{const U=(f==null?void 0:f.field)===_.field,B=_.headerAlign??_.align;return l.jsxs("th",{scope:"col","data-field":_.field,style:E?void 0:I(_),"aria-sort":U?f.sort==="asc"?"ascending":"descending":void 0,className:K(B&&Js[B],_.sortable&&"cny-dt-sortable",U&&"is-sorted"),onClick:()=>N(_),children:[l.jsxs("span",{className:"cny-dt-th-inner",children:[_.headerName??_.field,_.sortable&&l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:U?f.sort==="desc"?l.jsx(dr,{size:14}):l.jsx(Kf,{size:14}):l.jsx(Yf,{size:14})})]}),M(_)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:L=>L.stopPropagation(),onPointerDown:L=>P(_.field,L)})]},_.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((_,U)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(Pi,{shape:"avatar",width:16,height:16})}),t.map(B=>l.jsx("td",{className:B.align&&Js[B.align],children:l.jsx(Pi,{width:"70%"})},B.field))]},`sk-${U}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:S,children:v})}):n.map(_=>{const U=r(_),B=j.has(U);return l.jsxs("tr",{className:K("cny-dt-row",B&&"is-selected",p&&"is-clickable"),onClick:()=>p==null?void 0:p(_),children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:L=>L.stopPropagation(),children:l.jsx($i,{checked:B,onCheckedChange:()=>$(U),"aria-label":`Select row ${String(U)}`})}),t.map(L=>{const ee=L.valueGetter?L.valueGetter({row:_,field:L.field}):_[L.field];return l.jsx("td",{className:L.align&&Js[L.align],children:L.renderCell?L.renderCell({row:_,value:ee,field:L.field}):ee},L.field)})]},String(U))})})]})}),V()]})}),zi=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Jt(e,t){return t??zi[e%zi.length]}function dc(e=600){const t=w.useRef(null),[n,r]=w.useState(e);return w.useLayoutEffect(()=>{const o=t.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()},[]),[t,n]}function Rg(e,t=4){if(e<=0)return{max:1,ticks:[0,1]};const n=e/t,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(e/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 x1(e,t,n,r,o,s){const i=(y,x)=>[e+y*Math.sin(x),t-y*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 ${e} ${t} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,p]=i(r,s),[v,g]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${p}`,`A ${r} ${r} 0 ${a} 0 ${v} ${g}`,"Z"].join(" ")}const Ie={top:12,right:14,bottom:28,left:40};function b1({data:e,xKey:t,series:n,height:r=260,stacked:o=!1,grid:s=!0,legend:i=!0,yTickFormatter:a=p=>String(p),xTickFormatter:c=p=>p,renderTooltip:u,className:d,style:f,sx:h}){const[p,v]=dc(),[g,y]=w.useState(null),x=Math.max(0,v-Ie.left-Ie.right),b=Math.max(0,r-Ie.top-Ie.bottom),C=(O,$)=>Number(O[$]??0),S=e.length?Math.max(0,...e.map(O=>o?n.reduce(($,N)=>$+C(O,N.key),0):Math.max(...n.map($=>C(O,$.key))))):0,{max:T,ticks:E}=Rg(S),R=O=>Ie.top+b*(1-O/T),P=e.length,M=P?x/P:0,A=M*.68,j=O=>Ie.left+O*M+(M-A)/2,F=o?A:A/Math.max(1,n.length),{className:G,style:H,styleTag:J}=re(h,{position:"relative",...f},"cny-chart",d);return l.jsxs("div",{ref:p,className:G,style:H,children:[J,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${v} ${r}`,role:"img",children:[s&&E.map(O=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:Ie.left,x2:v-Ie.right,y1:R(O),y2:R(O)}),l.jsx("text",{className:"cny-chart-axis",x:Ie.left-6,y:R(O),dy:"0.32em",textAnchor:"end",children:a(O)})]},O)),e.map((O,$)=>{let N=0;return l.jsx("g",{children:n.map((I,V)=>{const Y=C(O,I.key),k=Y/T*b;let Z,_;return o?(Z=j($),_=R(N+Y),N+=Y):(Z=j($)+V*F,_=R(Y)),l.jsx("rect",{className:"cny-chart-bar",x:Z,y:_,width:Math.max(0,F-(o?0:2)),height:Math.max(0,k),rx:2,fill:Jt(V,I.color)},I.key)})},$)}),e.map((O,$)=>l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:Ie.left+$*M+M/2,y:r-Ie.bottom+16,textAnchor:"middle",children:c(String(O[t]??""))}),l.jsx("rect",{x:Ie.left+$*M,y:Ie.top,width:M,height:b,fill:"transparent",onMouseEnter:()=>y({index:$,x:Ie.left+$*M+M/2,y:Ie.top}),onMouseLeave:()=>y(null)})]},`x-${$}`))]}),g&&e[g.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${g.x/v*100}%`,top:g.y},children:u?u({label:String(e[g.index][t]),datum:e[g.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(e[g.index][t])}),n.map((O,$)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt($,O.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:O.label??O.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(e[g.index],O.key)})]},O.key))]})}),i&&l.jsx("div",{className:"cny-chart-legend",children:n.map((O,$)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt($,O.color)}}),O.label??O.key]},O.key))})]})}const We={top:12,right:14,bottom:28,left:40};function Pg({data:e,xKey:t,series:n,height:r=260,area:o=!1,stacked:s=!1,dots:i=!0,grid:a=!0,legend:c=!0,yTickFormatter:u=g=>String(g),xTickFormatter:d=g=>g,renderTooltip:f,className:h,style:p,sx:v}){const[g,y]=dc(),[x,b]=w.useState(null),C=Math.max(0,y-We.left-We.right),S=Math.max(0,r-We.top-We.bottom),T=(N,I)=>Number(N[I]??0),E=e.length?Math.max(0,...e.map(N=>s?n.reduce((I,V)=>I+T(N,V.key),0):Math.max(...n.map(I=>T(N,I.key))))):0,{max:R,ticks:P}=Rg(E),M=N=>We.top+S*(1-N/R),A=e.length,j=A?C/A:0,F=N=>We.left+N*j+j/2,G=M(0),H=e.map(()=>0),{className:J,style:O,styleTag:$}=re(v,{position:"relative",...p},"cny-chart",h);return l.jsxs("div",{ref:g,className:J,style:O,children:[$,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${y} ${r}`,role:"img",children:[a&&P.map(N=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:We.left,x2:y-We.right,y1:M(N),y2:M(N)}),l.jsx("text",{className:"cny-chart-axis",x:We.left-6,y:M(N),dy:"0.32em",textAnchor:"end",children:u(N)})]},N)),n.map((N,I)=>{const V=Jt(I,N.color),Y=e.map((_,U)=>{const B=T(_,N.key),L=s?H[U]:0,ee=L+B;return s&&(H[U]=ee),{x:F(U),y:M(ee),yBase:M(L)}});if(Y.length===0)return null;const k=Y.map(_=>`${_.x},${_.y}`).join(" "),Z=`M ${Y[0].x} ${s?Y[0].yBase:G} `+Y.map(_=>`L ${_.x} ${_.y}`).join(" ")+` L ${Y[Y.length-1].x} ${s?Y[Y.length-1].yBase:G} Z`;return l.jsxs("g",{children:[o&&l.jsx("path",{className:"cny-chart-area",d:Z,fill:V}),l.jsx("polyline",{className:"cny-chart-line",points:k,fill:"none",stroke:V}),i&&Y.map((_,U)=>l.jsx("circle",{className:"cny-chart-dot",cx:_.x,cy:_.y,r:3,fill:V},U))]},N.key)}),e.map((N,I)=>l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:F(I),y:r-We.bottom+16,textAnchor:"middle",children:d(String(N[t]??""))}),l.jsx("rect",{x:We.left+I*j,y:We.top,width:j,height:S,fill:"transparent",onMouseEnter:()=>b({index:I,x:F(I)}),onMouseLeave:()=>b(null)})]},`x-${I}`))]}),x&&e[x.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${x.x/y*100}%`,top:We.top},children:f?f({label:String(e[x.index][t]),datum:e[x.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(e[x.index][t])}),n.map((N,I)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt(I,N.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:N.label??N.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:T(e[x.index],N.key)})]},N.key))]})}),c&&l.jsx("div",{className:"cny-chart-legend",children:n.map((N,I)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt(I,N.color)}}),N.label??N.key]},N.key))})]})}function w1(e){return l.jsx(Pg,{...e,area:!1})}function C1(e){return l.jsx(Pg,{...e,area:!0})}function S1({data:e,height:t=260,innerRadius:n=0,legend:r=!0,renderTooltip:o,centerLabel:s,className:i,style:a,sx:c}){const[u,d]=dc(360),[f,h]=w.useState(null),p=e.reduce((P,M)=>P+Math.max(0,M.value),0),v=Math.min(d,t),g=d/2,y=t/2,x=v/2*.86,b=n>0?x*n:0;let C=0;const S=e.map((P,M)=>{const A=p>0?Math.max(0,P.value)/p:0,j=C,F=C+A*Math.PI*2;return C=F,{d:P,i:M,start:j,end:F,frac:A,color:Jt(M,P.color)}}),{className:T,style:E,styleTag:R}=re(c,{position:"relative",...a},"cny-chart",i);return l.jsxs("div",{ref:u,className:T,style:E,children:[R,l.jsxs("svg",{width:"100%",height:t,viewBox:`0 0 ${d} ${t}`,role:"img",children:[S.map(P=>P.frac>=.9999?l.jsx("circle",{className:K("cny-chart-slice",f===P.i&&"is-active"),cx:g,cy:y,r:b>0?(x+b)/2:x,fill:b>0?"none":P.color,stroke:b>0?P.color:void 0,strokeWidth:b>0?x-b:void 0,onMouseEnter:()=>h(P.i),onMouseLeave:()=>h(null)},P.i):l.jsx("path",{className:K("cny-chart-slice",f===P.i&&"is-active"),d:x1(g,y,x,b,P.start,P.end),fill:P.color,onMouseEnter:()=>h(P.i),onMouseLeave:()=>h(null)},P.i)),s!=null&&b>0&&l.jsx("foreignObject",{x:g-b,y:y-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:s})})]}),f!=null&&S[f]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:o?o({datum:S[f].d,percent:S[f].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:S[f].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:S[f].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[S[f].d.value," (",Math.round(S[f].frac*100),"%)"]})]})}),r&&l.jsx("div",{className:"cny-chart-legend",children:S.map(P=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P.color}}),P.d.label]},P.i))})]})}function T1({height:e=300,children:t,className:n,style:r,sx:o}){const s=w.Children.only(t),{className:i,style:a,styleTag:c}=re(o,{width:"100%",height:e,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,w.isValidElement(s)?w.cloneElement(s,{height:e}):s]})}const R1=w.forwardRef(function({variant:t="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=re(i,s,"cny-list",t,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),P1=w.forwardRef(function({leading:t,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},p){const v=u??(i?"a":s?"button":"li"),g=!a&&(i!=null||s!=null),y=d??l.jsxs(l.Fragment,{children:[t&&l.jsx("span",{className:"cny-list-item-leading",children:t}),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(v,{ref:p,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:g&&v==="div"?0:void 0,className:K("cny-list-item",c&&"is-active",a&&"is-disabled",g&&"is-interactive",f),...h,children:y});return v==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),E1=w.forwardRef(function({className:t,...n},r){return l.jsx("li",{ref:r,role:"separator",className:K("cny-list-separator",t),...n})}),M1=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("li",{ref:o,className:K("cny-list-subheader",t),...r,children:n})});var as="Tabs",[A1]=Te(as,[kt]),Eg=kt(),[N1,fc]=A1(as),Mg=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=Dt(a),[f,h]=we({prop:r,onChange:o,defaultProp:s??"",caller:as});return l.jsx(N1,{scope:n,baseId:ge(),value:f,onValueChange:h,orientation:i,dir:d,activationMode:c,children:l.jsx(Q.div,{dir:d,"data-orientation":i,...u,ref:t})})});Mg.displayName=as;var Ag="TabsList",Ng=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=fc(Ag,n),i=Eg(n);return l.jsx(_o,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Q.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Ng.displayName=Ag;var jg="TabsTrigger",Dg=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=fc(jg,n),a=Eg(n),c=Og(i.baseId,r),u=_g(i.baseId,r),d=r===i.value;return l.jsx(Lo,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(Q.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:z(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:z(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:z(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});Dg.displayName=jg;var kg="TabsContent",Ig=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=fc(kg,n),c=Og(a.baseId,r),u=_g(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(Ne,{present:o||d,children:({present:h})=>l.jsx(Q.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});Ig.displayName=kg;function Og(e,t){return`${e}-trigger-${t}`}function _g(e,t){return`${e}-content-${t}`}var j1=Mg,D1=Ng,k1=Dg,I1=Ig;const O1=w.forwardRef(function({variant:t="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(s,o,"cny-tabs",`variant-${t}`,`size-${n}`,r);return l.jsxs(j1,{ref:c,className:u,style:d,...a,children:[f,i]})}),_1=w.forwardRef(function({className:t,...n},r){return l.jsx(D1,{ref:r,className:K("cny-tabs-list",t),...n})}),L1=w.forwardRef(function({icon:t,badge:n,className:r,children:o,...s},i){return l.jsxs(k1,{ref:i,className:K("cny-tabs-trigger",r),...s,children:[t&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:t}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),F1=w.forwardRef(function({className:t,...n},r){return l.jsx(I1,{ref:r,className:K("cny-tabs-content",t),...n})});function V1(e){return e.multiple===!0}const $1=w.forwardRef(function(t,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:p,"aria-invalid":v,"aria-describedby":g,"aria-label":y,className:x,style:b,sx:C}=t,S=w.useId(),T=p??`cny-ac-${S}`,[E,R]=w.useState(!1),[P,M]=w.useState(""),A=w.useRef(null),j=V1(t),[F,G]=w.useState(!j&&t.defaultValue!==void 0?t.defaultValue??null:null),[H,J]=w.useState(j&&t.defaultValue!==void 0?t.defaultValue??[]:[]),O=j?t.value!==void 0?t.value:H:(()=>{const B=t.value!==void 0?t.value:F;return B==null?[]:[B]})(),$=w.useCallback(B=>{var L,ee;if(j)t.value===void 0&&J(B),(L=t.onValueChange)==null||L.call(t,B);else{const W=B[0]??null;t.value===void 0&&G(W),(ee=t.onValueChange)==null||ee.call(t,W)}},[j,t]),N=w.useCallback(B=>{if(!B.disabled)if(j){const L=t.maxItems,ee=O.includes(B.value);let W;if(ee)W=O.filter(X=>X!==B.value);else{if(L!=null&&O.length>=L)return;W=[...O,B.value]}$(W)}else $([B.value]),R(!1)},[$,j,O,t]),I=w.useCallback(B=>{var L;B.stopPropagation(),$([]),(L=A.current)==null||L.focus()},[$]),V=w.useMemo(()=>{const B=new Map;for(const L of r){const ee=L.group??"";B.has(ee)||B.set(ee,[]),B.get(ee).push(L)}return Array.from(B.entries())},[r]),Y=B=>{var L;return((L=r.find(ee=>ee.value===B))==null?void 0:L.label)??B},k=O.length===0?o:j?O.length===1?Y(O[0]):`${Y(O[0])} +${O.length-1}`:Y(O[0]),{className:Z,style:_,styleTag:U}=re(C,b,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,O.length>0&&"has-value",E&&"is-open",x);return l.jsxs(Va,{open:E,onOpenChange:R,children:[l.jsx($a,{asChild:!0,children:l.jsxs("button",{ref:B=>{A.current=B,typeof n=="function"?n(B):n&&(n.current=B)},type:"button",id:T,className:Z,style:_,disabled:f,"aria-label":y,"aria-invalid":v,"aria-describedby":g,"aria-haspopup":"listbox","aria-expanded":E,children:[U,l.jsx("span",{className:K("cny-ac-value",O.length===0&&"is-placeholder"),children:k}),h&&O.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-ac-clear","aria-label":"Clear",onClick:I,onPointerDown:B=>B.stopPropagation(),children:l.jsx(Ot,{size:13,"aria-hidden":"true"})}),l.jsx(Yf,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(Ba,{children:l.jsx(Wa,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(be,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(be.Input,{value:P,onValueChange:M,placeholder:s})}),l.jsx(be.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Xf,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(be.Empty,{className:"cny-ac-empty",children:i}),V.map(([B,L])=>{const ee=L.map(W=>{const X=O.includes(W.value);return l.jsxs(be.Item,{value:`${B} ${W.label} ${W.value}`,disabled:W.disabled,onSelect:()=>N(W),className:K("cny-ac-item",X&&"is-checked"),children:[j?l.jsx("span",{className:K("cny-ac-checkbox",X&&"is-checked"),children:X&&l.jsx(tn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[W.icon??null,!W.icon&&X&&l.jsx(tn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:W.label}),W.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:W.hint})]},W.value)});return B===""?l.jsx(be.Group,{children:ee},"__ungrouped"):l.jsx(be.Group,{heading:B,children:ee},B)})]})})]})})})]})}),B1=w.forwardRef(function({items:t,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Qt,{size:12,"aria-hidden":"true"}),{className:d,style:f,styleTag:h}=re(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:t.map((p,v)=>{const g=v===t.length-1,y=l.jsx("span",{className:K("cny-breadcrumb-label",g&&"is-current"),children:p.label}),x=p.render?p.render(y):p.href&&!g?l.jsx("a",{href:p.href,className:"cny-breadcrumb-link",children:y}):y;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[g?l.jsx("span",{"aria-current":"page",children:y}):x,!g&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},v)})})]})});var cs="Collapsible",[W1,Lg]=Te(cs),[G1,hc]=W1(cs),Fg=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[c,u]=we({prop:r,defaultProp:o??!1,onChange:i,caller:cs});return l.jsx(G1,{scope:n,disabled:s,contentId:ge(),open:c,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Q.div,{"data-state":mc(c),"data-disabled":s?"":void 0,...a,ref:t})})});Fg.displayName=cs;var Vg="CollapsibleTrigger",$g=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=hc(Vg,n);return l.jsx(Q.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":mc(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:z(e.onClick,o.onOpenToggle)})});$g.displayName=Vg;var pc="CollapsibleContent",Bg=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=hc(pc,e.__scopeCollapsible);return l.jsx(Ne,{present:n||o.open,children:({present:s})=>l.jsx(U1,{...r,ref:t,present:s})})});Bg.displayName=pc;var U1=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=hc(pc,n),[a,c]=m.useState(r),u=m.useRef(null),d=se(t,u),f=m.useRef(0),h=f.current,p=m.useRef(0),v=p.current,g=i.open||a,y=m.useRef(g),x=m.useRef(void 0);return m.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),Me(()=>{const b=u.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();f.current=C.height,p.current=C.width,y.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),c(r)}},[i.open,r]),l.jsx(Q.div,{"data-state":mc(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&o})});function mc(e){return e?"open":"closed"}var z1=Fg,H1=$g,K1=Bg,nt="Accordion",Y1=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[gc,X1,q1]=lr(nt),[ls]=Te(nt,[q1,Lg]),yc=Lg(),Wg=w.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,s=r;return l.jsx(gc.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(ej,{...s,ref:t}):l.jsx(J1,{...o,ref:t})})});Wg.displayName=nt;var[Gg,Z1]=ls(nt),[Ug,Q1]=ls(nt,{collapsible:!1}),J1=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:s=!1,...i}=e,[a,c]=we({prop:n,defaultProp:r??"",onChange:o,caller:nt});return l.jsx(Gg,{scope:e.__scopeAccordion,value:w.useMemo(()=>a?[a]:[],[a]),onItemOpen:c,onItemClose:w.useCallback(()=>s&&c(""),[s,c]),children:l.jsx(Ug,{scope:e.__scopeAccordion,collapsible:s,children:l.jsx(zg,{...i,ref:t})})})}),ej=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=we({prop:n,defaultProp:r??[],onChange:o,caller:nt}),c=w.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=w.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(Gg,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:l.jsx(Ug,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(zg,{...s,ref:t})})})}),[tj,us]=ls(nt),zg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:s="vertical",...i}=e,a=w.useRef(null),c=se(a,t),u=X1(n),f=Dt(o)==="ltr",h=z(e.onKeyDown,p=>{var P;if(!Y1.includes(p.key))return;const v=p.target,g=u().filter(M=>{var A;return!((A=M.ref.current)!=null&&A.disabled)}),y=g.findIndex(M=>M.ref.current===v),x=g.length;if(y===-1)return;p.preventDefault();let b=y;const C=0,S=x-1,T=()=>{b=y+1,b>S&&(b=C)},E=()=>{b=y-1,b<C&&(b=S)};switch(p.key){case"Home":b=C;break;case"End":b=S;break;case"ArrowRight":s==="horizontal"&&(f?T():E());break;case"ArrowDown":s==="vertical"&&T();break;case"ArrowLeft":s==="horizontal"&&(f?E():T());break;case"ArrowUp":s==="vertical"&&E();break}const R=b%x;(P=g[R].ref.current)==null||P.focus()});return l.jsx(tj,{scope:n,disabled:r,direction:o,orientation:s,children:l.jsx(gc.Slot,{scope:n,children:l.jsx(Q.div,{...i,"data-orientation":s,ref:c,onKeyDown:r?void 0:h})})})}),Mo="AccordionItem",[nj,vc]=ls(Mo),Hg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,s=us(Mo,n),i=Z1(Mo,n),a=yc(n),c=ge(),u=r&&i.value.includes(r)||!1,d=s.disabled||e.disabled;return l.jsx(nj,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(z1,{"data-orientation":s.orientation,"data-state":Qg(u),...a,...o,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(r):i.onItemClose(r)}})})});Hg.displayName=Mo;var Kg="AccordionHeader",Yg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=us(nt,n),s=vc(Kg,n);return l.jsx(Q.h3,{"data-orientation":o.orientation,"data-state":Qg(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Yg.displayName=Kg;var Hi="AccordionTrigger",Xg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=us(nt,n),s=vc(Hi,n),i=Q1(Hi,n),a=yc(n);return l.jsx(gc.ItemSlot,{scope:n,children:l.jsx(H1,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...a,...r,ref:t})})});Xg.displayName=Hi;var qg="AccordionContent",Zg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=us(nt,n),s=vc(qg,n),i=yc(n);return l.jsx(K1,{role:"region","aria-labelledby":s.triggerId,"data-orientation":o.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Zg.displayName=qg;function Qg(e){return e?"open":"closed"}var rj=Wg,oj=Hg,sj=Yg,ij=Xg,aj=Zg;const cj=w.forwardRef(function({variant:t="plain",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"cny-accordion",`cny-accordion-${t}`,n);return l.jsxs(rj,{ref:a,className:c,style:u,...i,children:[d,s]})}),lj=w.forwardRef(function({className:t,...n},r){return l.jsx(oj,{ref:r,className:K("cny-accordion-item",t),...n})}),uj=w.forwardRef(function({children:t,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(sj,{className:"cny-accordion-header",children:l.jsxs(ij,{ref:i,className:K("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:t}),!o&&l.jsx(dr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),dj=w.forwardRef(function({children:t,className:n,...r},o){return l.jsx(aj,{ref:o,className:K("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:t})})});var Jg=["PageUp","PageDown"],ey=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ty={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Vn="Slider",[Ki,fj,hj]=lr(Vn),[ny]=Te(Vn,[hj]),[pj,ds]=ny(Vn),ry=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:s=1,orientation:i="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:v,...g}=e,y=m.useRef(new Set),x=m.useRef(0),C=i==="horizontal"?mj:gj,[S=[],T]=we({prop:d,defaultProp:u,onChange:j=>{var G;(G=[...y.current][x.current])==null||G.focus(),f(j)}}),E=m.useRef(S);function R(j){const F=wj(S,j);A(j,F)}function P(j){A(j,x.current)}function M(){const j=E.current[x.current];S[x.current]!==j&&h(S)}function A(j,F,{commit:G}={commit:!1}){const H=Rj(s),J=Pj(Math.round((j-r)/s)*s+r,H),O=vo(J,[r,o]);T(($=[])=>{const N=xj($,O,F);if(Tj(N,c*s)){x.current=N.indexOf(O);const I=String(N)!==String($);return I&&G&&h(N),I?N:$}else return $})}return l.jsx(pj,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:o,valueIndexToChangeRef:x,thumbs:y.current,values:S,orientation:i,form:v,children:l.jsx(Ki.Provider,{scope:e.__scopeSlider,children:l.jsx(Ki.Slot,{scope:e.__scopeSlider,children:l.jsx(C,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:z(g.onPointerDown,()=>{a||(E.current=S)}),min:r,max:o,inverted:p,onSlideStart:a?void 0:R,onSlideMove:a?void 0:P,onSlideEnd:a?void 0:M,onHomeKeyDown:()=>!a&&A(r,0,{commit:!0}),onEndKeyDown:()=>!a&&A(o,S.length-1,{commit:!0}),onStepKeyDown:({event:j,direction:F})=>{if(!a){const J=Jg.includes(j.key)||j.shiftKey&&ey.includes(j.key)?10:1,O=x.current,$=S[O],N=s*J*F;A($+N,O,{commit:!0})}}})})})})});ry.displayName=Vn;var[oy,sy]=ny(Vn,{startEdge:"left",endEdge:"right",size:"width",direction:1}),mj=m.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=m.useState(null),p=se(t,C=>h(C)),v=m.useRef(void 0),g=Dt(o),y=g==="ltr",x=y&&!s||!y&&s;function b(C){const S=v.current||f.getBoundingClientRect(),T=[0,S.width],R=xc(T,x?[n,r]:[r,n]);return v.current=S,R(C-S.left)}return l.jsx(oy,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:l.jsx(iy,{dir:g,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const S=b(C.clientX);i==null||i(S)},onSlideMove:C=>{const S=b(C.clientX);a==null||a(S)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:C=>{const T=ty[x?"from-left":"from-right"].includes(C.key);u==null||u({event:C,direction:T?-1:1})}})})}),gj=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onStepKeyDown:c,...u}=e,d=m.useRef(null),f=se(t,d),h=m.useRef(void 0),p=!o;function v(g){const y=h.current||d.current.getBoundingClientRect(),x=[0,y.height],C=xc(x,p?[r,n]:[n,r]);return h.current=y,C(g-y.top)}return l.jsx(oy,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:l.jsx(iy,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const y=v(g.clientY);s==null||s(y)},onSlideMove:g=>{const y=v(g.clientY);i==null||i(y)},onSlideEnd:()=>{h.current=void 0,a==null||a()},onStepKeyDown:g=>{const x=ty[p?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:x?-1:1})}})})}),iy=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:a,onStepKeyDown:c,...u}=e,d=ds(Vn,n);return l.jsx(Q.span,{...u,ref:t,onKeyDown:z(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(a(f),f.preventDefault()):Jg.concat(ey).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:z(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:z(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&o(f)}),onPointerUp:z(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),ay="SliderTrack",cy=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ds(ay,n);return l.jsx(Q.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});cy.displayName=ay;var Yi="SliderRange",ly=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ds(Yi,n),s=sy(Yi,n),i=m.useRef(null),a=se(t,i),c=o.values.length,u=o.values.map(h=>fy(h,o.min,o.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return l.jsx(Q.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:f+"%"}})});ly.displayName=Yi;var Xi="SliderThumb",uy=m.forwardRef((e,t)=>{const n=fj(e.__scopeSlider),[r,o]=m.useState(null),s=se(t,a=>o(a)),i=m.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return l.jsx(yj,{...e,ref:s,index:i})}),yj=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...s}=e,i=ds(Xi,n),a=sy(Xi,n),[c,u]=m.useState(null),d=se(t,b=>u(b)),f=c?i.form||!!c.closest("form"):!0,h=pr(c),p=i.values[r],v=p===void 0?0:fy(p,i.min,i.max),g=bj(r,i.values.length),y=h==null?void 0:h[a.size],x=y?Cj(y,v,a.direction):0;return m.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${v}% + ${x}px)`},children:[l.jsx(Ki.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(Q.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":i.min,"aria-valuenow":p,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:z(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),f&&l.jsx(dy,{name:o??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:p},r)]})});uy.displayName=Xi;var vj="RadioBubbleInput",dy=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=m.useRef(null),s=se(o,r),i=yr(t);return m.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("input",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(Q.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});dy.displayName=vj;function xj(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,s)=>o-s)}function fy(e,t,n){const s=100/(n-t)*(e-t);return vo(s,[0,100])}function bj(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function wj(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function Cj(e,t,n){const r=e/2,s=xc([0,50],[0,r]);return(r-s(t)*n)*n}function Sj(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Tj(e,t){if(t>0){const n=Sj(e);return Math.min(...n)>=t}return!0}function xc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rj(e){return(String(e).split(".")[1]||"").length}function Pj(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Ej=ry,Mj=cy,Aj=ly,Nj=uy;const jj=w.forwardRef(function({className:t,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],p=a??(x=>x),{className:v,style:g,styleTag:y}=re(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,t);return l.jsxs(Ej,{ref:f,className:v,style:g,value:c,defaultValue:u,...d,children:[y,l.jsx(Mj,{className:"cny-slider-track",children:l.jsx(Aj,{className:"cny-slider-range"})}),h.map((x,b)=>l.jsx(Nj,{className:"cny-slider-thumb","aria-label":`Value ${b+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:p(x)})},b))]})}),Dj=w.forwardRef(function({steps:t,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:p}=re(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:[p,t.map((v,g)=>{const y=g<n?"complete":g===n?"active":"upcoming",x=y==="complete"&&!!s;return l.jsxs("li",{className:K("cny-stepper-step",`is-${y}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:x?()=>s==null?void 0:s(g):void 0,disabled:!x,"aria-current":y==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:y==="complete"?l.jsx(tn,{size:14}):v.icon??g+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:v.label}),v.description&&l.jsx("span",{className:"cny-stepper-desc",children:v.description})]})]}),g<t.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},g)})]})});exports.Accordion=cj;exports.AccordionContent=dj;exports.AccordionItem=lj;exports.AccordionTrigger=uj;exports.Alert=AS;exports.AreaChart=C1;exports.AspectRatio=QS;exports.Autocomplete=$1;exports.Avatar=NS;exports.AvatarStack=jS;exports.BREAKPOINTS=Vu;exports.Badge=QN;exports.BarChart=b1;exports.Box=cn;exports.Breadcrumb=B1;exports.Button=er;exports.ButtonGroup=Z0;exports.CHART_COLORS=zi;exports.Card=PS;exports.Center=JS;exports.Checkbox=$i;exports.Chip=ZN;exports.CommandPalette=IM;exports.CommandPaletteTrigger=OM;exports.ConfirmDialog=gm;exports.Container=XS;exports.DataTable=v1;exports.DatePicker=DM;exports.Dialog=mm;exports.DialogClose=GM;exports.DialogTrigger=WM;exports.Divider=qS;exports.Drawer=zM;exports.DrawerClose=KM;exports.DrawerTrigger=HM;exports.FAB=Q0;exports.Field=rT;exports.FileUploader=d1;exports.Grid=YS;exports.Group=eT;exports.IconButton=J0;exports.Input=RS;exports.LineChart=w1;exports.List=R1;exports.ListItem=P1;exports.ListSeparator=E1;exports.ListSubheader=M1;exports.Menu=fN;exports.MenuCheckboxItem=gN;exports.MenuContent=pN;exports.MenuItem=mN;exports.MenuLabel=xN;exports.MenuRadioGroup=yN;exports.MenuRadioItem=vN;exports.MenuSeparator=bN;exports.MenuSub=wN;exports.MenuSubContent=SN;exports.MenuSubTrigger=CN;exports.MenuTrigger=hN;exports.MultiSelect=QE;exports.Navbar=_S;exports.NavbarActions=$S;exports.NavbarBrand=LS;exports.NavbarItem=VS;exports.NavbarNav=FS;exports.Pagination=Tg;exports.Panel=Ui;exports.PanelGroup=h1;exports.PanelResizeHandle=Sg;exports.PieChart=S1;exports.Popover=HN;exports.PopoverAnchor=YN;exports.PopoverClose=XN;exports.PopoverContent=qN;exports.PopoverTrigger=KN;exports.Progress=DS;exports.ProgressRing=kS;exports.Radio=pM;exports.RadioGroup=hM;exports.ResponsiveContainer=T1;exports.RichTreeView=c1;exports.Row=KS;exports.Scroll=Zf;exports.ScrollRegion=OS;exports.Select=tE;exports.SelectGroup=rE;exports.SelectItem=nE;exports.SelectLabel=oE;exports.SelectSeparator=sE;exports.Sidebar=BS;exports.SidebarItem=GS;exports.SidebarSection=WS;exports.Skeleton=Pi;exports.Slider=jj;exports.Spacer=ZS;exports.Stack=HS;exports.Stepper=Dj;exports.Switch=xM;exports.Tabs=O1;exports.TabsContent=F1;exports.TabsList=_1;exports.TabsTrigger=L1;exports.Text=nT;exports.Textarea=oT;exports.Timeline=JN;exports.TimelineConnector=r1;exports.TimelineContent=o1;exports.TimelineDot=n1;exports.TimelineItem=e1;exports.TimelineOppositeContent=s1;exports.TimelineSeparator=t1;exports.ToastProvider=VM;exports.ToggleButton=uC;exports.ToggleButtonGroup=DC;exports.ToggleButtonGroupItem=kC;exports.Tooltip=WN;exports.TooltipContent=zN;exports.TooltipProvider=BN;exports.TooltipRoot=GN;exports.TooltipTrigger=UN;exports.TreeItem=wg;exports.TreeView=bg;exports.disableGlobalCursorStyles=p1;exports.resolveSx=qi;exports.useCommandPalette=kM;exports.useConfirm=UM;exports.useFileDrop=Cg;exports.useToast=BM;
208
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},OE="DialogDescriptionWarning",_E=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kp(OE).contentName}}.`;return m.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ha=xp,Ip=wp,Ka=Sp,Ya=Tp,Xa=Rp,qa=Ep,Za=Ap,Qo=jp,Gn='[cmdk-group=""]',Xs='[cmdk-group-items=""]',LE='[cmdk-group-heading=""]',Op='[cmdk-item=""]',Pu=`${Op}:not([aria-disabled="true"])`,Fi="cmdk-item-select",yn="data-value",FE=(e,t,n)=>EE(e,t,n),_p=m.createContext(void 0),br=()=>m.useContext(_p),Lp=m.createContext(void 0),Qa=()=>m.useContext(Lp),Fp=m.createContext(void 0),$p=m.forwardRef((e,t)=>{let n=vn(()=>{var k,Z;return{search:"",value:(Z=(k=e.value)!=null?k:e.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=vn(()=>new Set),o=vn(()=>new Map),s=vn(()=>new Map),i=vn(()=>new Set),a=Vp(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,loop:v,disablePointerSelection:g=!1,vimBindings:y=!0,...x}=e,b=ge(),C=ge(),S=ge(),T=m.useRef(null),E=XE();an(()=>{if(d!==void 0){let k=d.trim();n.current.value=k,R.emit()}},[d]),an(()=>{E(6,W)},[]);let R=m.useMemo(()=>({subscribe:k=>(i.current.add(k),()=>i.current.delete(k)),snapshot:()=>n.current,setState:(k,Z,_)=>{var G,B,L,J;if(!Object.is(n.current[k],Z)){if(n.current[k]=Z,k==="search")F(),A(),E(1,j);else if(k==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let U=document.getElementById(S);U?U.focus():(G=document.getElementById(b))==null||G.focus()}if(E(7,()=>{var U;n.current.selectedItemId=(U=K())==null?void 0:U.id,R.emit()}),_||E(5,W),((B=a.current)==null?void 0:B.value)!==void 0){let U=Z??"";(J=(L=a.current).onValueChange)==null||J.call(L,U);return}}R.emit()}},emit:()=>{i.current.forEach(k=>k())}}),[]),P=m.useMemo(()=>({value:(k,Z,_)=>{var G;Z!==((G=s.current.get(k))==null?void 0:G.value)&&(s.current.set(k,{value:Z,keywords:_}),n.current.filtered.items.set(k,M(Z,_)),E(2,()=>{A(),R.emit()}))},item:(k,Z)=>(r.current.add(k),Z&&(o.current.has(Z)?o.current.get(Z).add(k):o.current.set(Z,new Set([k]))),E(3,()=>{F(),A(),n.current.value||j(),R.emit()}),()=>{s.current.delete(k),r.current.delete(k),n.current.filtered.items.delete(k);let _=K();E(4,()=>{F(),(_==null?void 0:_.getAttribute("id"))===k&&j(),R.emit()})}),group:k=>(o.current.has(k)||o.current.set(k,new Set),()=>{s.current.delete(k),o.current.delete(k)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:S,labelId:C,listInnerRef:T}),[]);function M(k,Z){var _,G;let B=(G=(_=a.current)==null?void 0:_.filter)!=null?G:FE;return k?B(k,n.current.search,Z):0}function A(){if(!n.current.search||a.current.shouldFilter===!1)return;let k=n.current.filtered.items,Z=[];n.current.filtered.groups.forEach(G=>{let B=o.current.get(G),L=0;B.forEach(J=>{let U=k.get(J);L=Math.max(U,L)}),Z.push([G,L])});let _=T.current;ee().sort((G,B)=>{var L,J;let U=G.getAttribute("id"),H=B.getAttribute("id");return((L=k.get(H))!=null?L:0)-((J=k.get(U))!=null?J:0)}).forEach(G=>{let B=G.closest(Xs);B?B.appendChild(G.parentElement===B?G:G.closest(`${Xs} > *`)):_.appendChild(G.parentElement===_?G:G.closest(`${Xs} > *`))}),Z.sort((G,B)=>B[1]-G[1]).forEach(G=>{var B;let L=(B=T.current)==null?void 0:B.querySelector(`${Gn}[${yn}="${encodeURIComponent(G[0])}"]`);L==null||L.parentElement.appendChild(L)})}function j(){let k=ee().find(_=>_.getAttribute("aria-disabled")!=="true"),Z=k==null?void 0:k.getAttribute(yn);R.setState("value",Z||void 0)}function F(){var k,Z,_,G;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let B=0;for(let L of r.current){let J=(Z=(k=s.current.get(L))==null?void 0:k.value)!=null?Z:"",U=(G=(_=s.current.get(L))==null?void 0:_.keywords)!=null?G:[],H=M(J,U);n.current.filtered.items.set(L,H),H>0&&B++}for(let[L,J]of o.current)for(let U of J)if(n.current.filtered.items.get(U)>0){n.current.filtered.groups.add(L);break}n.current.filtered.count=B}function W(){var k,Z,_;let G=K();G&&(((k=G.parentElement)==null?void 0:k.firstChild)===G&&((_=(Z=G.closest(Gn))==null?void 0:Z.querySelector(LE))==null||_.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function K(){var k;return(k=T.current)==null?void 0:k.querySelector(`${Op}[aria-selected="true"]`)}function ee(){var k;return Array.from(((k=T.current)==null?void 0:k.querySelectorAll(Pu))||[])}function O(k){let Z=ee()[k];Z&&R.setState("value",Z.getAttribute(yn))}function V(k){var Z;let _=K(),G=ee(),B=G.findIndex(J=>J===_),L=G[B+k];(Z=a.current)!=null&&Z.loop&&(L=B+k<0?G[G.length-1]:B+k===G.length?G[0]:G[B+k]),L&&R.setState("value",L.getAttribute(yn))}function N(k){let Z=K(),_=Z==null?void 0:Z.closest(Gn),G;for(;_&&!G;)_=k>0?KE(_,Gn):YE(_,Gn),G=_==null?void 0:_.querySelector(Pu);G?R.setState("value",G.getAttribute(yn)):V(k)}let I=()=>O(ee().length-1),$=k=>{k.preventDefault(),k.metaKey?I():k.altKey?N(1):V(1)},X=k=>{k.preventDefault(),k.metaKey?O(0):k.altKey?N(-1):V(-1)};return m.createElement(Q.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:k=>{var Z;(Z=x.onKeyDown)==null||Z.call(x,k);let _=k.nativeEvent.isComposing||k.keyCode===229;if(!(k.defaultPrevented||_))switch(k.key){case"n":case"j":{y&&k.ctrlKey&&$(k);break}case"ArrowDown":{$(k);break}case"p":case"k":{y&&k.ctrlKey&&X(k);break}case"ArrowUp":{X(k);break}case"Home":{k.preventDefault(),O(0);break}case"End":{k.preventDefault(),I();break}case"Enter":{k.preventDefault();let G=K();if(G){let B=new Event(Fi);G.dispatchEvent(B)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:ZE},c),Jo(e,k=>m.createElement(Lp.Provider,{value:R},m.createElement(_p.Provider,{value:P},k))))}),$E=m.forwardRef((e,t)=>{var n,r;let o=ge(),s=m.useRef(null),i=m.useContext(Fp),a=br(),c=Vp(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;an(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=Bp(o,s,[e.value,e.children,s],e.keywords),f=Qa(),h=Nt(E=>E.value&&E.value===d.current),p=Nt(E=>u||a.filter()===!1?!0:E.search?E.filtered.items.get(o)>0:!0);m.useEffect(()=>{let E=s.current;if(!(!E||e.disabled))return E.addEventListener(Fi,v),()=>E.removeEventListener(Fi,v)},[p,e.onSelect,e.disabled]);function v(){var E,R;g(),(R=(E=c.current).onSelect)==null||R.call(E,d.current)}function g(){f.setState("value",d.current,!0)}if(!p)return null;let{disabled:y,value:x,onSelect:b,forceMount:C,keywords:S,...T}=e;return m.createElement(Q.div,{ref:mt(s,t),...T,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||a.getDisablePointerSelection()?void 0:g,onClick:y?void 0:v},e.children)}),VE=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=ge(),a=m.useRef(null),c=m.useRef(null),u=ge(),d=br(),f=Nt(p=>o||d.filter()===!1?!0:p.search?p.filtered.groups.has(i):!0);an(()=>d.group(i),[]),Bp(i,a,[e.value,e.heading,c]);let h=m.useMemo(()=>({id:i,forceMount:o}),[o]);return m.createElement(Q.div,{ref:mt(a,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Jo(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(Fp.Provider,{value:h},p))))}),BE=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=m.useRef(null),s=Nt(i=>!i.search);return!n&&!s?null:m.createElement(Q.div,{ref:mt(o,t),...r,"cmdk-separator":"",role:"separator"})}),WE=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=Qa(),i=Nt(u=>u.search),a=Nt(u=>u.selectedItemId),c=br();return m.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),m.createElement(Q.input,{ref:t,...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?e.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),GE=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=m.useRef(null),i=m.useRef(null),a=Nt(u=>u.selectedItemId),c=br();return m.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let p=u.offsetHeight;d.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),m.createElement(Q.div,{ref:mt(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Jo(e,u=>m.createElement("div",{ref:mt(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),UE=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return m.createElement(Ha,{open:n,onOpenChange:r},m.createElement(Ka,{container:i},m.createElement(Ya,{"cmdk-overlay":"",className:o}),m.createElement(Xa,{"aria-label":e.label,"cmdk-dialog":"",className:s},m.createElement($p,{ref:t,...a}))))}),zE=m.forwardRef((e,t)=>Nt(n=>n.filtered.count===0)?m.createElement(Q.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),HE=m.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return m.createElement(Q.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Jo(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),be=Object.assign($p,{List:GE,Item:$E,Input:WE,Group:VE,Separator:BE,Dialog:UE,Empty:zE,Loading:HE});function KE(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function YE(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Vp(e){let t=m.useRef(e);return an(()=>{t.current=e}),t}var an=typeof window>"u"?m.useEffect:m.useLayoutEffect;function vn(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Nt(e){let t=Qa(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function Bp(e,t,n,r=[]){let o=m.useRef(),s=br();return an(()=>{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(e,a,c),(i=t.current)==null||i.setAttribute(yn,a),o.current=a}),o}var XE=()=>{let[e,t]=m.useState(),n=vn(()=>new Map);return an(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function qE(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jo({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(qE(t),{ref:t.ref},n(t.props.children)):n(t)}var ZE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function QE({options:e,value:t,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:p,sx:v,"aria-invalid":g,"aria-describedby":y,"aria-label":x}){const[b,C]=w.useState(!1),[S,T]=w.useState(n??[]),[E,R]=w.useState(""),P=w.useRef(null),M=t??S,A=w.useCallback($=>{t===void 0&&T($),r==null||r($)},[t,r]),j=w.useCallback($=>{M.includes($)?A(M.filter(X=>X!==$)):(a==null||M.length<a)&&A([...M,$])},[M,A,a]),F=w.useCallback($=>A(M.filter(X=>X!==$)),[M,A]),W=w.useMemo(()=>{const $=new Map;for(const X of e)$.set(X.value,X);return $},[e]),K=w.useMemo(()=>{const $=new Map;for(const X of e){const k=X.group??"";$.has(k)||$.set(k,[]),$.get(k).push(X)}return $},[e]),ee=$=>{$.key==="Backspace"&&E===""&&M.length>0&&($.preventDefault(),F(M[M.length-1]))};w.useEffect(()=>{b&&queueMicrotask(()=>{var $;return($=P.current)==null?void 0:$.focus()})},[b]);const{className:O,style:V,styleTag:N}=re(v,p,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),I=a!=null&&M.length>=a;return l.jsxs($a,{open:b,onOpenChange:$=>!d&&C($),children:[l.jsx(Va,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":b,"aria-haspopup":"listbox","aria-invalid":g,"aria-describedby":y,"aria-label":x,"data-state":b?"open":"closed","data-disabled":d||void 0,id:f,className:O,style:V,onClick:()=>!d&&C($=>!$),tabIndex:d?-1:0,onKeyDown:$=>{($.key==="Enter"||$.key===" "||$.key==="ArrowDown")&&!b&&($.preventDefault(),C(!0))},children:[N,M.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),M.map($=>{const X=W.get($);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(X==null?void 0:X.label)??$}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(X==null?void 0:X.label)??$}`,onClick:k=>{k.stopPropagation(),F($)},children:l.jsx(Ot,{size:12,"aria-hidden":"true"})})]},$)}),l.jsx(dr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(Ba,{children:l.jsx(Wa,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:$=>$.preventDefault(),children:l.jsxs(be,{shouldFilter:!0,label:"Options",children:[l.jsx(be.Input,{ref:P,placeholder:s,value:E,onValueChange:R,onKeyDown:ee}),l.jsxs(be.List,{children:[l.jsx(be.Empty,{children:i}),Array.from(K.entries()).map(([$,X])=>l.jsx(be.Group,{heading:$||void 0,children:X.map(k=>{const Z=M.includes(k.value),_=k.disabled||!Z&&I;return l.jsxs(be.Item,{value:`${k.label} ${k.description??""} ${k.value}`,disabled:_,onSelect:()=>j(k.value),children:[k.icon&&l.jsx("span",{style:{display:"inline-flex"},children:k.icon}),l.jsx("span",{children:k.label}),k.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:k.description}),Z&&l.jsx("span",{className:"cny-check",children:l.jsx(tn,{size:14,"aria-hidden":"true"})})]},k.value)})},$||"default"))]})]})})})]})}var es="Checkbox",[JE]=Te(es),[eM,Ja]=JE(es);function tM(e){const{__scopeCheckbox:t,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}=e,[h,p]=we({prop:n,defaultProp:o??!1,onChange:c,caller:es}),[v,g]=m.useState(null),[y,x]=m.useState(null),b=m.useRef(!1),C=v?!!i||!!v.closest("form"):!0,S={checked:h,disabled:s,setChecked:p,control:v,setControl:g,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Rt(o)?!1:o,isFormControl:C,bubbleInput:y,setBubbleInput:x};return l.jsx(eM,{scope:t,...S,children:nM(f)?f(S):r})}var Wp="CheckboxTrigger",Gp=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:v}=Ja(Wp,e),g=se(o,d),y=m.useRef(c);return m.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const b=()=>f(y.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[s,f]),l.jsx(Q.button,{type:"button",role:"checkbox","aria-checked":Rt(c)?"mixed":c,"aria-required":u,"data-state":Yp(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:g,onKeyDown:z(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:z(n,x=>{f(b=>Rt(b)?!0:!b),v&&p&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});Gp.displayName=Wp;var $i=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:u,form:d,...f}=e;return l.jsx(tM,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>l.jsxs(l.Fragment,{children:[l.jsx(Gp,{...f,ref:t,__scopeCheckbox:n}),h&&l.jsx(Kp,{__scopeCheckbox:n})]})})});$i.displayName=es;var Up="CheckboxIndicator",zp=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Ja(Up,n);return l.jsx(Ne,{present:r||Rt(s.checked)||s.checked===!0,children:l.jsx(Q.span,{"data-state":Yp(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});zp.displayName=Up;var Hp="CheckboxBubbleInput",Kp=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p}=Ja(Hp,e),v=se(n,p),g=yr(s),y=pr(r);m.useEffect(()=>{const b=h;if(!b)return;const C=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(C,"checked").set,E=!o.current;if(g!==s&&T){const R=new Event("click",{bubbles:E});b.indeterminate=Rt(s),T.call(b,Rt(s)?!1:s),b.dispatchEvent(R)}},[h,g,s,o]);const x=m.useRef(Rt(s)?!1:s);return l.jsx(Q.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Kp.displayName=Hp;function nM(e){return typeof e=="function"}function Rt(e){return e==="indeterminate"}function Yp(e){return Rt(e)?"indeterminate":e?"checked":"unchecked"}const Vi=w.forwardRef(function({className:t,style:n,sx:r,children:o,...s},i){const a=l.jsx(zp,{children:s.checked==="indeterminate"?l.jsx(bS,{size:12,"aria-hidden":"true"}):l.jsx(tn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:p}=re(r,n,"checkbox",t);return l.jsxs($i,{ref:i,className:f,style:h,...s,children:[p,a]})}const{className:c,style:u,styleTag:d}=re(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx($i,{ref:i,className:Y("checkbox",t),...s,children:a}),l.jsx("span",{children:o})]})});var ec="Radio",[rM,Xp]=Te(ec),[oM,sM]=rM(ec),qp=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:c,form:u,...d}=e,[f,h]=m.useState(null),p=se(t,y=>h(y)),v=m.useRef(!1),g=f?u||!!f.closest("form"):!0;return l.jsxs(oM,{scope:n,checked:o,disabled:i,children:[l.jsx(Q.button,{type:"button",role:"radio","aria-checked":o,"data-state":em(o),"data-disabled":i?"":void 0,disabled:i,value:a,...d,ref:p,onClick:z(e.onClick,y=>{o||c==null||c(),g&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),g&&l.jsx(Jp,{control:f,bubbles:!v.current,name:r,value:a,checked:o,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});qp.displayName=ec;var Zp="RadioIndicator",Qp=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=sM(Zp,n);return l.jsx(Ne,{present:r||s.checked,children:l.jsx(Q.span,{"data-state":em(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Qp.displayName=Zp;var iM="RadioBubbleInput",Jp=m.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=m.useRef(null),a=se(i,s),c=yr(n),u=pr(t);return m.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const v=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(v)}},[c,n,r]),l.jsx(Q.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Jp.displayName=iM;function em(e){return e?"checked":"unchecked"}var aM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ts="RadioGroup",[cM]=Te(ts,[kt,Xp]),tm=kt(),nm=Xp(),[lM,uM]=cM(ts),rm=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,p=tm(n),v=Dt(u),[g,y]=we({prop:s,defaultProp:o??null,onChange:f,caller:ts});return l.jsx(lM,{scope:n,name:r,required:i,disabled:a,value:g,onValueChange:y,children:l.jsx(_o,{asChild:!0,...p,orientation:c,dir:v,loop:d,children:l.jsx(Q.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:v,...h,ref:t})})})});rm.displayName=ts;var om="RadioGroupItem",sm=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=uM(om,n),i=s.disabled||r,a=tm(n),c=nm(n),u=m.useRef(null),d=se(t,u),f=s.value===o.value,h=m.useRef(!1);return m.useEffect(()=>{const p=g=>{aM.includes(g.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),l.jsx(Lo,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(qp,{disabled:i,required:s.required,checked:f,...c,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:z(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:z(o.onFocus,()=>{var p;h.current&&((p=u.current)==null||p.click())})})})});sm.displayName=om;var dM="RadioGroupIndicator",im=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=nm(n);return l.jsx(Qp,{...o,...r,ref:t})});im.displayName=dM;var fM=rm,Eu=sm,Mu=im;const hM=w.forwardRef(function({orientation:t="vertical",className:n,style:r,...o},s){return l.jsx(fM,{ref:s,className:n,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:t==="horizontal"?16:8,...r},...o})}),pM=w.forwardRef(function({className:t,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=re(r,n,"radio",t);return l.jsxs(Eu,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Mu,{})]})}const{className:a,style:c,styleTag:u}=re(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Eu,{ref:i,className:Y("radio",t),...s,children:l.jsx(Mu,{})}),l.jsx("span",{children:o})]})});var ns="Switch",[mM]=Te(ns),[gM,yM]=mM(ns),am=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=m.useState(null),v=se(t,C=>p(C)),g=m.useRef(!1),y=h?d||!!h.closest("form"):!0,[x,b]=we({prop:o,defaultProp:s??!1,onChange:u,caller:ns});return l.jsxs(gM,{scope:n,checked:x,disabled:a,children:[l.jsx(Q.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":dm(x),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:v,onClick:z(e.onClick,C=>{b(S=>!S),y&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),y&&l.jsx(um,{control:h,bubbles:!g.current,name:r,value:c,checked:x,required:i,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});am.displayName=ns;var cm="SwitchThumb",lm=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=yM(cm,n);return l.jsx(Q.span,{"data-state":dm(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});lm.displayName=cm;var vM="SwitchBubbleInput",um=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=m.useRef(null),a=se(i,s),c=yr(n),u=pr(t);return m.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const v=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(v)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});um.displayName=vM;function dm(e){return e?"checked":"unchecked"}var Au=am,Nu=lm;const xM=w.forwardRef(function({className:t,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=re(r,n,"switch",t);return l.jsxs(Au,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Nu,{className:"switch-thumb"})]})}const{className:a,style:c,styleTag:u}=re(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Au,{ref:i,className:Y("switch",t),...s,children:l.jsx(Nu,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function io(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function ju(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function Wr(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function qs(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function bM(e,t){return e.getFullYear()===t.getFullYear()}function st(e){return new Date(e.getFullYear(),e.getMonth(),1)}function wM(e){return new Date(e.getFullYear(),0,1)}function Du(e){return new Date(Math.floor(e.getFullYear()/10)*10,0,1)}function Gr(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function Ro(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function rt(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}function Zs(e,t,n,r=0){const o=new Date(e);return o.setHours(t,n,r,0),o}function ke(e,t,n){return t&&e.getTime()<t.getTime()?new Date(t):n&&e.getTime()>n.getTime()?new Date(n):e}function CM(e,t){const n=st(e),r=(n.getDay()-t+7)%7,o=Ro(n,-r);return Array.from({length:42},(s,i)=>Ro(o,i))}function SM(e,t){const n=new Intl.DateTimeFormat(e,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=Ro(r,(s+t)%7);return n.format(i)})}function TM(e,t="short"){const n=new Intl.DateTimeFormat(e,{month:t});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function ku(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function RM(e,t){return new Intl.DateTimeFormat(t,{year:"numeric"}).format(e)}function PM(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function fm(e,t){return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}function hm(e,t,n,r){return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(e)}function EM(e,t,n,r){return`${fm(e,t)} · ${hm(e,t,n,r)}`}function Ur(e){if(e==null||e==="")return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e);const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function zr(e,t){return e.getTime()<t.getTime()}function Hr(e,t){return e.getTime()>t.getTime()}function Kr(e){return e<10?`0${e}`:String(e)}function MM(e){return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function AM(e){try{return new Intl.DateTimeFormat(e,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function NM(e,t,n,r,o){switch(t){case"year":return RM(e,n);case"month":return PM(e,n);case"time":return hm(e,n,r,o);case"datetime":return EM(e,n,r,o);case"date":default:return fm(e,n)}}function jM(e,t){switch(t){case"year":return wM(e);case"month":return st(e);case"date":return io(e);default:return new Date(e)}}const DM=w.forwardRef(function({mode:t="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:p=!1,clearable:v=!0,locale:g,weekStartsOn:y=0,hour12:x,showSeconds:b=!1,minuteStep:C=1,secondStep:S=1,format:T,icon:E,required:R=!1,validate:P,error:M,onValidate:A,id:j,className:F,style:W,sx:K,"aria-invalid":ee,"aria-describedby":O,dialogLabel:V,name:N,open:I,onOpenChange:$,...X},k){const Z=MM(g),_=x??AM(Z),G=w.useId(),B=j??`cny-dp-${G}`,L=`${B}-dialog`,J=`${B}-hint`,U=w.useMemo(()=>{const D=Ur(s),q=a==="future"||a==="current"?io(new Date):null;return D&&q?D.getTime()>q.getTime()?D:q:D??q},[s,a]),H=w.useMemo(()=>{const D=Ur(i),q=a==="past"||a==="current"?ju(new Date):null;return D&&q?D.getTime()<q.getTime()?D:q:D??q},[i,a]),ce=n!==void 0,[ae,Ce]=w.useState(()=>Ur(r)),oe=ce?Ur(n):ae,ht=I!==void 0,[Bt,Wt]=w.useState(!1),Re=ht?I:Bt,Le=w.useCallback(D=>{ht||Wt(D),$==null||$(D)},[ht,$]),bc=w.useMemo(()=>oe??ke(new Date,U,H),[oe,U,H]),[fe,De]=w.useState(()=>st(bc)),[me,Se]=w.useState(()=>bc),fs=t==="month"?"month":t==="year"?"year":"date",[$e,Gt]=w.useState(fs),hs=w.useRef(null);w.useImperativeHandle(k,()=>hs.current,[]);const Vn=w.useRef(null),ps=w.useRef(null),wc=w.useRef(null),ms=w.useRef(null),[hy,py]=w.useState({}),[my,gy]=w.useState(!1);w.useEffect(()=>gy(!0),[]);const un=w.useCallback(D=>U&&zr(D,U)||H&&Hr(D,H)?!0:c?c(D):!1,[U,H,c]),Rr=w.useCallback(D=>u?u(D):!1,[u]),dn=w.useMemo(()=>{if(M)return typeof M=="string"?M:"Invalid";if(R&&!oe)return"Required";if(oe){const q=io(new Date);if(a==="future"&&zr(oe,q))return"Must be today or later";if(a==="past"&&Hr(oe,ju(new Date)))return"Must be today or earlier";if(a==="current"&&!Wr(oe,q))return"Must be today";if(U&&zr(oe,U))return"Too early";if(H&&Hr(oe,H))return"Too late";if(c&&c(oe))return"Unavailable date";if(u&&u(oe))return"Unavailable time"}const D=P==null?void 0:P(oe);return D||null},[M,R,oe,a,U,H,c,u,P]),Cc=w.useRef(null);w.useEffect(()=>{Cc.current!==dn&&(Cc.current=dn,A==null||A(dn))},[dn,A]);const Pr=dn!==null,Sc=Pr?"danger":h,yy=oe?T?T(oe,t):NM(oe,t,Z,_,b):"",vy=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[t],xy=V??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[t],xt=w.useCallback(D=>{ce||Ce(D),o==null||o(D)},[ce,o]),Er=w.useCallback(()=>{var D;Le(!1),(D=Vn.current)==null||D.focus()},[Le]),by=w.useCallback(D=>{var q;D.stopPropagation(),xt(null),(q=Vn.current)==null||q.focus()},[xt]),Tc=w.useCallback(()=>{if(p)return;const D=oe??ke(new Date,U,H);De(st(D)),Se(D),Gt(fs),Le(!0)},[p,oe,U,H,Le,fs]);w.useEffect(()=>{if(!Re)return;const D=q=>{var le,te;const ie=q.target;(le=hs.current)!=null&&le.contains(ie)||(te=ps.current)!=null&&te.contains(ie)||Le(!1)};return document.addEventListener("pointerdown",D,!0),()=>document.removeEventListener("pointerdown",D,!0)},[Re,Le]);const Mr=w.useCallback(()=>{const D=Vn.current,q=ps.current;if(!D||!q)return;const ie=D.getBoundingClientRect(),le=q.offsetHeight||340,te=q.offsetWidth||264,Ve=window.innerHeight,Ae=window.innerWidth,Be=4,ve=8,bt=Ve-ie.bottom,ys=ie.top,Uy=bt<le+Be&&ys>bt?Math.max(ve,ie.top-Be-le):Math.min(Ve-le-ve,ie.bottom+Be),zy=Math.max(ve,Math.min(ie.left,Ae-te-ve));py({position:"fixed",top:Uy,left:zy,width:te})},[]);w.useLayoutEffect(()=>{Re&&Mr()},[Re,t,Mr]),w.useEffect(()=>{if(!Re)return;const D=()=>Mr();return window.addEventListener("scroll",D,!0),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",D)}},[Re,Mr]),w.useEffect(()=>{var D,q;Re&&($e==="date"&&(t==="date"||t==="datetime")?(D=wc.current)==null||D.focus():($e==="month"||$e==="year")&&((q=ms.current)==null||q.focus()))},[Re,me,t,$e]);const Rc=w.useCallback(()=>{var D;$e==="year"&&t!=="year"?Gt("month"):$e==="month"&&t!=="month"?Gt("date"):(Le(!1),(D=Vn.current)==null||D.focus())},[$e,t,Le]),Ar=w.useCallback(D=>{const q=ke(D,U,H);Se(q),De(ie=>qs(ie,q)?ie:st(q))},[U,H]),Bn=w.useCallback((D,q)=>{const ie=jM(D,t);if(t!=="time"&&un(ie))return;const le=t==="time"||t==="datetime"?Zs(ie,(oe??D).getHours(),(oe??D).getMinutes(),b?(oe??D).getSeconds():0):ie;xt(le),Se(le),((q==null?void 0:q.close)??(t!=="datetime"&&t!=="time"))&&Er()},[t,un,xt,oe,b,Er]),Nr=w.useCallback((D,q)=>{const ie=oe??ke(new Date,U,H),le=D==="hour"?q:ie.getHours(),te=D==="minute"?q:ie.getMinutes(),Ve=D==="second"?q:b?ie.getSeconds():0,Ae=Zs(ie,le,te,Ve);Rr(Ae)||(xt(Ae),Se(Ae))},[oe,U,H,b,Rr,xt]),fn=w.useCallback(D=>Ar(Ro(me,D)),[Ar,me]),wy=D=>{switch(D.key){case"ArrowLeft":D.preventDefault(),fn(-1);break;case"ArrowRight":D.preventDefault(),fn(1);break;case"ArrowUp":D.preventDefault(),fn(-7);break;case"ArrowDown":D.preventDefault(),fn(7);break;case"Home":{D.preventDefault();const q=(me.getDay()-y+7)%7;fn(-q);break}case"End":{D.preventDefault();const q=(me.getDay()-y+7)%7;fn(6-q);break}case"PageUp":D.preventDefault(),Ar(D.shiftKey?rt(me,-1):Gr(me,-1));break;case"PageDown":D.preventDefault(),Ar(D.shiftKey?rt(me,1):Gr(me,1));break;case"Enter":case" ":D.preventDefault(),Bn(me);break;case"Escape":D.preventDefault(),Rc();break}},Cy=w.useMemo(()=>CM(fe,y),[fe,y]),Sy=w.useMemo(()=>SM(Z,y),[Z,y]),Ty=w.useMemo(()=>TM(Z,"short"),[Z]),gs=w.useMemo(()=>io(new Date),[]),Ry=!U||!zr(st(fe),st(U)),Py=!H||!Hr(st(fe),st(H)),Ey=!U||fe.getFullYear()-1>=U.getFullYear(),My=!H||fe.getFullYear()+1<=H.getFullYear(),Ut=Du(fe).getFullYear(),Ay=!U||Ut-10+9>=U.getFullYear(),Ny=!H||Ut+10<=H.getFullYear(),jy=t==="time"?!Rr(new Date):!un(gs),Dy=()=>{if(t==="time"){const D=new Date;if(Rr(D))return;const ie=Zs(oe??D,D.getHours(),D.getMinutes(),b?D.getSeconds():0);xt(ie),Se(ie);return}Bn(gs,{close:t!=="datetime"})},ky=Y("cny-datepicker-trigger","input",Sc!=="primary"&&Sc,f==="sm"||f==="lg"?f:null,oe&&"has-value",Re&&"is-open"),Iy=E??(t==="time"?l.jsx(tS,{size:15}):l.jsx(BC,{size:15})),Pc=(D,q)=>{let le=!0;switch(D.key){case"ArrowLeft":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()+11)%12,Math.min(te.getDate(),28)),U,H):te=>ke(new Date(te.getFullYear()-1,te.getMonth(),Math.min(te.getDate(),28)),U,H));break;case"ArrowRight":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()+1)%12,Math.min(te.getDate(),28)),U,H):te=>ke(new Date(te.getFullYear()+1,te.getMonth(),Math.min(te.getDate(),28)),U,H));break;case"ArrowUp":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()-3+12)%12,Math.min(te.getDate(),28)),U,H):te=>ke(new Date(te.getFullYear()-3,te.getMonth(),Math.min(te.getDate(),28)),U,H));break;case"ArrowDown":Se(q==="month"?te=>ke(new Date(fe.getFullYear(),(te.getMonth()+3)%12,Math.min(te.getDate(),28)),U,H):te=>ke(new Date(te.getFullYear()+3,te.getMonth(),Math.min(te.getDate(),28)),U,H));break;case"PageUp":De(q==="month"?te=>rt(te,D.shiftKey?-10:-1):te=>rt(te,D.shiftKey?-100:-10));break;case"PageDown":De(q==="month"?te=>rt(te,D.shiftKey?10:1):te=>rt(te,D.shiftKey?100:10));break;case"Enter":case" ":q==="month"?Ec(new Date(fe.getFullYear(),me.getMonth(),1)):Mc(me.getFullYear());break;case"Escape":Rc();break;default:le=!1}le&&D.preventDefault()};w.useEffect(()=>{if(Re&&$e==="year"){const D=Du(fe).getFullYear(),q=me.getFullYear();(q<D-1||q>D+10)&&De(new Date(q,0,1))}},[Re,$e,me,fe]);const Ec=D=>{t==="month"?Bn(D):(De(st(D)),Se(ke(D,U,H)),Gt("date"))},Mc=D=>{if(t==="year")Bn(new Date(D,0,1));else{const q=new Date(D,fe.getMonth(),1);De(q),Se(ke(new Date(D,me.getMonth(),Math.min(me.getDate(),28)),U,H)),Gt("month")}},Oy=()=>{const D=me.getMonth();return Ty.map((q,ie)=>{const le=new Date(fe.getFullYear(),ie,1),te=!!oe&&qs(le,oe)&&bM(le,oe),Ve=le.getMonth()===fe.getMonth()&&t!=="month",Ae=ie===D,Be=un(le);return l.jsx("button",{ref:Ae?ms:void 0,type:"button",tabIndex:Ae?0:-1,className:Y("cny-datepicker-chip",te&&"is-selected",Ve&&!te&&"is-current"),disabled:Be,onClick:()=>Ec(le),onFocus:()=>Se(new Date(fe.getFullYear(),ie,Math.min(me.getDate(),28))),children:q},ie)})},_y=()=>{const D=Ut-1,q=me.getFullYear();return Array.from({length:12},(ie,le)=>{const te=D+le,Ve=new Date(te,0,1),Ae=!!oe&&oe.getFullYear()===te,Be=te===fe.getFullYear()&&t!=="year",ve=te===q,bt=un(Ve),ys=te<Ut||te>=Ut+10;return l.jsx("button",{ref:ve?ms:void 0,type:"button",tabIndex:ve?0:-1,className:Y("cny-datepicker-chip",Ae&&"is-selected",Be&&!Ae&&"is-current",ys&&"is-outside"),disabled:bt,onClick:()=>Mc(te),onFocus:()=>Se(new Date(te,me.getMonth(),Math.min(me.getDate(),28))),children:te},te)})},Ly=w.useRef(null),Ac=w.useRef(null),Nc=w.useRef(null),jc=()=>{const D=oe??ke(new Date,U,H),q=D.getHours(),ie=D.getMinutes(),le=D.getSeconds(),te=q>=12,Ve=_?q%12===0?12:q%12:q,Ae=ve=>{const bt=_?te?ve===12?12:ve+12:ve===12?0:ve:ve;Nr("hour",bt)},Be=ve=>{const bt=ve?q<12?q+12:q:q>=12?q-12:q;Nr("hour",bt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Qs,{ref:Ly,ariaLabel:"Hour",value:Ve,min:_?1:0,max:_?12:23,step:1,nextRef:Ac,onChange:Ae}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Qs,{ref:Ac,ariaLabel:"Minute",value:ie-ie%Math.max(1,C),min:0,max:59,step:Math.max(1,C),nextRef:b?Nc:void 0,onChange:ve=>Nr("minute",ve)}),b&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Qs,{ref:Nc,ariaLabel:"Second",value:le-le%Math.max(1,S),min:0,max:59,step:Math.max(1,S),onChange:ve=>Nr("second",ve)})]}),_&&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:Y("cny-dp-ampm-btn",!te&&"is-active"),onClick:()=>Be(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":te,className:Y("cny-dp-ampm-btn",te&&"is-active"),onClick:()=>Be(!0),children:"PM"})]})]})})},Fy=()=>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:!Ry,onClick:()=>De(D=>Gr(D,-1)),children:l.jsx(no,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${ku(fe,Z)})`,onClick:()=>Gt("month"),children:ku(fe,Z)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Py,onClick:()=>De(D=>Gr(D,1)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:wy,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:Sy.map((D,q)=>l.jsx("span",{role:"columnheader","aria-label":D,className:"cny-datepicker-weekday",children:D.slice(0,2)},q))}),Array.from({length:6},(D,q)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:Cy.slice(q*7,q*7+7).map(ie=>{const le=!qs(ie,fe),te=Wr(ie,oe),Ve=Wr(ie,gs),Ae=Wr(ie,me),Be=un(ie);return l.jsx("button",{ref:Ae?wc:void 0,type:"button",role:"gridcell",tabIndex:Ae?0:-1,"aria-selected":te,"aria-current":Ve?"date":void 0,"aria-disabled":Be||void 0,disabled:Be,className:Y("cny-datepicker-cell",le&&"is-outside",te&&"is-selected",Ve&&"is-today"),onClick:()=>Bn(ie),onFocus:()=>Se(ie),children:ie.getDate()},ie.toISOString())})},q))]})]}),$y=()=>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:!Ey,onClick:()=>De(D=>rt(D,-1)),children:l.jsx(no,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${fe.getFullYear()})`,onClick:()=>Gt("year"),children:fe.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!My,onClick:()=>De(D=>rt(D,1)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:D=>Pc(D,"month"),children:Oy()})]}),Vy=()=>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:!Ay,onClick:()=>De(D=>rt(D,-10)),children:l.jsx(no,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${Ut} – ${Ut+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Ny,onClick:()=>De(D=>rt(D,10)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:D=>Pc(D,"year"),children:_y()})]}),{className:By,style:Wy,styleTag:Gy}=re(K,W,"cny-datepicker",`mode-${t}`,p&&"is-disabled",F);return l.jsxs("div",{ref:hs,className:By,style:Wy,...X,children:[Gy,N&&l.jsx("input",{type:"hidden",name:N,value:oe?oe.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:Vn,type:"button",id:B,className:ky,"aria-haspopup":"dialog","aria-expanded":Re,"aria-controls":Re?L:void 0,"aria-invalid":ee||Pr,"aria-describedby":Y(O,Pr?J:void 0)||void 0,"aria-required":R||void 0,disabled:p,onClick:Tc,onKeyDown:D=>{D.key==="ArrowDown"||D.key==="Enter"||D.key===" "?(D.preventDefault(),Tc()):D.key==="Escape"&&Re&&(D.preventDefault(),Le(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Iy}),l.jsx("span",{className:Y("cny-datepicker-value",!oe&&"is-placeholder"),children:yy||vy}),v&&oe&&!p&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:by,onPointerDown:D=>D.stopPropagation(),children:l.jsx(Ot,{size:13,"aria-hidden":"true"})})]}),Pr&&M!==!1&&l.jsx("span",{id:J,className:"cny-datepicker-error",role:"alert",children:typeof M=="string"?M:M??dn}),Re&&my&&Ao.createPortal(l.jsxs("div",{ref:ps,id:L,role:"dialog","aria-modal":"false","aria-label":xy,className:Y("cny-datepicker-panel",`is-${t}`),style:hy,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(t==="date"||t==="datetime")&&$e==="date"&&Fy(),(t==="date"||t==="datetime"||t==="month")&&$e==="month"&&$y(),(t==="date"||t==="datetime"||t==="month"||t==="year")&&$e==="year"&&Vy(),t==="time"&&jc(),t==="datetime"&&$e==="date"&&jc()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!jy,onClick:Dy,children:t==="time"?"Now":t==="year"?"This year":t==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),v&&oe&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{xt(null),Er()},children:"Clear"}),(t==="datetime"||t==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:Er,children:"Done"})]})]}),document.body)]})}),Qs=w.forwardRef(function({value:t,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=w.useRef(null);w.useImperativeHandle(c,()=>u.current,[]);const[d,f]=w.useState(()=>Kr(t)),h=w.useRef(!1);w.useEffect(()=>{h.current||f(Kr(t))},[t]);const p=w.useCallback(x=>{if(!Number.isFinite(x))return;let b=Math.max(n,Math.min(r,x));b=Math.round(b/o)*o,b>r&&(b=Math.floor(r/o)*o),a(b),f(Kr(b))},[n,r,o,a]),v=()=>{const x=t+o;p(x>r?n:x)},g=()=>{const x=t-o;p(x<n?Math.floor(r/o)*o:x)},y=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),v();break;case"ArrowDown":x.preventDefault(),g();break;case"PageUp":x.preventDefault(),p(t+o*5);break;case"PageDown":x.preventDefault(),p(t-o*5);break;case"Home":x.preventDefault(),p(n);break;case"End":x.preventDefault(),p(r);break;case"Enter":x.preventDefault(),p(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?v():x.deltaY>0&&g())},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":t,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var C;const b=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(b),b.length===2){const S=parseInt(b,10);Number.isFinite(S)&&S>=n&&S<=r&&(p(S),(C=i==null?void 0:i.current)==null||C.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?p(x):f(Kr(t))},onKeyDown:y}),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:v,onMouseDown:x=>x.preventDefault(),children:l.jsx(Kf,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(dr,{size:10,"aria-hidden":"true"})})]})]})});function kM({hotkey:e=!0}={}){const[t,n]=w.useState(!1);return w.useEffect(()=>{if(!e)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)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}function IM({open:e,onOpenChange:t,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),t(!1))};return l.jsxs(be.Dialog,{open:e,onOpenChange:t,label:o,contentClassName:Y("cny-cmdk-content",u),children:[l.jsxs(_a,{children:[l.jsx(qa,{children:o}),l.jsx(Za,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(qf,{size:16,"aria-hidden":"true"}),l.jsx(be.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(be.List,{className:"cny-cmdk-list",children:[l.jsx(be.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(be.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var p;return l.jsxs(be.Item,{value:`${f.title} ${h.label} ${((p=h.keywords)==null?void 0:p.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 OM({onClick:e,label:t="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:e,className:Y("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(qf,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:t}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let _M=0;const LM=()=>`cny-toast-${Date.now().toString(36)}-${++_M}`,pm=w.createContext(null),FM={default:null,success:l.jsx(ZC,{size:16,"aria-hidden":"true"}),info:l.jsx(yS,{size:16,"aria-hidden":"true"}),warning:l.jsx(SS,{size:16,"aria-hidden":"true"}),danger:l.jsx(XC,{size:16,"aria-hidden":"true"}),loading:l.jsx(Xf,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function $M({children:e,position:t="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=w.useState([]),[a,c]=w.useState(!1);w.useEffect(()=>c(!0),[]);const u=w.useCallback(g=>{i(y=>y.map(x=>g==null||x.id===g?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(y=>y.filter(x=>g==null?!1:x.id!==g||!x.exiting)),i(y=>(y.filter(x=>x.exiting&&(g==null||x.id===g)).forEach(x=>{var b;return(b=x.onDismiss)==null?void 0:b.call(x)}),y.filter(x=>!x.exiting||g!=null&&x.id!==g)))},200)},[]),d=w.useCallback(g=>{const y=g.id??LM(),x={id:y,title:g.title,description:g.description,action:g.action,icon:g.icon,variant:g.variant??"default",duration:g.duration??n,dismissible:g.dismissible??!0,onDismiss:g.onDismiss,sx:g.sx};return i(b=>{const S=[...b.filter(T=>T.id!==y),x];return S.length>r?S.slice(S.length-r):S}),y},[n,r]),f=w.useCallback((g,y)=>{i(x=>x.map(b=>b.id===g?{...b,...y,variant:y.variant??b.variant,duration:y.duration??b.duration,dismissible:y.dismissible??b.dismissible}:b))},[]),h=w.useMemo(()=>{const g=(y=>d(typeof y=="string"?{title:y}:y));return g.success=(y,x)=>d({...x,title:y,variant:"success"}),g.info=(y,x)=>d({...x,title:y,variant:"info"}),g.warning=(y,x)=>d({...x,title:y,variant:"warning"}),g.error=(y,x)=>d({...x,title:y,variant:"danger"}),g.loading=(y,x)=>d({...x,title:y,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),g},[d]),p=w.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),v=t.startsWith("top-");return l.jsxs(pm.Provider,{value:p,children:[e,a&&Ao.createPortal(l.jsx("ol",{className:Y("cny-toast-viewport",`pos-${t}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(v?[...s].reverse():s).map(g=>l.jsx(VM,{toast:g,onDismiss:()=>u(g.id)},g.id))}),document.body)]})}function VM({toast:e,onDismiss:t}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=e,[d,f]=w.useState(!1),h=w.useRef(null);w.useEffect(()=>{if(!e.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(t,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,t,e.exiting]);const p=n==="danger"||n==="warning"?"alert":"status",v=i!==!1,g=i!==void 0&&i!==!1?i:FM[n],{className:y,style:x,styleTag:b}=re(u,void 0,"cny-toast",n,e.exiting&&"is-exiting");return l.jsxs("li",{role:p,"aria-atomic":"true",className:y,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[b,v&&g&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:g}),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:t,children:l.jsx(Ot,{size:14,"aria-hidden":"true"})})]})}function BM(){const e=w.useContext(pm);if(!e)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return e}const mm=w.forwardRef(function({title:t,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:p,styleTag:v}=re(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Ha,{...d,children:l.jsxs(Ka,{children:[l.jsx(Ya,{className:"cny-dialog-overlay"}),l.jsxs(Xa,{ref:f,className:h,style:p,children:[v,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(qa,{className:"cny-dialog-title",children:t}),n&&l.jsx(Za,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Qo,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Ot,{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})]})]})})}),WM=Ip,GM=Qo;function gm({open:e,onOpenChange:t,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:p}){const v=()=>{d==null||d(),t(!1)};return l.jsx(mm,{open:e,onOpenChange:t,size:"sm",title:n,className:Y("cny-confirm",f),style:h,sx:p,footer:l.jsxs(l.Fragment,{children:[l.jsx(er,{variant:"ghost",color:"primary",onClick:v,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 UM(){const[e,t]=w.useState(null),n=w.useCallback(i=>new Promise(a=>{t({...i,resolve:a})}),[]),r=w.useCallback(i=>{i||t(a=>(a==null||a.resolve(!1),null))},[]),o=w.useCallback(()=>{t(i=>(i==null||i.resolve(!0),null))},[]),s=e?l.jsx(gm,{open:!0,onOpenChange:r,title:e.title,message:e.message,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,danger:e.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const zM=w.forwardRef(function({title:t,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:p,style:v,styleTag:g}=re(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Ha,{...f,children:l.jsxs(Ka,{children:[l.jsx(Ya,{className:"cny-drawer-overlay"}),l.jsxs(Xa,{ref:h,className:p,style:v,children:[g,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(qa,{className:"cny-drawer-title",children:t}),n&&l.jsx(Za,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Qo,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Ot,{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})]})]})})}),HM=Ip,KM=Qo;var Bi=["Enter"," "],YM=["ArrowDown","PageUp","Home"],ym=["ArrowUp","PageDown","End"],XM=[...YM,...ym],qM={ltr:[...Bi,"ArrowRight"],rtl:[...Bi,"ArrowLeft"]},ZM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wr="Menu",[nr,QM,JM]=lr(wr),[ln,vm]=Te(wr,[JM,_t,kt]),Cr=_t(),xm=kt(),[bm,Vt]=ln(wr),[eA,Sr]=ln(wr),wm=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Cr(t),[c,u]=m.useState(null),d=m.useRef(!1),f=Qe(s),h=Dt(o);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),l.jsx(mr,{...a,children:l.jsx(bm,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(eA,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};wm.displayName=wr;var tA="MenuAnchor",tc=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Cr(n);return l.jsx(gr,{...o,...r,ref:t})});tc.displayName=tA;var nc="MenuPortal",[nA,Cm]=ln(nc,{forceMount:void 0}),Sm=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Vt(nc,t);return l.jsx(nA,{scope:t,forceMount:n,children:l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:r})})})};Sm.displayName=nc;var Ke="MenuContent",[rA,rc]=ln(Ke),Tm=m.forwardRef((e,t)=>{const n=Cm(Ke,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Vt(Ke,e.__scopeMenu),i=Sr(Ke,e.__scopeMenu);return l.jsx(nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ne,{present:r||s.open,children:l.jsx(nr.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(oA,{...o,ref:t}):l.jsx(sA,{...o,ref:t})})})})}),oA=m.forwardRef((e,t)=>{const n=Vt(Ke,e.__scopeMenu),r=m.useRef(null),o=se(t,r);return m.useEffect(()=>{const s=r.current;if(s)return zo(s)},[]),l.jsx(oc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),sA=m.forwardRef((e,t)=>{const n=Vt(Ke,e.__scopeMenu);return l.jsx(oc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),iA=en("MenuContent.ScrollLock"),oc=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:v,...g}=e,y=Vt(Ke,n),x=Sr(Ke,n),b=Cr(n),C=xm(n),S=QM(n),[T,E]=m.useState(null),R=m.useRef(null),P=se(t,R,y.onContentChange),M=m.useRef(0),A=m.useRef(""),j=m.useRef(0),F=m.useRef(null),W=m.useRef("right"),K=m.useRef(0),ee=v?vr:m.Fragment,O=v?{as:iA,allowPinchZoom:!0}:void 0,V=I=>{var L,J;const $=A.current+I,X=S().filter(U=>!U.disabled),k=document.activeElement,Z=(L=X.find(U=>U.ref.current===k))==null?void 0:L.textValue,_=X.map(U=>U.textValue),G=vA(_,$,Z),B=(J=X.find(U=>U.textValue===G))==null?void 0:J.ref.current;(function U(H){A.current=H,window.clearTimeout(M.current),H!==""&&(M.current=window.setTimeout(()=>U(""),1e3))})($),B&&setTimeout(()=>B.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),Fo();const N=m.useCallback(I=>{var X,k;return W.current===((X=F.current)==null?void 0:X.side)&&bA(I,(k=F.current)==null?void 0:k.area)},[]);return l.jsx(rA,{scope:n,searchRef:A,onItemEnter:m.useCallback(I=>{N(I)&&I.preventDefault()},[N]),onItemLeave:m.useCallback(I=>{var $;N(I)||(($=R.current)==null||$.focus(),E(null))},[N]),onTriggerLeave:m.useCallback(I=>{N(I)&&I.preventDefault()},[N]),pointerGraceTimerRef:j,onPointerGraceIntentChange:m.useCallback(I=>{F.current=I},[]),children:l.jsx(ee,{...O,children:l.jsx(fr,{asChild:!0,trapped:o,onMountAutoFocus:z(s,I=>{var $;I.preventDefault(),($=R.current)==null||$.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(In,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:l.jsx(_o,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:E,onEntryFocus:z(c,I=>{x.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Go,{role:"menu","aria-orientation":"vertical","data-state":Bm(y.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:z(g.onKeyDown,I=>{const X=I.target.closest("[data-radix-menu-content]")===I.currentTarget,k=I.ctrlKey||I.altKey||I.metaKey,Z=I.key.length===1;X&&(I.key==="Tab"&&I.preventDefault(),!k&&Z&&V(I.key));const _=R.current;if(I.target!==_||!XM.includes(I.key))return;I.preventDefault();const B=S().filter(L=>!L.disabled).map(L=>L.ref.current);ym.includes(I.key)&&B.reverse(),gA(B)}),onBlur:z(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(M.current),A.current="")}),onPointerMove:z(e.onPointerMove,rr(I=>{const $=I.target,X=K.current!==I.clientX;if(I.currentTarget.contains($)&&X){const k=I.clientX>K.current?"right":"left";W.current=k,K.current=I.clientX}}))})})})})})})});Tm.displayName=Ke;var aA="MenuGroup",sc=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Q.div,{role:"group",...r,ref:t})});sc.displayName=aA;var cA="MenuLabel",Rm=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Q.div,{...r,ref:t})});Rm.displayName=cA;var Po="MenuItem",Iu="menu.itemSelect",rs=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=m.useRef(null),i=Sr(Po,e.__scopeMenu),a=rc(Po,e.__scopeMenu),c=se(t,s),u=m.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(Iu,{bubbles:!0,cancelable:!0});f.addEventListener(Iu,p=>r==null?void 0:r(p),{once:!0}),Df(f,h),h.defaultPrevented?u.current=!1:i.onClose()}};return l.jsx(Pm,{...o,ref:c,disabled:n,onClick:z(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:z(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:z(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||Bi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});rs.displayName=Po;var Pm=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=rc(Po,n),a=xm(n),c=m.useRef(null),u=se(t,c),[d,f]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const v=c.current;v&&p((v.textContent??"").trim())},[s.children]),l.jsx(nr.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:l.jsx(Lo,{asChild:!0,...a,focusable:!r,children:l.jsx(Q.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:z(e.onPointerMove,rr(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,rr(v=>i.onItemLeave(v))),onFocus:z(e.onFocus,()=>f(!0)),onBlur:z(e.onBlur,()=>f(!1))})})})}),lA="MenuCheckboxItem",Em=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return l.jsx(Dm,{scope:e.__scopeMenu,checked:n,children:l.jsx(rs,{role:"menuitemcheckbox","aria-checked":Eo(n)?"mixed":n,...o,ref:t,"data-state":cc(n),onSelect:z(o.onSelect,()=>r==null?void 0:r(Eo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Em.displayName=lA;var Mm="MenuRadioGroup",[uA,dA]=ln(Mm,{value:void 0,onValueChange:()=>{}}),Am=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Qe(r);return l.jsx(uA,{scope:e.__scopeMenu,value:n,onValueChange:s,children:l.jsx(sc,{...o,ref:t})})});Am.displayName=Mm;var Nm="MenuRadioItem",jm=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=dA(Nm,e.__scopeMenu),s=n===o.value;return l.jsx(Dm,{scope:e.__scopeMenu,checked:s,children:l.jsx(rs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":cc(s),onSelect:z(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});jm.displayName=Nm;var ic="MenuItemIndicator",[Dm,fA]=ln(ic,{checked:!1}),km=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=fA(ic,n);return l.jsx(Ne,{present:r||Eo(s.checked)||s.checked===!0,children:l.jsx(Q.span,{...o,ref:t,"data-state":cc(s.checked)})})});km.displayName=ic;var hA="MenuSeparator",Im=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Q.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Im.displayName=hA;var pA="MenuArrow",Om=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Cr(n);return l.jsx(Uo,{...o,...r,ref:t})});Om.displayName=pA;var ac="MenuSub",[mA,_m]=ln(ac),Lm=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Vt(ac,t),i=Cr(t),[a,c]=m.useState(null),[u,d]=m.useState(null),f=Qe(o);return m.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(mr,{...i,children:l.jsx(bm,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(mA,{scope:t,contentId:ge(),triggerId:ge(),trigger:a,onTriggerChange:c,children:n})})})};Lm.displayName=ac;var Hn="MenuSubTrigger",Fm=m.forwardRef((e,t)=>{const n=Vt(Hn,e.__scopeMenu),r=Sr(Hn,e.__scopeMenu),o=_m(Hn,e.__scopeMenu),s=rc(Hn,e.__scopeMenu),i=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),l.jsx(tc,{asChild:!0,...u,children:l.jsx(Pm,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Bm(n.open),...e,ref:mt(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,rr(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:z(e.onPointerLeave,rr(f=>{var p,v;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const g=(v=n.content)==null?void 0:v.dataset.side,y=g==="right",x=y?-5:5,b=h[y?"left":"right"],C=h[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:b,y:h.top},{x:C,y:h.top},{x:C,y:h.bottom},{x:b,y:h.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,f=>{var p;const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||qM[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});Fm.displayName=Hn;var $m="MenuSubContent",Vm=m.forwardRef((e,t)=>{const n=Cm(Ke,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Vt(Ke,e.__scopeMenu),i=Sr(Ke,e.__scopeMenu),a=_m($m,e.__scopeMenu),c=m.useRef(null),u=se(t,c);return l.jsx(nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ne,{present:r||s.open,children:l.jsx(nr.Slot,{scope:e.__scopeMenu,children:l.jsx(oc,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:z(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:z(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=ZM[i.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),d.preventDefault())})})})})})});Vm.displayName=$m;function Bm(e){return e?"open":"closed"}function Eo(e){return e==="indeterminate"}function cc(e){return Eo(e)?"indeterminate":e?"checked":"unchecked"}function gA(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function yA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vA(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=yA(e,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}function xA(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[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}function bA(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return xA(n,t)}function rr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var wA=wm,CA=tc,SA=Sm,TA=Tm,RA=sc,PA=Rm,EA=rs,MA=Em,AA=Am,NA=jm,jA=km,DA=Im,kA=Om,IA=Lm,OA=Fm,_A=Vm,os="DropdownMenu",[LA]=Te(os,[vm]),je=vm(),[FA,Wm]=LA(os),Gm=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=je(t),u=m.useRef(null),[d,f]=we({prop:o,defaultProp:s??!1,onChange:i,caller:os});return l.jsx(FA,{scope:t,triggerId:ge(),triggerRef:u,contentId:ge(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(wA,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};Gm.displayName=os;var Um="DropdownMenuTrigger",zm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Wm(Um,n),i=je(n);return l.jsx(CA,{asChild:!0,...i,children:l.jsx(Q.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:mt(t,s.triggerRef),onPointerDown:z(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:z(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});zm.displayName=Um;var $A="DropdownMenuPortal",Hm=e=>{const{__scopeDropdownMenu:t,...n}=e,r=je(t);return l.jsx(SA,{...r,...n})};Hm.displayName=$A;var Km="DropdownMenuContent",Ym=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wm(Km,n),s=je(n),i=m.useRef(!1);return l.jsx(TA,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:z(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!o.modal||d)&&(i.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)"}})});Ym.displayName=Km;var VA="DropdownMenuGroup",BA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(RA,{...o,...r,ref:t})});BA.displayName=VA;var WA="DropdownMenuLabel",Xm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(PA,{...o,...r,ref:t})});Xm.displayName=WA;var GA="DropdownMenuItem",qm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(EA,{...o,...r,ref:t})});qm.displayName=GA;var UA="DropdownMenuCheckboxItem",Zm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(MA,{...o,...r,ref:t})});Zm.displayName=UA;var zA="DropdownMenuRadioGroup",Qm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(AA,{...o,...r,ref:t})});Qm.displayName=zA;var HA="DropdownMenuRadioItem",Jm=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(NA,{...o,...r,ref:t})});Jm.displayName=HA;var KA="DropdownMenuItemIndicator",eg=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(jA,{...o,...r,ref:t})});eg.displayName=KA;var YA="DropdownMenuSeparator",tg=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(DA,{...o,...r,ref:t})});tg.displayName=YA;var XA="DropdownMenuArrow",qA=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(kA,{...o,...r,ref:t})});qA.displayName=XA;var ZA=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=je(t),[a,c]=we({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(IA,{...i,open:a,onOpenChange:c,children:n})},QA="DropdownMenuSubTrigger",ng=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(OA,{...o,...r,ref:t})});ng.displayName=QA;var JA="DropdownMenuSubContent",rg=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return l.jsx(_A,{...o,...r,ref:t,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)"}})});rg.displayName=JA;var eN=Gm,tN=zm,og=Hm,nN=Ym,rN=Xm,oN=qm,sN=Zm,iN=Qm,aN=Jm,sg=eg,cN=tg,lN=ZA,uN=ng,dN=rg;const fN=eN,hN=tN,pN=w.forwardRef(function({className:t,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-menu-content",`size-${o}`,t);return l.jsx(og,{children:l.jsxs(nN,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),mN=w.forwardRef(function({icon:t,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(oN,{ref:a,className:Y("cny-menu-item",r&&"is-destructive",o),...i,children:[t&&l.jsx("span",{className:"cny-menu-item-icon",children:t}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),gN=w.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(sN,{ref:s,className:Y("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(sg,{children:l.jsx(tn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),t&&l.jsx("span",{className:"cny-menu-item-shortcut",children:t})]})}),yN=iN,vN=w.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(aN,{ref:s,className:Y("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(sg,{children:l.jsx(JC,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),t&&l.jsx("span",{className:"cny-menu-item-shortcut",children:t})]})}),xN=w.forwardRef(function({className:t,...n},r){return l.jsx(rN,{ref:r,className:Y("cny-menu-label",t),...n})}),bN=w.forwardRef(function({className:t,...n},r){return l.jsx(cN,{ref:r,className:Y("cny-menu-separator",t),...n})}),wN=lN,CN=w.forwardRef(function({icon:t,className:n,children:r,...o},s){return l.jsxs(uN,{ref:s,className:Y("cny-menu-item is-sub",n),...o,children:[t&&l.jsx("span",{className:"cny-menu-item-icon",children:t}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Qt,{size:13,"aria-hidden":"true"})})]})}),SN=w.forwardRef(function({className:t,...n},r){return l.jsx(og,{children:l.jsx(dN,{ref:r,className:Y("cny-menu-content",t),...n})})});var[ss]=Te("Tooltip",[_t]),is=_t(),ig="TooltipProvider",TN=700,Wi="tooltip.open",[RN,lc]=ss(ig),ag=e=>{const{__scopeTooltip:t,delayDuration:n=TN,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=m.useRef(!0),a=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(RN,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:m.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};ag.displayName=ig;var or="Tooltip",[PN,Tr]=ss(or),cg=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=lc(or,e.__scopeTooltip),u=is(t),[d,f]=m.useState(null),h=ge(),p=m.useRef(0),v=i??c.disableHoverableContent,g=a??c.delayDuration,y=m.useRef(!1),[x,b]=we({prop:r,defaultProp:o??!1,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(Wi))):c.onClose(),s==null||s(R)},caller:or}),C=m.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),S=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),T=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),E=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},g)},[g,b]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(mr,{...u,children:l.jsx(PN,{scope:t,contentId:h,open:x,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?E():S()},[c.isOpenDelayedRef,E,S]),onTriggerLeave:m.useCallback(()=>{v?T():(window.clearTimeout(p.current),p.current=0)},[T,v]),onOpen:S,onClose:T,disableHoverableContent:v,children:n})})};cg.displayName=or;var Gi="TooltipTrigger",lg=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Tr(Gi,n),s=lc(Gi,n),i=is(n),a=m.useRef(null),c=se(t,a,o.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(gr,{asChild:!0,...i,children:l.jsx(Q.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:z(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:z(e.onBlur,o.onClose),onClick:z(e.onClick,o.onClose)})})});lg.displayName=Gi;var uc="TooltipPortal",[EN,MN]=ss(uc,{forceMount:void 0}),ug=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Tr(uc,t);return l.jsx(EN,{scope:t,forceMount:n,children:l.jsx(Ne,{present:n||s.open,children:l.jsx(Ln,{asChild:!0,container:o,children:r})})})};ug.displayName=uc;var An="TooltipContent",dg=m.forwardRef((e,t)=>{const n=MN(An,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Tr(An,e.__scopeTooltip);return l.jsx(Ne,{present:r||i.open,children:i.disableHoverableContent?l.jsx(fg,{side:o,...s,ref:t}):l.jsx(AN,{side:o,...s,ref:t})})}),AN=m.forwardRef((e,t)=>{const n=Tr(An,e.__scopeTooltip),r=lc(An,e.__scopeTooltip),o=m.useRef(null),s=se(t,o),[i,a]=m.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,g)=>{const y=v.currentTarget,x={x:v.clientX,y:v.clientY},b=kN(x,y.getBoundingClientRect()),C=IN(x,b),S=ON(g.getBoundingClientRect()),T=LN([...C,...S]);a(T),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(c&&d){const v=y=>p(y,d),g=y=>p(y,c);return c.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[c,d,p,h]),m.useEffect(()=>{if(i){const v=g=>{const y=g.target,x={x:g.clientX,y:g.clientY},b=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),C=!_N(x,i);b?h():C&&(h(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,d,i,u,h]),l.jsx(fg,{...e,ref:s})}),[NN,jN]=ss(or,{isInside:!1}),DN=oC("TooltipContent"),fg=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Tr(An,n),u=is(n),{onClose:d}=c;return m.useEffect(()=>(document.addEventListener(Wi,d),()=>document.removeEventListener(Wi,d)),[d]),m.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(In,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(Go,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.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(DN,{children:r}),l.jsx(NN,{scope:n,isInside:!0,children:l.jsx(IR,{id:c.contentId,role:"tooltip",children:o||r})})]})})});dg.displayName=An;var hg="TooltipArrow",pg=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=is(n);return jN(hg,n).isInside?null:l.jsx(Uo,{...o,...r,ref:t})});pg.displayName=hg;function kN(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.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")}}function IN(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ON(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function _N(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[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}function LN(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),FN(t)}function FN(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[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(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $N=ag,mg=cg,gg=lg,yg=ug,vg=dg,VN=pg;const BN=$N,WN=w.forwardRef(function({children:t,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:p,style:v,styleTag:g}=re(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:t}):l.jsxs(mg,{delayDuration:i,open:a,children:[l.jsx(gg,{asChild:!0,children:t}),l.jsx(yg,{children:l.jsxs(vg,{ref:h,side:r,align:o,sideOffset:s,className:p,style:v,children:[g,n,l.jsx(VN,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),GN=mg,UN=gg,zN=w.forwardRef(function({className:t,...n},r){return l.jsx(yg,{children:l.jsx(vg,{ref:r,className:Y("cny-tooltip-content",t),...n})})}),HN=$a,KN=Va,YN=gE,XN=yE,qN=w.forwardRef(function({className:t,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-popover-content",t);return l.jsx(Ba,{children:l.jsxs(Wa,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(vE,{className:"cny-popover-arrow",width:12,height:6})]})})}),ZN=w.forwardRef(function({color:t="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:p,...v},g){const y=!u&&c!=null,{className:x,style:b,styleTag:C}=re(h,f,"cny-chip",t,n,r==="sm"&&"sm",y&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:g,role:y?"button":void 0,tabIndex:y?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,className:x,style:b,...v,children:[C,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:p}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:S=>{S.stopPropagation(),i(S)},children:l.jsx(Ot,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),QN=w.forwardRef(function({count:t,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},p){const v=typeof t=="number",g=v&&t>r?`${r}+`:t,x=!n&&v&&t===0&&!o?null:l.jsx("span",{className:Y("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!a&&`cny-badge-${i}`),children:n?null:g});if(a){const{className:T,style:E,styleTag:R}=re(f,d,"cny-badge","cny-badge-standalone",u);return l.jsxs("span",{ref:p,className:T,style:E,...h,children:[R,x]})}const{className:b,style:C,styleTag:S}=re(f,d,"cny-badge",u);return l.jsxs("span",{ref:p,className:b,style:C,...h,children:[S,c,x]})}),JN=w.forwardRef(function({position:t="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=re(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${t}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),e1=w.forwardRef(function({className:t,...n},r){return l.jsx("li",{ref:r,className:Y("cny-timeline-item",t),...n})}),t1=w.forwardRef(function({className:t,...n},r){return l.jsx("div",{ref:r,className:Y("cny-timeline-separator",t),...n})}),n1=w.forwardRef(function({color:t="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:Y("cny-timeline-dot",`cny-timeline-dot-${t}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),r1=w.forwardRef(function({color:t,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:Y("cny-timeline-connector",t&&`cny-timeline-connector-${t}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),o1=w.forwardRef(function({variant:t="plain",accentColor:n,className:r,...o},s){const i=t==="card"||t==="elevated";return l.jsx("div",{ref:s,className:Y("cny-timeline-content",i&&"cny-timeline-content-card",t==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),s1=w.forwardRef(function({className:t,...n},r){return l.jsx("div",{ref:r,className:Y("cny-timeline-opposite-content",t),...n})}),xg=w.createContext(null);function i1(){const e=w.useContext(xg);if(!e)throw new Error("TreeItem must be used within a <TreeView>.");return e}const bg=w.forwardRef(function({expandedIds:t,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...p},v){const[g,y]=w.useState(n??[]),[x,b]=w.useState(s),[C,S]=w.useState(null),T=t??g,E=o!==void 0?o:x,R=w.useMemo(()=>new Set(T),[T]),P=w.useCallback(V=>R.has(V),[R]),M=w.useCallback(V=>{const N=!R.has(V),I=N?[...T,V]:T.filter($=>$!==V);t===void 0&&y(I),r==null||r(I),a==null||a(V,N)},[T,R,t,r,a]),A=w.useCallback(V=>{o===void 0&&b(V),i==null||i(V)},[o,i]),j=w.useMemo(()=>({isExpanded:P,toggle:M,selectedId:E,select:A,activeId:C,setActive:S,defaultIcons:c}),[P,M,E,A,C,c]),F=w.useRef(null),W=w.useCallback(V=>{F.current=V,typeof v=="function"?v(V):v&&(v.current=V)},[v]);w.useEffect(()=>{var I;if(C!==null)return;const V=(I=F.current)==null?void 0:I.querySelector('[role="treeitem"]'),N=V==null?void 0:V.dataset.treeId;N&&S(N)},[C]);const{className:K,style:ee,styleTag:O}=re(f,d,"cny-tree",u);return l.jsx(xg.Provider,{value:j,children:l.jsxs("ul",{ref:W,role:"tree",className:K,style:ee,...p,children:[O,h]})})});function a1(e){return e?Array.from(e.querySelectorAll('[role="treeitem"]')):[]}const wg=w.forwardRef(function({itemId:t,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:p,defaultIcons:v}=i1(),g=!!o,y=g&&c(t),x=d===t,b=h===t,C=r??(v?g?y?l.jsx(hS,{size:16}):l.jsx(mS,{size:16}):l.jsx(dS,{size:16}):null),S=()=>{p(t),f(t),g&&u(t)},T=R=>{R.preventDefault(),R.stopPropagation(),p(t),u(t)},E=R=>{var M;const P=R.currentTarget.closest('[role="tree"]');switch(R.key){case"ArrowRight":if(R.preventDefault(),g&&!y)u(t);else if(y){const A=R.currentTarget.querySelector('[role="treeitem"]');A==null||A.focus()}break;case"ArrowLeft":if(R.preventDefault(),g&&y)u(t);else{const A=(M=R.currentTarget.parentElement)==null?void 0:M.closest('[role="treeitem"]');A==null||A.focus()}break;case"ArrowDown":case"ArrowUp":{R.preventDefault();const A=a1(P),j=A.indexOf(R.currentTarget),F=A[j+(R.key==="ArrowDown"?1:-1)];F==null||F.focus();break}case"Enter":case" ":R.preventDefault(),f(t),g&&u(t);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":t,"aria-expanded":g?y:void 0,"aria-selected":x,tabIndex:b?0:-1,className:Y("cny-tree-item",s),onKeyDown:E,onFocus:R=>{R.target===R.currentTarget&&p(t)},...i,children:[l.jsxs("div",{className:Y("cny-tree-row",x&&"is-selected"),onClick:S,children:[g?l.jsx("button",{type:"button",tabIndex:-1,className:Y("cny-tree-toggle",y&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:t}`,onClick:T,children:l.jsx(Qt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),C!=null&&l.jsx("span",{className:"cny-tree-icon",children:C}),l.jsx("span",{className:"cny-tree-label",children:n})]}),y&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),c1=w.forwardRef(function({items:t,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(bg,{ref:a,...i,children:c(t)})});function l1(e){if(!e)return[];if(typeof e=="string")return e.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(e))return e.map(n=>n.trim()).filter(Boolean);const t=[];for(const[n,r]of Object.entries(e)){t.push(n);for(const o of r)t.push(o)}return t}function u1(e,t){if(t.length===0)return!0;const n=e.name.toLowerCase(),r=(e.type||"").toLowerCase();return t.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 Cg(e={}){const{accept:t,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=e,[d,f]=w.useState(!1),h=w.useRef(null),p=w.useRef(0),v=w.useMemo(()=>l1(t),[t]),g=v.join(",")||void 0,y=w.useCallback(T=>{const E=[];return u1(T,v)||E.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&T.size>n&&E.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&T.size<r&&E.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),E},[v,n,r]),x=w.useCallback(T=>{if(i||T.length===0)return;const E=[],R=[];if(!o&&T.length>1||typeof s=="number"&&T.length>s)for(const M of T)R.push({file:M,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const M of T){const A=y(M);A.length?R.push({file:M,errors:A}):E.push(M)}a==null||a(E,R),E.length&&(c==null||c(E)),R.length&&(u==null||u(R))},[i,o,s,y,a,c,u]),b=w.useCallback(()=>{var T;i||(T=h.current)==null||T.click()},[i]),C=w.useCallback((T={})=>{const{onClick:E,onKeyDown:R,onDragOver:P,onDragEnter:M,onDragLeave:A,onDrop:j,...F}=T;return{...F,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:W=>{E==null||E(W),i||b()},onKeyDown:W=>{R==null||R(W),(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),b())},onDragOver:W=>{P==null||P(W),W.preventDefault(),i||f(!0)},onDragEnter:W=>{M==null||M(W),W.preventDefault(),!i&&(p.current+=1,f(!0))},onDragLeave:W=>{A==null||A(W),p.current=Math.max(0,p.current-1),p.current===0&&f(!1)},onDrop:W=>{var K;j==null||j(W),W.preventDefault(),p.current=0,f(!1),!i&&x(Array.from(((K=W.dataTransfer)==null?void 0:K.files)??[]))}}},[i,b,x]),S=w.useCallback((T={})=>{const{onChange:E,...R}=T;return{...R,ref:h,type:"file",accept:g,multiple:o,style:{display:"none"},onChange:P=>{E==null||E(P),x(Array.from(P.target.files??[])),P.target.value=""}}},[g,o,x]);return{getRootProps:C,getInputProps:S,open:b,isDragActive:d,inputRef:h}}const d1=w.forwardRef(function({onDrop:t,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:p,className:v,style:g,sx:y},x){const{getRootProps:b,getInputProps:C,isDragActive:S,open:T}=Cg({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:p,onDrop:t}),{className:E,style:R,styleTag:P}=re(y,g,"cny-uploader",`cny-uploader-${a}`,S&&"is-dragging",p&&"is-disabled",v);return l.jsxs("div",{...b(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:E,style:R,children:[P,l.jsx("input",{...C()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(rS,{})}),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:p,tabIndex:-1,onClick:M=>{M.stopPropagation(),T()},children:i})]})]})}),f1=5;function Ou(e){if(e.length===0)return[];const n=e.reduce((a,c)=>a+(c.def??0),0),r=e.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=e.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 _u(e,t,n,r){if(t<0||t+1>=e.length)return e;const o=e[t]+e[t+1];let s=Math.max(r[t].min,Math.min(r[t].max,e[t]+n));const i=Math.max(r[t+1].min,Math.min(r[t+1].max,o-s));s=Math.max(r[t].min,Math.min(r[t].max,o-i));const a=[...e];return a[t]=s,a[t+1]=i,a}const Ui=w.forwardRef(function({defaultSize:t,minSize:n,maxSize:r,className:o,style:s,...i},a){return l.jsx("div",{ref:a,className:Y("cny-panel",o),style:s,...i})}),Sg=w.forwardRef(function({disabled:t,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||t)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:t?-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":t||void 0,className:Y("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{t||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),h1=w.forwardRef(function({direction:t="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=w.useRef(null),u=w.Children.toArray(s).filter(w.isValidElement),d=u.filter(P=>P.type===Ui).map(P=>{const M=P.props;return{min:M.minSize??10,max:M.maxSize??90,def:M.defaultSize??null}}),[f,h]=w.useState(()=>Ou(d)),p=f.length===d.length?f:Ou(d),v=w.useRef(null),g=(P,M)=>{const A=t==="horizontal"?M.clientX:M.clientY;v.current={g:P,start:A,startSizes:p};const j=W=>{var I;const K=v.current,ee=(I=c.current)==null?void 0:I.getBoundingClientRect();if(!K||!ee)return;const O=t==="horizontal"?ee.width:ee.height;if(!O)return;const N=((t==="horizontal"?W.clientX:W.clientY)-K.start)/O*100;h(_u(K.startSizes,K.g,N,d))},F=()=>{v.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",F)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",F)},y=(P,M)=>{h(_u(p,P,M*f1,d))},x=P=>{c.current=P,typeof a=="function"?a(P):a&&(a.current=P)};let b=-1,C=-1;const S=u.map(P=>{var M,A;if(P.type===Ui){b+=1;const j=b,F={...P.props.style,flexBasis:`${p[j]??0}%`,flexGrow:0,flexShrink:0};return w.cloneElement(P,{key:P.key??`panel-${j}`,style:F})}if(P.type===Sg){C+=1;const j=C,F={direction:t,valueNow:Math.round(p[j]??0),valueMin:((M=d[j])==null?void 0:M.min)??0,valueMax:((A=d[j])==null?void 0:A.max)??100,onResizeStart:W=>g(j,W),onKeyResize:W=>y(j,W)};return w.cloneElement(P,{key:P.key??`handle-${j}`,__internal:F})}return P}),{className:T,style:E,styleTag:R}=re(o,r,"cny-panel-group",t==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:T,style:E,...i,children:[R,S]})});function p1(){}function m1(e,t,n,r){if(t<=1)return[{type:"page",page:1}];const o=t,s=Math.max(1,e-n),i=Math.min(o,e+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,p,v)=>h.type!=="page"?!0:v.findIndex(g=>g.type==="page"&&g.page===h.page)===p)}const Tg=w.forwardRef(function({page:t,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 p=w.useMemo(()=>m1(t,n,o,s),[t,n,o,s]),v=b=>{b<1||b>n||b===t||r(b)},{className:g,style:y,styleTag:x}=re(d,u,"cny-pagination",`cny-pagination-${a}`,c);return l.jsxs("nav",{ref:h,role:"navigation","aria-label":f,className:g,style:y,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>v(t-1),disabled:t<=1,"aria-label":"Previous page",children:l.jsx(no,{size:14,"aria-hidden":"true"})}),p.map(b=>b.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(sS,{size:14})},`e-${b.key}`):l.jsx("button",{type:"button",className:Y("cny-pagination-btn",b.page===t&&"is-active"),"aria-current":b.page===t?"page":void 0,onClick:()=>v(b.page),children:b.page},b.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>v(t+1),disabled:t>=n,"aria-label":"Next page",children:l.jsx(Qt,{size:14,"aria-hidden":"true"})})]})}),Js={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function g1(e){return e.id}function y1(e,t){return!e||e.field!==t?{field:t,sort:"asc"}:e.sort==="asc"?{field:t,sort:"desc"}:null}const v1=w.forwardRef(function({columns:t,rows:n,getRowId:r=g1,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:p,noRowsLabel:v="No rows",disableColumnResize:g=!1,className:y,style:x,sx:b},C){const S=t.length+(c?1:0),T=w.useRef(null),[E,R]=w.useState(null),P=(_,G)=>{var ce;G.preventDefault(),G.stopPropagation();const B={};(ce=T.current)==null||ce.querySelectorAll("thead th[data-field]").forEach(ae=>{const Ce=ae.dataset.field;Ce&&(B[Ce]=ae.getBoundingClientRect().width)});const L=G.clientX,J=B[_]??0;R(B);const U=ae=>{R({...B,[_]:Math.max(60,J+(ae.clientX-L))})},H=()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",H)};window.addEventListener("pointermove",U),window.addEventListener("pointerup",H)},M=_=>!g&&_.resizable!==!1,A=u??[],j=new Set(A),F=n.map(_=>r(_)),W=F.length>0&&F.every(_=>j.has(_)),K=F.some(_=>j.has(_)),ee=W?!0:K?"indeterminate":!1,O=()=>{if(d)if(W)d(A.filter(_=>!F.includes(_)));else{const _=new Set(A);F.forEach(G=>_.add(G)),d([..._])}},V=_=>{d&&(j.has(_)?d(A.filter(G=>G!==_)):d([...A,_]))},N=_=>{!_.sortable||!h||h(y1(f,_.field))},I=_=>_.width!=null?{width:_.width,minWidth:_.width}:{flex:_.flex??1},$=()=>{if(!i||s==null)return null;const{page:_,pageSize:G}=i,B=Math.max(1,Math.ceil(s/G)),L=s===0?0:_*G+1,J=Math.min(s,(_+1)*G);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[L,"–",J," of ",s]}),l.jsx(Tg,{page:_+1,pageCount:B,size:"sm",onPageChange:U=>a==null?void 0:a({page:U-1,pageSize:G})})]})},{className:X,style:k,styleTag:Z}=re(b,x,"cny-dt",y);return l.jsxs("div",{ref:C,className:X,style:k,children:[Z,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:T,className:"cny-dt-table",style:E?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:void 0,children:[E&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:44}}),t.map(_=>l.jsx("col",{style:{width:E[_.field]}},_.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(Vi,{checked:ee,onCheckedChange:O,"aria-label":"Select all rows"})}),t.map(_=>{const G=(f==null?void 0:f.field)===_.field,B=_.headerAlign??_.align;return l.jsxs("th",{scope:"col","data-field":_.field,style:E?void 0:I(_),"aria-sort":G?f.sort==="asc"?"ascending":"descending":void 0,className:Y(B&&Js[B],_.sortable&&"cny-dt-sortable",G&&"is-sorted"),onClick:()=>N(_),children:[l.jsxs("span",{className:"cny-dt-th-inner",children:[_.headerName??_.field,_.sortable&&l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:G?f.sort==="desc"?l.jsx(dr,{size:14}):l.jsx(Kf,{size:14}):l.jsx(Yf,{size:14})})]}),M(_)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:L=>L.stopPropagation(),onPointerDown:L=>P(_.field,L)})]},_.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((_,G)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(Pi,{shape:"avatar",width:16,height:16})}),t.map(B=>l.jsx("td",{className:B.align&&Js[B.align],children:l.jsx(Pi,{width:"70%"})},B.field))]},`sk-${G}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:S,children:v})}):n.map(_=>{const G=r(_),B=j.has(G);return l.jsxs("tr",{className:Y("cny-dt-row",B&&"is-selected",p&&"is-clickable"),onClick:()=>p==null?void 0:p(_),children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:L=>L.stopPropagation(),children:l.jsx(Vi,{checked:B,onCheckedChange:()=>V(G),"aria-label":`Select row ${String(G)}`})}),t.map(L=>{const J=L.valueGetter?L.valueGetter({row:_,field:L.field}):_[L.field];return l.jsx("td",{className:L.align&&Js[L.align],children:L.renderCell?L.renderCell({row:_,value:J,field:L.field}):J},L.field)})]},String(G))})})]})}),$()]})}),zi=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Jt(e,t){return t??zi[e%zi.length]}function dc(e=600){const t=w.useRef(null),[n,r]=w.useState(e);return w.useLayoutEffect(()=>{const o=t.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()},[]),[t,n]}function Rg(e,t=4){if(e<=0)return{max:1,ticks:[0,1]};const n=e/t,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(e/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 x1(e,t,n,r,o,s){const i=(y,x)=>[e+y*Math.sin(x),t-y*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 ${e} ${t} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,p]=i(r,s),[v,g]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${p}`,`A ${r} ${r} 0 ${a} 0 ${v} ${g}`,"Z"].join(" ")}const Ie={top:12,right:14,bottom:28,left:40};function b1({data:e,xKey:t,series:n,height:r=260,stacked:o=!1,grid:s=!0,legend:i=!0,yTickFormatter:a=p=>String(p),xTickFormatter:c=p=>p,renderTooltip:u,className:d,style:f,sx:h}){const[p,v]=dc(),[g,y]=w.useState(null),x=Math.max(0,v-Ie.left-Ie.right),b=Math.max(0,r-Ie.top-Ie.bottom),C=(O,V)=>Number(O[V]??0),S=e.length?Math.max(0,...e.map(O=>o?n.reduce((V,N)=>V+C(O,N.key),0):Math.max(...n.map(V=>C(O,V.key))))):0,{max:T,ticks:E}=Rg(S),R=O=>Ie.top+b*(1-O/T),P=e.length,M=P?x/P:0,A=M*.68,j=O=>Ie.left+O*M+(M-A)/2,F=o?A:A/Math.max(1,n.length),{className:W,style:K,styleTag:ee}=re(h,{position:"relative",...f},"cny-chart",d);return l.jsxs("div",{ref:p,className:W,style:K,children:[ee,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${v} ${r}`,role:"img",children:[s&&E.map(O=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:Ie.left,x2:v-Ie.right,y1:R(O),y2:R(O)}),l.jsx("text",{className:"cny-chart-axis",x:Ie.left-6,y:R(O),dy:"0.32em",textAnchor:"end",children:a(O)})]},O)),e.map((O,V)=>{let N=0;return l.jsx("g",{children:n.map((I,$)=>{const X=C(O,I.key),k=X/T*b;let Z,_;return o?(Z=j(V),_=R(N+X),N+=X):(Z=j(V)+$*F,_=R(X)),l.jsx("rect",{className:"cny-chart-bar",x:Z,y:_,width:Math.max(0,F-(o?0:2)),height:Math.max(0,k),rx:2,fill:Jt($,I.color)},I.key)})},V)}),e.map((O,V)=>l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:Ie.left+V*M+M/2,y:r-Ie.bottom+16,textAnchor:"middle",children:c(String(O[t]??""))}),l.jsx("rect",{x:Ie.left+V*M,y:Ie.top,width:M,height:b,fill:"transparent",onMouseEnter:()=>y({index:V,x:Ie.left+V*M+M/2,y:Ie.top}),onMouseLeave:()=>y(null)})]},`x-${V}`))]}),g&&e[g.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${g.x/v*100}%`,top:g.y},children:u?u({label:String(e[g.index][t]),datum:e[g.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(e[g.index][t])}),n.map((O,V)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt(V,O.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:O.label??O.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(e[g.index],O.key)})]},O.key))]})}),i&&l.jsx("div",{className:"cny-chart-legend",children:n.map((O,V)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt(V,O.color)}}),O.label??O.key]},O.key))})]})}const We={top:12,right:14,bottom:28,left:40};function Pg({data:e,xKey:t,series:n,height:r=260,area:o=!1,stacked:s=!1,dots:i=!0,grid:a=!0,legend:c=!0,yTickFormatter:u=g=>String(g),xTickFormatter:d=g=>g,renderTooltip:f,className:h,style:p,sx:v}){const[g,y]=dc(),[x,b]=w.useState(null),C=Math.max(0,y-We.left-We.right),S=Math.max(0,r-We.top-We.bottom),T=(N,I)=>Number(N[I]??0),E=e.length?Math.max(0,...e.map(N=>s?n.reduce((I,$)=>I+T(N,$.key),0):Math.max(...n.map(I=>T(N,I.key))))):0,{max:R,ticks:P}=Rg(E),M=N=>We.top+S*(1-N/R),A=e.length,j=A?C/A:0,F=N=>We.left+N*j+j/2,W=M(0),K=e.map(()=>0),{className:ee,style:O,styleTag:V}=re(v,{position:"relative",...p},"cny-chart",h);return l.jsxs("div",{ref:g,className:ee,style:O,children:[V,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${y} ${r}`,role:"img",children:[a&&P.map(N=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:We.left,x2:y-We.right,y1:M(N),y2:M(N)}),l.jsx("text",{className:"cny-chart-axis",x:We.left-6,y:M(N),dy:"0.32em",textAnchor:"end",children:u(N)})]},N)),n.map((N,I)=>{const $=Jt(I,N.color),X=e.map((_,G)=>{const B=T(_,N.key),L=s?K[G]:0,J=L+B;return s&&(K[G]=J),{x:F(G),y:M(J),yBase:M(L)}});if(X.length===0)return null;const k=X.map(_=>`${_.x},${_.y}`).join(" "),Z=`M ${X[0].x} ${s?X[0].yBase:W} `+X.map(_=>`L ${_.x} ${_.y}`).join(" ")+` L ${X[X.length-1].x} ${s?X[X.length-1].yBase:W} Z`;return l.jsxs("g",{children:[o&&l.jsx("path",{className:"cny-chart-area",d:Z,fill:$}),l.jsx("polyline",{className:"cny-chart-line",points:k,fill:"none",stroke:$}),i&&X.map((_,G)=>l.jsx("circle",{className:"cny-chart-dot",cx:_.x,cy:_.y,r:3,fill:$},G))]},N.key)}),e.map((N,I)=>l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:F(I),y:r-We.bottom+16,textAnchor:"middle",children:d(String(N[t]??""))}),l.jsx("rect",{x:We.left+I*j,y:We.top,width:j,height:S,fill:"transparent",onMouseEnter:()=>b({index:I,x:F(I)}),onMouseLeave:()=>b(null)})]},`x-${I}`))]}),x&&e[x.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${x.x/y*100}%`,top:We.top},children:f?f({label:String(e[x.index][t]),datum:e[x.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(e[x.index][t])}),n.map((N,I)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt(I,N.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:N.label??N.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:T(e[x.index],N.key)})]},N.key))]})}),c&&l.jsx("div",{className:"cny-chart-legend",children:n.map((N,I)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Jt(I,N.color)}}),N.label??N.key]},N.key))})]})}function w1(e){return l.jsx(Pg,{...e,area:!1})}function C1(e){return l.jsx(Pg,{...e,area:!0})}function S1({data:e,height:t=260,innerRadius:n=0,legend:r=!0,renderTooltip:o,centerLabel:s,className:i,style:a,sx:c}){const[u,d]=dc(360),[f,h]=w.useState(null),p=e.reduce((P,M)=>P+Math.max(0,M.value),0),v=Math.min(d,t),g=d/2,y=t/2,x=v/2*.86,b=n>0?x*n:0;let C=0;const S=e.map((P,M)=>{const A=p>0?Math.max(0,P.value)/p:0,j=C,F=C+A*Math.PI*2;return C=F,{d:P,i:M,start:j,end:F,frac:A,color:Jt(M,P.color)}}),{className:T,style:E,styleTag:R}=re(c,{position:"relative",...a},"cny-chart",i);return l.jsxs("div",{ref:u,className:T,style:E,children:[R,l.jsxs("svg",{width:"100%",height:t,viewBox:`0 0 ${d} ${t}`,role:"img",children:[S.map(P=>P.frac>=.9999?l.jsx("circle",{className:Y("cny-chart-slice",f===P.i&&"is-active"),cx:g,cy:y,r:b>0?(x+b)/2:x,fill:b>0?"none":P.color,stroke:b>0?P.color:void 0,strokeWidth:b>0?x-b:void 0,onMouseEnter:()=>h(P.i),onMouseLeave:()=>h(null)},P.i):l.jsx("path",{className:Y("cny-chart-slice",f===P.i&&"is-active"),d:x1(g,y,x,b,P.start,P.end),fill:P.color,onMouseEnter:()=>h(P.i),onMouseLeave:()=>h(null)},P.i)),s!=null&&b>0&&l.jsx("foreignObject",{x:g-b,y:y-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:s})})]}),f!=null&&S[f]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:o?o({datum:S[f].d,percent:S[f].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:S[f].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:S[f].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[S[f].d.value," (",Math.round(S[f].frac*100),"%)"]})]})}),r&&l.jsx("div",{className:"cny-chart-legend",children:S.map(P=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P.color}}),P.d.label]},P.i))})]})}function T1({height:e=300,children:t,className:n,style:r,sx:o}){const s=w.Children.only(t),{className:i,style:a,styleTag:c}=re(o,{width:"100%",height:e,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,w.isValidElement(s)?w.cloneElement(s,{height:e}):s]})}const R1=w.forwardRef(function({variant:t="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=re(i,s,"cny-list",t,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),P1=w.forwardRef(function({leading:t,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},p){const v=u??(i?"a":s?"button":"li"),g=!a&&(i!=null||s!=null),y=d??l.jsxs(l.Fragment,{children:[t&&l.jsx("span",{className:"cny-list-item-leading",children:t}),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(v,{ref:p,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:g&&v==="div"?0:void 0,className:Y("cny-list-item",c&&"is-active",a&&"is-disabled",g&&"is-interactive",f),...h,children:y});return v==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),E1=w.forwardRef(function({className:t,...n},r){return l.jsx("li",{ref:r,role:"separator",className:Y("cny-list-separator",t),...n})}),M1=w.forwardRef(function({className:t,children:n,...r},o){return l.jsx("li",{ref:o,className:Y("cny-list-subheader",t),...r,children:n})});var as="Tabs",[A1]=Te(as,[kt]),Eg=kt(),[N1,fc]=A1(as),Mg=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=Dt(a),[f,h]=we({prop:r,onChange:o,defaultProp:s??"",caller:as});return l.jsx(N1,{scope:n,baseId:ge(),value:f,onValueChange:h,orientation:i,dir:d,activationMode:c,children:l.jsx(Q.div,{dir:d,"data-orientation":i,...u,ref:t})})});Mg.displayName=as;var Ag="TabsList",Ng=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=fc(Ag,n),i=Eg(n);return l.jsx(_o,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Q.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Ng.displayName=Ag;var jg="TabsTrigger",Dg=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=fc(jg,n),a=Eg(n),c=Og(i.baseId,r),u=_g(i.baseId,r),d=r===i.value;return l.jsx(Lo,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(Q.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:z(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:z(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:z(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});Dg.displayName=jg;var kg="TabsContent",Ig=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=fc(kg,n),c=Og(a.baseId,r),u=_g(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(Ne,{present:o||d,children:({present:h})=>l.jsx(Q.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});Ig.displayName=kg;function Og(e,t){return`${e}-trigger-${t}`}function _g(e,t){return`${e}-content-${t}`}var j1=Mg,D1=Ng,k1=Dg,I1=Ig;const O1=w.forwardRef(function({variant:t="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(s,o,"cny-tabs",`variant-${t}`,`size-${n}`,r);return l.jsxs(j1,{ref:c,className:u,style:d,...a,children:[f,i]})}),_1=w.forwardRef(function({className:t,...n},r){return l.jsx(D1,{ref:r,className:Y("cny-tabs-list",t),...n})}),L1=w.forwardRef(function({icon:t,badge:n,className:r,children:o,...s},i){return l.jsxs(k1,{ref:i,className:Y("cny-tabs-trigger",r),...s,children:[t&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:t}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),F1=w.forwardRef(function({className:t,...n},r){return l.jsx(I1,{ref:r,className:Y("cny-tabs-content",t),...n})});function $1(e){return e.multiple===!0}const V1=w.forwardRef(function(t,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:p,"aria-invalid":v,"aria-describedby":g,"aria-label":y,className:x,style:b,sx:C}=t,S=w.useId(),T=p??`cny-ac-${S}`,[E,R]=w.useState(!1),[P,M]=w.useState(""),A=w.useRef(null),j=$1(t),[F,W]=w.useState(!j&&t.defaultValue!==void 0?t.defaultValue??null:null),[K,ee]=w.useState(j&&t.defaultValue!==void 0?t.defaultValue??[]:[]),O=j?t.value!==void 0?t.value:K:(()=>{const B=t.value!==void 0?t.value:F;return B==null?[]:[B]})(),V=w.useCallback(B=>{var L,J;if(j)t.value===void 0&&ee(B),(L=t.onValueChange)==null||L.call(t,B);else{const U=B[0]??null;t.value===void 0&&W(U),(J=t.onValueChange)==null||J.call(t,U)}},[j,t]),N=w.useCallback(B=>{if(!B.disabled)if(j){const L=t.maxItems,J=O.includes(B.value);let U;if(J)U=O.filter(H=>H!==B.value);else{if(L!=null&&O.length>=L)return;U=[...O,B.value]}V(U)}else V([B.value]),R(!1)},[V,j,O,t]),I=w.useCallback(B=>{var L;B.stopPropagation(),V([]),(L=A.current)==null||L.focus()},[V]),$=w.useMemo(()=>{const B=new Map;for(const L of r){const J=L.group??"";B.has(J)||B.set(J,[]),B.get(J).push(L)}return Array.from(B.entries())},[r]),X=B=>{var L;return((L=r.find(J=>J.value===B))==null?void 0:L.label)??B},k=O.length===0?o:j?O.length===1?X(O[0]):`${X(O[0])} +${O.length-1}`:X(O[0]),{className:Z,style:_,styleTag:G}=re(C,b,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,O.length>0&&"has-value",E&&"is-open",x);return l.jsxs($a,{open:E,onOpenChange:R,children:[l.jsx(Va,{asChild:!0,children:l.jsxs("button",{ref:B=>{A.current=B,typeof n=="function"?n(B):n&&(n.current=B)},type:"button",id:T,className:Z,style:_,disabled:f,"aria-label":y,"aria-invalid":v,"aria-describedby":g,"aria-haspopup":"listbox","aria-expanded":E,children:[G,l.jsx("span",{className:Y("cny-ac-value",O.length===0&&"is-placeholder"),children:k}),h&&O.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-ac-clear","aria-label":"Clear",onClick:I,onPointerDown:B=>B.stopPropagation(),children:l.jsx(Ot,{size:13,"aria-hidden":"true"})}),l.jsx(Yf,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(Ba,{children:l.jsx(Wa,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(be,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(be.Input,{value:P,onValueChange:M,placeholder:s})}),l.jsx(be.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Xf,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(be.Empty,{className:"cny-ac-empty",children:i},"empty"),$.map(([B,L],J)=>{const U=L.map((H,ce)=>{const ae=O.includes(H.value);return l.jsxs(be.Item,{value:`${B} ${H.label} ${H.value}`,disabled:H.disabled,onSelect:()=>N(H),className:Y("cny-ac-item",ae&&"is-checked"),children:[j?l.jsx("span",{className:Y("cny-ac-checkbox",ae&&"is-checked"),children:ae&&l.jsx(tn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[H.icon??null,!H.icon&&ae&&l.jsx(tn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:H.label}),H.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:H.hint})]},H.value||`opt-${J}-${ce}`)});return B===""?l.jsx(be.Group,{children:U},`__ungrouped_${J}`):l.jsx(be.Group,{heading:B,children:U},B||`group_${J}`)})]})})]})})})]})}),B1=w.forwardRef(function({items:t,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Qt,{size:12,"aria-hidden":"true"}),{className:d,style:f,styleTag:h}=re(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:t.map((p,v)=>{const g=v===t.length-1,y=l.jsx("span",{className:Y("cny-breadcrumb-label",g&&"is-current"),children:p.label}),x=p.render?p.render(y):p.href&&!g?l.jsx("a",{href:p.href,className:"cny-breadcrumb-link",children:y}):y;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[g?l.jsx("span",{"aria-current":"page",children:y}):x,!g&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},v)})})]})});var cs="Collapsible",[W1,Lg]=Te(cs),[G1,hc]=W1(cs),Fg=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[c,u]=we({prop:r,defaultProp:o??!1,onChange:i,caller:cs});return l.jsx(G1,{scope:n,disabled:s,contentId:ge(),open:c,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Q.div,{"data-state":mc(c),"data-disabled":s?"":void 0,...a,ref:t})})});Fg.displayName=cs;var $g="CollapsibleTrigger",Vg=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=hc($g,n);return l.jsx(Q.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":mc(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:z(e.onClick,o.onOpenToggle)})});Vg.displayName=$g;var pc="CollapsibleContent",Bg=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=hc(pc,e.__scopeCollapsible);return l.jsx(Ne,{present:n||o.open,children:({present:s})=>l.jsx(U1,{...r,ref:t,present:s})})});Bg.displayName=pc;var U1=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=hc(pc,n),[a,c]=m.useState(r),u=m.useRef(null),d=se(t,u),f=m.useRef(0),h=f.current,p=m.useRef(0),v=p.current,g=i.open||a,y=m.useRef(g),x=m.useRef(void 0);return m.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),Me(()=>{const b=u.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();f.current=C.height,p.current=C.width,y.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),c(r)}},[i.open,r]),l.jsx(Q.div,{"data-state":mc(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&o})});function mc(e){return e?"open":"closed"}var z1=Fg,H1=Vg,K1=Bg,nt="Accordion",Y1=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[gc,X1,q1]=lr(nt),[ls]=Te(nt,[q1,Lg]),yc=Lg(),Wg=w.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,s=r;return l.jsx(gc.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(ej,{...s,ref:t}):l.jsx(J1,{...o,ref:t})})});Wg.displayName=nt;var[Gg,Z1]=ls(nt),[Ug,Q1]=ls(nt,{collapsible:!1}),J1=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:s=!1,...i}=e,[a,c]=we({prop:n,defaultProp:r??"",onChange:o,caller:nt});return l.jsx(Gg,{scope:e.__scopeAccordion,value:w.useMemo(()=>a?[a]:[],[a]),onItemOpen:c,onItemClose:w.useCallback(()=>s&&c(""),[s,c]),children:l.jsx(Ug,{scope:e.__scopeAccordion,collapsible:s,children:l.jsx(zg,{...i,ref:t})})})}),ej=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=we({prop:n,defaultProp:r??[],onChange:o,caller:nt}),c=w.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=w.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(Gg,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:l.jsx(Ug,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(zg,{...s,ref:t})})})}),[tj,us]=ls(nt),zg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:s="vertical",...i}=e,a=w.useRef(null),c=se(a,t),u=X1(n),f=Dt(o)==="ltr",h=z(e.onKeyDown,p=>{var P;if(!Y1.includes(p.key))return;const v=p.target,g=u().filter(M=>{var A;return!((A=M.ref.current)!=null&&A.disabled)}),y=g.findIndex(M=>M.ref.current===v),x=g.length;if(y===-1)return;p.preventDefault();let b=y;const C=0,S=x-1,T=()=>{b=y+1,b>S&&(b=C)},E=()=>{b=y-1,b<C&&(b=S)};switch(p.key){case"Home":b=C;break;case"End":b=S;break;case"ArrowRight":s==="horizontal"&&(f?T():E());break;case"ArrowDown":s==="vertical"&&T();break;case"ArrowLeft":s==="horizontal"&&(f?E():T());break;case"ArrowUp":s==="vertical"&&E();break}const R=b%x;(P=g[R].ref.current)==null||P.focus()});return l.jsx(tj,{scope:n,disabled:r,direction:o,orientation:s,children:l.jsx(gc.Slot,{scope:n,children:l.jsx(Q.div,{...i,"data-orientation":s,ref:c,onKeyDown:r?void 0:h})})})}),Mo="AccordionItem",[nj,vc]=ls(Mo),Hg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,s=us(Mo,n),i=Z1(Mo,n),a=yc(n),c=ge(),u=r&&i.value.includes(r)||!1,d=s.disabled||e.disabled;return l.jsx(nj,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(z1,{"data-orientation":s.orientation,"data-state":Qg(u),...a,...o,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(r):i.onItemClose(r)}})})});Hg.displayName=Mo;var Kg="AccordionHeader",Yg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=us(nt,n),s=vc(Kg,n);return l.jsx(Q.h3,{"data-orientation":o.orientation,"data-state":Qg(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Yg.displayName=Kg;var Hi="AccordionTrigger",Xg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=us(nt,n),s=vc(Hi,n),i=Q1(Hi,n),a=yc(n);return l.jsx(gc.ItemSlot,{scope:n,children:l.jsx(H1,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...a,...r,ref:t})})});Xg.displayName=Hi;var qg="AccordionContent",Zg=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=us(nt,n),s=vc(qg,n),i=yc(n);return l.jsx(K1,{role:"region","aria-labelledby":s.triggerId,"data-orientation":o.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Zg.displayName=qg;function Qg(e){return e?"open":"closed"}var rj=Wg,oj=Hg,sj=Yg,ij=Xg,aj=Zg;const cj=w.forwardRef(function({variant:t="plain",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"cny-accordion",`cny-accordion-${t}`,n);return l.jsxs(rj,{ref:a,className:c,style:u,...i,children:[d,s]})}),lj=w.forwardRef(function({className:t,...n},r){return l.jsx(oj,{ref:r,className:Y("cny-accordion-item",t),...n})}),uj=w.forwardRef(function({children:t,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(sj,{className:"cny-accordion-header",children:l.jsxs(ij,{ref:i,className:Y("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:t}),!o&&l.jsx(dr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),dj=w.forwardRef(function({children:t,className:n,...r},o){return l.jsx(aj,{ref:o,className:Y("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:t})})});var Jg=["PageUp","PageDown"],ey=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ty={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},$n="Slider",[Ki,fj,hj]=lr($n),[ny]=Te($n,[hj]),[pj,ds]=ny($n),ry=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:s=1,orientation:i="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:v,...g}=e,y=m.useRef(new Set),x=m.useRef(0),C=i==="horizontal"?mj:gj,[S=[],T]=we({prop:d,defaultProp:u,onChange:j=>{var W;(W=[...y.current][x.current])==null||W.focus(),f(j)}}),E=m.useRef(S);function R(j){const F=wj(S,j);A(j,F)}function P(j){A(j,x.current)}function M(){const j=E.current[x.current];S[x.current]!==j&&h(S)}function A(j,F,{commit:W}={commit:!1}){const K=Rj(s),ee=Pj(Math.round((j-r)/s)*s+r,K),O=vo(ee,[r,o]);T((V=[])=>{const N=xj(V,O,F);if(Tj(N,c*s)){x.current=N.indexOf(O);const I=String(N)!==String(V);return I&&W&&h(N),I?N:V}else return V})}return l.jsx(pj,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:o,valueIndexToChangeRef:x,thumbs:y.current,values:S,orientation:i,form:v,children:l.jsx(Ki.Provider,{scope:e.__scopeSlider,children:l.jsx(Ki.Slot,{scope:e.__scopeSlider,children:l.jsx(C,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:z(g.onPointerDown,()=>{a||(E.current=S)}),min:r,max:o,inverted:p,onSlideStart:a?void 0:R,onSlideMove:a?void 0:P,onSlideEnd:a?void 0:M,onHomeKeyDown:()=>!a&&A(r,0,{commit:!0}),onEndKeyDown:()=>!a&&A(o,S.length-1,{commit:!0}),onStepKeyDown:({event:j,direction:F})=>{if(!a){const ee=Jg.includes(j.key)||j.shiftKey&&ey.includes(j.key)?10:1,O=x.current,V=S[O],N=s*ee*F;A(V+N,O,{commit:!0})}}})})})})});ry.displayName=$n;var[oy,sy]=ny($n,{startEdge:"left",endEdge:"right",size:"width",direction:1}),mj=m.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=m.useState(null),p=se(t,C=>h(C)),v=m.useRef(void 0),g=Dt(o),y=g==="ltr",x=y&&!s||!y&&s;function b(C){const S=v.current||f.getBoundingClientRect(),T=[0,S.width],R=xc(T,x?[n,r]:[r,n]);return v.current=S,R(C-S.left)}return l.jsx(oy,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:l.jsx(iy,{dir:g,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const S=b(C.clientX);i==null||i(S)},onSlideMove:C=>{const S=b(C.clientX);a==null||a(S)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:C=>{const T=ty[x?"from-left":"from-right"].includes(C.key);u==null||u({event:C,direction:T?-1:1})}})})}),gj=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onStepKeyDown:c,...u}=e,d=m.useRef(null),f=se(t,d),h=m.useRef(void 0),p=!o;function v(g){const y=h.current||d.current.getBoundingClientRect(),x=[0,y.height],C=xc(x,p?[r,n]:[n,r]);return h.current=y,C(g-y.top)}return l.jsx(oy,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:l.jsx(iy,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const y=v(g.clientY);s==null||s(y)},onSlideMove:g=>{const y=v(g.clientY);i==null||i(y)},onSlideEnd:()=>{h.current=void 0,a==null||a()},onStepKeyDown:g=>{const x=ty[p?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:x?-1:1})}})})}),iy=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:a,onStepKeyDown:c,...u}=e,d=ds($n,n);return l.jsx(Q.span,{...u,ref:t,onKeyDown:z(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(a(f),f.preventDefault()):Jg.concat(ey).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:z(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:z(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&o(f)}),onPointerUp:z(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),ay="SliderTrack",cy=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ds(ay,n);return l.jsx(Q.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});cy.displayName=ay;var Yi="SliderRange",ly=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ds(Yi,n),s=sy(Yi,n),i=m.useRef(null),a=se(t,i),c=o.values.length,u=o.values.map(h=>fy(h,o.min,o.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return l.jsx(Q.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:f+"%"}})});ly.displayName=Yi;var Xi="SliderThumb",uy=m.forwardRef((e,t)=>{const n=fj(e.__scopeSlider),[r,o]=m.useState(null),s=se(t,a=>o(a)),i=m.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return l.jsx(yj,{...e,ref:s,index:i})}),yj=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...s}=e,i=ds(Xi,n),a=sy(Xi,n),[c,u]=m.useState(null),d=se(t,b=>u(b)),f=c?i.form||!!c.closest("form"):!0,h=pr(c),p=i.values[r],v=p===void 0?0:fy(p,i.min,i.max),g=bj(r,i.values.length),y=h==null?void 0:h[a.size],x=y?Cj(y,v,a.direction):0;return m.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${v}% + ${x}px)`},children:[l.jsx(Ki.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(Q.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":i.min,"aria-valuenow":p,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:z(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),f&&l.jsx(dy,{name:o??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:p},r)]})});uy.displayName=Xi;var vj="RadioBubbleInput",dy=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=m.useRef(null),s=se(o,r),i=yr(t);return m.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const f=new Event("input",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),l.jsx(Q.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});dy.displayName=vj;function xj(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,s)=>o-s)}function fy(e,t,n){const s=100/(n-t)*(e-t);return vo(s,[0,100])}function bj(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function wj(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function Cj(e,t,n){const r=e/2,s=xc([0,50],[0,r]);return(r-s(t)*n)*n}function Sj(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Tj(e,t){if(t>0){const n=Sj(e);return Math.min(...n)>=t}return!0}function xc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rj(e){return(String(e).split(".")[1]||"").length}function Pj(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Ej=ry,Mj=cy,Aj=ly,Nj=uy;const jj=w.forwardRef(function({className:t,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],p=a??(x=>x),{className:v,style:g,styleTag:y}=re(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,t);return l.jsxs(Ej,{ref:f,className:v,style:g,value:c,defaultValue:u,...d,children:[y,l.jsx(Mj,{className:"cny-slider-track",children:l.jsx(Aj,{className:"cny-slider-range"})}),h.map((x,b)=>l.jsx(Nj,{className:"cny-slider-thumb","aria-label":`Value ${b+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:p(x)})},b))]})}),Dj=w.forwardRef(function({steps:t,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:p}=re(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:[p,t.map((v,g)=>{const y=g<n?"complete":g===n?"active":"upcoming",x=y==="complete"&&!!s;return l.jsxs("li",{className:Y("cny-stepper-step",`is-${y}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:x?()=>s==null?void 0:s(g):void 0,disabled:!x,"aria-current":y==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:y==="complete"?l.jsx(tn,{size:14}):v.icon??g+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:v.label}),v.description&&l.jsx("span",{className:"cny-stepper-desc",children:v.description})]})]}),g<t.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},g)})]})});exports.Accordion=cj;exports.AccordionContent=dj;exports.AccordionItem=lj;exports.AccordionTrigger=uj;exports.Alert=AS;exports.AreaChart=C1;exports.AspectRatio=QS;exports.Autocomplete=V1;exports.Avatar=NS;exports.AvatarStack=jS;exports.BREAKPOINTS=$u;exports.Badge=QN;exports.BarChart=b1;exports.Box=cn;exports.Breadcrumb=B1;exports.Button=er;exports.ButtonGroup=Z0;exports.CHART_COLORS=zi;exports.Card=PS;exports.Center=JS;exports.Checkbox=Vi;exports.Chip=ZN;exports.CommandPalette=IM;exports.CommandPaletteTrigger=OM;exports.ConfirmDialog=gm;exports.Container=XS;exports.DataTable=v1;exports.DatePicker=DM;exports.Dialog=mm;exports.DialogClose=GM;exports.DialogTrigger=WM;exports.Divider=qS;exports.Drawer=zM;exports.DrawerClose=KM;exports.DrawerTrigger=HM;exports.FAB=Q0;exports.Field=rT;exports.FileUploader=d1;exports.Grid=YS;exports.Group=eT;exports.IconButton=J0;exports.Input=RS;exports.LineChart=w1;exports.List=R1;exports.ListItem=P1;exports.ListSeparator=E1;exports.ListSubheader=M1;exports.Menu=fN;exports.MenuCheckboxItem=gN;exports.MenuContent=pN;exports.MenuItem=mN;exports.MenuLabel=xN;exports.MenuRadioGroup=yN;exports.MenuRadioItem=vN;exports.MenuSeparator=bN;exports.MenuSub=wN;exports.MenuSubContent=SN;exports.MenuSubTrigger=CN;exports.MenuTrigger=hN;exports.MultiSelect=QE;exports.Navbar=_S;exports.NavbarActions=VS;exports.NavbarBrand=LS;exports.NavbarItem=$S;exports.NavbarNav=FS;exports.Pagination=Tg;exports.Panel=Ui;exports.PanelGroup=h1;exports.PanelResizeHandle=Sg;exports.PieChart=S1;exports.Popover=HN;exports.PopoverAnchor=YN;exports.PopoverClose=XN;exports.PopoverContent=qN;exports.PopoverTrigger=KN;exports.Progress=DS;exports.ProgressRing=kS;exports.Radio=pM;exports.RadioGroup=hM;exports.ResponsiveContainer=T1;exports.RichTreeView=c1;exports.Row=KS;exports.Scroll=Zf;exports.ScrollRegion=OS;exports.Select=tE;exports.SelectGroup=rE;exports.SelectItem=nE;exports.SelectLabel=oE;exports.SelectSeparator=sE;exports.Sidebar=BS;exports.SidebarItem=GS;exports.SidebarSection=WS;exports.Skeleton=Pi;exports.Slider=jj;exports.Spacer=ZS;exports.Stack=HS;exports.Stepper=Dj;exports.Switch=xM;exports.Tabs=O1;exports.TabsContent=F1;exports.TabsList=_1;exports.TabsTrigger=L1;exports.Text=nT;exports.Textarea=oT;exports.Timeline=JN;exports.TimelineConnector=r1;exports.TimelineContent=o1;exports.TimelineDot=n1;exports.TimelineItem=e1;exports.TimelineOppositeContent=s1;exports.TimelineSeparator=t1;exports.ToastProvider=$M;exports.ToggleButton=uC;exports.ToggleButtonGroup=DC;exports.ToggleButtonGroupItem=kC;exports.Tooltip=WN;exports.TooltipContent=zN;exports.TooltipProvider=BN;exports.TooltipRoot=GN;exports.TooltipTrigger=UN;exports.TreeItem=wg;exports.TreeView=bg;exports.disableGlobalCursorStyles=p1;exports.resolveSx=qi;exports.useCommandPalette=kM;exports.useConfirm=UM;exports.useFileDrop=Cg;exports.useToast=BM;
209
209
  //# sourceMappingURL=index.cjs.map