canny-ui-react 6.2.0 → 6.2.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,180 +1,180 @@
1
- "use client";"use strict";var au=e=>{throw TypeError(e)};var cu=(e,t,n)=>t.has(e)||au("Cannot "+n);var Ve=(e,t,n)=>(cu(e,t,"read from private field"),n?n.call(e):t.get(e)),lu=(e,t,n)=>t.has(e)?au("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),di=(e,t,n,r)=>(cu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),C=require("react"),ys=require("react-dom");function Pf(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 p=Pf(C),or=Pf(ys);function Y(...e){return e.filter(Boolean).join(" ")}const Tf={sm:640,md:768,lg:1024,xl:1280},fi=["base","sm","md","lg","xl"],sw=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),iw=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),aw=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^ms-/,"-ms-"),cw=e=>e.replace(/[<>]/g,""),lw=(e,t)=>typeof t=="number"&&t!==0&&!sw.has(e)?`${t}px`:cw(String(t)),uu=e=>Object.entries(e).filter(([,t])=>t!==void 0).map(([t,n])=>`${aw(t)}:${lw(t,n)};`).join(""),uw=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 lc(e){const t={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[a,c]of Object.entries(e))if(iw(c)){r=!0;for(const u of fi){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 fi){const c=uu(n[a]);c&&o.push(`${a}{${c}}`)}const s=`cny-sx-${uw(o.join(""))}`;let i="";for(const a of fi){const c=uu(n[a]);c&&(i+=a==="base"?`.${s}{${c}}`:`@media (min-width:${Tf[a]}px){.${s}{${c}}}`)}return{className:s,css:i}}function re(e,t,...n){const r=e?lc(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 uc=C.createContext({});function dc(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const dw=typeof window<"u",Ef=dw?C.useLayoutEffect:C.useEffect,vs=C.createContext(null);function fc(e,t){e.indexOf(t)===-1&&e.push(t)}function Xo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const It=(e,t,n)=>n>t?t:n<e?e:n;function Ji(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let sr=()=>{},_t=()=>{};var Rf;typeof process<"u"&&((Rf=process.env)==null?void 0:Rf.NODE_ENV)!=="production"&&(sr=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ji(t,n))},_t=(e,t,n)=>{if(!e)throw new Error(Ji(t,n))});const Zt={},Mf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Af(e){return typeof e=="object"&&e!==null}const Nf=e=>/^0[^.\s]+$/u.test(e);function jf(e){let t;return()=>(t===void 0&&(t=e()),t)}const it=e=>e,fw=(e,t)=>n=>t(e(n)),Fr=(...e)=>e.reduce(fw),Mr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class hc{constructor(){this.subscriptions=[]}add(t){return fc(this.subscriptions,t),()=>Xo(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 He=e=>e*1e3,st=e=>e/1e3;function If(e,t){return t?e*(1e3/t):0}const du=new Set;function pc(e,t,n){e||du.has(t)||(console.warn(Ji(t,n)),du.add(t))}const Df=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,hw=1e-7,pw=12;function mw(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Df(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>hw&&++a<pw);return i}function Vr(e,t,n,r){if(e===t&&n===r)return it;const o=s=>mw(s,0,1,e,n);return s=>s===0||s===1?s:Df(o(s),t,r)}const kf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_f=e=>t=>1-e(1-t),Of=Vr(.33,1.53,.69,.99),mc=_f(Of),$f=kf(mc),Lf=e=>e>=1?1:(e*=2)<1?.5*mc(e):.5*(2-Math.pow(2,-10*(e-1))),gc=e=>1-Math.sin(Math.acos(e)),Ff=_f(gc),Vf=kf(gc),gw=Vr(.42,0,1,1),yw=Vr(0,0,.58,1),Bf=Vr(.42,0,.58,1),vw=e=>Array.isArray(e)&&typeof e[0]!="number",Gf=e=>Array.isArray(e)&&typeof e[0]=="number",fu={linear:it,easeIn:gw,easeInOut:Bf,easeOut:yw,circIn:gc,circInOut:Vf,circOut:Ff,backIn:mc,backInOut:$f,backOut:Of,anticipate:Lf},xw=e=>typeof e=="string",hu=e=>{if(Gf(e)){_t(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Vr(t,n,r,o)}else if(xw(e))return _t(fu[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),fu[e];return e},mo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function bw(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 y=h&&o?n:r;return f&&i.add(d),y.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 ww=40;function Uf(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=mo.reduce((w,S)=>(w[S]=bw(s),w),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:m,postRender:y}=i,g=()=>{const w=Zt.useManualTiming,S=w?o.timestamp:performance.now();n=!1,w||(o.delta=r?1e3/60:Math.max(Math.min(S-o.timestamp,ww),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),m.process(o),y.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,o.isProcessing||e(g)};return{schedule:mo.reduce((w,S)=>{const R=i[S];return w[S]=(P,T=!1,A=!1)=>(n||v(),R.schedule(P,T,A)),w},{}),cancel:w=>{for(let S=0;S<mo.length;S++)i[mo[S]].cancel(w)},state:o,steps:i}}const{schedule:fe,cancel:Qt,state:ke,steps:hi}=Uf(typeof requestAnimationFrame<"u"?requestAnimationFrame:it,!0);let _o;function Cw(){_o=void 0}const We={now:()=>(_o===void 0&&We.set(ke.isProcessing||Zt.useManualTiming?ke.timestamp:performance.now()),_o),set:e=>{_o=e,queueMicrotask(Cw)}},Wf=e=>t=>typeof t=="string"&&t.startsWith(e),Kf=Wf("--"),Sw=Wf("var(--"),yc=e=>Sw(e)?Rw.test(e.split("/*")[0].trim()):!1,Rw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function pu(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ir={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ar={...ir,transform:e=>It(0,1,e)},go={...ir,default:1},Pr=e=>Math.round(e*1e5)/1e5,vc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pw(e){return e==null}const Tw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xc=(e,t)=>n=>!!(typeof n=="string"&&Tw.test(n)&&n.startsWith(e)||t&&!Pw(n)&&Object.prototype.hasOwnProperty.call(n,t)),zf=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(vc);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Ew=e=>It(0,255,e),pi={...ir,transform:e=>Math.round(Ew(e))},xn={test:xc("rgb","red"),parse:zf("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+pi.transform(e)+", "+pi.transform(t)+", "+pi.transform(n)+", "+Pr(Ar.transform(r))+")"};function Mw(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 ea={test:xc("#"),parse:Mw,transform:xn.transform},Br=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wt=Br("deg"),Nt=Br("%"),ne=Br("px"),Aw=Br("vh"),Nw=Br("vw"),mu={...Nt,parse:e=>Nt.parse(e)/100,transform:e=>Nt.transform(e*100)},zn={test:xc("hsl","hue"),parse:zf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Nt.transform(Pr(t))+", "+Nt.transform(Pr(n))+", "+Pr(Ar.transform(r))+")"},Ce={test:e=>xn.test(e)||ea.test(e)||zn.test(e),parse:e=>xn.test(e)?xn.parse(e):zn.test(e)?zn.parse(e):ea.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xn.transform(e):zn.transform(e),getAnimatableNone:e=>{const t=Ce.parse(e);return t.alpha=0,Ce.transform(t)}},jw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Iw(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(vc))==null?void 0:t.length)||0)+(((n=e.match(jw))==null?void 0:n.length)||0)>0}const Hf="number",Yf="color",Dw="var",kw="var(",gu="${}",_w=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Qn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(_w,c=>(Ce.test(c)?(r.color.push(s),o.push(Yf),n.push(Ce.parse(c))):c.startsWith(kw)?(r.var.push(s),o.push(Dw),n.push(c)):(r.number.push(s),o.push(Hf),n.push(parseFloat(c))),++s,gu)).split(gu);return{values:n,split:a,indexes:r,types:o}}function Ow(e){return Qn(e).values}function Xf({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===Hf?o+=Pr(r[s]):i===Yf?o+=Ce.transform(r[s]):o+=r[s]}return o}}function $w(e){return Xf(Qn(e))}const Lw=e=>typeof e=="number"?0:Ce.test(e)?Ce.getAnimatableNone(e):e,Fw=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Lw(e);function Vw(e){const t=Qn(e);return Xf(t)(t.values.map((r,o)=>Fw(r,t.split[o])))}const ft={test:Iw,parse:Ow,createTransformer:$w,getAnimatableNone:Vw};function mi(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 Bw({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=mi(c,a,e+1/3),s=mi(c,a,e),i=mi(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function qo(e,t){return n=>n>0?t:e}const pe=(e,t,n)=>e+(t-e)*n,gi=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Gw=[ea,xn,zn],Uw=e=>Gw.find(t=>t.test(e));function yu(e){const t=Uw(e);if(sr(!!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===zn&&(n=Bw(n)),n}const vu=(e,t)=>{const n=yu(e),r=yu(t);if(!n||!r)return qo(e,t);const o={...n};return s=>(o.red=gi(n.red,r.red,s),o.green=gi(n.green,r.green,s),o.blue=gi(n.blue,r.blue,s),o.alpha=pe(n.alpha,r.alpha,s),xn.transform(o))},ta=new Set(["none","hidden"]);function Ww(e,t){return ta.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Kw(e,t){return n=>pe(e,t,n)}function bc(e){return typeof e=="number"?Kw:typeof e=="string"?yc(e)?qo:Ce.test(e)?vu:Yw:Array.isArray(e)?qf:typeof e=="object"?Ce.test(e)?vu:zw:qo}function qf(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>bc(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function zw(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=bc(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Hw(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 Yw=(e,t)=>{const n=ft.createTransformer(t),r=Qn(e),o=Qn(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?ta.has(e)&&!o.values.length||ta.has(t)&&!r.values.length?Ww(e,t):Fr(qf(Hw(r,o),o.values),n):(sr(!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"),qo(e,t))};function Zf(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?pe(e,t,n):bc(e)(e,t)}const Xw=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>fe.update(t,n),stop:()=>Qt(t),now:()=>ke.isProcessing?ke.timestamp:We.now()}},Qf=(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)})`},Zo=2e4;function wc(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Zo;)t+=n,r=e.next(t);return t>=Zo?1/0:t}function qw(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(wc(r),Zo);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:st(o)}}const ge={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 na(e,t){return e*Math.sqrt(1-t*t)}const Zw=12;function Qw(e,t,n){let r=n;for(let o=1;o<Zw;o++)r=r-e(r)/t(r);return r}const yi=.001;function Jw({duration:e=ge.duration,bounce:t=ge.bounce,velocity:n=ge.velocity,mass:r=ge.mass}){let o,s;sr(e<=He(ge.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=It(ge.minDamping,ge.maxDamping,i),e=It(ge.minDuration,ge.maxDuration,st(e)),i<1?(o=u=>{const d=u*i,f=d*e,h=d-n,m=na(u,i),y=Math.exp(-f);return yi-h/m*y},s=u=>{const f=u*i*e,h=f*n+n,m=Math.pow(i,2)*Math.pow(u,2)*e,y=Math.exp(-f),g=na(Math.pow(u,2),i);return(-o(u)+yi>0?-1:1)*((h-m)*y)/g}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-yi+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,c=Qw(o,s,a);if(e=He(e),isNaN(c))return{stiffness:ge.stiffness,damping:ge.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:e}}}const eC=["duration","bounce"],tC=["stiffness","damping","mass"];function xu(e,t){return t.some(n=>e[n]!==void 0)}function nC(e){let t={velocity:ge.velocity,stiffness:ge.stiffness,damping:ge.damping,mass:ge.mass,isResolvedFromDuration:!1,...e};if(!xu(e,tC)&&xu(e,eC))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*It(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ge.mass,stiffness:o,damping:s}}else{const n=Jw({...e,velocity:0});t={...t,...n,mass:ge.mass},t.isResolvedFromDuration=!0}return t}function Qo(e=ge.visualDuration,t=ge.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:m}=nC({...n,velocity:-st(n.velocity||0)}),y=h||0,g=u/(2*Math.sqrt(c*d)),v=i-s,x=st(Math.sqrt(c/d)),b=Math.abs(v)<5;r||(r=b?ge.restSpeed.granular:ge.restSpeed.default),o||(o=b?ge.restDelta.granular:ge.restDelta.default);let w,S,R,P,T,A;if(g<1)R=na(x,g),P=(y+g*x*v)/R,w=M=>{const D=Math.exp(-g*x*M);return i-D*(P*Math.sin(R*M)+v*Math.cos(R*M))},T=g*x*P+v*R,A=g*x*v-P*R,S=M=>Math.exp(-g*x*M)*(T*Math.sin(R*M)+A*Math.cos(R*M));else if(g===1){w=D=>i-Math.exp(-x*D)*(v+(y+x*v)*D);const M=y+x*v;S=D=>Math.exp(-x*D)*(x*M*D-y)}else{const M=x*Math.sqrt(g*g-1);w=W=>{const Z=Math.exp(-g*x*W),G=Math.min(M*W,300);return i-Z*((y+g*x*v)*Math.sinh(G)+M*v*Math.cosh(G))/M};const D=(y+g*x*v)/M,k=g*x*D-v*M,V=g*x*v-D*M;S=W=>{const Z=Math.exp(-g*x*W),G=Math.min(M*W,300);return Z*(k*Math.sinh(G)+V*Math.cosh(G))}}const E={calculatedDuration:m&&f||null,velocity:M=>He(S(M)),next:M=>{if(!m&&g<1){const k=Math.exp(-g*x*M),V=Math.sin(R*M),W=Math.cos(R*M),Z=i-k*(P*V+v*W),G=He(k*(T*V+A*W));return a.done=Math.abs(G)<=r&&Math.abs(i-Z)<=o,a.value=a.done?i:Z,a}const D=w(M);if(m)a.done=M>=f;else{const k=He(S(M));a.done=Math.abs(k)<=r&&Math.abs(i-D)<=o}return a.value=a.done?i:D,a},toString:()=>{const M=Math.min(wc(E),Zo),D=Qf(k=>E.next(M*k).value,M,30);return M+"ms "+D},toTransition:()=>{}};return E}Qo.applyToOptions=e=>{const t=qw(e,100,Qo);return e.ease=t.ease,e.duration=He(t.duration),e.type="keyframes",e};const rC=5;function Jf(e,t,n){const r=Math.max(t-rC,0);return If(n-e(r),t-r)}function ra({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},m=A=>a!==void 0&&A<a||c!==void 0&&A>c,y=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let g=n*t;const v=f+g,x=i===void 0?v:i(v);x!==v&&(g=x-f);const b=A=>-g*Math.exp(-A/r),w=A=>x+b(A),S=A=>{const E=b(A),M=w(A);h.done=Math.abs(E)<=u,h.value=h.done?x:M};let R,P;const T=A=>{m(h.value)&&(R=A,P=Qo({keyframes:[h.value,y(h.value)],velocity:Jf(w,A,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:A=>{let E=!1;return!P&&R===void 0&&(E=!0,S(A),T(A)),R!==void 0&&A>=R?P.next(A-R):(!E&&S(A),h)}}}function oC(e,t,n){const r=[],o=n||Zt.mix||Zf,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]||it:t;a=Fr(c,a)}r.push(a)}return r}function sC(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(_t(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=oC(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=Mr(e[f],e[f+1],d);return a[f](h)};return n?d=>u(It(e[0],e[s-1],d)):u}function iC(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Mr(0,t,r);e.push(pe(n,1,o))}}function aC(e){const t=[0];return iC(t,e.length-1),t}function cC(e,t){return e.map(n=>n*t)}function lC(e,t){return e.map(()=>t||Bf).splice(0,e.length-1)}function Hn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=vw(r)?r.map(hu):hu(r),s={done:!1,value:t[0]},i=cC(n&&n.length===t.length?n:aC(t),e),a=sC(i,t,{ease:Array.isArray(o)?o:lC(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const uC=e=>e!==null;function xs(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(uC),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const dC={decay:ra,inertia:ra,tween:Hn,keyframes:Hn,spring:Qo};function eh(e){typeof e.type=="string"&&(e.type=dC[e.type])}class Cc{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 fC=e=>e/100;class Jo extends Cc{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!==We.now()&&this.tick(We.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;eh(t);const{type:n=Hn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Hn;process.env.NODE_ENV!=="production"&&c!==Hn&&_t(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Hn&&typeof a[0]!="number"&&(this.mixKeyframes=Fr(fC,Zf(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=wc(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:m,type:y,onUpdate:g,finalKeyframe:v}=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 w=this.currentTime,S=r;if(f){const A=Math.min(this.currentTime,o)/a;let E=Math.floor(A),M=A%1;!M&&A>=1&&(M=1),M===1&&E--,E=Math.min(E,f+1),!!(E%2)&&(h==="reverse"?(M=1-M,m&&(M-=m/a)):h==="mirror"&&(S=i)),w=It(0,1,M)*a}let R;b?(this.delayState.value=d[0],R=this.delayState):R=S.next(w),s&&!b&&(R.value=s(R.value));let{done:P}=R;!b&&c!==null&&(P=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return T&&y!==ra&&(R.value=xs(d,this.options,v,this.speed)),g&&g(R.value),T&&this.finish(),R}then(t,n){return this.finished.then(t,n)}get duration(){return st(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+st(t)}get time(){return st(this.currentTime)}set time(t){t=He(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 Jf(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(We.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=st(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Xw,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(We.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 hC(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const bn=e=>e*180/Math.PI,oa=e=>{const t=bn(Math.atan2(e[1],e[0]));return sa(t)},pC={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:oa,rotateZ:oa,skewX:e=>bn(Math.atan(e[1])),skewY:e=>bn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},sa=e=>(e=e%360,e<0&&(e+=360),e),bu=oa,wu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Cu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),mC={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wu,scaleY:Cu,scale:e=>(wu(e)+Cu(e))/2,rotateX:e=>sa(bn(Math.atan2(e[6],e[5]))),rotateY:e=>sa(bn(Math.atan2(-e[2],e[0]))),rotateZ:bu,rotate:bu,skewX:e=>bn(Math.atan(e[4])),skewY:e=>bn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ia(e){return e.includes("scale")?1:0}function aa(e,t){if(!e||e==="none")return ia(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=mC,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=pC,o=a}if(!o)return ia(t);const s=r[t],i=o[1].split(",").map(yC);return typeof s=="function"?s(i):i[s]}const gC=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return aa(n,t)};function yC(e){return parseFloat(e.trim())}const ar=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cr=new Set(ar),Su=e=>e===ir||e===ne,vC=new Set(["x","y","z"]),xC=ar.filter(e=>!vC.has(e));function bC(e){const t=[];return xC.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ht={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})=>aa(t,"x"),y:(e,{transform:t})=>aa(t,"y")};Ht.translateX=Ht.x;Ht.translateY=Ht.y;const wn=new Set;let ca=!1,la=!1,ua=!1;function th(){if(la){const e=Array.from(wn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=bC(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)})}la=!1,ca=!1,wn.forEach(e=>e.complete(ua)),wn.clear()}function nh(){wn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(la=!0)})}function wC(){ua=!0,nh(),th(),ua=!1}class Sc{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?(wn.add(this),ca||(ca=!0,fe.read(nh),fe.resolveKeyframes(th))):(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])}hC(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),wn.delete(this)}cancel(){this.state==="scheduled"&&(wn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const CC=e=>e.startsWith("--");function rh(e,t,n){CC(t)?e.style.setProperty(t,n):e.style[t]=n}const SC={};function oh(e,t){const n=jf(e);return()=>SC[t]??n()}const RC=oh(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),sh=oh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ru={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wr([0,.65,.55,1]),circOut:wr([.55,0,1,.45]),backIn:wr([.31,.01,.66,-.59]),backOut:wr([.33,1.53,.69,.99])};function ih(e,t){if(e)return typeof e=="function"?sh()?Qf(e,t):"ease-out":Gf(e)?wr(e):Array.isArray(e)?e.map(n=>ih(n,t)||Ru.easeOut):Ru[e]}function PC(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=ih(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 ah(e){return typeof e=="function"&&"applyToOptions"in e}function TC({type:e,...t}){return ah(e)&&sh()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ch extends Cc{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,_t(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=TC(t);this.animation=PC(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=xs(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),rh(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 st(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+st(t)}get time(){return st(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=He(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&&RC()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),it):o(this)}}const lh={anticipate:Lf,backInOut:$f,circInOut:Vf};function EC(e){return e in lh}function MC(e){typeof e.ease=="string"&&EC(e.ease)&&(e.ease=lh[e.ease])}const vi=10;class AC extends ch{constructor(t){MC(t),eh(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 Jo({...i,autoplay:!1}),c=Math.max(vi,We.now()-this.startTime),u=It(0,vi,c-vi),d=a.sample(c).value,{name:f}=this.options;s&&f&&rh(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const Pu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ft.test(e)||e==="0")&&!e.startsWith("url("));function NC(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 jC(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=Pu(o,t),a=Pu(s,t);return sr(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:NC(e)||(n==="spring"||ah(n))&&r}function da(e){e.duration=0,e.type="keyframes"}const uh=new Set(["opacity","clipPath","filter","transform"]),IC=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function DC(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&IC.test(e[t]))return!0;return!1}const kC=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),_C=jf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function OC(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 _C()&&n&&(uh.has(n)||kC.has(n)&&DC(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const $C=40;class LC extends Cc{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 y;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=We.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},m=(d==null?void 0:d.KeyframeResolver)||Sc;this.keyframeResolver=new m(a,(g,v,x)=>this.onKeyframesResolved(g,v,h,!x),c,u,d),(y=this.keyframeResolver)==null||y.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=We.now();let f=!0;jC(t,s,i,a)||(f=!1,(Zt.instantAnimations||!c)&&(d==null||d(xs(t,r,n))),t[0]=t[t.length-1],da(r),r.repeat=0);const m={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>$C?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=f&&!u&&OC(m),g=(b=(x=m.motionValue)==null?void 0:x.owner)==null?void 0:b.current;let v;if(y)try{v=new AC({...m,element:g})}catch{v=new Jo(m)}else v=new Jo(m);v.finished.then(()=>{this.notifyFinished()}).catch(it),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),wC()),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 dh(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 FC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function VC(e){const t=FC.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const BC=4;function fh(e,t,n=1){_t(n<=BC,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=VC(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Mf(i)?parseFloat(i):i}return yc(o)?fh(o,t,n+1):o}const GC={type:"spring",stiffness:500,damping:25,restSpeed:10},UC=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),WC={type:"keyframes",duration:.8},KC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},zC=(e,{keyframes:t})=>t.length>2?WC:cr.has(e)?e.startsWith("scale")?UC(t[1]):GC:KC;function hh(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Rc(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?hh(n,e):n}const HC=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function YC(e){for(const t in e)if(!HC.has(t))return!0;return!1}const Pc=(e,t,n,r={},o,s)=>i=>{const a=Rc(r,e)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-He(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};YC(a)||Object.assign(d,zC(e,d)),d.duration&&(d.duration=He(d.duration)),d.repeatDelay&&(d.repeatDelay=He(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(da(d),d.delay===0&&(f=!0)),(Zt.instantAnimations||Zt.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,da(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const h=xs(d.keyframes,a);if(h!==void 0){fe.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new Jo(d):new LC(d)};function Tu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tc(e,t,n,r){if(typeof t=="function"){const[o,s]=Tu(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]=Tu(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Cn(e,t,n){const r=e.getProps();return Tc(r,t,n!==void 0?n:r.custom,e)}const ph=new Set(["width","height","top","left","right","bottom",...ar]),Eu=30,XC=e=>!isNaN(parseFloat(e));class qC{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=We.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=We.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=XC(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&pc(!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 hc);const r=this.events[t].add(n);return t==="change"?()=>{r(),fe.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=We.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Eu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Eu);return If(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 Jn(e,t){return new qC(e,t)}const fa=e=>Array.isArray(e);function ZC(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Jn(n))}function QC(e){return fa(e)?e[e.length-1]||0:e}function JC(e,t){const n=Cn(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=QC(s[i]);ZC(e,i,a)}}const _e=e=>!!(e&&e.getVelocity);function e0(e){return!!(_e(e)&&e.add)}function ha(e,t){const n=e.getValue("willChange");if(e0(n))return n.add(t);if(!n&&Zt.WillChange){const r=new Zt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ec(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const t0="framerAppearId",mh="data-"+Ec(t0);function gh(e){return e.props[mh]}function n0({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function yh(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=t;const c=e.getDefaultTransition();s=s?hh(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 m=e.getValue(h,e.latestValues[h]??null),y=a[h];if(y===void 0||f&&n0(f,h))continue;const g={delay:n,...Rc(s||{},h)},v=m.get();if(v!==void 0&&!m.isAnimating()&&!Array.isArray(y)&&y===v&&!g.velocity){fe.update(()=>m.set(y));continue}let x=!1;if(window.MotionHandoffAnimation){const S=gh(e);if(S){const R=window.MotionHandoffAnimation(S,h,fe);R!==null&&(g.startTime=R,x=!0)}}ha(e,h);const b=u??e.shouldReduceMotion;m.start(Pc(h,m,y,b&&ph.has(h)?{type:!1}:g,e,x));const w=m.animation;w&&d.push(w)}if(i){const h=()=>fe.update(()=>{i&&JC(e,i)});d.length?Promise.all(d).then(h):h()}return d}function pa(e,t,n={}){var c;const r=Cn(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(yh(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return r0(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 r0(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(pa(c,t,{...i,delay:n+(typeof r=="function"?0:r)+dh(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function o0(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>pa(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=pa(e,t,n);else{const o=typeof t=="function"?Cn(e,t,n.custom):t;r=Promise.all(yh(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const s0={test:e=>e==="auto",parse:e=>e},vh=e=>t=>t.test(e),xh=[ir,ne,Nt,Wt,Nw,Aw,s0],Mu=e=>xh.find(vh(e));function i0(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Nf(e):!0}const a0=new Set(["brightness","contrast","saturate","opacity"]);function c0(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(vc)||[];if(!r)return e;const o=n.replace(r,"");let s=a0.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const l0=/\b([a-z-]*)\(.*?\)/gu,ma={...ft,getAnimatableNone:e=>{const t=e.match(l0);return t?t.map(c0).join(" "):e}},ga={...ft,getAnimatableNone:e=>{const t=ft.parse(e);return ft.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Au={...ir,transform:Math.round},u0={rotate:Wt,rotateX:Wt,rotateY:Wt,rotateZ:Wt,scale:go,scaleX:go,scaleY:go,scaleZ:go,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:Ar,originX:mu,originY:mu,originZ:ne},Mc={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,...u0,zIndex:Au,fillOpacity:Ar,strokeOpacity:Ar,numOctaves:Au},d0={...Mc,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:ma,WebkitFilter:ma,mask:ga,WebkitMask:ga},bh=e=>d0[e],f0=new Set([ma,ga]);function wh(e,t){let n=bh(e);return f0.has(n)||(n=ft),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const h0=new Set(["auto","none","0"]);function p0(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!h0.has(s)&&Qn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=wh(n,o)}class m0 extends Sc{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(),yc(f))){const h=fh(f,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!ph.has(r)||t.length!==2)return;const[o,s]=t,i=Mu(o),a=Mu(s),c=pu(o),u=pu(s);if(c!==u&&Ht[r]){this.needsMeasurement=!0;return}if(i!==a)if(Su(i)&&Su(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else Ht[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||i0(t[o]))&&r.push(o);r.length&&p0(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=Ht[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]=Ht[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 Ch(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 Sh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Oo(e){return Af(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Ac}=Uf(queueMicrotask,!1),ut={x:!1,y:!1};function Rh(){return ut.x||ut.y}function g0(e){return e==="x"||e==="y"?ut[e]?null:(ut[e]=!0,()=>{ut[e]=!1}):ut.x||ut.y?null:(ut.x=ut.y=!0,()=>{ut.x=ut.y=!1})}function Ph(e,t){const n=Ch(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function y0(e){return!(e.pointerType==="touch"||Rh())}function v0(e,t,n={}){const[r,o,s]=Ph(e,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",y)},f=v=>{u&&(u(v),u=void 0),d()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(v))},m=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},y=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}f(v)}},g=v=>{if(!y0(v))return;c=!1;const x=t(i,v);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",y,o))};i.addEventListener("pointerenter",g,o),i.addEventListener("pointerdown",m,o)}),s}const Th=(e,t)=>t?e===t?!0:Th(e,t.parentElement):!1,Nc=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,x0=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function b0(e){return x0.has(e.tagName)||e.isContentEditable===!0}const w0=new Set(["INPUT","SELECT","TEXTAREA"]);function C0(e){return w0.has(e.tagName)||e.isContentEditable===!0}const $o=new WeakSet;function Nu(e){return t=>{t.key==="Enter"&&e(t)}}function xi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const S0=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Nu(()=>{if($o.has(n))return;xi(n,"down");const o=Nu(()=>{xi(n,"up")}),s=()=>xi(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 ju(e){return Nc(e)&&!Rh()}const Iu=new WeakSet;function R0(e,t,n={}){const[r,o,s]=Ph(e,n),i=a=>{const c=a.currentTarget;if(!ju(a)||Iu.has(a))return;$o.add(c),n.stopPropagation&&Iu.add(a);const u=t(c,a),d=(m,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),$o.has(c)&&$o.delete(c),ju(m)&&typeof u=="function"&&u(m,{success:y})},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||Th(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Oo(a)&&(a.addEventListener("focus",u=>S0(u,o)),!b0(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function jc(e){return Af(e)&&"ownerSVGElement"in e}const Lo=new WeakMap;let Kt;const Eh=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:jc(r)&&"getBBox"in r?r.getBBox()[t]:r[n],P0=Eh("inline","width","offsetWidth"),T0=Eh("block","height","offsetHeight");function E0({target:e,borderBoxSize:t}){var n;(n=Lo.get(e))==null||n.forEach(r=>{r(e,{get width(){return P0(e,t)},get height(){return T0(e,t)}})})}function M0(e){e.forEach(E0)}function A0(){typeof ResizeObserver>"u"||(Kt=new ResizeObserver(M0))}function N0(e,t){Kt||A0();const n=Ch(e);return n.forEach(r=>{let o=Lo.get(r);o||(o=new Set,Lo.set(r,o)),o.add(t),Kt==null||Kt.observe(r)}),()=>{n.forEach(r=>{const o=Lo.get(r);o==null||o.delete(t),o!=null&&o.size||Kt==null||Kt.unobserve(r)})}}const Fo=new Set;let Yn;function j0(){Yn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Fo.forEach(t=>t(e))},window.addEventListener("resize",Yn)}function I0(e){return Fo.add(e),Yn||j0(),()=>{Fo.delete(e),!Fo.size&&typeof Yn=="function"&&(window.removeEventListener("resize",Yn),Yn=void 0)}}function Du(e,t){return typeof e=="function"?I0(e):N0(e,t)}function D0(e){return jc(e)&&e.tagName==="svg"}const k0=[...xh,Ce,ft],_0=e=>k0.find(vh(e)),ku=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xn=()=>({x:ku(),y:ku()}),_u=()=>({min:0,max:0}),Pe=()=>({x:_u(),y:_u()}),O0=new WeakMap;function bs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Nr(e){return typeof e=="string"||Array.isArray(e)}const Ic=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Dc=["initial",...Ic];function ws(e){return bs(e.animate)||Dc.some(t=>Nr(e[t]))}function Mh(e){return!!(ws(e)||e.variants)}function $0(e,t,n){for(const r in t){const o=t[r],s=n[r];if(_e(o))e.addValue(r,o);else if(_e(s))e.addValue(r,Jn(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,Jn(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ya={current:null},Ah={current:!1},L0=typeof window<"u";function F0(){if(Ah.current=!0,!!L0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ya.current=e.matches;e.addEventListener("change",t),t()}else ya.current=!1}const Ou=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let es={};function Nh(e){es=e}function V0(){return es}class B0{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=Sc,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=We.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,fe.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=ws(n),this.isVariantNode=Mh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];u[m]!==void 0&&_e(y)&&y.set(u[m])}}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,O0.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:(Ah.current||F0(),this.shouldReduceMotion=ya.current),process.env.NODE_ENV!=="production"&&pc(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(),Qt(this.notifyUpdate),Qt(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&&uh.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new ch({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:He(d)}),h=i(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=cr.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&fe.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 es){const n=es[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):Pe()}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<Ou.length;r++){const o=Ou[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=$0(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=Jn(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"&&(Mf(r)||Nf(r))?r=parseFloat(r):!_0(r)&&ft.test(n)&&(r=wh(t,n)),this.setBaseTarget(t,_e(r)?r.get():r)),_e(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=Tc(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&&!_e(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 hc),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ac.render(this.render)}}class jh extends B0{constructor(){super(...arguments),this.KeyframeResolver=m0}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;_e(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class rn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ih({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function G0({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function U0(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 bi(e){return e===void 0||e===1}function va({scale:e,scaleX:t,scaleY:n}){return!bi(e)||!bi(t)||!bi(n)}function vn(e){return va(e)||Dh(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dh(e){return $u(e.x)||$u(e.y)}function $u(e){return e&&e!=="0%"}function ts(e,t,n){const r=e-n,o=t*r;return n+o}function Lu(e,t,n,r,o){return o!==void 0&&(e=ts(e,o,r)),ts(e,n,r)+t}function xa(e,t=0,n=1,r,o){e.min=Lu(e.min,t,n,r,o),e.max=Lu(e.max,t,n,r,o)}function kh(e,{x:t,y:n}){xa(e.x,t.translate,t.scale,t.originPoint),xa(e.y,n.translate,n.scale,n.originPoint)}const Fu=.999999999999,Vu=1.0000000000001;function W0(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&&(Et(e.x,-s.scroll.offset.x),Et(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,kh(e,i)),r&&vn(s.latestValues)&&Vo(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<Vu&&t.x>Fu&&(t.x=1),t.y<Vu&&t.y>Fu&&(t.y=1)}function Et(e,t){e.min+=t,e.max+=t}function Bu(e,t,n,r,o=.5){const s=pe(e.min,e.max,o);xa(e,t,n,s,r)}function Gu(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Vo(e,t,n){const r=n??e;Bu(e.x,Gu(t.x,r.x),t.scaleX,t.scale,t.originX),Bu(e.y,Gu(t.y,r.y),t.scaleY,t.scale,t.originY)}function _h(e,t){return Ih(U0(e.getBoundingClientRect(),t))}function K0(e,t,n){const r=_h(e,n),{scroll:o}=t;return o&&(Et(r.x,o.offset.x),Et(r.y,o.offset.y)),r}const z0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H0=ar.length;function Y0(e,t,n){let r="",o=!0;for(let s=0;s<H0;s++){const i=ar[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=Sh(a,Mc[i]);if(!c){o=!1;const d=z0[i]||i;r+=`${d}(${u}) `}n&&(t[i]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function kc(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(cr.has(c)){i=!0;continue}else if(Kf(c)){o[c]=u;continue}else{const d=Sh(u,Mc[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(t.transform||(i||n?r.transform=Y0(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 Oh(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 Uu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const xr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ne.test(e))e=parseFloat(e);else return e;const n=Uu(e,t.target.x),r=Uu(e,t.target.y);return`${n}% ${r}%`}},X0={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=ft.parse(e);if(o.length>5)return r;const s=ft.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=pe(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},ba={borderRadius:{...xr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xr,borderTopRightRadius:xr,borderBottomLeftRadius:xr,borderBottomRightRadius:xr,boxShadow:X0};function $h(e,{layout:t,layoutId:n}){return cr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ba[e]||e==="opacity")}function _c(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)(_e(r[a])||o&&_e(o[a])||$h(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function q0(e){return window.getComputedStyle(e)}class Z0 extends jh{constructor(){super(...arguments),this.type="html",this.renderInstance=Oh}readValueFromInstance(t,n){var r;if(cr.has(n))return(r=this.projection)!=null&&r.isProjecting?ia(n):gC(t,n);{const o=q0(t),s=(Kf(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _h(t,n)}build(t,n,r){kc(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return _c(t,n,r)}}const Q0={offset:"stroke-dashoffset",array:"stroke-dasharray"},J0={offset:"strokeDashoffset",array:"strokeDasharray"};function eS(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?Q0:J0;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const tS=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Lh(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(kc(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 m of tS)f[m]!==void 0&&(h[m]=f[m],delete f[m]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&eS(f,o,s,i,!1)}const Fh=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"]),Vh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nS(e,t,n,r){Oh(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Fh.has(o)?o:Ec(o),t.attrs[o])}function Bh(e,t,n){const r=_c(e,t,n);for(const o in e)if(_e(e[o])||_e(t[o])){const s=ar.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}class rS extends jh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(cr.has(n)){const r=bh(n);return r&&r.default||0}return n=Fh.has(n)?n:Ec(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Bh(t,n,r)}build(t,n,r){Lh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){nS(t,n,r,o)}mount(t){this.isSVGTag=Vh(t.tagName),super.mount(t)}}const oS=Dc.length;function Gh(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Gh(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<oS;n++){const r=Dc[n],o=e.props[r];(Nr(o)||o===!1)&&(t[r]=o)}return t}function Uh(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 sS=[...Ic].reverse(),iS=Ic.length;function aS(e){return t=>Promise.all(t.map(({animation:n,options:r})=>o0(e,n,r)))}function cS(e){let t=aS(e),n=Wu(),r=!0,o=!1;const s=u=>(d,f)=>{var m;const h=Cn(e,f,u==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(h){const{transition:y,transitionEnd:g,...v}=h;d={...d,...v,...g}}return d};function i(u){t=u(e)}function a(u){const{props:d}=e,f=Gh(e.parent)||{},h=[],m=new Set;let y={},g=1/0;for(let x=0;x<iS;x++){const b=sS[x],w=n[b],S=d[b]!==void 0?d[b]:f[b],R=Nr(S),P=b===u?w.isActive:null;P===!1&&(g=x);let T=S===f[b]&&S!==d[b]&&R;if(T&&(r||o)&&e.manuallyAnimateOnMount&&(T=!1),w.protectedKeys={...y},!w.isActive&&P===null||!S&&!w.prevProp||bs(S)||typeof S=="boolean")continue;if(b==="exit"&&w.isActive&&P!==!0){w.prevResolvedValues&&(y={...y,...w.prevResolvedValues});continue}const A=lS(w.prevProp,S);let E=A||b===u&&w.isActive&&!T&&R||x>g&&R,M=!1;const D=Array.isArray(S)?S:[S];let k=D.reduce(s(b),{});P===!1&&(k={});const{prevResolvedValues:V={}}=w,W={...V,...k},Z=O=>{E=!0,m.has(O)&&(M=!0,m.delete(O)),w.needsAnimating[O]=!0;const N=e.getValue(O);N&&(N.liveStyle=!1)};for(const O in W){const N=k[O],j=V[O];if(y.hasOwnProperty(O))continue;let H=!1;fa(N)&&fa(j)?H=!Uh(N,j):H=N!==j,H?N!=null?Z(O):m.add(O):N!==void 0&&m.has(O)?Z(O):w.protectedKeys[O]=!0}w.prevProp=S,w.prevResolvedValues=k,w.isActive&&(y={...y,...k}),(r||o)&&e.blockInitialAnimation&&(E=!1);const G=T&&A;E&&(!G||M)&&h.push(...D.map(O=>{const N={type:b};if(typeof O=="string"&&(r||o)&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:j}=e,H=Cn(j,O);if(j.enteringChildren&&H){const{delayChildren:I}=H.transition||{};N.delay=dh(j.enteringChildren,e,I)}}return{animation:O,options:N}}))}if(m.size){const x={};if(typeof d.initial!="boolean"){const b=Cn(e,Array.isArray(d.initial)?d.initial[0]:d.initial);b&&b.transition&&(x.transition=b.transition)}m.forEach(b=>{const w=e.getBaseTarget(b),S=e.getValue(b);S&&(S.liveStyle=!0),x[b]=w??null}),h.push({animation:x})}let v=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,o=!1,v?t(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(m=>{var y;return(y=m.animationState)==null?void 0:y.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Wu(),o=!0}}}function lS(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Uh(t,e):!1}function gn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Wu(){return{animate:gn(!0),whileInView:gn(),whileHover:gn(),whileTap:gn(),whileDrag:gn(),whileFocus:gn(),exit:gn()}}function wa(e,t){e.min=t.min,e.max=t.max}function lt(e,t){wa(e.x,t.x),wa(e.y,t.y)}function Ku(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Wh=1e-4,uS=1-Wh,dS=1+Wh,Kh=.01,fS=0-Kh,hS=0+Kh;function Ke(e){return e.max-e.min}function pS(e,t,n){return Math.abs(e-t)<=n}function zu(e,t,n,r=.5){e.origin=r,e.originPoint=pe(t.min,t.max,e.origin),e.scale=Ke(n)/Ke(t),e.translate=pe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=uS&&e.scale<=dS||isNaN(e.scale))&&(e.scale=1),(e.translate>=fS&&e.translate<=hS||isNaN(e.translate))&&(e.translate=0)}function Tr(e,t,n,r){zu(e.x,t.x,n.x,r?r.originX:void 0),zu(e.y,t.y,n.y,r?r.originY:void 0)}function Hu(e,t,n,r=0){const o=r?pe(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+Ke(t)}function mS(e,t,n,r){Hu(e.x,t.x,n.x,r==null?void 0:r.x),Hu(e.y,t.y,n.y,r==null?void 0:r.y)}function Yu(e,t,n,r=0){const o=r?pe(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+Ke(t)}function ns(e,t,n,r){Yu(e.x,t.x,n.x,r==null?void 0:r.x),Yu(e.y,t.y,n.y,r==null?void 0:r.y)}function Xu(e,t,n,r,o){return e-=t,e=ts(e,1/n,r),o!==void 0&&(e=ts(e,1/o,r)),e}function gS(e,t=0,n=1,r=.5,o,s=e,i=e){if(Nt.test(t)&&(t=parseFloat(t),t=pe(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=pe(s.min,s.max,r);e===s&&(a-=t),e.min=Xu(e.min,t,n,a,o),e.max=Xu(e.max,t,n,a,o)}function qu(e,t,[n,r,o],s,i){gS(e,t[n],t[r],t[o],t.scale,s,i)}const yS=["x","scaleX","originX"],vS=["y","scaleY","originY"];function Zu(e,t,n,r){qu(e.x,t,yS,n?n.x:void 0,r?r.x:void 0),qu(e.y,t,vS,n?n.y:void 0,r?r.y:void 0)}function Qu(e){return e.translate===0&&e.scale===1}function zh(e){return Qu(e.x)&&Qu(e.y)}function Ju(e,t){return e.min===t.min&&e.max===t.max}function xS(e,t){return Ju(e.x,t.x)&&Ju(e.y,t.y)}function ed(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hh(e,t){return ed(e.x,t.x)&&ed(e.y,t.y)}function td(e){return Ke(e.x)/Ke(e.y)}function nd(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Pt(e){return[e("x"),e("y")]}function bS(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:m,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}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 Yh=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],wS=Yh.length,rd=e=>typeof e=="string"?parseFloat(e):e,od=e=>typeof e=="number"||ne.test(e);function CS(e,t,n,r,o,s){o?(e.opacity=pe(0,n.opacity??1,SS(r)),e.opacityExit=pe(t.opacity??1,0,RS(r))):s&&(e.opacity=pe(t.opacity??1,n.opacity??1,r));for(let i=0;i<wS;i++){const a=Yh[i];let c=sd(t,a),u=sd(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||od(c)===od(u)?(e[a]=Math.max(pe(rd(c),rd(u),r),0),(Nt.test(u)||Nt.test(c))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=pe(t.rotate||0,n.rotate||0,r))}function sd(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const SS=Xh(0,.5,Ff),RS=Xh(.5,.95,it);function Xh(e,t,n){return r=>r<e?0:r>t?1:n(Mr(e,t,r))}function PS(e,t,n){const r=_e(e)?e:Jn(e);return r.start(Pc("",r,t,n)),r.animation}function jr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const TS=(e,t)=>e.depth-t.depth;class ES{constructor(){this.children=[],this.isDirty=!1}add(t){fc(this.children,t),this.isDirty=!0}remove(t){Xo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(TS),this.isDirty=!1,this.children.forEach(t)}}function MS(e,t){const n=We.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Qt(r),e(s-t))};return fe.setup(r,!0),()=>Qt(r)}function Bo(e){return _e(e)?e.get():e}class AS{constructor(){this.members=[]}add(t){fc(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&&(Xo(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Xo(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 Go={hasAnimatedSinceResize:!0,hasEverUpdated:!1},wi=["","X","Y","Z"],NS=1e3;let jS=0;function Ci(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=gh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",fe,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qh(r)}function Zh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=jS++,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(kS),this.nodes.forEach(VS),this.nodes.forEach(BS),this.nodes.forEach(_S)},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 ES)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new hc),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=jc(i)&&!D0(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;fe.read(()=>{f=window.innerWidth}),e(i,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=MS(h,250),Go.hasAnimatedSinceResize&&(Go.hasAnimatedSinceResize=!1,this.nodes.forEach(cd)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||zS,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=u.getProps(),x=!this.targetLayout||!Hh(this.targetLayout,m),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 w={...Rc(y,"layout"),onPlay:g,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(d,b)}else f||cd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Qt(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(GS),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&&qh(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($S),this.nodes.forEach(id);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ad);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(LS),this.nodes.forEach(FS),this.nodes.forEach(IS),this.nodes.forEach(DS)):this.nodes.forEach(ad),this.clearAllSnapshots();const a=We.now();ke.delta=It(0,1e3/60,a-ke.timestamp),ke.timestamp=a,ke.isProcessing=!0,hi.update.process(ke),hi.preRender.process(ke),hi.render.process(ke),ke.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ac.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(OS),this.sharedNodes.forEach(US)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,fe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){fe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ke(this.snapshot.measuredBox.x)&&!Ke(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=Pe()),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&&!zh(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||vn(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)),HS(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return Pe();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(YS))){const{scroll:d}=this.root;d&&(Et(a.x,d.offset.x),Et(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=Pe();if(lt(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&&lt(a,i),Et(a.x,f.offset.x),Et(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||Pe();lt(u,i);for(let h=0;h<this.path.length;h++){const m=this.path[h];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(Et(u.x,-m.scroll.offset.x),Et(u.y,-m.scroll.offset.y)),vn(m.latestValues)&&Vo(u,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return vn(this.latestValues)&&Vo(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=Pe();lt(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!vn(d.latestValues))continue;let f;d.instance&&(va(d.latestValues)&&d.updateSnapshot(),f=Pe(),lt(f,d.measurePageBox())),Zu(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return vn(this.latestValues)&&Zu(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!==ke.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=ke.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=Pe(),this.targetWithTransforms=Pe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mS(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):lt(this.target,this.layout.layoutBox),kh(this.target,this.targetDelta)):lt(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||va(this.parent.latestValues)||Dh(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=Pe(),this.relativeTargetOrigin=Pe(),ns(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),lt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===ke.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;lt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;W0(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=Pe());const{target:m}=i;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ku(this.prevProjectionDelta.x,this.projectionDelta.x),Ku(this.prevProjectionDelta.y,this.projectionDelta.y)),Tr(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!nd(this.projectionDelta.x,this.prevProjectionDelta.x)||!nd(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Xn(),this.projectionDelta=Xn(),this.projectionDeltaWithTransform=Xn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=Xn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Pe(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,g=m!==y,v=this.getStack(),x=!v||v.members.length<=1,b=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(KS));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const R=S/1e3;ld(f.x,i.x,R),ld(f.y,i.y,R),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ns(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),WS(this.relativeTarget,this.relativeTargetOrigin,h,R),w&&xS(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Pe()),lt(w,this.relativeTarget)),g&&(this.animationValues=d,CS(d,u,this.latestValues,R,b,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},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&&(Qt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=fe.update(()=>{Go.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Jn(0)),this.motionValue.jump(0,!1),this.currentAnimation=PS(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(NS),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&&Qh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Pe();const f=Ke(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=Ke(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}lt(a,c),Vo(a,d),Tr(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new AS),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&&Ci("z",i,u,this.animationValues);for(let d=0;d<wi.length;d++)Ci(`rotate${wi[d]}`,i,u,this.animationValues),Ci(`skew${wi[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=Bo(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=Bo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!vn(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=bS(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:m}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const y in ba){if(d[y]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:x}=ba[y],b=f==="none"?d[y]:g(d[y],u);if(v){const w=v.length;for(let S=0;S<w;S++)i[v[S]]=b}else x?this.options.visualElement.renderState.vars[y]=b:i[y]=b}this.options.layoutId&&(i.pointerEvents=u===this?Bo(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(id),this.root.sharedNodes.clear()}}}function IS(e){e.updateLayout()}function DS(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")Pt(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],m=Ke(h);h.min=r[f].min,h.max=h.min+m});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";wa(i?t.measuredBox[f]:t.layoutBox[f],r[f])}else Qh(s,t.layoutBox,r)&&Pt(f=>{const h=i?t.measuredBox[f]:t.layoutBox[f],m=Ke(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=Xn();Tr(a,r,t.layoutBox);const c=Xn();i?Tr(c,e.applyTransform(o,!0),t.measuredBox):Tr(c,r,t.layoutBox);const u=!zh(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const y=e.options.layoutAnchor||void 0,g=Pe();ns(g,t.layoutBox,h.layoutBox,y);const v=Pe();ns(v,r,m.layoutBox,y),Hh(g,v)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=v,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 kS(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 _S(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function OS(e){e.clearSnapshot()}function id(e){e.clearMeasurements()}function $S(e){e.isLayoutDirty=!0,e.updateLayout()}function ad(e){e.isLayoutDirty=!1}function LS(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function FS(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function cd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function VS(e){e.resolveTargetDelta()}function BS(e){e.calcProjection()}function GS(e){e.resetSkewAndRotation()}function US(e){e.removeLeadSnapshot()}function ld(e,t,n){e.translate=pe(t.translate,0,n),e.scale=pe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ud(e,t,n,r){e.min=pe(t.min,n.min,r),e.max=pe(t.max,n.max,r)}function WS(e,t,n,r){ud(e.x,t.x,n.x,r),ud(e.y,t.y,n.y,r)}function KS(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const zS={duration:.45,ease:[.4,0,.1,1]},dd=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fd=dd("applewebkit/")&&!dd("chrome/")?Math.round:it;function hd(e){e.min=fd(e.min),e.max=fd(e.max)}function HS(e){hd(e.x),hd(e.y)}function Qh(e,t,n){return e==="position"||e==="preserve-aspect"&&!pS(td(t),td(n),.2)}function YS(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const XS=Zh({attachResizeListener:(e,t)=>jr(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}),Si={current:void 0},Jh=Zh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Si.current){const e=new XS({});e.mount(window),e.setOptions({layoutScroll:!0}),Si.current=e}return Si.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Oc=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function pd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qS(...e){return t=>{let n=!1;const r=e.map(o=>{const s=pd(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():pd(e[o],null)}}}}function ZS(...e){return p.useCallback(qS(...e),e)}class QS extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Oo(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Oo(r)&&r.offsetWidth||0,s=Oo(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 JS({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=C.useId(),a=C.useRef(null),c=C.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=C.useContext(Oc),d=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=ZS(a,d);return C.useInsertionEffect(()=>{const{width:m,height:y,top:g,left:v,right:x,bottom:b}=c.current;if(t||s===!1||!a.current||!m||!y)return;const w=n==="left"?`left: ${v}`:`right: ${x}`,S=r==="bottom"?`bottom: ${b}`:`top: ${g}`;a.current.dataset.motionPopId=i;const R=document.createElement("style");u&&(R.nonce=u);const P=o??document.head;return P.appendChild(R),R.sheet&&R.sheet.insertRule(`
1
+ "use client";"use strict";var Bl=t=>{throw TypeError(t)};var Gl=(t,e,n)=>e.has(t)||Bl("Cannot "+n);var Ve=(t,e,n)=>(Gl(t,e,"read from private field"),n?n.call(t):e.get(t)),Ul=(t,e,n)=>e.has(t)?Bl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ti=(t,e,n,r)=>(Gl(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),ps=require("react-dom");function lf(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const p=lf(S),Ur=lf(ps);function Y(...t){return t.filter(Boolean).join(" ")}const uf={sm:640,md:768,lg:1024,xl:1280},ni=["base","sm","md","lg","xl"],$v=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),Lv=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Fv=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^ms-/,"-ms-"),Vv=t=>t.replace(/[<>]/g,""),Bv=(t,e)=>typeof e=="number"&&e!==0&&!$v.has(t)?`${e}px`:Vv(String(e)),zl=t=>Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>`${Fv(e)}:${Bv(e,n)};`).join(""),Gv=t=>{let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)|0;return(e>>>0).toString(36)};function Wa(t){const e={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[a,c]of Object.entries(t))if(Lv(c)){r=!0;for(const u of ni){const d=c[u];d!==void 0&&(n[u][a]=d)}}else e[a]=c;if(!r)return{style:e};Object.assign(n.base,e);const o=[];for(const a of ni){const c=zl(n[a]);c&&o.push(`${a}{${c}}`)}const s=`cny-sx-${Gv(o.join(""))}`;let i="";for(const a of ni){const c=zl(n[a]);c&&(i+=a==="base"?`.${s}{${c}}`:`@media (min-width:${uf[a]}px){.${s}{${c}}}`)}return{className:s,css:i}}function re(t,e,...n){const r=t?Wa(t):void 0;return{className:Y(...n,r==null?void 0:r.className),style:r!=null&&r.style||e?{...r==null?void 0:r.style,...e}:void 0,styleTag:r!=null&&r.css?l.jsx("style",{dangerouslySetInnerHTML:{__html:r.css}}):null}}const Ha=S.createContext({});function Ka(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const Uv=typeof window<"u",df=Uv?S.useLayoutEffect:S.useEffect,ms=S.createContext(null);function Ya(t,e){t.indexOf(e)===-1&&t.push(e)}function Jo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Nt=(t,e,n)=>n>e?e:n<t?t:n;function Ui(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let sr=()=>{},Gt=()=>{};var cf;typeof process<"u"&&((cf=process.env)==null?void 0:cf.NODE_ENV)!=="production"&&(sr=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(Ui(e,n))},Gt=(t,e,n)=>{if(!t)throw new Error(Ui(e,n))});const on={},ff=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function hf(t){return typeof t=="object"&&t!==null}const pf=t=>/^0[^.\s]+$/u.test(t);function mf(t){let e;return()=>(e===void 0&&(e=t()),e)}const dt=t=>t,zv=(t,e)=>n=>e(t(n)),zr=(...t)=>t.reduce(zv),Ar=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Xa{constructor(){this.subscriptions=[]}add(e){return Ya(this.subscriptions,e),()=>Jo(this.subscriptions,e)}notify(e,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](e,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Xe=t=>t*1e3,ut=t=>t/1e3;function gf(t,e){return e?t*(1e3/e):0}const Wl=new Set;function qa(t,e,n){t||Wl.has(e)||(console.warn(Ui(e,n)),Wl.add(e))}const yf=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Wv=1e-7,Hv=12;function Kv(t,e,n,r,o){let s,i,a=0;do i=e+(n-e)/2,s=yf(i,r,o)-t,s>0?n=i:e=i;while(Math.abs(s)>Wv&&++a<Hv);return i}function Wr(t,e,n,r){if(t===e&&n===r)return dt;const o=s=>Kv(s,0,1,t,n);return s=>s===0||s===1?s:yf(o(s),e,r)}const vf=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xf=t=>e=>1-t(1-e),bf=Wr(.33,1.53,.69,.99),Za=xf(bf),wf=vf(Za),Cf=t=>t>=1?1:(t*=2)<1?.5*Za(t):.5*(2-Math.pow(2,-10*(t-1))),Qa=t=>1-Math.sin(Math.acos(t)),Sf=xf(Qa),Pf=vf(Qa),Yv=Wr(.42,0,1,1),Xv=Wr(0,0,.58,1),Rf=Wr(.42,0,.58,1),qv=t=>Array.isArray(t)&&typeof t[0]!="number",Tf=t=>Array.isArray(t)&&typeof t[0]=="number",Hl={linear:dt,easeIn:Yv,easeInOut:Rf,easeOut:Xv,circIn:Qa,circInOut:Pf,circOut:Sf,backIn:Za,backInOut:wf,backOut:bf,anticipate:Cf},Zv=t=>typeof t=="string",Kl=t=>{if(Tf(t)){Gt(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,o]=t;return Wr(e,n,r,o)}else if(Zv(t))return Gt(Hl[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Hl[t];return t},vo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qv(t,e){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const y=h&&o?n:r;return f&&i.add(d),y.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 Jv=40;function Mf(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=vo.reduce((b,C)=>(b[C]=Qv(s),b),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:m,postRender:y}=i,g=()=>{const b=on.useManualTiming,C=b?o.timestamp:performance.now();n=!1,b||(o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,Jv),1)),o.timestamp=C,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),m.process(o),y.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(g))},v=()=>{n=!0,r=!0,o.isProcessing||t(g)};return{schedule:vo.reduce((b,C)=>{const P=i[C];return b[C]=(R,M=!1,j=!1)=>(n||v(),P.schedule(R,M,j)),b},{}),cancel:b=>{for(let C=0;C<vo.length;C++)i[vo[C]].cancel(b)},state:o,steps:i}}const{schedule:pe,cancel:sn,state:_e,steps:ri}=Mf(typeof requestAnimationFrame<"u"?requestAnimationFrame:dt,!0);let Fo;function ex(){Fo=void 0}const ze={now:()=>(Fo===void 0&&ze.set(_e.isProcessing||on.useManualTiming?_e.timestamp:performance.now()),Fo),set:t=>{Fo=t,queueMicrotask(ex)}},Ef=t=>e=>typeof e=="string"&&e.startsWith(t),jf=Ef("--"),tx=Ef("var(--"),Ja=t=>tx(t)?nx.test(t.split("/*")[0].trim()):!1,nx=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yl(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const ir={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Dr={...ir,transform:t=>Nt(0,1,t)},xo={...ir,default:1},Rr=t=>Math.round(t*1e5)/1e5,ec=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rx(t){return t==null}const ox=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tc=(t,e)=>n=>!!(typeof n=="string"&&ox.test(n)&&n.startsWith(t)||e&&!rx(n)&&Object.prototype.hasOwnProperty.call(n,e)),Af=(t,e,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(ec);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},sx=t=>Nt(0,255,t),oi={...ir,transform:t=>Math.round(sx(t))},Pn={test:tc("rgb","red"),parse:Af("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+oi.transform(t)+", "+oi.transform(e)+", "+oi.transform(n)+", "+Rr(Dr.transform(r))+")"};function ix(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const zi={test:tc("#"),parse:ix,transform:Pn.transform},Hr=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Jt=Hr("deg"),Dt=Hr("%"),te=Hr("px"),ax=Hr("vh"),cx=Hr("vw"),Xl={...Dt,parse:t=>Dt.parse(t)/100,transform:t=>Dt.transform(t*100)},Yn={test:tc("hsl","hue"),parse:Af("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Dt.transform(Rr(e))+", "+Dt.transform(Rr(n))+", "+Rr(Dr.transform(r))+")"},Re={test:t=>Pn.test(t)||zi.test(t)||Yn.test(t),parse:t=>Pn.test(t)?Pn.parse(t):Yn.test(t)?Yn.parse(t):zi.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Pn.transform(t):Yn.transform(t),getAnimatableNone:t=>{const e=Re.parse(t);return e.alpha=0,Re.transform(e)}},lx=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ux(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ec))==null?void 0:e.length)||0)+(((n=t.match(lx))==null?void 0:n.length)||0)>0}const Df="number",If="color",dx="var",fx="var(",ql="${}",hx=/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 er(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=e.replace(hx,c=>(Re.test(c)?(r.color.push(s),o.push(If),n.push(Re.parse(c))):c.startsWith(fx)?(r.var.push(s),o.push(dx),n.push(c)):(r.number.push(s),o.push(Df),n.push(parseFloat(c))),++s,ql)).split(ql);return{values:n,split:a,indexes:r,types:o}}function px(t){return er(t).values}function Nf({split:t,types:e}){const n=t.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],r[s]!==void 0){const i=e[s];i===Df?o+=Rr(r[s]):i===If?o+=Re.transform(r[s]):o+=r[s]}return o}}function mx(t){return Nf(er(t))}const gx=t=>typeof t=="number"?0:Re.test(t)?Re.getAnimatableNone(t):t,yx=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:gx(t);function vx(t){const e=er(t);return Nf(e)(e.values.map((r,o)=>yx(r,e.split[o])))}const gt={test:ux,parse:px,createTransformer:mx,getAnimatableNone:vx};function si(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function xx({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let o=0,s=0,i=0;if(!e)o=s=i=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;o=si(c,a,t+1/3),s=si(c,a,t),i=si(c,a,t-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function es(t,e){return n=>n>0?e:t}const ge=(t,e,n)=>t+(e-t)*n,ii=(t,e,n)=>{const r=t*t,o=n*(e*e-r)+r;return o<0?0:Math.sqrt(o)},bx=[zi,Pn,Yn],wx=t=>bx.find(e=>e.test(t));function Zl(t){const e=wx(t);if(sr(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===Yn&&(n=xx(n)),n}const Ql=(t,e)=>{const n=Zl(t),r=Zl(e);if(!n||!r)return es(t,e);const o={...n};return s=>(o.red=ii(n.red,r.red,s),o.green=ii(n.green,r.green,s),o.blue=ii(n.blue,r.blue,s),o.alpha=ge(n.alpha,r.alpha,s),Pn.transform(o))},Wi=new Set(["none","hidden"]);function Cx(t,e){return Wi.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Sx(t,e){return n=>ge(t,e,n)}function nc(t){return typeof t=="number"?Sx:typeof t=="string"?Ja(t)?es:Re.test(t)?Ql:Tx:Array.isArray(t)?kf:typeof t=="object"?Re.test(t)?Ql:Px:es}function kf(t,e){const n=[...t],r=n.length,o=t.map((s,i)=>nc(s)(s,e[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Px(t,e){const n={...t,...e},r={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(r[o]=nc(t[o])(t[o],e[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Rx(t,e){const n=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],i=t.indexes[s][r[s]],a=t.values[i]??0;n[o]=a,r[s]++}return n}const Tx=(t,e)=>{const n=gt.createTransformer(e),r=er(t),o=er(e);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Wi.has(t)&&!o.values.length||Wi.has(e)&&!r.values.length?Cx(t,e):zr(kf(Rx(r,o),o.values),n):(sr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),es(t,e))};function _f(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ge(t,e,n):nc(t)(t,e)}const Mx=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>pe.update(e,n),stop:()=>sn(e),now:()=>_e.isProcessing?_e.timestamp:ze.now()}},Of=(t,e,n=10)=>{let r="";const o=Math.max(Math.round(e/n),2);for(let s=0;s<o;s++)r+=Math.round(t(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},ts=2e4;function rc(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<ts;)e+=n,r=t.next(e);return e>=ts?1/0:e}function Ex(t,e=100,n){const r=n({...t,keyframes:[0,e]}),o=Math.min(rc(r),ts);return{type:"keyframes",ease:s=>r.next(o*s).value/e,duration:ut(o)}}const ve={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 Hi(t,e){return t*Math.sqrt(1-e*e)}const jx=12;function Ax(t,e,n){let r=n;for(let o=1;o<jx;o++)r=r-t(r)/e(r);return r}const ai=.001;function Dx({duration:t=ve.duration,bounce:e=ve.bounce,velocity:n=ve.velocity,mass:r=ve.mass}){let o,s;sr(t<=Xe(ve.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-e;i=Nt(ve.minDamping,ve.maxDamping,i),t=Nt(ve.minDuration,ve.maxDuration,ut(t)),i<1?(o=u=>{const d=u*i,f=d*t,h=d-n,m=Hi(u,i),y=Math.exp(-f);return ai-h/m*y},s=u=>{const f=u*i*t,h=f*n+n,m=Math.pow(i,2)*Math.pow(u,2)*t,y=Math.exp(-f),g=Hi(Math.pow(u,2),i);return(-o(u)+ai>0?-1:1)*((h-m)*y)/g}):(o=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-ai+d*f},s=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const a=5/t,c=Ax(o,s,a);if(t=Xe(t),isNaN(c))return{stiffness:ve.stiffness,damping:ve.damping,duration:t};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:t}}}const Ix=["duration","bounce"],Nx=["stiffness","damping","mass"];function Jl(t,e){return e.some(n=>t[n]!==void 0)}function kx(t){let e={velocity:ve.velocity,stiffness:ve.stiffness,damping:ve.damping,mass:ve.mass,isResolvedFromDuration:!1,...t};if(!Jl(t,Nx)&&Jl(t,Ix))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*Nt(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:ve.mass,stiffness:o,damping:s}}else{const n=Dx({...t,velocity:0});e={...e,...n,mass:ve.mass},e.isResolvedFromDuration=!0}return e}function ns(t=ve.visualDuration,e=ve.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=kx({...n,velocity:-ut(n.velocity||0)}),y=h||0,g=u/(2*Math.sqrt(c*d)),v=i-s,x=ut(Math.sqrt(c/d)),w=Math.abs(v)<5;r||(r=w?ve.restSpeed.granular:ve.restSpeed.default),o||(o=w?ve.restDelta.granular:ve.restDelta.default);let b,C,P,R,M,j;if(g<1)P=Hi(x,g),R=(y+g*x*v)/P,b=E=>{const N=Math.exp(-g*x*E);return i-N*(R*Math.sin(P*E)+v*Math.cos(P*E))},M=g*x*R+v*P,j=g*x*v-R*P,C=E=>Math.exp(-g*x*E)*(M*Math.sin(P*E)+j*Math.cos(P*E));else if(g===1){b=N=>i-Math.exp(-x*N)*(v+(y+x*v)*N);const E=y+x*v;C=N=>Math.exp(-x*N)*(x*E*N-y)}else{const E=x*Math.sqrt(g*g-1);b=U=>{const J=Math.exp(-g*x*U),z=Math.min(E*U,300);return i-J*((y+g*x*v)*Math.sinh(z)+E*v*Math.cosh(z))/E};const N=(y+g*x*v)/E,_=g*x*N-v*E,F=g*x*v-N*E;C=U=>{const J=Math.exp(-g*x*U),z=Math.min(E*U,300);return J*(_*Math.sinh(z)+F*Math.cosh(z))}}const T={calculatedDuration:m&&f||null,velocity:E=>Xe(C(E)),next:E=>{if(!m&&g<1){const _=Math.exp(-g*x*E),F=Math.sin(P*E),U=Math.cos(P*E),J=i-_*(R*F+v*U),z=Xe(_*(M*F+j*U));return a.done=Math.abs(z)<=r&&Math.abs(i-J)<=o,a.value=a.done?i:J,a}const N=b(E);if(m)a.done=E>=f;else{const _=Xe(C(E));a.done=Math.abs(_)<=r&&Math.abs(i-N)<=o}return a.value=a.done?i:N,a},toString:()=>{const E=Math.min(rc(T),ts),N=Of(_=>T.next(E*_).value,E,30);return E+"ms "+N},toTransition:()=>{}};return T}ns.applyToOptions=t=>{const e=Ex(t,100,ns);return t.ease=e.ease,t.duration=Xe(e.duration),t.type="keyframes",t};const _x=5;function $f(t,e,n){const r=Math.max(e-_x,0);return gf(n-t(r),e-r)}function Ki({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=t[0],h={done:!1,value:f},m=j=>a!==void 0&&j<a||c!==void 0&&j>c,y=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let g=n*e;const v=f+g,x=i===void 0?v:i(v);x!==v&&(g=x-f);const w=j=>-g*Math.exp(-j/r),b=j=>x+w(j),C=j=>{const T=w(j),E=b(j);h.done=Math.abs(T)<=u,h.value=h.done?x:E};let P,R;const M=j=>{m(h.value)&&(P=j,R=ns({keyframes:[h.value,y(h.value)],velocity:$f(b,j,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return M(0),{calculatedDuration:null,next:j=>{let T=!1;return!R&&P===void 0&&(T=!0,C(j),M(j)),P!==void 0&&j>=P?R.next(j-P):(!T&&C(j),h)}}}function Ox(t,e,n){const r=[],o=n||on.mix||_f,s=t.length-1;for(let i=0;i<s;i++){let a=o(t[i],t[i+1]);if(e){const c=Array.isArray(e)?e[i]||dt:e;a=zr(c,a)}r.push(a)}return r}function $x(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;if(Gt(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const i=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Ox(e,r,o),c=a.length,u=d=>{if(i&&d<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const h=Ar(t[f],t[f+1],d);return a[f](h)};return n?d=>u(Nt(t[0],t[s-1],d)):u}function Lx(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=Ar(0,e,r);t.push(ge(n,1,o))}}function Fx(t){const e=[0];return Lx(e,t.length-1),e}function Vx(t,e){return t.map(n=>n*e)}function Bx(t,e){return t.map(()=>e||Rf).splice(0,t.length-1)}function Xn({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=qv(r)?r.map(Kl):Kl(r),s={done:!1,value:e[0]},i=Vx(n&&n.length===e.length?n:Fx(e),t),a=$x(i,e,{ease:Array.isArray(o)?o:Bx(e,o)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const Gx=t=>t!==null;function gs(t,{repeat:e,repeatType:n="loop"},r,o=1){const s=t.filter(Gx),a=o<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Ux={decay:Ki,inertia:Ki,tween:Xn,keyframes:Xn,spring:ns};function Lf(t){typeof t.type=="string"&&(t.type=Ux[t.type])}class oc{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const zx=t=>t/100;class rs extends oc{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==ze.now()&&this.tick(ze.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Lf(e);const{type:n=Xn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=e;let{keyframes:a}=e;const c=n||Xn;process.env.NODE_ENV!=="production"&&c!==Xn&&Gt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Xn&&typeof a[0]!="number"&&(this.mixKeyframes=zr(zx,_f(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=rc(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:m,type:y,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-o/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let b=this.currentTime,C=r;if(f){const j=Math.min(this.currentTime,o)/a;let T=Math.floor(j),E=j%1;!E&&j>=1&&(E=1),E===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(h==="reverse"?(E=1-E,m&&(E-=m/a)):h==="mirror"&&(C=i)),b=Nt(0,1,E)*a}let P;w?(this.delayState.value=d[0],P=this.delayState):P=C.next(b),s&&!w&&(P.value=s(P.value));let{done:R}=P;!w&&c!==null&&(R=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return M&&y!==Ki&&(P.value=gs(d,this.options,v,this.speed)),g&&g(P.value),M&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return ut(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ut(e)}get time(){return ut(this.currentTime)}set time(e){e=Xe(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return $f(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(ze.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ut(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:e=Mx,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ze.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Wx(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Rn=t=>t*180/Math.PI,Yi=t=>{const e=Rn(Math.atan2(t[1],t[0]));return Xi(e)},Hx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Yi,rotateZ:Yi,skewX:t=>Rn(Math.atan(t[1])),skewY:t=>Rn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Xi=t=>(t=t%360,t<0&&(t+=360),t),eu=Yi,tu=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),nu=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Kx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tu,scaleY:nu,scale:t=>(tu(t)+nu(t))/2,rotateX:t=>Xi(Rn(Math.atan2(t[6],t[5]))),rotateY:t=>Xi(Rn(Math.atan2(-t[2],t[0]))),rotateZ:eu,rotate:eu,skewX:t=>Rn(Math.atan(t[4])),skewY:t=>Rn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function qi(t){return t.includes("scale")?1:0}function Zi(t,e){if(!t||t==="none")return qi(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=Kx,o=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Hx,o=a}if(!o)return qi(e);const s=r[e],i=o[1].split(",").map(Xx);return typeof s=="function"?s(i):i[s]}const Yx=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Zi(n,e)};function Xx(t){return parseFloat(t.trim())}const ar=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cr=new Set(ar),ru=t=>t===ir||t===te,qx=new Set(["x","y","z"]),Zx=ar.filter(t=>!qx.has(t));function Qx(t){const e=[];return Zx.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const nn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Zi(e,"x"),y:(t,{transform:e})=>Zi(e,"y")};nn.translateX=nn.x;nn.translateY=nn.y;const Tn=new Set;let Qi=!1,Ji=!1,ea=!1;function Ff(){if(Ji){const t=Array.from(Tn).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const o=Qx(r);o.length&&(n.set(r,o),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ji=!1,Qi=!1,Tn.forEach(t=>t.complete(ea)),Tn.clear()}function Vf(){Tn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ji=!0)})}function Jx(){ea=!0,Vf(),Ff(),ea=!1}class sc{constructor(e,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Tn.add(this),Qi||(Qi=!0,pe.read(Vf),pe.resolveKeyframes(Ff))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:o}=this;if(e[0]===null){const s=o==null?void 0:o.get(),i=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=i),o&&s===void 0&&o.set(e[0])}Wx(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Tn.delete(this)}cancel(){this.state==="scheduled"&&(Tn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const eb=t=>t.startsWith("--");function Bf(t,e,n){eb(e)?t.style.setProperty(e,n):t.style[e]=n}const tb={};function Gf(t,e){const n=mf(t);return()=>tb[e]??n()}const nb=Gf(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Uf=Gf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,ou={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sr([0,.65,.55,1]),circOut:Sr([.55,0,1,.45]),backIn:Sr([.31,.01,.66,-.59]),backOut:Sr([.33,1.53,.69,.99])};function zf(t,e){if(t)return typeof t=="function"?Uf()?Of(t,e):"ease-out":Tf(t)?Sr(t):Array.isArray(t)?t.map(n=>zf(n,e)||ou.easeOut):ou[t]}function rb(t,e,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const f=zf(a,o);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(d,h)}function Wf(t){return typeof t=="function"&&"applyToOptions"in t}function ob({type:t,...e}){return Wf(t)&&Uf()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Hf extends oc{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=e,Gt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=ob(e);this.animation=rb(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=gs(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Bf(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,o;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ut(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ut(e)}get time(){return ut(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Xe(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&nb()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),dt):o(this)}}const Kf={anticipate:Cf,backInOut:wf,circInOut:Pf};function sb(t){return t in Kf}function ib(t){typeof t.ease=="string"&&sb(t.ease)&&(t.ease=Kf[t.ease])}const ci=10;class ab extends Hf{constructor(e){ib(e),Lf(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new rs({...i,autoplay:!1}),c=Math.max(ci,ze.now()-this.startTime),u=Nt(0,ci,c-ci),d=a.sample(c).value,{name:f}=this.options;s&&f&&Bf(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const su=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gt.test(t)||t==="0")&&!t.startsWith("url("));function cb(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function lb(t,e,n,r){const o=t[0];if(o===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],i=su(o,e),a=su(s,e);return sr(i===a,`You are trying to animate ${e} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:cb(t)||(n==="spring"||Wf(n))&&r}function ta(t){t.duration=0,t.type="keyframes"}const Yf=new Set(["opacity","clipPath","filter","transform"]),ub=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function db(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&ub.test(t[e]))return!0;return!1}const fb=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),hb=mf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function pb(t){var f;const{motionValue:e,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=t;if(!(((f=e==null?void 0:e.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return hb()&&n&&(Yf.has(n)||fb.has(n)&&db(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const mb=40;class gb extends oc{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:d,...f}){var y;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=ze.now();const h={autoplay:e,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},m=(d==null?void 0:d.KeyframeResolver)||sc;this.keyframeResolver=new m(a,(g,v,x)=>this.onKeyframesResolved(g,v,h,!x),c,u,d),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,n,r,o){var x,w;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=ze.now();let f=!0;lb(e,s,i,a)||(f=!1,(on.instantAnimations||!c)&&(d==null||d(gs(e,r,n))),e[0]=e[e.length-1],ta(r),r.repeat=0);const m={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>mb?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},y=f&&!u&&pb(m),g=(w=(x=m.motionValue)==null?void 0:x.owner)==null?void 0:w.current;let v;if(y)try{v=new ab({...m,element:g})}catch{v=new rs(m)}else v=new rs(m);v.finished.then(()=>{this.notifyFinished()}).catch(dt),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Jx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Xf(t,e,n,r=0,o=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),i=t.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const yb=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vb(t){const e=yb.exec(t);if(!e)return[,];const[,n,r,o]=e;return[`--${n??r}`,o]}const xb=4;function qf(t,e,n=1){Gt(n<=xb,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=vb(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const i=s.trim();return ff(i)?parseFloat(i):i}return Ja(o)?qf(o,e,n+1):o}const bb={type:"spring",stiffness:500,damping:25,restSpeed:10},wb=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Cb={type:"keyframes",duration:.8},Sb={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pb=(t,{keyframes:e})=>e.length>2?Cb:cr.has(t)?t.startsWith("scale")?wb(e[1]):bb:Sb;function Zf(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function ic(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Zf(n,t):n}const Rb=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Tb(t){for(const e in t)if(!Rb.has(e))return!0;return!1}const ac=(t,e,n,r={},o,s)=>i=>{const a=ic(r,t)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Xe(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};Tb(a)||Object.assign(d,Pb(t,d)),d.duration&&(d.duration=Xe(d.duration)),d.repeatDelay&&(d.repeatDelay=Xe(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(ta(d),d.delay===0&&(f=!0)),(on.instantAnimations||on.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,ta(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&e.get()!==void 0){const h=gs(d.keyframes,a);if(h!==void 0){pe.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new rs(d):new gb(d)};function iu(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function cc(t,e,n,r){if(typeof e=="function"){const[o,s]=iu(r);e=e(n!==void 0?n:t.custom,o,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[o,s]=iu(r);e=e(n!==void 0?n:t.custom,o,s)}return e}function Mn(t,e,n){const r=t.getProps();return cc(r,e,n!==void 0?n:r.custom,t)}const Qf=new Set(["width","height","top","left","right","bottom",...ar]),au=30,Mb=t=>!isNaN(parseFloat(t));class Eb{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=ze.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ze.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Mb(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&qa(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Xa);const r=this.events[e].add(n);return e==="change"?()=>{r(),pe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ze.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>au)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,au);return gf(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tr(t,e){return new Eb(t,e)}const na=t=>Array.isArray(t);function jb(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,tr(n))}function Ab(t){return na(t)?t[t.length-1]||0:t}function Db(t,e){const n=Mn(t,e);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=Ab(s[i]);jb(t,i,a)}}const Oe=t=>!!(t&&t.getVelocity);function Ib(t){return!!(Oe(t)&&t.add)}function ra(t,e){const n=t.getValue("willChange");if(Ib(n))return n.add(e);if(!n&&on.WillChange){const r=new on.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function lc(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Nb="framerAppearId",Jf="data-"+lc(Nb);function eh(t){return t.props[Jf]}function kb({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function th(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=e;const c=t.getDefaultTransition();s=s?Zf(s,c):c;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&t.animationState&&t.animationState.getState()[o];for(const h in a){const m=t.getValue(h,t.latestValues[h]??null),y=a[h];if(y===void 0||f&&kb(f,h))continue;const g={delay:n,...ic(s||{},h)},v=m.get();if(v!==void 0&&!m.isAnimating()&&!Array.isArray(y)&&y===v&&!g.velocity){pe.update(()=>m.set(y));continue}let x=!1;if(window.MotionHandoffAnimation){const C=eh(t);if(C){const P=window.MotionHandoffAnimation(C,h,pe);P!==null&&(g.startTime=P,x=!0)}}ra(t,h);const w=u??t.shouldReduceMotion;m.start(ac(h,m,y,w&&Qf.has(h)?{type:!1}:g,t,x));const b=m.animation;b&&d.push(b)}if(i){const h=()=>pe.update(()=>{i&&Db(t,i)});d.length?Promise.all(d).then(h):h()}return d}function oa(t,e,n={}){var c;const r=Mn(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(th(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return _b(t,e,u,d,f,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[u,d]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(n.delay)])}function _b(t,e,n=0,r=0,o=0,s=1,i){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(oa(c,e,{...i,delay:n+(typeof r=="function"?0:r)+Xf(t.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Ob(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const o=e.map(s=>oa(t,s,n));r=Promise.all(o)}else if(typeof e=="string")r=oa(t,e,n);else{const o=typeof e=="function"?Mn(t,e,n.custom):e;r=Promise.all(th(t,o,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const $b={test:t=>t==="auto",parse:t=>t},nh=t=>e=>e.test(t),rh=[ir,te,Dt,Jt,cx,ax,$b],cu=t=>rh.find(nh(t));function Lb(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||pf(t):!0}const Fb=new Set(["brightness","contrast","saturate","opacity"]);function Vb(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(ec)||[];if(!r)return t;const o=n.replace(r,"");let s=Fb.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const Bb=/\b([a-z-]*)\(.*?\)/gu,sa={...gt,getAnimatableNone:t=>{const e=t.match(Bb);return e?e.map(Vb).join(" "):t}},ia={...gt,getAnimatableNone:t=>{const e=gt.parse(t);return gt.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},lu={...ir,transform:Math.round},Gb={rotate:Jt,rotateX:Jt,rotateY:Jt,rotateZ:Jt,scale:xo,scaleX:xo,scaleY:xo,scaleZ:xo,skew:Jt,skewX:Jt,skewY:Jt,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:Dr,originX:Xl,originY:Xl,originZ:te},uc={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,inset:te,insetBlock:te,insetBlockStart:te,insetBlockEnd:te,insetInline:te,insetInlineStart:te,insetInlineEnd:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,paddingBlock:te,paddingBlockStart:te,paddingBlockEnd:te,paddingInline:te,paddingInlineStart:te,paddingInlineEnd:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,marginBlock:te,marginBlockStart:te,marginBlockEnd:te,marginInline:te,marginInlineStart:te,marginInlineEnd:te,fontSize:te,backgroundPositionX:te,backgroundPositionY:te,...Gb,zIndex:lu,fillOpacity:Dr,strokeOpacity:Dr,numOctaves:lu},Ub={...uc,color:Re,backgroundColor:Re,outlineColor:Re,fill:Re,stroke:Re,borderColor:Re,borderTopColor:Re,borderRightColor:Re,borderBottomColor:Re,borderLeftColor:Re,filter:sa,WebkitFilter:sa,mask:ia,WebkitMask:ia},oh=t=>Ub[t],zb=new Set([sa,ia]);function sh(t,e){let n=oh(t);return zb.has(n)||(n=gt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Wb=new Set(["auto","none","0"]);function Hb(t,e,n){let r=0,o;for(;r<t.length&&!o;){const s=t[r];typeof s=="string"&&!Wb.has(s)&&er(s).values.length&&(o=t[r]),r++}if(o&&n)for(const s of e)t[s]=sh(n,o)}class Kb extends sc{constructor(e,n,r,o,s){super(e,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let f=e[d];if(typeof f=="string"&&(f=f.trim(),Ja(f))){const h=qf(f,n.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Qf.has(r)||e.length!==2)return;const[o,s]=e,i=cu(o),a=cu(s),c=Yl(o),u=Yl(s);if(c!==u&&nn[r]){this.needsMeasurement=!0;return}if(i!==a)if(ru(i)&&ru(a))for(let d=0;d<e.length;d++){const f=e[d];typeof f=="string"&&(e[d]=parseFloat(f))}else nn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let o=0;o<e.length;o++)(e[o]===null||Lb(e[o]))&&r.push(o);r.length&&Hb(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nn[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&e.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const o=e.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=nn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function ih(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const o=(n==null?void 0:n[t])??r.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(r=>r!=null)}const ah=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Vo(t){return hf(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:dc}=Mf(queueMicrotask,!1),pt={x:!1,y:!1};function ch(){return pt.x||pt.y}function Yb(t){return t==="x"||t==="y"?pt[t]?null:(pt[t]=!0,()=>{pt[t]=!1}):pt.x||pt.y?null:(pt.x=pt.y=!0,()=>{pt.x=pt.y=!1})}function lh(t,e){const n=ih(t),r=new AbortController,o={passive:!0,...e,signal:r.signal};return[n,o,()=>r.abort()]}function Xb(t){return!(t.pointerType==="touch"||ch())}function qb(t,e,n={}){const[r,o,s]=lh(t,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",y)},f=v=>{u&&(u(v),u=void 0),d()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(v))},m=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},y=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}f(v)}},g=v=>{if(!Xb(v))return;c=!1;const x=e(i,v);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",y,o))};i.addEventListener("pointerenter",g,o),i.addEventListener("pointerdown",m,o)}),s}const uh=(t,e)=>e?t===e?!0:uh(t,e.parentElement):!1,fc=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Zb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Qb(t){return Zb.has(t.tagName)||t.isContentEditable===!0}const Jb=new Set(["INPUT","SELECT","TEXTAREA"]);function ew(t){return Jb.has(t.tagName)||t.isContentEditable===!0}const Bo=new WeakSet;function uu(t){return e=>{e.key==="Enter"&&t(e)}}function li(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const tw=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=uu(()=>{if(Bo.has(n))return;li(n,"down");const o=uu(()=>{li(n,"up")}),s=()=>li(n,"cancel");n.addEventListener("keyup",o,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function du(t){return fc(t)&&!ch()}const fu=new WeakSet;function nw(t,e,n={}){const[r,o,s]=lh(t,n),i=a=>{const c=a.currentTarget;if(!du(a)||fu.has(a))return;Bo.add(c),n.stopPropagation&&fu.add(a);const u=e(c,a),d=(m,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Bo.has(c)&&Bo.delete(c),du(m)&&typeof u=="function"&&u(m,{success:y})},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||uh(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Vo(a)&&(a.addEventListener("focus",u=>tw(u,o)),!Qb(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function hc(t){return hf(t)&&"ownerSVGElement"in t}const Go=new WeakMap;let en;const dh=(t,e,n)=>(r,o)=>o&&o[0]?o[0][t+"Size"]:hc(r)&&"getBBox"in r?r.getBBox()[e]:r[n],rw=dh("inline","width","offsetWidth"),ow=dh("block","height","offsetHeight");function sw({target:t,borderBoxSize:e}){var n;(n=Go.get(t))==null||n.forEach(r=>{r(t,{get width(){return rw(t,e)},get height(){return ow(t,e)}})})}function iw(t){t.forEach(sw)}function aw(){typeof ResizeObserver>"u"||(en=new ResizeObserver(iw))}function cw(t,e){en||aw();const n=ih(t);return n.forEach(r=>{let o=Go.get(r);o||(o=new Set,Go.set(r,o)),o.add(e),en==null||en.observe(r)}),()=>{n.forEach(r=>{const o=Go.get(r);o==null||o.delete(e),o!=null&&o.size||en==null||en.unobserve(r)})}}const Uo=new Set;let qn;function lw(){qn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Uo.forEach(e=>e(t))},window.addEventListener("resize",qn)}function uw(t){return Uo.add(t),qn||lw(),()=>{Uo.delete(t),!Uo.size&&typeof qn=="function"&&(window.removeEventListener("resize",qn),qn=void 0)}}function hu(t,e){return typeof t=="function"?uw(t):cw(t,e)}function dw(t){return hc(t)&&t.tagName==="svg"}const fw=[...rh,Re,gt],hw=t=>fw.find(nh(t)),pu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Zn=()=>({x:pu(),y:pu()}),mu=()=>({min:0,max:0}),Ee=()=>({x:mu(),y:mu()}),pw=new WeakMap;function ys(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ir(t){return typeof t=="string"||Array.isArray(t)}const pc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mc=["initial",...pc];function vs(t){return ys(t.animate)||mc.some(e=>Ir(t[e]))}function fh(t){return!!(vs(t)||t.variants)}function mw(t,e,n){for(const r in e){const o=e[r],s=n[r];if(Oe(o))t.addValue(r,o);else if(Oe(s))t.addValue(r,tr(o,{owner:t}));else if(s!==o)if(t.hasValue(r)){const i=t.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=t.getStaticValue(r);t.addValue(r,tr(i!==void 0?i:o,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const aa={current:null},hh={current:!1},gw=typeof window<"u";function yw(){if(hh.current=!0,!!gw)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>aa.current=t.matches;t.addEventListener("change",e),e()}else aa.current=!1}const gu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let os={};function ph(t){os=t}function vw(){return os}class xw{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=sc,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=ze.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,pe.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=vs(n),this.isVariantNode=fh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];u[m]!==void 0&&Oe(y)&&y.set(u[m])}}mount(e){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=e,pw.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hh.current||yw(),this.shouldReduceMotion=aa.current),process.env.NODE_ENV!=="production"&&qa(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),sn(this.notifyUpdate),sn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Yf.has(e)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new Hf({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:Xe(d)}),h=i(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const r=cr.has(e);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[e]=i,this.props.onUpdate&&pe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in os){const n=os[e];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[e]&&o&&r(this.props)&&(this.features[e]=new o(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ee()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<gu.length;r++){const o=gu[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=e[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=mw(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=tr(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(ff(r)||pf(r))?r=parseFloat(r):!hw(r)&&gt.test(n)&&(r=sh(e,n)),this.setBaseTarget(e,Oe(r)?r.get():r)),Oe(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=cc(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[e])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!Oe(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Xa),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){dc.render(this.render)}}class mh extends xw{constructor(){super(...arguments),this.KeyframeResolver=Kb}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Oe(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class hn{constructor(e){this.isMounted=!1,this.node=e}update(){}}function gh({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function bw({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ww(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ui(t){return t===void 0||t===1}function ca({scale:t,scaleX:e,scaleY:n}){return!ui(t)||!ui(e)||!ui(n)}function Sn(t){return ca(t)||yh(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function yh(t){return yu(t.x)||yu(t.y)}function yu(t){return t&&t!=="0%"}function ss(t,e,n){const r=t-n,o=e*r;return n+o}function vu(t,e,n,r,o){return o!==void 0&&(t=ss(t,o,r)),ss(t,n,r)+e}function la(t,e=0,n=1,r,o){t.min=vu(t.min,e,n,r,o),t.max=vu(t.max,e,n,r,o)}function vh(t,{x:e,y:n}){la(t.x,e.translate,e.scale,e.originPoint),la(t.y,n.translate,n.scale,n.originPoint)}const xu=.999999999999,bu=1.0000000000001;function Cw(t,e,n,r=!1){var a;const o=n.length;if(!o)return;e.x=e.y=1;let s,i;for(let c=0;c<o;c++){s=n[c],i=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Et(t.x,-s.scroll.offset.x),Et(t.y,-s.scroll.offset.y)),i&&(e.x*=i.x.scale,e.y*=i.y.scale,vh(t,i)),r&&Sn(s.latestValues)&&zo(t,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}e.x<bu&&e.x>xu&&(e.x=1),e.y<bu&&e.y>xu&&(e.y=1)}function Et(t,e){t.min+=e,t.max+=e}function wu(t,e,n,r,o=.5){const s=ge(t.min,t.max,o);la(t,e,n,s,r)}function Cu(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function zo(t,e,n){const r=n??t;wu(t.x,Cu(e.x,r.x),e.scaleX,e.scale,e.originX),wu(t.y,Cu(e.y,r.y),e.scaleY,e.scale,e.originY)}function xh(t,e){return gh(ww(t.getBoundingClientRect(),e))}function Sw(t,e,n){const r=xh(t,n),{scroll:o}=e;return o&&(Et(r.x,o.offset.x),Et(r.y,o.offset.y)),r}const Pw={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rw=ar.length;function Tw(t,e,n){let r="",o=!0;for(let s=0;s<Rw;s++){const i=ar[s],a=t[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const u=parseFloat(a);c=i.startsWith("scale")?u===1:u===0}if(!c||n){const u=ah(a,uc[i]);if(!c){o=!1;const d=Pw[i]||i;r+=`${d}(${u}) `}n&&(e[i]=u)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}function gc(t,e,n){const{style:r,vars:o,transformOrigin:s}=t;let i=!1,a=!1;for(const c in e){const u=e[c];if(cr.has(c)){i=!0;continue}else if(jf(c)){o[c]=u;continue}else{const d=ah(u,uc[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(e.transform||(i||n?r.transform=Tw(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function bh(t,{style:e,vars:n},r,o){const s=t.style;let i;for(i in e)s[i]=e[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function Su(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wr={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(te.test(t))t=parseFloat(t);else return t;const n=Su(t,e.target.x),r=Su(t,e.target.y);return`${n}% ${r}%`}},Mw={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=gt.parse(t);if(o.length>5)return r;const s=gt.createTransformer(t),i=typeof o[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;o[0+i]/=a,o[1+i]/=c;const u=ge(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},ua={borderRadius:{...wr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wr,borderTopRightRadius:wr,borderBottomLeftRadius:wr,borderBottomRightRadius:wr,boxShadow:Mw};function wh(t,{layout:e,layoutId:n}){return cr.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ua[t]||t==="opacity")}function yc(t,e,n){var i;const r=t.style,o=e==null?void 0:e.style,s={};if(!r)return s;for(const a in r)(Oe(r[a])||o&&Oe(o[a])||wh(a,t)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Ew(t){return window.getComputedStyle(t)}class jw extends mh{constructor(){super(...arguments),this.type="html",this.renderInstance=bh}readValueFromInstance(e,n){var r;if(cr.has(n))return(r=this.projection)!=null&&r.isProjecting?qi(n):Yx(e,n);{const o=Ew(e),s=(jf(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return xh(e,n)}build(e,n,r){gc(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return yc(e,n,r)}}const Aw={offset:"stroke-dashoffset",array:"stroke-dasharray"},Dw={offset:"strokeDashoffset",array:"strokeDasharray"};function Iw(t,e,n=1,r=0,o=!0){t.pathLength=1;const s=o?Aw:Dw;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const Nw=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ch(t,{attrX:e,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(gc(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const m of Nw)f[m]!==void 0&&(h[m]=f[m],delete f[m]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Iw(f,o,s,i,!1)}const Sh=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Ph=t=>typeof t=="string"&&t.toLowerCase()==="svg";function kw(t,e,n,r){bh(t,e,void 0,r);for(const o in e.attrs)t.setAttribute(Sh.has(o)?o:lc(o),e.attrs[o])}function Rh(t,e,n){const r=yc(t,e,n);for(const o in t)if(Oe(t[o])||Oe(e[o])){const s=ar.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=t[o]}return r}class _w extends mh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ee}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(cr.has(n)){const r=oh(n);return r&&r.default||0}return n=Sh.has(n)?n:lc(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return Rh(e,n,r)}build(e,n,r){Ch(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,o){kw(e,n,r,o)}mount(e){this.isSVGTag=Ph(e.tagName),super.mount(e)}}const Ow=mc.length;function Th(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Th(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Ow;n++){const r=mc[n],o=t.props[r];(Ir(o)||o===!1)&&(e[r]=o)}return e}function Mh(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const $w=[...pc].reverse(),Lw=pc.length;function Fw(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Ob(t,n,r)))}function Vw(t){let e=Fw(t),n=Pu(),r=!0,o=!1;const s=u=>(d,f)=>{var m;const h=Mn(t,f,u==="exit"?(m=t.presenceContext)==null?void 0:m.custom:void 0);if(h){const{transition:y,transitionEnd:g,...v}=h;d={...d,...v,...g}}return d};function i(u){e=u(t)}function a(u){const{props:d}=t,f=Th(t.parent)||{},h=[],m=new Set;let y={},g=1/0;for(let x=0;x<Lw;x++){const w=$w[x],b=n[w],C=d[w]!==void 0?d[w]:f[w],P=Ir(C),R=w===u?b.isActive:null;R===!1&&(g=x);let M=C===f[w]&&C!==d[w]&&P;if(M&&(r||o)&&t.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...y},!b.isActive&&R===null||!C&&!b.prevProp||ys(C)||typeof C=="boolean")continue;if(w==="exit"&&b.isActive&&R!==!0){b.prevResolvedValues&&(y={...y,...b.prevResolvedValues});continue}const j=Bw(b.prevProp,C);let T=j||w===u&&b.isActive&&!M&&P||x>g&&P,E=!1;const N=Array.isArray(C)?C:[C];let _=N.reduce(s(w),{});R===!1&&(_={});const{prevResolvedValues:F={}}=b,U={...F,..._},J=L=>{T=!0,m.has(L)&&(E=!0,m.delete(L)),b.needsAnimating[L]=!0;const $=t.getValue(L);$&&($.liveStyle=!1)};for(const L in U){const $=_[L],D=F[L];if(y.hasOwnProperty(L))continue;let q=!1;na($)&&na(D)?q=!Mh($,D):q=$!==D,q?$!=null?J(L):m.add(L):$!==void 0&&m.has(L)?J(L):b.protectedKeys[L]=!0}b.prevProp=C,b.prevResolvedValues=_,b.isActive&&(y={...y,..._}),(r||o)&&t.blockInitialAnimation&&(T=!1);const z=M&&j;T&&(!z||E)&&h.push(...N.map(L=>{const $={type:w};if(typeof L=="string"&&(r||o)&&!z&&t.manuallyAnimateOnMount&&t.parent){const{parent:D}=t,q=Mn(D,L);if(D.enteringChildren&&q){const{delayChildren:A}=q.transition||{};$.delay=Xf(D.enteringChildren,t,A)}}return{animation:L,options:$}}))}if(m.size){const x={};if(typeof d.initial!="boolean"){const w=Mn(t,Array.isArray(d.initial)?d.initial[0]:d.initial);w&&w.transition&&(x.transition=w.transition)}m.forEach(w=>{const b=t.getBaseTarget(w),C=t.getValue(w);C&&(C.liveStyle=!0),x[w]=b??null}),h.push({animation:x})}let v=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(v=!1),r=!1,o=!1,v?e(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(m=>{var y;return(y=m.animationState)==null?void 0:y.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Pu(),o=!0}}}function Bw(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Mh(e,t):!1}function wn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Pu(){return{animate:wn(!0),whileInView:wn(),whileHover:wn(),whileTap:wn(),whileDrag:wn(),whileFocus:wn(),exit:wn()}}function da(t,e){t.min=e.min,t.max=e.max}function ht(t,e){da(t.x,e.x),da(t.y,e.y)}function Ru(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Eh=1e-4,Gw=1-Eh,Uw=1+Eh,jh=.01,zw=0-jh,Ww=0+jh;function We(t){return t.max-t.min}function Hw(t,e,n){return Math.abs(t-e)<=n}function Tu(t,e,n,r=.5){t.origin=r,t.originPoint=ge(e.min,e.max,t.origin),t.scale=We(n)/We(e),t.translate=ge(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Gw&&t.scale<=Uw||isNaN(t.scale))&&(t.scale=1),(t.translate>=zw&&t.translate<=Ww||isNaN(t.translate))&&(t.translate=0)}function Tr(t,e,n,r){Tu(t.x,e.x,n.x,r?r.originX:void 0),Tu(t.y,e.y,n.y,r?r.originY:void 0)}function Mu(t,e,n,r=0){const o=r?ge(n.min,n.max,r):n.min;t.min=o+e.min,t.max=t.min+We(e)}function Kw(t,e,n,r){Mu(t.x,e.x,n.x,r==null?void 0:r.x),Mu(t.y,e.y,n.y,r==null?void 0:r.y)}function Eu(t,e,n,r=0){const o=r?ge(n.min,n.max,r):n.min;t.min=e.min-o,t.max=t.min+We(e)}function is(t,e,n,r){Eu(t.x,e.x,n.x,r==null?void 0:r.x),Eu(t.y,e.y,n.y,r==null?void 0:r.y)}function ju(t,e,n,r,o){return t-=e,t=ss(t,1/n,r),o!==void 0&&(t=ss(t,1/o,r)),t}function Yw(t,e=0,n=1,r=.5,o,s=t,i=t){if(Dt.test(e)&&(e=parseFloat(e),e=ge(i.min,i.max,e/100)-i.min),typeof e!="number")return;let a=ge(s.min,s.max,r);t===s&&(a-=e),t.min=ju(t.min,e,n,a,o),t.max=ju(t.max,e,n,a,o)}function Au(t,e,[n,r,o],s,i){Yw(t,e[n],e[r],e[o],e.scale,s,i)}const Xw=["x","scaleX","originX"],qw=["y","scaleY","originY"];function Du(t,e,n,r){Au(t.x,e,Xw,n?n.x:void 0,r?r.x:void 0),Au(t.y,e,qw,n?n.y:void 0,r?r.y:void 0)}function Iu(t){return t.translate===0&&t.scale===1}function Ah(t){return Iu(t.x)&&Iu(t.y)}function Nu(t,e){return t.min===e.min&&t.max===e.max}function Zw(t,e){return Nu(t.x,e.x)&&Nu(t.y,e.y)}function ku(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Dh(t,e){return ku(t.x,e.x)&&ku(t.y,e.y)}function _u(t){return We(t.x)/We(t.y)}function Ou(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tt(t){return[t("x"),t("y")]}function Qw(t,e,n){let r="";const o=t.x.translate/e.x,s=t.y.translate/e.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Ih=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Jw=Ih.length,$u=t=>typeof t=="string"?parseFloat(t):t,Lu=t=>typeof t=="number"||te.test(t);function eC(t,e,n,r,o,s){o?(t.opacity=ge(0,n.opacity??1,tC(r)),t.opacityExit=ge(e.opacity??1,0,nC(r))):s&&(t.opacity=ge(e.opacity??1,n.opacity??1,r));for(let i=0;i<Jw;i++){const a=Ih[i];let c=Fu(e,a),u=Fu(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Lu(c)===Lu(u)?(t[a]=Math.max(ge($u(c),$u(u),r),0),(Dt.test(u)||Dt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=ge(e.rotate||0,n.rotate||0,r))}function Fu(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const tC=Nh(0,.5,Sf),nC=Nh(.5,.95,dt);function Nh(t,e,n){return r=>r<t?0:r>e?1:n(Ar(t,e,r))}function rC(t,e,n){const r=Oe(t)?t:tr(t);return r.start(ac("",r,e,n)),r.animation}function Nr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const oC=(t,e)=>t.depth-e.depth;class sC{constructor(){this.children=[],this.isDirty=!1}add(e){Ya(this.children,e),this.isDirty=!0}remove(e){Jo(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(oC),this.isDirty=!1,this.children.forEach(e)}}function iC(t,e){const n=ze.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(sn(r),t(s-e))};return pe.setup(r,!0),()=>sn(r)}function Wo(t){return Oe(t)?t.get():t}class aC{constructor(){this.members=[]}add(e){Ya(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Jo(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Jo(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(e,n){var o;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=e.options;(s===void 0||s!==i)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(o=e.root)!=null&&o.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,o,s,i;(r=(n=e.options).onExitComplete)==null||r.call(n),(i=(o=e.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Ho={hasAnimatedSinceResize:!0,hasEverUpdated:!1},di=["","X","Y","Z"],cC=1e3;let lC=0;function fi(t,e,n,r){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),r&&(r[t]=0))}function kh(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=eh(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",pe,!(o||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&kh(r)}function _h({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=e==null?void 0:e()){this.id=lC++,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(fC),this.nodes.forEach(vC),this.nodes.forEach(xC),this.nodes.forEach(hC)},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 sC)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Xa),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=hc(i)&&!dw(i),this.instance=i;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;pe.read(()=>{f=window.innerWidth}),t(i,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=iC(h,250),Ho.hasAnimatedSinceResize&&(Ho.hasAnimatedSinceResize=!1,this.nodes.forEach(Gu)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||PC,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=u.getProps(),x=!this.targetLayout||!Dh(this.targetLayout,m),w=!f&&h;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...ic(y,"layout"),onPlay:g,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(d,w)}else f||Gu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),sn(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(bC),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&&kh(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(mC),this.nodes.forEach(Vu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(gC),this.nodes.forEach(yC),this.nodes.forEach(uC),this.nodes.forEach(dC)):this.nodes.forEach(Bu),this.clearAllSnapshots();const a=ze.now();_e.delta=Nt(0,1e3/60,a-_e.timestamp),_e.timestamp=a,_e.isProcessing=!0,ri.update.process(_e),ri.preRender.process(_e),ri.render.process(_e),_e.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(pC),this.sharedNodes.forEach(wC)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!We(this.snapshot.measuredBox.x)&&!We(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ee()),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&&!Ah(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||Sn(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)),RC(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return Ee();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(TC))){const{scroll:d}=this.root;d&&(Et(a.x,d.offset.x),Et(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=Ee();if(ht(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&&ht(a,i),Et(a.x,f.offset.x),Et(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||Ee();ht(u,i);for(let h=0;h<this.path.length;h++){const m=this.path[h];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(Et(u.x,-m.scroll.offset.x),Et(u.y,-m.scroll.offset.y)),Sn(m.latestValues)&&zo(u,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return Sn(this.latestValues)&&zo(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=Ee();ht(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!Sn(d.latestValues))continue;let f;d.instance&&(ca(d.latestValues)&&d.updateSnapshot(),f=Ee(),ht(f,d.measurePageBox())),Du(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return Sn(this.latestValues)&&Du(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!==_e.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=_e.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=Ee(),this.targetWithTransforms=Ee()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Kw(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ht(this.target,this.layout.layoutBox),vh(this.target,this.targetDelta)):ht(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||ca(this.parent.latestValues)||yh(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=Ee(),this.relativeTargetOrigin=Ee(),is(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ht(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===_e.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;ht(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Cw(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=Ee());const{target:m}=i;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ru(this.prevProjectionDelta.x,this.projectionDelta.x),Ru(this.prevProjectionDelta.y,this.projectionDelta.y)),Tr(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Ou(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ou(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Zn(),this.projectionDelta=Zn(),this.projectionDeltaWithTransform=Zn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=Zn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Ee(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,g=m!==y,v=this.getStack(),x=!v||v.members.length<=1,w=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(SC));this.animationProgress=0;let b;this.mixTargetDelta=C=>{const P=C/1e3;Uu(f.x,i.x,P),Uu(f.y,i.y,P),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(is(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),CC(this.relativeTarget,this.relativeTargetOrigin,h,P),b&&Zw(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Ee()),ht(b,this.relativeTarget)),g&&(this.animationValues=d,eC(d,u,this.latestValues,P,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(sn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pe.update(()=>{Ho.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=tr(0)),this.motionValue.jump(0,!1),this.currentAnimation=rC(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(cC),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&&Oh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ee();const f=We(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=We(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}ht(a,c),zo(a,d),Tr(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new aC),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&&fi("z",i,u,this.animationValues);for(let d=0;d<di.length;d++)fi(`rotate${di[d]}`,i,u,this.animationValues),fi(`skew${di[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=Wo(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=Wo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Sn(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Qw(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:m}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const y in ua){if(d[y]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:x}=ua[y],w=f==="none"?d[y]:g(d[y],u);if(v){const b=v.length;for(let C=0;C<b;C++)i[v[C]]=w}else x?this.options.visualElement.renderState.vars[y]=w:i[y]=w}this.options.layoutId&&(i.pointerEvents=u===this?Wo(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(Vu),this.root.sharedNodes.clear()}}}function uC(t){t.updateLayout()}function dC(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=t.layout,{animationType:s}=t.options,i=e.source!==t.layout.source;if(s==="size")Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=We(h);h.min=r[f].min,h.max=h.min+m});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";da(i?e.measuredBox[f]:e.layoutBox[f],r[f])}else Oh(s,e.layoutBox,r)&&Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=We(r[f]);h.max=h.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+m)});const a=Zn();Tr(a,r,e.layoutBox);const c=Zn();i?Tr(c,t.applyTransform(o,!0),e.measuredBox):Tr(c,r,e.layoutBox);const u=!Ah(a);let d=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const y=t.options.layoutAnchor||void 0,g=Ee();is(g,e.layoutBox,h.layoutBox,y);const v=Ee();is(v,r,m.layoutBox,y),Dh(g,v)||(d=!0),f.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=g,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function fC(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function hC(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function pC(t){t.clearSnapshot()}function Vu(t){t.clearMeasurements()}function mC(t){t.isLayoutDirty=!0,t.updateLayout()}function Bu(t){t.isLayoutDirty=!1}function gC(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function yC(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Gu(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function vC(t){t.resolveTargetDelta()}function xC(t){t.calcProjection()}function bC(t){t.resetSkewAndRotation()}function wC(t){t.removeLeadSnapshot()}function Uu(t,e,n){t.translate=ge(e.translate,0,n),t.scale=ge(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function zu(t,e,n,r){t.min=ge(e.min,n.min,r),t.max=ge(e.max,n.max,r)}function CC(t,e,n,r){zu(t.x,e.x,n.x,r),zu(t.y,e.y,n.y,r)}function SC(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const PC={duration:.45,ease:[.4,0,.1,1]},Wu=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Hu=Wu("applewebkit/")&&!Wu("chrome/")?Math.round:dt;function Ku(t){t.min=Hu(t.min),t.max=Hu(t.max)}function RC(t){Ku(t.x),Ku(t.y)}function Oh(t,e,n){return t==="position"||t==="preserve-aspect"&&!Hw(_u(e),_u(n),.2)}function TC(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const MC=_h({attachResizeListener:(t,e)=>Nr(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),hi={current:void 0},$h=_h({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!hi.current){const t=new MC({});t.mount(window),t.setOptions({layoutScroll:!0}),hi.current=t}return hi.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),vc=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Yu(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function EC(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Yu(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Yu(t[o],null)}}}}function jC(...t){return p.useCallback(EC(...t),t)}class AC extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Vo(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Vo(r)&&r.offsetWidth||0,s=Vo(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 DC({children:t,isPresent:e,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=S.useId(),a=S.useRef(null),c=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=S.useContext(vc),d=((h=t.props)==null?void 0:h.ref)??(t==null?void 0:t.ref),f=jC(a,d);return S.useInsertionEffect(()=>{const{width:m,height:y,top:g,left:v,right:x,bottom:w}=c.current;if(e||s===!1||!a.current||!m||!y)return;const b=n==="left"?`left: ${v}`:`right: ${x}`,C=r==="bottom"?`bottom: ${w}`:`top: ${g}`;a.current.dataset.motionPopId=i;const P=document.createElement("style");u&&(P.nonce=u);const R=o??document.head;return R.appendChild(P),P.sheet&&P.sheet.insertRule(`
2
2
  [data-motion-pop-id="${i}"] {
3
3
  position: absolute !important;
4
4
  width: ${m}px !important;
5
5
  height: ${y}px !important;
6
- ${w}px !important;
7
- ${S}px !important;
6
+ ${b}px !important;
7
+ ${C}px !important;
8
8
  }
9
- `),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),P.contains(R)&&P.removeChild(R)}},[t]),l.jsx(QS,{isPresent:t,childRef:a,sizeRef:c,pop:s,children:s===!1?e:p.cloneElement(e,{ref:f})})}const eR=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=dc(tR),f=C.useId();let h=!0,m=C.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:o,onExitComplete:y=>{d.set(y,!0);for(const g of d.values())if(!g)return;r&&r()},register:y=>(d.set(y,!1),()=>d.delete(y))}),[n,d,r]);return s&&h&&(m={...m}),C.useMemo(()=>{d.forEach((y,g)=>d.set(g,!1))},[n]),p.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=l.jsx(JS,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:e}),l.jsx(vs.Provider,{value:m,children:e})};function tR(){return new Map}function ep(e=!0){const t=C.useContext(vs);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=C.useId();C.useEffect(()=>{if(e)return o(s)},[e]);const i=C.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const yo=e=>e.key||"";function md(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const tp=({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]=ep(i),h=C.useMemo(()=>md(e),[e]),m=i&&!d?[]:h.map(yo),y=C.useRef(!0),g=C.useRef(h),v=dc(()=>new Map),x=C.useRef(new Set),[b,w]=C.useState(h),[S,R]=C.useState(h);Ef(()=>{y.current=!1,g.current=h;for(let A=0;A<S.length;A++){const E=yo(S[A]);m.includes(E)?(v.delete(E),x.current.delete(E)):v.get(E)!==!0&&v.set(E,!1)}},[S,m.length,m.join("-")]);const P=[];if(h!==b){let A=[...h];for(let E=0;E<S.length;E++){const M=S[E],D=yo(M);m.includes(D)||(A.splice(E,0,M),P.push(M))}return s==="wait"&&P.length&&(A=P),R(md(A)),w(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:T}=C.useContext(uc);return l.jsx(l.Fragment,{children:S.map(A=>{const E=yo(A),M=i&&!d?!1:h===S||m.includes(E),D=()=>{if(x.current.has(E))return;if(v.has(E))x.current.add(E),v.set(E,!0);else return;let k=!0;v.forEach(V=>{V||(k=!1)}),k&&(T==null||T(),R(g.current),i&&(f==null||f()),r&&r())};return l.jsx(eR,{isPresent:M,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:M?void 0:D,anchorX:a,anchorY:c,children:A},E)})})},np=C.createContext({strict:!1}),gd={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 yd=!1;function nR(){if(yd)return;const e={};for(const t in gd)e[t]={isEnabled:n=>gd[t].some(r=>!!n[r])};Nh(e),yd=!0}function rp(){return nR(),V0()}function rR(e){const t=rp();for(const n in e)t[n]={...t[n],...e[n]};Nh(t)}const oR=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 rs(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||oR.has(e)}let op=e=>!rs(e);function sR(e){typeof e=="function"&&(op=t=>t.startsWith("on")?!rs(t):e(t))}try{sR(require("@emotion/is-prop-valid").default)}catch{}function iR(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||_e(e[o])||(op(o)||n===!0&&rs(o)||!t&&!rs(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Cs=C.createContext({});function aR(e,t){if(ws(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Nr(n)?n:void 0,animate:Nr(r)?r:void 0}}return e.inherit!==!1?t:{}}function cR(e){const{initial:t,animate:n}=aR(e,C.useContext(Cs));return C.useMemo(()=>({initial:t,animate:n}),[vd(t),vd(n)])}function vd(e){return Array.isArray(e)?e.join(" "):e}const $c=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sp(e,t,n){for(const r in t)!_e(t[r])&&!$h(r,n)&&(e[r]=t[r])}function lR({transformTemplate:e},t){return C.useMemo(()=>{const n=$c();return kc(n,t,e),Object.assign({},n.vars,n.style)},[t])}function uR(e,t){const n=e.style||{},r={};return sp(r,n,e),Object.assign(r,lR(e,t)),r}function dR(e,t){const n={},r=uR(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 ip=()=>({...$c(),attrs:{}});function fR(e,t,n,r){const o=C.useMemo(()=>{const s=ip();return Lh(s,t,Vh(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};sp(s,e.style,e),o.style={...s,...o.style}}return o}const hR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Lc(e){return typeof e!="string"||e.includes("-")?!1:!!(hR.indexOf(e)>-1||/[A-Z]/u.test(e))}function pR(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??Lc(e)?fR:dR)(t,r,o,e),u=iR(t,typeof e=="string",s),d=e!==C.Fragment?{...u,...c,ref:n}:{},{children:f}=t,h=C.useMemo(()=>_e(f)?f.get():f,[f]);return C.createElement(e,{...d,children:h})}function mR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:gR(n,r,o,e),renderState:t()}}function gR(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=Bo(s[h]);let{initial:i,animate:a}=e;const c=ws(e),u=Mh(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"&&!bs(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const y=Tc(e,h[m]);if(y){const{transitionEnd:g,transition:v,...x}=y;for(const b in x){let w=x[b];if(Array.isArray(w)){const S=d?w.length-1:0;w=w[S]}w!==null&&(o[b]=w)}for(const b in g)o[b]=g[b]}}}return o}const ap=e=>(t,n)=>{const r=C.useContext(Cs),o=C.useContext(vs),s=()=>mR(e,t,r,o);return n?s():dc(s)},yR=ap({scrapeMotionValuesFromProps:_c,createRenderState:$c}),vR=ap({scrapeMotionValuesFromProps:Bh,createRenderState:ip}),xR=Symbol.for("motionComponentSymbol");function bR(e,t,n){const r=C.useRef(n);C.useInsertionEffect(()=>{r.current=n});const o=C.useRef(null);return C.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 cp=C.createContext({});function Gn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wR(e,t,n,r,o,s){var w,S;const{visualElement:i}=C.useContext(Cs),a=C.useContext(np),c=C.useContext(vs),u=C.useContext(Oc),d=u.reducedMotion,f=u.skipAnimations,h=C.useRef(null),m=C.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}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const y=h.current,g=C.useContext(cp);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&CR(h.current,n,o,g);const v=C.useRef(!1);C.useInsertionEffect(()=>{y&&v.current&&y.update(n,c)});const x=n[mh],b=C.useRef(!!x&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,x))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,x)));return Ef(()=>{m.current=!0,y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),b.current&&y.animationState&&y.animationState.animateChanges())}),C.useEffect(()=>{y&&(!b.current&&y.animationState&&y.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,x)}),b.current=!1),y.enteringChildren=void 0)}),y}function CR(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:lp(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 lp(e){if(e)return e.options.allowProjection!==!1?e.projection:lp(e.parent)}function Ri(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&rR(r);const s=n?n==="svg":Lc(e),i=s?vR:yR;function a(u,d){let f;const h={...C.useContext(Oc),...u,layoutId:SR(u)},{isStatic:m}=h,y=cR(u),g=i(u,m);if(!m&&typeof window<"u"){RR(h,r);const v=PR(h);f=v.MeasureLayout,y.visualElement=wR(e,g,h,o,v.ProjectionNode,s)}return l.jsxs(Cs.Provider,{value:y,children:[f&&y.visualElement?l.jsx(f,{visualElement:y.visualElement,...h}):null,pR(e,u,bR(g,y.visualElement,d),g,m,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=C.forwardRef(a);return c[xR]=e,c}function SR({layoutId:e}){const t=C.useContext(uc).id;return t&&e!==void 0?t+"-"+e:e}function RR(e,t){const n=C.useContext(np).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?sr(!1,r,"lazy-strict-mode"):_t(!1,r,"lazy-strict-mode")}}function PR(e){const t=rp(),{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 TR(e,t){if(typeof Proxy>"u")return Ri;const n=new Map,r=(s,i)=>Ri(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&pc(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,Ri(i,void 0,e,t)),n.get(i))})}const ER=(e,t)=>t.isSVG??Lc(e)?new rS(t):new Z0(t,{allowProjection:e!==C.Fragment});class MR extends rn{constructor(t){super(t),t.animationState||(t.animationState=cS(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();bs(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 AR=0;class NR extends rn{constructor(){super(...arguments),this.id=AR++,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=Cn(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 jR={animation:{Feature:MR},exit:{Feature:NR}};function Gr(e){return{point:{x:e.pageX,y:e.pageY}}}const IR=e=>t=>Nc(t)&&e(t,Gr(t));function Er(e,t,n,r){return jr(e,t,IR(n),r)}const up=({current:e})=>e?e.ownerDocument.defaultView:null,xd=(e,t)=>Math.abs(e-t);function DR(e,t){const n=xd(e.x,t.x),r=xd(e.y,t.y);return Math.sqrt(n**2+r**2)}const bd=new Set(["auto","scroll"]);class dp{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=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vo(this.lastRawMoveEventInfo,this.transformPagePoint));const m=Pi(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,g=DR(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!g)return;const{point:v}=m,{timestamp:x}=ke;this.history.push({...v,timestamp:x});const{onStart:b,onMove:w}=this.handlers;y||(b&&b(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,m)},this.handlePointerMove=(m,y)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=vo(y,this.transformPagePoint),fe.update(this.updatePoint,!0)},this.handlePointerUp=(m,y)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Pi(m.type==="pointercancel"?this.lastMoveEventInfo:vo(y,this.transformPagePoint),this.history);this.startEvent&&g&&g(m,b),v&&v(m,b)},!Nc(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=Gr(t),u=vo(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=ke;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,Pi(u,this.history)),this.removeListeners=Fr(Er(this.contextWindow,"pointermove",this.handlePointerMove),Er(this.contextWindow,"pointerup",this.handlePointerUp),Er(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(bd.has(r.overflowX)||bd.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),fe.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Qt(this.updatePoint)}}function vo(e,t){return t?{point:t(e.point)}:e}function wd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Pi({point:e},t){return{point:e,delta:wd(e,fp(t)),offset:wd(e,kR(t)),velocity:_R(t,.1)}}function kR(e){return e[0]}function fp(e){return e[e.length-1]}function _R(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=fp(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>He(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>He(t)*2&&(r=e[1]);const s=st(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 OR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?pe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?pe(n,e,r.max):Math.min(e,n)),e}function Cd(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 $R(e,{top:t,left:n,bottom:r,right:o}){return{x:Cd(e.x,n,o),y:Cd(e.y,t,r)}}function Sd(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 LR(e,t){return{x:Sd(e.x,t.x),y:Sd(e.y,t.y)}}function FR(e,t){let n=.5;const r=Ke(e),o=Ke(t);return o>r?n=Mr(t.min,t.max-r,e.min):r>o&&(n=Mr(e.min,e.max-o,t.min)),It(0,1,n)}function VR(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 Ca=.35;function BR(e=Ca){return e===!1?e=0:e===!0&&(e=Ca),{x:Rd(e,"left","right"),y:Rd(e,"top","bottom")}}function Rd(e,t,n){return{min:Pd(e,t),max:Pd(e,n)}}function Pd(e,t){return typeof e=="number"?e:e[t]||0}const GR=new WeakMap;class UR{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=Pe(),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(Gr(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:y,onDragStart:g}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=g0(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Pt(x=>{let b=this.getAxisMotionValue(x).get()||0;if(Nt.test(b)){const{projection:w}=this.visualElement;if(w&&w.layout){const S=w.layout.layoutBox[x];S&&(b=Ke(S)*(parseFloat(b)/100))}}this.originPoint[x]=b}),g&&fe.update(()=>g(f,h),!1,!0),ha(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:g,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=h;if(y&&this.currentDirection===null){this.currentDirection=KR(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),v&&fe.update(()=>v(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new dp(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:up(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&&fe.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||!xo(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=OR(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=$R(r.layoutBox,t):this.constraints=!1,this.elastic=BR(n),o!==this.constraints&&!Gn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Pt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=VR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Gn(t))return!1;const r=t.current;_t(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=K0(r,o.root,this.visualElement.getTransformPagePoint());let i=LR(o.layout.layoutBox,s);if(n){const a=n(G0(i));this.hasMutatedConstraints=!!a,a&&(i=Ih(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Pt(d=>{if(!xo(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ha(this.visualElement,t),r.start(Pc(t,r,0,n,this.visualElement,!1))}stopAnimation(){Pt(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){Pt(n=>{const{drag:r}=this.getProps();if(!xo(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]-pe(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};Pt(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=FR({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(),Pt(i=>{if(!xo(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(pe(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;GR.set(this.visualElement,this);const t=this.visualElement.current,n=Er(t,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,m=h!==t&&C0(h);d&&f&&!m&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();Gn(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=WR(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),fe.read(o);const a=jr(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Pt(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=Ca,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Td(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function WR(e,t,n){const r=Du(e,Td(n)),o=Du(t,Td(n));return()=>{r(),o()}}function xo(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function KR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class zR extends rn{constructor(t){super(t),this.removeGroupControls=it,this.removeListeners=it,this.controls=new UR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||it}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 Ti=e=>(t,n)=>{e&&fe.update(()=>e(t,n),!1,!0)};class HR extends rn{constructor(){super(...arguments),this.removePointerDownListener=it}onPointerDown(t){this.session=new dp(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:up(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ti(t),onStart:Ti(n),onMove:Ti(r),onEnd:(s,i)=>{delete this.session,o&&fe.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Er(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 Ei=!1;class YR extends C.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),Ei&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Go.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}),Ei=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||fe.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(),Ac.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Ei=!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 hp(e){const[t,n]=ep(),r=C.useContext(uc);return l.jsx(YR,{...e,layoutGroup:r,switchLayoutGroup:C.useContext(cp),isPresent:t,safeToRemove:n})}const XR={pan:{Feature:HR},drag:{Feature:zR,ProjectionNode:Jh,MeasureLayout:hp}};function Ed(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&&fe.postRender(()=>s(t,Gr(t)))}class qR extends rn{mount(){const{current:t}=this.node;t&&(this.unmount=v0(t,(n,r)=>(Ed(this.node,r,"Start"),o=>Ed(this.node,o,"End"))))}unmount(){}}class ZR extends rn{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=Fr(jr(this.node.current,"focus",()=>this.onFocus()),jr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Md(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&&fe.postRender(()=>s(t,Gr(t)))}class QR extends rn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=R0(t,(o,s)=>(Md(this.node,s,"Start"),(i,{success:a})=>Md(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Sa=new WeakMap,Mi=new WeakMap,JR=e=>{const t=Sa.get(e.target);t&&t(e)},e1=e=>{e.forEach(JR)};function t1({root:e,...t}){const n=e||document;Mi.has(n)||Mi.set(n,{});const r=Mi.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(e1,{root:e,...t})),r[o]}function n1(e,t,n){const r=t1(t);return Sa.set(e,n),r.observe(e),()=>{Sa.delete(e),r.unobserve(e)}}const r1={some:0,all:1};class o1 extends rn{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:r1[o]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=d?f:h;m&&m(u)};this.stopObserver=n1(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(s1(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function s1({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const i1={inView:{Feature:o1},tap:{Feature:QR},focus:{Feature:ZR},hover:{Feature:qR}},a1={layout:{ProjectionNode:Jh,MeasureLayout:hp}},c1={...jR,...i1,...XR,...a1},pp=TR(c1,ER);function mp(){const[e,t]=C.useState([]),n=C.useRef(0),r=C.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=C.useCallback(s=>{t(i=>i.filter(a=>a.id!==s))},[]);return{ripples:e,add:r,remove:o}}function gp({ripples:e,onDone:t}){return l.jsx(tp,{children:e.map(n=>l.jsx(pp.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 l1=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),Ir=C.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:m,children:y,onClick:g,...v},x){const{ripples:b,add:w,remove:S}=mp(),R=d||i,P=k=>{R||(!u&&t!=="link"&&w(k),g==null||g(k))},{className:T,style:A,styleTag:E}=re(m,h,"btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",f),M=i?l.jsx(l1,{}):c==="start"?a:null,D=!i&&c==="end"?a:null;return l.jsxs("button",{ref:x,className:T,style:A,onClick:P,disabled:R,"aria-busy":i||void 0,...v,children:[E,l.jsxs("span",{className:"btn-content",children:[M,y,D]}),!u&&t!=="link"&&l.jsx(gp,{ripples:b,onDone:S})]})}),u1=C.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})}),d1=C.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},m){const{ripples:y,add:g,remove:v}=mp(),x=S=>{f||(s||g(S),d==null||d(S))},b=a!=null,w=Y("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",b&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(tp,{children:c&&l.jsxs(pp.button,{ref:m,type:"button",className:w,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(gp,{ripples:y,onDone:v})]})})}),f1=C.forwardRef(function({icon:t,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(Ir,{ref:s,shape:n,variant:r,icon:t,...o})});function q(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 $e=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},h1=p[" useInsertionEffect ".trim().toString()]||$e;function Ee({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=p1({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=p.useRef(e!==void 0);p.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=p.useCallback(d=>{var f;if(a){const h=m1(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 p1({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),s=p.useRef(t);return h1(()=>{s.current=t},[t]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function m1(e){return typeof e=="function"}function Ad(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ot(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ad(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():Ad(e[o],null)}}}}function se(...e){return p.useCallback(Ot(...e),e)}function Rn(e){const t=g1(e),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(v1);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function g1(e){const t=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=b1(o),a=x1(s,o.props);return o.type!==p.Fragment&&(a.ref=r?Ot(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yp=Symbol("radix.slottable");function y1(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yp,t}function v1(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yp}function x1(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 b1(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 w1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ee=w1.reduce((e,t)=>{const n=Rn(`Primitive.${t}`),r=p.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 vp(e,t){e&&or.flushSync(()=>e.dispatchEvent(t))}var xp="Toggle",Fc=p.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=Ee({prop:n,onChange:o,defaultProp:r??!1,caller:xp});return l.jsx(ee.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:q(e.onClick,()=>{e.disabled||a(!i)})})});Fc.displayName=xp;var C1=Fc;const S1=C.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(C1,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});function R1(e,t){const n=p.createContext(t),r=s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=p.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 Ie(e,t=[]){let n=[];function r(s,i){const a=p.createContext(i),c=n.length;n=[...n,i];const u=f=>{var x;const{scope:h,children:m,...y}=f,g=((x=h==null?void 0:h[e])==null?void 0:x[c])||a,v=p.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:v,children:m})};u.displayName=s+"Provider";function d(f,h){var g;const m=((g=h==null?void 0:h[e])==null?void 0:g[c])||a,y=p.useContext(m);if(y)return y;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=>p.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,P1(o,...t)]}function P1(...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 p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Ur(e){const t=e+"CollectionProvider",[n,r]=Ie(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:x}=g,b=C.useRef(null),w=C.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:b,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=Rn(a),u=C.forwardRef((g,v)=>{const{scope:x,children:b}=g,w=s(a,x),S=se(v,w.collectionRef);return l.jsx(c,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Rn(d),m=C.forwardRef((g,v)=>{const{scope:x,children:b,...w}=g,S=C.useRef(null),R=se(v,S),P=s(d,x);return C.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),l.jsx(h,{[f]:"",ref:R,children:b})});m.displayName=d;function y(g){const v=s(e+"CollectionConsumer",g);return C.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((P,T)=>w.indexOf(P.ref.current)-w.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:m},y,r]}var T1=p[" useId ".trim().toString()]||(()=>{}),E1=0;function ve(e){const[t,n]=p.useState(T1());return $e(()=>{n(r=>r??String(E1++))},[e]),e||(t?`radix-${t}`:"")}function mt(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var M1=p.createContext(void 0);function on(e){const t=p.useContext(M1);return e||t||"ltr"}var Ai="rovingFocusGroup.onEntryFocus",A1={bubbles:!1,cancelable:!0},Wr="RovingFocusGroup",[Ra,bp,N1]=Ur(Wr),[j1,sn]=Ie(Wr,[N1]),[I1,D1]=j1(Wr),wp=p.forwardRef((e,t)=>l.jsx(Ra.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ra.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(k1,{...e,ref:t})})}));wp.displayName=Wr;var k1=p.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=p.useRef(null),m=se(t,h),y=on(s),[g,v]=Ee({prop:i,defaultProp:a??null,onChange:c,caller:Wr}),[x,b]=p.useState(!1),w=mt(u),S=bp(n),R=p.useRef(!1),[P,T]=p.useState(0);return p.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(Ai,w),()=>A.removeEventListener(Ai,w)},[w]),l.jsx(I1,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:g,onItemFocus:p.useCallback(A=>v(A),[v]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:p.useCallback(()=>T(A=>A-1),[]),children:l.jsx(ee.div,{tabIndex:x||P===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:q(e.onMouseDown,()=>{R.current=!0}),onFocus:q(e.onFocus,A=>{const E=!R.current;if(A.target===A.currentTarget&&E&&!x){const M=new CustomEvent(Ai,A1);if(A.currentTarget.dispatchEvent(M),!M.defaultPrevented){const D=S().filter(G=>G.focusable),k=D.find(G=>G.active),V=D.find(G=>G.id===g),Z=[k,V,...D].filter(Boolean).map(G=>G.ref.current);Rp(Z,d)}}R.current=!1}),onBlur:q(e.onBlur,()=>b(!1))})})}),Cp="RovingFocusGroupItem",Sp=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=ve(),u=s||c,d=D1(Cp,n),f=d.currentTabStopId===u,h=bp(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:g}=d;return p.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),l.jsx(Ra.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(ee.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:q(e.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:q(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:q(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=$1(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=d.loop?L1(w,S+1):w.slice(S+1)}setTimeout(()=>Rp(w))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});Sp.displayName=Cp;var _1={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O1(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $1(e,t,n){const r=O1(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _1[r]}function Rp(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function L1(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ss=wp,Rs=Sp,an="ToggleGroup",[Pp]=Ie(an,[sn]),Tp=sn(),Vc=C.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return l.jsx(F1,{...o,ref:t})}if(n==="multiple"){const o=r;return l.jsx(V1,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${an}\``)});Vc.displayName=an;var[Ep,Mp]=Pp(an),F1=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=Ee({prop:n,defaultProp:r??"",onChange:o,caller:an});return l.jsx(Ep,{scope:e.__scopeToggleGroup,type:"single",value:C.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:C.useCallback(()=>a(""),[a]),children:l.jsx(Ap,{...s,ref:t})})}),V1=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=Ee({prop:n,defaultProp:r??[],onChange:o,caller:an}),c=C.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=C.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(Ep,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:u,children:l.jsx(Ap,{...s,ref:t})})});Vc.displayName=an;var[B1,G1]=Pp(an),Ap=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,u=Tp(n),d=on(i),f={role:"group",dir:d,...c};return l.jsx(B1,{scope:n,rovingFocus:o,disabled:r,children:o?l.jsx(Ss,{asChild:!0,...u,orientation:s,dir:d,loop:a,children:l.jsx(ee.div,{...f,ref:t})}):l.jsx(ee.div,{...f,ref:t})})}),os="ToggleGroupItem",Np=C.forwardRef((e,t)=>{const n=Mp(os,e.__scopeToggleGroup),r=G1(os,e.__scopeToggleGroup),o=Tp(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,a={...e,pressed:s,disabled:i},c=C.useRef(null);return r.rovingFocus?l.jsx(Rs,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:l.jsx(Nd,{...a,ref:t})}):l.jsx(Nd,{...a,ref:t})});Np.displayName=os;var Nd=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=Mp(os,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return l.jsx(Fc,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),U1=Vc,W1=Np;const jp=C.createContext({variant:"outline",color:"primary"}),K1=C.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(jp.Provider,{value:{variant:t,color:n,size:r},children:l.jsx(U1,{ref:u,className:d,...c,children:a})})}),z1=C.forwardRef(function({icon:t,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=C.useContext(jp),d=Y("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(W1,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[t,o]})})});/**
9
+ `),()=>{var M;(M=a.current)==null||M.removeAttribute("data-motion-pop-id"),R.contains(P)&&R.removeChild(P)}},[e]),l.jsx(AC,{isPresent:e,childRef:a,sizeRef:c,pop:s,children:s===!1?t:p.cloneElement(t,{ref:f})})}const IC=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=Ka(NC),f=S.useId();let h=!0,m=S.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:o,onExitComplete:y=>{d.set(y,!0);for(const g of d.values())if(!g)return;r&&r()},register:y=>(d.set(y,!1),()=>d.delete(y))}),[n,d,r]);return s&&h&&(m={...m}),S.useMemo(()=>{d.forEach((y,g)=>d.set(g,!1))},[n]),p.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=l.jsx(DC,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),l.jsx(ms.Provider,{value:m,children:t})};function NC(){return new Map}function Lh(t=!0){const e=S.useContext(ms);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,s=S.useId();S.useEffect(()=>{if(t)return o(s)},[t]);const i=S.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,i]:[!0]}const bo=t=>t.key||"";function Xu(t){const e=[];return S.Children.forEach(t,n=>{S.isValidElement(n)&&e.push(n)}),e}const Fh=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,f]=Lh(i),h=S.useMemo(()=>Xu(t),[t]),m=i&&!d?[]:h.map(bo),y=S.useRef(!0),g=S.useRef(h),v=Ka(()=>new Map),x=S.useRef(new Set),[w,b]=S.useState(h),[C,P]=S.useState(h);df(()=>{y.current=!1,g.current=h;for(let j=0;j<C.length;j++){const T=bo(C[j]);m.includes(T)?(v.delete(T),x.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[C,m.length,m.join("-")]);const R=[];if(h!==w){let j=[...h];for(let T=0;T<C.length;T++){const E=C[T],N=bo(E);m.includes(N)||(j.splice(T,0,E),R.push(E))}return s==="wait"&&R.length&&(j=R),P(Xu(j)),b(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&C.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:M}=S.useContext(Ha);return l.jsx(l.Fragment,{children:C.map(j=>{const T=bo(j),E=i&&!d?!1:h===C||m.includes(T),N=()=>{if(x.current.has(T))return;if(v.has(T))x.current.add(T),v.set(T,!0);else return;let _=!0;v.forEach(F=>{F||(_=!1)}),_&&(M==null||M(),P(g.current),i&&(f==null||f()),r&&r())};return l.jsx(IC,{isPresent:E,initial:!y.current||n?void 0:!1,custom:e,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:E?void 0:N,anchorX:a,anchorY:c,children:j},T)})})},Vh=S.createContext({strict:!1}),qu={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 Zu=!1;function kC(){if(Zu)return;const t={};for(const e in qu)t[e]={isEnabled:n=>qu[e].some(r=>!!n[r])};ph(t),Zu=!0}function Bh(){return kC(),vw()}function _C(t){const e=Bh();for(const n in t)e[n]={...e[n],...t[n]};ph(e)}const OC=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 as(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||OC.has(t)}let Gh=t=>!as(t);function $C(t){typeof t=="function"&&(Gh=e=>e.startsWith("on")?!as(e):t(e))}try{$C(require("@emotion/is-prop-valid").default)}catch{}function LC(t,e,n){const r={};for(const o in t)o==="values"&&typeof t.values=="object"||Oe(t[o])||(Gh(o)||n===!0&&as(o)||!e&&!as(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}const xs=S.createContext({});function FC(t,e){if(vs(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ir(n)?n:void 0,animate:Ir(r)?r:void 0}}return t.inherit!==!1?e:{}}function VC(t){const{initial:e,animate:n}=FC(t,S.useContext(xs));return S.useMemo(()=>({initial:e,animate:n}),[Qu(e),Qu(n)])}function Qu(t){return Array.isArray(t)?t.join(" "):t}const xc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Uh(t,e,n){for(const r in e)!Oe(e[r])&&!wh(r,n)&&(t[r]=e[r])}function BC({transformTemplate:t},e){return S.useMemo(()=>{const n=xc();return gc(n,e,t),Object.assign({},n.vars,n.style)},[e])}function GC(t,e){const n=t.style||{},r={};return Uh(r,n,t),Object.assign(r,BC(t,e)),r}function UC(t,e){const n={},r=GC(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const zh=()=>({...xc(),attrs:{}});function zC(t,e,n,r){const o=S.useMemo(()=>{const s=zh();return Ch(s,e,Ph(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Uh(s,t.style,t),o.style={...s,...o.style}}return o}const WC=["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 bc(t){return typeof t!="string"||t.includes("-")?!1:!!(WC.indexOf(t)>-1||/[A-Z]/u.test(t))}function HC(t,e,n,{latestValues:r},o,s=!1,i){const c=(i??bc(t)?zC:UC)(e,r,o,t),u=LC(e,typeof t=="string",s),d=t!==S.Fragment?{...u,...c,ref:n}:{},{children:f}=e,h=S.useMemo(()=>Oe(f)?f.get():f,[f]);return S.createElement(t,{...d,children:h})}function KC({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,o){return{latestValues:YC(n,r,o,t),renderState:e()}}function YC(t,e,n,r){const o={},s=r(t,{});for(const h in s)o[h]=Wo(s[h]);let{initial:i,animate:a}=t;const c=vs(t),u=fh(t);e&&u&&!c&&t.inherit!==!1&&(i===void 0&&(i=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!ys(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const y=cc(t,h[m]);if(y){const{transitionEnd:g,transition:v,...x}=y;for(const w in x){let b=x[w];if(Array.isArray(b)){const C=d?b.length-1:0;b=b[C]}b!==null&&(o[w]=b)}for(const w in g)o[w]=g[w]}}}return o}const Wh=t=>(e,n)=>{const r=S.useContext(xs),o=S.useContext(ms),s=()=>KC(t,e,r,o);return n?s():Ka(s)},XC=Wh({scrapeMotionValuesFromProps:yc,createRenderState:xc}),qC=Wh({scrapeMotionValuesFromProps:Rh,createRenderState:zh}),ZC=Symbol.for("motionComponentSymbol");function QC(t,e,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const o=S.useRef(null);return S.useCallback(s=>{var a;s&&((a=t.onMount)==null||a.call(t,s));const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const Hh=S.createContext({});function zn(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function JC(t,e,n,r,o,s){var b,C;const{visualElement:i}=S.useContext(xs),a=S.useContext(Vh),c=S.useContext(ms),u=S.useContext(vc),d=u.reducedMotion,f=u.skipAnimations,h=S.useRef(null),m=S.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(t,{visualState:e,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const y=h.current,g=S.useContext(Hh);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&e0(h.current,n,o,g);const v=S.useRef(!1);S.useInsertionEffect(()=>{y&&v.current&&y.update(n,c)});const x=n[Jf],w=S.useRef(!!x&&typeof window<"u"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,x))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,x)));return df(()=>{m.current=!0,y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),w.current&&y.animationState&&y.animationState.animateChanges())}),S.useEffect(()=>{y&&(!w.current&&y.animationState&&y.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,x)}),w.current=!1),y.enteringChildren=void 0)}),y}function e0(t,e,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Kh(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&zn(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function Kh(t){if(t)return t.options.allowProjection!==!1?t.projection:Kh(t.parent)}function pi(t,{forwardMotionProps:e=!1,type:n}={},r,o){r&&_C(r);const s=n?n==="svg":bc(t),i=s?qC:XC;function a(u,d){let f;const h={...S.useContext(vc),...u,layoutId:t0(u)},{isStatic:m}=h,y=VC(u),g=i(u,m);if(!m&&typeof window<"u"){n0(h,r);const v=r0(h);f=v.MeasureLayout,y.visualElement=JC(t,g,h,o,v.ProjectionNode,s)}return l.jsxs(xs.Provider,{value:y,children:[f&&y.visualElement?l.jsx(f,{visualElement:y.visualElement,...h}):null,HC(t,u,QC(g,y.visualElement,d),g,m,e,s)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=S.forwardRef(a);return c[ZC]=t,c}function t0({layoutId:t}){const e=S.useContext(Ha).id;return e&&t!==void 0?e+"-"+t:t}function n0(t,e){const n=S.useContext(Vh).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?sr(!1,r,"lazy-strict-mode"):Gt(!1,r,"lazy-strict-mode")}}function r0(t){const e=Bh(),{drag:n,layout:r}=e;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function o0(t,e){if(typeof Proxy>"u")return pi;const n=new Map,r=(s,i)=>pi(s,i,t,e),o=(s,i)=>(process.env.NODE_ENV!=="production"&&qa(!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,pi(i,void 0,t,e)),n.get(i))})}const s0=(t,e)=>e.isSVG??bc(t)?new _w(e):new jw(e,{allowProjection:t!==S.Fragment});class i0 extends hn{constructor(e){super(e),e.animationState||(e.animationState=Vw(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ys(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let a0=0;class c0 extends hn{constructor(){super(...arguments),this.id=a0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Mn(this.node,i,a);if(c){const{transition:u,transitionEnd:d,...f}=c;for(const h in f)(s=this.node.getValue(h))==null||s.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!e);n&&!e&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const l0={animation:{Feature:i0},exit:{Feature:c0}};function Kr(t){return{point:{x:t.pageX,y:t.pageY}}}const u0=t=>e=>fc(e)&&t(e,Kr(e));function Mr(t,e,n,r){return Nr(t,e,u0(n),r)}const Yh=({current:t})=>t?t.ownerDocument.defaultView:null,Ju=(t,e)=>Math.abs(t-e);function d0(t,e){const n=Ju(t.x,e.x),r=Ju(t.y,e.y);return Math.sqrt(n**2+r**2)}const ed=new Set(["auto","scroll"]);class Xh{constructor(e,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=wo(this.lastRawMoveEventInfo,this.transformPagePoint));const m=mi(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,g=d0(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!g)return;const{point:v}=m,{timestamp:x}=_e;this.history.push({...v,timestamp:x});const{onStart:w,onMove:b}=this.handlers;y||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,m)},this.handlePointerMove=(m,y)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=wo(y,this.transformPagePoint),pe.update(this.updatePoint,!0)},this.handlePointerUp=(m,y)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=mi(m.type==="pointercancel"?this.lastMoveEventInfo:wo(y,this.transformPagePoint),this.history);this.startEvent&&g&&g(m,w),v&&v(m,w)},!fc(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=Kr(e),u=wo(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=_e;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,mi(u,this.history)),this.removeListeners=zr(Mr(this.contextWindow,"pointermove",this.handlePointerMove),Mr(this.contextWindow,"pointerup",this.handlePointerUp),Mr(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(ed.has(r.overflowX)||ed.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,o),pe.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),sn(this.updatePoint)}}function wo(t,e){return e?{point:e(t.point)}:t}function td(t,e){return{x:t.x-e.x,y:t.y-e.y}}function mi({point:t},e){return{point:t,delta:td(t,qh(e)),offset:td(t,f0(e)),velocity:h0(e,.1)}}function f0(t){return t[0]}function qh(t){return t[t.length-1]}function h0(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=qh(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>Xe(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&o.timestamp-r.timestamp>Xe(e)*2&&(r=t[1]);const s=ut(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 p0(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?ge(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?ge(n,t,r.max):Math.min(t,n)),t}function nd(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function m0(t,{top:e,left:n,bottom:r,right:o}){return{x:nd(t.x,n,o),y:nd(t.y,e,r)}}function rd(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function g0(t,e){return{x:rd(t.x,e.x),y:rd(t.y,e.y)}}function y0(t,e){let n=.5;const r=We(t),o=We(e);return o>r?n=Ar(e.min,e.max-r,t.min):r>o&&(n=Ar(t.min,t.max-o,e.min)),Nt(0,1,n)}function v0(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const fa=.35;function x0(t=fa){return t===!1?t=0:t===!0&&(t=fa),{x:od(t,"left","right"),y:od(t,"top","bottom")}}function od(t,e,n){return{min:sd(t,e),max:sd(t,n)}}function sd(t,e){return typeof t=="number"?t:t[e]||0}const b0=new WeakMap;class w0{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ee(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(Kr(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:y,onDragStart:g}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Yb(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tt(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Dt.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const C=b.layout.layoutBox[x];C&&(w=We(C)*(parseFloat(w)/100))}}this.originPoint[x]=w}),g&&pe.update(()=>g(f,h),!1,!0),ra(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:g,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=h;if(y&&this.currentDirection===null){this.currentDirection=S0(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),v&&pe.update(()=>v(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Xh(e,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Yh(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&pe.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:o}=this.getProps();if(!r||!Co(e,o,this.currentDirection))return;const s=this.getAxisMotionValue(e);let i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=p0(i,this.constraints[e],this.elastic[e])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;e&&zn(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=m0(r.layoutBox,e):this.constraints=!1,this.elastic=x0(n),o!==this.constraints&&!zn(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=v0(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!zn(e))return!1;const r=e.current;Gt(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=Sw(r,o.root,this.visualElement.getTransformPagePoint());let i=g0(o.layout.layoutBox,s);if(n){const a=n(bw(i));this.hasMutatedConstraints=!!a,a&&(i=gh(a))}return i}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Tt(d=>{if(!Co(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,y={type:"inertia",velocity:r?e[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return ra(this.visualElement,e),r.start(ac(e,r,0,n,this.visualElement,!1))}stopAnimation(){Tt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Tt(n=>{const{drag:r}=this.getProps();if(!Co(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n],c=s.get()||0;s.set(e[n]-ge(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Tt(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=y0({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tt(i=>{if(!Co(i,e,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(ge(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;b0.set(this.visualElement,this);const e=this.visualElement.current,n=Mr(e,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,m=h!==e&&ew(h);d&&f&&!m&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();zn(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=C0(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pe.read(o);const a=Nr(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Tt(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),i(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=fa,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function id(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function C0(t,e,n){const r=hu(t,id(n)),o=hu(e,id(n));return()=>{r(),o()}}function Co(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function S0(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class P0 extends hn{constructor(e){super(e),this.removeGroupControls=dt,this.removeListeners=dt,this.controls=new w0(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dt}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const gi=t=>(e,n)=>{t&&pe.update(()=>t(e,n),!1,!0)};class R0 extends hn{constructor(){super(...arguments),this.removePointerDownListener=dt}onPointerDown(e){this.session=new Xh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yh(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:gi(e),onStart:gi(n),onMove:gi(r),onEnd:(s,i)=>{delete this.session,o&&pe.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Mr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let yi=!1;class T0 extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),yi&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ho.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,e.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),yi=!0,o||e.layoutDependency!==n||n===void 0||e.isPresent!==s?i.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?i.promote():i.relegate()||pe.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),dc.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=e;yi=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Zh(t){const[e,n]=Lh(),r=S.useContext(Ha);return l.jsx(T0,{...t,layoutGroup:r,switchLayoutGroup:S.useContext(Hh),isPresent:e,safeToRemove:n})}const M0={pan:{Feature:R0},drag:{Feature:P0,ProjectionNode:$h,MeasureLayout:Zh}};function ad(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&pe.postRender(()=>s(e,Kr(e)))}class E0 extends hn{mount(){const{current:e}=this.node;e&&(this.unmount=qb(e,(n,r)=>(ad(this.node,r,"Start"),o=>ad(this.node,o,"End"))))}unmount(){}}class j0 extends hn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=zr(Nr(this.node.current,"focus",()=>this.onFocus()),Nr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function cd(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&pe.postRender(()=>s(e,Kr(e)))}class A0 extends hn{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=nw(e,(o,s)=>(cd(this.node,s,"Start"),(i,{success:a})=>cd(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ha=new WeakMap,vi=new WeakMap,D0=t=>{const e=ha.get(t.target);e&&e(t)},I0=t=>{t.forEach(D0)};function N0({root:t,...e}){const n=t||document;vi.has(n)||vi.set(n,{});const r=vi.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(I0,{root:t,...e})),r[o]}function k0(t,e,n){const r=N0(e);return ha.set(t,n),r.observe(t),()=>{ha.delete(t),r.unobserve(t)}}const _0={some:0,all:1};class O0 extends hn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=e,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:_0[o]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=d?f:h;m&&m(u)};this.stopObserver=k0(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some($0(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function $0({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const L0={inView:{Feature:O0},tap:{Feature:A0},focus:{Feature:j0},hover:{Feature:E0}},F0={layout:{ProjectionNode:$h,MeasureLayout:Zh}},V0={...l0,...L0,...M0,...F0},Qh=o0(V0,s0);function Jh(){const[t,e]=S.useState([]),n=S.useRef(0),r=S.useCallback(s=>{const a=s.currentTarget.getBoundingClientRect(),c=Math.max(a.width,a.height)*2.2,u=s.clientX-a.left-c/2,d=s.clientY-a.top-c/2,f=n.current++;e(h=>[...h,{id:f,x:u,y:d,size:c}])},[]),o=S.useCallback(s=>{e(i=>i.filter(a=>a.id!==s))},[]);return{ripples:t,add:r,remove:o}}function ep({ripples:t,onDone:e}){return l.jsx(Fh,{children:t.map(n=>l.jsx(Qh.span,{className:"btn-ripple",style:{left:n.x,top:n.y,width:n.size,height:n.size},initial:{scale:0,opacity:1},animate:{scale:1,opacity:[1,1,0]},transition:{scale:{duration:1,ease:[.4,0,.2,1]},opacity:{duration:1.2,times:[0,.6,1],ease:"easeOut"}},onAnimationComplete:()=>e(n.id)},n.id))})}const B0=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),kr=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,shape:o,block:s=!1,loading:i=!1,icon:a,iconPosition:c="start",disableRipple:u=!1,disabled:d,className:f,style:h,sx:m,children:y,onClick:g,...v},x){const{ripples:w,add:b,remove:C}=Jh(),P=d||i,R=_=>{P||(!u&&e!=="link"&&b(_),g==null||g(_))},{className:M,style:j,styleTag:T}=re(m,h,"btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",f),E=i?l.jsx(B0,{}):c==="start"?a:null,N=!i&&c==="end"?a:null;return l.jsxs("button",{ref:x,className:M,style:j,onClick:R,disabled:P,"aria-busy":i||void 0,...v,children:[T,l.jsxs("span",{className:"btn-content",children:[E,y,N]}),!u&&e!=="link"&&l.jsx(ep,{ripples:w,onDone:C})]})}),G0=S.forwardRef(function({orientation:e="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=Y("btn-group",e==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return l.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),U0=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,position:o="static",disableRipple:s=!1,icon:i,label:a,open:c=!0,className:u,onClick:d,disabled:f,...h},m){const{ripples:y,add:g,remove:v}=Jh(),x=C=>{f||(s||g(C),d==null||d(C))},w=a!=null,b=Y("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",w&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(Fh,{children:c&&l.jsxs(Qh.button,{ref:m,type:"button",className:b,onClick:x,disabled:f,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...h,children:[l.jsxs("span",{className:"btn-content",children:[i,w&&a]}),!s&&l.jsx(ep,{ripples:y,onDone:v})]})})}),z0=S.forwardRef(function({icon:e,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(kr,{ref:s,shape:n,variant:r,icon:e,...o})});var W0=Object.defineProperty,lr=(t,e)=>W0(t,"name",{value:e,configurable:!0}),tp=!!(typeof window<"u"&&window.document&&window.document.createElement);function H(t,e,{checkForDefaultPrevented:n=!0}={}){return lr(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}lr(H,"composeEventHandlers");function H0(t){var e;if(!tp)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}lr(H0,"getOwnerWindow");function pa(t){if(!tp)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}lr(pa,"getOwnerDocument");function np(t,e=!1){const{activeElement:n}=pa(t);if(!(n!=null&&n.nodeName))return null;if(rp(n)&&n.contentDocument)return np(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=pa(n).getElementById(r);if(o)return o}}return n}lr(np,"getActiveElement");function rp(t){return t.tagName==="IFRAME"}lr(rp,"isFrame");var Te=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},K0=Object.defineProperty,Y0=(t,e)=>K0(t,"name",{value:e,configurable:!0}),ld=p[" useEffectEvent ".trim().toString()],ud=p[" useInsertionEffect ".trim().toString()];function op(t){if(typeof ld=="function")return ld(t);const e=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ud=="function"?ud(()=>{e.current=t}):Te(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}Y0(op,"useEffectEvent");var X0=Object.defineProperty,Yr=(t,e)=>X0(t,"name",{value:e,configurable:!0}),q0=p[" useInsertionEffect ".trim().toString()]||Te;function be({prop:t,defaultProp:e,onChange:n=Yr(()=>{},"onChange"),caller:r}){const[o,s,i]=sp({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:o,u=p.useCallback(d=>{var f;if(a){const h=ip(d)?d(t):d;h!==t&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,t,s,i]);return[c,u]}Yr(be,"useControllableState");function sp({defaultProp:t,onChange:e}){const[n,r]=p.useState(t),o=p.useRef(n),s=p.useRef(e);return q0(()=>{s.current=e},[e]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}Yr(sp,"useUncontrolledState");function ip(t){return typeof t=="function"}Yr(ip,"isFunction");var dd=Symbol("RADIX:SYNC_STATE");function Z0(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=e,c=o!==void 0,u=op(i),d=[{...n,state:s}];r&&d.push(r);const[f,h]=p.useReducer((v,x)=>{if(x.type===dd)return{...v,state:x.state};const w=t(v,x);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,y=p.useRef(m);p.useEffect(()=>{y.current!==m&&(y.current=m,c||u(m))},[m,y,c]);const g=p.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return p.useEffect(()=>{c&&!Object.is(o,f.state)&&h({type:dd,state:o})},[o,f.state,c]),[g,h]}Yr(Z0,"useControllableStateReducer");var Q0=Object.defineProperty,wc=(t,e)=>Q0(t,"name",{value:e,configurable:!0});function ma(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}wc(ma,"setRef");function ap(...t){return e=>{let n=!1;const r=t.map(o=>{const s=ma(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ma(t[o],null)}}}}wc(ap,"composeRefs");function oe(...t){return p.useCallback(ap(...t),t)}wc(oe,"useComposedRefs");var J0=Object.defineProperty,bt=(t,e)=>J0(t,"name",{value:e,configurable:!0});function kt(t){const e=p.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];ga(o)&&typeof So=="function"&&(o=So(o._payload)),p.Children.forEach(o,h=>{var m;if(fp(h)){a=!0;const y=h;let g="child"in y.props?y.props.child:y.props.children;ga(g)&&typeof So=="function"&&(g=So(g._payload)),i=eS(y,g),c.push((m=i==null?void 0:i.props)==null?void 0:m.children)}else c.push(h)}),i?i=p.cloneElement(i,void 0,c):!a&&p.Children.count(o)===1&&p.isValidElement(o)&&(i=o);const u=i?dp(i):void 0,d=oe(r,u);if(!i){if(o||o===0)throw new Error(a?rS(t):nS(t));return o}const f=up(s,i.props??{});return i.type!==p.Fragment&&(f.ref=r?d:u),p.cloneElement(i,f)});return e.displayName=`${t}.Slot`,e}bt(kt,"createSlot");var cp=Symbol.for("radix.slottable");function lp(t){const e=bt(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=cp,e}bt(lp,"createSlottable");var eS=bt((t,e)=>{if("child"in t.props){const n=t.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,t.props.children(n.props.children)):null}return p.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function up(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}bt(up,"mergeProps");function dp(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}bt(dp,"getElementRef");function fp(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===cp}bt(fp,"isSlottable");var tS=Symbol.for("react.lazy");function ga(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===tS&&"_payload"in t&&hp(t._payload)}bt(ga,"isLazyComponent");function hp(t){return typeof t=="object"&&t!==null&&"then"in t}bt(hp,"isPromiseLike");var nS=bt(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rS=bt(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),So=p[" use ".trim().toString()],oS=Object.defineProperty,sS=(t,e)=>oS(t,"name",{value:e,configurable:!0}),iS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=iS.reduce((t,e)=>{const n=kt(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Cc(t,e){t&&Ur.flushSync(()=>t.dispatchEvent(e))}sS(Cc,"dispatchDiscreteCustomEvent");var aS=Object.defineProperty,cS=(t,e)=>aS(t,"name",{value:e,configurable:!0}),lS="Toggle",pp=p.forwardRef(cS(function(e,n){const{pressed:r,defaultPressed:o,onPressedChange:s,...i}=e,[a,c]=be({prop:r,onChange:s,defaultProp:o??!1,caller:lS});return l.jsx(ne.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:n,onClick:H(e.onClick,()=>{e.disabled||c(!a)})})},"Toggle")),uS=pp;const dS=S.forwardRef(function({variant:e="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},u){const d=Y("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return l.jsx(uS,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});var fS=Object.defineProperty,lt=(t,e)=>fS(t,"name",{value:e,configurable:!0});function hS(t,e){const n=p.createContext(e);n.displayName=t+"Context";const r=lt(s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=p.useContext(n);if(c)return c;if(e!==void 0)return e;if(!a)throw new Error(`\`${s}\` must be used within \`${t}\``)}return lt(o,"useContext"),[r,o]}lt(hS,"createContext");function Ce(t,e=[]){let n=[];function r(s,i){const a=p.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=lt(f=>{var x;const{scope:h,children:m,...y}=f,g=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var x;const{optional:y=!1}=m,g=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useContext(g);if(v)return v;if(i!==void 0)return i;if(!y)throw new Error(`\`${f}\` must be used within \`${s}\``)}return lt(d,"useContext"),[u,d]}lt(r,"createContext");const o=lt(()=>{const s=n.map(i=>p.createContext(i));return lt(function(a){const c=(a==null?void 0:a[t])||s;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=t,[r,mp(o,...e)]}lt(Ce,"createContextScope");function mp(...t){const e=t[0];if(t.length===1)return e;const n=lt(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return lt(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}lt(mp,"composeContextScopes");var pS=Object.defineProperty,Ne=(t,e)=>pS(t,"name",{value:e,configurable:!0});function ur(t){const e=t+"CollectionProvider",[n,r]=Ce(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=Ne(g=>{const{scope:v,children:x}=g,w=p.useRef(null),b=p.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:x})},"CollectionProvider");i.displayName=e;const a=t+"CollectionSlot",c=kt(a),u=p.forwardRef((g,v)=>{const{scope:x,children:w}=g,b=s(a,x),C=oe(v,b.collectionRef);return l.jsx(c,{ref:C,children:w})});u.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",h=kt(d),m=p.forwardRef((g,v)=>{const{scope:x,children:w,...b}=g,C=p.useRef(null),P=oe(v,C),R=s(d,x);return p.useEffect(()=>(R.itemMap.set(C,{ref:C,...b}),()=>void R.itemMap.delete(C))),l.jsx(h,{[f]:"",ref:P,children:w})});m.displayName=d;function y(g){const v=s(t+"CollectionConsumer",g);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((R,M)=>b.indexOf(R.ref.current)-b.indexOf(M.ref.current))},[v.collectionRef,v.itemMap])}return Ne(y,"useCollection"),[{Provider:i,Slot:u,ItemSlot:m},y,r]}Ne(ur,"createCollection");var fd=new WeakMap,Pe,ot,xi=(ot=class extends Map{constructor(n){super(n);Ul(this,Pe);ti(this,Pe,[...super.keys()]),fd.set(this,!0)}set(n,r){return fd.get(this)&&(this.has(n)?Ve(this,Pe)[Ve(this,Pe).indexOf(n)]=n:Ve(this,Pe).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Ve(this,Pe).length,a=Sc(n);let c=a>=0?a:i+a;const u=c<0||c>=i?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(r,o),this;const d=this.size+(s?0:1);a<0&&c++;const f=[...Ve(this,Pe)];let h,m=!1;for(let y=c;y<d;y++)if(c===y){let g=f[y];f[y]===r&&(g=f[y+1]),s&&this.delete(r),h=this.get(g),this.set(r,o)}else{!m&&f[y-1]===r&&(m=!0);const g=f[m?y:y-1],v=h;h=this.get(g),this.delete(g),this.set(g,v)}return this}with(n,r,o){const s=new ot(this);return s.insert(n,r,o),s}before(n){const r=Ve(this,Pe).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Ve(this,Pe).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Ve(this,Pe).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=Ve(this,Pe).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ti(this,Pe,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Ve(this,Pe).splice(Ve(this,Pe).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Ko(Ve(this,Pe),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Ko(Ve(this,Pe),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Ve(this,Pe).indexOf(n)}keyAt(n){return Ko(Ve(this,Pe),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new ot(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new ot(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const a of this)s===0&&n.length===1?i=a:i=Reflect.apply(r,this,[i,a,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const a=this.at(i);i===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new ot(r)}toReversed(){const n=new ot;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new ot(r)}slice(n,r){const o=new ot;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const a=this.keyAt(i),c=this.get(a);o.set(a,c)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Pe=new WeakMap,Ne(ot,"OrderedDict"),ot);function Ko(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=gp(t,e);return n===-1?void 0:t[n]}Ne(Ko,"at");function gp(t,e){const n=t.length,r=Sc(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Ne(gp,"toSafeIndex");function Sc(t){return t!==t||t===0?0:Math.trunc(t)}Ne(Sc,"toSafeInteger");function mS(t){const e=t+"CollectionProvider",[n,r]=Ce(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new xi,setItemMap:Ne(()=>{},"setItemMap")}),i=Ne(({state:b,...C})=>b?l.jsx(c,{...C,state:b}):l.jsx(a,{...C}),"CollectionProvider");i.displayName=e;const a=Ne(b=>{const C=v();return l.jsx(c,{...b,state:C})},"CollectionInit");a.displayName=e+"Init";const c=Ne(b=>{const{scope:C,children:P,state:R}=b,M=p.useRef(null),[j,T]=p.useState(null),E=oe(M,T),[N,_]=R;return p.useEffect(()=>{if(!j)return;const F=xp(()=>{});return F.observe(j,{childList:!0,subtree:!0}),()=>{F.disconnect()}},[j]),l.jsx(o,{scope:C,itemMap:N,setItemMap:_,collectionRef:E,collectionRefObject:M,collectionElement:j,children:P})},"CollectionProviderImpl");c.displayName=e+"Impl";const u=t+"CollectionSlot",d=kt(u),f=p.forwardRef((b,C)=>{const{scope:P,children:R}=b,M=s(u,P),j=oe(C,M.collectionRef);return l.jsx(d,{ref:j,children:R})});f.displayName=u;const h=t+"CollectionItemSlot",m="data-radix-collection-item",y=kt(h),g=p.forwardRef((b,C)=>{const{scope:P,children:R,...M}=b,j=p.useRef(null),[T,E]=p.useState(null),N=oe(C,j,E),_=s(h,P),{setItemMap:F}=_,U=p.useRef(M);yp(U.current,M)||(U.current=M);const J=U.current;return p.useEffect(()=>{const z=J;return F(I=>T?I.has(T)?I.set(T,{...z,element:T}).toSorted(ya):(I.set(T,{...z,element:T}),I.toSorted(ya)):I),()=>{F(I=>!T||!I.has(T)?I:(I.delete(T),new xi(I)))}},[T,J,F]),l.jsx(y,{[m]:"",ref:N,children:R})});g.displayName=h;function v(){return p.useState(new xi)}Ne(v,"useInitCollection");function x(b){const{itemMap:C}=s(t+"CollectionConsumer",b);return C}return Ne(x,"useCollection"),[{Provider:i,Slot:f,ItemSlot:g},{createCollectionScope:r,useCollection:x,useInitCollection:v}]}Ne(mS,"createCollection");function yp(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}Ne(yp,"shallowEqual");function vp(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Ne(vp,"isElementPreceding");function ya(t,e){return!t[1].element||!e[1].element?0:vp(t[1].element,e[1].element)?-1:1}Ne(ya,"sortByDocumentPosition");function xp(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Ne(xp,"getChildListObserver");var gS=Object.defineProperty,yS=(t,e)=>gS(t,"name",{value:e,configurable:!0}),vS=p[" useId ".trim().toString()]||(()=>{}),xS=0;function $e(t){const[e,n]=p.useState(vS());return Te(()=>{t||n(r=>r??String(xS++))},[t]),t||(e?`radix-${e}`:"")}yS($e,"useId");var bS=Object.defineProperty,wS=(t,e)=>bS(t,"name",{value:e,configurable:!0});function qe(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}wS(qe,"useCallbackRef");var CS=Object.defineProperty,SS=(t,e)=>CS(t,"name",{value:e,configurable:!0}),PS=p.createContext(void 0);function Kt(t){const e=p.useContext(PS);return t||e||"ltr"}SS(Kt,"useDirection");var RS=Object.defineProperty,Pc=(t,e)=>RS(t,"name",{value:e,configurable:!0}),bi=!1;function bp(){const[t,e]=p.useState(bi);return p.useEffect(()=>{bi||(bi=!0,e(!0))},[]),t}Pc(bp,"useIsHydrated");var wp=p[" useSyncExternalStore ".trim().toString()];function Cp(){return()=>{}}Pc(Cp,"subscribe");function Sp(){return wp(Cp,()=>!0,()=>!1)}Pc(Sp,"useIsHydratedModern");var TS=typeof wp=="function"?Sp:bp,MS=Object.defineProperty,kn=(t,e)=>MS(t,"name",{value:e,configurable:!0}),wi="rovingFocusGroup.onEntryFocus",ES={bubbles:!1,cancelable:!0},bs="RovingFocusGroup",[va,Pp,jS]=ur(bs),[AS,pn]=Ce(bs,[jS]),[DS,IS]=AS(bs),NS=p.forwardRef(kn(function(e,n){return l.jsx(va.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(va.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(kS,{...e,ref:n})})})},"RovingFocusGroup")),kS=p.forwardRef(kn(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=p.useRef(null),y=oe(n,m),g=Kt(i),[v,x]=be({prop:a,defaultProp:c??null,onChange:u,caller:bs}),[w,b]=p.useState(!1),C=qe(d),P=Pp(r),R=p.useRef(!1),[M,j]=p.useState(0);return p.useEffect(()=>{const T=m.current;if(T)return T.addEventListener(wi,C),()=>T.removeEventListener(wi,C)},[C]),l.jsx(DS,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(T=>x(T),[x]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(T=>T+1),[]),onFocusableItemRemove:p.useCallback(()=>j(T=>T-1),[]),children:l.jsx(ne.div,{tabIndex:w||M===0?-1:0,"data-orientation":o,...h,ref:y,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{R.current=!0}),onFocus:H(e.onFocus,T=>{const E=!R.current;if(T.target===T.currentTarget&&E&&!w){const N=new CustomEvent(wi,ES);if(T.currentTarget.dispatchEvent(N),!N.defaultPrevented){const _=P().filter(I=>I.focusable),F=_.find(I=>I.active),U=_.find(I=>I.id===v),z=[F,U,..._].filter(Boolean).map(I=>I.ref.current);Rc(z,f)}}R.current=!1}),onBlur:H(e.onBlur,()=>b(!1))})})},"RovingFocusGroupImpl")),_S="RovingFocusGroupItem",OS=p.forwardRef(kn(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=e,u=$e(),d=i||u,f=IS(_S,r),h=f.currentTabStopId===d,m=Pp(r),{onFocusableItemAdd:y,onFocusableItemRemove:g,currentTabStopId:v}=f,x=TS();return Te(()=>{if(!(!x||!o))return y(),()=>g()},[x,o,y,g]),p.useEffect(()=>{if(!(x||!o))return y(),()=>g()},[x,o,y,g]),l.jsx(va.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:l.jsx(ne.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:H(e.onMouseDown,w=>{o?f.onItemFocus(d):w.preventDefault()}),onFocus:H(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:H(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const b=Tp(w,f.orientation,f.dir);if(b!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let P=m().filter(R=>R.focusable).map(R=>R.ref.current);if(b==="last")P.reverse();else if(b==="prev"||b==="next"){b==="prev"&&P.reverse();const R=P.indexOf(w.currentTarget);P=f.loop?Mp(P,R+1):P.slice(R+1)}setTimeout(()=>Rc(P))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:v!=null}):a})})},"RovingFocusGroupItem")),$S={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Rp(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}kn(Rp,"getDirectionAwareKey");function Tp(t,e,n){const r=Rp(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $S[r]}kn(Tp,"getFocusIntent");function Rc(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}kn(Rc,"focusFirst");function Mp(t,e){return t.map((n,r)=>t[(e+r)%t.length])}kn(Mp,"wrapArray");var ws=NS,Cs=OS,LS=Object.defineProperty,an=(t,e)=>LS(t,"name",{value:e,configurable:!0}),dr="ToggleGroup",[Ep,T2]=Ce(dr,[pn]),jp=pn(),FS=p.forwardRef(an(function(e,n){const{type:r,...o}=e;if(r==="single"){const s=o;return l.jsx(VS,{role:"radiogroup",...s,ref:n})}if(r==="multiple"){const s=o;return l.jsx(BS,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${dr}\``)},"ToggleGroup")),[Ap,Dp]=Ep(dr),VS=p.forwardRef(an(function(e,n){const{value:r,defaultValue:o,onValueChange:s=an(()=>{},"onValueChange"),...i}=e,[a,c]=be({prop:r,defaultProp:o??"",onChange:s,caller:dr});return l.jsx(Ap,{scope:e.__scopeToggleGroup,type:"single",value:p.useMemo(()=>a?[a]:[],[a]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:l.jsx(Ip,{...i,ref:n})})},"ToggleGroupImplSingle")),BS=p.forwardRef(an(function(e,n){const{value:r,defaultValue:o,onValueChange:s=an(()=>{},"onValueChange"),...i}=e,[a,c]=be({prop:r,defaultProp:o??[],onChange:s,caller:dr}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(Ap,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:u,onItemDeactivate:d,children:l.jsx(Ip,{...i,ref:n})})},"ToggleGroupImplMultiple")),[GS,US]=Ep(dr),Ip=p.forwardRef(an(function(e,n){const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:c=!0,...u}=e,d=jp(r),f=Kt(a),h={dir:f,...u};return l.jsx(GS,{scope:r,rovingFocus:s,disabled:o,children:s?l.jsx(ws,{asChild:!0,...d,orientation:i,dir:f,loop:c,children:l.jsx(ne.div,{...h,ref:n})}):l.jsx(ne.div,{...h,ref:n})})},"ToggleGroupImpl")),xa="ToggleGroupItem",zS=p.forwardRef(an(function(e,n){const r=Dp(xa,e.__scopeToggleGroup),o=US(xa,e.__scopeToggleGroup),s=jp(e.__scopeToggleGroup),i=r.value.includes(e.value),a=o.disabled||e.disabled,c={...e,pressed:i,disabled:a},u=p.useRef(null);return o.rovingFocus?l.jsx(Cs,{asChild:!0,...s,focusable:!a,active:i,ref:u,children:l.jsx(hd,{...c,ref:n})}):l.jsx(hd,{...c,ref:n})},"ToggleGroupItem")),hd=p.forwardRef(an(function(e,n){const{__scopeToggleGroup:r,value:o,...s}=e,i=Dp(xa,r),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},c=i.type==="single"?a:void 0;return l.jsx(pp,{...c,...s,ref:n,onPressedChange:u=>{u?i.onItemActivate(o):i.onItemDeactivate(o)}})},"ToggleGroupItemImpl"));const Np=S.createContext({variant:"outline",color:"primary"}),WS=S.forwardRef(function({variant:e="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},u){const d=Y("btn-group",o==="spaced"&&"spaced",s&&"round",i);return l.jsx(Np.Provider,{value:{variant:e,color:n,size:r},children:l.jsx(FS,{ref:u,className:d,...c,children:a})})}),HS=S.forwardRef(function({icon:e,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=S.useContext(Np),d=Y("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(zS,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[e,o]})})});/**
10
10
  * @license lucide-react v1.8.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */const Ip=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
14
+ */const kp=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
15
15
  * @license lucide-react v1.8.0 - ISC
16
16
  *
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
- */const H1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
19
+ */const KS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
20
20
  * @license lucide-react v1.8.0 - ISC
21
21
  *
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
- */const Y1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
24
+ */const YS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
25
25
  * @license lucide-react v1.8.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
- */const jd=e=>{const t=Y1(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
29
+ */const pd=t=>{const e=YS(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
30
30
  * @license lucide-react v1.8.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
- */var Ni={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
34
+ */var Ci={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
35
35
  * @license lucide-react v1.8.0 - ISC
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 X1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},q1=C.createContext({}),Z1=()=>C.useContext(q1),Q1=C.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:m=""}=Z1()??{},y=r??f?Number(n??d)*24/Number(t??u):n??d;return C.createElement("svg",{ref:c,...Ni,width:t??u??Ni.width,height:t??u??Ni.height,stroke:e??h,strokeWidth:y,className:Ip("lucide",m,o),...!s&&!X1(a)&&{"aria-hidden":"true"},...a},[...i.map(([g,v])=>C.createElement(g,v)),...Array.isArray(s)?s:[s]])});/**
39
+ */const XS=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},qS=S.createContext({}),ZS=()=>S.useContext(qS),QS=S.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>{const{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:m=""}=ZS()??{},y=r??f?Number(n??d)*24/Number(e??u):n??d;return S.createElement("svg",{ref:c,...Ci,width:e??u??Ci.width,height:e??u??Ci.height,stroke:t??h,strokeWidth:y,className:kp("lucide",m,o),...!s&&!XS(a)&&{"aria-hidden":"true"},...a},[...i.map(([g,v])=>S.createElement(g,v)),...Array.isArray(s)?s:[s]])});/**
40
40
  * @license lucide-react v1.8.0 - ISC
41
41
  *
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
- */const me=(e,t)=>{const n=C.forwardRef(({className:r,...o},s)=>C.createElement(Q1,{ref:s,iconNode:t,className:Ip(`lucide-${H1(jd(e))}`,`lucide-${e}`,r),...o}));return n.displayName=jd(e),n};/**
44
+ */const ye=(t,e)=>{const n=S.forwardRef(({className:r,...o},s)=>S.createElement(QS,{ref:s,iconNode:e,className:kp(`lucide-${KS(pd(t))}`,`lucide-${t}`,r),...o}));return n.displayName=pd(t),n};/**
45
45
  * @license lucide-react v1.8.0 - ISC
46
46
  *
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
- */const J1=[["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"}]],eP=me("calendar",J1);/**
49
+ */const JS=[["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"}]],eP=ye("calendar",JS);/**
50
50
  * @license lucide-react v1.8.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */const tP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jt=me("check",tP);/**
54
+ */const tP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cn=ye("check",tP);/**
55
55
  * @license lucide-react v1.8.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const nP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Kr=me("chevron-down",nP);/**
59
+ */const nP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Xr=ye("chevron-down",nP);/**
60
60
  * @license lucide-react v1.8.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */const rP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Uo=me("chevron-left",rP);/**
64
+ */const rP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Yo=ye("chevron-left",rP);/**
65
65
  * @license lucide-react v1.8.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const oP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yt=me("chevron-right",oP);/**
69
+ */const oP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],rn=ye("chevron-right",oP);/**
70
70
  * @license lucide-react v1.8.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */const sP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Dp=me("chevron-up",sP);/**
74
+ */const sP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_p=ye("chevron-up",sP);/**
75
75
  * @license lucide-react v1.8.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const iP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],kp=me("chevrons-up-down",iP);/**
79
+ */const iP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Op=ye("chevrons-up-down",iP);/**
80
80
  * @license lucide-react v1.8.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const aP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],_p=me("circle-alert",aP);/**
84
+ */const aP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$p=ye("circle-alert",aP);/**
85
85
  * @license lucide-react v1.8.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const cP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Op=me("circle-check",cP);/**
89
+ */const cP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Lp=ye("circle-check",cP);/**
90
90
  * @license lucide-react v1.8.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const lP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$p=me("circle",lP);/**
94
+ */const lP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fp=ye("circle",lP);/**
95
95
  * @license lucide-react v1.8.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const uP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dP=me("clock",uP);/**
99
+ */const uP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dP=ye("clock",uP);/**
100
100
  * @license lucide-react v1.8.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const fP=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],hP=me("cloud-upload",fP);/**
104
+ */const fP=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],hP=ye("cloud-upload",fP);/**
105
105
  * @license lucide-react v1.8.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const pP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],mP=me("ellipsis",pP);/**
109
+ */const pP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],mP=ye("ellipsis",pP);/**
110
110
  * @license lucide-react v1.8.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const gP=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],yP=me("eye-off",gP);/**
114
+ */const gP=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],yP=ye("eye-off",gP);/**
115
115
  * @license lucide-react v1.8.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const vP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],xP=me("eye",vP);/**
119
+ */const vP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],xP=ye("eye",vP);/**
120
120
  * @license lucide-react v1.8.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const bP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],wP=me("file",bP);/**
124
+ */const bP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],wP=ye("file",bP);/**
125
125
  * @license lucide-react v1.8.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const CP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],SP=me("folder-open",CP);/**
129
+ */const CP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],SP=ye("folder-open",CP);/**
130
130
  * @license lucide-react v1.8.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const RP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],PP=me("folder",RP);/**
134
+ */const PP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],RP=ye("folder",PP);/**
135
135
  * @license lucide-react v1.8.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const TP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Lp=me("info",TP);/**
139
+ */const TP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Vp=ye("info",TP);/**
140
140
  * @license lucide-react v1.8.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const EP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Fp=me("loader-circle",EP);/**
144
+ */const MP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Bp=ye("loader-circle",MP);/**
145
145
  * @license lucide-react v1.8.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const MP=[["path",{d:"M5 12h14",key:"1ays0h"}]],AP=me("minus",MP);/**
149
+ */const EP=[["path",{d:"M5 12h14",key:"1ays0h"}]],jP=ye("minus",EP);/**
150
150
  * @license lucide-react v1.8.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const NP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],jP=me("panel-left",NP);/**
154
+ */const AP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],DP=ye("panel-left",AP);/**
155
155
  * @license lucide-react v1.8.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const IP=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Vp=me("search",IP);/**
159
+ */const IP=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Gp=ye("search",IP);/**
160
160
  * @license lucide-react v1.8.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const DP=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Bp=me("triangle-alert",DP);/**
164
+ */const NP=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Up=ye("triangle-alert",NP);/**
165
165
  * @license lucide-react v1.8.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const kP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vt=me("x",kP),_P=C.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:m,defaultValue:y,onChange:g,...v},x){const b=m!==void 0,[w,S]=C.useState(y!=null?String(y):""),R=b?String(m??""):w,P=C.useRef(null);C.useImperativeHandle(x,()=>P.current,[]);const[T,A]=C.useState(!1),E=a&&T&&c==="password"?"text":c,M=s&&!u&&R!=="",D=M||a,k=r!=null||o!=null||D,V=O=>{b||S(O.target.value),g==null||g(O)},W=O=>{var j;O.preventDefault(),b||S("");const N=P.current;if(N){const H=(j=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:j.set;H==null||H.call(N,""),N.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},Z=re(k?void 0:h,k?void 0:f,"input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,d),G=l.jsx("input",{ref:P,type:E,className:Z.className,style:Z.style,disabled:u,value:b?m:void 0,defaultValue:b?void 0:y,onChange:V,...v});if(!k)return l.jsxs(l.Fragment,{children:[Z.styleTag,G]});const _=re(h,f,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!D&&"has-suffix",D&&"has-action");return l.jsxs("span",{className:_.className,style:_.style,children:[_.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),G,o!=null&&!D&&l.jsx("span",{className:"cny-input-suffix",children:o}),M&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:W,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Vt,{size:14,"aria-hidden":"true"})}),a&&c==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>A(O=>!O),"aria-label":T?"Hide password":"Show password","aria-pressed":T,children:T?l.jsx(yP,{size:14,"aria-hidden":"true"}):l.jsx(xP,{size:14,"aria-hidden":"true"})})]})}),OP=C.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]})}),$P={info:Lp,success:Op,warning:Bp,danger:_p};function LP({color:e}){const t=$P[e];return l.jsx(t,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const FP=C.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},m){const y=c!==!1,g=c&&c!==!0?c:l.jsx(LP,{color:t}),{className:v,style:x,styleTag:b}=re(i,s,"alert",t,n&&"solid",o),w=t==="danger"?"alert":"status";return l.jsxs("div",{ref:m,role:w,className:v,style:x,...h,children:[b,y&&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.jsx(Vt,{size:14,"aria-hidden":"true"})})]})}),VP=C.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:m}=re(a,i,"avatar",t!=="md"&&t,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[m,r?l.jsx("img",{src:r,alt:o??""}):c]})}),BP=C.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("avatar-stack",t),...r,children:n})}),GP=C.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:m}=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:[m,l.jsx("span",{className:"progress-bar"})]})}),UP=C.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:m}=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:[m,r&&l.jsxs("span",{children:[u,"%"]})]})}),WP={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},Gp=C.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 m={...WP[r],maxHeight:o,maxWidth:s,...c??{}},{className:y,style:g,styleTag:v}=re(u,m,i?"cny-scroll-region":"cny-scroll",t!=="default"&&t,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:y,style:g,...f,children:[v,d]})}),KP=C.forwardRef(function(t,n){return l.jsx(Gp,{ref:n,region:!0,...t})}),Pa=C.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})}),zP=C.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]})}),HP=C.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]})}),YP=C.forwardRef(function({className:t,children:n,...r},o){return l.jsx("nav",{ref:o,className:Y("cny-navbar-nav",t),...r,children:n})}),XP=C.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})}),qP=C.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("cny-navbar-actions",t),...r,children:n})}),ZP=C.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:m}=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:[m,c]})}),QP=C.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("cny-sidebar-header",t),...r,children:n})}),JP=C.forwardRef(function({className:t,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("cny-sidebar-footer",t),...r,children:n})}),eT=C.forwardRef(function({collapsed:t=!1,onClick:n,className:r,children:o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":!t,"aria-label":t?"Expand sidebar":"Collapse sidebar",className:Y("cny-sidebar-toggle",t&&"collapsed",r),onClick:n,...s,children:o??l.jsx(jP,{size:16,"aria-hidden":"true"})})});function Ta(e){const t=Array.from(e.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(t.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const tT=C.forwardRef(function({title:t,className:n,children:r,...o},s){const i=C.useRef(null),a=C.useCallback(c=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(g=>!g.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(g=>g===document.activeElement);let m=h;switch(c.key){case"ArrowDown":c.preventDefault(),m=h<f.length-1?h+1:0;break;case"ArrowUp":c.preventDefault(),m=h<=0?f.length-1:h-1;break;case"Home":c.preventDefault(),m=0;break;case"End":c.preventDefault(),m=f.length-1;break;default:return}const y=f[m];y&&y!==document.activeElement&&(f.forEach(g=>g.setAttribute("tabindex","-1")),y.setAttribute("tabindex","0"),y.focus())},[]);return C.useLayoutEffect(()=>{const c=i.current;if(!c||(Ta(c),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>Ta(c));return u.observe(c,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),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",{ref:i,className:"cny-sidebar-nav",onKeyDown:a,children:r})]})}),nT=C.forwardRef(function({active:t=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){const u=C.useRef(null),d=C.useId();C.useLayoutEffect(()=>{const h=u.current;if(!h)return;const m=h.closest('[class*="cny-sidebar-nav"]');m&&Ta(m)},[t,n]);const f=typeof i=="string"&&!a["aria-label"]?i:void 0;return l.jsxs("a",{ref:h=>{u.current=h,typeof c=="function"?c(h):c&&(c.current=h)},"data-cny-sidebar-item":d,"aria-current":t?"page":void 0,"aria-disabled":n||void 0,"aria-label":f,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 rT(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 jn=C.forwardRef(function({as:t,className:n,style:r,children:o,...s},i){const a=t??"div",{layoutProps:c,domProps:u}=oT(s),{sx:d,...f}=c,h=d?lc(d):void 0,m=Y(...rT(f),h==null?void 0:h.className,n),y=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,g=C.createElement(a,{ref:i,className:m||void 0,style:y,...u},o);return h!=null&&h.css?C.createElement(C.Fragment,null,C.createElement("style",{dangerouslySetInnerHTML:{__html:h.css}}),g):g});function oT(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 sT=C.forwardRef(function(t,n){return l.jsx(jn,{ref:n,display:"flex",direction:"column",...t})}),iT=C.forwardRef(function(t,n){const{align:r="center",...o}=t;return l.jsx(jn,{ref:n,display:"flex",direction:"row",align:r,...o})}),Id=e=>e.map(t=>`minmax(0,${t}fr)`).join(" "),aT=C.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=Id(r);else{const f={};for(const[h,m]of Object.entries(r))m&&(f[h]=Id(m));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(jn,{ref:c,display:"grid",className:Y(!u&&t&&`grid-cols-${t}`,s),sx:d,...a})}),cT=C.forwardRef(function({size:t="lg",className:n,...r},o){return l.jsx(jn,{ref:o,className:Y("cny-container",t,n),...r})}),lT=C.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})]})}),uT=C.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})}),dT=C.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]})}),fT=C.forwardRef(function(t,n){return l.jsx(jn,{ref:n,display:"flex",align:"center",justify:"center",...t})}),hT=C.forwardRef(function(t,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=t;return l.jsx(jn,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),pT={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"},mT=C.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 m=t??pT[n],{className:y,style:g,styleTag:v}=re(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return C.createElement(m,{ref:h,className:y,style:g,...f},v,d)});function gT({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 m=C.useId(),y=C.Children.only(f),g=y.props.id??m,v=n!=null&&n!==!1,x=a??(v?"danger":"default"),b=t||n?`${g}-hint`:void 0,w=C.cloneElement(y,{id:g,"aria-invalid":v||y.props["aria-invalid"]||void 0,"aria-describedby":b??y.props["aria-describedby"],className:Y(y.props.className,x!=="default"&&x)}),S=i!=null&&s!=null&&s>i?"danger":"default",{className:R,style:P,styleTag:T}=re(d,u,"cny-field",c);return l.jsxs("div",{className:R,style:P,...h,children:[T,(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})]}),w,(n||t)&&l.jsx("span",{id:b,className:Y("cny-field-hint",x!=="default"&&x),children:n??t})]})}const yT=C.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=C.useRef(null);C.useImperativeHandle(d,()=>f.current,[]);const h=C.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const w=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,w)}px`,x.style.overflowY=x.scrollHeight>w?"auto":"hidden"},[r,o]);C.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const m=x=>{c==null||c(x),r&&h()},{className:y,style:g,styleTag:v}=re(a,i,"input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[v,l.jsx("textarea",{ref:f,className:y,style:g,onChange:m,...u})]})});function ss(e,[t,n]){return Math.min(n,Math.max(t,e))}function vT(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e);p.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 xT="DismissableLayer",Ea="dismissableLayer.update",bT="dismissableLayer.pointerDownOutside",wT="dismissableLayer.focusOutside",Dd,Up=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lr=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=p.useContext(Up),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),y=se(t,T=>f(T)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(v),b=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,R=RT(T=>{const A=T.target,E=[...u.branches].some(M=>M.contains(A));!S||E||(o==null||o(T),i==null||i(T),T.defaultPrevented||a==null||a())},h),P=PT(T=>{const A=T.target;[...u.branches].some(M=>M.contains(A))||(s==null||s(T),i==null||i(T),T.defaultPrevented||a==null||a())},h);return vT(T=>{b===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Dd=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),kd(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Dd)}},[d,h,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),kd())},[d,u]),p.useEffect(()=>{const T=()=>m({});return document.addEventListener(Ea,T),()=>document.removeEventListener(Ea,T)},[]),l.jsx(ee.div,{...c,ref:y,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,P.onFocusCapture),onBlurCapture:q(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,R.onPointerDownCapture)})});lr.displayName=xT;var CT="DismissableLayerBranch",ST=p.forwardRef((e,t)=>{const n=p.useContext(Up),r=p.useRef(null),o=se(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ee.div,{...e,ref:o})});ST.displayName=CT;function RT(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Wp(bT,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 PT(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!r.current&&Wp(wT,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 kd(){const e=new CustomEvent(Ea);document.dispatchEvent(e)}function Wp(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?vp(o,s):o.dispatchEvent(s)}var ji=0;function Ps(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_d()),document.body.insertAdjacentElement("beforeend",e[1]??_d()),ji++,()=>{ji===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ji--}},[])}function _d(){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 Ii="focusScope.autoFocusOnMount",Di="focusScope.autoFocusOnUnmount",Od={bubbles:!1,cancelable:!0},TT="FocusScope",zr=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=p.useState(null),u=mt(o),d=mt(s),f=p.useRef(null),h=se(t,g=>c(g)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let g=function(w){if(m.paused||!a)return;const S=w.target;a.contains(S)?f.current=S:zt(f.current,{select:!0})},v=function(w){if(m.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||zt(f.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&zt(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),b.disconnect()}}},[r,a,m.paused]),p.useEffect(()=>{if(a){Ld.add(m);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Ii,Od);a.addEventListener(Ii,u),a.dispatchEvent(x),x.defaultPrevented||(ET(IT(Kp(a)),{select:!0}),document.activeElement===g&&zt(a))}return()=>{a.removeEventListener(Ii,u),setTimeout(()=>{const x=new CustomEvent(Di,Od);a.addEventListener(Di,d),a.dispatchEvent(x),x.defaultPrevented||zt(g??document.body,{select:!0}),a.removeEventListener(Di,d),Ld.remove(m)},0)}}},[a,u,d,m]);const y=p.useCallback(g=>{if(!n&&!r||m.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(v&&x){const b=g.currentTarget,[w,S]=MT(b);w&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&zt(w,{select:!0})):g.shiftKey&&x===w&&(g.preventDefault(),n&&zt(S,{select:!0})):x===b&&g.preventDefault()}},[n,r,m.paused]);return l.jsx(ee.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});zr.displayName=TT;function ET(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zt(r,{select:t}),document.activeElement!==n)return}function MT(e){const t=Kp(e),n=$d(t,e),r=$d(t.reverse(),e);return[n,r]}function Kp(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 $d(e,t){for(const n of e)if(!AT(n,{upTo:t}))return n}function AT(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 NT(e){return e instanceof HTMLInputElement&&"select"in e}function zt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&NT(e)&&t&&e.select()}}var Ld=jT();function jT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Fd(e,t),e.unshift(t)},remove(t){var n;e=Fd(e,t),(n=e[0])==null||n.resume()}}}function Fd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function IT(e){return e.filter(t=>t.tagName!=="A")}const DT=["top","right","bottom","left"],en=Math.min,et=Math.max,is=Math.round,bo=Math.floor,jt=e=>({x:e,y:e}),kT={left:"right",right:"left",bottom:"top",top:"bottom"};function Ma(e,t,n){return et(e,en(t,n))}function $t(e,t){return typeof e=="function"?e(t):e}function Lt(e){return e.split("-")[0]}function ur(e){return e.split("-")[1]}function Bc(e){return e==="x"?"y":"x"}function Gc(e){return e==="y"?"height":"width"}function At(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Uc(e){return Bc(At(e))}function _T(e,t,n){n===void 0&&(n=!1);const r=ur(e),o=Uc(e),s=Gc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=as(i)),[i,as(i)]}function OT(e){const t=as(e);return[Aa(e),t,Aa(t)]}function Aa(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Vd=["left","right"],Bd=["right","left"],$T=["top","bottom"],LT=["bottom","top"];function FT(e,t,n){switch(e){case"top":case"bottom":return n?t?Bd:Vd:t?Vd:Bd;case"left":case"right":return t?$T:LT;default:return[]}}function VT(e,t,n,r){const o=ur(e);let s=FT(Lt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Aa)))),s}function as(e){const t=Lt(e);return kT[t]+e.slice(t.length)}function BT(e){return{top:0,right:0,bottom:0,left:0,...e}}function zp(e){return typeof e!="number"?BT(e):{top:e,right:e,bottom:e,left:e}}function cs(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 Gd(e,t,n){let{reference:r,floating:o}=e;const s=At(t),i=Uc(t),a=Gc(i),c=Lt(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 m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(ur(t)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function GT(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:m=0}=$t(t,e),y=zp(m),v=a[h?f==="floating"?"reference":"floating":f],x=cs(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},R=cs(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:c}):b);return{top:(x.top-R.top+y.top)/S.y,bottom:(R.bottom-x.bottom+y.bottom)/S.y,left:(x.left-R.left+y.left)/S.x,right:(R.right-x.right+y.right)/S.x}}const UT=50,WT=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:GT},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}=Gd(u,r,c),h=r,m=0;const y={};for(let g=0;g<s.length;g++){const v=s[g];if(!v)continue;const{name:x,fn:b}=v,{x:w,y:S,data:R,reset:P}=await b({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:y,rects:u,platform:a,elements:{reference:e,floating:t}});d=w??d,f=S??f,y[x]={...y[x],...R},P&&m<UT&&(m++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(u=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:f}=Gd(u,h,c)),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:y}},KT=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}=$t(e,t)||{};if(u==null)return{};const f=zp(d),h={x:n,y:r},m=Uc(o),y=Gc(m),g=await i.getDimensions(u),v=m==="y",x=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",S=s.reference[y]+s.reference[m]-h[m]-s.floating[y],R=h[m]-s.reference[m],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=P?P[w]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=a.floating[w]||s.floating[y]);const A=S/2-R/2,E=T/2-g[y]/2-1,M=en(f[x],E),D=en(f[b],E),k=M,V=T-g[y]-D,W=T/2-g[y]/2+A,Z=Ma(k,W,V),G=!c.arrow&&ur(o)!=null&&W!==Z&&s.reference[y]/2-(W<k?M:D)-g[y]/2<0,_=G?W<k?W-k:W-V:0;return{[m]:h[m]+_,data:{[m]:Z,centerOffset:W-Z-_,...G&&{alignmentOffset:_}},reset:G}}}),zT=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:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...v}=$t(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Lt(o),b=At(a),w=Lt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),R=h||(w||!g?[as(a)]:OT(a)),P=y!=="none";!h&&P&&R.push(...VT(a,g,y,S));const T=[a,...R],A=await c.detectOverflow(t,v),E=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&E.push(A[x]),f){const W=_T(o,i,S);E.push(A[W[0]],A[W[1]])}if(M=[...M,{placement:o,overflows:E}],!E.every(W=>W<=0)){var D,k;const W=(((D=s.flip)==null?void 0:D.index)||0)+1,Z=T[W];if(Z&&(!(f==="alignment"?b!==At(Z):!1)||M.every(O=>At(O.placement)===b?O.overflows[0]>0:!0)))return{data:{index:W,overflows:M},reset:{placement:Z}};let G=(k=M.filter(_=>_.overflows[0]<=0).sort((_,O)=>_.overflows[1]-O.overflows[1])[0])==null?void 0:k.placement;if(!G)switch(m){case"bestFit":{var V;const _=(V=M.filter(O=>{if(P){const N=At(O.placement);return N===b||N==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(N=>N>0).reduce((N,j)=>N+j,0)]).sort((O,N)=>O[1]-N[1])[0])==null?void 0:V[0];_&&(G=_);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function Ud(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wd(e){return DT.some(t=>e[t]>=0)}const HT=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=$t(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Ud(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Wd(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Ud(i,n.floating);return{data:{escapedOffsets:a,escaped:Wd(a)}}}default:return{}}}}},Hp=new Set(["left","top"]);async function YT(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Lt(n),a=ur(n),c=At(n)==="y",u=Hp.has(i)?-1:1,d=s&&c?-1:1,f=$t(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const XT=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 YT(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}}}}},qT=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:w}=x;return{x:b,y:w}}},...u}=$t(e,t),d={x:n,y:r},f=await s.detectOverflow(t,u),h=At(Lt(o)),m=Bc(h);let y=d[m],g=d[h];if(i){const x=m==="y"?"top":"left",b=m==="y"?"bottom":"right",w=y+f[x],S=y-f[b];y=Ma(w,y,S)}if(a){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=g+f[x],S=g-f[b];g=Ma(w,g,S)}const v=c.fn({...t,[m]:y,[h]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},ZT=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}=$t(e,t),d={x:n,y:r},f=At(o),h=Bc(f);let m=d[h],y=d[f];const g=$t(a,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=h==="y"?"height":"width",S=s.reference[h]-s.floating[w]+v.mainAxis,R=s.reference[h]+s.reference[w]-v.mainAxis;m<S?m=S:m>R&&(m=R)}if(u){var x,b;const w=h==="y"?"width":"height",S=Hp.has(Lt(o)),R=s.reference[f]-s.floating[w]+(S&&((x=i.offset)==null?void 0:x[f])||0)+(S?0:v.crossAxis),P=s.reference[f]+s.reference[w]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);y<R?y=R:y>P&&(y=P)}return{[h]:m,[f]:y}}}},QT=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}=$t(e,t),d=await i.detectOverflow(t,u),f=Lt(o),h=ur(o),m=At(o)==="y",{width:y,height:g}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const b=g-d.top-d.bottom,w=y-d.left-d.right,S=en(g-d[v],b),R=en(y-d[x],w),P=!t.middlewareData.shift;let T=S,A=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=b),P&&!h){const M=et(d.left,0),D=et(d.right,0),k=et(d.top,0),V=et(d.bottom,0);m?A=y-2*(M!==0||D!==0?M+D:et(d.left,d.right)):T=g-2*(k!==0||V!==0?k+V:et(d.top,d.bottom))}await c({...t,availableWidth:A,availableHeight:T});const E=await i.getDimensions(a.floating);return y!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function Ts(){return typeof window<"u"}function dr(e){return Yp(e)?(e.nodeName||"").toLowerCase():"#document"}function tt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dt(e){var t;return(t=(Yp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yp(e){return Ts()?e instanceof Node||e instanceof tt(e).Node:!1}function gt(e){return Ts()?e instanceof Element||e instanceof tt(e).Element:!1}function Bt(e){return Ts()?e instanceof HTMLElement||e instanceof tt(e).HTMLElement:!1}function Kd(e){return!Ts()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tt(e).ShadowRoot}function Hr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function JT(e){return/^(table|td|th)$/.test(dr(e))}function Es(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const eE=/transform|translate|scale|rotate|perspective|filter/,tE=/paint|layout|strict|content/,yn=e=>!!e&&e!=="none";let ki;function Wc(e){const t=gt(e)?yt(e):e;return yn(t.transform)||yn(t.translate)||yn(t.scale)||yn(t.rotate)||yn(t.perspective)||!Kc()&&(yn(t.backdropFilter)||yn(t.filter))||eE.test(t.willChange||"")||tE.test(t.contain||"")}function nE(e){let t=tn(e);for(;Bt(t)&&!er(t);){if(Wc(t))return t;if(Es(t))return null;t=tn(t)}return null}function Kc(){return ki==null&&(ki=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ki}function er(e){return/^(html|body|#document)$/.test(dr(e))}function yt(e){return tt(e).getComputedStyle(e)}function Ms(e){return gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tn(e){if(dr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Kd(e)&&e.host||Dt(e);return Kd(t)?t.host:t}function Xp(e){const t=tn(e);return er(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bt(t)&&Hr(t)?t:Xp(t)}function Dr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Xp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=tt(o);if(s){const a=Na(i);return t.concat(i,i.visualViewport||[],Hr(o)?o:[],a&&n?Dr(a):[])}else return t.concat(o,Dr(o,[],n))}function Na(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qp(e){const t=yt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Bt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=is(n)!==s||is(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function zc(e){return gt(e)?e:e.contextElement}function qn(e){const t=zc(e);if(!Bt(t))return jt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=qp(t);let i=(s?is(n.width):n.width)/r,a=(s?is(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const rE=jt(0);function Zp(e){const t=tt(e);return!Kc()||!t.visualViewport?rE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tt(e)?!1:t}function Pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=zc(e);let i=jt(1);t&&(r?gt(r)&&(i=qn(r)):i=qn(e));const a=oE(s,n,r)?Zp(s):jt(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=tt(s),m=r&&gt(r)?tt(r):r;let y=h,g=Na(y);for(;g&&r&&m!==y;){const v=qn(g),x=g.getBoundingClientRect(),b=yt(g),w=x.left+(g.clientLeft+parseFloat(b.paddingLeft))*v.x,S=x.top+(g.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=w,u+=S,y=tt(g),g=Na(y)}}return cs({width:d,height:f,x:c,y:u})}function As(e,t){const n=Ms(e).scrollLeft;return t?t.left+n:Pn(Dt(e)).left+n}function Qp(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-As(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function sE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Dt(r),a=t?Es(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=jt(1);const d=jt(0),f=Bt(r);if((f||!f&&!s)&&((dr(r)!=="body"||Hr(i))&&(c=Ms(r)),f)){const m=Pn(r);u=qn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?Qp(i,c):jt(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 iE(e){return Array.from(e.getClientRects())}function aE(e){const t=Dt(e),n=Ms(e),r=e.ownerDocument.body,o=et(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=et(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+As(e);const a=-n.scrollTop;return yt(r).direction==="rtl"&&(i+=et(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const zd=25;function cE(e,t){const n=tt(e),r=Dt(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=Kc();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=As(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-m);y<=zd&&(s-=y)}else u<=zd&&(s+=u);return{width:s,height:i,x:a,y:c}}function lE(e,t){const n=Pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Bt(e)?qn(e):jt(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 Hd(e,t,n){let r;if(t==="viewport")r=cE(e,n);else if(t==="document")r=aE(Dt(e));else if(gt(t))r=lE(t,n);else{const o=Zp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return cs(r)}function Jp(e,t){const n=tn(e);return n===t||!gt(n)||er(n)?!1:yt(n).position==="fixed"||Jp(n,t)}function uE(e,t){const n=t.get(e);if(n)return n;let r=Dr(e,[],!1).filter(a=>gt(a)&&dr(a)!=="body"),o=null;const s=yt(e).position==="fixed";let i=s?tn(e):e;for(;gt(i)&&!er(i);){const a=yt(i),c=Wc(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Hr(i)&&!c&&Jp(e,i))?r=r.filter(d=>d!==i):o=a,i=tn(i)}return t.set(e,r),r}function dE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Es(t)?[]:uE(t,this._c):[].concat(n),r],a=Hd(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 m=Hd(t,i[h],o);c=et(m.top,c),u=en(m.right,u),d=en(m.bottom,d),f=et(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function fE(e){const{width:t,height:n}=qp(e);return{width:t,height:n}}function hE(e,t,n){const r=Bt(t),o=Dt(t),s=n==="fixed",i=Pn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=jt(0);function u(){c.x=As(o)}if(r||!r&&!s)if((dr(t)!=="body"||Hr(o))&&(a=Ms(t)),r){const m=Pn(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Qp(o,a):jt(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 _i(e){return yt(e).position==="static"}function Yd(e,t){if(!Bt(e)||yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Dt(e)===n&&(n=n.ownerDocument.body),n}function em(e,t){const n=tt(e);if(Es(e))return n;if(!Bt(e)){let o=tn(e);for(;o&&!er(o);){if(gt(o)&&!_i(o))return o;o=tn(o)}return n}let r=Yd(e,t);for(;r&&JT(r)&&_i(r);)r=Yd(r,t);return r&&er(r)&&_i(r)&&!Wc(r)?n:r||nE(e)||n}const pE=async function(e){const t=this.getOffsetParent||em,n=this.getDimensions,r=await n(e.floating);return{reference:hE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mE(e){return yt(e).direction==="rtl"}const gE={convertOffsetParentRelativeRectToViewportRelativeRect:sE,getDocumentElement:Dt,getClippingRect:dE,getOffsetParent:em,getElementRects:pE,getClientRects:iE,getDimensions:fE,getScale:qn,isElement:gt,isRTL:mE};function tm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yE(e,t){let n=null,r;const o=Dt(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:m}=u;if(a||t(),!h||!m)return;const y=bo(f),g=bo(o.clientWidth-(d+h)),v=bo(o.clientHeight-(f+m)),x=bo(d),w={rootMargin:-y+"px "+-g+"px "+-v+"px "+-x+"px",threshold:et(0,en(1,c))||1};let S=!0;function R(P){const T=P[0].intersectionRatio;if(T!==c){if(!S)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!tm(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(R,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,w)}n.observe(e)}return i(!0),s}function nm(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=zc(e),d=o||s?[...u?Dr(u):[],...t?Dr(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?yE(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let y,g=c?Pn(e):null;c&&v();function v(){const x=Pn(e);g&&!tm(g,x)&&n(),g=x,y=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const vE=XT,xE=qT,bE=zT,wE=QT,CE=HT,Xd=KT,SE=ZT,RE=(e,t,n)=>{const r=new Map,o={platform:gE,...n},s={...o.platform,_c:r};return WT(e,t,{...o,platform:s})};var PE=typeof document<"u",TE=function(){},Wo=PE?C.useLayoutEffect:TE;function ls(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(!ls(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)&&!ls(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function rm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qd(e,t){const n=rm(e);return Math.round(t*n)/n}function Oi(e){const t=p.useRef(e);return Wo(()=>{t.current=e}),t}function om(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]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);ls(h,r)||m(r);const[y,g]=p.useState(null),[v,x]=p.useState(null),b=p.useCallback(O=>{O!==P.current&&(P.current=O,g(O))},[]),w=p.useCallback(O=>{O!==T.current&&(T.current=O,x(O))},[]),S=s||y,R=i||v,P=p.useRef(null),T=p.useRef(null),A=p.useRef(d),E=c!=null,M=Oi(c),D=Oi(o),k=Oi(u),V=p.useCallback(()=>{if(!P.current||!T.current)return;const O={placement:t,strategy:n,middleware:h};D.current&&(O.platform=D.current),RE(P.current,T.current,O).then(N=>{const j={...N,isPositioned:k.current!==!1};W.current&&!ls(A.current,j)&&(A.current=j,or.flushSync(()=>{f(j)}))})},[h,t,n,D,k]);Wo(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[u]);const W=p.useRef(!1);Wo(()=>(W.current=!0,()=>{W.current=!1}),[]),Wo(()=>{if(S&&(P.current=S),R&&(T.current=R),S&&R){if(M.current)return M.current(S,R,V);V()}},[S,R,V,M,E]);const Z=p.useMemo(()=>({reference:P,floating:T,setReference:b,setFloating:w}),[b,w]),G=p.useMemo(()=>({reference:S,floating:R}),[S,R]),_=p.useMemo(()=>{const O={position:n,left:0,top:0};if(!G.floating)return O;const N=qd(G.floating,d.x),j=qd(G.floating,d.y);return a?{...O,transform:"translate("+N+"px, "+j+"px)",...rm(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:j}},[n,a,G.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:V,refs:Z,elements:G,floatingStyles:_}),[d,V,Z,G,_])}const EE=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?Xd({element:r.current,padding:o}).fn(n):{}:r?Xd({element:r,padding:o}).fn(n):{}}}},sm=(e,t)=>{const n=vE(e);return{name:n.name,fn:n.fn,options:[e,t]}},im=(e,t)=>{const n=xE(e);return{name:n.name,fn:n.fn,options:[e,t]}},am=(e,t)=>({fn:SE(e).fn,options:[e,t]}),cm=(e,t)=>{const n=bE(e);return{name:n.name,fn:n.fn,options:[e,t]}},lm=(e,t)=>{const n=wE(e);return{name:n.name,fn:n.fn,options:[e,t]}},um=(e,t)=>{const n=CE(e);return{name:n.name,fn:n.fn,options:[e,t]}},dm=(e,t)=>{const n=EE(e);return{name:n.name,fn:n.fn,options:[e,t]}};var ME="Arrow",fm=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(ee.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"})})});fm.displayName=ME;var AE=fm;function Yr(e){const[t,n]=p.useState(void 0);return $e(()=>{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 Hc="Popper",[hm,cn]=Ie(Hc),[NE,pm]=hm(Hc),mm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return l.jsx(NE,{scope:t,anchor:r,onAnchorChange:o,children:n})};mm.displayName=Hc;var gm="PopperAnchor",ym=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=pm(gm,n),i=p.useRef(null),a=se(t,i),c=p.useRef(null);return p.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(ee.div,{...o,ref:a})});ym.displayName=gm;var Yc="PopperContent",[jE,IE]=hm(Yc),vm=p.forwardRef((e,t)=>{var L,Q,K,z,ie,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:m="optimized",onPlaced:y,...g}=e,v=pm(Yc,n),[x,b]=p.useState(null),w=se(t,xe=>b(xe)),[S,R]=p.useState(null),P=Yr(S),T=(P==null?void 0:P.width)??0,A=(P==null?void 0:P.height)??0,E=r+(s!=="center"?"-"+s:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],k=D.length>0,V={padding:M,boundary:D.filter(kE),altBoundary:k},{refs:W,floatingStyles:Z,placement:G,isPositioned:_,middlewareData:O}=om({strategy:"fixed",placement:E,whileElementsMounted:(...xe)=>nm(...xe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[sm({mainAxis:o+A,alignmentAxis:i}),c&&im({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?am():void 0,...V}),c&&cm({...V}),lm({...V,apply:({elements:xe,rects:oe,availableWidth:rt,availableHeight:ct})=>{const{width:Ct,height:Se}=oe.reference,Le=xe.floating.style;Le.setProperty("--radix-popper-available-width",`${rt}px`),Le.setProperty("--radix-popper-available-height",`${ct}px`),Le.setProperty("--radix-popper-anchor-width",`${Ct}px`),Le.setProperty("--radix-popper-anchor-height",`${Se}px`)}}),S&&dm({element:S,padding:a}),_E({arrowWidth:T,arrowHeight:A}),h&&um({strategy:"referenceHidden",...V})]}),[N,j]=wm(G),H=mt(y);$e(()=>{_&&(H==null||H())},[_,H]);const I=(L=O.arrow)==null?void 0:L.x,X=(Q=O.arrow)==null?void 0:Q.y,F=((K=O.arrow)==null?void 0:K.centerOffset)!==0,[U,B]=p.useState();return $e(()=>{x&&B(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:_?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[(z=O.transformOrigin)==null?void 0:z.x,(ie=O.transformOrigin)==null?void 0:ie.y].join(" "),...((ae=O.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(jE,{scope:n,placedSide:N,onArrowChange:R,arrowX:I,arrowY:X,shouldHideArrow:F,children:l.jsx(ee.div,{"data-side":N,"data-align":j,...g,ref:w,style:{...g.style,animation:_?void 0:"none"}})})})});vm.displayName=Yc;var xm="PopperArrow",DE={top:"bottom",right:"left",bottom:"top",left:"right"},bm=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=IE(xm,r),i=DE[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(AE,{...o,ref:n,style:{...o.style,display:"block"}})})});bm.displayName=xm;function kE(e){return e!==null}var _E=e=>({name:"transformOrigin",options:e,fn(t){var v,x,b;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=wm(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let y="",g="";return u==="bottom"?(y=i?f:`${h}px`,g=`${-c}px`):u==="top"?(y=i?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?f:`${m}px`):u==="left"&&(y=`${r.floating.width+c}px`,g=i?f:`${m}px`),{data:{x:y,y:g}}}});function wm(e){const[t,n="center"]=e.split("-");return[t,n]}var Xr=mm,qr=ym,Ns=vm,js=bm,OE="Portal",fr=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=p.useState(!1);$e(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ys.createPortal(l.jsx(ee.div,{...r,ref:t}),i):null});fr.displayName=OE;function Zr(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cm=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"}),$E="VisuallyHidden",Xc=p.forwardRef((e,t)=>l.jsx(ee.span,{...e,ref:t,style:{...Cm,...e.style}}));Xc.displayName=$E;var LE=Xc,FE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fn=new WeakMap,wo=new WeakMap,Co={},$i=0,Sm=function(e){return e&&(e.host||Sm(e.parentNode))},VE=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sm(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})},BE=function(e,t,n,r){var o=VE(t,Array.isArray(e)?e:[e]);Co[n]||(Co[n]=new WeakMap);var s=Co[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),y=m!==null&&m!=="false",g=(Fn.get(h)||0)+1,v=(s.get(h)||0)+1;Fn.set(h,g),s.set(h,v),i.push(h),g===1&&y&&wo.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),a.clear(),$i++,function(){i.forEach(function(f){var h=Fn.get(f)-1,m=s.get(f)-1;Fn.set(f,h),s.set(f,m),h||(wo.has(f)||f.removeAttribute(r),wo.delete(f)),m||f.removeAttribute(n)}),$i--,$i||(Fn=new WeakMap,Fn=new WeakMap,wo=new WeakMap,Co={})}},Qr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=FE(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),BE(r,o,n,"aria-hidden")):function(){return null}},Mt=function(){return Mt=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},Mt.apply(this,arguments)};function Rm(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 GE(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 Ko="right-scroll-bar-position",zo="width-before-scroll-bar",UE="with-scroll-bars-hidden",WE="--removed-body-scroll-bar-size";function Li(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function KE(e,t){var n=C.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 zE=typeof window<"u"?p.useLayoutEffect:p.useEffect,Zd=new WeakMap;function HE(e,t){var n=KE(null,function(r){return e.forEach(function(o){return Li(o,r)})});return zE(function(){var r=Zd.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Li(a,null)}),s.forEach(function(a){o.has(a)||Li(a,i)})}Zd.set(n,e)},[e]),n}function YE(e){return e}function XE(e,t){t===void 0&&(t=YE);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 qE(e){e===void 0&&(e={});var t=XE(null);return t.options=Mt({async:!0,ssr:!1},e),t}var Pm=function(e){var t=e.sideCar,n=Rm(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 p.createElement(r,Mt({},n))};Pm.isSideCarExport=!0;function ZE(e,t){return e.useMedium(t),Pm}var Tm=qE(),Fi=function(){},Is=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Fi,onWheelCapture:Fi,onTouchMoveCapture:Fi}),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,m=e.noRelative,y=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,S=Rm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=h,P=HE([n,t]),T=Mt(Mt({},S),o);return p.createElement(p.Fragment,null,d&&p.createElement(R,{sideCar:Tm,removeScrollBar:u,shards:f,noRelative:m,noIsolation:y,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:w}),i?p.cloneElement(p.Children.only(a),Mt(Mt({},T),{ref:P})):p.createElement(b,Mt({},T,{className:c,ref:P}),a))});Is.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Is.classNames={fullWidth:zo,zeroRight:Ko};var QE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QE();return t&&e.setAttribute("nonce",t),e}function eM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nM=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JE())&&(eM(t,n),tM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rM=function(){var e=nM();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Em=function(){var e=rM(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},oM={left:0,top:0,right:0,gap:0},Vi=function(e){return parseInt(e||"",10)||0},sM=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[Vi(n),Vi(r),Vi(o)]},iM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oM;var t=sM(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])}},aM=Em(),Zn="data-scroll-locked",cM=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
170
- .`.concat(UE,` {
169
+ */const kP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yt=ye("x",kP),_P=S.forwardRef(function({color:e="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:m,defaultValue:y,onChange:g,...v},x){const w=m!==void 0,[b,C]=S.useState(y!=null?String(y):""),P=w?String(m??""):b,R=S.useRef(null);S.useImperativeHandle(x,()=>R.current,[]);const[M,j]=S.useState(!1),T=a&&M&&c==="password"?"text":c,E=s&&!u&&P!=="",N=E||a,_=r!=null||o!=null||N,F=L=>{w||C(L.target.value),g==null||g(L)},U=L=>{var D;L.preventDefault(),w||C("");const $=R.current;if($){const q=(D=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:D.set;q==null||q.call($,""),$.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},J=re(_?void 0:h,_?void 0:f,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,d),z=l.jsx("input",{ref:R,type:T,className:J.className,style:J.style,disabled:u,value:w?m:void 0,defaultValue:w?void 0:y,onChange:F,...v});if(!_)return l.jsxs(l.Fragment,{children:[J.styleTag,z]});const I=re(h,f,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!N&&"has-suffix",N&&"has-action");return l.jsxs("span",{className:I.className,style:I.style,children:[I.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),z,o!=null&&!N&&l.jsx("span",{className:"cny-input-suffix",children:o}),E&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:U,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Yt,{size:14,"aria-hidden":"true"})}),a&&c==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>j(L=>!L),"aria-label":M?"Hide password":"Show password","aria-pressed":M,children:M?l.jsx(yP,{size:14,"aria-hidden":"true"}):l.jsx(xP,{size:14,"aria-hidden":"true"})})]})}),OP=S.forwardRef(function({color:e="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"card",e!=="default"&&e,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),$P={info:Vp,success:Lp,warning:Up,danger:$p};function LP({color:t}){const e=$P[t];return l.jsx(e,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const FP=S.forwardRef(function({color:e="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},m){const y=c!==!1,g=c&&c!==!0?c:l.jsx(LP,{color:e}),{className:v,style:x,styleTag:w}=re(i,s,"alert",e,n&&"solid",o),b=e==="danger"?"alert":"status";return l.jsxs("div",{ref:m,role:b,className:v,style:x,...h,children:[w,y&&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.jsx(Yt,{size:14,"aria-hidden":"true"})})]})}),VP=S.forwardRef(function({size:e="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=re(a,i,"avatar",e!=="md"&&e,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[m,r?l.jsx("img",{src:r,alt:o??""}):c]})}),BP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("avatar-stack",e),...r,children:n})}),GP=S.forwardRef(function({value:e=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:m}=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:[m,l.jsx("span",{className:"progress-bar"})]})}),UP=S.forwardRef(function({value:e,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d={...s??{},"--value":u},{className:f,style:h,styleTag:m}=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:[m,r&&l.jsxs("span",{children:[u,"%"]})]})}),zP={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},zp=S.forwardRef(function({variant:e="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m={...zP[r],maxHeight:o,maxWidth:s,...c??{}},{className:y,style:g,styleTag:v}=re(u,m,i?"cny-scroll-region":"cny-scroll",e!=="default"&&e,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:y,style:g,...f,children:[v,d]})}),WP=S.forwardRef(function(e,n){return l.jsx(zp,{ref:n,region:!0,...e})}),ba=S.forwardRef(function({shape:e="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=re(i,{...s??{},width:n,height:r},"skeleton",e,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),HP=S.forwardRef(function({solid:e=!1,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,r,"cny-navbar",e&&"solid",n);return l.jsxs("header",{ref:a,className:c,style:u,...i,children:[d,s]})}),KP=S.forwardRef(function({mark:e=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:Y("cny-navbar-brand",n),...o,children:[e&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),YP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("nav",{ref:o,className:Y("cny-navbar-nav",e),...r,children:n})}),XP=S.forwardRef(function({active:e=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":e?"page":void 0,className:Y("cny-navbar-item",e&&"active",n),...o,children:r})}),qP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("cny-navbar-actions",e),...r,children:n})}),ZP=S.forwardRef(function({width:e="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=re(a,i,"cny-sidebar",e!=="default"&&e,n&&"sticky",r&&"collapsed",o&&"responsive",s);return l.jsxs("aside",{ref:d,className:f,style:h,...u,children:[m,c]})}),QP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("cny-sidebar-header",e),...r,children:n})}),JP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:Y("cny-sidebar-footer",e),...r,children:n})}),eR=S.forwardRef(function({collapsed:e=!1,onClick:n,className:r,children:o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":!e,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:Y("cny-sidebar-toggle",e&&"collapsed",r),onClick:n,...s,children:o??l.jsx(DP,{size:16,"aria-hidden":"true"})})});function wa(t){const e=Array.from(t.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(e.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const tR=S.forwardRef(function({title:e,className:n,children:r,...o},s){const i=S.useRef(null),a=S.useCallback(c=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(g=>!g.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(g=>g===document.activeElement);let m=h;switch(c.key){case"ArrowDown":c.preventDefault(),m=h<f.length-1?h+1:0;break;case"ArrowUp":c.preventDefault(),m=h<=0?f.length-1:h-1;break;case"Home":c.preventDefault(),m=0;break;case"End":c.preventDefault(),m=f.length-1;break;default:return}const y=f[m];y&&y!==document.activeElement&&(f.forEach(g=>g.setAttribute("tabindex","-1")),y.setAttribute("tabindex","0"),y.focus())},[]);return S.useLayoutEffect(()=>{const c=i.current;if(!c||(wa(c),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>wa(c));return u.observe(c,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),l.jsxs("div",{ref:s,className:Y("cny-sidebar-section",n),...o,children:[e&&l.jsx("div",{className:"cny-sidebar-title",children:e}),l.jsx("nav",{ref:i,className:"cny-sidebar-nav",onKeyDown:a,children:r})]})}),nR=S.forwardRef(function({active:e=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){const u=S.useRef(null),d=S.useId();S.useLayoutEffect(()=>{const h=u.current;if(!h)return;const m=h.closest('[class*="cny-sidebar-nav"]');m&&wa(m)},[e,n]);const f=typeof i=="string"&&!a["aria-label"]?i:void 0;return l.jsxs("a",{ref:h=>{u.current=h,typeof c=="function"?c(h):c&&(c.current=h)},"data-cny-sidebar-item":d,"aria-current":e?"page":void 0,"aria-disabled":n||void 0,"aria-label":f,className:Y("cny-sidebar-item",e&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function rR(t){const e=[];return t.display&&e.push(t.display),t.direction==="row"?e.push("flex-row"):t.direction==="column"?e.push("flex-col"):t.direction==="row-reverse"?e.push("flex-row-reverse"):t.direction==="column-reverse"&&e.push("flex-col-reverse"),t.align&&e.push(`items-${t.align==="start"||t.align==="end",t.align}`),t.justify&&e.push(`justify-${t.justify}`),t.wrap&&e.push("flex-wrap"),t.p!==void 0&&e.push(`p-${t.p}`),t.px!==void 0&&e.push(`px-${t.px}`),t.py!==void 0&&e.push(`py-${t.py}`),t.pt!==void 0&&e.push(`pt-${t.pt}`),t.pr!==void 0&&e.push(`pr-${t.pr}`),t.pb!==void 0&&e.push(`pb-${t.pb}`),t.pl!==void 0&&e.push(`pl-${t.pl}`),t.m!==void 0&&e.push(`m-${t.m}`),t.mx!==void 0&&e.push(`mx-${t.mx}`),t.my!==void 0&&e.push(`my-${t.my}`),t.mt!==void 0&&e.push(`mt-${t.mt}`),t.mr!==void 0&&e.push(`mr-${t.mr}`),t.mb!==void 0&&e.push(`mb-${t.mb}`),t.ml!==void 0&&e.push(`ml-${t.ml}`),t.gap!==void 0&&e.push(`gap-${t.gap}`),t.gapX!==void 0&&e.push(`gap-x-${t.gapX}`),t.gapY!==void 0&&e.push(`gap-y-${t.gapY}`),t.w&&e.push(`w-${t.w}`),t.h&&e.push(`h-${t.h}`),t.grow&&e.push("flex-1"),e}const _n=S.forwardRef(function({as:e,className:n,style:r,children:o,...s},i){const a=e??"div",{layoutProps:c,domProps:u}=oR(s),{sx:d,...f}=c,h=d?Wa(d):void 0,m=Y(...rR(f),h==null?void 0:h.className,n),y=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,g=S.createElement(a,{ref:i,className:m||void 0,style:y,...u},o);return h!=null&&h.css?S.createElement(S.Fragment,null,S.createElement("style",{dangerouslySetInnerHTML:{__html:h.css}}),g):g});function oR(t){const e=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h","grow","sx"]),n={},r={};for(const[o,s]of Object.entries(t))e.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const sR=S.forwardRef(function(e,n){return l.jsx(_n,{ref:n,display:"flex",direction:"column",...e})}),iR=S.forwardRef(function(e,n){const{align:r="center",...o}=e;return l.jsx(_n,{ref:n,display:"flex",direction:"row",align:r,...o})}),md=t=>t.map(e=>`minmax(0,${e}fr)`).join(" "),aR=S.forwardRef(function({cols:e,minColWidth:n,ratio:r,template:o,className:s,sx:i,...a},c){let u;if(o)u=o;else if(r)if(Array.isArray(r))u=md(r);else{const f={};for(const[h,m]of Object.entries(r))m&&(f[h]=md(m));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(_n,{ref:c,display:"grid",className:Y(!u&&e&&`grid-cols-${e}`,s),sx:d,...a})}),cR=S.forwardRef(function({size:e="lg",className:n,...r},o){return l.jsx(_n,{ref:o,className:Y("cny-container",e,n),...r})}),lR=S.forwardRef(function({orientation:e="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=re(o,r,"cny-divider",e,n);return e==="vertical"?l.jsxs(l.Fragment,{children:[u,l.jsx("span",{ref:i,role:"separator","aria-orientation":"vertical",className:a,style:c,...s})]}):l.jsxs(l.Fragment,{children:[u,l.jsx("hr",{ref:i,className:a,style:c,...s})]})}),uR=S.forwardRef(function({className:e,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=re(r,n,"cny-spacer",e);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),dR=S.forwardRef(function({ratio:e=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=re(o,{aspectRatio:String(e),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),fR=S.forwardRef(function(e,n){return l.jsx(_n,{ref:n,display:"flex",align:"center",justify:"center",...e})}),hR=S.forwardRef(function(e,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=e;return l.jsx(_n,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),pR={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"},mR=S.forwardRef(function({as:e,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m=e??pR[n],{className:y,style:g,styleTag:v}=re(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return S.createElement(m,{ref:h,className:y,style:g,...f},v,d)});function gR({label:t,hint:e,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const m=S.useId(),y=S.Children.only(f),g=y.props.id??m,v=n!=null&&n!==!1,x=a??(v?"danger":"default"),w=e||n?`${g}-hint`:void 0,b=S.cloneElement(y,{id:g,"aria-invalid":v||y.props["aria-invalid"]||void 0,"aria-describedby":w??y.props["aria-describedby"],className:Y(y.props.className,x!=="default"&&x)}),C=i!=null&&s!=null&&s>i?"danger":"default",{className:P,style:R,styleTag:M}=re(d,u,"cny-field",c);return l.jsxs("div",{className:P,style:R,...h,children:[M,(t!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[t!=null?l.jsxs("label",{htmlFor:g,className:"cny-field-label",children:[t,r&&l.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&l.jsx("span",{className:"cny-field-optional",children:"optional"})]}):l.jsx("span",{}),s!=null&&l.jsx("span",{className:Y("cny-field-counter",C==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),b,(n||e)&&l.jsx("span",{id:w,className:Y("cny-field-hint",x!=="default"&&x),children:n??e})]})}const yR=S.forwardRef(function({color:e="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=S.useRef(null);S.useImperativeHandle(d,()=>f.current,[]);const h=S.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const b=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,b)}px`,x.style.overflowY=x.scrollHeight>b?"auto":"hidden"},[r,o]);S.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const m=x=>{c==null||c(x),r&&h()},{className:y,style:g,styleTag:v}=re(a,i,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[v,l.jsx("textarea",{ref:f,className:y,style:g,onChange:m,...u})]})});var vR=Object.defineProperty,xR=(t,e)=>vR(t,"name",{value:e,configurable:!0});function _r(t,[e,n]){return Math.min(n,Math.max(e,t))}xR(_r,"clamp");var bR=Object.defineProperty,Ie=(t,e)=>bR(t,"name",{value:e,configurable:!0}),Ca="dismissableLayer.update",wR="dismissableLayer.pointerDownOutside",CR="dismissableLayer.focusOutside",gd,Wp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),fr=p.forwardRef(Ie(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=e,f=p.useContext(Wp),[h,m]=p.useState(null),y=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=p.useState({}),v=oe(n,m),x=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w?x.indexOf(w):-1,C=h?x.indexOf(h):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,R=C>=b,M=p.useRef(!1),j=Kp(_=>{i==null||i(_),c==null||c(_),_.defaultPrevented||u==null||u()},{ownerDocument:y,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(_=>{if(!(_ instanceof Node))return!1;const F=[...f.branches].some(U=>U.contains(_));return R&&!F},[f.branches,R])}),T=Yp(_=>{if(o&&M.current)return;const F=_.target;[...f.branches].some(J=>J.contains(F))||(a==null||a(_),c==null||c(_),_.defaultPrevented||u==null||u())},y),E=h?C===x.length-1:!1,N=qe(_=>{_.key==="Escape"&&(s==null||s(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))});return p.useEffect(()=>{if(E)return y.addEventListener("keydown",N,{capture:!0}),()=>y.removeEventListener("keydown",N,{capture:!0})},[y,E,N]),p.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(gd=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),Sa(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=gd))}},[h,y,r,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),Sa())},[h,f]),p.useEffect(()=>{const _=Ie(()=>g({}),"handleUpdate");return document.addEventListener(Ca,_),()=>document.removeEventListener(Ca,_)},[]),l.jsx(ne.div,{...d,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,T.onFocusCapture),onBlurCapture:H(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function Hp(){const t=p.useContext(Wp),[e,n]=p.useState(null);return p.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Ie(Hp,"useDismissableLayerSurface");var SR=Ie(()=>!0,"IS_TRUE");function Kp(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=SR}=e,a=qe(t),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}Ie(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ie(m,"isOutsideInteractionIntercepted");function y(b){if(!u.current)return;const C=b.target;C instanceof Node&&[...s].some(R=>R.contains(C))||d.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ie(y,"handleInteractionCapture");function g(b){u.current&&d.current.set(b.type,!1)}Ie(g,"handleInteractionBubble");const v=Ie(b=>{if(b.target&&!c.current){let C=function(){n.removeEventListener("click",f.current);const R=m();h(),R||Tc(wR,a,P,{discrete:!0})};if(Ie(C,"handleAndDispatchPointerDownOutsideEvent"),!i(b.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const P={originalEvent:b};u.current=!0,o.current=r&&b.button===0,d.current.clear(),!r||b.button!==0?C():(n.removeEventListener("click",f.current),f.current=C,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,y,!0),n.addEventListener(b,g);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,y,!0),n.removeEventListener(b,g)}},[n,a,r,o,s,i]),{onPointerDownCapture:Ie(()=>c.current=!0,"onPointerDownCapture")}}Ie(Kp,"usePointerDownOutside");function Yp(t,e=globalThis==null?void 0:globalThis.document){const n=qe(t),r=p.useRef(!1);return p.useEffect(()=>{const o=Ie(s=>{s.target&&!r.current&&Tc(CR,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:Ie(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ie(()=>r.current=!1,"onBlurCapture")}}Ie(Yp,"useFocusOutside");function Sa(){const t=new CustomEvent(Ca);document.dispatchEvent(t)}Ie(Sa,"dispatchUpdate");function Tc(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Cc(o,s):o.dispatchEvent(s)}Ie(Tc,"handleAndDispatchCustomEvent");var PR=Object.defineProperty,Mc=(t,e)=>PR(t,"name",{value:e,configurable:!0}),Po=0,Pt=null;function RR(t){return hr(),t.children}Mc(RR,"FocusGuards");function hr(){p.useEffect(()=>{Pt||(Pt={start:Pa(),end:Pa()});const{start:t,end:e}=Pt;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Po++,()=>{Po===1&&(Pt==null||Pt.start.remove(),Pt==null||Pt.end.remove(),Pt=null),Po=Math.max(0,Po-1)}},[])}Mc(hr,"useFocusGuards");function Pa(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Mc(Pa,"createFocusGuard");var TR=Object.defineProperty,He=(t,e)=>TR(t,"name",{value:e,configurable:!0}),Si="focusScope.autoFocusOnMount",Pi="focusScope.autoFocusOnUnmount",yd={bubbles:!1,cancelable:!0},Ss=p.forwardRef(He(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,u]=p.useState(null),d=qe(s),f=qe(i),h=p.useRef(null),m=oe(n,u),y=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let v=function(C){if(y.paused||!c)return;const P=C.target;c.contains(P)?h.current=P:Lt(h.current,{select:!0})},x=function(C){if(y.paused||!c)return;const P=C.relatedTarget;P!==null&&(c.contains(P)||Lt(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&Lt(c)};He(v,"handleFocusIn"),He(x,"handleFocusOut"),He(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(w);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[o,c,y.paused]),p.useEffect(()=>{if(c){vd.add(y);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(Si,yd);c.addEventListener(Si,d),c.dispatchEvent(w),w.defaultPrevented||(Xp(em(Ec(c)),{select:!0}),document.activeElement===v&&Lt(c))}return()=>{c.removeEventListener(Si,d),setTimeout(()=>{const w=new CustomEvent(Pi,yd);c.addEventListener(Pi,f),c.dispatchEvent(w),w.defaultPrevented||Lt(v??document.body,{select:!0}),c.removeEventListener(Pi,f),vd.remove(y)},0)}}},[c,d,f,y]);const g=p.useCallback(v=>{if(!r&&!o||y.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const b=v.currentTarget,[C,P]=qp(b);C&&P?!v.shiftKey&&w===P?(v.preventDefault(),r&&Lt(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),r&&Lt(P,{select:!0})):w===b&&v.preventDefault()}},[r,o,y.paused]);return l.jsx(ne.div,{tabIndex:-1,...a,ref:m,onKeyDown:g})},"FocusScope"));function Xp(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Lt(r,{select:e}),document.activeElement!==n)return}He(Xp,"focusFirst");function qp(t){const e=Ec(t),n=Ra(e,t),r=Ra(e.reverse(),t);return[n,r]}He(qp,"getTabbableEdges");function Ec(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:He(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}He(Ec,"getTabbableCandidates");function Ra(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Zp(r,{upTo:e})))return r}He(Ra,"findVisible");function Zp(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}He(Zp,"isHidden");function Qp(t){return t instanceof HTMLInputElement&&"select"in t}He(Qp,"isSelectableInput");function Lt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Qp(t)&&e&&t.select()}}He(Lt,"focus");var vd=Jp();function Jp(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Ta(t,e),t.unshift(e)},remove(e){var n;t=Ta(t,e),(n=t[0])==null||n.resume()}}}He(Jp,"createFocusScopesStack");function Ta(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}He(Ta,"arrayRemove");function em(t){return t.filter(e=>e.tagName!=="A")}He(em,"removeLinks");const MR=["top","right","bottom","left"],ln=Math.min,st=Math.max,cs=Math.round,Ro=Math.floor,It=t=>({x:t,y:t}),ER={left:"right",right:"left",bottom:"top",top:"bottom"};function Ma(t,e,n){return st(t,ln(e,n))}function Ut(t,e){return typeof t=="function"?t(e):t}function zt(t){return t.split("-")[0]}function pr(t){return t.split("-")[1]}function jc(t){return t==="x"?"y":"x"}function Ac(t){return t==="y"?"height":"width"}function At(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Dc(t){return jc(At(t))}function jR(t,e,n){n===void 0&&(n=!1);const r=pr(t),o=Dc(t),s=Ac(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ls(i)),[i,ls(i)]}function AR(t){const e=ls(t);return[Ea(t),e,Ea(e)]}function Ea(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const xd=["left","right"],bd=["right","left"],DR=["top","bottom"],IR=["bottom","top"];function NR(t,e,n){switch(t){case"top":case"bottom":return n?e?bd:xd:e?xd:bd;case"left":case"right":return e?DR:IR;default:return[]}}function kR(t,e,n,r){const o=pr(t);let s=NR(zt(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(Ea)))),s}function ls(t){const e=zt(t);return ER[e]+t.slice(e.length)}function _R(t){return{top:0,right:0,bottom:0,left:0,...t}}function tm(t){return typeof t!="number"?_R(t):{top:t,right:t,bottom:t,left:t}}function us(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function wd(t,e,n){let{reference:r,floating:o}=t;const s=At(e),i=Dc(e),a=Ac(i),c=zt(e),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(pr(e)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function OR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Ut(e,t),y=tm(m),v=a[h?f==="floating"?"reference":"floating":f],x=us(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},P=us(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-P.top+y.top)/C.y,bottom:(P.bottom-x.bottom+y.bottom)/C.y,left:(x.left-P.left+y.left)/C.x,right:(P.right-x.right+y.right)/C.x}}const $R=50,LR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:OR},c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=wd(u,r,c),h=r,m=0;const y={};for(let g=0;g<s.length;g++){const v=s[g];if(!v)continue;const{name:x,fn:w}=v,{x:b,y:C,data:P,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:y,rects:u,platform:a,elements:{reference:t,floating:e}});d=b??d,f=C??f,y[x]={...y[x],...P},R&&m<$R&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:d,y:f}=wd(u,h,c)),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:y}},FR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=Ut(t,e)||{};if(u==null)return{};const f=tm(d),h={x:n,y:r},m=Dc(o),y=Ac(m),g=await i.getDimensions(u),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=s.reference[y]+s.reference[m]-h[m]-s.floating[y],P=h[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=R?R[b]:0;(!M||!await(i.isElement==null?void 0:i.isElement(R)))&&(M=a.floating[b]||s.floating[y]);const j=C/2-P/2,T=M/2-g[y]/2-1,E=ln(f[x],T),N=ln(f[w],T),_=E,F=M-g[y]-N,U=M/2-g[y]/2+j,J=Ma(_,U,F),z=!c.arrow&&pr(o)!=null&&U!==J&&s.reference[y]/2-(U<_?E:N)-g[y]/2<0,I=z?U<_?U-_:U-F:0;return{[m]:h[m]+I,data:{[m]:J,centerOffset:U-J-I,...z&&{alignmentOffset:I}},reset:z}}}),VR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...v}=Ut(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=zt(o),w=At(a),b=zt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),P=h||(b||!g?[ls(a)]:AR(a)),R=y!=="none";!h&&R&&P.push(...kR(a,g,y,C));const M=[a,...P],j=await c.detectOverflow(e,v),T=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(j[x]),f){const U=jR(o,i,C);T.push(j[U[0]],j[U[1]])}if(E=[...E,{placement:o,overflows:T}],!T.every(U=>U<=0)){var N,_;const U=(((N=s.flip)==null?void 0:N.index)||0)+1,J=M[U];if(J&&(!(f==="alignment"?w!==At(J):!1)||E.every(L=>At(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:U,overflows:E},reset:{placement:J}};let z=(_=E.filter(I=>I.overflows[0]<=0).sort((I,L)=>I.overflows[1]-L.overflows[1])[0])==null?void 0:_.placement;if(!z)switch(m){case"bestFit":{var F;const I=(F=E.filter(L=>{if(R){const $=At(L.placement);return $===w||$==="y"}return!0}).map(L=>[L.placement,L.overflows.filter($=>$>0).reduce(($,D)=>$+D,0)]).sort((L,$)=>L[1]-$[1])[0])==null?void 0:F[0];I&&(z=I);break}case"initialPlacement":z=a;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function Cd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Sd(t){return MR.some(e=>t[e]>=0)}const BR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=Ut(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=Cd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Sd(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=Cd(i,n.floating);return{data:{escapedOffsets:a,escaped:Sd(a)}}}default:return{}}}}},nm=new Set(["left","top"]);async function GR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=zt(n),a=pr(n),c=At(n)==="y",u=nm.has(i)?-1:1,d=s&&c?-1:1,f=Ut(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const UR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=e,c=await GR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},zR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:w,y:b}=x;return{x:w,y:b}}},...u}=Ut(t,e),d={x:n,y:r},f=await s.detectOverflow(e,u),h=At(zt(o)),m=jc(h);let y=d[m],g=d[h];if(i){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=y+f[x],C=y-f[w];y=Ma(b,y,C)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=g+f[x],C=g-f[w];g=Ma(b,g,C)}const v=c.fn({...e,[m]:y,[h]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},WR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Ut(t,e),d={x:n,y:r},f=At(o),h=jc(f);let m=d[h],y=d[f];const g=Ut(a,e),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const b=h==="y"?"height":"width",C=s.reference[h]-s.floating[b]+v.mainAxis,P=s.reference[h]+s.reference[b]-v.mainAxis;m<C?m=C:m>P&&(m=P)}if(u){var x,w;const b=h==="y"?"width":"height",C=nm.has(zt(o)),P=s.reference[f]-s.floating[b]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),R=s.reference[f]+s.reference[b]+(C?0:((w=i.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);y<P?y=P:y>R&&(y=R)}return{[h]:m,[f]:y}}}},HR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:s,platform:i,elements:a}=e,{apply:c=()=>{},...u}=Ut(t,e),d=await i.detectOverflow(e,u),f=zt(o),h=pr(o),m=At(o)==="y",{width:y,height:g}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const w=g-d.top-d.bottom,b=y-d.left-d.right,C=ln(g-d[v],w),P=ln(y-d[x],b),R=!e.middlewareData.shift;let M=C,j=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=w),R&&!h){const E=st(d.left,0),N=st(d.right,0),_=st(d.top,0),F=st(d.bottom,0);m?j=y-2*(E!==0||N!==0?E+N:st(d.left,d.right)):M=g-2*(_!==0||F!==0?_+F:st(d.top,d.bottom))}await c({...e,availableWidth:j,availableHeight:M});const T=await i.getDimensions(a.floating);return y!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function Ps(){return typeof window<"u"}function mr(t){return rm(t)?(t.nodeName||"").toLowerCase():"#document"}function it(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function _t(t){var e;return(e=(rm(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rm(t){return Ps()?t instanceof Node||t instanceof it(t).Node:!1}function vt(t){return Ps()?t instanceof Element||t instanceof it(t).Element:!1}function Xt(t){return Ps()?t instanceof HTMLElement||t instanceof it(t).HTMLElement:!1}function Pd(t){return!Ps()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof it(t).ShadowRoot}function qr(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=xt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function KR(t){return/^(table|td|th)$/.test(mr(t))}function Rs(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const YR=/transform|translate|scale|rotate|perspective|filter/,XR=/paint|layout|strict|content/,Cn=t=>!!t&&t!=="none";let Ri;function Ic(t){const e=vt(t)?xt(t):t;return Cn(e.transform)||Cn(e.translate)||Cn(e.scale)||Cn(e.rotate)||Cn(e.perspective)||!Nc()&&(Cn(e.backdropFilter)||Cn(e.filter))||YR.test(e.willChange||"")||XR.test(e.contain||"")}function qR(t){let e=un(t);for(;Xt(e)&&!nr(e);){if(Ic(e))return e;if(Rs(e))return null;e=un(e)}return null}function Nc(){return Ri==null&&(Ri=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ri}function nr(t){return/^(html|body|#document)$/.test(mr(t))}function xt(t){return it(t).getComputedStyle(t)}function Ts(t){return vt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function un(t){if(mr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Pd(t)&&t.host||_t(t);return Pd(e)?e.host:e}function om(t){const e=un(t);return nr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xt(e)&&qr(e)?e:om(e)}function Or(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=om(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=it(o);if(s){const a=ja(i);return e.concat(i,i.visualViewport||[],qr(o)?o:[],a&&n?Or(a):[])}else return e.concat(o,Or(o,[],n))}function ja(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function sm(t){const e=xt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Xt(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=cs(n)!==s||cs(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function kc(t){return vt(t)?t:t.contextElement}function Qn(t){const e=kc(t);if(!Xt(e))return It(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=sm(e);let i=(s?cs(n.width):n.width)/r,a=(s?cs(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ZR=It(0);function im(t){const e=it(t);return!Nc()||!e.visualViewport?ZR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function QR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==it(t)?!1:e}function jn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=kc(t);let i=It(1);e&&(r?vt(r)&&(i=Qn(r)):i=Qn(t));const a=QR(s,n,r)?im(s):It(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=it(s),m=r&&vt(r)?it(r):r;let y=h,g=ja(y);for(;g&&r&&m!==y;){const v=Qn(g),x=g.getBoundingClientRect(),w=xt(g),b=x.left+(g.clientLeft+parseFloat(w.paddingLeft))*v.x,C=x.top+(g.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=b,u+=C,y=it(g),g=ja(y)}}return us({width:d,height:f,x:c,y:u})}function Ms(t,e){const n=Ts(t).scrollLeft;return e?e.left+n:jn(_t(t)).left+n}function am(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Ms(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function JR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=_t(r),a=e?Rs(e.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=It(1);const d=It(0),f=Xt(r);if((f||!f&&!s)&&((mr(r)!=="body"||qr(i))&&(c=Ts(r)),f)){const m=jn(r);u=Qn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?am(i,c):It(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function eT(t){return Array.from(t.getClientRects())}function tT(t){const e=_t(t),n=Ts(t),r=t.ownerDocument.body,o=st(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=st(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ms(t);const a=-n.scrollTop;return xt(r).direction==="rtl"&&(i+=st(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Rd=25;function nT(t,e){const n=it(t),r=_t(t),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Nc();(!d||d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=Ms(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-m);y<=Rd&&(s-=y)}else u<=Rd&&(s+=u);return{width:s,height:i,x:a,y:c}}function rT(t,e){const n=jn(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Xt(t)?Qn(t):It(1),i=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function Td(t,e,n){let r;if(e==="viewport")r=nT(t,n);else if(e==="document")r=tT(_t(t));else if(vt(e))r=rT(e,n);else{const o=im(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return us(r)}function cm(t,e){const n=un(t);return n===e||!vt(n)||nr(n)?!1:xt(n).position==="fixed"||cm(n,e)}function oT(t,e){const n=e.get(t);if(n)return n;let r=Or(t,[],!1).filter(a=>vt(a)&&mr(a)!=="body"),o=null;const s=xt(t).position==="fixed";let i=s?un(t):t;for(;vt(i)&&!nr(i);){const a=xt(i),c=Ic(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||qr(i)&&!c&&cm(t,i))?r=r.filter(d=>d!==i):o=a,i=un(i)}return e.set(t,r),r}function sT(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?Rs(e)?[]:oT(e,this._c):[].concat(n),r],a=Td(e,i[0],o);let c=a.top,u=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const m=Td(e,i[h],o);c=st(m.top,c),u=ln(m.right,u),d=ln(m.bottom,d),f=st(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function iT(t){const{width:e,height:n}=sm(t);return{width:e,height:n}}function aT(t,e,n){const r=Xt(e),o=_t(e),s=n==="fixed",i=jn(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=It(0);function u(){c.x=Ms(o)}if(r||!r&&!s)if((mr(e)!=="body"||qr(o))&&(a=Ts(e)),r){const m=jn(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?am(o,a):It(0),f=i.left+a.scrollLeft-c.x-d.x,h=i.top+a.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function Ti(t){return xt(t).position==="static"}function Md(t,e){if(!Xt(t)||xt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return _t(t)===n&&(n=n.ownerDocument.body),n}function lm(t,e){const n=it(t);if(Rs(t))return n;if(!Xt(t)){let o=un(t);for(;o&&!nr(o);){if(vt(o)&&!Ti(o))return o;o=un(o)}return n}let r=Md(t,e);for(;r&&KR(r)&&Ti(r);)r=Md(r,e);return r&&nr(r)&&Ti(r)&&!Ic(r)?n:r||qR(t)||n}const cT=async function(t){const e=this.getOffsetParent||lm,n=this.getDimensions,r=await n(t.floating);return{reference:aT(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lT(t){return xt(t).direction==="rtl"}const uT={convertOffsetParentRelativeRectToViewportRelativeRect:JR,getDocumentElement:_t,getClippingRect:sT,getOffsetParent:lm,getElementRects:cT,getClientRects:eT,getDimensions:iT,getScale:Qn,isElement:vt,isRTL:lT};function um(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function dT(t,e){let n=null,r;const o=_t(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(a||e(),!h||!m)return;const y=Ro(f),g=Ro(o.clientWidth-(d+h)),v=Ro(o.clientHeight-(f+m)),x=Ro(d),b={rootMargin:-y+"px "+-g+"px "+-v+"px "+-x+"px",threshold:st(0,ln(1,c))||1};let C=!0;function P(R){const M=R[0].intersectionRatio;if(M!==c){if(!C)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!um(u,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(t)}return i(!0),s}function fT(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=kc(t),d=o||s?[...u?Or(u):[],...e?Or(e):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?dT(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),n()}),u&&!c&&m.observe(u),e&&m.observe(e));let y,g=c?jn(t):null;c&&v();function v(){const x=jn(t);g&&!um(g,x)&&n(),g=x,y=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const hT=UR,pT=zR,mT=VR,gT=HR,yT=BR,Ed=FR,vT=WR,xT=(t,e,n)=>{const r=new Map,o={platform:uT,...n},s={...o.platform,_c:r};return LR(t,e,{...o,platform:s})};var bT=typeof document<"u",wT=function(){},Xo=bT?S.useLayoutEffect:wT;function ds(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ds(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!ds(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function dm(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function jd(t,e){const n=dm(t);return Math.round(e*n)/n}function Mi(t){const e=p.useRef(t);return Xo(()=>{e.current=t}),e}function CT(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[d,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);ds(h,r)||m(r);const[y,g]=p.useState(null),[v,x]=p.useState(null),w=p.useCallback(L=>{L!==R.current&&(R.current=L,g(L))},[]),b=p.useCallback(L=>{L!==M.current&&(M.current=L,x(L))},[]),C=s||y,P=i||v,R=p.useRef(null),M=p.useRef(null),j=p.useRef(d),T=c!=null,E=Mi(c),N=Mi(o),_=Mi(u),F=p.useCallback(()=>{if(!R.current||!M.current)return;const L={placement:e,strategy:n,middleware:h};N.current&&(L.platform=N.current),xT(R.current,M.current,L).then($=>{const D={...$,isPositioned:_.current!==!1};U.current&&!ds(j.current,D)&&(j.current=D,Ur.flushSync(()=>{f(D)}))})},[h,e,n,N,_]);Xo(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const U=p.useRef(!1);Xo(()=>(U.current=!0,()=>{U.current=!1}),[]),Xo(()=>{if(C&&(R.current=C),P&&(M.current=P),C&&P){if(E.current)return E.current(C,P,F);F()}},[C,P,F,E,T]);const J=p.useMemo(()=>({reference:R,floating:M,setReference:w,setFloating:b}),[w,b]),z=p.useMemo(()=>({reference:C,floating:P}),[C,P]),I=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!z.floating)return L;const $=jd(z.floating,d.x),D=jd(z.floating,d.y);return a?{...L,transform:"translate("+$+"px, "+D+"px)",...dm(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:D}},[n,a,z.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:F,refs:J,elements:z,floatingStyles:I}),[d,F,J,z,I])}const ST=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Ed({element:r.current,padding:o}).fn(n):{}:r?Ed({element:r,padding:o}).fn(n):{}}}},PT=(t,e)=>{const n=hT(t);return{name:n.name,fn:n.fn,options:[t,e]}},RT=(t,e)=>{const n=pT(t);return{name:n.name,fn:n.fn,options:[t,e]}},TT=(t,e)=>({fn:vT(t).fn,options:[t,e]}),MT=(t,e)=>{const n=mT(t);return{name:n.name,fn:n.fn,options:[t,e]}},ET=(t,e)=>{const n=gT(t);return{name:n.name,fn:n.fn,options:[t,e]}},jT=(t,e)=>{const n=yT(t);return{name:n.name,fn:n.fn,options:[t,e]}},AT=(t,e)=>{const n=ST(t);return{name:n.name,fn:n.fn,options:[t,e]}};var DT=Object.defineProperty,IT=(t,e)=>DT(t,"name",{value:e,configurable:!0}),NT=p.forwardRef(IT(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return l.jsx(ne.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),kT=NT,_T=Object.defineProperty,OT=(t,e)=>_T(t,"name",{value:e,configurable:!0});function gr(t){const[e,n]=p.useState(void 0);return Te(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}OT(gr,"useSize");var $T=Object.defineProperty,Ft=(t,e)=>$T(t,"name",{value:e,configurable:!0}),fm="Popper",[hm,mn]=Ce(fm),[LT,pm]=hm(fm),FT=Ft(t=>{const{__scopePopper:e,children:n}=t,[r,o]=p.useState(null),[s,i]=p.useState(void 0);return l.jsx(LT,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),VT="PopperAnchor",BT=p.forwardRef(Ft(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=pm(VT,r),a=p.useRef(null),c=i.onAnchorChange,u=p.useCallback(g=>{a.current=g,g&&c(g)},[c]),d=oe(n,u),f=p.useRef(null);p.useEffect(()=>{if(!o)return;const g=f.current;f.current=o.current,g!==f.current&&c(f.current)});const h=i.placementState&&Es(i.placementState),m=h==null?void 0:h[0],y=h==null?void 0:h[1];return o?null:l.jsx(ne.div,{"data-radix-popper-side":m,"data-radix-popper-align":y,...s,ref:d})},"PopperAnchor")),mm="PopperContent",[GT,UT]=hm(mm),zT=p.forwardRef(Ft(function(e,n){var W,Z,ce,ie,ue,se,Ye;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:g,...v}=e,x=pm(mm,r),[w,b]=p.useState(null),C=oe(n,b),[P,R]=p.useState(null),M=gr(P),j=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,E=o+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(d)?d:[d],F=_.length>0,U={padding:N,boundary:_.filter(gm),altBoundary:F},{refs:J,floatingStyles:z,placement:I,isPositioned:L,middlewareData:$}=CT({strategy:"fixed",placement:E,whileElementsMounted:Ft((...$t)=>fT(...$t,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[PT({mainAxis:s+T,alignmentAxis:a}),u&&RT({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?TT():void 0,...U}),u&&MT({...U}),ET({...U,apply:Ft(({elements:$t,rects:qt,availableWidth:we,availableHeight:ft})=>{const{width:uo,height:me}=qt.reference,Se=$t.floating.style;Se.setProperty("--radix-popper-available-width",`${we}px`),Se.setProperty("--radix-popper-available-height",`${ft}px`),Se.setProperty("--radix-popper-anchor-width",`${uo}px`),Se.setProperty("--radix-popper-anchor-height",`${me}px`)},"apply")}),P&&AT({element:P,padding:c}),YT({arrowWidth:j,arrowHeight:T}),m&&jT({strategy:"referenceHidden",...U,boundary:F?U.boundary:void 0})]}),D=x.setPlacementState;Te(()=>(D(I),()=>{D(void 0)}),[I,D]);const[q,A]=Es(I),G=qe(g);Te(()=>{L&&(G==null||G())},[L,G]);const O=(W=$.arrow)==null?void 0:W.x,V=(Z=$.arrow)==null?void 0:Z.y,B=((ce=$.arrow)==null?void 0:ce.centerOffset)!==0,[X,K]=p.useState();return Te(()=>{w&&K(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:L?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(ie=$.transformOrigin)==null?void 0:ie.x,(ue=$.transformOrigin)==null?void 0:ue.y].join(" "),...((se=$.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(GT,{scope:r,placedSide:q,placedAlign:A,onArrowChange:R,arrowX:O,arrowY:V,shouldHideArrow:B,children:l.jsx(ne.div,{"data-side":q,"data-align":A,...v,ref:C,style:{...v.style,animation:L?(Ye=v.style)==null?void 0:Ye.animation:"none"}})})})},"PopperContent")),WT="PopperArrow",HT={top:"bottom",right:"left",bottom:"top",left:"right"},KT=p.forwardRef(Ft(function(e,n){const{__scopePopper:r,...o}=e,s=UT(WT,r),i=HT[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(kT,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function gm(t){return t!==null}Ft(gm,"isNotNull");var YT=Ft(t=>({name:"transformOrigin",options:t,fn(e){var v,x,w;const{placement:n,rects:r,middlewareData:o}=e,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,d]=Es(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let y="",g="";return u==="bottom"?(y=i?f:`${h}px`,g=`${-c}px`):u==="top"?(y=i?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?f:`${m}px`):u==="left"&&(y=`${r.floating.width+c}px`,g=i?f:`${m}px`),{data:{x:y,y:g}}}}),"transformOrigin");function Es(t){const[e,n="center"]=t.split("-");return[e,n]}Ft(Es,"getSideAndAlignFromPlacement");var Zr=FT,Qr=BT,js=zT,ym=KT,XT=Object.defineProperty,qT=(t,e)=>XT(t,"name",{value:e,configurable:!0}),Jr=p.forwardRef(qT(function(e,n){var c;const{container:r,...o}=e,[s,i]=p.useState(!1);Te(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Ur.createPortal(l.jsx(ne.div,{...o,ref:n}),a):null},"Portal")),ZT=Object.defineProperty,Wt=(t,e)=>ZT(t,"name",{value:e,configurable:!0});function vm(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}Wt(vm,"useStateMachine");var Ge=Wt(t=>{const{present:e,children:n}=t,r=xm(e),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=bm(r.ref,wm(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null},"Presence");function xm(t){const[e,n]=p.useState(),r=p.useRef(null),o=p.useRef(t),s=p.useRef("none"),i=p.useRef(void 0),a=t?"mounted":"unmounted",[c,u]=vm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=i.current??Wn(r.current),i.current=void 0):s.current="none"},[c]),Te(()=>{const d=r.current,f=o.current;if(f!==t){const m=s.current,y=Wn(d);t?(i.current=y,u("MOUNT")):y==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),Te(()=>{if(e){let d;const f=e.ownerDocument.defaultView??window,h=Wt(y=>{const v=Wn(r.current).includes(CSS.escape(y.animationName));if(y.target===e&&v&&(u("ANIMATION_END"),!o.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",d=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),m=Wt(y=>{y.target===e&&(s.current=Wn(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(d),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Wn(f)}else r.current=null;n(d)},[])}}Wt(xm,"usePresence");function Aa(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Wt(Aa,"setRef");function bm(...t){const e=p.useRef(t);return e.current=t,p.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const a=Aa(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():Aa(r[i],null)}}},[])}Wt(bm,"useStableComposedRefs");function Wn(t){return(t==null?void 0:t.animationName)||"none"}Wt(Wn,"getAnimationName");function wm(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Wt(wm,"getElementRef");var QT=Object.defineProperty,JT=(t,e)=>QT(t,"name",{value:e,configurable:!0});function _c(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}JT(_c,"usePrevious");var e1=Object.defineProperty,t1=(t,e)=>e1(t,"name",{value:e,configurable:!0}),Cm=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Sm=p.forwardRef(t1(function(e,n){return l.jsx(ne.span,{...e,ref:n,style:{...Cm,...e.style}})},"VisuallyHidden")),n1=Sm,r1=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Bn=new WeakMap,To=new WeakMap,Mo={},Ei=0,Pm=function(t){return t&&(t.host||Pm(t.parentNode))},o1=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Pm(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},s1=function(t,e,n,r){var o=o1(e,Array.isArray(t)?t:[t]);Mo[n]||(Mo[n]=new WeakMap);var s=Mo[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),y=m!==null&&m!=="false",g=(Bn.get(h)||0)+1,v=(s.get(h)||0)+1;Bn.set(h,g),s.set(h,v),i.push(h),g===1&&y&&To.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(e),a.clear(),Ei++,function(){i.forEach(function(f){var h=Bn.get(f)-1,m=s.get(f)-1;Bn.set(f,h),s.set(f,m),h||(To.has(f)||f.removeAttribute(r),To.delete(f)),m||f.removeAttribute(n)}),Ei--,Ei||(Bn=new WeakMap,Bn=new WeakMap,To=new WeakMap,Mo={})}},eo=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=r1(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),s1(r,o,n,"aria-hidden")):function(){return null}},jt=function(){return jt=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},jt.apply(this,arguments)};function Rm(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function i1(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var qo="right-scroll-bar-position",Zo="width-before-scroll-bar",a1="with-scroll-bars-hidden",c1="--removed-body-scroll-bar-size";function ji(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function l1(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var u1=typeof window<"u"?p.useLayoutEffect:p.useEffect,Ad=new WeakMap;function d1(t,e){var n=l1(null,function(r){return t.forEach(function(o){return ji(o,r)})});return u1(function(){var r=Ad.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||ji(a,null)}),s.forEach(function(a){o.has(a)||ji(a,i)})}Ad.set(n,t)},[t]),n}function f1(t){return t}function h1(t,e){e===void 0&&(e=f1);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function p1(t){t===void 0&&(t={});var e=h1(null);return e.options=jt({async:!0,ssr:!1},t),e}var Tm=function(t){var e=t.sideCar,n=Rm(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,jt({},n))};Tm.isSideCarExport=!0;function m1(t,e){return t.useMedium(e),Tm}var Mm=p1(),Ai=function(){},As=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:Ai,onWheelCapture:Ai,onTouchMoveCapture:Ai}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,m=t.noRelative,y=t.noIsolation,g=t.inert,v=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,b=t.gapMode,C=Rm(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,R=d1([n,e]),M=jt(jt({},C),o);return p.createElement(p.Fragment,null,d&&p.createElement(P,{sideCar:Mm,removeScrollBar:u,shards:f,noRelative:m,noIsolation:y,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:b}),i?p.cloneElement(p.Children.only(a),jt(jt({},M),{ref:R})):p.createElement(w,jt({},M,{className:c,ref:R}),a))});As.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};As.classNames={fullWidth:Zo,zeroRight:qo};var g1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function y1(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=g1();return e&&t.setAttribute("nonce",e),t}function v1(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function x1(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var b1=function(){var t=0,e=null;return{add:function(n){t==0&&(e=y1())&&(v1(e,n),x1(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},w1=function(){var t=b1();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Em=function(){var t=w1(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},C1={left:0,top:0,right:0,gap:0},Di=function(t){return parseInt(t||"",10)||0},S1=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[Di(n),Di(r),Di(o)]},P1=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return C1;var e=S1(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},R1=Em(),Jn="data-scroll-locked",T1=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
170
+ .`.concat(a1,` {
171
171
  overflow: hidden `).concat(r,`;
172
172
  padding-right: `).concat(a,"px ").concat(r,`;
173
173
  }
174
- body[`).concat(Zn,`] {
174
+ body[`).concat(Jn,`] {
175
175
  overflow: hidden `).concat(r,`;
176
176
  overscroll-behavior: contain;
177
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
177
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
178
178
  padding-left: `.concat(o,`px;
179
179
  padding-top: `).concat(s,`px;
180
180
  padding-right: `).concat(i,`px;
@@ -184,33 +184,33 @@
184
184
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
185
185
  }
186
186
 
187
- .`).concat(Ko,` {
187
+ .`).concat(qo,` {
188
188
  right: `).concat(a,"px ").concat(r,`;
189
189
  }
190
190
 
191
- .`).concat(zo,` {
191
+ .`).concat(Zo,` {
192
192
  margin-right: `).concat(a,"px ").concat(r,`;
193
193
  }
194
194
 
195
- .`).concat(Ko," .").concat(Ko,` {
195
+ .`).concat(qo," .").concat(qo,` {
196
196
  right: 0 `).concat(r,`;
197
197
  }
198
198
 
199
- .`).concat(zo," .").concat(zo,` {
199
+ .`).concat(Zo," .").concat(Zo,` {
200
200
  margin-right: 0 `).concat(r,`;
201
201
  }
202
202
 
203
- body[`).concat(Zn,`] {
204
- `).concat(WE,": ").concat(a,`px;
203
+ body[`).concat(Jn,`] {
204
+ `).concat(c1,": ").concat(a,`px;
205
205
  }
206
- `)},Qd=function(){var e=parseInt(document.body.getAttribute(Zn)||"0",10);return isFinite(e)?e:0},lM=function(){p.useEffect(function(){return document.body.setAttribute(Zn,(Qd()+1).toString()),function(){var e=Qd()-1;e<=0?document.body.removeAttribute(Zn):document.body.setAttribute(Zn,e.toString())}},[])},uM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;lM();var s=p.useMemo(function(){return iM(o)},[o]);return p.createElement(aM,{styles:cM(s,!t,o,n?"":"!important")})},ja=!1;if(typeof window<"u")try{var So=Object.defineProperty({},"passive",{get:function(){return ja=!0,!0}});window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{ja=!1}var Vn=ja?{passive:!1}:!1,dM=function(e){return e.tagName==="TEXTAREA"},Mm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dM(e)&&n[t]==="visible")},fM=function(e){return Mm(e,"overflowY")},hM=function(e){return Mm(e,"overflowX")},Jd=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Am(e,r);if(o){var s=Nm(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Am=function(e,t){return e==="v"?fM(t):hM(t)},Nm=function(e,t){return e==="v"?pM(t):mM(t)},gM=function(e,t){return e==="h"&&t==="rtl"?-1:1},yM=function(e,t,n,r,o){var s=gM(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 m=Nm(e,a),y=m[0],g=m[1],v=m[2],x=g-v-s*y;(y||x)&&Am(e,a)&&(f+=x,h+=y);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},Ro=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ef=function(e){return[e.deltaX,e.deltaY]},tf=function(e){return e&&"current"in e?e.current:e},vM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xM=function(e){return`
207
- .block-interactivity-`.concat(e,` {pointer-events: none;}
208
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
209
- `)},bM=0,Bn=[];function wM(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(bM++)[0],s=p.useState(Em)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=GE([e.lockRef.current],(e.shards||[]).map(tf),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=Ro(g),b=n.current,w="deltaX"in g?g.deltaX:b[0]-x[0],S="deltaY"in g?g.deltaY:b[1]-x[1],R,P=g.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&T==="h"&&P.type==="range")return!1;var A=window.getSelection(),E=A&&A.anchorNode,M=E?E===P||E.contains(P):!1;if(M)return!1;var D=Jd(T,P);if(!D)return!0;if(D?R=T:(R=T==="v"?"h":"v",D=Jd(T,P)),!D)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=R),!R)return!0;var k=r.current||R;return yM(k,v,g,k==="h"?w:S)},[]),c=p.useCallback(function(g){var v=g;if(!(!Bn.length||Bn[Bn.length-1]!==s)){var x="deltaY"in v?ef(v):Ro(v),b=t.current.filter(function(R){return R.name===v.type&&(R.target===v.target||v.target===R.shadowParent)&&vM(R.delta,x)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var w=(i.current.shards||[]).map(tf).filter(Boolean).filter(function(R){return R.contains(v.target)}),S=w.length>0?a(v,w[0]):!i.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(g,v,x,b){var w={name:g,delta:v,target:x,should:b,shadowParent:CM(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=p.useCallback(function(g){n.current=Ro(g),r.current=void 0},[]),f=p.useCallback(function(g){u(g.type,ef(g),g.target,a(g,e.lockRef.current))},[]),h=p.useCallback(function(g){u(g.type,Ro(g),g.target,a(g,e.lockRef.current))},[]);p.useEffect(function(){return Bn.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Vn),document.addEventListener("touchmove",c,Vn),document.addEventListener("touchstart",d,Vn),function(){Bn=Bn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Vn),document.removeEventListener("touchmove",c,Vn),document.removeEventListener("touchstart",d,Vn)}},[]);var m=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(s,{styles:xM(o)}):null,m?p.createElement(uM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function CM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SM=ZE(Tm,wM);var hr=p.forwardRef(function(e,t){return p.createElement(Is,Mt({},e,{ref:t,sideCar:SM}))});hr.classNames=Is.classNames;var RM=[" ","Enter","ArrowUp","ArrowDown"],PM=[" ","Enter"],Tn="Select",[Ds,ks,TM]=Ur(Tn),[pr]=Ie(Tn,[TM,cn]),_s=cn(),[EM,ln]=pr(Tn),[MM,AM]=pr(Tn),jm=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:m,form:y}=e,g=_s(t),[v,x]=p.useState(null),[b,w]=p.useState(null),[S,R]=p.useState(!1),P=on(u),[T,A]=Ee({prop:r,defaultProp:o??!1,onChange:s,caller:Tn}),[E,M]=Ee({prop:i,defaultProp:a,onChange:c,caller:Tn}),D=p.useRef(null),k=v?y||!!v.closest("form"):!0,[V,W]=p.useState(new Set),Z=Array.from(V).map(G=>G.props.value).join(";");return l.jsx(Xr,{...g,children:l.jsxs(EM,{required:m,scope:t,trigger:v,onTriggerChange:x,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:R,contentId:ve(),value:E,onValueChange:M,open:T,onOpenChange:A,dir:P,triggerPointerDownPosRef:D,disabled:h,children:[l.jsx(Ds.Provider,{scope:t,children:l.jsx(MM,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(G=>{W(_=>new Set(_).add(G))},[]),onNativeOptionRemove:p.useCallback(G=>{W(_=>{const O=new Set(_);return O.delete(G),O})},[]),children:n})}),k?l.jsxs(eg,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:E,onChange:G=>M(G.target.value),disabled:h,form:y,children:[E===void 0?l.jsx("option",{value:""}):null,Array.from(V)]},Z):null]})})};jm.displayName=Tn;var Im="SelectTrigger",Dm=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=_s(n),i=ln(Im,n),a=i.disabled||r,c=se(t,i.onTriggerChange),u=ks(n),d=p.useRef("touch"),[f,h,m]=ng(g=>{const v=u().filter(w=>!w.disabled),x=v.find(w=>w.value===i.value),b=rg(v,g,x);b!==void 0&&i.onValueChange(b.value)}),y=g=>{a||(i.onOpenChange(!0),m()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return l.jsx(qr,{asChild:!0,...s,children:l.jsx(ee.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":tg(i.value)?"":void 0,...o,ref:c,onClick:q(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&y(g)}),onPointerDown:q(o.onPointerDown,g=>{d.current=g.pointerType;const v=g.target;v.hasPointerCapture(g.pointerId)&&v.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:q(o.onKeyDown,g=>{const v=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(v&&g.key===" ")&&RM.includes(g.key)&&(y(),g.preventDefault())})})})});Dm.displayName=Im;var km="SelectValue",_m=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=ln(km,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=se(t,c.onValueNodeChange);return $e(()=>{u(d)},[u,d]),l.jsx(ee.span,{...a,ref:f,style:{pointerEvents:"none"},children:tg(c.value)?l.jsx(l.Fragment,{children:i}):s})});_m.displayName=km;var NM="SelectIcon",Om=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(ee.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Om.displayName=NM;var jM="SelectPortal",$m=e=>l.jsx(fr,{asChild:!0,...e});$m.displayName=jM;var En="SelectContent",Lm=p.forwardRef((e,t)=>{const n=ln(En,e.__scopeSelect),[r,o]=p.useState();if($e(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?or.createPortal(l.jsx(Fm,{scope:e.__scopeSelect,children:l.jsx(Ds.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(Vm,{...e,ref:t})});Lm.displayName=En;var dt=10,[Fm,un]=pr(En),IM="SelectContentImpl",DM=Rn("SelectContent.RemoveScroll"),Vm=p.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:m,sticky:y,hideWhenDetached:g,avoidCollisions:v,...x}=e,b=ln(En,n),[w,S]=p.useState(null),[R,P]=p.useState(null),T=se(t,L=>S(L)),[A,E]=p.useState(null),[M,D]=p.useState(null),k=ks(n),[V,W]=p.useState(!1),Z=p.useRef(!1);p.useEffect(()=>{if(w)return Qr(w)},[w]),Ps();const G=p.useCallback(L=>{const[Q,...K]=k().map(ae=>ae.ref.current),[z]=K.slice(-1),ie=document.activeElement;for(const ae of L)if(ae===ie||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===Q&&R&&(R.scrollTop=0),ae===z&&R&&(R.scrollTop=R.scrollHeight),ae==null||ae.focus(),document.activeElement!==ie))return},[k,R]),_=p.useCallback(()=>G([A,w]),[G,A,w]);p.useEffect(()=>{V&&_()},[V,_]);const{onOpenChange:O,triggerPointerDownPosRef:N}=b;p.useEffect(()=>{if(w){let L={x:0,y:0};const Q=z=>{var ie,ae;L={x:Math.abs(Math.round(z.pageX)-(((ie=N.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(z.pageY)-(((ae=N.current)==null?void 0:ae.y)??0))}},K=z=>{L.x<=10&&L.y<=10?z.preventDefault():w.contains(z.target)||O(!1),document.removeEventListener("pointermove",Q),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",K,{capture:!0})}}},[w,O,N]),p.useEffect(()=>{const L=()=>O(!1);return window.addEventListener("blur",L),window.addEventListener("resize",L),()=>{window.removeEventListener("blur",L),window.removeEventListener("resize",L)}},[O]);const[j,H]=ng(L=>{const Q=k().filter(ie=>!ie.disabled),K=Q.find(ie=>ie.ref.current===document.activeElement),z=rg(Q,L,K);z&&setTimeout(()=>z.ref.current.focus())}),I=p.useCallback((L,Q,K)=>{const z=!Z.current&&!K;(b.value!==void 0&&b.value===Q||z)&&(E(L),z&&(Z.current=!0))},[b.value]),X=p.useCallback(()=>w==null?void 0:w.focus(),[w]),F=p.useCallback((L,Q,K)=>{const z=!Z.current&&!K;(b.value!==void 0&&b.value===Q||z)&&D(L)},[b.value]),U=r==="popper"?Ia:Bm,B=U===Ia?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:v}:{};return l.jsx(Fm,{scope:n,content:w,viewport:R,onViewportChange:P,itemRefCallback:I,selectedItem:A,onItemLeave:X,itemTextRefCallback:F,focusSelectedItem:_,selectedItemText:M,position:r,isPositioned:V,searchRef:j,children:l.jsx(hr,{as:DM,allowPinchZoom:!0,children:l.jsx(zr,{asChild:!0,trapped:b.open,onMountAutoFocus:L=>{L.preventDefault()},onUnmountAutoFocus:q(o,L=>{var Q;(Q=b.trigger)==null||Q.focus({preventScroll:!0}),L.preventDefault()}),children:l.jsx(lr,{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:()=>W(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:q(x.onKeyDown,L=>{const Q=L.ctrlKey||L.altKey||L.metaKey;if(L.key==="Tab"&&L.preventDefault(),!Q&&L.key.length===1&&H(L.key),["ArrowUp","ArrowDown","Home","End"].includes(L.key)){let z=k().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(L.key)&&(z=z.slice().reverse()),["ArrowUp","ArrowDown"].includes(L.key)){const ie=L.target,ae=z.indexOf(ie);z=z.slice(ae+1)}setTimeout(()=>G(z)),L.preventDefault()}})})})})})})});Vm.displayName=IM;var kM="SelectItemAlignedPosition",Bm=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ln(En,n),i=un(En,n),[a,c]=p.useState(null),[u,d]=p.useState(null),f=se(t,T=>d(T)),h=ks(n),m=p.useRef(!1),y=p.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:x,focusSelectedItem:b}=i,w=p.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&g&&v&&x){const T=s.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),E=s.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(s.dir!=="rtl"){const ie=M.left-A.left,ae=E.left-ie,xe=T.left-ae,oe=T.width+xe,rt=Math.max(oe,A.width),ct=window.innerWidth-dt,Ct=ss(ae,[dt,Math.max(dt,ct-rt)]);a.style.minWidth=oe+"px",a.style.left=Ct+"px"}else{const ie=A.right-M.right,ae=window.innerWidth-E.right-ie,xe=window.innerWidth-T.right-ae,oe=T.width+xe,rt=Math.max(oe,A.width),ct=window.innerWidth-dt,Ct=ss(ae,[dt,Math.max(dt,ct-rt)]);a.style.minWidth=oe+"px",a.style.right=Ct+"px"}const D=h(),k=window.innerHeight-dt*2,V=g.scrollHeight,W=window.getComputedStyle(u),Z=parseInt(W.borderTopWidth,10),G=parseInt(W.paddingTop,10),_=parseInt(W.borderBottomWidth,10),O=parseInt(W.paddingBottom,10),N=Z+G+V+O+_,j=Math.min(v.offsetHeight*5,N),H=window.getComputedStyle(g),I=parseInt(H.paddingTop,10),X=parseInt(H.paddingBottom,10),F=T.top+T.height/2-dt,U=k-F,B=v.offsetHeight/2,L=v.offsetTop+B,Q=Z+G+L,K=N-Q;if(Q<=F){const ie=D.length>0&&v===D[D.length-1].ref.current;a.style.bottom="0px";const ae=u.clientHeight-g.offsetTop-g.offsetHeight,xe=Math.max(U,B+(ie?X:0)+ae+_),oe=Q+xe;a.style.height=oe+"px"}else{const ie=D.length>0&&v===D[0].ref.current;a.style.top="0px";const xe=Math.max(F,Z+g.offsetTop+(ie?I:0)+B)+K;a.style.height=xe+"px",g.scrollTop=Q-F+g.offsetTop}a.style.margin=`${dt}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=k+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,a,u,g,v,x,s.dir,r]);$e(()=>w(),[w]);const[S,R]=p.useState();$e(()=>{u&&R(window.getComputedStyle(u).zIndex)},[u]);const P=p.useCallback(T=>{T&&y.current===!0&&(w(),b==null||b(),y.current=!1)},[w,b]);return l.jsx(OM,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:P,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(ee.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Bm.displayName=kM;var _M="SelectPopperPosition",Ia=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=dt,...s}=e,i=_s(n);return l.jsx(Ns,{...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)"}})});Ia.displayName=_M;var[OM,qc]=pr(En,{}),Da="SelectViewport",Gm=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=un(Da,n),i=qc(Da,n),a=se(t,s.onViewportChange),c=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(Ds.Slot,{scope:n,children:l.jsx(ee.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:q(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const y=window.innerHeight-dt*2,g=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),x=Math.max(g,v);if(x<y){const b=x+m,w=Math.min(y,b),S=b-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Gm.displayName=Da;var Um="SelectGroup",[$M,LM]=pr(Um),Wm=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ve();return l.jsx($M,{scope:n,id:o,children:l.jsx(ee.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Wm.displayName=Um;var Km="SelectLabel",zm=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=LM(Km,n);return l.jsx(ee.div,{id:o.id,...r,ref:t})});zm.displayName=Km;var us="SelectItem",[FM,Hm]=pr(us),Ym=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=ln(us,n),c=un(us,n),u=a.value===r,[d,f]=p.useState(s??""),[h,m]=p.useState(!1),y=se(t,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,r,o)}),g=ve(),v=p.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(FM,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:p.useCallback(b=>{f(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(Ds.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:l.jsx(ee.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:y,onFocus:q(i.onFocus,()=>m(!0)),onBlur:q(i.onBlur,()=>m(!1)),onClick:q(i.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:q(i.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:q(i.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:q(i.onPointerMove,b=>{var w;v.current=b.pointerType,o?(w=c.onItemLeave)==null||w.call(c):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:q(i.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:q(i.onKeyDown,b=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(PM.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});Ym.displayName=us;var Cr="SelectItemText",Xm=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ln(Cr,n),a=un(Cr,n),c=Hm(Cr,n),u=AM(Cr,n),[d,f]=p.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)}),m=d==null?void 0:d.textContent,y=p.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=u;return $e(()=>(g(y),()=>v(y)),[g,v,y]),l.jsxs(l.Fragment,{children:[l.jsx(ee.span,{id:c.textId,...s,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?or.createPortal(s.children,i.valueNode):null]})});Xm.displayName=Cr;var qm="SelectItemIndicator",Zm=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Hm(qm,n).isSelected?l.jsx(ee.span,{"aria-hidden":!0,...r,ref:t}):null});Zm.displayName=qm;var ka="SelectScrollUpButton",VM=p.forwardRef((e,t)=>{const n=un(ka,e.__scopeSelect),r=qc(ka,e.__scopeSelect),[o,s]=p.useState(!1),i=se(t,r.onScrollButtonChange);return $e(()=>{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(Qm,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});VM.displayName=ka;var _a="SelectScrollDownButton",BM=p.forwardRef((e,t)=>{const n=un(_a,e.__scopeSelect),r=qc(_a,e.__scopeSelect),[o,s]=p.useState(!1),i=se(t,r.onScrollButtonChange);return $e(()=>{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(Qm,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});BM.displayName=_a;var Qm=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=un("SelectScrollButton",n),i=p.useRef(null),a=ks(n),c=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>c(),[c]),$e(()=>{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(ee.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:q(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:q(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:q(o.onPointerLeave,()=>{c()})})}),GM="SelectSeparator",Jm=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(ee.div,{"aria-hidden":!0,...r,ref:t})});Jm.displayName=GM;var Oa="SelectArrow",UM=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_s(n),s=ln(Oa,n),i=un(Oa,n);return s.open&&i.position==="popper"?l.jsx(js,{...o,...r,ref:t}):null});UM.displayName=Oa;var WM="SelectBubbleInput",eg=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=p.useRef(null),s=se(r,o),i=Zr(t);return p.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(ee.select,{...n,style:{...Cm,...n.style},ref:s,defaultValue:t})});eg.displayName=WM;function tg(e){return e===""||e===void 0}function ng(e){const t=mt(e),n=p.useRef(""),r=p.useRef(0),o=p.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=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function rg(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=KM(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 KM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zM=jm,HM=Dm,YM=_m,XM=Om,qM=$m,ZM=Lm,QM=Gm,JM=Wm,eA=zm,tA=Ym,nA=Xm,rA=Zm,oA=Jm;function sA({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":m,...y}){const{className:g,style:v,styleTag:x}=re(u,c,"cny-select-trigger",t==="sm"||t==="lg"?t:null,n!=="primary"&&n,a,o);return l.jsxs(zM,{disabled:d,...y,children:[l.jsxs(HM,{id:i,"aria-invalid":h,"aria-describedby":m,className:g,style:v,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(YM,{placeholder:e}),l.jsx(XM,{className:"cny-select-chevron",asChild:!0,children:l.jsx(Kr,{size:14,"aria-hidden":"true"})})]}),l.jsx(qM,{children:l.jsx(ZM,{position:"popper",sideOffset:4,className:Y("cny-select-content",s),children:l.jsx(QM,{className:"cny-select-viewport",children:f})})})]})}const iA=C.forwardRef(function({className:t,children:n,...r},o){return l.jsxs(tA,{ref:o,className:Y("cny-select-item",t),...r,children:[l.jsx(nA,{children:n}),l.jsx(rA,{className:"cny-select-indicator",children:l.jsx(Jt,{size:14,"aria-hidden":"true"})})]})}),aA=C.forwardRef(function(t,n){return l.jsx(JM,{ref:n,...t})}),cA=C.forwardRef(function({className:t,...n},r){return l.jsx(eA,{ref:r,className:Y("cny-select-group-label",t),...n})}),lA=C.forwardRef(function({className:t,...n},r){return l.jsx(oA,{ref:r,className:Y("cny-select-separator",t),...n})});function uA(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Be=e=>{const{present:t,children:n}=e,r=dA(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=se(r.ref,fA(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};Be.displayName="Presence";function dA(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[a,c]=uA(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Po(r.current);s.current=a==="mounted"?u:"none"},[a]),$e(()=>{const u=r.current,d=o.current;if(d!==e){const h=s.current,m=Po(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),$e(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=m=>{const g=Po(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=m=>{m.target===t&&(s.current=Po(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:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Po(e){return(e==null?void 0:e.animationName)||"none"}function fA(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 Os="Popover",[og]=Ie(Os,[cn]),Jr=cn(),[hA,dn]=og(Os),sg=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=Jr(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Ee({prop:r,defaultProp:o??!1,onChange:s,caller:Os});return l.jsx(Xr,{...a,children:l.jsx(hA,{scope:t,contentId:ve(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})};sg.displayName=Os;var ig="PopoverAnchor",ag=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dn(ig,n),s=Jr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return p.useEffect(()=>(i(),()=>a()),[i,a]),l.jsx(qr,{...s,...r,ref:t})});ag.displayName=ig;var cg="PopoverTrigger",lg=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dn(cg,n),s=Jr(n),i=se(t,o.triggerRef),a=l.jsx(ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gg(o.open),...r,ref:i,onClick:q(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:l.jsx(qr,{asChild:!0,...s,children:a})});lg.displayName=cg;var Zc="PopoverPortal",[pA,mA]=og(Zc,{forceMount:void 0}),ug=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=dn(Zc,t);return l.jsx(pA,{scope:t,forceMount:n,children:l.jsx(Be,{present:n||s.open,children:l.jsx(fr,{asChild:!0,container:o,children:r})})})};ug.displayName=Zc;var tr="PopoverContent",dg=p.forwardRef((e,t)=>{const n=mA(tr,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=dn(tr,e.__scopePopover);return l.jsx(Be,{present:r||s.open,children:s.modal?l.jsx(yA,{...o,ref:t}):l.jsx(vA,{...o,ref:t})})});dg.displayName=tr;var gA=Rn("PopoverContent.RemoveScroll"),yA=p.forwardRef((e,t)=>{const n=dn(tr,e.__scopePopover),r=p.useRef(null),o=se(t,r),s=p.useRef(!1);return p.useEffect(()=>{const i=r.current;if(i)return Qr(i)},[]),l.jsx(hr,{as:gA,allowPinchZoom:!0,children:l.jsx(fg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:q(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:q(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),vA=p.forwardRef((e,t)=>{const n=dn(tr,e.__scopePopover),r=p.useRef(!1),o=p.useRef(!1);return l.jsx(fg,{...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()}})}),fg=p.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=dn(tr,n),m=Jr(n);return Ps(),l.jsx(zr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(lr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:l.jsx(Ns,{"data-state":gg(h.open),role:"dialog",id:h.contentId,...m,...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)"}})})})}),hg="PopoverClose",pg=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dn(hg,n);return l.jsx(ee.button,{type:"button",...r,ref:t,onClick:q(e.onClick,()=>o.onOpenChange(!1))})});pg.displayName=hg;var xA="PopoverArrow",mg=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Jr(n);return l.jsx(js,{...o,...r,ref:t})});mg.displayName=xA;function gg(e){return e?"open":"closed"}var Qc=sg,bA=ag,Jc=lg,el=ug,tl=dg,wA=pg,CA=mg,nf=1,SA=.9,RA=.8,PA=.17,Bi=.1,Gi=.999,TA=.9999,EA=.99,MA=/[\\\/_+.#"@\[\(\{&]/,AA=/[\\\/_+.#"@\[\(\{&]/g,NA=/[\s-]/,yg=/[\s-]/g;function $a(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?nf:EA;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,y;u>=0;)f=$a(e,t,n,r,u+1,s+1,i),f>d&&(u===o?f*=nf:MA.test(e.charAt(u-1))?(f*=RA,m=e.slice(o,u-1).match(AA),m&&o>0&&(f*=Math.pow(Gi,m.length))):NA.test(e.charAt(u-1))?(f*=SA,y=e.slice(o,u-1).match(yg),y&&o>0&&(f*=Math.pow(Gi,y.length))):(f*=PA,o>0&&(f*=Math.pow(Gi,u-o))),e.charAt(u)!==t.charAt(s)&&(f*=TA)),(f<Bi&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=$a(e,t,n,r,u+1,s+2,i),h*Bi>f&&(f=h*Bi)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function rf(e){return e.toLowerCase().replace(yg," ")}function jA(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,$a(e,t,rf(e),rf(t),0,0,{})}var $s="Dialog",[vg]=Ie($s),[IA,xt]=vg($s),xg=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=p.useRef(null),c=p.useRef(null),[u,d]=Ee({prop:r,defaultProp:o??!1,onChange:s,caller:$s});return l.jsx(IA,{scope:t,triggerRef:a,contentRef:c,contentId:ve(),titleId:ve(),descriptionId:ve(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};xg.displayName=$s;var bg="DialogTrigger",wg=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xt(bg,n),s=se(t,o.triggerRef);return l.jsx(ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ol(o.open),...r,ref:s,onClick:q(e.onClick,o.onOpenToggle)})});wg.displayName=bg;var nl="DialogPortal",[DA,Cg]=vg(nl,{forceMount:void 0}),Sg=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=xt(nl,t);return l.jsx(DA,{scope:t,forceMount:n,children:p.Children.map(r,i=>l.jsx(Be,{present:n||s.open,children:l.jsx(fr,{asChild:!0,container:o,children:i})}))})};Sg.displayName=nl;var ds="DialogOverlay",Rg=p.forwardRef((e,t)=>{const n=Cg(ds,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=xt(ds,e.__scopeDialog);return s.modal?l.jsx(Be,{present:r||s.open,children:l.jsx(_A,{...o,ref:t})}):null});Rg.displayName=ds;var kA=Rn("DialogOverlay.RemoveScroll"),_A=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xt(ds,n);return l.jsx(hr,{as:kA,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ee.div,{"data-state":ol(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Mn="DialogContent",Pg=p.forwardRef((e,t)=>{const n=Cg(Mn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=xt(Mn,e.__scopeDialog);return l.jsx(Be,{present:r||s.open,children:s.modal?l.jsx(OA,{...o,ref:t}):l.jsx($A,{...o,ref:t})})});Pg.displayName=Mn;var OA=p.forwardRef((e,t)=>{const n=xt(Mn,e.__scopeDialog),r=p.useRef(null),o=se(t,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return Qr(s)},[]),l.jsx(Tg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:q(e.onFocusOutside,s=>s.preventDefault())})}),$A=p.forwardRef((e,t)=>{const n=xt(Mn,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return l.jsx(Tg,{...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()}})}),Tg=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=xt(Mn,n),c=p.useRef(null),u=se(t,c);return Ps(),l.jsxs(l.Fragment,{children:[l.jsx(zr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(lr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ol(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(LA,{titleId:a.titleId}),l.jsx(VA,{contentRef:c,descriptionId:a.descriptionId})]})]})}),rl="DialogTitle",Eg=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xt(rl,n);return l.jsx(ee.h2,{id:o.titleId,...r,ref:t})});Eg.displayName=rl;var Mg="DialogDescription",Ag=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xt(Mg,n);return l.jsx(ee.p,{id:o.descriptionId,...r,ref:t})});Ag.displayName=Mg;var Ng="DialogClose",jg=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=xt(Ng,n);return l.jsx(ee.button,{type:"button",...r,ref:t,onClick:q(e.onClick,()=>o.onOpenChange(!1))})});jg.displayName=Ng;function ol(e){return e?"open":"closed"}var Ig="DialogTitleWarning",[B$,Dg]=R1(Ig,{contentName:Mn,titleName:rl,docsSlug:"dialog"}),LA=({titleId:e})=>{const t=Dg(Ig),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
206
+ `)},Dd=function(){var t=parseInt(document.body.getAttribute(Jn)||"0",10);return isFinite(t)?t:0},M1=function(){p.useEffect(function(){return document.body.setAttribute(Jn,(Dd()+1).toString()),function(){var t=Dd()-1;t<=0?document.body.removeAttribute(Jn):document.body.setAttribute(Jn,t.toString())}},[])},E1=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;M1();var s=p.useMemo(function(){return P1(o)},[o]);return p.createElement(R1,{styles:T1(s,!e,o,n?"":"!important")})},Da=!1;if(typeof window<"u")try{var Eo=Object.defineProperty({},"passive",{get:function(){return Da=!0,!0}});window.addEventListener("test",Eo,Eo),window.removeEventListener("test",Eo,Eo)}catch{Da=!1}var Gn=Da?{passive:!1}:!1,j1=function(t){return t.tagName==="TEXTAREA"},jm=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!j1(t)&&n[e]==="visible")},A1=function(t){return jm(t,"overflowY")},D1=function(t){return jm(t,"overflowX")},Id=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Am(t,r);if(o){var s=Dm(t,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},I1=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},N1=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Am=function(t,e){return t==="v"?A1(e):D1(e)},Dm=function(t,e){return t==="v"?I1(e):N1(e)},k1=function(t,e){return t==="h"&&e==="rtl"?-1:1},_1=function(t,e,n,r,o){var s=k1(t,window.getComputedStyle(e).direction),i=s*r,a=n.target,c=e.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var m=Dm(t,a),y=m[0],g=m[1],v=m[2],x=g-v-s*y;(y||x)&&Am(t,a)&&(f+=x,h+=y);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},jo=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Nd=function(t){return[t.deltaX,t.deltaY]},kd=function(t){return t&&"current"in t?t.current:t},O1=function(t,e){return t[0]===e[0]&&t[1]===e[1]},$1=function(t){return`
207
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
208
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
209
+ `)},L1=0,Un=[];function F1(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(L1++)[0],s=p.useState(Em)[0],i=p.useRef(t);p.useEffect(function(){i.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var g=i1([t.lockRef.current],(t.shards||[]).map(kd),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=jo(g),w=n.current,b="deltaX"in g?g.deltaX:w[0]-x[0],C="deltaY"in g?g.deltaY:w[1]-x[1],P,R=g.target,M=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in g&&M==="h"&&R.type==="range")return!1;var j=window.getSelection(),T=j&&j.anchorNode,E=T?T===R||T.contains(R):!1;if(E)return!1;var N=Id(M,R);if(!N)return!0;if(N?P=M:(P=M==="v"?"h":"v",N=Id(M,R)),!N)return!1;if(!r.current&&"changedTouches"in g&&(b||C)&&(r.current=P),!P)return!0;var _=r.current||P;return _1(_,v,g,_==="h"?b:C)},[]),c=p.useCallback(function(g){var v=g;if(!(!Un.length||Un[Un.length-1]!==s)){var x="deltaY"in v?Nd(v):jo(v),w=e.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&O1(P.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(kd).filter(Boolean).filter(function(P){return P.contains(v.target)}),C=b.length>0?a(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(g,v,x,w){var b={name:g,delta:v,target:x,should:w,shadowParent:V1(x)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),d=p.useCallback(function(g){n.current=jo(g),r.current=void 0},[]),f=p.useCallback(function(g){u(g.type,Nd(g),g.target,a(g,t.lockRef.current))},[]),h=p.useCallback(function(g){u(g.type,jo(g),g.target,a(g,t.lockRef.current))},[]);p.useEffect(function(){return Un.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Gn),document.addEventListener("touchmove",c,Gn),document.addEventListener("touchstart",d,Gn),function(){Un=Un.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Gn),document.removeEventListener("touchmove",c,Gn),document.removeEventListener("touchstart",d,Gn)}},[]);var m=t.removeScrollBar,y=t.inert;return p.createElement(p.Fragment,null,y?p.createElement(s,{styles:$1(o)}):null,m?p.createElement(E1,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function V1(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const B1=m1(Mm,F1);var yr=p.forwardRef(function(t,e){return p.createElement(As,jt({},t,{ref:e,sideCar:B1}))});yr.classNames=As.classNames;var G1=Object.defineProperty,fe=(t,e)=>G1(t,"name",{value:e,configurable:!0}),U1=[" ","Enter","ArrowUp","ArrowDown"],z1=[" ","Enter"],rr="Select",[Ds,Oc,W1]=ur(rr),[On,M2]=Ce(rr,[W1,mn]),$c=mn(),[H1,gn]=On(rr),[K1,Y1]=On(rr);function Im(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:y,internal_do_not_use_render:g}=t,v=$c(e),[x,w]=p.useState(null),[b,C]=p.useState(null),[P,R]=p.useState(!1),M=Kt(u),[j,T]=be({prop:r,defaultProp:o??!1,onChange:s,caller:rr}),[E,N]=be({prop:i,defaultProp:a,onChange:c,caller:rr}),_=p.useRef(null),F=p.useRef(E);p.useEffect(()=>{const A=y?x==null?void 0:x.ownerDocument.getElementById(y):x==null?void 0:x.form;if(A instanceof HTMLFormElement){const G=fe(()=>N(F.current),"reset");return A.addEventListener("reset",G),()=>A.removeEventListener("reset",G)}},[y,x,N]);const U=x?!!y||!!x.closest("form"):!0,[J,z]=p.useState(new Set),I=$e(),L=Array.from(J).map(A=>A.props.value).join(";"),$=p.useCallback(A=>{z(G=>new Set(G).add(A))},[]),D=p.useCallback(A=>{z(G=>{const O=new Set(G);return O.delete(A),O})},[]),q={required:m,trigger:x,onTriggerChange:w,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:R,contentId:I,value:E,onValueChange:N,open:j,onOpenChange:T,dir:M,triggerPointerDownPosRef:_,disabled:h,name:d,autoComplete:f,form:y,nativeOptions:J,nativeSelectKey:L,isFormControl:U};return l.jsx(Zr,{...v,children:l.jsx(H1,{scope:e,...q,children:l.jsx(Ds.Provider,{scope:e,children:l.jsx(K1,{scope:e,onNativeOptionAdd:$,onNativeOptionRemove:D,children:_m(g)?g(q):n})})})})}fe(Im,"SelectProvider");var X1=fe(t=>{const{__scopeSelect:e,children:n,...r}=t;return l.jsx(Im,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>l.jsxs(l.Fragment,{children:[n,o?l.jsx(TM,{__scopeSelect:e}):null]})})},"Select"),q1="SelectTrigger",Z1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=$c(r),a=gn(q1,r),c=a.disabled||o,u=oe(n,a.onTriggerChange),d=Oc(r),f=p.useRef("touch"),[h,m,y]=Lc(v=>{const x=d().filter(C=>!C.disabled),w=x.find(C=>C.value===a.value),b=Fc(x,v,w);b!==void 0&&a.onValueChange(b.value)}),g=fe(v=>{c||(a.onOpenChange(!0),y()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})},"handleOpen");return l.jsx(Qr,{asChild:!0,...i,children:l.jsx(ne.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":to(a.value)?"":void 0,...s,ref:u,onClick:H(s.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&g(v)}),onPointerDown:H(s.onPointerDown,v=>{f.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(g(v),v.preventDefault())}),onKeyDown:H(s.onKeyDown,v=>{const x=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&U1.includes(v.key)&&(g(),v.preventDefault())})})})},"SelectTrigger")),Q1="SelectValue",J1=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...c}=e,u=gn(Q1,r),{onValueNodeHasChildrenChange:d}=u,f=i!==void 0,h=oe(n,u.onValueNodeChange);Te(()=>{d(f)},[d,f]);const m=to(u.value);return l.jsx(ne.span,{...c,asChild:m?!1:c.asChild,ref:h,style:{pointerEvents:"none"},children:l.jsx(p.Fragment,{children:m?a:i},m?"placeholder":"value")})},"SelectValue")),eM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return l.jsx(ne.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),tM="SelectPortal",[nM,rM]=On(tM,{forceMount:void 0}),oM=fe(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return l.jsx(nM,{scope:t.__scopeSelect,forceMount:n,children:l.jsx(Jr,{asChild:!0,...r})})},"SelectPortal"),An="SelectContent",sM=p.forwardRef(fe(function(e,n){const r=rM(An,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=gn(An,e.__scopeSelect),[a,c]=p.useState();return Te(()=>{c(new DocumentFragment)},[]),l.jsx(Ge,{present:o||i.open,children:({present:u})=>u?l.jsx(cM,{...s,ref:n}):l.jsx(iM,{...s,fragment:a})})},"SelectContent")),iM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Ur.createPortal(l.jsx(Nm,{scope:r,children:l.jsx(Ds.Slot,{scope:r,children:l.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),mt=10,[Nm,Is]=On(An),aM=kt("SelectContent.RemoveScroll"),cM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:y,sticky:g,hideWhenDetached:v,avoidCollisions:x,...w}=e,b=gn(An,r),[C,P]=p.useState(null),[R,M]=p.useState(null),j=oe(n,P),[T,E]=p.useState(null),[N,_]=p.useState(null),F=Oc(r),[U,J]=p.useState(!1),z=p.useRef(!1);p.useEffect(()=>{if(C)return eo(C)},[C]),hr();const I=p.useCallback(K=>{const[W,...Z]=F().map(ue=>ue.ref.current),[ce]=Z.slice(-1),ie=document.activeElement;for(const ue of K)if(ue===ie||(ue==null||ue.scrollIntoView({block:"nearest"}),ue===W&&R&&(R.scrollTop=0),ue===ce&&R&&(R.scrollTop=R.scrollHeight),ue==null||ue.focus(),document.activeElement!==ie))return},[F,R]),L=p.useCallback(()=>I([T,C]),[I,T,C]);p.useEffect(()=>{U&&L()},[U,L]);const{onOpenChange:$,triggerPointerDownPosRef:D}=b;p.useEffect(()=>{if(C){let K={x:0,y:0};const W=fe(ce=>{var ie,ue;K={x:Math.abs(Math.round(ce.pageX)-(((ie=D.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((ue=D.current)==null?void 0:ue.y)??0))}},"handlePointerMove"),Z=fe(ce=>{K.x<=10&&K.y<=10?ce.preventDefault():ce.composedPath().includes(C)||$(!1),document.removeEventListener("pointermove",W),D.current=null},"handlePointerUp");return D.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",Z,{capture:!0})}}},[C,$,D]),p.useEffect(()=>{const K=fe(()=>$(!1),"close");return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[$]);const[q,A]=Lc(K=>{const W=F().filter(ie=>!ie.disabled),Z=W.find(ie=>ie.ref.current===document.activeElement),ce=Fc(W,K,Z);ce&&setTimeout(()=>{var ie;return(ie=ce.ref.current)==null?void 0:ie.focus()})}),G=p.useCallback((K,W,Z)=>{const ce=!z.current&&!Z;(b.value!==void 0&&b.value===W||ce)&&(E(K),ce&&(z.current=!0))},[b.value]),O=p.useCallback(()=>C==null?void 0:C.focus(),[C]),V=p.useCallback((K,W,Z)=>{const ce=!z.current&&!Z;(b.value!==void 0&&b.value===W||ce)&&_(K)},[b.value]),B=o==="popper"?_d:lM,X=B===_d?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:y,sticky:g,hideWhenDetached:v,avoidCollisions:x}:{};return l.jsx(Nm,{scope:r,content:C,viewport:R,onViewportChange:M,itemRefCallback:G,selectedItem:T,onItemLeave:O,itemTextRefCallback:V,focusSelectedItem:L,selectedItemText:N,position:o,isPositioned:U,searchRef:q,children:l.jsx(yr,{as:aM,allowPinchZoom:!0,children:l.jsx(Ss,{asChild:!0,trapped:b.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:H(s,K=>{var W;(W=b.trigger)==null||W.focus({preventScroll:!0}),K.preventDefault()}),children:l.jsx(fr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(B,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:K=>K.preventDefault(),...w,...X,onPlaced:()=>J(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:H(w.onKeyDown,K=>{const W=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!W&&K.key.length===1&&A(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let ce=F().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(K.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ie=K.target,ue=ce.indexOf(ie);ce=ce.slice(ue+1)}setTimeout(()=>I(ce)),K.preventDefault()}})})})})})})},"SelectContentImpl")),lM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=gn(An,r),a=Is(An,r),[c,u]=p.useState(null),[d,f]=p.useState(null),h=oe(n,f),m=Oc(r),y=p.useRef(!1),g=p.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:w,focusSelectedItem:b}=a,C=p.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&v&&x&&w){const j=i.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),N=w.getBoundingClientRect();if(i.dir!=="rtl"){const ie=N.left-T.left,ue=E.left-ie,se=j.left-ue,Ye=j.width+se,$t=Math.max(Ye,T.width),qt=window.innerWidth-mt,we=_r(ue,[mt,Math.max(mt,qt-$t)]);c.style.minWidth=Ye+"px",c.style.left=we+"px"}else{const ie=T.right-N.right,ue=window.innerWidth-E.right-ie,se=window.innerWidth-j.right-ue,Ye=j.width+se,$t=Math.max(Ye,T.width),qt=window.innerWidth-mt,we=_r(ue,[mt,Math.max(mt,qt-$t)]);c.style.minWidth=Ye+"px",c.style.right=we+"px"}const _=m(),F=window.innerHeight-mt*2,U=v.scrollHeight,J=window.getComputedStyle(d),z=parseInt(J.borderTopWidth,10),I=parseInt(J.paddingTop,10),L=parseInt(J.borderBottomWidth,10),$=parseInt(J.paddingBottom,10),D=z+I+U+$+L,q=Math.min(x.offsetHeight*5,D),A=window.getComputedStyle(v),G=parseInt(A.paddingTop,10),O=parseInt(A.paddingBottom,10),V=j.top+j.height/2-mt,B=F-V,X=x.offsetHeight/2,K=x.offsetTop+X,W=z+I+K,Z=D-W;if(W<=V){const ie=_.length>0&&x===_[_.length-1].ref.current;c.style.bottom="0px";const ue=d.clientHeight-v.offsetTop-v.offsetHeight,se=Math.max(B,X+(ie?O:0)+ue+L),Ye=W+se;c.style.height=Ye+"px"}else{const ie=_.length>0&&x===_[0].ref.current;c.style.top="0px";const se=Math.max(V,z+v.offsetTop+(ie?G:0)+X)+Z;c.style.height=se+"px",v.scrollTop=W-V+v.offsetTop}c.style.margin=`${mt}px 0`,c.style.minHeight=q+"px",c.style.maxHeight=F+"px",o==null||o(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,c,d,v,x,w,i.dir,o]);Te(()=>C(),[C]);const[P,R]=p.useState();Te(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const M=p.useCallback(j=>{j&&g.current===!0&&(C(),b==null||b(),g.current=!1)},[C,b]);return l.jsx(uM,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:M,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:l.jsx(ne.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),_d=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=mt,...i}=e,a=$c(r);return l.jsx(js,{...a,...i,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[uM,dM]=On(An,{}),Od="SelectViewport",fM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=Is(Od,r),a=dM(Od,r),c=oe(n,i.onViewportChange),u=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Ds.Slot,{scope:r,children:l.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:H(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const y=Math.abs(u.current-f.scrollTop);if(y>0){const g=window.innerHeight-mt*2,v=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),w=Math.max(v,x);if(w<g){const b=w+y,C=Math.min(g,b),P=b-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=P>0?P:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})},"SelectViewport")),hM="SelectGroup",[pM,mM]=On(hM),gM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e,s=$e();return l.jsx(pM,{scope:r,id:s,children:l.jsx(ne.div,{role:"group","aria-labelledby":s,...o,ref:n})})},"SelectGroup")),yM="SelectLabel",vM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e,s=mM(yM,r);return l.jsx(ne.div,{id:s.id,...o,ref:n})},"SelectLabel")),Ia="SelectItem",[xM,km]=On(Ia),bM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,c=gn(Ia,r),u=Is(Ia,r),d=c.value===o,[f,h]=p.useState(i??""),[m,y]=p.useState(!1),g=qe(C=>{var P;return(P=u.itemRefCallback)==null?void 0:P.call(u,C,o,s)}),v=oe(n,g),x=$e(),w=p.useRef("touch"),b=fe(()=>{s||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return l.jsx(xM,{scope:r,value:o,disabled:s,textId:x,isSelected:d,onItemTextChange:p.useCallback(C=>{h(P=>P||((C==null?void 0:C.textContent)??"").trim())},[]),children:l.jsx(Ds.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:l.jsx(ne.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:v,onFocus:H(a.onFocus,()=>y(!0)),onBlur:H(a.onBlur,()=>y(!1)),onClick:H(a.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:H(a.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:H(a.onPointerDown,C=>{w.current=C.pointerType}),onPointerMove:H(a.onPointerMove,C=>{var P;w.current=C.pointerType,s?(P=u.onItemLeave)==null||P.call(u):w.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(a.onPointerLeave,C=>{var P;C.currentTarget===document.activeElement&&((P=u.onItemLeave)==null||P.call(u))}),onKeyDown:H(a.onKeyDown,C=>{var R;s||C.target!==C.currentTarget||((R=u.searchRef)==null?void 0:R.current)!==""&&C.key===" "||(z1.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})},"SelectItem")),Ao="SelectItemText",wM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=gn(Ao,r),c=Is(Ao,r),u=km(Ao,r),d=Y1(Ao,r),[f,h]=p.useState(null),m=qe(b=>{var C;return(C=c.itemTextRefCallback)==null?void 0:C.call(c,b,u.value,u.disabled)}),y=oe(n,h,u.onItemTextChange,m),g=f==null?void 0:f.textContent,v=p.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return Te(()=>(x(v),()=>w(v)),[x,w,v]),l.jsxs(l.Fragment,{children:[l.jsx(ne.span,{id:u.textId,...i,ref:y}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!to(a.value)?Ur.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),CM="SelectItemIndicator",SM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e;return km(CM,r).isSelected?l.jsx(ne.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),PM=p.forwardRef(fe(function(e,n){const{__scopeSelect:r,...o}=e;return l.jsx(ne.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),RM="SelectBubbleInput",TM=p.forwardRef(fe(function({__scopeSelect:e,...n},r){const o=gn(RM,e),{value:s,onValueChange:i,required:a,disabled:c,name:u,autoComplete:d,form:f}=o,{nativeOptions:h,nativeSelectKey:m}=o,y=p.useRef(null),g=oe(r,y),v=s??"",x=_c(v),w=Array.from(h).some(b=>(b.props.value??"")==="");return p.useEffect(()=>{const b=y.current;if(!b)return;const C=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(C,"value").set;if(x!==v&&R){const M=new Event("change",{bubbles:!0});R.call(b,v),b.dispatchEvent(M)}},[x,v]),l.jsxs(ne.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:b=>i(b.target.value),...n,style:{...Cm,...n.style},ref:g,defaultValue:v,children:[to(s)&&!w?l.jsx("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function _m(t){return typeof t=="function"}fe(_m,"isFunction");function to(t){return t===""||t===void 0}fe(to,"shouldShowPlaceholder");function Lc(t){const e=qe(t),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;e(a),fe((function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch")(a)},[e]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}fe(Lc,"useTypeaheadSearch");function Fc(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=Om(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}fe(Fc,"findNextItem");function Om(t,e){return t.map((n,r)=>t[(e+r)%t.length])}fe(Om,"wrapArray");function MM({placeholder:t,size:e,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,style:c,sx:u,disabled:d,children:f,"aria-invalid":h,"aria-describedby":m,...y}){const{className:g,style:v,styleTag:x}=re(u,c,"cny-select-trigger",e==="sm"||e==="lg"?e:null,n!=="primary"&&n,a,o);return l.jsxs(X1,{disabled:d,...y,children:[l.jsxs(Z1,{id:i,"aria-invalid":h,"aria-describedby":m,className:g,style:v,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(J1,{placeholder:t}),l.jsx(eM,{className:"cny-select-chevron",asChild:!0,children:l.jsx(Xr,{size:14,"aria-hidden":"true"})})]}),l.jsx(oM,{children:l.jsx(sM,{position:"popper",sideOffset:4,className:Y("cny-select-content",s),children:l.jsx(fM,{className:"cny-select-viewport",children:f})})})]})}const EM=S.forwardRef(function({className:e,children:n,...r},o){return l.jsxs(bM,{ref:o,className:Y("cny-select-item",e),...r,children:[l.jsx(wM,{children:n}),l.jsx(SM,{className:"cny-select-indicator",children:l.jsx(cn,{size:14,"aria-hidden":"true"})})]})}),jM=S.forwardRef(function(e,n){return l.jsx(gM,{ref:n,...e})}),AM=S.forwardRef(function({className:e,...n},r){return l.jsx(vM,{ref:r,className:Y("cny-select-group-label",e),...n})}),DM=S.forwardRef(function({className:e,...n},r){return l.jsx(PM,{ref:r,className:Y("cny-select-separator",e),...n})});var IM=Object.defineProperty,wt=(t,e)=>IM(t,"name",{value:e,configurable:!0}),Vc="Popover",[$m,E2]=Ce(Vc,[mn]),no=mn(),[NM,yn]=$m(Vc),kM=wt(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=t,a=no(e),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=be({prop:r,defaultProp:o??!1,onChange:s,caller:Vc});return l.jsx(Zr,{...a,children:l.jsx(NM,{scope:e,contentId:$e(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),_M="PopoverAnchor",OM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=yn(_M,r),i=no(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=s;return p.useEffect(()=>(a(),()=>c()),[a,c]),l.jsx(Qr,{...i,...o,ref:n})},"PopoverAnchor")),$M="PopoverTrigger",LM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=yn($M,r),i=no(r),a=oe(n,s.triggerRef),c=l.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Bc(s.open),...o,ref:a,onClick:H(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:l.jsx(Qr,{asChild:!0,...i,children:c})},"PopoverTrigger")),Lm="PopoverPortal",[FM,VM]=$m(Lm,{forceMount:void 0}),BM=wt(t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,s=yn(Lm,e);return l.jsx(FM,{scope:e,forceMount:n,children:l.jsx(Ge,{present:n||s.open,children:l.jsx(Jr,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),$r="PopoverContent",GM=p.forwardRef(wt(function(e,n){const r=VM($r,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,i=yn($r,e.__scopePopover);return l.jsx(Ge,{present:o||i.open,children:i.modal?l.jsx(zM,{...s,ref:n}):l.jsx(WM,{...s,ref:n})})},"PopoverContent")),UM=kt("PopoverContent.RemoveScroll"),zM=p.forwardRef(wt(function(e,n){const r=yn($r,e.__scopePopover),o=p.useRef(null),s=oe(n,o),i=p.useRef(!1);return p.useEffect(()=>{const a=o.current;if(a)return eo(a)},[]),l.jsx(yr,{as:UM,allowPinchZoom:!0,children:l.jsx(Fm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),WM=p.forwardRef(wt(function(e,n){const r=yn($r,e.__scopePopover),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Fm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"PopoverContentNonModal")),Fm=p.forwardRef(wt(function(e,n){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=e,m=yn($r,r),y=no(r);return hr(),l.jsx(Ss,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(fr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:l.jsx(js,{"data-state":Bc(m.open),role:"dialog",id:m.contentId,...y,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),HM="PopoverClose",KM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=yn(HM,r);return l.jsx(ne.button,{type:"button",...o,ref:n,onClick:H(e.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),YM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=no(r);return l.jsx(ym,{...s,...o,ref:n})},"PopoverArrow"));function Bc(t){return t?"open":"closed"}wt(Bc,"getState");var Gc=kM,XM=OM,Uc=LM,zc=BM,Wc=GM,qM=KM,ZM=YM,$d=1,QM=.9,JM=.8,eE=.17,Ii=.1,Ni=.999,tE=.9999,nE=.99,rE=/[\\\/_+.#"@\[\(\{&]/,oE=/[\\\/_+.#"@\[\(\{&]/g,sE=/[\s-]/,Vm=/[\s-]/g;function Na(t,e,n,r,o,s,i){if(s===e.length)return o===t.length?$d:nE;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,y;u>=0;)f=Na(t,e,n,r,u+1,s+1,i),f>d&&(u===o?f*=$d:rE.test(t.charAt(u-1))?(f*=JM,m=t.slice(o,u-1).match(oE),m&&o>0&&(f*=Math.pow(Ni,m.length))):sE.test(t.charAt(u-1))?(f*=QM,y=t.slice(o,u-1).match(Vm),y&&o>0&&(f*=Math.pow(Ni,y.length))):(f*=eE,o>0&&(f*=Math.pow(Ni,u-o))),t.charAt(u)!==e.charAt(s)&&(f*=tE)),(f<Ii&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=Na(t,e,n,r,u+1,s+2,i),h*Ii>f&&(f=h*Ii)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Ld(t){return t.toLowerCase().replace(Vm," ")}function iE(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Na(t,e,Ld(t),Ld(e),0,0,{})}function Er(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function Fd(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Dn(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Fd(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Fd(t[o],null)}}}}function ro(...t){return p.useCallback(Dn(...t),t)}function aE(t,e){const n=p.createContext(e),r=s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=t+"Provider";function o(s){const i=p.useContext(n);if(i)return i;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,o]}function cE(t,e=[]){let n=[];function r(s,i){const a=p.createContext(i),c=n.length;n=[...n,i];const u=f=>{var x;const{scope:h,children:m,...y}=f,g=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:v,children:m})};u.displayName=s+"Provider";function d(f,h){var g;const m=((g=h==null?void 0:h[t])==null?void 0:g[c])||a,y=p.useContext(m);if(y)return y;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=>p.createContext(i));return function(a){const c=(a==null?void 0:a[t])||s;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return o.scopeName=t,[r,lE(o,...e)]}function lE(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.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 p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}var Lr=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},uE=p[" useId ".trim().toString()]||(()=>{}),dE=0;function Vt(t){const[e,n]=p.useState(uE());return Lr(()=>{n(r=>r??String(dE++))},[t]),e?`radix-${e}`:""}var fE=p[" useInsertionEffect ".trim().toString()]||Lr;function hE({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,s,i]=pE({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:o;{const d=p.useRef(t!==void 0);p.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=p.useCallback(d=>{var f;if(a){const h=mE(d)?d(t):d;h!==t&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,t,s,i]);return[c,u]}function pE({defaultProp:t,onChange:e}){const[n,r]=p.useState(t),o=p.useRef(n),s=p.useRef(e);return fE(()=>{s.current=e},[e]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function mE(t){return typeof t=="function"}function Bm(t){const e=gE(t),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(vE);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(e,{...i,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function gE(t){const e=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=bE(o),a=xE(s,o.props);return o.type!==p.Fragment&&(a.ref=r?Dn(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var yE=Symbol("radix.slottable");function vE(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===yE}function xE(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function bE(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var wE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=wE.reduce((t,e)=>{const n=Bm(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Vd(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}var ki="focusScope.autoFocusOnMount",_i="focusScope.autoFocusOnUnmount",Bd={bubbles:!1,cancelable:!0},CE="FocusScope",Gm=p.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=t,[a,c]=p.useState(null),u=Vd(o),d=Vd(s),f=p.useRef(null),h=ro(e,g=>c(g)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let g=function(b){if(m.paused||!a)return;const C=b.target;a.contains(C)?f.current=C:tn(f.current,{select:!0})},v=function(b){if(m.paused||!a)return;const C=b.relatedTarget;C!==null&&(a.contains(C)||tn(f.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const P of b)P.removedNodes.length>0&&tn(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,m.paused]),p.useEffect(()=>{if(a){Ud.add(m);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(ki,Bd);a.addEventListener(ki,u),a.dispatchEvent(x),x.defaultPrevented||(SE(EE(Um(a)),{select:!0}),document.activeElement===g&&tn(a))}return()=>{a.removeEventListener(ki,u),setTimeout(()=>{const x=new CustomEvent(_i,Bd);a.addEventListener(_i,d),a.dispatchEvent(x),x.defaultPrevented||tn(g??document.body,{select:!0}),a.removeEventListener(_i,d),Ud.remove(m)},0)}}},[a,u,d,m]);const y=p.useCallback(g=>{if(!n&&!r||m.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(v&&x){const w=g.currentTarget,[b,C]=PE(w);b&&C?!g.shiftKey&&x===C?(g.preventDefault(),n&&tn(b,{select:!0})):g.shiftKey&&x===b&&(g.preventDefault(),n&&tn(C,{select:!0})):x===w&&g.preventDefault()}},[n,r,m.paused]);return l.jsx(Ke.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});Gm.displayName=CE;function SE(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(tn(r,{select:e}),document.activeElement!==n)return}function PE(t){const e=Um(t),n=Gd(e,t),r=Gd(e.reverse(),t);return[n,r]}function Um(t){const e=[],n=document.createTreeWalker(t,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();)e.push(n.currentNode);return e}function Gd(t,e){for(const n of t)if(!RE(n,{upTo:e}))return n}function RE(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function TE(t){return t instanceof HTMLInputElement&&"select"in t}function tn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&TE(t)&&e&&t.select()}}var Ud=ME();function ME(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=zd(t,e),t.unshift(e)},remove(e){var n;t=zd(t,e),(n=t[0])==null||n.resume()}}}function zd(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function EE(t){return t.filter(e=>e.tagName!=="A")}var jE="Portal",zm=p.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[o,s]=p.useState(!1);Lr(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ps.createPortal(l.jsx(Ke.div,{...r,ref:e}),i):null});zm.displayName=jE;function AE(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}var Ns=t=>{const{present:e,children:n}=t,r=DE(e),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=ro(r.ref,IE(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};Ns.displayName="Presence";function DE(t){const[e,n]=p.useState(),r=p.useRef(null),o=p.useRef(t),s=p.useRef("none"),i=t?"mounted":"unmounted",[a,c]=AE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Do(r.current);s.current=a==="mounted"?u:"none"},[a]),Lr(()=>{const u=r.current,d=o.current;if(d!==t){const h=s.current,m=Do(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,c]),Lr(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=m=>{const g=Do(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&g&&(c("ANIMATION_END"),!o.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},h=m=>{m.target===e&&(s.current=Do(r.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Do(t){return(t==null?void 0:t.animationName)||"none"}function IE(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Oi=0;function NE(){p.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Wd()),document.body.insertAdjacentElement("beforeend",t[1]??Wd()),Oi++,()=>{Oi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Oi--}},[])}function Wd(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ks="Dialog",[Wm]=cE(ks),[kE,Ct]=Wm(ks),Hm=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=p.useRef(null),c=p.useRef(null),[u,d]=hE({prop:r,defaultProp:o??!1,onChange:s,caller:ks});return l.jsx(kE,{scope:e,triggerRef:a,contentRef:c,contentId:Vt(),titleId:Vt(),descriptionId:Vt(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};Hm.displayName=ks;var Km="DialogTrigger",_E=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Ct(Km,n),s=ro(e,o.triggerRef);return l.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yc(o.open),...r,ref:s,onClick:Er(t.onClick,o.onOpenToggle)})});_E.displayName=Km;var Hc="DialogPortal",[OE,Ym]=Wm(Hc,{forceMount:void 0}),Xm=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=Ct(Hc,e);return l.jsx(OE,{scope:e,forceMount:n,children:p.Children.map(r,i=>l.jsx(Ns,{present:n||s.open,children:l.jsx(zm,{asChild:!0,container:o,children:i})}))})};Xm.displayName=Hc;var fs="DialogOverlay",qm=p.forwardRef((t,e)=>{const n=Ym(fs,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,s=Ct(fs,t.__scopeDialog);return s.modal?l.jsx(Ns,{present:r||s.open,children:l.jsx(LE,{...o,ref:e})}):null});qm.displayName=fs;var $E=Bm("DialogOverlay.RemoveScroll"),LE=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Ct(fs,n);return l.jsx(yr,{as:$E,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(Ke.div,{"data-state":Yc(o.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),In="DialogContent",Zm=p.forwardRef((t,e)=>{const n=Ym(In,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,s=Ct(In,t.__scopeDialog);return l.jsx(Ns,{present:r||s.open,children:s.modal?l.jsx(FE,{...o,ref:e}):l.jsx(VE,{...o,ref:e})})});Zm.displayName=In;var FE=p.forwardRef((t,e)=>{const n=Ct(In,t.__scopeDialog),r=p.useRef(null),o=ro(e,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return eo(s)},[]),l.jsx(Qm,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Er(t.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Er(t.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:Er(t.onFocusOutside,s=>s.preventDefault())})}),VE=p.forwardRef((t,e)=>{const n=Ct(In,t.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return l.jsx(Qm,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=t.onCloseAutoFocus)==null||i.call(t,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=t.onInteractOutside)==null||c.call(t,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()}})}),Qm=p.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=t,a=Ct(In,n),c=p.useRef(null),u=ro(e,c);return NE(),l.jsxs(l.Fragment,{children:[l.jsx(Gm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(fr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Yc(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(zE,{titleId:a.titleId}),l.jsx(HE,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Kc="DialogTitle",BE=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Ct(Kc,n);return l.jsx(Ke.h2,{id:o.titleId,...r,ref:e})});BE.displayName=Kc;var Jm="DialogDescription",GE=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Ct(Jm,n);return l.jsx(Ke.p,{id:o.descriptionId,...r,ref:e})});GE.displayName=Jm;var eg="DialogClose",UE=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Ct(eg,n);return l.jsx(Ke.button,{type:"button",...r,ref:e,onClick:Er(t.onClick,()=>o.onOpenChange(!1))})});UE.displayName=eg;function Yc(t){return t?"open":"closed"}var tg="DialogTitleWarning",[j2,ng]=aE(tg,{contentName:In,titleName:Kc,docsSlug:"dialog"}),zE=({titleId:t})=>{const e=ng(tg),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
210
210
 
211
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
211
+ If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
212
212
 
213
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},FA="DialogDescriptionWarning",VA=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dg(FA).contentName}}.`;return p.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},sl=xg,kg=wg,il=Sg,al=Rg,cl=Pg,ll=Eg,ul=Ag,Ls=jg,br='[cmdk-group=""]',Ui='[cmdk-group-items=""]',BA='[cmdk-group-heading=""]',_g='[cmdk-item=""]',of=`${_g}:not([aria-disabled="true"])`,La="cmdk-item-select",Un="data-value",GA=(e,t,n)=>jA(e,t,n),Og=p.createContext(void 0),eo=()=>p.useContext(Og),$g=p.createContext(void 0),dl=()=>p.useContext($g),Lg=p.createContext(void 0),Fg=p.forwardRef((e,t)=>{let n=Wn(()=>{var I,X;return{search:"",value:(X=(I=e.value)!=null?I:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Wn(()=>new Set),o=Wn(()=>new Map),s=Wn(()=>new Map),i=Wn(()=>new Set),a=Vg(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:y,disablePointerSelection:g=!1,vimBindings:v=!0,...x}=e,b=ve(),w=ve(),S=ve(),R=p.useRef(null),P=JA();An(()=>{if(d!==void 0){let I=d.trim();n.current.value=I,T.emit()}},[d]),An(()=>{P(6,V)},[]);let T=p.useMemo(()=>({subscribe:I=>(i.current.add(I),()=>i.current.delete(I)),snapshot:()=>n.current,setState:(I,X,F)=>{var U,B,L,Q;if(!Object.is(n.current[I],X)){if(n.current[I]=X,I==="search")k(),M(),P(1,D);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(S);K?K.focus():(U=document.getElementById(b))==null||U.focus()}if(P(7,()=>{var K;n.current.selectedItemId=(K=W())==null?void 0:K.id,T.emit()}),F||P(5,V),((B=a.current)==null?void 0:B.value)!==void 0){let K=X??"";(Q=(L=a.current).onValueChange)==null||Q.call(L,K);return}}T.emit()}},emit:()=>{i.current.forEach(I=>I())}}),[]),A=p.useMemo(()=>({value:(I,X,F)=>{var U;X!==((U=s.current.get(I))==null?void 0:U.value)&&(s.current.set(I,{value:X,keywords:F}),n.current.filtered.items.set(I,E(X,F)),P(2,()=>{M(),T.emit()}))},item:(I,X)=>(r.current.add(I),X&&(o.current.has(X)?o.current.get(X).add(I):o.current.set(X,new Set([I]))),P(3,()=>{k(),M(),n.current.value||D(),T.emit()}),()=>{s.current.delete(I),r.current.delete(I),n.current.filtered.items.delete(I);let F=W();P(4,()=>{k(),(F==null?void 0:F.getAttribute("id"))===I&&D(),T.emit()})}),group:I=>(o.current.has(I)||o.current.set(I,new Set),()=>{s.current.delete(I),o.current.delete(I)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:S,labelId:w,listInnerRef:R}),[]);function E(I,X){var F,U;let B=(U=(F=a.current)==null?void 0:F.filter)!=null?U:GA;return I?B(I,n.current.search,X):0}function M(){if(!n.current.search||a.current.shouldFilter===!1)return;let I=n.current.filtered.items,X=[];n.current.filtered.groups.forEach(U=>{let B=o.current.get(U),L=0;B.forEach(Q=>{let K=I.get(Q);L=Math.max(K,L)}),X.push([U,L])});let F=R.current;Z().sort((U,B)=>{var L,Q;let K=U.getAttribute("id"),z=B.getAttribute("id");return((L=I.get(z))!=null?L:0)-((Q=I.get(K))!=null?Q:0)}).forEach(U=>{let B=U.closest(Ui);B?B.appendChild(U.parentElement===B?U:U.closest(`${Ui} > *`)):F.appendChild(U.parentElement===F?U:U.closest(`${Ui} > *`))}),X.sort((U,B)=>B[1]-U[1]).forEach(U=>{var B;let L=(B=R.current)==null?void 0:B.querySelector(`${br}[${Un}="${encodeURIComponent(U[0])}"]`);L==null||L.parentElement.appendChild(L)})}function D(){let I=Z().find(F=>F.getAttribute("aria-disabled")!=="true"),X=I==null?void 0:I.getAttribute(Un);T.setState("value",X||void 0)}function k(){var I,X,F,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 Q=(X=(I=s.current.get(L))==null?void 0:I.value)!=null?X:"",K=(U=(F=s.current.get(L))==null?void 0:F.keywords)!=null?U:[],z=E(Q,K);n.current.filtered.items.set(L,z),z>0&&B++}for(let[L,Q]of o.current)for(let K of Q)if(n.current.filtered.items.get(K)>0){n.current.filtered.groups.add(L);break}n.current.filtered.count=B}function V(){var I,X,F;let U=W();U&&(((I=U.parentElement)==null?void 0:I.firstChild)===U&&((F=(X=U.closest(br))==null?void 0:X.querySelector(BA))==null||F.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function W(){var I;return(I=R.current)==null?void 0:I.querySelector(`${_g}[aria-selected="true"]`)}function Z(){var I;return Array.from(((I=R.current)==null?void 0:I.querySelectorAll(of))||[])}function G(I){let X=Z()[I];X&&T.setState("value",X.getAttribute(Un))}function _(I){var X;let F=W(),U=Z(),B=U.findIndex(Q=>Q===F),L=U[B+I];(X=a.current)!=null&&X.loop&&(L=B+I<0?U[U.length-1]:B+I===U.length?U[0]:U[B+I]),L&&T.setState("value",L.getAttribute(Un))}function O(I){let X=W(),F=X==null?void 0:X.closest(br),U;for(;F&&!U;)F=I>0?ZA(F,br):QA(F,br),U=F==null?void 0:F.querySelector(of);U?T.setState("value",U.getAttribute(Un)):_(I)}let N=()=>G(Z().length-1),j=I=>{I.preventDefault(),I.metaKey?N():I.altKey?O(1):_(1)},H=I=>{I.preventDefault(),I.metaKey?G(0):I.altKey?O(-1):_(-1)};return p.createElement(ee.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:I=>{var X;(X=x.onKeyDown)==null||X.call(x,I);let F=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||F))switch(I.key){case"n":case"j":{v&&I.ctrlKey&&j(I);break}case"ArrowDown":{j(I);break}case"p":case"k":{v&&I.ctrlKey&&H(I);break}case"ArrowUp":{H(I);break}case"Home":{I.preventDefault(),G(0);break}case"End":{I.preventDefault(),N();break}case"Enter":{I.preventDefault();let U=W();if(U){let B=new Event(La);U.dispatchEvent(B)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:tN},c),Fs(e,I=>p.createElement($g.Provider,{value:T},p.createElement(Og.Provider,{value:A},I))))}),UA=p.forwardRef((e,t)=>{var n,r;let o=ve(),s=p.useRef(null),i=p.useContext(Lg),a=eo(),c=Vg(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=Bg(o,s,[e.value,e.children,s],e.keywords),f=dl(),h=nn(P=>P.value&&P.value===d.current),m=nn(P=>u||a.filter()===!1?!0:P.search?P.filtered.items.get(o)>0:!0);p.useEffect(()=>{let P=s.current;if(!(!P||e.disabled))return P.addEventListener(La,y),()=>P.removeEventListener(La,y)},[m,e.onSelect,e.disabled]);function y(){var P,T;g(),(T=(P=c.current).onSelect)==null||T.call(P,d.current)}function g(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:b,forceMount:w,keywords:S,...R}=e;return p.createElement(ee.div,{ref:Ot(s,t),...R,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:g,onClick:v?void 0:y},e.children)}),WA=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=ve(),a=p.useRef(null),c=p.useRef(null),u=ve(),d=eo(),f=nn(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);An(()=>d.group(i),[]),Bg(i,a,[e.value,e.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(ee.div,{ref:Ot(a,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Fs(e,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(Lg.Provider,{value:h},m))))}),KA=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=p.useRef(null),s=nn(i=>!i.search);return!n&&!s?null:p.createElement(ee.div,{ref:Ot(o,t),...r,"cmdk-separator":"",role:"separator"})}),zA=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=dl(),i=nn(u=>u.search),a=nn(u=>u.selectedItemId),c=eo();return p.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),p.createElement(ee.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)}})}),HA=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=p.useRef(null),i=p.useRef(null),a=nn(u=>u.selectedItemId),c=eo();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(ee.div,{ref:Ot(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Fs(e,u=>p.createElement("div",{ref:Ot(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),YA=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return p.createElement(sl,{open:n,onOpenChange:r},p.createElement(il,{container:i},p.createElement(al,{"cmdk-overlay":"",className:o}),p.createElement(cl,{"aria-label":e.label,"cmdk-dialog":"",className:s},p.createElement(Fg,{ref:t,...a}))))}),XA=p.forwardRef((e,t)=>nn(n=>n.filtered.count===0)?p.createElement(ee.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),qA=p.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return p.createElement(ee.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Fs(e,i=>p.createElement("div",{"aria-hidden":!0},i)))}),Te=Object.assign(Fg,{List:HA,Item:UA,Input:zA,Group:WA,Separator:KA,Dialog:YA,Empty:XA,Loading:qA});function ZA(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function QA(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Vg(e){let t=p.useRef(e);return An(()=>{t.current=e}),t}var An=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Wn(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function nn(e){let t=dl(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function Bg(e,t,n,r=[]){let o=p.useRef(),s=eo();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(Un,a),o.current=a}),o}var JA=()=>{let[e,t]=p.useState(),n=Wn(()=>new Map);return An(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function eN(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Fs({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(eN(t),{ref:t.ref},n(t.props.children)):n(t)}var tN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function nN({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:m,sx:y,"aria-invalid":g,"aria-describedby":v,"aria-label":x}){const[b,w]=C.useState(!1),[S,R]=C.useState(n??[]),[P,T]=C.useState(""),A=C.useRef(null),E=t??S,M=C.useCallback(j=>{t===void 0&&R(j),r==null||r(j)},[t,r]),D=C.useCallback(j=>{E.includes(j)?M(E.filter(H=>H!==j)):(a==null||E.length<a)&&M([...E,j])},[E,M,a]),k=C.useCallback(j=>M(E.filter(H=>H!==j)),[E,M]),V=C.useMemo(()=>{const j=new Map;for(const H of e)j.set(H.value,H);return j},[e]),W=C.useMemo(()=>{const j=new Map;for(const H of e){const I=H.group??"";j.has(I)||j.set(I,[]),j.get(I).push(H)}return j},[e]),Z=j=>{j.key==="Backspace"&&P===""&&E.length>0&&(j.preventDefault(),k(E[E.length-1]))};C.useEffect(()=>{b&&queueMicrotask(()=>{var j;return(j=A.current)==null?void 0:j.focus()})},[b]);const{className:G,style:_,styleTag:O}=re(y,m,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),N=a!=null&&E.length>=a;return l.jsxs(Qc,{open:b,onOpenChange:j=>!d&&w(j),children:[l.jsx(Jc,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":b,"aria-haspopup":"listbox","aria-invalid":g,"aria-describedby":v,"aria-label":x,"data-state":b?"open":"closed","data-disabled":d||void 0,id:f,className:G,style:_,onClick:()=>!d&&w(j=>!j),tabIndex:d?-1:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" "||j.key==="ArrowDown")&&!b&&(j.preventDefault(),w(!0))},children:[O,E.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),E.map(j=>{const H=V.get(j);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(H==null?void 0:H.label)??j}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(H==null?void 0:H.label)??j}`,onClick:I=>{I.stopPropagation(),k(j)},children:l.jsx(Vt,{size:12,"aria-hidden":"true"})})]},j)}),l.jsx(Kr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(el,{children:l.jsx(tl,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:j=>j.preventDefault(),children:l.jsxs(Te,{shouldFilter:!0,label:"Options",children:[l.jsx(Te.Input,{ref:A,placeholder:s,value:P,onValueChange:T,onKeyDown:Z}),l.jsxs(Te.List,{children:[l.jsx(Te.Empty,{children:i}),Array.from(W.entries()).map(([j,H])=>l.jsx(Te.Group,{heading:j||void 0,children:H.map(I=>{const X=E.includes(I.value),F=I.disabled||!X&&N;return l.jsxs(Te.Item,{value:`${I.label} ${I.description??""} ${I.value}`,disabled:F,onSelect:()=>D(I.value),children:[I.icon&&l.jsx("span",{style:{display:"inline-flex"},children:I.icon}),l.jsx("span",{children:I.label}),I.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:I.description}),X&&l.jsx("span",{className:"cny-check",children:l.jsx(Jt,{size:14,"aria-hidden":"true"})})]},I.value)})},j||"default"))]})]})})})]})}var Vs="Checkbox",[rN]=Ie(Vs),[oN,fl]=rN(Vs);function sN(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,m]=Ee({prop:n,defaultProp:o??!1,onChange:c,caller:Vs}),[y,g]=p.useState(null),[v,x]=p.useState(null),b=p.useRef(!1),w=y?!!i||!!y.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:y,setControl:g,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Xt(o)?!1:o,isFormControl:w,bubbleInput:v,setBubbleInput:x};return l.jsx(oN,{scope:t,...S,children:iN(f)?f(S):r})}var Gg="CheckboxTrigger",Ug=p.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:m,bubbleInput:y}=fl(Gg,e),g=se(o,d),v=p.useRef(c);return p.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const b=()=>f(v.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[s,f]),l.jsx(ee.button,{type:"button",role:"checkbox","aria-checked":Xt(c)?"mixed":c,"aria-required":u,"data-state":Yg(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:g,onKeyDown:q(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:q(n,x=>{f(b=>Xt(b)?!0:!b),y&&m&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});Ug.displayName=Gg;var Fa=p.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(sN,{__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(Ug,{...f,ref:t,__scopeCheckbox:n}),h&&l.jsx(Hg,{__scopeCheckbox:n})]})})});Fa.displayName=Vs;var Wg="CheckboxIndicator",Kg=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=fl(Wg,n);return l.jsx(Be,{present:r||Xt(s.checked)||s.checked===!0,children:l.jsx(ee.span,{"data-state":Yg(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Kg.displayName=Wg;var zg="CheckboxBubbleInput",Hg=p.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:m}=fl(zg,e),y=se(n,m),g=Zr(s),v=Yr(r);p.useEffect(()=>{const b=h;if(!b)return;const w=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(w,"checked").set,P=!o.current;if(g!==s&&R){const T=new Event("click",{bubbles:P});b.indeterminate=Xt(s),R.call(b,Xt(s)?!1:s),b.dispatchEvent(T)}},[h,g,s,o]);const x=p.useRef(Xt(s)?!1:s);return l.jsx(ee.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:y,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Hg.displayName=zg;function iN(e){return typeof e=="function"}function Xt(e){return e==="indeterminate"}function Yg(e){return Xt(e)?"indeterminate":e?"checked":"unchecked"}const Va=C.forwardRef(function({className:t,style:n,sx:r,children:o,...s},i){const a=l.jsx(Kg,{children:s.checked==="indeterminate"?l.jsx(AP,{size:12,"aria-hidden":"true"}):l.jsx(Jt,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:m}=re(r,n,"checkbox",t);return l.jsxs(Fa,{ref:i,className:f,style:h,...s,children:[m,a]})}const{className:c,style:u,styleTag:d}=re(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(Fa,{ref:i,className:Y("checkbox",t),...s,children:a}),l.jsx("span",{children:o})]})});var hl="Radio",[aN,Xg]=Ie(hl),[cN,lN]=aN(hl),qg=p.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]=p.useState(null),m=se(t,v=>h(v)),y=p.useRef(!1),g=f?u||!!f.closest("form"):!0;return l.jsxs(cN,{scope:n,checked:o,disabled:i,children:[l.jsx(ee.button,{type:"button",role:"radio","aria-checked":o,"data-state":ey(o),"data-disabled":i?"":void 0,disabled:i,value:a,...d,ref:m,onClick:q(e.onClick,v=>{o||c==null||c(),g&&(y.current=v.isPropagationStopped(),y.current||v.stopPropagation())})}),g&&l.jsx(Jg,{control:f,bubbles:!y.current,name:r,value:a,checked:o,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});qg.displayName=hl;var Zg="RadioIndicator",Qg=p.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=lN(Zg,n);return l.jsx(Be,{present:r||s.checked,children:l.jsx(ee.span,{"data-state":ey(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Qg.displayName=Zg;var uN="RadioBubbleInput",Jg=p.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=p.useRef(null),a=se(i,s),c=Zr(n),u=Yr(t);return p.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(y)}},[c,n,r]),l.jsx(ee.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}})});Jg.displayName=uN;function ey(e){return e?"checked":"unchecked"}var dN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Bs="RadioGroup",[fN]=Ie(Bs,[sn,Xg]),ty=sn(),ny=Xg(),[hN,pN]=fN(Bs),ry=p.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,m=ty(n),y=on(u),[g,v]=Ee({prop:s,defaultProp:o??null,onChange:f,caller:Bs});return l.jsx(hN,{scope:n,name:r,required:i,disabled:a,value:g,onValueChange:v,children:l.jsx(Ss,{asChild:!0,...m,orientation:c,dir:y,loop:d,children:l.jsx(ee.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:y,...h,ref:t})})})});ry.displayName=Bs;var oy="RadioGroupItem",sy=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=pN(oy,n),i=s.disabled||r,a=ty(n),c=ny(n),u=p.useRef(null),d=se(t,u),f=s.value===o.value,h=p.useRef(!1);return p.useEffect(()=>{const m=g=>{dN.includes(g.key)&&(h.current=!0)},y=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",y)}},[]),l.jsx(Rs,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(qg,{disabled:i,required:s.required,checked:f,...c,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:q(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:q(o.onFocus,()=>{var m;h.current&&((m=u.current)==null||m.click())})})})});sy.displayName=oy;var mN="RadioGroupIndicator",iy=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=ny(n);return l.jsx(Qg,{...o,...r,ref:t})});iy.displayName=mN;var gN=ry,sf=sy,af=iy;const yN=C.forwardRef(function({orientation:t="vertical",className:n,style:r,...o},s){return l.jsx(gN,{ref:s,className:Y("cny-radio-group",t==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),vN=C.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(sf,{ref:i,className:d,style:f,...s,children:[h,l.jsx(af,{})]})}const{className:a,style:c,styleTag:u}=re(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(sf,{ref:i,className:Y("radio",t),...s,children:l.jsx(af,{})}),l.jsx("span",{children:o})]})});var Gs="Switch",[xN]=Ie(Gs),[bN,wN]=xN(Gs),ay=p.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,m]=p.useState(null),y=se(t,w=>m(w)),g=p.useRef(!1),v=h?d||!!h.closest("form"):!0,[x,b]=Ee({prop:o,defaultProp:s??!1,onChange:u,caller:Gs});return l.jsxs(bN,{scope:n,checked:x,disabled:a,children:[l.jsx(ee.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":dy(x),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:y,onClick:q(e.onClick,w=>{b(S=>!S),v&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),v&&l.jsx(uy,{control:h,bubbles:!g.current,name:r,value:c,checked:x,required:i,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});ay.displayName=Gs;var cy="SwitchThumb",ly=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=wN(cy,n);return l.jsx(ee.span,{"data-state":dy(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ly.displayName=cy;var CN="SwitchBubbleInput",uy=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=p.useRef(null),a=se(i,s),c=Zr(n),u=Yr(t);return p.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(y)}},[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}})});uy.displayName=CN;function dy(e){return e?"checked":"unchecked"}var cf=ay,lf=ly;const SN=C.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(cf,{ref:i,className:d,style:f,...s,children:[h,l.jsx(lf,{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(cf,{ref:i,className:Y("switch",t),...s,children:l.jsx(lf,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function Ho(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function uf(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function To(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Wi(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function RN(e,t){return e.getFullYear()===t.getFullYear()}function Tt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function PN(e){return new Date(e.getFullYear(),0,1)}function df(e){return new Date(Math.floor(e.getFullYear()/10)*10,0,1)}function Eo(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function fs(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function St(e,t){const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n}function Ki(e,t,n,r=0){const o=new Date(e);return o.setHours(t,n,r,0),o}function Ue(e,t,n){return t&&e.getTime()<t.getTime()?new Date(t):n&&e.getTime()>n.getTime()?new Date(n):e}function TN(e,t){const n=Tt(e),r=(n.getDay()-t+7)%7,o=fs(n,-r);return Array.from({length:42},(s,i)=>fs(o,i))}function EN(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=fs(r,(s+t)%7);return n.format(i)})}function MN(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 ff(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function AN(e,t){return new Intl.DateTimeFormat(t,{year:"numeric"}).format(e)}function NN(e,t){return new Intl.DateTimeFormat(t,{month:"long",year:"numeric"}).format(e)}function fy(e,t){return new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"numeric"}).format(e)}function hy(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 jN(e,t,n,r){return`${fy(e,t)} · ${hy(e,t,n,r)}`}function Mo(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 Ao(e,t){return e.getTime()<t.getTime()}function No(e,t){return e.getTime()>t.getTime()}function jo(e){return e<10?`0${e}`:String(e)}function IN(e){return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function DN(e){try{return new Intl.DateTimeFormat(e,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function kN(e,t,n,r,o){switch(t){case"year":return AN(e,n);case"month":return NN(e,n);case"time":return hy(e,n,r,o);case"datetime":return jN(e,n,r,o);case"date":default:return fy(e,n)}}function _N(e,t){switch(t){case"year":return PN(e);case"month":return Tt(e);case"date":return Ho(e);default:return new Date(e)}}const ON=C.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:m=!1,clearable:y=!0,locale:g,weekStartsOn:v=0,hour12:x,showSeconds:b=!1,minuteStep:w=1,secondStep:S=1,format:R,icon:P,required:T=!1,validate:A,error:E,onValidate:M,id:D,className:k,style:V,sx:W,"aria-invalid":Z,"aria-describedby":G,dialogLabel:_,name:O,open:N,onOpenChange:j,...H},I){const X=IN(g),F=x??DN(X),U=C.useId(),B=D??`cny-dp-${U}`,L=`${B}-dialog`,Q=`${B}-hint`,K=C.useMemo(()=>{const $=Mo(s),J=a==="future"||a==="current"?Ho(new Date):null;return $&&J?$.getTime()>J.getTime()?$:J:$??J},[s,a]),z=C.useMemo(()=>{const $=Mo(i),J=a==="past"||a==="current"?uf(new Date):null;return $&&J?$.getTime()<J.getTime()?$:J:$??J},[i,a]),ie=n!==void 0,[ae,xe]=C.useState(()=>Mo(r)),oe=ie?Mo(n):ae,rt=N!==void 0,[ct,Ct]=C.useState(!1),Se=rt?N:ct,Le=C.useCallback($=>{rt||Ct($),j==null||j($)},[rt,j]),ao=C.useMemo(()=>oe??Ue(new Date,K,z),[oe,K,z]),[he,be]=C.useState(()=>Tt(ao)),[ye,Me]=C.useState(()=>ao),si=t==="month"?"month":t==="year"?"year":"date",[Xe,pn]=C.useState(si),ii=C.useRef(null);C.useImperativeHandle(I,()=>ii.current,[]);const yr=C.useRef(null),ai=C.useRef(null),ql=C.useRef(null),ci=C.useRef(null),[Tb,Eb]=C.useState({}),[Mb,Ab]=C.useState(!1);C.useEffect(()=>Ab(!0),[]);const On=C.useCallback($=>K&&Ao($,K)||z&&No($,z)?!0:c?c($):!1,[K,z,c]),co=C.useCallback($=>u?u($):!1,[u]),$n=C.useMemo(()=>{if(E)return typeof E=="string"?E:"Invalid";if(T&&!oe)return"Required";if(oe){const J=Ho(new Date);if(a==="future"&&Ao(oe,J))return"Must be today or later";if(a==="past"&&No(oe,uf(new Date)))return"Must be today or earlier";if(a==="current"&&!To(oe,J))return"Must be today";if(K&&Ao(oe,K))return"Too early";if(z&&No(oe,z))return"Too late";if(c&&c(oe))return"Unavailable date";if(u&&u(oe))return"Unavailable time"}const $=A==null?void 0:A(oe);return $||null},[E,T,oe,a,K,z,c,u,A]),Zl=C.useRef(null);C.useEffect(()=>{Zl.current!==$n&&(Zl.current=$n,M==null||M($n))},[$n,M]);const lo=$n!==null,Ql=lo?"danger":h,Nb=oe?R?R(oe,t):kN(oe,t,X,F,b):"",jb=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[t],Ib=_??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[t],Gt=C.useCallback($=>{ie||xe($),o==null||o($)},[ie,o]),uo=C.useCallback(()=>{var $;Le(!1),($=yr.current)==null||$.focus()},[Le]),Db=C.useCallback($=>{var J;$.stopPropagation(),Gt(null),(J=yr.current)==null||J.focus()},[Gt]),Jl=C.useCallback(()=>{if(m)return;const $=oe??Ue(new Date,K,z);be(Tt($)),Me($),pn(si),Le(!0)},[m,oe,K,z,Le,si]);C.useEffect(()=>{if(!Se)return;const $=J=>{var de,te;const ce=J.target;(de=ii.current)!=null&&de.contains(ce)||(te=ai.current)!=null&&te.contains(ce)||Le(!1)};return document.addEventListener("pointerdown",$,!0),()=>document.removeEventListener("pointerdown",$,!0)},[Se,Le]);const fo=C.useCallback(()=>{const $=yr.current,J=ai.current;if(!$||!J)return;const ce=$.getBoundingClientRect(),de=J.offsetHeight||340,te=J.offsetWidth||264,qe=window.innerHeight,Fe=window.innerWidth,Ze=4,Re=8,Ut=qe-ce.bottom,ui=ce.top,rw=Ut<de+Ze&&ui>Ut?Math.max(Re,ce.top-Ze-de):Math.min(qe-de-Re,ce.bottom+Ze),ow=Math.max(Re,Math.min(ce.left,Fe-te-Re));Eb({position:"fixed",top:rw,left:ow,width:te})},[]);C.useLayoutEffect(()=>{Se&&fo()},[Se,t,fo]),C.useEffect(()=>{if(!Se)return;const $=()=>fo();return window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[Se,fo]),C.useEffect(()=>{var $,J;Se&&(Xe==="date"&&(t==="date"||t==="datetime")?($=ql.current)==null||$.focus():(Xe==="month"||Xe==="year")&&((J=ci.current)==null||J.focus()))},[Se,ye,t,Xe]);const eu=C.useCallback(()=>{var $;Xe==="year"&&t!=="year"?pn("month"):Xe==="month"&&t!=="month"?pn("date"):(Le(!1),($=yr.current)==null||$.focus())},[Xe,t,Le]),ho=C.useCallback($=>{const J=Ue($,K,z);Me(J),be(ce=>Wi(ce,J)?ce:Tt(J))},[K,z]),vr=C.useCallback(($,J)=>{const ce=_N($,t);if(t!=="time"&&On(ce))return;const de=t==="time"||t==="datetime"?Ki(ce,(oe??$).getHours(),(oe??$).getMinutes(),b?(oe??$).getSeconds():0):ce;Gt(de),Me(de),((J==null?void 0:J.close)??(t!=="datetime"&&t!=="time"))&&uo()},[t,On,Gt,oe,b,uo]),po=C.useCallback(($,J)=>{const ce=oe??Ue(new Date,K,z),de=$==="hour"?J:ce.getHours(),te=$==="minute"?J:ce.getMinutes(),qe=$==="second"?J:b?ce.getSeconds():0,Fe=Ki(ce,de,te,qe);co(Fe)||(Gt(Fe),Me(Fe))},[oe,K,z,b,co,Gt]),Ln=C.useCallback($=>ho(fs(ye,$)),[ho,ye]),kb=$=>{switch($.key){case"ArrowLeft":$.preventDefault(),Ln(-1);break;case"ArrowRight":$.preventDefault(),Ln(1);break;case"ArrowUp":$.preventDefault(),Ln(-7);break;case"ArrowDown":$.preventDefault(),Ln(7);break;case"Home":{$.preventDefault();const J=(ye.getDay()-v+7)%7;Ln(-J);break}case"End":{$.preventDefault();const J=(ye.getDay()-v+7)%7;Ln(6-J);break}case"PageUp":$.preventDefault(),ho($.shiftKey?St(ye,-1):Eo(ye,-1));break;case"PageDown":$.preventDefault(),ho($.shiftKey?St(ye,1):Eo(ye,1));break;case"Enter":case" ":$.preventDefault(),vr(ye);break;case"Escape":$.preventDefault(),eu();break}},_b=C.useMemo(()=>TN(he,v),[he,v]),Ob=C.useMemo(()=>EN(X,v),[X,v]),$b=C.useMemo(()=>MN(X,"short"),[X]),li=C.useMemo(()=>Ho(new Date),[]),Lb=!K||!Ao(Tt(he),Tt(K)),Fb=!z||!No(Tt(he),Tt(z)),Vb=!K||he.getFullYear()-1>=K.getFullYear(),Bb=!z||he.getFullYear()+1<=z.getFullYear(),mn=df(he).getFullYear(),Gb=!K||mn-10+9>=K.getFullYear(),Ub=!z||mn+10<=z.getFullYear(),Wb=t==="time"?!co(new Date):!On(li),Kb=()=>{if(t==="time"){const $=new Date;if(co($))return;const ce=Ki(oe??$,$.getHours(),$.getMinutes(),b?$.getSeconds():0);Gt(ce),Me(ce);return}vr(li,{close:t!=="datetime"})},zb=Y("cny-datepicker-trigger","input",Ql!=="primary"&&Ql,f==="sm"||f==="lg"?f:null,oe&&"has-value",Se&&"is-open"),Hb=P??(t==="time"?l.jsx(dP,{size:15}):l.jsx(eP,{size:15})),tu=($,J)=>{let de=!0;switch($.key){case"ArrowLeft":Me(J==="month"?te=>Ue(new Date(he.getFullYear(),(te.getMonth()+11)%12,Math.min(te.getDate(),28)),K,z):te=>Ue(new Date(te.getFullYear()-1,te.getMonth(),Math.min(te.getDate(),28)),K,z));break;case"ArrowRight":Me(J==="month"?te=>Ue(new Date(he.getFullYear(),(te.getMonth()+1)%12,Math.min(te.getDate(),28)),K,z):te=>Ue(new Date(te.getFullYear()+1,te.getMonth(),Math.min(te.getDate(),28)),K,z));break;case"ArrowUp":Me(J==="month"?te=>Ue(new Date(he.getFullYear(),(te.getMonth()-3+12)%12,Math.min(te.getDate(),28)),K,z):te=>Ue(new Date(te.getFullYear()-3,te.getMonth(),Math.min(te.getDate(),28)),K,z));break;case"ArrowDown":Me(J==="month"?te=>Ue(new Date(he.getFullYear(),(te.getMonth()+3)%12,Math.min(te.getDate(),28)),K,z):te=>Ue(new Date(te.getFullYear()+3,te.getMonth(),Math.min(te.getDate(),28)),K,z));break;case"PageUp":be(J==="month"?te=>St(te,$.shiftKey?-10:-1):te=>St(te,$.shiftKey?-100:-10));break;case"PageDown":be(J==="month"?te=>St(te,$.shiftKey?10:1):te=>St(te,$.shiftKey?100:10));break;case"Enter":case" ":J==="month"?nu(new Date(he.getFullYear(),ye.getMonth(),1)):ru(ye.getFullYear());break;case"Escape":eu();break;default:de=!1}de&&$.preventDefault()};C.useEffect(()=>{if(Se&&Xe==="year"){const $=df(he).getFullYear(),J=ye.getFullYear();(J<$-1||J>$+10)&&be(new Date(J,0,1))}},[Se,Xe,ye,he]);const nu=$=>{t==="month"?vr($):(be(Tt($)),Me(Ue($,K,z)),pn("date"))},ru=$=>{if(t==="year")vr(new Date($,0,1));else{const J=new Date($,he.getMonth(),1);be(J),Me(Ue(new Date($,ye.getMonth(),Math.min(ye.getDate(),28)),K,z)),pn("month")}},Yb=()=>{const $=ye.getMonth();return $b.map((J,ce)=>{const de=new Date(he.getFullYear(),ce,1),te=!!oe&&Wi(de,oe)&&RN(de,oe),qe=de.getMonth()===he.getMonth()&&t!=="month",Fe=ce===$,Ze=On(de);return l.jsx("button",{ref:Fe?ci:void 0,type:"button",tabIndex:Fe?0:-1,className:Y("cny-datepicker-chip",te&&"is-selected",qe&&!te&&"is-current"),disabled:Ze,onClick:()=>nu(de),onFocus:()=>Me(new Date(he.getFullYear(),ce,Math.min(ye.getDate(),28))),children:J},ce)})},Xb=()=>{const $=mn-1,J=ye.getFullYear();return Array.from({length:12},(ce,de)=>{const te=$+de,qe=new Date(te,0,1),Fe=!!oe&&oe.getFullYear()===te,Ze=te===he.getFullYear()&&t!=="year",Re=te===J,Ut=On(qe),ui=te<mn||te>=mn+10;return l.jsx("button",{ref:Re?ci:void 0,type:"button",tabIndex:Re?0:-1,className:Y("cny-datepicker-chip",Fe&&"is-selected",Ze&&!Fe&&"is-current",ui&&"is-outside"),disabled:Ut,onClick:()=>ru(te),onFocus:()=>Me(new Date(te,ye.getMonth(),Math.min(ye.getDate(),28))),children:te},te)})},qb=C.useRef(null),ou=C.useRef(null),su=C.useRef(null),iu=()=>{const $=oe??Ue(new Date,K,z),J=$.getHours(),ce=$.getMinutes(),de=$.getSeconds(),te=J>=12,qe=F?J%12===0?12:J%12:J,Fe=Re=>{const Ut=F?te?Re===12?12:Re+12:Re===12?0:Re:Re;po("hour",Ut)},Ze=Re=>{const Ut=Re?J<12?J+12:J:J>=12?J-12:J;po("hour",Ut)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(zi,{ref:qb,ariaLabel:"Hour",value:qe,min:F?1:0,max:F?12:23,step:1,nextRef:ou,onChange:Fe}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(zi,{ref:ou,ariaLabel:"Minute",value:ce-ce%Math.max(1,w),min:0,max:59,step:Math.max(1,w),nextRef:b?su:void 0,onChange:Re=>po("minute",Re)}),b&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(zi,{ref:su,ariaLabel:"Second",value:de-de%Math.max(1,S),min:0,max:59,step:Math.max(1,S),onChange:Re=>po("second",Re)})]}),F&&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:()=>Ze(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":te,className:Y("cny-dp-ampm-btn",te&&"is-active"),onClick:()=>Ze(!0),children:"PM"})]})]})})},Zb=()=>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:!Lb,onClick:()=>be($=>Eo($,-1)),children:l.jsx(Uo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${ff(he,X)})`,onClick:()=>pn("month"),children:ff(he,X)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Fb,onClick:()=>be($=>Eo($,1)),children:l.jsx(Yt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:kb,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:Ob.map(($,J)=>l.jsx("span",{role:"columnheader","aria-label":$,className:"cny-datepicker-weekday",children:$.slice(0,2)},J))}),Array.from({length:6},($,J)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:_b.slice(J*7,J*7+7).map(ce=>{const de=!Wi(ce,he),te=To(ce,oe),qe=To(ce,li),Fe=To(ce,ye),Ze=On(ce);return l.jsx("button",{ref:Fe?ql:void 0,type:"button",role:"gridcell",tabIndex:Fe?0:-1,"aria-selected":te,"aria-current":qe?"date":void 0,"aria-disabled":Ze||void 0,disabled:Ze,className:Y("cny-datepicker-cell",de&&"is-outside",te&&"is-selected",qe&&"is-today"),onClick:()=>vr(ce),onFocus:()=>Me(ce),children:ce.getDate()},ce.toISOString())})},J))]})]}),Qb=()=>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:!Vb,onClick:()=>be($=>St($,-1)),children:l.jsx(Uo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${he.getFullYear()})`,onClick:()=>pn("year"),children:he.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!Bb,onClick:()=>be($=>St($,1)),children:l.jsx(Yt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:$=>tu($,"month"),children:Yb()})]}),Jb=()=>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:!Gb,onClick:()=>be($=>St($,-10)),children:l.jsx(Uo,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${mn} – ${mn+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Ub,onClick:()=>be($=>St($,10)),children:l.jsx(Yt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:$=>tu($,"year"),children:Xb()})]}),{className:ew,style:tw,styleTag:nw}=re(W,V,"cny-datepicker",`mode-${t}`,m&&"is-disabled",k);return l.jsxs("div",{ref:ii,className:ew,style:tw,...H,children:[nw,O&&l.jsx("input",{type:"hidden",name:O,value:oe?oe.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:yr,type:"button",id:B,className:zb,"aria-haspopup":"dialog","aria-expanded":Se,"aria-controls":Se?L:void 0,"aria-invalid":Z||lo,"aria-describedby":Y(G,lo?Q:void 0)||void 0,"aria-required":T||void 0,disabled:m,onClick:Jl,onKeyDown:$=>{$.key==="ArrowDown"||$.key==="Enter"||$.key===" "?($.preventDefault(),Jl()):$.key==="Escape"&&Se&&($.preventDefault(),Le(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Hb}),l.jsx("span",{className:Y("cny-datepicker-value",!oe&&"is-placeholder"),children:Nb||jb}),y&&oe&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:Db,onPointerDown:$=>$.stopPropagation(),children:l.jsx(Vt,{size:13,"aria-hidden":"true"})})]}),lo&&E!==!1&&l.jsx("span",{id:Q,className:"cny-datepicker-error",role:"alert",children:typeof E=="string"?E:E??$n}),Se&&Mb&&ys.createPortal(l.jsxs("div",{ref:ai,id:L,role:"dialog","aria-modal":"false","aria-label":Ib,className:Y("cny-datepicker-panel",`is-${t}`),style:Tb,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(t==="date"||t==="datetime")&&Xe==="date"&&Zb(),(t==="date"||t==="datetime"||t==="month")&&Xe==="month"&&Qb(),(t==="date"||t==="datetime"||t==="month"||t==="year")&&Xe==="year"&&Jb(),t==="time"&&iu(),t==="datetime"&&Xe==="date"&&iu()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!Wb,onClick:Kb,children:t==="time"?"Now":t==="year"?"This year":t==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),y&&oe&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{Gt(null),uo()},children:"Clear"}),(t==="datetime"||t==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:uo,children:"Done"})]})]}),document.body)]})}),zi=C.forwardRef(function({value:t,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=C.useRef(null);C.useImperativeHandle(c,()=>u.current,[]);const[d,f]=C.useState(()=>jo(t)),h=C.useRef(!1);C.useEffect(()=>{h.current||f(jo(t))},[t]);const m=C.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(jo(b))},[n,r,o,a]),y=()=>{const x=t+o;m(x>r?n:x)},g=()=>{const x=t-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),y();break;case"ArrowDown":x.preventDefault(),g();break;case"PageUp":x.preventDefault(),m(t+o*5);break;case"PageDown":x.preventDefault(),m(t-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?y():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 w;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&&(m(S),(w=i==null?void 0:i.current)==null||w.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f(jo(t))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(Dp,{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(Kr,{size:10,"aria-hidden":"true"})})]})]})});function $N({hotkey:e=!0}={}){const[t,n]=C.useState(!1);return C.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 LN({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(Te.Dialog,{open:e,onOpenChange:t,label:o,contentClassName:Y("cny-cmdk-content",u),children:[l.jsxs(Xc,{children:[l.jsx(ll,{children:o}),l.jsx(ul,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Vp,{size:16,"aria-hidden":"true"}),l.jsx(Te.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(Te.List,{className:"cny-cmdk-list",children:[l.jsx(Te.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(Te.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(Te.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function FN({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(Vp,{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 VN=0;const BN=()=>`cny-toast-${Date.now().toString(36)}-${++VN}`,py=C.createContext(null),GN={default:null,success:l.jsx(Op,{size:16,"aria-hidden":"true"}),info:l.jsx(Lp,{size:16,"aria-hidden":"true"}),warning:l.jsx(Bp,{size:16,"aria-hidden":"true"}),danger:l.jsx(_p,{size:16,"aria-hidden":"true"}),loading:l.jsx(Fp,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function UN({children:e,position:t="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=C.useState([]),[a,c]=C.useState(!1);C.useEffect(()=>c(!0),[]);const u=C.useCallback(g=>{i(v=>v.map(x=>g==null||x.id===g?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>g==null?!1:x.id!==g||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(g==null||x.id===g)).forEach(x=>{var b;return(b=x.onDismiss)==null?void 0:b.call(x)}),v.filter(x=>!x.exiting||g!=null&&x.id!==g)))},200)},[]),d=C.useCallback(g=>{const v=g.id??BN(),x={id:v,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(R=>R.id!==v),x];return S.length>r?S.slice(S.length-r):S}),v},[n,r]),f=C.useCallback((g,v)=>{i(x=>x.map(b=>b.id===g?{...b,...v,variant:v.variant??b.variant,duration:v.duration??b.duration,dismissible:v.dismissible??b.dismissible}:b))},[]),h=C.useMemo(()=>{const g=(v=>d(typeof v=="string"?{title:v}:v));return g.success=(v,x)=>d({...x,title:v,variant:"success"}),g.info=(v,x)=>d({...x,title:v,variant:"info"}),g.warning=(v,x)=>d({...x,title:v,variant:"warning"}),g.error=(v,x)=>d({...x,title:v,variant:"danger"}),g.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),g},[d]),m=C.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),y=t.startsWith("top-");return l.jsxs(py.Provider,{value:m,children:[e,a&&ys.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:(y?[...s].reverse():s).map(g=>l.jsx(WN,{toast:g,onDismiss:()=>u(g.id)},g.id))}),document.body)]})}function WN({toast:e,onDismiss:t}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=e,[d,f]=C.useState(!1),h=C.useRef(null);C.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 m=n==="danger"||n==="warning"?"alert":"status",y=i!==!1,g=i!==void 0&&i!==!1?i:GN[n],{className:v,style:x,styleTag:b}=re(u,void 0,"cny-toast",n,e.exiting&&"is-exiting");return l.jsxs("li",{role:m,"aria-atomic":"true",className:v,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[b,y&&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(Vt,{size:14,"aria-hidden":"true"})})]})}function KN(){const e=C.useContext(py);if(!e)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return e}const my=C.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:m,styleTag:y}=re(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(sl,{...d,children:l.jsxs(il,{children:[l.jsx(al,{className:"cny-dialog-overlay"}),l.jsxs(cl,{ref:f,className:h,style:m,children:[y,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(ll,{className:"cny-dialog-title",children:t}),n&&l.jsx(ul,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Ls,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Vt,{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})]})]})})}),zN=kg,HN=Ls;function gy({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:m}){const y=()=>{d==null||d(),t(!1)};return l.jsx(my,{open:e,onOpenChange:t,size:"sm",title:n,className:Y("cny-confirm",f),style:h,sx:m,footer:l.jsxs(l.Fragment,{children:[l.jsx(Ir,{variant:"ghost",color:"primary",onClick:y,disabled:c,children:i}),l.jsx(Ir,{variant:"solid",color:a?"danger":"primary",loading:c,onClick:u,children:s})]}),children:o??l.jsx("p",{className:"cny-confirm-message",children:r})})}function YN(){const[e,t]=C.useState(null),n=C.useCallback(i=>new Promise(a=>{t({...i,resolve:a})}),[]),r=C.useCallback(i=>{i||t(a=>(a==null||a.resolve(!1),null))},[]),o=C.useCallback(()=>{t(i=>(i==null||i.resolve(!0),null))},[]),s=e?l.jsx(gy,{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 XN=C.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:m,style:y,styleTag:g}=re(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(sl,{...f,children:l.jsxs(il,{children:[l.jsx(al,{className:"cny-drawer-overlay"}),l.jsxs(cl,{ref:h,className:m,style:y,children:[g,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(ll,{className:"cny-drawer-title",children:t}),n&&l.jsx(ul,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Ls,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Vt,{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})]})]})})}),qN=kg,ZN=Ls;var Ba=["Enter"," "],QN=["ArrowDown","PageUp","Home"],yy=["ArrowUp","PageDown","End"],JN=[...QN,...yy],ej={ltr:[...Ba,"ArrowRight"],rtl:[...Ba,"ArrowLeft"]},tj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},to="Menu",[kr,nj,rj]=Ur(to),[In,vy]=Ie(to,[rj,cn,sn]),no=cn(),xy=sn(),[by,fn]=In(to),[oj,ro]=In(to),wy=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=no(t),[c,u]=p.useState(null),d=p.useRef(!1),f=mt(s),h=on(o);return p.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),l.jsx(Xr,{...a,children:l.jsx(by,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(oj,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};wy.displayName=to;var sj="MenuAnchor",pl=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=no(n);return l.jsx(qr,{...o,...r,ref:t})});pl.displayName=sj;var ml="MenuPortal",[ij,Cy]=In(ml,{forceMount:void 0}),Sy=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=fn(ml,t);return l.jsx(ij,{scope:t,forceMount:n,children:l.jsx(Be,{present:n||s.open,children:l.jsx(fr,{asChild:!0,container:o,children:r})})})};Sy.displayName=ml;var at="MenuContent",[aj,gl]=In(at),Ry=p.forwardRef((e,t)=>{const n=Cy(at,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(at,e.__scopeMenu),i=ro(at,e.__scopeMenu);return l.jsx(kr.Provider,{scope:e.__scopeMenu,children:l.jsx(Be,{present:r||s.open,children:l.jsx(kr.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(cj,{...o,ref:t}):l.jsx(lj,{...o,ref:t})})})})}),cj=p.forwardRef((e,t)=>{const n=fn(at,e.__scopeMenu),r=p.useRef(null),o=se(t,r);return p.useEffect(()=>{const s=r.current;if(s)return Qr(s)},[]),l.jsx(yl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lj=p.forwardRef((e,t)=>{const n=fn(at,e.__scopeMenu);return l.jsx(yl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),uj=Rn("MenuContent.ScrollLock"),yl=p.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:m,disableOutsideScroll:y,...g}=e,v=fn(at,n),x=ro(at,n),b=no(n),w=xy(n),S=nj(n),[R,P]=p.useState(null),T=p.useRef(null),A=se(t,T,v.onContentChange),E=p.useRef(0),M=p.useRef(""),D=p.useRef(0),k=p.useRef(null),V=p.useRef("right"),W=p.useRef(0),Z=y?hr:p.Fragment,G=y?{as:uj,allowPinchZoom:!0}:void 0,_=N=>{var L,Q;const j=M.current+N,H=S().filter(K=>!K.disabled),I=document.activeElement,X=(L=H.find(K=>K.ref.current===I))==null?void 0:L.textValue,F=H.map(K=>K.textValue),U=Cj(F,j,X),B=(Q=H.find(K=>K.textValue===U))==null?void 0:Q.ref.current;(function K(z){M.current=z,window.clearTimeout(E.current),z!==""&&(E.current=window.setTimeout(()=>K(""),1e3))})(j),B&&setTimeout(()=>B.focus())};p.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ps();const O=p.useCallback(N=>{var H,I;return V.current===((H=k.current)==null?void 0:H.side)&&Rj(N,(I=k.current)==null?void 0:I.area)},[]);return l.jsx(aj,{scope:n,searchRef:M,onItemEnter:p.useCallback(N=>{O(N)&&N.preventDefault()},[O]),onItemLeave:p.useCallback(N=>{var j;O(N)||((j=T.current)==null||j.focus(),P(null))},[O]),onTriggerLeave:p.useCallback(N=>{O(N)&&N.preventDefault()},[O]),pointerGraceTimerRef:D,onPointerGraceIntentChange:p.useCallback(N=>{k.current=N},[]),children:l.jsx(Z,{...G,children:l.jsx(zr,{asChild:!0,trapped:o,onMountAutoFocus:q(s,N=>{var j;N.preventDefault(),(j=T.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(lr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:l.jsx(Ss,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:P,onEntryFocus:q(c,N=>{x.isUsingKeyboardRef.current||N.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Ns,{role:"menu","aria-orientation":"vertical","data-state":By(v.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:A,style:{outline:"none",...g.style},onKeyDown:q(g.onKeyDown,N=>{const H=N.target.closest("[data-radix-menu-content]")===N.currentTarget,I=N.ctrlKey||N.altKey||N.metaKey,X=N.key.length===1;H&&(N.key==="Tab"&&N.preventDefault(),!I&&X&&_(N.key));const F=T.current;if(N.target!==F||!JN.includes(N.key))return;N.preventDefault();const B=S().filter(L=>!L.disabled).map(L=>L.ref.current);yy.includes(N.key)&&B.reverse(),bj(B)}),onBlur:q(e.onBlur,N=>{N.currentTarget.contains(N.target)||(window.clearTimeout(E.current),M.current="")}),onPointerMove:q(e.onPointerMove,_r(N=>{const j=N.target,H=W.current!==N.clientX;if(N.currentTarget.contains(j)&&H){const I=N.clientX>W.current?"right":"left";V.current=I,W.current=N.clientX}}))})})})})})})});Ry.displayName=at;var dj="MenuGroup",vl=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(ee.div,{role:"group",...r,ref:t})});vl.displayName=dj;var fj="MenuLabel",Py=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(ee.div,{...r,ref:t})});Py.displayName=fj;var hs="MenuItem",hf="menu.itemSelect",Us=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=p.useRef(null),i=ro(hs,e.__scopeMenu),a=gl(hs,e.__scopeMenu),c=se(t,s),u=p.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(hf,{bubbles:!0,cancelable:!0});f.addEventListener(hf,m=>r==null?void 0:r(m),{once:!0}),vp(f,h),h.defaultPrevented?u.current=!1:i.onClose()}};return l.jsx(Ty,{...o,ref:c,disabled:n,onClick:q(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:q(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:q(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||Ba.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Us.displayName=hs;var Ty=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=gl(hs,n),a=xy(n),c=p.useRef(null),u=se(t,c),[d,f]=p.useState(!1),[h,m]=p.useState("");return p.useEffect(()=>{const y=c.current;y&&m((y.textContent??"").trim())},[s.children]),l.jsx(kr.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:l.jsx(Rs,{asChild:!0,...a,focusable:!r,children:l.jsx(ee.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:q(e.onPointerMove,_r(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,_r(y=>i.onItemLeave(y))),onFocus:q(e.onFocus,()=>f(!0)),onBlur:q(e.onBlur,()=>f(!1))})})})}),hj="MenuCheckboxItem",Ey=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return l.jsx(Iy,{scope:e.__scopeMenu,checked:n,children:l.jsx(Us,{role:"menuitemcheckbox","aria-checked":ps(n)?"mixed":n,...o,ref:t,"data-state":wl(n),onSelect:q(o.onSelect,()=>r==null?void 0:r(ps(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ey.displayName=hj;var My="MenuRadioGroup",[pj,mj]=In(My,{value:void 0,onValueChange:()=>{}}),Ay=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=mt(r);return l.jsx(pj,{scope:e.__scopeMenu,value:n,onValueChange:s,children:l.jsx(vl,{...o,ref:t})})});Ay.displayName=My;var Ny="MenuRadioItem",jy=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=mj(Ny,e.__scopeMenu),s=n===o.value;return l.jsx(Iy,{scope:e.__scopeMenu,checked:s,children:l.jsx(Us,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":wl(s),onSelect:q(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});jy.displayName=Ny;var xl="MenuItemIndicator",[Iy,gj]=In(xl,{checked:!1}),Dy=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=gj(xl,n);return l.jsx(Be,{present:r||ps(s.checked)||s.checked===!0,children:l.jsx(ee.span,{...o,ref:t,"data-state":wl(s.checked)})})});Dy.displayName=xl;var yj="MenuSeparator",ky=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ky.displayName=yj;var vj="MenuArrow",_y=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=no(n);return l.jsx(js,{...o,...r,ref:t})});_y.displayName=vj;var bl="MenuSub",[xj,Oy]=In(bl),$y=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=fn(bl,t),i=no(t),[a,c]=p.useState(null),[u,d]=p.useState(null),f=mt(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Xr,{...i,children:l.jsx(by,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(xj,{scope:t,contentId:ve(),triggerId:ve(),trigger:a,onTriggerChange:c,children:n})})})};$y.displayName=bl;var Sr="MenuSubTrigger",Ly=p.forwardRef((e,t)=>{const n=fn(Sr,e.__scopeMenu),r=ro(Sr,e.__scopeMenu),o=Oy(Sr,e.__scopeMenu),s=gl(Sr,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),l.jsx(pl,{asChild:!0,...u,children:l.jsx(Ty,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":By(n.open),...e,ref:Ot(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:q(e.onPointerMove,_r(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:q(e.onPointerLeave,_r(f=>{var m,y;d();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(y=n.content)==null?void 0:y.dataset.side,v=g==="right",x=v?-5:5,b=h[v?"left":"right"],w=h[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:b,y:h.top},{x:w,y:h.top},{x:w,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:q(e.onKeyDown,f=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||ej[r.dir].includes(f.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),f.preventDefault())})})})});Ly.displayName=Sr;var Fy="MenuSubContent",Vy=p.forwardRef((e,t)=>{const n=Cy(at,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(at,e.__scopeMenu),i=ro(at,e.__scopeMenu),a=Oy(Fy,e.__scopeMenu),c=p.useRef(null),u=se(t,c);return l.jsx(kr.Provider,{scope:e.__scopeMenu,children:l.jsx(Be,{present:r||s.open,children:l.jsx(kr.Slot,{scope:e.__scopeMenu,children:l.jsx(yl,{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:q(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:q(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:q(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),h=tj[i.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(m=a.trigger)==null||m.focus(),d.preventDefault())})})})})})});Vy.displayName=Fy;function By(e){return e?"open":"closed"}function ps(e){return e==="indeterminate"}function wl(e){return ps(e)?"indeterminate":e?"checked":"unchecked"}function bj(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Cj(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=wj(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 Sj(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 Rj(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Sj(n,t)}function _r(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Pj=wy,Tj=pl,Ej=Sy,Mj=Ry,Aj=vl,Nj=Py,jj=Us,Ij=Ey,Dj=Ay,kj=jy,_j=Dy,Oj=ky,$j=_y,Lj=$y,Fj=Ly,Vj=Vy,Ws="DropdownMenu",[Bj]=Ie(Ws,[vy]),Ge=vy(),[Gj,Gy]=Bj(Ws),Uy=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Ge(t),u=p.useRef(null),[d,f]=Ee({prop:o,defaultProp:s??!1,onChange:i,caller:Ws});return l.jsx(Gj,{scope:t,triggerId:ve(),triggerRef:u,contentId:ve(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(Pj,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};Uy.displayName=Ws;var Wy="DropdownMenuTrigger",Ky=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Gy(Wy,n),i=Ge(n);return l.jsx(Tj,{asChild:!0,...i,children:l.jsx(ee.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:Ot(t,s.triggerRef),onPointerDown:q(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:q(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Ky.displayName=Wy;var Uj="DropdownMenuPortal",zy=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ge(t);return l.jsx(Ej,{...r,...n})};zy.displayName=Uj;var Hy="DropdownMenuContent",Yy=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Gy(Hy,n),s=Ge(n),i=p.useRef(!1);return l.jsx(Mj,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:q(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)"}})});Yy.displayName=Hy;var Wj="DropdownMenuGroup",Kj=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(Aj,{...o,...r,ref:t})});Kj.displayName=Wj;var zj="DropdownMenuLabel",Xy=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(Nj,{...o,...r,ref:t})});Xy.displayName=zj;var Hj="DropdownMenuItem",qy=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(jj,{...o,...r,ref:t})});qy.displayName=Hj;var Yj="DropdownMenuCheckboxItem",Zy=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(Ij,{...o,...r,ref:t})});Zy.displayName=Yj;var Xj="DropdownMenuRadioGroup",Qy=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(Dj,{...o,...r,ref:t})});Qy.displayName=Xj;var qj="DropdownMenuRadioItem",Jy=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(kj,{...o,...r,ref:t})});Jy.displayName=qj;var Zj="DropdownMenuItemIndicator",ev=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(_j,{...o,...r,ref:t})});ev.displayName=Zj;var Qj="DropdownMenuSeparator",tv=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(Oj,{...o,...r,ref:t})});tv.displayName=Qj;var Jj="DropdownMenuArrow",eI=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx($j,{...o,...r,ref:t})});eI.displayName=Jj;var tI=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=Ge(t),[a,c]=Ee({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(Lj,{...i,open:a,onOpenChange:c,children:n})},nI="DropdownMenuSubTrigger",nv=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(Fj,{...o,...r,ref:t})});nv.displayName=nI;var rI="DropdownMenuSubContent",rv=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ge(n);return l.jsx(Vj,{...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)"}})});rv.displayName=rI;var oI=Uy,sI=Ky,ov=zy,iI=Yy,aI=Xy,cI=qy,lI=Zy,uI=Qy,dI=Jy,sv=ev,fI=tv,hI=tI,pI=nv,mI=rv;const gI=oI,yI=sI,vI=C.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(ov,{children:l.jsxs(iI,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),xI=C.forwardRef(function({icon:t,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(cI,{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})]})}),bI=C.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(lI,{ref:s,className:Y("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(sv,{children:l.jsx(Jt,{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})]})}),wI=uI,CI=C.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(dI,{ref:s,className:Y("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(sv,{children:l.jsx($p,{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})]})}),SI=C.forwardRef(function({className:t,...n},r){return l.jsx(aI,{ref:r,className:Y("cny-menu-label",t),...n})}),RI=C.forwardRef(function({className:t,...n},r){return l.jsx(fI,{ref:r,className:Y("cny-menu-separator",t),...n})}),PI=hI,TI=C.forwardRef(function({icon:t,className:n,children:r,...o},s){return l.jsxs(pI,{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(Yt,{size:13,"aria-hidden":"true"})})]})}),EI=C.forwardRef(function({className:t,...n},r){return l.jsx(ov,{children:l.jsx(mI,{ref:r,className:Y("cny-menu-content",t),...n})})});var MI=Object.defineProperty,mr=(e,t)=>MI(e,"name",{value:t,configurable:!0}),iv=!!(typeof window<"u"&&window.document&&window.document.createElement);function le(e,t,{checkForDefaultPrevented:n=!0}={}){return mr(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}mr(le,"composeEventHandlers");function AI(e){var t;if(!iv)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}mr(AI,"getOwnerWindow");function Ga(e){if(!iv)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}mr(Ga,"getOwnerDocument");function av(e,t=!1){const{activeElement:n}=Ga(e);if(!(n!=null&&n.nodeName))return null;if(cv(n)&&n.contentDocument)return av(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ga(n).getElementById(r);if(o)return o}}return n}mr(av,"getActiveElement");function cv(e){return e.tagName==="IFRAME"}mr(cv,"isFrame");var NI=Object.defineProperty,ot=(e,t)=>NI(e,"name",{value:t,configurable:!0});function jI(e,t){const n=p.createContext(t);n.displayName=e+"Context";const r=ot(s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=e+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return ot(o,"useContext"),[r,o]}ot(jI,"createContext");function Dn(e,t=[]){let n=[];function r(s,i){const a=p.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=ot(f=>{var x;const{scope:h,children:m,...y}=f,g=((x=h==null?void 0:h[e])==null?void 0:x[c])||a,v=p.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var x;const{optional:y=!1}=m,g=((x=h==null?void 0:h[e])==null?void 0:x[c])||a,v=p.useContext(g);if(v)return v;if(i!==void 0)return i;if(!y)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ot(d,"useContext"),[u,d]}ot(r,"createContext");const o=ot(()=>{const s=n.map(i=>p.createContext(i));return ot(function(a){const c=(a==null?void 0:a[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=e,[r,lv(o,...t)]}ot(Dn,"createContextScope");function lv(...e){const t=e[0];if(e.length===1)return t;const n=ot(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return ot(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ot(lv,"composeContextScopes");var II=Object.defineProperty,Cl=(e,t)=>II(e,"name",{value:t,configurable:!0});function Ua(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Cl(Ua,"setRef");function uv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ua(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():Ua(e[o],null)}}}}Cl(uv,"composeRefs");function je(...e){return p.useCallback(uv(...e),e)}Cl(je,"useComposedRefs");var DI=Object.defineProperty,bt=(e,t)=>DI(e,"name",{value:t,configurable:!0});function Nn(e){const t=p.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];Wa(o)&&typeof Io=="function"&&(o=Io(o._payload)),p.Children.forEach(o,h=>{var m;if(pv(h)){a=!0;const y=h;let g="child"in y.props?y.props.child:y.props.children;Wa(g)&&typeof Io=="function"&&(g=Io(g._payload)),i=_I(y,g),c.push((m=i==null?void 0:i.props)==null?void 0:m.children)}else c.push(h)}),i?i=p.cloneElement(i,void 0,c):!a&&p.Children.count(o)===1&&p.isValidElement(o)&&(i=o);const u=i?hv(i):void 0,d=je(r,u);if(!i){if(o||o===0)throw new Error(a?LI(e):$I(e));return o}const f=fv(s,i.props??{});return i.type!==p.Fragment&&(f.ref=r?d:u),p.cloneElement(i,f)});return t.displayName=`${e}.Slot`,t}bt(Nn,"createSlot");var dv=Symbol.for("radix.slottable");function kI(e){const t=bt(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=dv,t}bt(kI,"createSlottable");var _I=bt((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function fv(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}}bt(fv,"mergeProps");function hv(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)}bt(hv,"getElementRef");function pv(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dv}bt(pv,"isSlottable");var OI=Symbol.for("react.lazy");function Wa(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===OI&&"_payload"in e&&mv(e._payload)}bt(Wa,"isLazyComponent");function mv(e){return typeof e=="object"&&e!==null&&"then"in e}bt(mv,"isPromiseLike");var $I=bt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),LI=bt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Io=p[" use ".trim().toString()],FI=Object.defineProperty,VI=(e,t)=>FI(e,"name",{value:t,configurable:!0}),BI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=BI.reduce((e,t)=>{const n=Nn(`Primitive.${t}`),r=p.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 Sl(e,t){e&&or.flushSync(()=>e.dispatchEvent(t))}VI(Sl,"dispatchDiscreteCustomEvent");var GI=Object.defineProperty,Ne=(e,t)=>GI(e,"name",{value:t,configurable:!0});function Rl(e){const t=e+"CollectionProvider",[n,r]=Dn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Ne(g=>{const{scope:v,children:x}=g,b=p.useRef(null),w=p.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:b,children:x})},"CollectionProvider");i.displayName=t;const a=e+"CollectionSlot",c=Nn(a),u=p.forwardRef((g,v)=>{const{scope:x,children:b}=g,w=s(a,x),S=je(v,w.collectionRef);return l.jsx(c,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Nn(d),m=p.forwardRef((g,v)=>{const{scope:x,children:b,...w}=g,S=p.useRef(null),R=je(v,S),P=s(d,x);return p.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),l.jsx(h,{[f]:"",ref:R,children:b})});m.displayName=d;function y(g){const v=s(e+"CollectionConsumer",g);return p.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((P,T)=>w.indexOf(P.ref.current)-w.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return Ne(y,"useCollection"),[{Provider:i,Slot:u,ItemSlot:m},y,r]}Ne(Rl,"createCollection");var pf=new WeakMap,we,Je,Hi=(Je=class extends Map{constructor(n){super(n);lu(this,we);di(this,we,[...super.keys()]),pf.set(this,!0)}set(n,r){return pf.get(this)&&(this.has(n)?Ve(this,we)[Ve(this,we).indexOf(n)]=n:Ve(this,we).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Ve(this,we).length,a=Pl(n);let c=a>=0?a:i+a;const u=c<0||c>=i?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(r,o),this;const d=this.size+(s?0:1);a<0&&c++;const f=[...Ve(this,we)];let h,m=!1;for(let y=c;y<d;y++)if(c===y){let g=f[y];f[y]===r&&(g=f[y+1]),s&&this.delete(r),h=this.get(g),this.set(r,o)}else{!m&&f[y-1]===r&&(m=!0);const g=f[m?y:y-1],v=h;h=this.get(g),this.delete(g),this.set(g,v)}return this}with(n,r,o){const s=new Je(this);return s.insert(n,r,o),s}before(n){const r=Ve(this,we).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Ve(this,we).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Ve(this,we).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=Ve(this,we).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return di(this,we,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Ve(this,we).splice(Ve(this,we).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Yo(Ve(this,we),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Yo(Ve(this,we),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Ve(this,we).indexOf(n)}keyAt(n){return Yo(Ve(this,we),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new Je(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new Je(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const a of this)s===0&&n.length===1?i=a:i=Reflect.apply(r,this,[i,a,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const a=this.at(i);i===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new Je(r)}toReversed(){const n=new Je;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Je(r)}slice(n,r){const o=new Je;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const a=this.keyAt(i),c=this.get(a);o.set(a,c)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},we=new WeakMap,Ne(Je,"OrderedDict"),Je);function Yo(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=gv(e,t);return n===-1?void 0:e[n]}Ne(Yo,"at");function gv(e,t){const n=e.length,r=Pl(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Ne(gv,"toSafeIndex");function Pl(e){return e!==e||e===0?0:Math.trunc(e)}Ne(Pl,"toSafeInteger");function UI(e){const t=e+"CollectionProvider",[n,r]=Dn(t),[o,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Hi,setItemMap:Ne(()=>{},"setItemMap")}),i=Ne(({state:w,...S})=>w?l.jsx(c,{...S,state:w}):l.jsx(a,{...S}),"CollectionProvider");i.displayName=t;const a=Ne(w=>{const S=v();return l.jsx(c,{...w,state:S})},"CollectionInit");a.displayName=t+"Init";const c=Ne(w=>{const{scope:S,children:R,state:P}=w,T=p.useRef(null),[A,E]=p.useState(null),M=je(T,E),[D,k]=P;return p.useEffect(()=>{if(!A)return;const V=xv(()=>{});return V.observe(A,{childList:!0,subtree:!0}),()=>{V.disconnect()}},[A]),l.jsx(o,{scope:S,itemMap:D,setItemMap:k,collectionRef:M,collectionRefObject:T,collectionElement:A,children:R})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Nn(u),f=p.forwardRef((w,S)=>{const{scope:R,children:P}=w,T=s(u,R),A=je(S,T.collectionRef);return l.jsx(d,{ref:A,children:P})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",y=Nn(h),g=p.forwardRef((w,S)=>{const{scope:R,children:P,...T}=w,A=p.useRef(null),[E,M]=p.useState(null),D=je(S,A,M),k=s(h,R),{setItemMap:V}=k,W=p.useRef(T);yv(W.current,T)||(W.current=T);const Z=W.current;return p.useEffect(()=>{const G=Z;return V(_=>E?_.has(E)?_.set(E,{...G,element:E}).toSorted(Ka):(_.set(E,{...G,element:E}),_.toSorted(Ka)):_),()=>{V(_=>!E||!_.has(E)?_:(_.delete(E),new Hi(_)))}},[E,Z,V]),l.jsx(y,{[m]:"",ref:D,children:P})});g.displayName=h;function v(){return p.useState(new Hi)}Ne(v,"useInitCollection");function x(w){const{itemMap:S}=s(e+"CollectionConsumer",w);return S}return Ne(x,"useCollection"),[{Provider:i,Slot:f,ItemSlot:g},{createCollectionScope:r,useCollection:x,useInitCollection:v}]}Ne(UI,"createCollection");function yv(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}Ne(yv,"shallowEqual");function vv(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ne(vv,"isElementPreceding");function Ka(e,t){return!e[1].element||!t[1].element?0:vv(e[1].element,t[1].element)?-1:1}Ne(Ka,"sortByDocumentPosition");function xv(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Ne(xv,"getChildListObserver");var WI=Object.defineProperty,KI=(e,t)=>WI(e,"name",{value:t,configurable:!0}),zI=p.createContext(void 0);function Tl(e){const t=p.useContext(zI);return e||t||"ltr"}KI(Tl,"useDirection");var HI=Object.defineProperty,YI=(e,t)=>HI(e,"name",{value:t,configurable:!0});function vt(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}YI(vt,"useCallbackRef");var XI=Object.defineProperty,Ae=(e,t)=>XI(e,"name",{value:t,configurable:!0}),za="dismissableLayer.update",qI="dismissableLayer.pointerDownOutside",ZI="dismissableLayer.focusOutside",mf,bv=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),QI=p.forwardRef(Ae(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(bv),[h,m]=p.useState(null),y=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=p.useState({}),v=je(n,m),x=Array.from(f.layers),[b]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=b?x.indexOf(b):-1,S=h?x.indexOf(h):-1,R=f.layersWithOutsidePointerEventsDisabled.size>0,P=S>=w,T=p.useRef(!1),A=wv(k=>{i==null||i(k),c==null||c(k),k.defaultPrevented||u==null||u()},{ownerDocument:y,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(k=>{if(!(k instanceof Node))return!1;const V=[...f.branches].some(W=>W.contains(k));return P&&!V},[f.branches,P])}),E=Cv(k=>{if(o&&T.current)return;const V=k.target;[...f.branches].some(Z=>Z.contains(V))||(a==null||a(k),c==null||c(k),k.defaultPrevented||u==null||u())},y),M=h?S===x.length-1:!1,D=vt(k=>{k.key==="Escape"&&(s==null||s(k),!k.defaultPrevented&&u&&(k.preventDefault(),u()))});return p.useEffect(()=>{if(M)return y.addEventListener("keydown",D,{capture:!0}),()=>y.removeEventListener("keydown",D,{capture:!0})},[y,M,D]),p.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(mf=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),Ha(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=mf))}},[h,y,r,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),Ha())},[h,f]),p.useEffect(()=>{const k=Ae(()=>g({}),"handleUpdate");return document.addEventListener(za,k),()=>document.removeEventListener(za,k)},[]),l.jsx(nt.div,{...d,ref:v,style:{pointerEvents:R?P?"auto":"none":void 0,...t.style},onFocusCapture:le(t.onFocusCapture,E.onFocusCapture),onBlurCapture:le(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:le(t.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function JI(){const e=p.useContext(bv),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ae(JI,"useDismissableLayerSurface");var eD=Ae(()=>!0,"IS_TRUE");function wv(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=eD}=t,a=vt(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}Ae(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ae(m,"isOutsideInteractionIntercepted");function y(w){if(!u.current)return;const S=w.target;S instanceof Node&&[...s].some(P=>P.contains(S))||d.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ae(y,"handleInteractionCapture");function g(w){u.current&&d.current.set(w.type,!1)}Ae(g,"handleInteractionBubble");const v=Ae(w=>{if(w.target&&!c.current){let S=function(){n.removeEventListener("click",f.current);const P=m();h(),P||El(qI,a,R,{discrete:!0})};if(Ae(S,"handleAndDispatchPointerDownOutsideEvent"),!i(w.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const R={originalEvent:w};u.current=!0,o.current=r&&w.button===0,d.current.clear(),!r||w.button!==0?S():(n.removeEventListener("click",f.current),f.current=S,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of x)n.addEventListener(w,y,!0),n.addEventListener(w,g);const b=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(b),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const w of x)n.removeEventListener(w,y,!0),n.removeEventListener(w,g)}},[n,a,r,o,s,i]),{onPointerDownCapture:Ae(()=>c.current=!0,"onPointerDownCapture")}}Ae(wv,"usePointerDownOutside");function Cv(e,t=globalThis==null?void 0:globalThis.document){const n=vt(e),r=p.useRef(!1);return p.useEffect(()=>{const o=Ae(s=>{s.target&&!r.current&&El(ZI,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:Ae(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ae(()=>r.current=!1,"onBlurCapture")}}Ae(Cv,"useFocusOutside");function Ha(){const e=new CustomEvent(za);document.dispatchEvent(e)}Ae(Ha,"dispatchUpdate");function El(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?Sl(o,s):o.dispatchEvent(s)}Ae(El,"handleAndDispatchCustomEvent");var tD=Object.defineProperty,Ml=(e,t)=>tD(e,"name",{value:t,configurable:!0}),Do=0,Rt=null;function nD(e){return Al(),e.children}Ml(nD,"FocusGuards");function Al(){p.useEffect(()=>{Rt||(Rt={start:Ya(),end:Ya()});const{start:e,end:t}=Rt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Do++,()=>{Do===1&&(Rt==null||Rt.start.remove(),Rt==null||Rt.end.remove(),Rt=null),Do=Math.max(0,Do-1)}},[])}Ml(Al,"useFocusGuards");function Ya(){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}Ml(Ya,"createFocusGuard");var rD=Object.defineProperty,ze=(e,t)=>rD(e,"name",{value:t,configurable:!0}),Yi="focusScope.autoFocusOnMount",Xi="focusScope.autoFocusOnUnmount",gf={bubbles:!1,cancelable:!0},oD=p.forwardRef(ze(function(t,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[c,u]=p.useState(null),d=vt(s),f=vt(i),h=p.useRef(null),m=je(n,u),y=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let v=function(S){if(y.paused||!c)return;const R=S.target;c.contains(R)?h.current=R:kt(h.current,{select:!0})},x=function(S){if(y.paused||!c)return;const R=S.relatedTarget;R!==null&&(c.contains(R)||kt(h.current,{select:!0}))},b=function(S){if(document.activeElement===document.body)for(const P of S)P.removedNodes.length>0&&kt(c)};ze(v,"handleFocusIn"),ze(x,"handleFocusOut"),ze(b,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const w=new MutationObserver(b);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),w.disconnect()}}},[o,c,y.paused]),p.useEffect(()=>{if(c){yf.add(y);const v=document.activeElement;if(!c.contains(v)){const b=new CustomEvent(Yi,gf);c.addEventListener(Yi,d),c.dispatchEvent(b),b.defaultPrevented||(Sv(Mv(Nl(c)),{select:!0}),document.activeElement===v&&kt(c))}return()=>{c.removeEventListener(Yi,d),setTimeout(()=>{const b=new CustomEvent(Xi,gf);c.addEventListener(Xi,f),c.dispatchEvent(b),b.defaultPrevented||kt(v??document.body,{select:!0}),c.removeEventListener(Xi,f),yf.remove(y)},0)}}},[c,d,f,y]);const g=p.useCallback(v=>{if(!r&&!o||y.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(x&&b){const w=v.currentTarget,[S,R]=Rv(w);S&&R?!v.shiftKey&&b===R?(v.preventDefault(),r&&kt(S,{select:!0})):v.shiftKey&&b===S&&(v.preventDefault(),r&&kt(R,{select:!0})):b===w&&v.preventDefault()}},[r,o,y.paused]);return l.jsx(nt.div,{tabIndex:-1,...a,ref:m,onKeyDown:g})},"FocusScope"));function Sv(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(kt(r,{select:t}),document.activeElement!==n)return}ze(Sv,"focusFirst");function Rv(e){const t=Nl(e),n=Xa(t,e),r=Xa(t.reverse(),e);return[n,r]}ze(Rv,"getTabbableEdges");function Nl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ze(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}ze(Nl,"getTabbableCandidates");function Xa(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Pv(r,{upTo:t})))return r}ze(Xa,"findVisible");function Pv(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}ze(Pv,"isHidden");function Tv(e){return e instanceof HTMLInputElement&&"select"in e}ze(Tv,"isSelectableInput");function kt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Tv(e)&&t&&e.select()}}ze(kt,"focus");var yf=Ev();function Ev(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=qa(e,t),e.unshift(t)},remove(t){var n;e=qa(e,t),(n=e[0])==null||n.resume()}}}ze(Ev,"createFocusScopesStack");function qa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ze(qa,"arrayRemove");function Mv(e){return e.filter(t=>t.tagName!=="A")}ze(Mv,"removeLinks");var ht=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},sD=Object.defineProperty,iD=(e,t)=>sD(e,"name",{value:t,configurable:!0}),aD=p[" useId ".trim().toString()]||(()=>{}),cD=0;function ms(e){const[t,n]=p.useState(aD());return ht(()=>{e||n(r=>r??String(cD++))},[e]),e||(t?`radix-${t}`:"")}iD(ms,"useId");var lD=Object.defineProperty,uD=(e,t)=>lD(e,"name",{value:t,configurable:!0});function Av(e){const[t,n]=p.useState(void 0);return ht(()=>{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}uD(Av,"useSize");var dD=Object.defineProperty,qt=(e,t)=>dD(e,"name",{value:t,configurable:!0}),Nv="Popper",[jv,Iv]=Dn(Nv),[fD,Dv]=jv(Nv),hD=qt(e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null),[s,i]=p.useState(void 0);return l.jsx(fD,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),pD="PopperAnchor",mD=p.forwardRef(qt(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,i=Dv(pD,r),a=p.useRef(null),c=i.onAnchorChange,u=p.useCallback(g=>{a.current=g,g&&c(g)},[c]),d=je(n,u),f=p.useRef(null);p.useEffect(()=>{if(!o)return;const g=f.current;f.current=o.current,g!==f.current&&c(f.current)});const h=i.placementState&&Ks(i.placementState),m=h==null?void 0:h[0],y=h==null?void 0:h[1];return o?null:l.jsx(nt.div,{"data-radix-popper-side":m,"data-radix-popper-align":y,...s,ref:d})},"PopperAnchor")),kv="PopperContent",[gD,G$]=jv(kv),yD=p.forwardRef(qt(function(t,n){var K,z,ie,ae,xe,oe,rt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:g,...v}=t,x=Dv(kv,r),[b,w]=p.useState(null),S=je(n,w),[R,P]=p.useState(null),T=Av(R),A=(T==null?void 0:T.width)??0,E=(T==null?void 0:T.height)??0,M=o+(i!=="center"?"-"+i:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],V=k.length>0,W={padding:D,boundary:k.filter(_v),altBoundary:V},{refs:Z,floatingStyles:G,placement:_,isPositioned:O,middlewareData:N}=om({strategy:"fixed",placement:M,whileElementsMounted:qt((...ct)=>nm(...ct,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[sm({mainAxis:s+E,alignmentAxis:a}),u&&im({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?am():void 0,...W}),u&&cm({...W}),lm({...W,apply:qt(({elements:ct,rects:Ct,availableWidth:Se,availableHeight:Le})=>{const{width:ao,height:he}=Ct.reference,be=ct.floating.style;be.setProperty("--radix-popper-available-width",`${Se}px`),be.setProperty("--radix-popper-available-height",`${Le}px`),be.setProperty("--radix-popper-anchor-width",`${ao}px`),be.setProperty("--radix-popper-anchor-height",`${he}px`)},"apply")}),R&&dm({element:R,padding:c}),vD({arrowWidth:A,arrowHeight:E}),m&&um({strategy:"referenceHidden",...W,boundary:V?W.boundary:void 0})]}),j=x.setPlacementState;ht(()=>(j(_),()=>{j(void 0)}),[_,j]);const[H,I]=Ks(_),X=vt(g);ht(()=>{O&&(X==null||X())},[O,X]);const F=(K=N.arrow)==null?void 0:K.x,U=(z=N.arrow)==null?void 0:z.y,B=((ie=N.arrow)==null?void 0:ie.centerOffset)!==0,[L,Q]=p.useState();return ht(()=>{b&&Q(window.getComputedStyle(b).zIndex)},[b]),l.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:O?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:L,"--radix-popper-transform-origin":[(ae=N.transformOrigin)==null?void 0:ae.x,(xe=N.transformOrigin)==null?void 0:xe.y].join(" "),...((oe=N.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(gD,{scope:r,placedSide:H,placedAlign:I,onArrowChange:P,arrowX:F,arrowY:U,shouldHideArrow:B,children:l.jsx(nt.div,{"data-side":H,"data-align":I,...v,ref:S,style:{...v.style,animation:O?(rt=v.style)==null?void 0:rt.animation:"none"}})})})},"PopperContent"));function _v(e){return e!==null}qt(_v,"isNotNull");var vD=qt(e=>({name:"transformOrigin",options:e,fn(t){var v,x,b;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=Ks(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let y="",g="";return u==="bottom"?(y=i?f:`${h}px`,g=`${-c}px`):u==="top"?(y=i?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?f:`${m}px`):u==="left"&&(y=`${r.floating.width+c}px`,g=i?f:`${m}px`),{data:{x:y,y:g}}}}),"transformOrigin");function Ks(e){const[t,n="center"]=e.split("-");return[t,n]}qt(Ks,"getSideAndAlignFromPlacement");var Ov=hD,xD=mD,bD=yD,wD=Object.defineProperty,CD=(e,t)=>wD(e,"name",{value:t,configurable:!0}),SD=p.forwardRef(CD(function(t,n){var c;const{container:r,...o}=t,[s,i]=p.useState(!1);ht(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?or.createPortal(l.jsx(nt.div,{...o,ref:n}),a):null},"Portal")),RD=Object.defineProperty,Ft=(e,t)=>RD(e,"name",{value:t,configurable:!0});function $v(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}Ft($v,"useStateMachine");var zs=Ft(e=>{const{present:t,children:n}=e,r=Lv(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=Fv(r.ref,Vv(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null},"Presence");function Lv(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),i=p.useRef(void 0),a=e?"mounted":"unmounted",[c,u]=$v(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=i.current??Kn(r.current),i.current=void 0):s.current="none"},[c]),ht(()=>{const d=r.current,f=o.current;if(f!==e){const m=s.current,y=Kn(d);e?(i.current=y,u("MOUNT")):y==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ht(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Ft(y=>{const v=Kn(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&v&&(u("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},"handleAnimationEnd"),m=Ft(y=>{y.target===t&&(s.current=Kn(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Kn(f)}else r.current=null;n(d)},[])}}Ft(Lv,"usePresence");function Za(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ft(Za,"setRef");function Fv(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(i=>{const a=Za(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():Za(r[i],null)}}},[])}Ft(Fv,"useStableComposedRefs");function Kn(e){return(e==null?void 0:e.animationName)||"none"}Ft(Kn,"getAnimationName");function Vv(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)}Ft(Vv,"getElementRef");var PD=Object.defineProperty,TD=(e,t)=>PD(e,"name",{value:t,configurable:!0}),vf=p[" useEffectEvent ".trim().toString()],xf=p[" useInsertionEffect ".trim().toString()];function Bv(e){if(typeof vf=="function")return vf(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof xf=="function"?xf(()=>{t.current=e}):ht(()=>{t.current=e}),p.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}TD(Bv,"useEffectEvent");var ED=Object.defineProperty,oo=(e,t)=>ED(e,"name",{value:t,configurable:!0}),MD=p[" useInsertionEffect ".trim().toString()]||ht;function Hs({prop:e,defaultProp:t,onChange:n=oo(()=>{},"onChange"),caller:r}){const[o,s,i]=Gv({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o,u=p.useCallback(d=>{var f;if(a){const h=Uv(d)?d(e):d;h!==e&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,e,s,i]);return[c,u]}oo(Hs,"useControllableState");function Gv({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),s=p.useRef(t);return MD(()=>{s.current=t},[t]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}oo(Gv,"useUncontrolledState");function Uv(e){return typeof e=="function"}oo(Uv,"isFunction");var bf=Symbol("RADIX:SYNC_STATE");function AD(e,t,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=t,c=o!==void 0,u=Bv(i),d=[{...n,state:s}];r&&d.push(r);const[f,h]=p.useReducer((v,x)=>{if(x.type===bf)return{...v,state:x.state};const b=e(v,x);return c&&!Object.is(b.state,v.state)&&u(b.state),b},...d),m=f.state,y=p.useRef(m);p.useEffect(()=>{y.current!==m&&(y.current=m,c||u(m))},[m,y,c]);const g=p.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return p.useEffect(()=>{c&&!Object.is(o,f.state)&&h({type:bf,state:o})},[o,f.state,c]),[g,h]}oo(AD,"useControllableStateReducer");var ND=Object.defineProperty,jl=(e,t)=>ND(e,"name",{value:t,configurable:!0}),qi=!1;function Wv(){const[e,t]=p.useState(qi);return p.useEffect(()=>{qi||(qi=!0,t(!0))},[]),e}jl(Wv,"useIsHydrated");var Kv=p[" useSyncExternalStore ".trim().toString()];function zv(){return()=>{}}jl(zv,"subscribe");function Hv(){return Kv(zv,()=>!0,()=>!1)}jl(Hv,"useIsHydratedModern");var jD=typeof Kv=="function"?Hv:Wv,ID=Object.defineProperty,kn=(e,t)=>ID(e,"name",{value:t,configurable:!0}),Zi="rovingFocusGroup.onEntryFocus",DD={bubbles:!1,cancelable:!0},Ys="RovingFocusGroup",[Qa,Yv,kD]=Rl(Ys),[_D,Xv]=Dn(Ys,[kD]),[OD,$D]=_D(Ys),LD=p.forwardRef(kn(function(t,n){return l.jsx(Qa.Provider,{scope:t.__scopeRovingFocusGroup,children:l.jsx(Qa.Slot,{scope:t.__scopeRovingFocusGroup,children:l.jsx(FD,{...t,ref:n})})})},"RovingFocusGroup")),FD=p.forwardRef(kn(function(t,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),y=je(n,m),g=Tl(i),[v,x]=Hs({prop:a,defaultProp:c??null,onChange:u,caller:Ys}),[b,w]=p.useState(!1),S=vt(d),R=Yv(r),P=p.useRef(!1),[T,A]=p.useState(0);return p.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Zi,S),()=>E.removeEventListener(Zi,S)},[S]),l.jsx(OD,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(E=>x(E),[x]),onItemShiftTab:p.useCallback(()=>w(!0),[]),onFocusableItemAdd:p.useCallback(()=>A(E=>E+1),[]),onFocusableItemRemove:p.useCallback(()=>A(E=>E-1),[]),children:l.jsx(nt.div,{tabIndex:b||T===0?-1:0,"data-orientation":o,...h,ref:y,style:{outline:"none",...t.style},onMouseDown:le(t.onMouseDown,()=>{P.current=!0}),onFocus:le(t.onFocus,E=>{const M=!P.current;if(E.target===E.currentTarget&&M&&!b){const D=new CustomEvent(Zi,DD);if(E.currentTarget.dispatchEvent(D),!D.defaultPrevented){const k=R().filter(_=>_.focusable),V=k.find(_=>_.active),W=k.find(_=>_.id===v),G=[V,W,...k].filter(Boolean).map(_=>_.ref.current);Il(G,f)}}P.current=!1}),onBlur:le(t.onBlur,()=>w(!1))})})},"RovingFocusGroupImpl")),VD="RovingFocusGroupItem",BD=p.forwardRef(kn(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=t,u=ms(),d=i||u,f=$D(VD,r),h=f.currentTabStopId===d,m=Yv(r),{onFocusableItemAdd:y,onFocusableItemRemove:g,currentTabStopId:v}=f,x=jD();return ht(()=>{if(!(!x||!o))return y(),()=>g()},[x,o,y,g]),p.useEffect(()=>{if(!(x||!o))return y(),()=>g()},[x,o,y,g]),l.jsx(Qa.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:l.jsx(nt.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:le(t.onMouseDown,b=>{o?f.onItemFocus(d):b.preventDefault()}),onFocus:le(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:le(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const w=Zv(b,f.orientation,f.dir);if(w!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let R=m().filter(P=>P.focusable).map(P=>P.ref.current);if(w==="last")R.reverse();else if(w==="prev"||w==="next"){w==="prev"&&R.reverse();const P=R.indexOf(b.currentTarget);R=f.loop?Qv(R,P+1):R.slice(P+1)}setTimeout(()=>Il(R))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:v!=null}):a})})},"RovingFocusGroupItem")),GD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}kn(qv,"getDirectionAwareKey");function Zv(e,t,n){const r=qv(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return GD[r]}kn(Zv,"getFocusIntent");function Il(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}kn(Il,"focusFirst");function Qv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}kn(Qv,"wrapArray");var UD=LD,WD=BD,KD=Object.defineProperty,ue=(e,t)=>KD(e,"name",{value:t,configurable:!0}),Ja=["Enter"," "],zD=["ArrowDown","PageUp","Home"],Jv=["ArrowUp","PageDown","End"],HD=[...zD,...Jv],YD={ltr:[...Ja,"ArrowRight"],rtl:[...Ja,"ArrowLeft"]},XD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xs="Menu",[Or,qD,ZD]=Rl(Xs),[_n,ex]=Dn(Xs,[ZD,Iv,Xv]),qs=Iv(),tx=Xv(),[nx,hn]=_n(Xs),[QD,so]=_n(Xs),JD=ue(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=qs(t),[c,u]=p.useState(null),d=p.useRef(!1),f=vt(s),h=Tl(o);return p.useEffect(()=>{const m=ue(()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=ue(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=ue(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),l.jsx(Ov,{...a,children:l.jsx(nx,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(QD,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),rx=p.forwardRef(ue(function(t,n){const{__scopeMenu:r,...o}=t,s=qs(r);return l.jsx(xD,{...s,...o,ref:n})},"MenuAnchor")),ox="MenuPortal",[ek,sx]=_n(ox,{forceMount:void 0}),tk=ue(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=hn(ox,t);return l.jsx(ek,{scope:t,forceMount:n,children:l.jsx(zs,{present:n||s.open,children:l.jsx(SD,{asChild:!0,container:o,children:r})})})},"MenuPortal"),pt="MenuContent",[nk,Dl]=_n(pt),rk=p.forwardRef(ue(function(t,n){const r=sx(pt,t.__scopeMenu),{forceMount:o=r.forceMount,...s}=t,i=hn(pt,t.__scopeMenu),a=so(pt,t.__scopeMenu);return l.jsx(Or.Provider,{scope:t.__scopeMenu,children:l.jsx(zs,{present:o||i.open,children:l.jsx(Or.Slot,{scope:t.__scopeMenu,children:a.modal?l.jsx(ok,{...s,ref:n}):l.jsx(sk,{...s,ref:n})})})})},"MenuContent")),ok=p.forwardRef(ue(function(t,n){const r=hn(pt,t.__scopeMenu),o=p.useRef(null),s=je(n,o);return p.useEffect(()=>{const i=o.current;if(i)return Qr(i)},[]),l.jsx(kl,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:le(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),sk=p.forwardRef(ue(function(t,n){const r=hn(pt,t.__scopeMenu);return l.jsx(kl,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),ik=Nn("MenuContent.ScrollLock"),kl=p.forwardRef(ue(function(t,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:y,disableOutsideScroll:g,...v}=t,x=hn(pt,r),b=so(pt,r),w=qs(r),S=tx(r),R=qD(r),[P,T]=p.useState(null),A=p.useRef(null),E=je(n,A,x.onContentChange),M=p.useRef(0),D=p.useRef(""),k=p.useRef(0),V=p.useRef(null),W=p.useRef("right"),Z=p.useRef(0),G=g?hr:p.Fragment,_=g?{as:ik,allowPinchZoom:!0}:void 0,O=ue(j=>{var Q,K;const H=D.current+j,I=R().filter(z=>!z.disabled),X=document.activeElement,F=(Q=I.find(z=>z.ref.current===X))==null?void 0:Q.textValue,U=I.map(z=>z.textValue),B=hx(U,H,F),L=(K=I.find(z=>z.textValue===B))==null?void 0:K.ref.current;ue((function z(ie){D.current=ie,window.clearTimeout(M.current),ie!==""&&(M.current=window.setTimeout(()=>z(""),1e3))}),"updateSearch")(H),L&&setTimeout(()=>L.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(M.current),[]),Al();const N=p.useCallback(j=>{var I,X;return W.current===((I=V.current)==null?void 0:I.side)&&mx(j,(X=V.current)==null?void 0:X.area)},[]);return l.jsx(nk,{scope:r,searchRef:D,onItemEnter:p.useCallback(j=>{N(j)&&j.preventDefault()},[N]),onItemLeave:p.useCallback(j=>{var H;N(j)||((H=A.current)==null||H.focus(),T(null))},[N]),onTriggerLeave:p.useCallback(j=>{N(j)&&j.preventDefault()},[N]),pointerGraceTimerRef:k,onPointerGraceIntentChange:p.useCallback(j=>{V.current=j},[]),children:l.jsx(G,{..._,children:l.jsx(oD,{asChild:!0,trapped:s,onMountAutoFocus:le(i,j=>{var H;j.preventDefault(),(H=A.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(QI,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:y,children:l.jsx(UD,{asChild:!0,...S,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:T,onEntryFocus:le(u,j=>{b.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(bD,{role:"menu","aria-orientation":"vertical","data-state":Ol(x.open),"data-radix-menu-content":"",dir:b.dir,...w,...v,ref:E,style:{outline:"none",...v.style},onKeyDown:le(v.onKeyDown,j=>{const I=j.target.closest("[data-radix-menu-content]")===j.currentTarget,X=j.ctrlKey||j.altKey||j.metaKey,F=j.key.length===1;I&&(j.key==="Tab"&&j.preventDefault(),!X&&F&&O(j.key));const U=A.current;if(j.target!==U||!HD.includes(j.key))return;j.preventDefault();const L=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);Jv.includes(j.key)&&L.reverse(),dx(L)}),onBlur:le(t.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(M.current),D.current="")}),onPointerMove:le(t.onPointerMove,nr(j=>{const H=j.target,I=Z.current!==j.clientX;if(j.currentTarget.contains(H)&&I){const X=j.clientX>Z.current?"right":"left";W.current=X,Z.current=j.clientX}}))})})})})})})},"MenuContentImpl")),ak=p.forwardRef(ue(function(t,n){const{__scopeMenu:r,...o}=t;return l.jsx(nt.div,{role:"group",...o,ref:n})},"MenuGroup")),ck=p.forwardRef(ue(function(t,n){const{__scopeMenu:r,...o}=t;return l.jsx(nt.div,{...o,ref:n})},"MenuLabel")),ec="MenuItem",wf="menu.itemSelect",_l=p.forwardRef(ue(function(t,n){const{disabled:r=!1,onSelect:o,...s}=t,i=p.useRef(null),a=so(ec,t.__scopeMenu),c=Dl(ec,t.__scopeMenu),u=je(n,i),d=p.useRef(!1),f=ue(()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(wf,{bubbles:!0,cancelable:!0});h.addEventListener(wf,y=>o==null?void 0:o(y),{once:!0}),Sl(h,m),m.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return l.jsx(ix,{...s,ref:u,disabled:r,onClick:le(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:le(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:le(t.onKeyDown,h=>{r||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||Ja.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),ix=p.forwardRef(ue(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=t,a=Dl(ec,r),c=tx(r),u=p.useRef(null),d=je(n,u),[f,h]=p.useState(!1),[m,y]=p.useState("");return p.useEffect(()=>{const g=u.current;g&&y((g.textContent??"").trim())},[i.children]),l.jsx(Or.ItemSlot,{scope:r,disabled:o,textValue:s??m,children:l.jsx(WD,{asChild:!0,...c,focusable:!o,children:l.jsx(nt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:le(t.onPointerMove,nr(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:le(t.onPointerLeave,nr(g=>a.onItemLeave(g))),onFocus:le(t.onFocus,()=>h(!0)),onBlur:le(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),lk=p.forwardRef(ue(function(t,n){const{checked:r=!1,onCheckedChange:o,...s}=t;return l.jsx(cx,{scope:t.__scopeMenu,checked:r,children:l.jsx(_l,{role:"menuitemcheckbox","aria-checked":$r(r)?"mixed":r,...s,ref:n,"data-state":Zs(r),onSelect:le(s.onSelect,()=>o==null?void 0:o($r(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),uk="MenuRadioGroup",[dk,fk]=_n(uk,{value:void 0,onValueChange:ue(()=>{},"onValueChange")}),hk=p.forwardRef(ue(function(t,n){const{value:r,onValueChange:o,...s}=t,i=vt(o);return l.jsx(dk,{scope:t.__scopeMenu,value:r,onValueChange:i,children:l.jsx(ak,{...s,ref:n})})},"MenuRadioGroup")),pk="MenuRadioItem",mk=p.forwardRef(ue(function(t,n){const{value:r,...o}=t,s=fk(pk,t.__scopeMenu),i=r===s.value;return l.jsx(cx,{scope:t.__scopeMenu,checked:i,children:l.jsx(_l,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":Zs(i),onSelect:le(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),ax="MenuItemIndicator",[cx,gk]=_n(ax,{checked:!1}),yk=p.forwardRef(ue(function(t,n){const{__scopeMenu:r,forceMount:o,...s}=t,i=gk(ax,r);return l.jsx(zs,{present:o||$r(i.checked)||i.checked===!0,children:l.jsx(nt.span,{...s,ref:n,"data-state":Zs(i.checked)})})},"MenuItemIndicator")),vk=p.forwardRef(ue(function(t,n){const{__scopeMenu:r,...o}=t;return l.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),lx="MenuSub",[xk,ux]=_n(lx),bk=ue(e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=hn(lx,t),i=qs(t),[a,c]=p.useState(null),[u,d]=p.useState(null),f=vt(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Ov,{...i,children:l.jsx(nx,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(xk,{scope:t,contentId:ms(),triggerId:ms(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),ko="MenuSubTrigger",wk=p.forwardRef(ue(function(t,n){const r=hn(ko,t.__scopeMenu),o=so(ko,t.__scopeMenu),s=ux(ko,t.__scopeMenu),i=Dl(ko,t.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=je(n,s.onTriggerChange);return l.jsx(rx,{asChild:!0,...d,children:l.jsx(ix,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ol(r.open),...t,ref:h,onClick:m=>{var y;(y=t.onClick)==null||y.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:le(t.onPointerMove,nr(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:le(t.onPointerLeave,nr(m=>{var g,v;f();const y=(g=r.content)==null?void 0:g.getBoundingClientRect();if(y){const x=(v=r.content)==null?void 0:v.dataset.side,b=x==="right",w=b?-5:5,S=y[b?"left":"right"],R=y[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+w,y:m.clientY},{x:S,y:y.top},{x:R,y:y.top},{x:R,y:y.bottom},{x:S,y:y.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:le(t.onKeyDown,m=>{var g;t.disabled||m.target!==m.currentTarget||i.searchRef.current!==""&&m.key===" "||YD[o.dir].includes(m.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),m.preventDefault())})})})},"MenuSubTrigger")),Ck="MenuSubContent",Sk=p.forwardRef(ue(function(t,n){const r=sx(pt,t.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=t,a=hn(pt,t.__scopeMenu),c=so(pt,t.__scopeMenu),u=ux(Ck,t.__scopeMenu),d=p.useRef(null),f=je(n,d);return l.jsx(Or.Provider,{scope:t.__scopeMenu,children:l.jsx(zs,{present:o||a.open,children:l.jsx(Or.Slot,{scope:t.__scopeMenu,children:l.jsx(kl,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:le(t.onFocusOutside,h=>{h.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:le(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:le(t.onKeyDown,h=>{var g;const m=h.currentTarget.contains(h.target),y=XD[c.dir].includes(h.key);m&&y&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function Ol(e){return e?"open":"closed"}ue(Ol,"getOpenState");function $r(e){return e==="indeterminate"}ue($r,"isIndeterminate");function Zs(e){return $r(e)?"indeterminate":e?"checked":"unchecked"}ue(Zs,"getCheckedState");function dx(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}ue(dx,"focusFirst");function fx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ue(fx,"wrapArray");function hx(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=fx(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}ue(hx,"getNextMatch");function px(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}ue(px,"isPointInPolygon");function mx(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return px(n,t)}ue(mx,"isPointerInGraceArea");function nr(e){return t=>t.pointerType==="mouse"?e(t):void 0}ue(nr,"whenMouse");var Rk=JD,Pk=rx,Tk=tk,Ek=rk,Mk=ck,Ak=_l,Nk=lk,jk=hk,Ik=mk,Dk=yk,kk=vk,_k=bk,Ok=wk,$k=Sk,Lk=Object.defineProperty,Oe=(e,t)=>Lk(e,"name",{value:t,configurable:!0}),$l="ContextMenu",[Fk,U$]=Dn($l,[ex]),Ye=ex(),[Vk,gx]=Fk($l),Bk=Oe(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=e,a=p.useRef(!1),[c,u]=Hs({prop:o,defaultProp:!1,onChange:r,caller:$l}),d=Ye(t);return l.jsx(Vk,{scope:t,open:c,onOpenChange:u,modal:i,hasInteractedRef:a,children:l.jsx(Rk,{...d,dir:s,open:c,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),Gk="ContextMenuTrigger",Uk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=t,i=gx(Gk,r),a=Ye(r),[c,u]=p.useState({x:0,y:0}),d=p.useMemo(()=>({current:{getBoundingClientRect:Oe(()=>DOMRect.fromRect({width:0,height:0,...c}),"getBoundingClientRect")}}),[c]),f=p.useRef(0),h=p.useCallback(()=>window.clearTimeout(f.current),[]),m=Oe(y=>{i.hasInteractedRef.current=!0,u({x:y.clientX,y:y.clientY}),i.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>h,[h]),p.useEffect(()=>void(o&&h()),[o,h]),l.jsxs(l.Fragment,{children:[l.jsx(Pk,{...a,virtualRef:d}),l.jsx(nt.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:le(t.onContextMenu,y=>{h(),m(y),y.preventDefault()}),onPointerDown:o?t.onPointerDown:le(t.onPointerDown,Rr(y=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>m(y),700)})),onPointerMove:o?t.onPointerMove:le(t.onPointerMove,Rr(h)),onPointerCancel:o?t.onPointerCancel:le(t.onPointerCancel,Rr(h)),onPointerUp:o?t.onPointerUp:le(t.onPointerUp,Rr(h))})]})},"ContextMenuTrigger")),Wk=Oe(e=>{const{__scopeContextMenu:t,...n}=e,r=Ye(t);return l.jsx(Tk,{...r,...n})},"ContextMenuPortal"),Kk="ContextMenuContent",zk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=gx(Kk,r),i=Ye(r),a=p.useRef(!1);return l.jsx(Ek,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=t.onCloseAutoFocus)==null||u.call(t,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=t.onInteractOutside)==null||u.call(t,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),Hk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(Mk,{...s,...o,ref:n})},"ContextMenuLabel")),Yk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(Ak,{...s,...o,ref:n})},"ContextMenuItem")),Xk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(Nk,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),qk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(jk,{...s,...o,ref:n})},"ContextMenuRadioGroup")),Zk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(Ik,{...s,...o,ref:n})},"ContextMenuRadioItem")),Qk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(Dk,{...s,...o,ref:n})},"ContextMenuItemIndicator")),Jk=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(kk,{...s,...o,ref:n})},"ContextMenuSeparator")),e_="ContextMenuSub",t_=Oe(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:s}=e,i=Ye(t),[a,c]=Hs({prop:o,defaultProp:s??!1,onChange:r,caller:e_});return l.jsx(_k,{...i,open:a,onOpenChange:c,children:n})},"ContextMenuSub"),n_=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx(Ok,{...s,...o,ref:n})},"ContextMenuSubTrigger")),r_=p.forwardRef(Oe(function(t,n){const{__scopeContextMenu:r,...o}=t,s=Ye(r);return l.jsx($k,{...s,...o,ref:n,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function Rr(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Oe(Rr,"whenTouchOrPen");var o_=Bk,s_=Uk,yx=Wk,i_=zk,a_=Hk,c_=Yk,l_=Xk,u_=qk,d_=Zk,vx=Qk,f_=Jk,h_=t_,p_=n_,m_=r_;const g_=o_,y_=s_,v_=C.forwardRef(function({className:t,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-menu-content",`size-${o}`,t);return l.jsx(yx,{children:l.jsxs(i_,{ref:c,className:u,style:d,alignOffset:s,...a,children:[f,i]})})}),x_=C.forwardRef(function({icon:t,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(c_,{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})]})}),b_=C.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(l_,{ref:s,className:Y("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(vx,{children:l.jsx(Jt,{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})]})}),w_=u_,C_=C.forwardRef(function({shortcut:t,className:n,children:r,...o},s){return l.jsxs(d_,{ref:s,className:Y("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(vx,{children:l.jsx($p,{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})]})}),S_=C.forwardRef(function({className:t,...n},r){return l.jsx(a_,{ref:r,className:Y("cny-menu-label",t),...n})}),R_=C.forwardRef(function({className:t,...n},r){return l.jsx(f_,{ref:r,className:Y("cny-menu-separator",t),...n})}),P_=h_,T_=C.forwardRef(function({icon:t,className:n,children:r,...o},s){return l.jsxs(p_,{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(Yt,{size:13,"aria-hidden":"true"})})]})}),E_=C.forwardRef(function({className:t,...n},r){return l.jsx(yx,{children:l.jsx(m_,{ref:r,className:Y("cny-menu-content",t),...n})})});var[Qs]=Ie("Tooltip",[cn]),Js=cn(),xx="TooltipProvider",M_=700,tc="tooltip.open",[A_,Ll]=Qs(xx),bx=e=>{const{__scopeTooltip:t,delayDuration:n=M_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(A_,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};bx.displayName=xx;var Lr="Tooltip",[N_,io]=Qs(Lr),wx=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ll(Lr,e.__scopeTooltip),u=Js(t),[d,f]=p.useState(null),h=ve(),m=p.useRef(0),y=i??c.disableHoverableContent,g=a??c.delayDuration,v=p.useRef(!1),[x,b]=Ee({prop:r,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(tc))):c.onClose(),s==null||s(T)},caller:Lr}),w=p.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,b(!0)},[b]),R=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),P=p.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,b(!0),m.current=0},g)},[g,b]);return p.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),l.jsx(Xr,{...u,children:l.jsx(N_,{scope:t,contentId:h,open:x,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?P():S()},[c.isOpenDelayedRef,P,S]),onTriggerLeave:p.useCallback(()=>{y?R():(window.clearTimeout(m.current),m.current=0)},[R,y]),onOpen:S,onClose:R,disableHoverableContent:y,children:n})})};wx.displayName=Lr;var nc="TooltipTrigger",Cx=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=io(nc,n),s=Ll(nc,n),i=Js(n),a=p.useRef(null),c=se(t,a,o.onTriggerChange),u=p.useRef(!1),d=p.useRef(!1),f=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(qr,{asChild:!0,...i,children:l.jsx(ee.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:q(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:q(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:q(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:q(e.onBlur,o.onClose),onClick:q(e.onClick,o.onClose)})})});Cx.displayName=nc;var Fl="TooltipPortal",[j_,I_]=Qs(Fl,{forceMount:void 0}),Sx=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=io(Fl,t);return l.jsx(j_,{scope:t,forceMount:n,children:l.jsx(Be,{present:n||s.open,children:l.jsx(fr,{asChild:!0,container:o,children:r})})})};Sx.displayName=Fl;var rr="TooltipContent",Rx=p.forwardRef((e,t)=>{const n=I_(rr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=io(rr,e.__scopeTooltip);return l.jsx(Be,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Px,{side:o,...s,ref:t}):l.jsx(D_,{side:o,...s,ref:t})})}),D_=p.forwardRef((e,t)=>{const n=io(rr,e.__scopeTooltip),r=Ll(rr,e.__scopeTooltip),o=p.useRef(null),s=se(t,o),[i,a]=p.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,h=p.useCallback(()=>{a(null),f(!1)},[f]),m=p.useCallback((y,g)=>{const v=y.currentTarget,x={x:y.clientX,y:y.clientY},b=$_(x,v.getBoundingClientRect()),w=L_(x,b),S=F_(g.getBoundingClientRect()),R=B_([...w,...S]);a(R),f(!0)},[f]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(c&&d){const y=v=>m(v,d),g=v=>m(v,c);return c.addEventListener("pointerleave",y),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",g)}}},[c,d,m,h]),p.useEffect(()=>{if(i){const y=g=>{const v=g.target,x={x:g.clientX,y:g.clientY},b=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),w=!V_(x,i);b?h():w&&(h(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,d,i,u,h]),l.jsx(Px,{...e,ref:s})}),[k_,__]=Qs(Lr,{isInside:!1}),O_=y1("TooltipContent"),Px=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=io(rr,n),u=Js(n),{onClose:d}=c;return p.useEffect(()=>(document.addEventListener(tc,d),()=>document.removeEventListener(tc,d)),[d]),p.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(lr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(Ns,{"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(O_,{children:r}),l.jsx(k_,{scope:n,isInside:!0,children:l.jsx(LE,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Rx.displayName=rr;var Tx="TooltipArrow",Ex=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Js(n);return __(Tx,n).isInside?null:l.jsx(js,{...o,...r,ref:t})});Ex.displayName=Tx;function $_(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 L_(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 F_(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 V_(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 B_(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),G_(t)}function G_(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 U_=bx,Mx=wx,Ax=Cx,Nx=Sx,jx=Rx,W_=Ex;const K_=U_,z_=C.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:m,style:y,styleTag:g}=re(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:t}):l.jsxs(Mx,{delayDuration:i,open:a,children:[l.jsx(Ax,{asChild:!0,children:t}),l.jsx(Nx,{children:l.jsxs(jx,{ref:h,side:r,align:o,sideOffset:s,className:m,style:y,children:[g,n,l.jsx(W_,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),H_=Mx,Y_=Ax,X_=C.forwardRef(function({className:t,...n},r){return l.jsx(Nx,{children:l.jsx(jx,{ref:r,className:Y("cny-tooltip-content",t),...n})})}),q_=Qc,Z_=Jc,Q_=bA,J_=wA,eO=C.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(el,{children:l.jsxs(tl,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(CA,{className:"cny-popover-arrow",width:12,height:6})]})})}),tO=C.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:m,...y},g){const v=!u&&c!=null,{className:x,style:b,styleTag:w}=re(h,f,"cny-chip",t,n,r==="sm"&&"sm",v&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:g,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,onKeyDown:v?S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),c==null||c(S))}:void 0,className:x,style:b,...y,children:[w,s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:m}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:S=>{S.stopPropagation(),i(S)},children:l.jsx(Vt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),nO=C.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},m){const y=typeof t=="number",g=y&&t>r?`${r}+`:t,x=!n&&y&&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:R,style:P,styleTag:T}=re(f,d,"cny-badge","cny-badge-standalone",u);return l.jsxs("span",{ref:m,className:R,style:P,...h,children:[T,x]})}const{className:b,style:w,styleTag:S}=re(f,d,"cny-badge",u);return l.jsxs("span",{ref:m,className:b,style:w,...h,children:[S,c,x]})}),rO=C.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]})}),oO=C.forwardRef(function({className:t,...n},r){return l.jsx("li",{ref:r,className:Y("cny-timeline-item",t),...n})}),sO=C.forwardRef(function({className:t,...n},r){return l.jsx("div",{ref:r,className:Y("cny-timeline-separator",t),...n})}),iO=C.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})}),aO=C.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})}),cO=C.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})}),lO=C.forwardRef(function({className:t,...n},r){return l.jsx("div",{ref:r,className:Y("cny-timeline-opposite-content",t),...n})}),Ix=C.createContext(null);function uO(){const e=C.useContext(Ix);if(!e)throw new Error("TreeItem must be used within a <TreeView>.");return e}const Dx=C.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,...m},y){const[g,v]=C.useState(n??[]),[x,b]=C.useState(s),[w,S]=C.useState(null),R=t??g,P=o!==void 0?o:x,T=C.useMemo(()=>new Set(R),[R]),A=C.useCallback(_=>T.has(_),[T]),E=C.useCallback(_=>{const O=!T.has(_),N=O?[...R,_]:R.filter(j=>j!==_);t===void 0&&v(N),r==null||r(N),a==null||a(_,O)},[R,T,t,r,a]),M=C.useCallback(_=>{o===void 0&&b(_),i==null||i(_)},[o,i]),D=C.useMemo(()=>({isExpanded:A,toggle:E,selectedId:P,select:M,activeId:w,setActive:S,defaultIcons:c}),[A,E,P,M,w,c]),k=C.useRef(null),V=C.useCallback(_=>{k.current=_,typeof y=="function"?y(_):y&&(y.current=_)},[y]);C.useEffect(()=>{var N;if(w!==null)return;const _=(N=k.current)==null?void 0:N.querySelector('[role="treeitem"]'),O=_==null?void 0:_.dataset.treeId;O&&S(O)},[w]);const{className:W,style:Z,styleTag:G}=re(f,d,"cny-tree",u);return l.jsx(Ix.Provider,{value:D,children:l.jsxs("ul",{ref:V,role:"tree",className:W,style:Z,...m,children:[G,h]})})});function dO(e){return e?Array.from(e.querySelectorAll('[role="treeitem"]')):[]}const kx=C.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:m,defaultIcons:y}=uO(),g=!!o,v=g&&c(t),x=d===t,b=h===t,w=r??(y?g?v?l.jsx(SP,{size:16}):l.jsx(PP,{size:16}):l.jsx(wP,{size:16}):null),S=()=>{m(t),f(t),g&&u(t)},R=T=>{T.preventDefault(),T.stopPropagation(),m(t),u(t)},P=T=>{var E;const A=T.currentTarget.closest('[role="tree"]');switch(T.key){case"ArrowRight":if(T.preventDefault(),g&&!v)u(t);else if(v){const M=T.currentTarget.querySelector('[role="treeitem"]');M==null||M.focus()}break;case"ArrowLeft":if(T.preventDefault(),g&&v)u(t);else{const M=(E=T.currentTarget.parentElement)==null?void 0:E.closest('[role="treeitem"]');M==null||M.focus()}break;case"ArrowDown":case"ArrowUp":{T.preventDefault();const M=dO(A),D=M.indexOf(T.currentTarget),k=M[D+(T.key==="ArrowDown"?1:-1)];k==null||k.focus();break}case"Enter":case" ":T.preventDefault(),f(t),g&&u(t);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":t,"aria-expanded":g?v:void 0,"aria-selected":x,tabIndex:b?0:-1,className:Y("cny-tree-item",s),onKeyDown:P,onFocus:T=>{T.target===T.currentTarget&&m(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",v&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:t}`,onClick:R,children:l.jsx(Yt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),w!=null&&l.jsx("span",{className:"cny-tree-icon",children:w}),l.jsx("span",{className:"cny-tree-label",children:n})]}),v&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),fO=C.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(kx,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?c(h):null},f)});return l.jsx(Dx,{ref:a,...i,children:c(t)})});function hO(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 pO(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 _x(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]=C.useState(!1),h=C.useRef(null),m=C.useRef(0),y=C.useMemo(()=>hO(t),[t]),g=y.join(",")||void 0,v=C.useCallback(R=>{const P=[];return pO(R,y)||P.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&R.size>n&&P.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&R.size<r&&P.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),P},[y,n,r]),x=C.useCallback(R=>{if(i||R.length===0)return;const P=[],T=[];if(!o&&R.length>1||typeof s=="number"&&R.length>s)for(const E of R)T.push({file:E,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const E of R){const M=v(E);M.length?T.push({file:E,errors:M}):P.push(E)}a==null||a(P,T),P.length&&(c==null||c(P)),T.length&&(u==null||u(T))},[i,o,s,v,a,c,u]),b=C.useCallback(()=>{var R;i||(R=h.current)==null||R.click()},[i]),w=C.useCallback((R={})=>{const{onClick:P,onKeyDown:T,onDragOver:A,onDragEnter:E,onDragLeave:M,onDrop:D,...k}=R;return{...k,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:V=>{P==null||P(V),i||b()},onKeyDown:V=>{T==null||T(V),(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),b())},onDragOver:V=>{A==null||A(V),V.preventDefault(),i||f(!0)},onDragEnter:V=>{E==null||E(V),V.preventDefault(),!i&&(m.current+=1,f(!0))},onDragLeave:V=>{M==null||M(V),m.current=Math.max(0,m.current-1),m.current===0&&f(!1)},onDrop:V=>{var W;D==null||D(V),V.preventDefault(),m.current=0,f(!1),!i&&x(Array.from(((W=V.dataTransfer)==null?void 0:W.files)??[]))}}},[i,b,x]),S=C.useCallback((R={})=>{const{onChange:P,...T}=R;return{...T,ref:h,type:"file",accept:g,multiple:o,style:{display:"none"},onChange:A=>{P==null||P(A),x(Array.from(A.target.files??[])),A.target.value=""}}},[g,o,x]);return{getRootProps:w,getInputProps:S,open:b,isDragActive:d,inputRef:h}}const mO=C.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:m,className:y,style:g,sx:v},x){const{getRootProps:b,getInputProps:w,isDragActive:S,open:R}=_x({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,onDrop:t}),{className:P,style:T,styleTag:A}=re(v,g,"cny-uploader",`cny-uploader-${a}`,S&&"is-dragging",m&&"is-disabled",y);return l.jsxs("div",{...b(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:P,style:T,children:[A,l.jsx("input",{...w()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(hP,{})}),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(Ir,{type:"button",variant:"outline",size:a==="sm"?"sm":"md",disabled:m,tabIndex:-1,onClick:E=>{E.stopPropagation(),R()},children:i})]})]})}),gO=5;function Cf(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 Sf(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 rc=C.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})}),Ox=C.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})}),yO=C.forwardRef(function({direction:t="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=C.useRef(null),u=C.Children.toArray(s).filter(C.isValidElement),d=u.filter(A=>A.type===rc).map(A=>{const E=A.props;return{min:E.minSize??10,max:E.maxSize??90,def:E.defaultSize??null}}),[f,h]=C.useState(()=>Cf(d)),m=f.length===d.length?f:Cf(d),y=C.useRef(null),g=(A,E)=>{const M=t==="horizontal"?E.clientX:E.clientY;y.current={g:A,start:M,startSizes:m};const D=V=>{var N;const W=y.current,Z=(N=c.current)==null?void 0:N.getBoundingClientRect();if(!W||!Z)return;const G=t==="horizontal"?Z.width:Z.height;if(!G)return;const O=((t==="horizontal"?V.clientX:V.clientY)-W.start)/G*100;h(Sf(W.startSizes,W.g,O,d))},k=()=>{y.current=null,window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",k)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",k)},v=(A,E)=>{h(Sf(m,A,E*gO,d))},x=A=>{c.current=A,typeof a=="function"?a(A):a&&(a.current=A)};let b=-1,w=-1;const S=u.map(A=>{var E,M;if(A.type===rc){b+=1;const D=b,k={...A.props.style,flexBasis:`${m[D]??0}%`,flexGrow:0,flexShrink:0};return C.cloneElement(A,{key:A.key??`panel-${D}`,style:k})}if(A.type===Ox){w+=1;const D=w,k={direction:t,valueNow:Math.round(m[D]??0),valueMin:((E=d[D])==null?void 0:E.min)??0,valueMax:((M=d[D])==null?void 0:M.max)??100,onResizeStart:V=>g(D,V),onKeyResize:V=>v(D,V)};return C.cloneElement(A,{key:A.key??`handle-${D}`,__internal:k})}return A}),{className:R,style:P,styleTag:T}=re(o,r,"cny-panel-group",t==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:R,style:P,...i,children:[T,S]})});function vO(){}function xO(e,t,n,r){if(t<1)return[];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,m,y)=>h.type!=="page"?!0:y.findIndex(g=>g.type==="page"&&g.page===h.page)===m)}const $x=C.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 m=C.useMemo(()=>xO(t,n,o,s),[t,n,o,s]),y=b=>{b<1||b>n||b===t||r(b)},{className:g,style:v,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:v,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>y(t-1),disabled:t<=1,"aria-label":"Previous page",children:l.jsx(Uo,{size:14,"aria-hidden":"true"})}),m.map(b=>b.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(mP,{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:()=>y(b.page),children:b.page},b.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>y(t+1),disabled:t>=n,"aria-label":"Next page",children:l.jsx(Yt,{size:14,"aria-hidden":"true"})})]})}),Qi={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function bO(e){return e.id}function wO(e,t){return!e||e.field!==t?{field:t,sort:"asc"}:e.sort==="asc"?{field:t,sort:"desc"}:null}const CO=C.forwardRef(function({columns:t,rows:n,getRowId:r=bO,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:m,noRowsLabel:y="No rows",disableColumnResize:g=!1,className:v,style:x,sx:b},w){const S=t.length+(c?1:0),R=C.useRef(null),[P,T]=C.useState(null),A=(F,U)=>{var ie;U.preventDefault(),U.stopPropagation();const B={};(ie=R.current)==null||ie.querySelectorAll("thead th[data-field]").forEach(ae=>{const xe=ae.dataset.field;xe&&(B[xe]=ae.getBoundingClientRect().width)});const L=U.clientX,Q=B[F]??0;T(B);const K=ae=>{T({...B,[F]:Math.max(60,Q+(ae.clientX-L))})},z=()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",z)};window.addEventListener("pointermove",K),window.addEventListener("pointerup",z)},E=F=>!g&&F.resizable!==!1,M=u??[],D=new Set(M),k=n.map(F=>r(F)),V=k.length>0&&k.every(F=>D.has(F)),W=k.some(F=>D.has(F)),Z=V?!0:W?"indeterminate":!1,G=()=>{if(d)if(V)d(M.filter(F=>!k.includes(F)));else{const F=new Set(M);k.forEach(U=>F.add(U)),d([...F])}},_=F=>{d&&(D.has(F)?d(M.filter(U=>U!==F)):d([...M,F]))},O=F=>{!F.sortable||!h||h(wO(f,F.field))},N=F=>F.width!=null?{width:F.width,minWidth:F.width}:{flex:F.flex??1},j=()=>{if(!i||s==null)return null;const{page:F,pageSize:U}=i,B=Math.max(1,Math.ceil(s/U)),L=s===0?0:F*U+1,Q=Math.min(s,(F+1)*U);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[L,"–",Q," of ",s]}),l.jsx($x,{page:F+1,pageCount:B,size:"sm",onPageChange:K=>a==null?void 0:a({page:K-1,pageSize:U})})]})},{className:H,style:I,styleTag:X}=re(b,x,"cny-dt",v);return l.jsxs("div",{ref:w,className:H,style:I,children:[X,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:R,className:"cny-dt-table",style:P?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:void 0,children:[P&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:44}}),t.map(F=>l.jsx("col",{style:{width:P[F.field]}},F.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(Va,{checked:Z,onCheckedChange:G,"aria-label":"Select all rows"})}),t.map(F=>{const U=(f==null?void 0:f.field)===F.field,B=F.headerAlign??F.align;return l.jsxs("th",{scope:"col","data-field":F.field,style:P?void 0:N(F),"aria-sort":U?f.sort==="asc"?"ascending":"descending":void 0,className:Y(B&&Qi[B],F.sortable&&"cny-dt-sortable",U&&"is-sorted"),children:[F.sortable?l.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>O(F),children:l.jsxs("span",{className:"cny-dt-th-inner",children:[F.headerName??F.field,l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:U?f.sort==="desc"?l.jsx(Kr,{size:14}):l.jsx(Dp,{size:14}):l.jsx(kp,{size:14})})]})}):l.jsx("span",{className:"cny-dt-th-inner",children:F.headerName??F.field}),E(F)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:L=>L.stopPropagation(),onPointerDown:L=>A(F.field,L)})]},F.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((F,U)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(Pa,{shape:"avatar",width:16,height:16})}),t.map(B=>l.jsx("td",{className:B.align&&Qi[B.align],children:l.jsx(Pa,{width:"70%"})},B.field))]},`sk-${U}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:S,children:y})}):n.map(F=>{const U=r(F),B=D.has(U);return l.jsxs("tr",{className:Y("cny-dt-row",B&&"is-selected",m&&"is-clickable"),onClick:()=>m==null?void 0:m(F),tabIndex:m?0:void 0,onKeyDown:m?L=>{L.target===L.currentTarget&&(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),m(F))}:void 0,children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:L=>L.stopPropagation(),children:l.jsx(Va,{checked:B,onCheckedChange:()=>_(U),"aria-label":`Select row ${String(U)}`})}),t.map(L=>{const Q=L.valueGetter?L.valueGetter({row:F,field:L.field}):F[L.field];return l.jsx("td",{className:L.align&&Qi[L.align],children:L.renderCell?L.renderCell({row:F,value:Q,field:L.field}):Q},L.field)})]},String(U))})})]})}),j()]})}),oc=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Sn(e,t){return t??oc[e%oc.length]}function Vl(e=600){const t=C.useRef(null),[n,r]=C.useState(e);return C.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 Lx(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 SO(e,t,n,r,o,s){const i=(v,x)=>[e+v*Math.sin(x),t-v*Math.cos(x)],a=s-o>Math.PI?1:0,[c,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${e} ${t} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,m]=i(r,s),[y,g]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${m}`,`A ${r} ${r} 0 ${a} 0 ${y} ${g}`,"Z"].join(" ")}function Bl({caption:e,head:t,rows:n}){return l.jsxs("table",{className:"cny-sr-only",children:[l.jsx("caption",{children:e}),l.jsx("thead",{children:l.jsx("tr",{children:t.map((r,o)=>l.jsx("th",{scope:"col",children:r},o))})}),l.jsx("tbody",{children:n.map((r,o)=>l.jsx("tr",{children:r.map((s,i)=>l.jsx("td",{children:s},i))},o))})]})}const De={top:12,right:14,bottom:28,left:40};function RO({data:e,xKey:t,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:a=!0,yTickFormatter:c=y=>String(y),xTickFormatter:u=y=>y,renderTooltip:d,className:f,style:h,sx:m}){const[y,g]=Vl(),[v,x]=C.useState(null),b=Math.max(0,g-De.left-De.right),w=Math.max(0,r-De.top-De.bottom),S=(_,O)=>Number(_[O]??0),R=e.length?Math.max(0,...e.map(_=>s?n.reduce((O,N)=>O+S(_,N.key),0):Math.max(...n.map(O=>S(_,O.key))))):0,{max:P,ticks:T}=Lx(R),A=_=>De.top+w*(1-_/P),E=e.length,M=E?b/E:0,D=M*.68,k=_=>De.left+_*M+(M-D)/2,V=s?D:D/Math.max(1,n.length),{className:W,style:Z,styleTag:G}=re(m,{position:"relative",...h},"cny-chart",f);return l.jsxs("div",{ref:y,className:W,style:Z,children:[G,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":o,children:[i&&T.map(_=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:De.left,x2:g-De.right,y1:A(_),y2:A(_)}),l.jsx("text",{className:"cny-chart-axis",x:De.left-6,y:A(_),dy:"0.32em",textAnchor:"end",children:c(_)})]},_)),e.map((_,O)=>{let N=0;return l.jsx("g",{children:n.map((j,H)=>{const I=S(_,j.key),X=I/P*w;let F,U;return s?(F=k(O),U=A(N+I),N+=I):(F=k(O)+H*V,U=A(I)),l.jsx("rect",{className:"cny-chart-bar",x:F,y:U,width:Math.max(0,V-(s?0:2)),height:Math.max(0,X),rx:2,fill:Sn(H,j.color)},j.key)})},O)}),e.map((_,O)=>{const N=u(String(_[t]??"")),j=`${N}: ${n.map(H=>`${H.label??H.key} ${S(_,H.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:De.left+O*M+M/2,y:r-De.bottom+16,textAnchor:"middle",children:N}),l.jsx("rect",{className:"cny-chart-hit",x:De.left+O*M,y:De.top,width:M,height:w,fill:"transparent",tabIndex:0,"aria-label":j,onMouseEnter:()=>x({index:O,x:De.left+O*M+M/2,y:De.top}),onMouseLeave:()=>x(null),onFocus:()=>x({index:O,x:De.left+O*M+M/2,y:De.top}),onBlur:()=>x(null)})]},`x-${O}`)})]}),l.jsx(Bl,{caption:o,head:[String(t),...n.map(_=>_.label??_.key)],rows:e.map(_=>[u(String(_[t]??"")),...n.map(O=>S(_,O.key))])}),v&&e[v.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${v.x/g*100}%`,top:v.y},children:d?d({label:String(e[v.index][t]),datum:e[v.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(e[v.index][t])}),n.map((_,O)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Sn(O,_.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:_.label??_.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:S(e[v.index],_.key)})]},_.key))]})}),a&&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:Sn(O,_.color)}}),_.label??_.key]},_.key))})]})}const Qe={top:12,right:14,bottom:28,left:40};function Fx({data:e,xKey:t,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:a=!0,grid:c=!0,legend:u=!0,yTickFormatter:d=v=>String(v),xTickFormatter:f=v=>v,renderTooltip:h,className:m,style:y,sx:g}){const[v,x]=Vl(),[b,w]=C.useState(null),S=Math.max(0,x-Qe.left-Qe.right),R=Math.max(0,r-Qe.top-Qe.bottom),P=(N,j)=>Number(N[j]??0),T=e.length?Math.max(0,...e.map(N=>i?n.reduce((j,H)=>j+P(N,H.key),0):Math.max(...n.map(j=>P(N,j.key))))):0,{max:A,ticks:E}=Lx(T),M=N=>Qe.top+R*(1-N/A),D=e.length,k=D?S/D:0,V=N=>Qe.left+N*k+k/2,W=M(0),Z=e.map(()=>0),{className:G,style:_,styleTag:O}=re(g,{position:"relative",...y},"cny-chart",m);return l.jsxs("div",{ref:v,className:G,style:_,children:[O,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,role:"img","aria-label":o,children:[c&&E.map(N=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:Qe.left,x2:x-Qe.right,y1:M(N),y2:M(N)}),l.jsx("text",{className:"cny-chart-axis",x:Qe.left-6,y:M(N),dy:"0.32em",textAnchor:"end",children:d(N)})]},N)),n.map((N,j)=>{const H=Sn(j,N.color),I=e.map((U,B)=>{const L=P(U,N.key),Q=i?Z[B]:0,K=Q+L;return i&&(Z[B]=K),{x:V(B),y:M(K),yBase:M(Q)}});if(I.length===0)return null;const X=I.map(U=>`${U.x},${U.y}`).join(" "),F=`M ${I[0].x} ${i?I[0].yBase:W} `+I.map(U=>`L ${U.x} ${U.y}`).join(" ")+` L ${I[I.length-1].x} ${i?I[I.length-1].yBase:W} Z`;return l.jsxs("g",{children:[s&&l.jsx("path",{className:"cny-chart-area",d:F,fill:H}),l.jsx("polyline",{className:"cny-chart-line",points:X,fill:"none",stroke:H}),a&&I.map((U,B)=>l.jsx("circle",{className:"cny-chart-dot",cx:U.x,cy:U.y,r:3,fill:H},B))]},N.key)}),e.map((N,j)=>{const H=f(String(N[t]??"")),I=`${H}: ${n.map(X=>`${X.label??X.key} ${P(N,X.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:V(j),y:r-Qe.bottom+16,textAnchor:"middle",children:H}),l.jsx("rect",{className:"cny-chart-hit",x:Qe.left+j*k,y:Qe.top,width:k,height:R,fill:"transparent",tabIndex:0,"aria-label":I,onMouseEnter:()=>w({index:j,x:V(j)}),onMouseLeave:()=>w(null),onFocus:()=>w({index:j,x:V(j)}),onBlur:()=>w(null)})]},`x-${j}`)})]}),l.jsx(Bl,{caption:o,head:[String(t),...n.map(N=>N.label??N.key)],rows:e.map(N=>[f(String(N[t]??"")),...n.map(j=>P(N,j.key))])}),b&&e[b.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${b.x/x*100}%`,top:Qe.top},children:h?h({label:String(e[b.index][t]),datum:e[b.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(e[b.index][t])}),n.map((N,j)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Sn(j,N.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:N.label??N.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:P(e[b.index],N.key)})]},N.key))]})}),u&&l.jsx("div",{className:"cny-chart-legend",children:n.map((N,j)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Sn(j,N.color)}}),N.label??N.key]},N.key))})]})}function PO(e){return l.jsx(Fx,{...e,area:!1})}function TO(e){return l.jsx(Fx,{...e,area:!0})}function EO({data:e,height:t=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,renderTooltip:s,centerLabel:i,className:a,style:c,sx:u}){const[d,f]=Vl(360),[h,m]=C.useState(null),y=e.reduce((E,M)=>E+Math.max(0,M.value),0),g=Math.min(f,t),v=f/2,x=t/2,b=g/2*.86,w=r>0?b*r:0;let S=0;const R=e.map((E,M)=>{const D=y>0?Math.max(0,E.value)/y:0,k=S,V=S+D*Math.PI*2;return S=V,{d:E,i:M,start:k,end:V,frac:D,color:Sn(M,E.color)}}),{className:P,style:T,styleTag:A}=re(u,{position:"relative",...c},"cny-chart",a);return l.jsxs("div",{ref:d,className:P,style:T,children:[A,l.jsxs("svg",{width:"100%",height:t,viewBox:`0 0 ${f} ${t}`,role:"img","aria-label":n,children:[R.map(E=>E.frac>=.9999?l.jsx("circle",{className:Y("cny-chart-slice",h===E.i&&"is-active"),cx:v,cy:x,r:w>0?(b+w)/2:b,fill:w>0?"none":E.color,stroke:w>0?E.color:void 0,strokeWidth:w>0?b-w:void 0,tabIndex:0,"aria-label":`${E.d.label}: ${E.d.value} (${Math.round(E.frac*100)}%)`,onMouseEnter:()=>m(E.i),onMouseLeave:()=>m(null),onFocus:()=>m(E.i),onBlur:()=>m(null)},E.i):l.jsx("path",{className:Y("cny-chart-slice",h===E.i&&"is-active"),d:SO(v,x,b,w,E.start,E.end),fill:E.color,tabIndex:0,"aria-label":`${E.d.label}: ${E.d.value} (${Math.round(E.frac*100)}%)`,onMouseEnter:()=>m(E.i),onMouseLeave:()=>m(null),onFocus:()=>m(E.i),onBlur:()=>m(null)},E.i)),i!=null&&w>0&&l.jsx("foreignObject",{x:v-w,y:x-w,width:w*2,height:w*2,children:l.jsx("div",{className:"cny-chart-center",children:i})})]}),l.jsx(Bl,{caption:n,head:["Slice","Value","Share"],rows:R.map(E=>[E.d.label,E.d.value,`${Math.round(E.frac*100)}%`])}),h!=null&&R[h]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:s?s({datum:R[h].d,percent:R[h].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:R[h].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:R[h].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[R[h].d.value," (",Math.round(R[h].frac*100),"%)"]})]})}),o&&l.jsx("div",{className:"cny-chart-legend",children:R.map(E=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:E.color}}),E.d.label]},E.i))})]})}function MO({height:e=300,children:t,className:n,style:r,sx:o}){const s=C.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,C.isValidElement(s)?C.cloneElement(s,{height:e}):s]})}const AO=C.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]})}),NO=C.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},m){const y=u??(i?"a":s?"button":"li"),g=!a&&(i!=null||s!=null),v=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(y,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:g&&y==="div"?0:void 0,className:Y("cny-list-item",c&&"is-active",a&&"is-disabled",g&&"is-interactive",f),...h,children:v});return y==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),jO=C.forwardRef(function({className:t,...n},r){return l.jsx("li",{ref:r,role:"separator",className:Y("cny-list-separator",t),...n})}),IO=C.forwardRef(function({className:t,children:n,...r},o){return l.jsx("li",{ref:o,className:Y("cny-list-subheader",t),...r,children:n})});var ei="Tabs",[DO]=Ie(ei,[sn]),Vx=sn(),[kO,Gl]=DO(ei),Bx=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=on(a),[f,h]=Ee({prop:r,onChange:o,defaultProp:s??"",caller:ei});return l.jsx(kO,{scope:n,baseId:ve(),value:f,onValueChange:h,orientation:i,dir:d,activationMode:c,children:l.jsx(ee.div,{dir:d,"data-orientation":i,...u,ref:t})})});Bx.displayName=ei;var Gx="TabsList",Ux=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Gl(Gx,n),i=Vx(n);return l.jsx(Ss,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(ee.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Ux.displayName=Gx;var Wx="TabsTrigger",Kx=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Gl(Wx,n),a=Vx(n),c=Yx(i.baseId,r),u=Xx(i.baseId,r),d=r===i.value;return l.jsx(Rs,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(ee.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:q(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:q(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:q(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});Kx.displayName=Wx;var zx="TabsContent",Hx=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Gl(zx,n),c=Yx(a.baseId,r),u=Xx(a.baseId,r),d=r===a.value,f=p.useRef(d);return p.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(Be,{present:o||d,children:({present:h})=>l.jsx(ee.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})})});Hx.displayName=zx;function Yx(e,t){return`${e}-trigger-${t}`}function Xx(e,t){return`${e}-content-${t}`}var _O=Bx,OO=Ux,$O=Kx,LO=Hx;const FO=C.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(_O,{ref:c,className:u,style:d,...a,children:[f,i]})}),VO=C.forwardRef(function({className:t,...n},r){return l.jsx(OO,{ref:r,className:Y("cny-tabs-list",t),...n})}),BO=C.forwardRef(function({icon:t,badge:n,className:r,children:o,...s},i){return l.jsxs($O,{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})]})}),GO=C.forwardRef(function({className:t,...n},r){return l.jsx(LO,{ref:r,className:Y("cny-tabs-content",t),...n})});function UO(e){return e.multiple===!0}const WO=C.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:m,"aria-invalid":y,"aria-describedby":g,"aria-label":v,className:x,style:b,sx:w}=t,S=C.useId(),R=m??`cny-ac-${S}`,[P,T]=C.useState(!1),[A,E]=C.useState(""),M=C.useRef(null),D=UO(t),[k,V]=C.useState(!D&&t.defaultValue!==void 0?t.defaultValue??null:null),[W,Z]=C.useState(D&&t.defaultValue!==void 0?t.defaultValue??[]:[]),G=D?t.value!==void 0?t.value:W:(()=>{const B=t.value!==void 0?t.value:k;return B==null?[]:[B]})(),_=C.useCallback(B=>{var L,Q;if(D)t.value===void 0&&Z(B),(L=t.onValueChange)==null||L.call(t,B);else{const K=B[0]??null;t.value===void 0&&V(K),(Q=t.onValueChange)==null||Q.call(t,K)}},[D,t]),O=C.useCallback(B=>{if(!B.disabled)if(D){const L=t.maxItems,Q=G.includes(B.value);let K;if(Q)K=G.filter(z=>z!==B.value);else{if(L!=null&&G.length>=L)return;K=[...G,B.value]}_(K)}else _([B.value]),T(!1)},[_,D,G,t]),N=C.useCallback(B=>{var L;B.stopPropagation(),_([]),(L=M.current)==null||L.focus()},[_]),j=C.useMemo(()=>{const B=new Map;for(const L of r){const Q=L.group??"";B.has(Q)||B.set(Q,[]),B.get(Q).push(L)}return Array.from(B.entries())},[r]),H=B=>{var L;return((L=r.find(Q=>Q.value===B))==null?void 0:L.label)??B},I=G.length===0?o:D?G.length===1?H(G[0]):`${H(G[0])} +${G.length-1}`:H(G[0]),{className:X,style:F,styleTag:U}=re(w,b,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,G.length>0&&"has-value",P&&"is-open",x);return l.jsxs(Qc,{open:P,onOpenChange:T,children:[l.jsx(Jc,{asChild:!0,children:l.jsxs("button",{ref:B=>{M.current=B,typeof n=="function"?n(B):n&&(n.current=B)},type:"button",id:R,className:X,style:F,disabled:f,"aria-label":v,"aria-invalid":y,"aria-describedby":g,"aria-haspopup":"listbox","aria-expanded":P,children:[U,l.jsx("span",{className:Y("cny-ac-value",G.length===0&&"is-placeholder"),children:I}),h&&G.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:N,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),N(B))},onPointerDown:B=>B.stopPropagation(),children:l.jsx(Vt,{size:13,"aria-hidden":"true"})}),l.jsx(kp,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(el,{children:l.jsx(tl,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(Te,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(Te.Input,{value:A,onValueChange:E,placeholder:s})}),l.jsx(Te.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Fp,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(Te.Empty,{className:"cny-ac-empty",children:i},"empty"),j.map(([B,L],Q)=>{const K=L.map((z,ie)=>{const ae=G.includes(z.value);return l.jsxs(Te.Item,{value:`${B} ${z.label} ${z.value}`,disabled:z.disabled,onSelect:()=>O(z),className:Y("cny-ac-item",ae&&"is-checked"),children:[D?l.jsx("span",{className:Y("cny-ac-checkbox",ae&&"is-checked"),children:ae&&l.jsx(Jt,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[z.icon??null,!z.icon&&ae&&l.jsx(Jt,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:z.label}),z.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:z.hint})]},z.value||`opt-${Q}-${ie}`)});return B===""?l.jsx(Te.Group,{children:K},`__ungrouped_${Q}`):l.jsx(Te.Group,{heading:B,children:K},B||`group_${Q}`)})]})})]})})})]})}),KO=C.forwardRef(function({items:t,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Yt,{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((m,y)=>{const g=y===t.length-1,v=l.jsx("span",{className:Y("cny-breadcrumb-label",g&&"is-current"),children:m.label}),x=m.render?m.render(v):m.href&&!g?l.jsx("a",{href:m.href,className:"cny-breadcrumb-link",children:v}):v;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[g?l.jsx("span",{"aria-current":"page",children:v}):x,!g&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},y)})})]})});var ti="Collapsible",[zO,qx]=Ie(ti),[HO,Ul]=zO(ti),Zx=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[c,u]=Ee({prop:r,defaultProp:o??!1,onChange:i,caller:ti});return l.jsx(HO,{scope:n,disabled:s,contentId:ve(),open:c,onOpenToggle:p.useCallback(()=>u(d=>!d),[u]),children:l.jsx(ee.div,{"data-state":Kl(c),"data-disabled":s?"":void 0,...a,ref:t})})});Zx.displayName=ti;var Qx="CollapsibleTrigger",Jx=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Ul(Qx,n);return l.jsx(ee.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Kl(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:q(e.onClick,o.onOpenToggle)})});Jx.displayName=Qx;var Wl="CollapsibleContent",eb=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ul(Wl,e.__scopeCollapsible);return l.jsx(Be,{present:n||o.open,children:({present:s})=>l.jsx(YO,{...r,ref:t,present:s})})});eb.displayName=Wl;var YO=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=Ul(Wl,n),[a,c]=p.useState(r),u=p.useRef(null),d=se(t,u),f=p.useRef(0),h=f.current,m=p.useRef(0),y=m.current,g=i.open||a,v=p.useRef(g),x=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),$e(()=>{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 w=b.getBoundingClientRect();f.current=w.height,m.current=w.width,v.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),c(r)}},[i.open,r]),l.jsx(ee.div,{"data-state":Kl(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":y?`${y}px`:void 0,...e.style},children:g&&o})});function Kl(e){return e?"open":"closed"}var XO=Zx,qO=Jx,ZO=eb,wt="Accordion",QO=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[zl,JO,e$]=Ur(wt),[ni]=Ie(wt,[e$,qx]),Hl=qx(),tb=C.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,s=r;return l.jsx(zl.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(o$,{...s,ref:t}):l.jsx(r$,{...o,ref:t})})});tb.displayName=wt;var[nb,t$]=ni(wt),[rb,n$]=ni(wt,{collapsible:!1}),r$=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:s=!1,...i}=e,[a,c]=Ee({prop:n,defaultProp:r??"",onChange:o,caller:wt});return l.jsx(nb,{scope:e.__scopeAccordion,value:C.useMemo(()=>a?[a]:[],[a]),onItemOpen:c,onItemClose:C.useCallback(()=>s&&c(""),[s,c]),children:l.jsx(rb,{scope:e.__scopeAccordion,collapsible:s,children:l.jsx(ob,{...i,ref:t})})})}),o$=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=Ee({prop:n,defaultProp:r??[],onChange:o,caller:wt}),c=C.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=C.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(nb,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:l.jsx(rb,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(ob,{...s,ref:t})})})}),[s$,ri]=ni(wt),ob=C.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:s="vertical",...i}=e,a=C.useRef(null),c=se(a,t),u=JO(n),f=on(o)==="ltr",h=q(e.onKeyDown,m=>{var A;if(!QO.includes(m.key))return;const y=m.target,g=u().filter(E=>{var M;return!((M=E.ref.current)!=null&&M.disabled)}),v=g.findIndex(E=>E.ref.current===y),x=g.length;if(v===-1)return;m.preventDefault();let b=v;const w=0,S=x-1,R=()=>{b=v+1,b>S&&(b=w)},P=()=>{b=v-1,b<w&&(b=S)};switch(m.key){case"Home":b=w;break;case"End":b=S;break;case"ArrowRight":s==="horizontal"&&(f?R():P());break;case"ArrowDown":s==="vertical"&&R();break;case"ArrowLeft":s==="horizontal"&&(f?P():R());break;case"ArrowUp":s==="vertical"&&P();break}const T=b%x;(A=g[T].ref.current)==null||A.focus()});return l.jsx(s$,{scope:n,disabled:r,direction:o,orientation:s,children:l.jsx(zl.Slot,{scope:n,children:l.jsx(ee.div,{...i,"data-orientation":s,ref:c,onKeyDown:r?void 0:h})})})}),gs="AccordionItem",[i$,Yl]=ni(gs),sb=C.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,s=ri(gs,n),i=t$(gs,n),a=Hl(n),c=ve(),u=r&&i.value.includes(r)||!1,d=s.disabled||e.disabled;return l.jsx(i$,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(XO,{"data-orientation":s.orientation,"data-state":db(u),...a,...o,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(r):i.onItemClose(r)}})})});sb.displayName=gs;var ib="AccordionHeader",ab=C.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ri(wt,n),s=Yl(ib,n);return l.jsx(ee.h3,{"data-orientation":o.orientation,"data-state":db(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});ab.displayName=ib;var sc="AccordionTrigger",cb=C.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ri(wt,n),s=Yl(sc,n),i=n$(sc,n),a=Hl(n);return l.jsx(zl.ItemSlot,{scope:n,children:l.jsx(qO,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:s.triggerId,...a,...r,ref:t})})});cb.displayName=sc;var lb="AccordionContent",ub=C.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=ri(wt,n),s=Yl(lb,n),i=Hl(n);return l.jsx(ZO,{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}})});ub.displayName=lb;function db(e){return e?"open":"closed"}var a$=tb,c$=sb,l$=ab,u$=cb,d$=ub;const f$=C.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(a$,{ref:a,className:c,style:u,...i,children:[d,s]})}),h$=C.forwardRef(function({className:t,...n},r){return l.jsx(c$,{ref:r,className:Y("cny-accordion-item",t),...n})}),p$=C.forwardRef(function({children:t,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(l$,{className:"cny-accordion-header",children:l.jsxs(u$,{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(Kr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),m$=C.forwardRef(function({children:t,className:n,...r},o){return l.jsx(d$,{ref:o,className:Y("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:t})})});var fb=["PageUp","PageDown"],hb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],pb={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},gr="Slider",[ic,g$,y$]=Ur(gr),[mb]=Ie(gr,[y$]),[v$,oi]=mb(gr),gb=p.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:m=!1,form:y,...g}=e,v=p.useRef(new Set),x=p.useRef(0),w=i==="horizontal"?x$:b$,[S=[],R]=Ee({prop:d,defaultProp:u,onChange:D=>{var V;(V=[...v.current][x.current])==null||V.focus(),f(D)}}),P=p.useRef(S);function T(D){const k=P$(S,D);M(D,k)}function A(D){M(D,x.current)}function E(){const D=P.current[x.current];S[x.current]!==D&&h(S)}function M(D,k,{commit:V}={commit:!1}){const W=A$(s),Z=N$(Math.round((D-r)/s)*s+r,W),G=ss(Z,[r,o]);R((_=[])=>{const O=S$(_,G,k);if(M$(O,c*s)){x.current=O.indexOf(G);const N=String(O)!==String(_);return N&&V&&h(O),N?O:_}else return _})}return l.jsx(v$,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:o,valueIndexToChangeRef:x,thumbs:v.current,values:S,orientation:i,form:y,children:l.jsx(ic.Provider,{scope:e.__scopeSlider,children:l.jsx(ic.Slot,{scope:e.__scopeSlider,children:l.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:q(g.onPointerDown,()=>{a||(P.current=S)}),min:r,max:o,inverted:m,onSlideStart:a?void 0:T,onSlideMove:a?void 0:A,onSlideEnd:a?void 0:E,onHomeKeyDown:()=>!a&&M(r,0,{commit:!0}),onEndKeyDown:()=>!a&&M(o,S.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:k})=>{if(!a){const Z=fb.includes(D.key)||D.shiftKey&&hb.includes(D.key)?10:1,G=x.current,_=S[G],O=s*Z*k;M(_+O,G,{commit:!0})}}})})})})});gb.displayName=gr;var[yb,vb]=mb(gr,{startEdge:"left",endEdge:"right",size:"width",direction:1}),x$=p.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=p.useState(null),m=se(t,w=>h(w)),y=p.useRef(void 0),g=on(o),v=g==="ltr",x=v&&!s||!v&&s;function b(w){const S=y.current||f.getBoundingClientRect(),R=[0,S.width],T=Xl(R,x?[n,r]:[r,n]);return y.current=S,T(w-S.left)}return l.jsx(yb,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:l.jsx(xb,{dir:g,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=b(w.clientX);i==null||i(S)},onSlideMove:w=>{const S=b(w.clientX);a==null||a(S)},onSlideEnd:()=>{y.current=void 0,c==null||c()},onStepKeyDown:w=>{const R=pb[x?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:R?-1:1})}})})}),b$=p.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onStepKeyDown:c,...u}=e,d=p.useRef(null),f=se(t,d),h=p.useRef(void 0),m=!o;function y(g){const v=h.current||d.current.getBoundingClientRect(),x=[0,v.height],w=Xl(x,m?[r,n]:[n,r]);return h.current=v,w(g-v.top)}return l.jsx(yb,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:l.jsx(xb,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const v=y(g.clientY);s==null||s(v)},onSlideMove:g=>{const v=y(g.clientY);i==null||i(v)},onSlideEnd:()=>{h.current=void 0,a==null||a()},onStepKeyDown:g=>{const x=pb[m?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:x?-1:1})}})})}),xb=p.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:a,onStepKeyDown:c,...u}=e,d=oi(gr,n);return l.jsx(ee.span,{...u,ref:t,onKeyDown:q(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(a(f),f.preventDefault()):fb.concat(hb).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:q(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:q(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&o(f)}),onPointerUp:q(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),bb="SliderTrack",wb=p.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=oi(bb,n);return l.jsx(ee.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});wb.displayName=bb;var ac="SliderRange",Cb=p.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=oi(ac,n),s=vb(ac,n),i=p.useRef(null),a=se(t,i),c=o.values.length,u=o.values.map(h=>Pb(h,o.min,o.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return l.jsx(ee.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:f+"%"}})});Cb.displayName=ac;var cc="SliderThumb",Sb=p.forwardRef((e,t)=>{const n=g$(e.__scopeSlider),[r,o]=p.useState(null),s=se(t,a=>o(a)),i=p.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return l.jsx(w$,{...e,ref:s,index:i})}),w$=p.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...s}=e,i=oi(cc,n),a=vb(cc,n),[c,u]=p.useState(null),d=se(t,b=>u(b)),f=c?i.form||!!c.closest("form"):!0,h=Yr(c),m=i.values[r],y=m===void 0?0:Pb(m,i.min,i.max),g=R$(r,i.values.length),v=h==null?void 0:h[a.size],x=v?T$(v,y,a.direction):0;return p.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(${y}% + ${x}px)`},children:[l.jsx(ic.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(ee.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":i.min,"aria-valuenow":m,"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:m===void 0?{display:"none"}:e.style,onFocus:q(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),f&&l.jsx(Rb,{name:o??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:m},r)]})});Sb.displayName=cc;var C$="RadioBubbleInput",Rb=p.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=p.useRef(null),s=se(o,r),i=Zr(t);return p.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(ee.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});Rb.displayName=C$;function S$(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,s)=>o-s)}function Pb(e,t,n){const s=100/(n-t)*(e-t);return ss(s,[0,100])}function R$(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function P$(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 T$(e,t,n){const r=e/2,s=Xl([0,50],[0,r]);return(r-s(t)*n)*n}function E$(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function M$(e,t){if(t>0){const n=E$(e);return Math.min(...n)>=t}return!0}function Xl(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 A$(e){return(String(e).split(".")[1]||"").length}function N$(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var j$=gb,I$=wb,D$=Cb,k$=Sb;const _$=C.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],m=a??(x=>x),{className:y,style:g,styleTag:v}=re(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,t);return l.jsxs(j$,{ref:f,className:y,style:g,value:c,defaultValue:u,...d,children:[v,l.jsx(I$,{className:"cny-slider-track",children:l.jsx(D$,{className:"cny-slider-range"})}),h.map((x,b)=>l.jsx(k$,{className:"cny-slider-thumb","aria-label":`Value ${b+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:m(x)})},b))]})}),O$=C.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:m}=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:[m,t.map((y,g)=>{const v=g<n?"complete":g===n?"active":"upcoming",x=v==="complete"&&!!s;return l.jsxs("li",{className:Y("cny-stepper-step",`is-${v}`),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":v==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:v==="complete"?l.jsx(Jt,{size:14}):y.icon??g+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:y.label}),y.description&&l.jsx("span",{className:"cny-stepper-desc",children:y.description})]})]}),g<t.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},g)})]})}),$$=C.forwardRef(function({size:t=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const a=C.useId().replace(/[^a-zA-Z0-9_-]/g,""),c=`cny-loader-fade-reveal-${a}`,u=`cny-loader-${a}`;return l.jsxs("div",{ref:i,className:Y("cny-loader",u,r),style:{width:t,height:t*(24/21.635),color:n,...o},...s,children:[l.jsx("style",{children:`
213
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return p.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},WE="DialogDescriptionWarning",HE=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ng(WE).contentName}}.`;return p.useEffect(()=>{var s;const o=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&o&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},KE=Hm,YE=Xm,XE=qm,qE=Zm,Cr='[cmdk-group=""]',$i='[cmdk-group-items=""]',ZE='[cmdk-group-heading=""]',rg='[cmdk-item=""]',Hd=`${rg}:not([aria-disabled="true"])`,ka="cmdk-item-select",Hn="data-value",QE=(t,e,n)=>iE(t,e,n),og=p.createContext(void 0),oo=()=>p.useContext(og),sg=p.createContext(void 0),Xc=()=>p.useContext(sg),ig=p.createContext(void 0),ag=p.forwardRef((t,e)=>{let n=Kn(()=>{var A,G;return{search:"",value:(G=(A=t.value)!=null?A:t.defaultValue)!=null?G:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Kn(()=>new Set),o=Kn(()=>new Map),s=Kn(()=>new Map),i=Kn(()=>new Set),a=cg(t),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:y,disablePointerSelection:g=!1,vimBindings:v=!0,...x}=t,w=Vt(),b=Vt(),C=Vt(),P=p.useRef(null),R=lj();Nn(()=>{if(d!==void 0){let A=d.trim();n.current.value=A,M.emit()}},[d]),Nn(()=>{R(6,F)},[]);let M=p.useMemo(()=>({subscribe:A=>(i.current.add(A),()=>i.current.delete(A)),snapshot:()=>n.current,setState:(A,G,O)=>{var V,B,X,K;if(!Object.is(n.current[A],G)){if(n.current[A]=G,A==="search")_(),E(),R(1,N);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let W=document.getElementById(C);W?W.focus():(V=document.getElementById(w))==null||V.focus()}if(R(7,()=>{var W;n.current.selectedItemId=(W=U())==null?void 0:W.id,M.emit()}),O||R(5,F),((B=a.current)==null?void 0:B.value)!==void 0){let W=G??"";(K=(X=a.current).onValueChange)==null||K.call(X,W);return}}M.emit()}},emit:()=>{i.current.forEach(A=>A())}}),[]),j=p.useMemo(()=>({value:(A,G,O)=>{var V;G!==((V=s.current.get(A))==null?void 0:V.value)&&(s.current.set(A,{value:G,keywords:O}),n.current.filtered.items.set(A,T(G,O)),R(2,()=>{E(),M.emit()}))},item:(A,G)=>(r.current.add(A),G&&(o.current.has(G)?o.current.get(G).add(A):o.current.set(G,new Set([A]))),R(3,()=>{_(),E(),n.current.value||N(),M.emit()}),()=>{s.current.delete(A),r.current.delete(A),n.current.filtered.items.delete(A);let O=U();R(4,()=>{_(),(O==null?void 0:O.getAttribute("id"))===A&&N(),M.emit()})}),group:A=>(o.current.has(A)||o.current.set(A,new Set),()=>{s.current.delete(A),o.current.delete(A)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:b,listInnerRef:P}),[]);function T(A,G){var O,V;let B=(V=(O=a.current)==null?void 0:O.filter)!=null?V:QE;return A?B(A,n.current.search,G):0}function E(){if(!n.current.search||a.current.shouldFilter===!1)return;let A=n.current.filtered.items,G=[];n.current.filtered.groups.forEach(V=>{let B=o.current.get(V),X=0;B.forEach(K=>{let W=A.get(K);X=Math.max(W,X)}),G.push([V,X])});let O=P.current;J().sort((V,B)=>{var X,K;let W=V.getAttribute("id"),Z=B.getAttribute("id");return((X=A.get(Z))!=null?X:0)-((K=A.get(W))!=null?K:0)}).forEach(V=>{let B=V.closest($i);B?B.appendChild(V.parentElement===B?V:V.closest(`${$i} > *`)):O.appendChild(V.parentElement===O?V:V.closest(`${$i} > *`))}),G.sort((V,B)=>B[1]-V[1]).forEach(V=>{var B;let X=(B=P.current)==null?void 0:B.querySelector(`${Cr}[${Hn}="${encodeURIComponent(V[0])}"]`);X==null||X.parentElement.appendChild(X)})}function N(){let A=J().find(O=>O.getAttribute("aria-disabled")!=="true"),G=A==null?void 0:A.getAttribute(Hn);M.setState("value",G||void 0)}function _(){var A,G,O,V;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 X of r.current){let K=(G=(A=s.current.get(X))==null?void 0:A.value)!=null?G:"",W=(V=(O=s.current.get(X))==null?void 0:O.keywords)!=null?V:[],Z=T(K,W);n.current.filtered.items.set(X,Z),Z>0&&B++}for(let[X,K]of o.current)for(let W of K)if(n.current.filtered.items.get(W)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=B}function F(){var A,G,O;let V=U();V&&(((A=V.parentElement)==null?void 0:A.firstChild)===V&&((O=(G=V.closest(Cr))==null?void 0:G.querySelector(ZE))==null||O.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function U(){var A;return(A=P.current)==null?void 0:A.querySelector(`${rg}[aria-selected="true"]`)}function J(){var A;return Array.from(((A=P.current)==null?void 0:A.querySelectorAll(Hd))||[])}function z(A){let G=J()[A];G&&M.setState("value",G.getAttribute(Hn))}function I(A){var G;let O=U(),V=J(),B=V.findIndex(K=>K===O),X=V[B+A];(G=a.current)!=null&&G.loop&&(X=B+A<0?V[V.length-1]:B+A===V.length?V[0]:V[B+A]),X&&M.setState("value",X.getAttribute(Hn))}function L(A){let G=U(),O=G==null?void 0:G.closest(Cr),V;for(;O&&!V;)O=A>0?aj(O,Cr):cj(O,Cr),V=O==null?void 0:O.querySelector(Hd);V?M.setState("value",V.getAttribute(Hn)):I(A)}let $=()=>z(J().length-1),D=A=>{A.preventDefault(),A.metaKey?$():A.altKey?L(1):I(1)},q=A=>{A.preventDefault(),A.metaKey?z(0):A.altKey?L(-1):I(-1)};return p.createElement(Ke.div,{ref:e,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:A=>{var G;(G=x.onKeyDown)==null||G.call(x,A);let O=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||O))switch(A.key){case"n":case"j":{v&&A.ctrlKey&&D(A);break}case"ArrowDown":{D(A);break}case"p":case"k":{v&&A.ctrlKey&&q(A);break}case"ArrowUp":{q(A);break}case"Home":{A.preventDefault(),z(0);break}case"End":{A.preventDefault(),$();break}case"Enter":{A.preventDefault();let V=U();if(V){let B=new Event(ka);V.dispatchEvent(B)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:dj},c),_s(t,A=>p.createElement(sg.Provider,{value:M},p.createElement(og.Provider,{value:j},A))))}),JE=p.forwardRef((t,e)=>{var n,r;let o=Vt(),s=p.useRef(null),i=p.useContext(ig),a=oo(),c=cg(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Nn(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=lg(o,s,[t.value,t.children,s],t.keywords),f=Xc(),h=dn(R=>R.value&&R.value===d.current),m=dn(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);p.useEffect(()=>{let R=s.current;if(!(!R||t.disabled))return R.addEventListener(ka,y),()=>R.removeEventListener(ka,y)},[m,t.onSelect,t.disabled]);function y(){var R,M;g(),(M=(R=c.current).onSelect)==null||M.call(R,d.current)}function g(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:w,forceMount:b,keywords:C,...P}=t;return p.createElement(Ke.div,{ref:Dn(s,e),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:g,onClick:v?void 0:y},t.children)}),ej=p.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...s}=t,i=Vt(),a=p.useRef(null),c=p.useRef(null),u=Vt(),d=oo(),f=dn(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);Nn(()=>d.group(i),[]),lg(i,a,[t.value,t.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(Ke.div,{ref:Dn(a,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),_s(t,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(ig.Provider,{value:h},m))))}),tj=p.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=p.useRef(null),s=dn(i=>!i.search);return!n&&!s?null:p.createElement(Ke.div,{ref:Dn(o,e),...r,"cmdk-separator":"",role:"separator"})}),nj=p.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,s=Xc(),i=dn(u=>u.search),a=dn(u=>u.selectedItemId),c=oo();return p.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),p.createElement(Ke.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?t.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),rj=p.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,s=p.useRef(null),i=p.useRef(null),a=dn(u=>u.selectedItemId),c=oo();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(Ke.div,{ref:Dn(s,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},_s(t,u=>p.createElement("div",{ref:Dn(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),oj=p.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=t;return p.createElement(KE,{open:n,onOpenChange:r},p.createElement(YE,{container:i},p.createElement(XE,{"cmdk-overlay":"",className:o}),p.createElement(qE,{"aria-label":t.label,"cmdk-dialog":"",className:s},p.createElement(ag,{ref:e,...a}))))}),sj=p.forwardRef((t,e)=>dn(n=>n.filtered.count===0)?p.createElement(Ke.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),ij=p.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...s}=t;return p.createElement(Ke.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},_s(t,i=>p.createElement("div",{"aria-hidden":!0},i)))}),je=Object.assign(ag,{List:rj,Item:JE,Input:nj,Group:ej,Separator:tj,Dialog:oj,Empty:sj,Loading:ij});function aj(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function cj(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function cg(t){let e=p.useRef(t);return Nn(()=>{e.current=t}),e}var Nn=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Kn(t){let e=p.useRef();return e.current===void 0&&(e.current=t()),e}function dn(t){let e=Xc(),n=()=>t(e.snapshot());return p.useSyncExternalStore(e.subscribe,n,n)}function lg(t,e,n,r=[]){let o=p.useRef(),s=oo();return Nn(()=>{var i;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(t,a,c),(i=e.current)==null||i.setAttribute(Hn,a),o.current=a}),o}var lj=()=>{let[t,e]=p.useState(),n=Kn(()=>new Map);return Nn(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function uj(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function _s({asChild:t,children:e},n){return t&&p.isValidElement(e)?p.cloneElement(uj(e),{ref:e.ref},n(e.props.children)):n(e)}var dj={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function fj({options:t,value:e,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:u="primary",disabled:d=!1,id:f,className:h,style:m,sx:y,"aria-invalid":g,"aria-describedby":v,"aria-label":x}){const[w,b]=S.useState(!1),[C,P]=S.useState(n??[]),[R,M]=S.useState(""),j=S.useRef(null),T=e??C,E=S.useCallback(D=>{e===void 0&&P(D),r==null||r(D)},[e,r]),N=S.useCallback(D=>{T.includes(D)?E(T.filter(q=>q!==D)):(a==null||T.length<a)&&E([...T,D])},[T,E,a]),_=S.useCallback(D=>E(T.filter(q=>q!==D)),[T,E]),F=S.useMemo(()=>{const D=new Map;for(const q of t)D.set(q.value,q);return D},[t]),U=S.useMemo(()=>{const D=new Map;for(const q of t){const A=q.group??"";D.has(A)||D.set(A,[]),D.get(A).push(q)}return D},[t]),J=D=>{D.key==="Backspace"&&R===""&&T.length>0&&(D.preventDefault(),_(T[T.length-1]))};S.useEffect(()=>{w&&queueMicrotask(()=>{var D;return(D=j.current)==null?void 0:D.focus()})},[w]);const{className:z,style:I,styleTag:L}=re(y,m,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),$=a!=null&&T.length>=a;return l.jsxs(Gc,{open:w,onOpenChange:D=>!d&&b(D),children:[l.jsx(Uc,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-invalid":g,"aria-describedby":v,"aria-label":x,"data-state":w?"open":"closed","data-disabled":d||void 0,id:f,className:z,style:I,onClick:()=>!d&&b(D=>!D),tabIndex:d?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!w&&(D.preventDefault(),b(!0))},children:[L,T.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(D=>{const q=F.get(D);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(q==null?void 0:q.label)??D}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(q==null?void 0:q.label)??D}`,onClick:A=>{A.stopPropagation(),_(D)},children:l.jsx(Yt,{size:12,"aria-hidden":"true"})})]},D)}),l.jsx(Xr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(zc,{children:l.jsx(Wc,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:l.jsxs(je,{shouldFilter:!0,label:"Options",children:[l.jsx(je.Input,{ref:j,placeholder:s,value:R,onValueChange:M,onKeyDown:J}),l.jsxs(je.List,{children:[l.jsx(je.Empty,{children:i}),Array.from(U.entries()).map(([D,q])=>l.jsx(je.Group,{heading:D||void 0,children:q.map(A=>{const G=T.includes(A.value),O=A.disabled||!G&&$;return l.jsxs(je.Item,{value:`${A.label} ${A.description??""} ${A.value}`,disabled:O,onSelect:()=>N(A.value),children:[A.icon&&l.jsx("span",{style:{display:"inline-flex"},children:A.icon}),l.jsx("span",{children:A.label}),A.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:A.description}),G&&l.jsx("span",{className:"cny-check",children:l.jsx(cn,{size:14,"aria-hidden":"true"})})]},A.value)})},D||"default"))]})]})})})]})}var hj=Object.defineProperty,Ht=(t,e)=>hj(t,"name",{value:e,configurable:!0}),qc="Checkbox",[pj,A2]=Ce(qc),[mj,Zc]=pj(qc);function ug(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=be({prop:n,defaultProp:o??!1,onChange:c,caller:qc}),[y,g]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=y?!!i||!!y.closest("form"):!0,R={checked:h,disabled:s,setChecked:m,control:y,setControl:g,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:Bt(o)?!1:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(mj,{scope:e,...R,children:dg(f)?f(R):r})}Ht(ug,"CheckboxProvider");var gj="CheckboxTrigger",yj=p.forwardRef(Ht(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},s){const{control:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:y,isFormControl:g,bubbleInput:v}=Zc(gj,e),x=oe(s,f),w=p.useRef(u);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const C=Ht(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[i,h]),l.jsx(ne.button,{type:"button",role:"checkbox","aria-checked":Bt(u)?"mixed":u,"aria-required":d,"data-state":Qc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:x,onKeyDown:H(n,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:H(r,b=>{y(),h(C=>Bt(C)?!0:!C),v&&g&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"CheckboxTrigger")),Kd=p.forwardRef(Ht(function(e,n){const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(ug,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(yj,{...h,ref:n,__scopeCheckbox:r}),m&&l.jsx(wj,{__scopeCheckbox:r})]})})},"Checkbox")),vj="CheckboxIndicator",xj=p.forwardRef(Ht(function(e,n){const{__scopeCheckbox:r,forceMount:o,...s}=e,i=Zc(vj,r);return l.jsx(Ge,{present:o||Bt(i.checked)||i.checked===!0,children:l.jsx(ne.span,{"data-state":Qc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),bj="CheckboxBubbleInput",wj=p.forwardRef(Ht(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:y,bubbleInput:g,setBubbleInput:v}=Zc(bj,e),x=oe(o,v),w=gr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=g;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,N=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const F=!(N&&i.current);if(_&&E){b.current=!N;const U=new Event("click",{bubbles:F});M.indeterminate=Bt(c),E.call(M,Bt(c)?!1:c),M.dispatchEvent(U),b.current=!1}},[g,c,i,a]);const R=p.useRef(Bt(c)?!1:c);return l.jsx(ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:y,...r,tabIndex:-1,ref:x,onClick:H(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function dg(t){return typeof t=="function"}Ht(dg,"isFunction");function Bt(t){return t==="indeterminate"}Ht(Bt,"isIndeterminate");function Qc(t){return Bt(t)?"indeterminate":t?"checked":"unchecked"}Ht(Qc,"getState");const _a=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){const a=l.jsx(xj,{children:s.checked==="indeterminate"?l.jsx(jP,{size:12,"aria-hidden":"true"}):l.jsx(cn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:m}=re(r,n,"checkbox",e);return l.jsxs(Kd,{ref:i,className:f,style:h,...s,children:[m,a]})}const{className:c,style:u,styleTag:d}=re(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(Kd,{ref:i,className:Y("checkbox",e),...s,children:a}),l.jsx("span",{children:o})]})});var Cj=Object.defineProperty,Be=(t,e)=>Cj(t,"name",{value:e,configurable:!0}),fg="Radio",[Sj,hg]=Ce(fg),[Pj,Os]=Sj(fg);function pg(t){const{__scopeRadio:e,checked:n=!1,children:r,disabled:o,form:s,name:i,onCheck:a,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=p.useState(null),[m,y]=p.useState(null),g=p.useRef(!1),[v,x]=p.useReducer(C=>C+1,0),w=f?!!s||!!f.closest("form"):!0,b={checked:n,disabled:o,required:c,name:i,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:g,userInteractionCount:v,onUserInteraction:x,isFormControl:w,bubbleInput:m,setBubbleInput:y,onCheck:Be(()=>a==null?void 0:a(),"onCheck")};return l.jsx(Pj,{scope:e,...b,children:mg(d)?d(b):r})}Be(pg,"RadioProvider");var Rj="RadioTrigger",Tj=p.forwardRef(Be(function({__scopeRadio:e,onClick:n,...r},o){const{checked:s,disabled:i,value:a,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=Os(Rj,e),y=oe(o,c);return l.jsx(ne.button,{type:"button",role:"radio","aria-checked":s,"data-state":Jc(s),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:y,onClick:H(n,g=>{s||(f(),u()),m&&h&&(d.current=g.isPropagationStopped(),d.current||g.stopPropagation())})})},"RadioTrigger")),Mj="RadioIndicator",Ej=p.forwardRef(Be(function(e,n){const{__scopeRadio:r,forceMount:o,...s}=e,i=Os(Mj,r);return l.jsx(Ge,{present:o||i.checked,children:l.jsx(ne.span,{"data-state":Jc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),jj="RadioBubbleInput",Aj=p.forwardRef(Be(function({__scopeRadio:e,onClick:n,...r},o){const{control:s,checked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:y,userInteractionCount:g}=Os(jj,e),v=oe(o,m),x=gr(s),w=p.useRef(!1),b=p.useRef(i),C=p.useRef(g);p.useEffect(()=>{const R=h;if(!R)return;const M=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(M,"checked").set,E=g!==C.current;C.current=g;const N=b.current!==i;b.current=i;const _=!(E&&y.current);if(N&&T){w.current=!E;const F=new Event("click",{bubbles:_});T.call(R,i),R.dispatchEvent(F),w.current=!1}},[h,i,y,g]);const P=p.useRef(i);return l.jsx(ne.input,{type:"radio","aria-hidden":!0,defaultChecked:P.current,required:a,disabled:c,name:u,value:d,form:f,...r,tabIndex:-1,ref:v,onClick:H(n,R=>{w.current&&R.stopPropagation()}),style:{...r.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function mg(t){return typeof t=="function"}Be(mg,"isFunction");function Jc(t){return t?"checked":"unchecked"}Be(Jc,"getState");var Dj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],el="RadioGroup",[Ij,D2]=Ce(el,[pn,hg]),gg=pn(),$s=hg(),[Nj,kj]=Ij(el),_j=p.forwardRef(Be(function(e,n){const{__scopeRadioGroup:r,name:o,form:s,defaultValue:i,value:a,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...y}=e,g=gg(r),v=Kt(f),[x,w]=be({prop:a,defaultProp:i??null,onChange:m,caller:el}),[b,C]=p.useState(null),P=oe(n,C),R=p.useRef(x);return p.useEffect(()=>{const M=s?b==null?void 0:b.ownerDocument.getElementById(s):b==null?void 0:b.closest("form");if(M instanceof HTMLFormElement){const j=Be(()=>w(R.current),"reset");return M.addEventListener("reset",j),()=>M.removeEventListener("reset",j)}},[b,s,w]),l.jsx(Nj,{scope:r,name:o,form:s,required:c,disabled:u,value:x,onValueChange:w,children:l.jsx(ws,{asChild:!0,...g,orientation:d,dir:v,loop:h,children:l.jsx(ne.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...y,ref:P})})})},"RadioGroup")),Oj="RadioGroupItemProvider",$j="RadioGroupItemTrigger";function yg(t){const{__scopeRadioGroup:e,value:n,disabled:r,children:o,internal_do_not_use_render:s}=t,i=kj(Oj,e),a=$s(e),c=i.disabled||r;return l.jsx(pg,{...a,checked:i.value===n,disabled:c,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:s,children:o})}Be(yg,"RadioGroupItemProvider");var Lj=p.forwardRef(Be(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=gg(r),i=$s(r),{checked:a,disabled:c}=Os($j,i.__scopeRadio),u=p.useRef(null),d=oe(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=Be(y=>{Dj.includes(y.key)&&(f.current=!0)},"handleKeyDown"),m=Be(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),l.jsx(Cs,{asChild:!0,...s,focusable:!c,active:a,children:l.jsx(Tj,{...i,...o,ref:d,onKeyDown:H(o.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:H(o.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),Yd=p.forwardRef(Be(function(e,n){const{__scopeRadioGroup:r,value:o,disabled:s,...i}=e;return l.jsx(yg,{__scopeRadioGroup:r,value:o,disabled:s,internal_do_not_use_render:({isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(Lj,{...i,ref:n,__scopeRadioGroup:r}),a&&l.jsx(Fj,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),Fj=p.forwardRef(Be(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=$s(r);return l.jsx(Aj,{...s,...o,ref:n})},"RadioGroupItemBubbleInput")),Xd=p.forwardRef(Be(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=$s(r);return l.jsx(Ej,{...s,...o,ref:n})},"RadioGroupIndicator"));const Vj=S.forwardRef(function({orientation:e="vertical",className:n,style:r,...o},s){return l.jsx(_j,{ref:s,className:Y("cny-radio-group",e==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),Bj=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=re(r,n,"radio",e);return l.jsxs(Yd,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Xd,{})]})}const{className:a,style:c,styleTag:u}=re(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Yd,{ref:i,className:Y("radio",e),...s,children:l.jsx(Xd,{})}),l.jsx("span",{children:o})]})});var Gj=Object.defineProperty,fn=(t,e)=>Gj(t,"name",{value:e,configurable:!0}),tl="Switch",[Uj,I2]=Ce(tl),[zj,nl]=Uj(tl);function vg(t){const{__scopeSwitch:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=be({prop:n,defaultProp:o??!1,onChange:c,caller:tl}),[y,g]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=y?!!i||!!y.closest("form"):!0,R={checked:h,setChecked:m,disabled:s,control:y,setControl:g,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(zj,{scope:e,...R,children:xg(f)?f(R):r})}fn(vg,"SwitchProvider");var Wj="SwitchTrigger",Hj=p.forwardRef(fn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,form:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:y,isFormControl:g,bubbleInput:v}=nl(Wj,e),x=oe(o,f),w=p.useRef(u);return p.useEffect(()=>{const b=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(b instanceof HTMLFormElement){const C=fn(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[s,i,h]),l.jsx(ne.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":rl(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:x,onClick:H(n,b=>{y(),h(C=>!C),v&&g&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"SwitchTrigger")),qd=p.forwardRef(fn(function(e,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(vg,{__scopeSwitch:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(Hj,{...h,ref:n,__scopeSwitch:r}),m&&l.jsx(Xj,{__scopeSwitch:r})]})})},"Switch")),Kj="SwitchThumb",Zd=p.forwardRef(fn(function(e,n){const{__scopeSwitch:r,...o}=e,s=nl(Kj,r);return l.jsx(ne.span,{"data-state":rl(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),Yj="SwitchBubbleInput",Xj=p.forwardRef(fn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:y,bubbleInput:g,setBubbleInput:v}=nl(Yj,e),x=oe(o,v),w=gr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=g;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,N=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const F=!(N&&i.current);if(_&&E){b.current=!N;const U=new Event("click",{bubbles:F});E.call(M,c),M.dispatchEvent(U),b.current=!1}},[g,c,i,a]);const R=p.useRef(c);return l.jsx(ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:y,...r,tabIndex:-1,ref:x,onClick:H(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function xg(t){return typeof t=="function"}fn(xg,"isFunction");function rl(t){return t?"checked":"unchecked"}fn(rl,"getState");const qj=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=re(r,n,"switch",e);return l.jsxs(qd,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Zd,{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(qd,{ref:i,className:Y("switch",e),...s,children:l.jsx(Zd,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function Qo(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Qd(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function Io(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Li(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function Zj(t,e){return t.getFullYear()===e.getFullYear()}function Mt(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Qj(t){return new Date(t.getFullYear(),0,1)}function Jd(t){return new Date(Math.floor(t.getFullYear()/10)*10,0,1)}function No(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function hs(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Rt(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}function Fi(t,e,n,r=0){const o=new Date(t);return o.setHours(e,n,r,0),o}function Ue(t,e,n){return e&&t.getTime()<e.getTime()?new Date(e):n&&t.getTime()>n.getTime()?new Date(n):t}function Jj(t,e){const n=Mt(t),r=(n.getDay()-e+7)%7,o=hs(n,-r);return Array.from({length:42},(s,i)=>hs(o,i))}function eA(t,e){const n=new Intl.DateTimeFormat(t,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=hs(r,(s+e)%7);return n.format(i)})}function tA(t,e="short"){const n=new Intl.DateTimeFormat(t,{month:e});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function ef(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function nA(t,e){return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function rA(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function bg(t,e){return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}function wg(t,e,n,r){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(t)}function oA(t,e,n,r){return`${bg(t,e)} · ${wg(t,e,n,r)}`}function ko(t){if(t==null||t==="")return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:new Date(t);const e=new Date(t);return Number.isNaN(e.getTime())?null:e}function _o(t,e){return t.getTime()<e.getTime()}function Oo(t,e){return t.getTime()>e.getTime()}function $o(t){return t<10?`0${t}`:String(t)}function sA(t){return t||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function iA(t){try{return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function aA(t,e,n,r,o){switch(e){case"year":return nA(t,n);case"month":return rA(t,n);case"time":return wg(t,n,r,o);case"datetime":return oA(t,n,r,o);case"date":default:return bg(t,n)}}function cA(t,e){switch(e){case"year":return Qj(t);case"month":return Mt(t);case"date":return Qo(t);default:return new Date(t)}}const lA=S.forwardRef(function({mode:e="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:u,placeholder:d,size:f,color:h="primary",disabled:m=!1,clearable:y=!0,locale:g,weekStartsOn:v=0,hour12:x,showSeconds:w=!1,minuteStep:b=1,secondStep:C=1,format:P,icon:R,required:M=!1,validate:j,error:T,onValidate:E,id:N,className:_,style:F,sx:U,"aria-invalid":J,"aria-describedby":z,dialogLabel:I,name:L,open:$,onOpenChange:D,...q},A){const G=sA(g),O=x??iA(G),V=S.useId(),B=N??`cny-dp-${V}`,X=`${B}-dialog`,K=`${B}-hint`,W=S.useMemo(()=>{const k=ko(s),Q=a==="future"||a==="current"?Qo(new Date):null;return k&&Q?k.getTime()>Q.getTime()?k:Q:k??Q},[s,a]),Z=S.useMemo(()=>{const k=ko(i),Q=a==="past"||a==="current"?Qd(new Date):null;return k&&Q?k.getTime()<Q.getTime()?k:Q:k??Q},[i,a]),ce=n!==void 0,[ie,ue]=S.useState(()=>ko(r)),se=ce?ko(n):ie,Ye=$!==void 0,[$t,qt]=S.useState(!1),we=Ye?$:$t,ft=S.useCallback(k=>{Ye||qt(k),D==null||D(k)},[Ye,D]),uo=S.useMemo(()=>se??Ue(new Date,W,Z),[se,W,Z]),[me,Se]=S.useState(()=>Mt(uo)),[xe,De]=S.useState(()=>uo),Xs=e==="month"?"month":e==="year"?"year":"date",[et,xn]=S.useState(Xs),qs=S.useRef(null);S.useImperativeHandle(A,()=>qs.current,[]);const xr=S.useRef(null),Zs=S.useRef(null),Al=S.useRef(null),Qs=S.useRef(null),[ov,sv]=S.useState({}),[iv,av]=S.useState(!1);S.useEffect(()=>av(!0),[]);const Ln=S.useCallback(k=>W&&_o(k,W)||Z&&Oo(k,Z)?!0:c?c(k):!1,[W,Z,c]),fo=S.useCallback(k=>u?u(k):!1,[u]),Fn=S.useMemo(()=>{if(T)return typeof T=="string"?T:"Invalid";if(M&&!se)return"Required";if(se){const Q=Qo(new Date);if(a==="future"&&_o(se,Q))return"Must be today or later";if(a==="past"&&Oo(se,Qd(new Date)))return"Must be today or earlier";if(a==="current"&&!Io(se,Q))return"Must be today";if(W&&_o(se,W))return"Too early";if(Z&&Oo(se,Z))return"Too late";if(c&&c(se))return"Unavailable date";if(u&&u(se))return"Unavailable time"}const k=j==null?void 0:j(se);return k||null},[T,M,se,a,W,Z,c,u,j]),Dl=S.useRef(null);S.useEffect(()=>{Dl.current!==Fn&&(Dl.current=Fn,E==null||E(Fn))},[Fn,E]);const ho=Fn!==null,Il=ho?"danger":h,cv=se?P?P(se,e):aA(se,e,G,O,w):"",lv=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[e],uv=I??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[e],Zt=S.useCallback(k=>{ce||ue(k),o==null||o(k)},[ce,o]),po=S.useCallback(()=>{var k;ft(!1),(k=xr.current)==null||k.focus()},[ft]),dv=S.useCallback(k=>{var Q;k.stopPropagation(),Zt(null),(Q=xr.current)==null||Q.focus()},[Zt]),Nl=S.useCallback(()=>{if(m)return;const k=se??Ue(new Date,W,Z);Se(Mt(k)),De(k),xn(Xs),ft(!0)},[m,se,W,Z,ft,Xs]);S.useEffect(()=>{if(!we)return;const k=Q=>{var he,ee;const ae=Q.target;(he=qs.current)!=null&&he.contains(ae)||(ee=Zs.current)!=null&&ee.contains(ae)||ft(!1)};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[we,ft]);const mo=S.useCallback(()=>{const k=xr.current,Q=Zs.current;if(!k||!Q)return;const ae=k.getBoundingClientRect(),he=Q.offsetHeight||340,ee=Q.offsetWidth||264,tt=window.innerHeight,Fe=window.innerWidth,nt=4,Me=8,Qt=tt-ae.bottom,ei=ae.top,_v=Qt<he+nt&&ei>Qt?Math.max(Me,ae.top-nt-he):Math.min(tt-he-Me,ae.bottom+nt),Ov=Math.max(Me,Math.min(ae.left,Fe-ee-Me));sv({position:"fixed",top:_v,left:Ov,width:ee})},[]);S.useLayoutEffect(()=>{we&&mo()},[we,e,mo]),S.useEffect(()=>{if(!we)return;const k=()=>mo();return window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[we,mo]),S.useEffect(()=>{var k,Q;we&&(et==="date"&&(e==="date"||e==="datetime")?(k=Al.current)==null||k.focus():(et==="month"||et==="year")&&((Q=Qs.current)==null||Q.focus()))},[we,xe,e,et]);const kl=S.useCallback(()=>{var k;et==="year"&&e!=="year"?xn("month"):et==="month"&&e!=="month"?xn("date"):(ft(!1),(k=xr.current)==null||k.focus())},[et,e,ft]),go=S.useCallback(k=>{const Q=Ue(k,W,Z);De(Q),Se(ae=>Li(ae,Q)?ae:Mt(Q))},[W,Z]),br=S.useCallback((k,Q)=>{const ae=cA(k,e);if(e!=="time"&&Ln(ae))return;const he=e==="time"||e==="datetime"?Fi(ae,(se??k).getHours(),(se??k).getMinutes(),w?(se??k).getSeconds():0):ae;Zt(he),De(he),((Q==null?void 0:Q.close)??(e!=="datetime"&&e!=="time"))&&po()},[e,Ln,Zt,se,w,po]),yo=S.useCallback((k,Q)=>{const ae=se??Ue(new Date,W,Z),he=k==="hour"?Q:ae.getHours(),ee=k==="minute"?Q:ae.getMinutes(),tt=k==="second"?Q:w?ae.getSeconds():0,Fe=Fi(ae,he,ee,tt);fo(Fe)||(Zt(Fe),De(Fe))},[se,W,Z,w,fo,Zt]),Vn=S.useCallback(k=>go(hs(xe,k)),[go,xe]),fv=k=>{switch(k.key){case"ArrowLeft":k.preventDefault(),Vn(-1);break;case"ArrowRight":k.preventDefault(),Vn(1);break;case"ArrowUp":k.preventDefault(),Vn(-7);break;case"ArrowDown":k.preventDefault(),Vn(7);break;case"Home":{k.preventDefault();const Q=(xe.getDay()-v+7)%7;Vn(-Q);break}case"End":{k.preventDefault();const Q=(xe.getDay()-v+7)%7;Vn(6-Q);break}case"PageUp":k.preventDefault(),go(k.shiftKey?Rt(xe,-1):No(xe,-1));break;case"PageDown":k.preventDefault(),go(k.shiftKey?Rt(xe,1):No(xe,1));break;case"Enter":case" ":k.preventDefault(),br(xe);break;case"Escape":k.preventDefault(),kl();break}},hv=S.useMemo(()=>Jj(me,v),[me,v]),pv=S.useMemo(()=>eA(G,v),[G,v]),mv=S.useMemo(()=>tA(G,"short"),[G]),Js=S.useMemo(()=>Qo(new Date),[]),gv=!W||!_o(Mt(me),Mt(W)),yv=!Z||!Oo(Mt(me),Mt(Z)),vv=!W||me.getFullYear()-1>=W.getFullYear(),xv=!Z||me.getFullYear()+1<=Z.getFullYear(),bn=Jd(me).getFullYear(),bv=!W||bn-10+9>=W.getFullYear(),wv=!Z||bn+10<=Z.getFullYear(),Cv=e==="time"?!fo(new Date):!Ln(Js),Sv=()=>{if(e==="time"){const k=new Date;if(fo(k))return;const ae=Fi(se??k,k.getHours(),k.getMinutes(),w?k.getSeconds():0);Zt(ae),De(ae);return}br(Js,{close:e!=="datetime"})},Pv=Y("cny-datepicker-trigger","input",Il!=="primary"&&Il,f==="sm"||f==="lg"?f:null,se&&"has-value",we&&"is-open"),Rv=R??(e==="time"?l.jsx(dP,{size:15}):l.jsx(eP,{size:15})),_l=(k,Q)=>{let he=!0;switch(k.key){case"ArrowLeft":De(Q==="month"?ee=>Ue(new Date(me.getFullYear(),(ee.getMonth()+11)%12,Math.min(ee.getDate(),28)),W,Z):ee=>Ue(new Date(ee.getFullYear()-1,ee.getMonth(),Math.min(ee.getDate(),28)),W,Z));break;case"ArrowRight":De(Q==="month"?ee=>Ue(new Date(me.getFullYear(),(ee.getMonth()+1)%12,Math.min(ee.getDate(),28)),W,Z):ee=>Ue(new Date(ee.getFullYear()+1,ee.getMonth(),Math.min(ee.getDate(),28)),W,Z));break;case"ArrowUp":De(Q==="month"?ee=>Ue(new Date(me.getFullYear(),(ee.getMonth()-3+12)%12,Math.min(ee.getDate(),28)),W,Z):ee=>Ue(new Date(ee.getFullYear()-3,ee.getMonth(),Math.min(ee.getDate(),28)),W,Z));break;case"ArrowDown":De(Q==="month"?ee=>Ue(new Date(me.getFullYear(),(ee.getMonth()+3)%12,Math.min(ee.getDate(),28)),W,Z):ee=>Ue(new Date(ee.getFullYear()+3,ee.getMonth(),Math.min(ee.getDate(),28)),W,Z));break;case"PageUp":Se(Q==="month"?ee=>Rt(ee,k.shiftKey?-10:-1):ee=>Rt(ee,k.shiftKey?-100:-10));break;case"PageDown":Se(Q==="month"?ee=>Rt(ee,k.shiftKey?10:1):ee=>Rt(ee,k.shiftKey?100:10));break;case"Enter":case" ":Q==="month"?Ol(new Date(me.getFullYear(),xe.getMonth(),1)):$l(xe.getFullYear());break;case"Escape":kl();break;default:he=!1}he&&k.preventDefault()};S.useEffect(()=>{if(we&&et==="year"){const k=Jd(me).getFullYear(),Q=xe.getFullYear();(Q<k-1||Q>k+10)&&Se(new Date(Q,0,1))}},[we,et,xe,me]);const Ol=k=>{e==="month"?br(k):(Se(Mt(k)),De(Ue(k,W,Z)),xn("date"))},$l=k=>{if(e==="year")br(new Date(k,0,1));else{const Q=new Date(k,me.getMonth(),1);Se(Q),De(Ue(new Date(k,xe.getMonth(),Math.min(xe.getDate(),28)),W,Z)),xn("month")}},Tv=()=>{const k=xe.getMonth();return mv.map((Q,ae)=>{const he=new Date(me.getFullYear(),ae,1),ee=!!se&&Li(he,se)&&Zj(he,se),tt=he.getMonth()===me.getMonth()&&e!=="month",Fe=ae===k,nt=Ln(he);return l.jsx("button",{ref:Fe?Qs:void 0,type:"button",tabIndex:Fe?0:-1,className:Y("cny-datepicker-chip",ee&&"is-selected",tt&&!ee&&"is-current"),disabled:nt,onClick:()=>Ol(he),onFocus:()=>De(new Date(me.getFullYear(),ae,Math.min(xe.getDate(),28))),children:Q},ae)})},Mv=()=>{const k=bn-1,Q=xe.getFullYear();return Array.from({length:12},(ae,he)=>{const ee=k+he,tt=new Date(ee,0,1),Fe=!!se&&se.getFullYear()===ee,nt=ee===me.getFullYear()&&e!=="year",Me=ee===Q,Qt=Ln(tt),ei=ee<bn||ee>=bn+10;return l.jsx("button",{ref:Me?Qs:void 0,type:"button",tabIndex:Me?0:-1,className:Y("cny-datepicker-chip",Fe&&"is-selected",nt&&!Fe&&"is-current",ei&&"is-outside"),disabled:Qt,onClick:()=>$l(ee),onFocus:()=>De(new Date(ee,xe.getMonth(),Math.min(xe.getDate(),28))),children:ee},ee)})},Ev=S.useRef(null),Ll=S.useRef(null),Fl=S.useRef(null),Vl=()=>{const k=se??Ue(new Date,W,Z),Q=k.getHours(),ae=k.getMinutes(),he=k.getSeconds(),ee=Q>=12,tt=O?Q%12===0?12:Q%12:Q,Fe=Me=>{const Qt=O?ee?Me===12?12:Me+12:Me===12?0:Me:Me;yo("hour",Qt)},nt=Me=>{const Qt=Me?Q<12?Q+12:Q:Q>=12?Q-12:Q;yo("hour",Qt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Vi,{ref:Ev,ariaLabel:"Hour",value:tt,min:O?1:0,max:O?12:23,step:1,nextRef:Ll,onChange:Fe}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Vi,{ref:Ll,ariaLabel:"Minute",value:ae-ae%Math.max(1,b),min:0,max:59,step:Math.max(1,b),nextRef:w?Fl:void 0,onChange:Me=>yo("minute",Me)}),w&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Vi,{ref:Fl,ariaLabel:"Second",value:he-he%Math.max(1,C),min:0,max:59,step:Math.max(1,C),onChange:Me=>yo("second",Me)})]}),O&&l.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[l.jsx("button",{type:"button",role:"radio","aria-checked":!ee,className:Y("cny-dp-ampm-btn",!ee&&"is-active"),onClick:()=>nt(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":ee,className:Y("cny-dp-ampm-btn",ee&&"is-active"),onClick:()=>nt(!0),children:"PM"})]})]})})},jv=()=>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:!gv,onClick:()=>Se(k=>No(k,-1)),children:l.jsx(Yo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${ef(me,G)})`,onClick:()=>xn("month"),children:ef(me,G)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!yv,onClick:()=>Se(k=>No(k,1)),children:l.jsx(rn,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:fv,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:pv.map((k,Q)=>l.jsx("span",{role:"columnheader","aria-label":k,className:"cny-datepicker-weekday",children:k.slice(0,2)},Q))}),Array.from({length:6},(k,Q)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:hv.slice(Q*7,Q*7+7).map(ae=>{const he=!Li(ae,me),ee=Io(ae,se),tt=Io(ae,Js),Fe=Io(ae,xe),nt=Ln(ae);return l.jsx("button",{ref:Fe?Al:void 0,type:"button",role:"gridcell",tabIndex:Fe?0:-1,"aria-selected":ee,"aria-current":tt?"date":void 0,"aria-disabled":nt||void 0,disabled:nt,className:Y("cny-datepicker-cell",he&&"is-outside",ee&&"is-selected",tt&&"is-today"),onClick:()=>br(ae),onFocus:()=>De(ae),children:ae.getDate()},ae.toISOString())})},Q))]})]}),Av=()=>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:!vv,onClick:()=>Se(k=>Rt(k,-1)),children:l.jsx(Yo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${me.getFullYear()})`,onClick:()=>xn("year"),children:me.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!xv,onClick:()=>Se(k=>Rt(k,1)),children:l.jsx(rn,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:k=>_l(k,"month"),children:Tv()})]}),Dv=()=>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:!bv,onClick:()=>Se(k=>Rt(k,-10)),children:l.jsx(Yo,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${bn} – ${bn+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!wv,onClick:()=>Se(k=>Rt(k,10)),children:l.jsx(rn,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:k=>_l(k,"year"),children:Mv()})]}),{className:Iv,style:Nv,styleTag:kv}=re(U,F,"cny-datepicker",`mode-${e}`,m&&"is-disabled",_);return l.jsxs("div",{ref:qs,className:Iv,style:Nv,...q,children:[kv,L&&l.jsx("input",{type:"hidden",name:L,value:se?se.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:xr,type:"button",id:B,className:Pv,"aria-haspopup":"dialog","aria-expanded":we,"aria-controls":we?X:void 0,"aria-invalid":J||ho,"aria-describedby":Y(z,ho?K:void 0)||void 0,"aria-required":M||void 0,disabled:m,onClick:Nl,onKeyDown:k=>{k.key==="ArrowDown"||k.key==="Enter"||k.key===" "?(k.preventDefault(),Nl()):k.key==="Escape"&&we&&(k.preventDefault(),ft(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Rv}),l.jsx("span",{className:Y("cny-datepicker-value",!se&&"is-placeholder"),children:cv||lv}),y&&se&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:dv,onPointerDown:k=>k.stopPropagation(),children:l.jsx(Yt,{size:13,"aria-hidden":"true"})})]}),ho&&T!==!1&&l.jsx("span",{id:K,className:"cny-datepicker-error",role:"alert",children:typeof T=="string"?T:T??Fn}),we&&iv&&ps.createPortal(l.jsxs("div",{ref:Zs,id:X,role:"dialog","aria-modal":"false","aria-label":uv,className:Y("cny-datepicker-panel",`is-${e}`),style:ov,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(e==="date"||e==="datetime")&&et==="date"&&jv(),(e==="date"||e==="datetime"||e==="month")&&et==="month"&&Av(),(e==="date"||e==="datetime"||e==="month"||e==="year")&&et==="year"&&Dv(),e==="time"&&Vl(),e==="datetime"&&et==="date"&&Vl()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!Cv,onClick:Sv,children:e==="time"?"Now":e==="year"?"This year":e==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),y&&se&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{Zt(null),po()},children:"Clear"}),(e==="datetime"||e==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:po,children:"Done"})]})]}),document.body)]})}),Vi=S.forwardRef(function({value:e,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=S.useRef(null);S.useImperativeHandle(c,()=>u.current,[]);const[d,f]=S.useState(()=>$o(e)),h=S.useRef(!1);S.useEffect(()=>{h.current||f($o(e))},[e]);const m=S.useCallback(x=>{if(!Number.isFinite(x))return;let w=Math.max(n,Math.min(r,x));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),a(w),f($o(w))},[n,r,o,a]),y=()=>{const x=e+o;m(x>r?n:x)},g=()=>{const x=e-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),y();break;case"ArrowDown":x.preventDefault(),g();break;case"PageUp":x.preventDefault(),m(e+o*5);break;case"PageDown":x.preventDefault(),m(e-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?y():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":e,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var b;const w=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(w),w.length===2){const C=parseInt(w,10);Number.isFinite(C)&&C>=n&&C<=r&&(m(C),(b=i==null?void 0:i.current)==null||b.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f($o(e))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(_p,{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(Xr,{size:10,"aria-hidden":"true"})})]})]})});var uA=Object.defineProperty,ct=(t,e)=>uA(t,"name",{value:e,configurable:!0}),ol="Dialog",[Cg,N2]=Ce(ol),[dA,St]=Cg(ol),Sg=ct(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=p.useRef(null),c=p.useRef(null),[u,d]=be({prop:r,defaultProp:o??!1,onChange:s,caller:ol}),[f,h]=p.useState(0),[m,y]=p.useState(0);return l.jsx(dA,{scope:e,triggerRef:a,contentRef:c,contentId:$e(),titleId:$e(),descriptionId:$e(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:y,open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(g=>!g),[d]),modal:i,children:n})},"Dialog"),fA="DialogTrigger",Pg=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(fA,r),i=oe(n,s.triggerRef);return l.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Fs(s.open),...o,ref:i,onClick:H(e.onClick,s.onOpenToggle)})},"DialogTrigger")),Rg="DialogPortal",[hA,Tg]=Cg(Rg,{forceMount:void 0}),Mg=ct(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=St(Rg,e);return l.jsx(hA,{scope:e,forceMount:n,children:p.Children.map(r,i=>l.jsx(Ge,{present:n||s.open,children:l.jsx(Jr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),Oa="DialogOverlay",Eg=p.forwardRef(ct(function(e,n){const r=Tg(Oa,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(Oa,e.__scopeDialog);return i.modal?l.jsx(Ge,{present:o||i.open,children:l.jsx(mA,{...s,ref:n})}):null},"DialogOverlay")),pA=kt("DialogOverlay.RemoveScroll"),mA=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(Oa,r),i=Hp(),a=oe(n,i);return l.jsx(yr,{as:pA,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(ne.div,{"data-state":Fs(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Fr="DialogContent",jg=p.forwardRef(ct(function(e,n){const r=Tg(Fr,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(Fr,e.__scopeDialog);return l.jsx(Ge,{present:o||i.open,children:i.modal?l.jsx(gA,{...s,ref:n}):l.jsx(yA,{...s,ref:n})})},"DialogContent")),gA=p.forwardRef(ct(function(e,n){const r=St(Fr,e.__scopeDialog),o=p.useRef(null),s=oe(n,r.contentRef,o);return p.useEffect(()=>{const i=o.current;if(i)return eo(i)},[]),l.jsx(Ag,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),yA=p.forwardRef(ct(function(e,n){const r=St(Fr,e.__scopeDialog),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Ag,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Ag=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,c=St(Fr,r);return hr(),l.jsx(l.Fragment,{children:l.jsx(Ss,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(fr,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Fs(c.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),vA="DialogTitle",sl=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(vA,r),{setTitleCount:i}=s;return Te(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(ne.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),xA="DialogDescription",il=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(xA,r),{setDescriptionCount:i}=s;return Te(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(ne.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),bA="DialogClose",Ls=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=St(bA,r);return l.jsx(ne.button,{type:"button",...o,ref:n,onClick:H(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Fs(t){return t?"open":"closed"}ct(Fs,"getState");function wA({hotkey:t=!0}={}){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(!t)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),{open:e,setOpen:n,toggle:()=>n(r=>!r)}}function CA({open:t,onOpenChange:e,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:u}){const d=f=>{var h;f.disabled||((h=f.onSelect)==null||h.call(f),c==null||c(f),e(!1))};return l.jsxs(je.Dialog,{open:t,onOpenChange:e,label:o,contentClassName:Y("cny-cmdk-content",u),children:[l.jsxs(Sm,{children:[l.jsx(sl,{children:o}),l.jsx(il,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Gp,{size:16,"aria-hidden":"true"}),l.jsx(je.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(je.List,{className:"cny-cmdk-list",children:[l.jsx(je.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(je.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(je.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function SA({onClick:t,label:e="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:t,className:Y("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(Gp,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:e}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let PA=0;const RA=()=>`cny-toast-${Date.now().toString(36)}-${++PA}`,Dg=S.createContext(null),TA={default:null,success:l.jsx(Lp,{size:16,"aria-hidden":"true"}),info:l.jsx(Vp,{size:16,"aria-hidden":"true"}),warning:l.jsx(Up,{size:16,"aria-hidden":"true"}),danger:l.jsx($p,{size:16,"aria-hidden":"true"}),loading:l.jsx(Bp,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function MA({children:t,position:e="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=S.useState([]),[a,c]=S.useState(!1);S.useEffect(()=>c(!0),[]);const u=S.useCallback(g=>{i(v=>v.map(x=>g==null||x.id===g?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>g==null?!1:x.id!==g||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(g==null||x.id===g)).forEach(x=>{var w;return(w=x.onDismiss)==null?void 0:w.call(x)}),v.filter(x=>!x.exiting||g!=null&&x.id!==g)))},200)},[]),d=S.useCallback(g=>{const v=g.id??RA(),x={id:v,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(w=>{const C=[...w.filter(P=>P.id!==v),x];return C.length>r?C.slice(C.length-r):C}),v},[n,r]),f=S.useCallback((g,v)=>{i(x=>x.map(w=>w.id===g?{...w,...v,variant:v.variant??w.variant,duration:v.duration??w.duration,dismissible:v.dismissible??w.dismissible}:w))},[]),h=S.useMemo(()=>{const g=(v=>d(typeof v=="string"?{title:v}:v));return g.success=(v,x)=>d({...x,title:v,variant:"success"}),g.info=(v,x)=>d({...x,title:v,variant:"info"}),g.warning=(v,x)=>d({...x,title:v,variant:"warning"}),g.error=(v,x)=>d({...x,title:v,variant:"danger"}),g.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),g},[d]),m=S.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),y=e.startsWith("top-");return l.jsxs(Dg.Provider,{value:m,children:[t,a&&ps.createPortal(l.jsx("ol",{className:Y("cny-toast-viewport",`pos-${e}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(y?[...s].reverse():s).map(g=>l.jsx(EA,{toast:g,onDismiss:()=>u(g.id)},g.id))}),document.body)]})}function EA({toast:t,onDismiss:e}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=t,[d,f]=S.useState(!1),h=S.useRef(null);S.useEffect(()=>{if(!t.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(e,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,e,t.exiting]);const m=n==="danger"||n==="warning"?"alert":"status",y=i!==!1,g=i!==void 0&&i!==!1?i:TA[n],{className:v,style:x,styleTag:w}=re(u,void 0,"cny-toast",n,t.exiting&&"is-exiting");return l.jsxs("li",{role:m,"aria-atomic":"true",className:v,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[w,y&&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:e,children:l.jsx(Yt,{size:14,"aria-hidden":"true"})})]})}function jA(){const t=S.useContext(Dg);if(!t)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return t}const Ig=S.forwardRef(function({title:e,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:m,styleTag:y}=re(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Sg,{...d,children:l.jsxs(Mg,{children:[l.jsx(Eg,{className:"cny-dialog-overlay"}),l.jsxs(jg,{ref:f,className:h,style:m,children:[y,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(sl,{className:"cny-dialog-title",children:e}),n&&l.jsx(il,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Ls,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Yt,{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})]})]})})}),AA=Pg,DA=Ls;function Ng({open:t,onOpenChange:e,title:n,message:r,children:o,confirmLabel:s="Confirm",cancelLabel:i="Cancel",danger:a=!1,loading:c=!1,onConfirm:u,onCancel:d,className:f,style:h,sx:m}){const y=()=>{d==null||d(),e(!1)};return l.jsx(Ig,{open:t,onOpenChange:e,size:"sm",title:n,className:Y("cny-confirm",f),style:h,sx:m,footer:l.jsxs(l.Fragment,{children:[l.jsx(kr,{variant:"ghost",color:"primary",onClick:y,disabled:c,children:i}),l.jsx(kr,{variant:"solid",color:a?"danger":"primary",loading:c,onClick:u,children:s})]}),children:o??l.jsx("p",{className:"cny-confirm-message",children:r})})}function IA(){const[t,e]=S.useState(null),n=S.useCallback(i=>new Promise(a=>{e({...i,resolve:a})}),[]),r=S.useCallback(i=>{i||e(a=>(a==null||a.resolve(!1),null))},[]),o=S.useCallback(()=>{e(i=>(i==null||i.resolve(!0),null))},[]),s=t?l.jsx(Ng,{open:!0,onOpenChange:r,title:t.title,message:t.message,confirmLabel:t.confirmLabel,cancelLabel:t.cancelLabel,danger:t.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const NA=S.forwardRef(function({title:e,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:m,style:y,styleTag:g}=re(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Sg,{...f,children:l.jsxs(Mg,{children:[l.jsx(Eg,{className:"cny-drawer-overlay"}),l.jsxs(jg,{ref:h,className:m,style:y,children:[g,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(sl,{className:"cny-drawer-title",children:e}),n&&l.jsx(il,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Ls,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Yt,{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})]})]})})}),kA=Pg,_A=Ls;var OA=Object.defineProperty,le=(t,e)=>OA(t,"name",{value:e,configurable:!0}),$a=["Enter"," "],$A=["ArrowDown","PageUp","Home"],kg=["ArrowUp","PageDown","End"],LA=[...$A,...kg],FA={ltr:[...$a,"ArrowRight"],rtl:[...$a,"ArrowLeft"]},VA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Vs="Menu",[Vr,BA,GA]=ur(Vs),[$n,Bs]=Ce(Vs,[GA,mn,pn]),Gs=mn(),_g=pn(),[Og,vn]=$n(Vs),[UA,so]=$n(Vs),zA=le(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=Gs(e),[c,u]=p.useState(null),d=p.useRef(!1),f=qe(s),h=Kt(o);return p.useEffect(()=>{const m=le(()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=le(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=le(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),l.jsx(Zr,{...a,children:l.jsx(Og,{scope:e,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(UA,{scope:e,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),$g=p.forwardRef(le(function(e,n){const{__scopeMenu:r,...o}=e,s=Gs(r);return l.jsx(Qr,{...s,...o,ref:n})},"MenuAnchor")),Lg="MenuPortal",[WA,Fg]=$n(Lg,{forceMount:void 0}),HA=le(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=vn(Lg,e);return l.jsx(WA,{scope:e,forceMount:n,children:l.jsx(Ge,{present:n||s.open,children:l.jsx(Jr,{asChild:!0,container:o,children:r})})})},"MenuPortal"),yt="MenuContent",[KA,al]=$n(yt),YA=p.forwardRef(le(function(e,n){const r=Fg(yt,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=vn(yt,e.__scopeMenu),a=so(yt,e.__scopeMenu);return l.jsx(Vr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ge,{present:o||i.open,children:l.jsx(Vr.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(XA,{...s,ref:n}):l.jsx(qA,{...s,ref:n})})})})},"MenuContent")),XA=p.forwardRef(le(function(e,n){const r=vn(yt,e.__scopeMenu),o=p.useRef(null),s=oe(n,o);return p.useEffect(()=>{const i=o.current;if(i)return eo(i)},[]),l.jsx(cl,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),qA=p.forwardRef(le(function(e,n){const r=vn(yt,e.__scopeMenu);return l.jsx(cl,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),ZA=kt("MenuContent.ScrollLock"),cl=p.forwardRef(le(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:y,disableOutsideScroll:g,...v}=e,x=vn(yt,r),w=so(yt,r),b=Gs(r),C=_g(r),P=BA(r),[R,M]=p.useState(null),j=p.useRef(null),T=oe(n,j,x.onContentChange),E=p.useRef(0),N=p.useRef(""),_=p.useRef(0),F=p.useRef(null),U=p.useRef("right"),J=p.useRef(0),z=g?yr:p.Fragment,I=g?{as:ZA,allowPinchZoom:!0}:void 0,L=le(D=>{var K,W;const q=N.current+D,A=P().filter(Z=>!Z.disabled),G=document.activeElement,O=(K=A.find(Z=>Z.ref.current===G))==null?void 0:K.textValue,V=A.map(Z=>Z.textValue),B=Kg(V,q,O),X=(W=A.find(Z=>Z.textValue===B))==null?void 0:W.ref.current;le((function Z(ce){N.current=ce,window.clearTimeout(E.current),ce!==""&&(E.current=window.setTimeout(()=>Z(""),1e3))}),"updateSearch")(q),X&&setTimeout(()=>X.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(E.current),[]),hr();const $=p.useCallback(D=>{var A,G;return U.current===((A=F.current)==null?void 0:A.side)&&Xg(D,(G=F.current)==null?void 0:G.area)},[]);return l.jsx(KA,{scope:r,searchRef:N,onItemEnter:p.useCallback(D=>{$(D)&&D.preventDefault()},[$]),onItemLeave:p.useCallback(D=>{var q;$(D)||((q=j.current)==null||q.focus(),M(null))},[$]),onTriggerLeave:p.useCallback(D=>{$(D)&&D.preventDefault()},[$]),pointerGraceTimerRef:_,onPointerGraceIntentChange:p.useCallback(D=>{F.current=D},[]),children:l.jsx(z,{...I,children:l.jsx(Ss,{asChild:!0,trapped:s,onMountAutoFocus:H(i,D=>{var q;D.preventDefault(),(q=j.current)==null||q.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(fr,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:y,children:l.jsx(ws,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:M,onEntryFocus:H(u,D=>{w.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(js,{role:"menu","aria-orientation":"vertical","data-state":ul(x.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:H(v.onKeyDown,D=>{const A=D.target.closest("[data-radix-menu-content]")===D.currentTarget,G=D.ctrlKey||D.altKey||D.metaKey,O=D.key.length===1;A&&(D.key==="Tab"&&D.preventDefault(),!G&&O&&L(D.key));const V=j.current;if(D.target!==V||!LA.includes(D.key))return;D.preventDefault();const X=P().filter(K=>!K.disabled).map(K=>K.ref.current);kg.includes(D.key)&&X.reverse(),Wg(X)}),onBlur:H(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),N.current="")}),onPointerMove:H(e.onPointerMove,or(D=>{const q=D.target,A=J.current!==D.clientX;if(D.currentTarget.contains(q)&&A){const G=D.clientX>J.current?"right":"left";U.current=G,J.current=D.clientX}}))})})})})})})},"MenuContentImpl")),QA=p.forwardRef(le(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(ne.div,{role:"group",...o,ref:n})},"MenuGroup")),JA=p.forwardRef(le(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(ne.div,{...o,ref:n})},"MenuLabel")),La="MenuItem",tf="menu.itemSelect",ll=p.forwardRef(le(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=p.useRef(null),a=so(La,e.__scopeMenu),c=al(La,e.__scopeMenu),u=oe(n,i),d=p.useRef(!1),f=le(()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(tf,{bubbles:!0,cancelable:!0});h.addEventListener(tf,y=>o==null?void 0:o(y),{once:!0}),Cc(h,m),m.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return l.jsx(Vg,{...s,ref:u,disabled:r,onClick:H(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:H(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:H(e.onKeyDown,h=>{r||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||$a.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),Vg=p.forwardRef(le(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=al(La,r),c=_g(r),u=p.useRef(null),d=oe(n,u),[f,h]=p.useState(!1),[m,y]=p.useState("");return p.useEffect(()=>{const g=u.current;g&&y((g.textContent??"").trim())},[i.children]),l.jsx(Vr.ItemSlot,{scope:r,disabled:o,textValue:s??m,children:l.jsx(Cs,{asChild:!0,...c,focusable:!o,children:l.jsx(ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:H(e.onPointerMove,or(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:H(e.onPointerLeave,or(g=>a.onItemLeave(g))),onFocus:H(e.onFocus,()=>h(!0)),onBlur:H(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),eD=p.forwardRef(le(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return l.jsx(Gg,{scope:e.__scopeMenu,checked:r,children:l.jsx(ll,{role:"menuitemcheckbox","aria-checked":Br(r)?"mixed":r,...s,ref:n,"data-state":Us(r),onSelect:H(s.onSelect,()=>o==null?void 0:o(Br(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),tD="MenuRadioGroup",[nD,rD]=$n(tD,{value:void 0,onValueChange:le(()=>{},"onValueChange")}),oD=p.forwardRef(le(function(e,n){const{value:r,onValueChange:o,...s}=e,i=qe(o);return l.jsx(nD,{scope:e.__scopeMenu,value:r,onValueChange:i,children:l.jsx(QA,{...s,ref:n})})},"MenuRadioGroup")),sD="MenuRadioItem",iD=p.forwardRef(le(function(e,n){const{value:r,...o}=e,s=rD(sD,e.__scopeMenu),i=r===s.value;return l.jsx(Gg,{scope:e.__scopeMenu,checked:i,children:l.jsx(ll,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":Us(i),onSelect:H(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Bg="MenuItemIndicator",[Gg,aD]=$n(Bg,{checked:!1}),cD=p.forwardRef(le(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=aD(Bg,r);return l.jsx(Ge,{present:o||Br(i.checked)||i.checked===!0,children:l.jsx(ne.span,{...s,ref:n,"data-state":Us(i.checked)})})},"MenuItemIndicator")),lD=p.forwardRef(le(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(ne.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),Ug="MenuSub",[uD,zg]=$n(Ug),dD=le(t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,s=vn(Ug,e),i=Gs(e),[a,c]=p.useState(null),[u,d]=p.useState(null),f=qe(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Zr,{...i,children:l.jsx(Og,{scope:e,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(uD,{scope:e,contentId:$e(),triggerId:$e(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),Lo="MenuSubTrigger",fD=p.forwardRef(le(function(e,n){const r=vn(Lo,e.__scopeMenu),o=so(Lo,e.__scopeMenu),s=zg(Lo,e.__scopeMenu),i=al(Lo,e.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=oe(n,s.onTriggerChange);return l.jsx($g,{asChild:!0,...d,children:l.jsx(Vg,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":ul(r.open),...e,ref:h,onClick:m=>{var y;(y=e.onClick)==null||y.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:H(e.onPointerMove,or(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:H(e.onPointerLeave,or(m=>{var g,v;f();const y=(g=r.content)==null?void 0:g.getBoundingClientRect();if(y){const x=(v=r.content)==null?void 0:v.dataset.side,w=x==="right",b=w?-5:5,C=y[w?"left":"right"],P=y[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x:C,y:y.top},{x:P,y:y.top},{x:P,y:y.bottom},{x:C,y:y.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:H(e.onKeyDown,m=>{var g;e.disabled||m.target!==m.currentTarget||i.searchRef.current!==""&&m.key===" "||FA[o.dir].includes(m.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),m.preventDefault())})})})},"MenuSubTrigger")),hD="MenuSubContent",pD=p.forwardRef(le(function(e,n){const r=Fg(yt,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=e,a=vn(yt,e.__scopeMenu),c=so(yt,e.__scopeMenu),u=zg(hD,e.__scopeMenu),d=p.useRef(null),f=oe(n,d);return l.jsx(Vr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ge,{present:o||a.open,children:l.jsx(Vr.Slot,{scope:e.__scopeMenu,children:l.jsx(cl,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:H(e.onFocusOutside,h=>{h.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:H(e.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:H(e.onKeyDown,h=>{var g;const m=h.currentTarget.contains(h.target),y=VA[c.dir].includes(h.key);m&&y&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function ul(t){return t?"open":"closed"}le(ul,"getOpenState");function Br(t){return t==="indeterminate"}le(Br,"isIndeterminate");function Us(t){return Br(t)?"indeterminate":t?"checked":"unchecked"}le(Us,"getCheckedState");function Wg(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}le(Wg,"focusFirst");function Hg(t,e){return t.map((n,r)=>t[(e+r)%t.length])}le(Hg,"wrapArray");function Kg(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=Hg(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}le(Kg,"getNextMatch");function Yg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}le(Yg,"isPointInPolygon");function Xg(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Yg(n,e)}le(Xg,"isPointerInGraceArea");function or(t){return e=>e.pointerType==="mouse"?t(e):void 0}le(or,"whenMouse");var qg=zA,Zg=$g,Qg=HA,Jg=YA,ey=JA,ty=ll,ny=eD,ry=oD,oy=iD,sy=cD,iy=lD,ay=dD,cy=fD,ly=pD,mD=Object.defineProperty,Ze=(t,e)=>mD(t,"name",{value:e,configurable:!0}),dl="DropdownMenu",[gD,k2]=Ce(dl,[Bs]),Qe=Bs(),[yD,uy]=gD(dl),vD=Ze(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=Qe(e),u=p.useRef(null),[d,f]=be({prop:o,defaultProp:s??!1,onChange:i,caller:dl});return l.jsx(yD,{scope:e,triggerId:$e(),triggerRef:u,contentId:$e(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(qg,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),xD="DropdownMenuTrigger",bD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=uy(xD,r),a=Qe(r),c=oe(n,i.triggerRef);return l.jsx(Zg,{asChild:!0,...a,children:l.jsx(ne.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:H(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:H(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),wD=Ze(t=>{const{__scopeDropdownMenu:e,...n}=t,r=Qe(e);return l.jsx(Qg,{...r,...n})},"DropdownMenuPortal"),CD="DropdownMenuContent",SD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=uy(CD,r),i=Qe(r),a=p.useRef(!1);return l.jsx(Jg,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:H(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:H(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),PD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(ey,{...s,...o,ref:n})},"DropdownMenuLabel")),RD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(ty,{...s,...o,ref:n})},"DropdownMenuItem")),TD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(ny,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),MD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(ry,{...s,...o,ref:n})},"DropdownMenuRadioGroup")),ED=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(oy,{...s,...o,ref:n})},"DropdownMenuRadioItem")),jD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(sy,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),AD=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(iy,{...s,...o,ref:n})},"DropdownMenuSeparator")),DD=Ze(t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:s}=t,i=Qe(e),[a,c]=be({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(ay,{...i,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),ID=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(cy,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),ND=p.forwardRef(Ze(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Qe(r);return l.jsx(ly,{...s,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),kD=vD,_D=bD,dy=wD,OD=SD,$D=PD,LD=RD,FD=TD,VD=MD,BD=ED,fy=jD,GD=AD,UD=DD,zD=ID,WD=ND;const HD=kD,KD=_D,YD=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(dy,{children:l.jsxs(OD,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),XD=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(LD,{ref:a,className:Y("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),qD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(FD,{ref:s,className:Y("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(fy,{children:l.jsx(cn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),ZD=VD,QD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(BD,{ref:s,className:Y("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(fy,{children:l.jsx(Fp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),JD=S.forwardRef(function({className:e,...n},r){return l.jsx($D,{ref:r,className:Y("cny-menu-label",e),...n})}),eI=S.forwardRef(function({className:e,...n},r){return l.jsx(GD,{ref:r,className:Y("cny-menu-separator",e),...n})}),tI=UD,nI=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(zD,{ref:s,className:Y("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(rn,{size:13,"aria-hidden":"true"})})]})}),rI=S.forwardRef(function({className:e,...n},r){return l.jsx(dy,{children:l.jsx(WD,{ref:r,className:Y("cny-menu-content",e),...n})})});var oI=Object.defineProperty,Le=(t,e)=>oI(t,"name",{value:e,configurable:!0}),fl="ContextMenu",[sI,_2]=Ce(fl,[Bs]),Je=Bs(),[iI,hy]=sI(fl),aI=Le(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=t,a=p.useRef(!1),[c,u]=be({prop:o,defaultProp:!1,onChange:r,caller:fl}),d=Je(e);return l.jsx(iI,{scope:e,open:c,onOpenChange:u,modal:i,hasInteractedRef:a,children:l.jsx(qg,{...d,dir:s,open:c,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),cI="ContextMenuTrigger",lI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=e,i=hy(cI,r),a=Je(r),[c,u]=p.useState({x:0,y:0}),d=p.useMemo(()=>({current:{getBoundingClientRect:Le(()=>DOMRect.fromRect({width:0,height:0,...c}),"getBoundingClientRect")}}),[c]),f=p.useRef(0),h=p.useCallback(()=>window.clearTimeout(f.current),[]),m=Le(y=>{i.hasInteractedRef.current=!0,u({x:y.clientX,y:y.clientY}),i.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>h,[h]),p.useEffect(()=>void(o&&h()),[o,h]),l.jsxs(l.Fragment,{children:[l.jsx(Zg,{...a,virtualRef:d}),l.jsx(ne.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:H(e.onContextMenu,y=>{h(),m(y),y.preventDefault()}),onPointerDown:o?e.onPointerDown:H(e.onPointerDown,Pr(y=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>m(y),700)})),onPointerMove:o?e.onPointerMove:H(e.onPointerMove,Pr(h)),onPointerCancel:o?e.onPointerCancel:H(e.onPointerCancel,Pr(h)),onPointerUp:o?e.onPointerUp:H(e.onPointerUp,Pr(h))})]})},"ContextMenuTrigger")),uI=Le(t=>{const{__scopeContextMenu:e,...n}=t,r=Je(e);return l.jsx(Qg,{...r,...n})},"ContextMenuPortal"),dI="ContextMenuContent",fI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=hy(dI,r),i=Je(r),a=p.useRef(!1);return l.jsx(Jg,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),hI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(ey,{...s,...o,ref:n})},"ContextMenuLabel")),pI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(ty,{...s,...o,ref:n})},"ContextMenuItem")),mI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(ny,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),gI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(ry,{...s,...o,ref:n})},"ContextMenuRadioGroup")),yI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(oy,{...s,...o,ref:n})},"ContextMenuRadioItem")),vI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(sy,{...s,...o,ref:n})},"ContextMenuItemIndicator")),xI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(iy,{...s,...o,ref:n})},"ContextMenuSeparator")),bI="ContextMenuSub",wI=Le(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:s}=t,i=Je(e),[a,c]=be({prop:o,defaultProp:s??!1,onChange:r,caller:bI});return l.jsx(ay,{...i,open:a,onOpenChange:c,children:n})},"ContextMenuSub"),CI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(cy,{...s,...o,ref:n})},"ContextMenuSubTrigger")),SI=p.forwardRef(Le(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Je(r);return l.jsx(ly,{...s,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function Pr(t){return e=>e.pointerType!=="mouse"?t(e):void 0}Le(Pr,"whenTouchOrPen");var PI=aI,RI=lI,py=uI,TI=fI,MI=hI,EI=pI,jI=mI,AI=gI,DI=yI,my=vI,II=xI,NI=wI,kI=CI,_I=SI;const OI=PI,$I=RI,LI=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(py,{children:l.jsxs(TI,{ref:c,className:u,style:d,alignOffset:s,...a,children:[f,i]})})}),FI=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(EI,{ref:a,className:Y("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),VI=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(jI,{ref:s,className:Y("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(my,{children:l.jsx(cn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),BI=AI,GI=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(DI,{ref:s,className:Y("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(my,{children:l.jsx(Fp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),UI=S.forwardRef(function({className:e,...n},r){return l.jsx(MI,{ref:r,className:Y("cny-menu-label",e),...n})}),zI=S.forwardRef(function({className:e,...n},r){return l.jsx(II,{ref:r,className:Y("cny-menu-separator",e),...n})}),WI=NI,HI=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(kI,{ref:s,className:Y("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(rn,{size:13,"aria-hidden":"true"})})]})}),KI=S.forwardRef(function({className:e,...n},r){return l.jsx(py,{children:l.jsx(_I,{ref:r,className:Y("cny-menu-content",e),...n})})});var YI=Object.defineProperty,Ae=(t,e)=>YI(t,"name",{value:e,configurable:!0}),[hl,O2]=Ce("Tooltip",[mn]),zs=mn(),XI="TooltipProvider",qI=700,Fa="tooltip.open",[ZI,pl]=hl(XI),QI=Ae(t=>{const{__scopeTooltip:e,delayDuration:n=qI,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(ZI,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),Va="Tooltip",[JI,io]=hl(Va),eN=Ae(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,c=pl(Va,t.__scopeTooltip),u=zs(e),[d,f]=p.useState(null),[h,m]=p.useState(void 0),y=$e(),g=p.useRef(0),v=i??c.disableHoverableContent,x=a??c.delayDuration,w=p.useRef(!1),[b,C]=be({prop:r,defaultProp:o??!1,onChange:Ae(E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Fa))):c.onClose(),s==null||s(E)},"onChange"),caller:Va}),P=p.useMemo(()=>b?w.current?"delayed-open":"instant-open":"closed",[b]),R=p.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,C(!0)},[C]),M=p.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),j=p.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,C(!0),g.current=0},x)},[x,C]);p.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const T=h??y;return l.jsx(Zr,{...u,children:l.jsx(JI,{scope:e,contentId:T,setContentId:m,open:b,stateAttribute:P,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?j():R()},[c.isOpenDelayedRef,j,R]),onTriggerLeave:p.useCallback(()=>{v?M():(window.clearTimeout(g.current),g.current=0)},[M,v]),onOpen:R,onClose:M,disableHoverableContent:v,children:n})})},"Tooltip"),nf="TooltipTrigger",tN=p.forwardRef(Ae(function(e,n){const{__scopeTooltip:r,...o}=e,s=io(nf,r),i=pl(nf,r),a=zs(r),c=p.useRef(null),u=oe(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(Qr,{asChild:!0,...a,children:l.jsx(ne.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:H(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:H(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:H(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:H(e.onBlur,s.onClose),onClick:H(e.onClick,s.onClose)})})},"TooltipTrigger")),gy="TooltipPortal",[nN,rN]=hl(gy,{forceMount:void 0}),oN=Ae(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=io(gy,e);return l.jsx(nN,{scope:e,forceMount:n,children:l.jsx(Ge,{present:n||s.open,children:l.jsx(Jr,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Gr="TooltipContent",sN=p.forwardRef(Ae(function(e,n){const r=rN(Gr,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=io(Gr,e.__scopeTooltip);return l.jsx(Ge,{present:o||a.open,children:a.disableHoverableContent?l.jsx(yy,{side:s,...i,ref:n}):l.jsx(iN,{side:s,...i,ref:n})})},"TooltipContent")),iN=p.forwardRef(Ae(function(e,n){const r=io(Gr,e.__scopeTooltip),o=pl(Gr,e.__scopeTooltip),s=p.useRef(null),i=oe(n,s),[a,c]=p.useState(null),{trigger:u,onClose:d}=r,f=s.current,{onPointerInTransitChange:h}=o,m=p.useCallback(()=>{c(null),h(!1)},[h]),y=p.useCallback((g,v)=>{const x=g.currentTarget,w={x:g.clientX,y:g.clientY},b=vy(w,x.getBoundingClientRect()),C=xy(w,b),P=by(v.getBoundingClientRect()),R=Cy([...C,...P]);c(R),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const g=Ae(x=>y(x,f),"handleTriggerLeave"),v=Ae(x=>y(x,u),"handleContentLeave");return u.addEventListener("pointerleave",g),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",v)}}},[u,f,y,m]),p.useEffect(()=>{if(a){const g=Ae(v=>{const x=v.target,w={x:v.clientX,y:v.clientY},b=(u==null?void 0:u.contains(x))||(f==null?void 0:f.contains(x)),C=!wy(w,a);b?m():C&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,f,a,d,m]),l.jsx(yy,{...e,ref:i})},"TooltipContentHoverable")),aN=lp("TooltipContent"),yy=p.forwardRef(Ae(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=e,d=io(Gr,r),f=zs(r),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Fa,h),()=>document.removeEventListener(Fa,h)),[h]),p.useEffect(()=>{if(d.trigger){const y=Ae(g=>{g.target instanceof Node&&g.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Te(()=>(m(i),()=>{m(void 0)}),[i,m]),l.jsx(fr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:y=>y.preventDefault(),onDismiss:h,children:l.jsxs(js,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(aN,{children:o}),s?l.jsx(n1,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),cN=p.forwardRef(Ae(function(e,n){const{__scopeTooltip:r,...o}=e,s=zs(r);return l.jsx(ym,{...s,...o,ref:n})},"TooltipArrow"));function vy(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ae(vy,"getExitSideFromRect");function xy(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Ae(xy,"getPaddedExitPoints");function by(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}Ae(by,"getPointsFromRect");function wy(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}Ae(wy,"isPointInPolygon");function Cy(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Sy(e)}Ae(Cy,"getHull");function Sy(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Ae(Sy,"getHullPresorted");var lN=QI,Py=eN,Ry=tN,Ty=oN,My=sN,uN=cN;const dN=lN,fN=S.forwardRef(function({children:e,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:a,disabled:c,contentClassName:u,contentStyle:d,sx:f},h){const{className:m,style:y,styleTag:g}=re(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:e}):l.jsxs(Py,{delayDuration:i,open:a,children:[l.jsx(Ry,{asChild:!0,children:e}),l.jsx(Ty,{children:l.jsxs(My,{ref:h,side:r,align:o,sideOffset:s,className:m,style:y,children:[g,n,l.jsx(uN,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),hN=Py,pN=Ry,mN=S.forwardRef(function({className:e,...n},r){return l.jsx(Ty,{children:l.jsx(My,{ref:r,className:Y("cny-tooltip-content",e),...n})})}),gN=Gc,yN=Uc,vN=XM,xN=qM,bN=S.forwardRef(function({className:e,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(r,n,"cny-popover-content",e);return l.jsx(zc,{children:l.jsxs(Wc,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(ZM,{className:"cny-popover-arrow",width:12,height:6})]})})}),wN=S.forwardRef(function({color:e="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:a="Remove",onClick:c,disabled:u,className:d,style:f,sx:h,children:m,...y},g){const v=!u&&c!=null,{className:x,style:w,styleTag:b}=re(h,f,"cny-chip",e,n,r==="sm"&&"sm",v&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:g,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,onKeyDown:v?C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),c==null||c(C))}:void 0,className:x,style:w,...y,children:[b,s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:m}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:C=>{C.stopPropagation(),i(C)},children:l.jsx(Yt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),CN=S.forwardRef(function({count:e,dot:n=!1,max:r=99,showZero:o=!1,color:s="danger",placement:i="top-right",standalone:a=!1,children:c,className:u,style:d,sx:f,...h},m){const y=typeof e=="number",g=y&&e>r?`${r}+`:e,x=!n&&y&&e===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:P,style:R,styleTag:M}=re(f,d,"cny-badge","cny-badge-standalone",u);return l.jsxs("span",{ref:m,className:P,style:R,...h,children:[M,x]})}const{className:w,style:b,styleTag:C}=re(f,d,"cny-badge",u);return l.jsxs("span",{ref:m,className:w,style:b,...h,children:[C,c,x]})}),SN=S.forwardRef(function({position:e="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=re(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${e}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),PN=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,className:Y("cny-timeline-item",e),...n})}),RN=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:Y("cny-timeline-separator",e),...n})}),TN=S.forwardRef(function({color:e="neutral",variant:n="filled",icon:r,active:o=!1,className:s,children:i,...a},c){const u=r??i;return l.jsx("span",{ref:c,className:Y("cny-timeline-dot",`cny-timeline-dot-${e}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),MN=S.forwardRef(function({color:e,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:Y("cny-timeline-connector",e&&`cny-timeline-connector-${e}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),EN=S.forwardRef(function({variant:e="plain",accentColor:n,className:r,...o},s){const i=e==="card"||e==="elevated";return l.jsx("div",{ref:s,className:Y("cny-timeline-content",i&&"cny-timeline-content-card",e==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),jN=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:Y("cny-timeline-opposite-content",e),...n})}),Ey=S.createContext(null);function AN(){const t=S.useContext(Ey);if(!t)throw new Error("TreeItem must be used within a <TreeView>.");return t}const jy=S.forwardRef(function({expandedIds:e,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...m},y){const[g,v]=S.useState(n??[]),[x,w]=S.useState(s),[b,C]=S.useState(null),P=e??g,R=o!==void 0?o:x,M=S.useMemo(()=>new Set(P),[P]),j=S.useCallback(I=>M.has(I),[M]),T=S.useCallback(I=>{const L=!M.has(I),$=L?[...P,I]:P.filter(D=>D!==I);e===void 0&&v($),r==null||r($),a==null||a(I,L)},[P,M,e,r,a]),E=S.useCallback(I=>{o===void 0&&w(I),i==null||i(I)},[o,i]),N=S.useMemo(()=>({isExpanded:j,toggle:T,selectedId:R,select:E,activeId:b,setActive:C,defaultIcons:c}),[j,T,R,E,b,c]),_=S.useRef(null),F=S.useCallback(I=>{_.current=I,typeof y=="function"?y(I):y&&(y.current=I)},[y]);S.useEffect(()=>{var $;if(b!==null)return;const I=($=_.current)==null?void 0:$.querySelector('[role="treeitem"]'),L=I==null?void 0:I.dataset.treeId;L&&C(L)},[b]);const{className:U,style:J,styleTag:z}=re(f,d,"cny-tree",u);return l.jsx(Ey.Provider,{value:N,children:l.jsxs("ul",{ref:F,role:"tree",className:U,style:J,...m,children:[z,h]})})});function DN(t){return t?Array.from(t.querySelectorAll('[role="treeitem"]')):[]}const Ay=S.forwardRef(function({itemId:e,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:m,defaultIcons:y}=AN(),g=!!o,v=g&&c(e),x=d===e,w=h===e,b=r??(y?g?v?l.jsx(SP,{size:16}):l.jsx(RP,{size:16}):l.jsx(wP,{size:16}):null),C=()=>{m(e),f(e),g&&u(e)},P=M=>{M.preventDefault(),M.stopPropagation(),m(e),u(e)},R=M=>{var T;const j=M.currentTarget.closest('[role="tree"]');switch(M.key){case"ArrowRight":if(M.preventDefault(),g&&!v)u(e);else if(v){const E=M.currentTarget.querySelector('[role="treeitem"]');E==null||E.focus()}break;case"ArrowLeft":if(M.preventDefault(),g&&v)u(e);else{const E=(T=M.currentTarget.parentElement)==null?void 0:T.closest('[role="treeitem"]');E==null||E.focus()}break;case"ArrowDown":case"ArrowUp":{M.preventDefault();const E=DN(j),N=E.indexOf(M.currentTarget),_=E[N+(M.key==="ArrowDown"?1:-1)];_==null||_.focus();break}case"Enter":case" ":M.preventDefault(),f(e),g&&u(e);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":e,"aria-expanded":g?v:void 0,"aria-selected":x,tabIndex:w?0:-1,className:Y("cny-tree-item",s),onKeyDown:R,onFocus:M=>{M.target===M.currentTarget&&m(e)},...i,children:[l.jsxs("div",{className:Y("cny-tree-row",x&&"is-selected"),onClick:C,children:[g?l.jsx("button",{type:"button",tabIndex:-1,className:Y("cny-tree-toggle",v&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:e}`,onClick:P,children:l.jsx(rn,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),b!=null&&l.jsx("span",{className:"cny-tree-icon",children:b}),l.jsx("span",{className:"cny-tree-label",children:n})]}),v&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),IN=S.forwardRef(function({items:e,getItemId:n=c=>String(c.id),getItemLabel:r=c=>c.label,getItemChildren:o=c=>c.children,getItemIcon:s,...i},a){const c=u=>u.map(d=>{const f=n(d),h=o(d);return l.jsx(Ay,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?c(h):null},f)});return l.jsx(jy,{ref:a,...i,children:c(e)})});function NN(t){if(!t)return[];if(typeof t=="string")return t.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(t))return t.map(n=>n.trim()).filter(Boolean);const e=[];for(const[n,r]of Object.entries(t)){e.push(n);for(const o of r)e.push(o)}return e}function kN(t,e){if(e.length===0)return!0;const n=t.name.toLowerCase(),r=(t.type||"").toLowerCase();return e.some(o=>{const s=o.toLowerCase();return s==="*"||s==="*/*"?!0:s.startsWith(".")?n.endsWith(s):s.endsWith("/*")?r.startsWith(s.slice(0,-1)):r===s})}function Dy(t={}){const{accept:e,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=t,[d,f]=S.useState(!1),h=S.useRef(null),m=S.useRef(0),y=S.useMemo(()=>NN(e),[e]),g=y.join(",")||void 0,v=S.useCallback(P=>{const R=[];return kN(P,y)||R.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&P.size>n&&R.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&P.size<r&&R.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),R},[y,n,r]),x=S.useCallback(P=>{if(i||P.length===0)return;const R=[],M=[];if(!o&&P.length>1||typeof s=="number"&&P.length>s)for(const T of P)M.push({file:T,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const T of P){const E=v(T);E.length?M.push({file:T,errors:E}):R.push(T)}a==null||a(R,M),R.length&&(c==null||c(R)),M.length&&(u==null||u(M))},[i,o,s,v,a,c,u]),w=S.useCallback(()=>{var P;i||(P=h.current)==null||P.click()},[i]),b=S.useCallback((P={})=>{const{onClick:R,onKeyDown:M,onDragOver:j,onDragEnter:T,onDragLeave:E,onDrop:N,..._}=P;return{..._,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:F=>{R==null||R(F),i||w()},onKeyDown:F=>{M==null||M(F),(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),w())},onDragOver:F=>{j==null||j(F),F.preventDefault(),i||f(!0)},onDragEnter:F=>{T==null||T(F),F.preventDefault(),!i&&(m.current+=1,f(!0))},onDragLeave:F=>{E==null||E(F),m.current=Math.max(0,m.current-1),m.current===0&&f(!1)},onDrop:F=>{var U;N==null||N(F),F.preventDefault(),m.current=0,f(!1),!i&&x(Array.from(((U=F.dataTransfer)==null?void 0:U.files)??[]))}}},[i,w,x]),C=S.useCallback((P={})=>{const{onChange:R,...M}=P;return{...M,ref:h,type:"file",accept:g,multiple:o,style:{display:"none"},onChange:j=>{R==null||R(j),x(Array.from(j.target.files??[])),j.target.value=""}}},[g,o,x]);return{getRootProps:b,getInputProps:C,open:w,isDragActive:d,inputRef:h}}const _N=S.forwardRef(function({onDrop:e,label:n="Drop files here or click to upload",hint:r,icon:o,children:s,buttonLabel:i="Browse files",size:a="md",accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,className:y,style:g,sx:v},x){const{getRootProps:w,getInputProps:b,isDragActive:C,open:P}=Dy({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,onDrop:e}),{className:R,style:M,styleTag:j}=re(v,g,"cny-uploader",`cny-uploader-${a}`,C&&"is-dragging",m&&"is-disabled",y);return l.jsxs("div",{...w(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:R,style:M,children:[j,l.jsx("input",{...b()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(hP,{})}),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(kr,{type:"button",variant:"outline",size:a==="sm"?"sm":"md",disabled:m,tabIndex:-1,onClick:T=>{T.stopPropagation(),P()},children:i})]})]})}),ON=5;function rf(t){if(t.length===0)return[];const n=t.reduce((a,c)=>a+(c.def??0),0),r=t.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=t.map(a=>a.def==null?o:a.def),i=s.reduce((a,c)=>a+c,0)||1;return s.map(a=>a/i*100)}function of(t,e,n,r){if(e<0||e+1>=t.length)return t;const o=t[e]+t[e+1];let s=Math.max(r[e].min,Math.min(r[e].max,t[e]+n));const i=Math.max(r[e+1].min,Math.min(r[e+1].max,o-s));s=Math.max(r[e].min,Math.min(r[e].max,o-i));const a=[...t];return a[e]=s,a[e+1]=i,a}const Ba=S.forwardRef(function({defaultSize:e,minSize:n,maxSize:r,className:o,style:s,...i},a){return l.jsx("div",{ref:a,className:Y("cny-panel",o),style:s,...i})}),Iy=S.forwardRef(function({disabled:e,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||e)return;const u=i?"ArrowRight":"ArrowDown",d=i?"ArrowLeft":"ArrowUp";c.key===u?(c.preventDefault(),r.onKeyResize(1)):c.key===d&&(c.preventDefault(),r.onKeyResize(-1))};return l.jsx("div",{ref:s,role:"separator",tabIndex:e?-1:0,"aria-orientation":i?"vertical":"horizontal","aria-valuenow":r==null?void 0:r.valueNow,"aria-valuemin":r==null?void 0:r.valueMin,"aria-valuemax":r==null?void 0:r.valueMax,"aria-disabled":e||void 0,className:Y("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{e||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),$N=S.forwardRef(function({direction:e="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=S.useRef(null),u=S.Children.toArray(s).filter(S.isValidElement),d=u.filter(j=>j.type===Ba).map(j=>{const T=j.props;return{min:T.minSize??10,max:T.maxSize??90,def:T.defaultSize??null}}),[f,h]=S.useState(()=>rf(d)),m=f.length===d.length?f:rf(d),y=S.useRef(null),g=(j,T)=>{const E=e==="horizontal"?T.clientX:T.clientY;y.current={g:j,start:E,startSizes:m};const N=F=>{var $;const U=y.current,J=($=c.current)==null?void 0:$.getBoundingClientRect();if(!U||!J)return;const z=e==="horizontal"?J.width:J.height;if(!z)return;const L=((e==="horizontal"?F.clientX:F.clientY)-U.start)/z*100;h(of(U.startSizes,U.g,L,d))},_=()=>{y.current=null,window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",_)},v=(j,T)=>{h(of(m,j,T*ON,d))},x=j=>{c.current=j,typeof a=="function"?a(j):a&&(a.current=j)};let w=-1,b=-1;const C=u.map(j=>{var T,E;if(j.type===Ba){w+=1;const N=w,_={...j.props.style,flexBasis:`${m[N]??0}%`,flexGrow:0,flexShrink:0};return S.cloneElement(j,{key:j.key??`panel-${N}`,style:_})}if(j.type===Iy){b+=1;const N=b,_={direction:e,valueNow:Math.round(m[N]??0),valueMin:((T=d[N])==null?void 0:T.min)??0,valueMax:((E=d[N])==null?void 0:E.max)??100,onResizeStart:F=>g(N,F),onKeyResize:F=>v(N,F)};return S.cloneElement(j,{key:j.key??`handle-${N}`,__internal:_})}return j}),{className:P,style:R,styleTag:M}=re(o,r,"cny-panel-group",e==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:P,style:R,...i,children:[M,C]})});function LN(){}function FN(t,e,n,r){if(e<1)return[];if(e===1)return[{type:"page",page:1}];const o=e,s=Math.max(1,t-n),i=Math.min(o,t+n),a=[],c=r&&s>1,u=r&&i<o,d=c&&s>2,f=u&&i<o-1;c&&a.push({type:"page",page:1}),d&&a.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)a.push({type:"page",page:h});return f&&a.push({type:"ellipsis",key:"r"}),u&&a.push({type:"page",page:o}),a.filter((h,m,y)=>h.type!=="page"?!0:y.findIndex(g=>g.type==="page"&&g.page===h.page)===m)}const Ny=S.forwardRef(function({page:e,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:a="md",className:c,style:u,sx:d,"aria-label":f="Pagination"},h){const m=S.useMemo(()=>FN(e,n,o,s),[e,n,o,s]),y=w=>{w<1||w>n||w===e||r(w)},{className:g,style:v,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:v,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>y(e-1),disabled:e<=1,"aria-label":"Previous page",children:l.jsx(Yo,{size:14,"aria-hidden":"true"})}),m.map(w=>w.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(mP,{size:14})},`e-${w.key}`):l.jsx("button",{type:"button",className:Y("cny-pagination-btn",w.page===e&&"is-active"),"aria-current":w.page===e?"page":void 0,onClick:()=>y(w.page),children:w.page},w.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>y(e+1),disabled:e>=n,"aria-label":"Next page",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]})}),Bi={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function VN(t){return t.id}function BN(t,e){return!t||t.field!==e?{field:e,sort:"asc"}:t.sort==="asc"?{field:e,sort:"desc"}:null}const GN=S.forwardRef(function({columns:e,rows:n,getRowId:r=VN,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:m,noRowsLabel:y="No rows",disableColumnResize:g=!1,className:v,style:x,sx:w},b){const C=e.length+(c?1:0),P=S.useRef(null),[R,M]=S.useState(null),j=(O,V)=>{var ce;V.preventDefault(),V.stopPropagation();const B={};(ce=P.current)==null||ce.querySelectorAll("thead th[data-field]").forEach(ie=>{const ue=ie.dataset.field;ue&&(B[ue]=ie.getBoundingClientRect().width)});const X=V.clientX,K=B[O]??0;M(B);const W=ie=>{M({...B,[O]:Math.max(60,K+(ie.clientX-X))})},Z=()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",Z)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",Z)},T=O=>!g&&O.resizable!==!1,E=u??[],N=new Set(E),_=n.map(O=>r(O)),F=_.length>0&&_.every(O=>N.has(O)),U=_.some(O=>N.has(O)),J=F?!0:U?"indeterminate":!1,z=()=>{if(d)if(F)d(E.filter(O=>!_.includes(O)));else{const O=new Set(E);_.forEach(V=>O.add(V)),d([...O])}},I=O=>{d&&(N.has(O)?d(E.filter(V=>V!==O)):d([...E,O]))},L=O=>{!O.sortable||!h||h(BN(f,O.field))},$=O=>O.width!=null?{width:O.width,minWidth:O.width}:{flex:O.flex??1},D=()=>{if(!i||s==null)return null;const{page:O,pageSize:V}=i,B=Math.max(1,Math.ceil(s/V)),X=s===0?0:O*V+1,K=Math.min(s,(O+1)*V);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[X,"–",K," of ",s]}),l.jsx(Ny,{page:O+1,pageCount:B,size:"sm",onPageChange:W=>a==null?void 0:a({page:W-1,pageSize:V})})]})},{className:q,style:A,styleTag:G}=re(w,x,"cny-dt",v);return l.jsxs("div",{ref:b,className:q,style:A,children:[G,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:P,className:"cny-dt-table",style:R?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:void 0,children:[R&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:44}}),e.map(O=>l.jsx("col",{style:{width:R[O.field]}},O.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(_a,{checked:J,onCheckedChange:z,"aria-label":"Select all rows"})}),e.map(O=>{const V=(f==null?void 0:f.field)===O.field,B=O.headerAlign??O.align;return l.jsxs("th",{scope:"col","data-field":O.field,style:R?void 0:$(O),"aria-sort":V?f.sort==="asc"?"ascending":"descending":void 0,className:Y(B&&Bi[B],O.sortable&&"cny-dt-sortable",V&&"is-sorted"),children:[O.sortable?l.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>L(O),children:l.jsxs("span",{className:"cny-dt-th-inner",children:[O.headerName??O.field,l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:V?f.sort==="desc"?l.jsx(Xr,{size:14}):l.jsx(_p,{size:14}):l.jsx(Op,{size:14})})]})}):l.jsx("span",{className:"cny-dt-th-inner",children:O.headerName??O.field}),T(O)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:X=>X.stopPropagation(),onPointerDown:X=>j(O.field,X)})]},O.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((O,V)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(ba,{shape:"avatar",width:16,height:16})}),e.map(B=>l.jsx("td",{className:B.align&&Bi[B.align],children:l.jsx(ba,{width:"70%"})},B.field))]},`sk-${V}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:C,children:y})}):n.map(O=>{const V=r(O),B=N.has(V);return l.jsxs("tr",{className:Y("cny-dt-row",B&&"is-selected",m&&"is-clickable"),onClick:()=>m==null?void 0:m(O),tabIndex:m?0:void 0,onKeyDown:m?X=>{X.target===X.currentTarget&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),m(O))}:void 0,children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:X=>X.stopPropagation(),children:l.jsx(_a,{checked:B,onCheckedChange:()=>I(V),"aria-label":`Select row ${String(V)}`})}),e.map(X=>{const K=X.valueGetter?X.valueGetter({row:O,field:X.field}):O[X.field];return l.jsx("td",{className:X.align&&Bi[X.align],children:X.renderCell?X.renderCell({row:O,value:K,field:X.field}):K},X.field)})]},String(V))})})]})}),D()]})}),Ga=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function En(t,e){return e??Ga[t%Ga.length]}function ml(t=600){const e=S.useRef(null),[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{var c;const a=Math.round(((c=i[0])==null?void 0:c.contentRect.width)??0);a>0&&r(u=>u===a?u:a)});return s.observe(o),()=>s.disconnect()},[]),[e,n]}function ky(t,e=4){if(t<=0)return{max:1,ticks:[0,1]};const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r,s=(o<=1?1:o<=2?2:o<=5?5:10)*r,i=Math.ceil(t/s)*s,a=[];for(let c=0;c<=i+1e-9;c+=s)a.push(Number(c.toFixed(6)));return{max:i,ticks:a}}function UN(t,e,n,r,o,s){const i=(v,x)=>[t+v*Math.sin(x),e-v*Math.cos(x)],a=s-o>Math.PI?1:0,[c,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${t} ${e} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,m]=i(r,s),[y,g]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${m}`,`A ${r} ${r} 0 ${a} 0 ${y} ${g}`,"Z"].join(" ")}function gl({caption:t,head:e,rows:n}){return l.jsxs("table",{className:"cny-sr-only",children:[l.jsx("caption",{children:t}),l.jsx("thead",{children:l.jsx("tr",{children:e.map((r,o)=>l.jsx("th",{scope:"col",children:r},o))})}),l.jsx("tbody",{children:n.map((r,o)=>l.jsx("tr",{children:r.map((s,i)=>l.jsx("td",{children:s},i))},o))})]})}const ke={top:12,right:14,bottom:28,left:40};function zN({data:t,xKey:e,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:a=!0,yTickFormatter:c=y=>String(y),xTickFormatter:u=y=>y,renderTooltip:d,className:f,style:h,sx:m}){const[y,g]=ml(),[v,x]=S.useState(null),w=Math.max(0,g-ke.left-ke.right),b=Math.max(0,r-ke.top-ke.bottom),C=(I,L)=>Number(I[L]??0),P=t.length?Math.max(0,...t.map(I=>s?n.reduce((L,$)=>L+C(I,$.key),0):Math.max(...n.map(L=>C(I,L.key))))):0,{max:R,ticks:M}=ky(P),j=I=>ke.top+b*(1-I/R),T=t.length,E=T?w/T:0,N=E*.68,_=I=>ke.left+I*E+(E-N)/2,F=s?N:N/Math.max(1,n.length),{className:U,style:J,styleTag:z}=re(m,{position:"relative",...h},"cny-chart",f);return l.jsxs("div",{ref:y,className:U,style:J,children:[z,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":o,children:[i&&M.map(I=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:ke.left,x2:g-ke.right,y1:j(I),y2:j(I)}),l.jsx("text",{className:"cny-chart-axis",x:ke.left-6,y:j(I),dy:"0.32em",textAnchor:"end",children:c(I)})]},I)),t.map((I,L)=>{let $=0;return l.jsx("g",{children:n.map((D,q)=>{const A=C(I,D.key),G=A/R*b;let O,V;return s?(O=_(L),V=j($+A),$+=A):(O=_(L)+q*F,V=j(A)),l.jsx("rect",{className:"cny-chart-bar",x:O,y:V,width:Math.max(0,F-(s?0:2)),height:Math.max(0,G),rx:2,fill:En(q,D.color)},D.key)})},L)}),t.map((I,L)=>{const $=u(String(I[e]??"")),D=`${$}: ${n.map(q=>`${q.label??q.key} ${C(I,q.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:ke.left+L*E+E/2,y:r-ke.bottom+16,textAnchor:"middle",children:$}),l.jsx("rect",{className:"cny-chart-hit",x:ke.left+L*E,y:ke.top,width:E,height:b,fill:"transparent",tabIndex:0,"aria-label":D,onMouseEnter:()=>x({index:L,x:ke.left+L*E+E/2,y:ke.top}),onMouseLeave:()=>x(null),onFocus:()=>x({index:L,x:ke.left+L*E+E/2,y:ke.top}),onBlur:()=>x(null)})]},`x-${L}`)})]}),l.jsx(gl,{caption:o,head:[String(e),...n.map(I=>I.label??I.key)],rows:t.map(I=>[u(String(I[e]??"")),...n.map(L=>C(I,L.key))])}),v&&t[v.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${v.x/g*100}%`,top:v.y},children:d?d({label:String(t[v.index][e]),datum:t[v.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[v.index][e])}),n.map((I,L)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:En(L,I.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:I.label??I.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(t[v.index],I.key)})]},I.key))]})}),a&&l.jsx("div",{className:"cny-chart-legend",children:n.map((I,L)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:En(L,I.color)}}),I.label??I.key]},I.key))})]})}const rt={top:12,right:14,bottom:28,left:40};function _y({data:t,xKey:e,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:a=!0,grid:c=!0,legend:u=!0,yTickFormatter:d=v=>String(v),xTickFormatter:f=v=>v,renderTooltip:h,className:m,style:y,sx:g}){const[v,x]=ml(),[w,b]=S.useState(null),C=Math.max(0,x-rt.left-rt.right),P=Math.max(0,r-rt.top-rt.bottom),R=($,D)=>Number($[D]??0),M=t.length?Math.max(0,...t.map($=>i?n.reduce((D,q)=>D+R($,q.key),0):Math.max(...n.map(D=>R($,D.key))))):0,{max:j,ticks:T}=ky(M),E=$=>rt.top+P*(1-$/j),N=t.length,_=N?C/N:0,F=$=>rt.left+$*_+_/2,U=E(0),J=t.map(()=>0),{className:z,style:I,styleTag:L}=re(g,{position:"relative",...y},"cny-chart",m);return l.jsxs("div",{ref:v,className:z,style:I,children:[L,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,role:"img","aria-label":o,children:[c&&T.map($=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:rt.left,x2:x-rt.right,y1:E($),y2:E($)}),l.jsx("text",{className:"cny-chart-axis",x:rt.left-6,y:E($),dy:"0.32em",textAnchor:"end",children:d($)})]},$)),n.map(($,D)=>{const q=En(D,$.color),A=t.map((V,B)=>{const X=R(V,$.key),K=i?J[B]:0,W=K+X;return i&&(J[B]=W),{x:F(B),y:E(W),yBase:E(K)}});if(A.length===0)return null;const G=A.map(V=>`${V.x},${V.y}`).join(" "),O=`M ${A[0].x} ${i?A[0].yBase:U} `+A.map(V=>`L ${V.x} ${V.y}`).join(" ")+` L ${A[A.length-1].x} ${i?A[A.length-1].yBase:U} Z`;return l.jsxs("g",{children:[s&&l.jsx("path",{className:"cny-chart-area",d:O,fill:q}),l.jsx("polyline",{className:"cny-chart-line",points:G,fill:"none",stroke:q}),a&&A.map((V,B)=>l.jsx("circle",{className:"cny-chart-dot",cx:V.x,cy:V.y,r:3,fill:q},B))]},$.key)}),t.map(($,D)=>{const q=f(String($[e]??"")),A=`${q}: ${n.map(G=>`${G.label??G.key} ${R($,G.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:F(D),y:r-rt.bottom+16,textAnchor:"middle",children:q}),l.jsx("rect",{className:"cny-chart-hit",x:rt.left+D*_,y:rt.top,width:_,height:P,fill:"transparent",tabIndex:0,"aria-label":A,onMouseEnter:()=>b({index:D,x:F(D)}),onMouseLeave:()=>b(null),onFocus:()=>b({index:D,x:F(D)}),onBlur:()=>b(null)})]},`x-${D}`)})]}),l.jsx(gl,{caption:o,head:[String(e),...n.map($=>$.label??$.key)],rows:t.map($=>[f(String($[e]??"")),...n.map(D=>R($,D.key))])}),w&&t[w.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${w.x/x*100}%`,top:rt.top},children:h?h({label:String(t[w.index][e]),datum:t[w.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[w.index][e])}),n.map(($,D)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:En(D,$.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:$.label??$.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:R(t[w.index],$.key)})]},$.key))]})}),u&&l.jsx("div",{className:"cny-chart-legend",children:n.map(($,D)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:En(D,$.color)}}),$.label??$.key]},$.key))})]})}function WN(t){return l.jsx(_y,{...t,area:!1})}function HN(t){return l.jsx(_y,{...t,area:!0})}function KN({data:t,height:e=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,renderTooltip:s,centerLabel:i,className:a,style:c,sx:u}){const[d,f]=ml(360),[h,m]=S.useState(null),y=t.reduce((T,E)=>T+Math.max(0,E.value),0),g=Math.min(f,e),v=f/2,x=e/2,w=g/2*.86,b=r>0?w*r:0;let C=0;const P=t.map((T,E)=>{const N=y>0?Math.max(0,T.value)/y:0,_=C,F=C+N*Math.PI*2;return C=F,{d:T,i:E,start:_,end:F,frac:N,color:En(E,T.color)}}),{className:R,style:M,styleTag:j}=re(u,{position:"relative",...c},"cny-chart",a);return l.jsxs("div",{ref:d,className:R,style:M,children:[j,l.jsxs("svg",{width:"100%",height:e,viewBox:`0 0 ${f} ${e}`,role:"img","aria-label":n,children:[P.map(T=>T.frac>=.9999?l.jsx("circle",{className:Y("cny-chart-slice",h===T.i&&"is-active"),cx:v,cy:x,r:b>0?(w+b)/2:w,fill:b>0?"none":T.color,stroke:b>0?T.color:void 0,strokeWidth:b>0?w-b:void 0,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i):l.jsx("path",{className:Y("cny-chart-slice",h===T.i&&"is-active"),d:UN(v,x,w,b,T.start,T.end),fill:T.color,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i)),i!=null&&b>0&&l.jsx("foreignObject",{x:v-b,y:x-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:i})})]}),l.jsx(gl,{caption:n,head:["Slice","Value","Share"],rows:P.map(T=>[T.d.label,T.d.value,`${Math.round(T.frac*100)}%`])}),h!=null&&P[h]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:s?s({datum:P[h].d,percent:P[h].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P[h].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:P[h].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[P[h].d.value," (",Math.round(P[h].frac*100),"%)"]})]})}),o&&l.jsx("div",{className:"cny-chart-legend",children:P.map(T=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:T.color}}),T.d.label]},T.i))})]})}function YN({height:t=300,children:e,className:n,style:r,sx:o}){const s=S.Children.only(e),{className:i,style:a,styleTag:c}=re(o,{width:"100%",height:t,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,S.isValidElement(s)?S.cloneElement(s,{height:t}):s]})}const XN=S.forwardRef(function({variant:e="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=re(i,s,"cny-list",e,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),qN=S.forwardRef(function({leading:e,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},m){const y=u??(i?"a":s?"button":"li"),g=!a&&(i!=null||s!=null),v=d??l.jsxs(l.Fragment,{children:[e&&l.jsx("span",{className:"cny-list-item-leading",children:e}),l.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&l.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&l.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&l.jsx("span",{className:"cny-list-item-trailing",children:n})]}),x=l.jsx(y,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:g&&y==="div"?0:void 0,className:Y("cny-list-item",c&&"is-active",a&&"is-disabled",g&&"is-interactive",f),...h,children:v});return y==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),ZN=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,role:"separator",className:Y("cny-list-separator",e),...n})}),QN=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("li",{ref:o,className:Y("cny-list-subheader",e),...r,children:n})});var JN=Object.defineProperty,vr=(t,e)=>JN(t,"name",{value:e,configurable:!0}),yl="Tabs",[ek,$2]=Ce(yl,[pn]),Oy=pn(),[tk,vl]=ek(yl),nk=p.forwardRef(vr(function(e,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,f=Kt(c),[h,m]=be({prop:o,onChange:s,defaultProp:i??"",caller:yl});return l.jsx(tk,{scope:r,baseId:$e(),value:h,onValueChange:m,orientation:a,dir:f,activationMode:u,children:l.jsx(ne.div,{dir:f,"data-orientation":a,...d,ref:n})})},"Tabs")),rk="TabsList",ok=p.forwardRef(vr(function(e,n){const{__scopeTabs:r,loop:o=!0,...s}=e,i=vl(rk,r),a=Oy(r);return l.jsx(ws,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:o,children:l.jsx(ne.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:n})})},"TabsList")),sk="TabsTrigger",ik=p.forwardRef(vr(function(e,n){const{__scopeTabs:r,value:o,disabled:s=!1,...i}=e,a=vl(sk,r),c=Oy(r),u=xl(a.baseId,o),d=bl(a.baseId,o),f=o===a.value;return l.jsx(Cs,{asChild:!0,...c,focusable:!s,active:f,children:l.jsx(ne.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:n,onMouseDown:H(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(o):h.preventDefault()}),onKeyDown:H(e.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&a.onValueChange(o)}),onFocus:H(e.onFocus,()=>{const h=a.activationMode!=="manual";!f&&!s&&h&&a.onValueChange(o)})})})},"TabsTrigger")),ak="TabsContent",ck=p.forwardRef(vr(function(e,n){const{__scopeTabs:r,value:o,forceMount:s,children:i,...a}=e,c=vl(ak,r),u=xl(c.baseId,o),d=bl(c.baseId,o),f=o===c.value,h=p.useRef(f);return p.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Ge,{present:s||f,children:({present:m})=>l.jsx(ne.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})},"TabsContent"));function xl(t,e){return`${t}-trigger-${e}`}vr(xl,"makeTriggerId");function bl(t,e){return`${t}-content-${e}`}vr(bl,"makeContentId");var lk=nk,uk=ok,dk=ik,fk=ck;const hk=S.forwardRef(function({variant:e="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=re(s,o,"cny-tabs",`variant-${e}`,`size-${n}`,r);return l.jsxs(lk,{ref:c,className:u,style:d,...a,children:[f,i]})}),pk=S.forwardRef(function({className:e,...n},r){return l.jsx(uk,{ref:r,className:Y("cny-tabs-list",e),...n})}),mk=S.forwardRef(function({icon:e,badge:n,className:r,children:o,...s},i){return l.jsxs(dk,{ref:i,className:Y("cny-tabs-trigger",r),...s,children:[e&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:e}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),gk=S.forwardRef(function({className:e,...n},r){return l.jsx(fk,{ref:r,className:Y("cny-tabs-content",e),...n})});function yk(t){return t.multiple===!0}const vk=S.forwardRef(function(e,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:a=!1,loadingText:c="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,id:m,"aria-invalid":y,"aria-describedby":g,"aria-label":v,className:x,style:w,sx:b}=e,C=S.useId(),P=m??`cny-ac-${C}`,[R,M]=S.useState(!1),[j,T]=S.useState(""),E=S.useRef(null),N=yk(e),[_,F]=S.useState(!N&&e.defaultValue!==void 0?e.defaultValue??null:null),[U,J]=S.useState(N&&e.defaultValue!==void 0?e.defaultValue??[]:[]),z=N?e.value!==void 0?e.value:U:(()=>{const B=e.value!==void 0?e.value:_;return B==null?[]:[B]})(),I=S.useCallback(B=>{var X,K;if(N)e.value===void 0&&J(B),(X=e.onValueChange)==null||X.call(e,B);else{const W=B[0]??null;e.value===void 0&&F(W),(K=e.onValueChange)==null||K.call(e,W)}},[N,e]),L=S.useCallback(B=>{if(!B.disabled)if(N){const X=e.maxItems,K=z.includes(B.value);let W;if(K)W=z.filter(Z=>Z!==B.value);else{if(X!=null&&z.length>=X)return;W=[...z,B.value]}I(W)}else I([B.value]),M(!1)},[I,N,z,e]),$=S.useCallback(B=>{var X;B.stopPropagation(),I([]),(X=E.current)==null||X.focus()},[I]),D=S.useMemo(()=>{const B=new Map;for(const X of r){const K=X.group??"";B.has(K)||B.set(K,[]),B.get(K).push(X)}return Array.from(B.entries())},[r]),q=B=>{var X;return((X=r.find(K=>K.value===B))==null?void 0:X.label)??B},A=z.length===0?o:N?z.length===1?q(z[0]):`${q(z[0])} +${z.length-1}`:q(z[0]),{className:G,style:O,styleTag:V}=re(b,w,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,z.length>0&&"has-value",R&&"is-open",x);return l.jsxs(Gc,{open:R,onOpenChange:M,children:[l.jsx(Uc,{asChild:!0,children:l.jsxs("button",{ref:B=>{E.current=B,typeof n=="function"?n(B):n&&(n.current=B)},type:"button",id:P,className:G,style:O,disabled:f,"aria-label":v,"aria-invalid":y,"aria-describedby":g,"aria-haspopup":"listbox","aria-expanded":R,children:[V,l.jsx("span",{className:Y("cny-ac-value",z.length===0&&"is-placeholder"),children:A}),h&&z.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:$,onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),$(B))},onPointerDown:B=>B.stopPropagation(),children:l.jsx(Yt,{size:13,"aria-hidden":"true"})}),l.jsx(Op,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(zc,{children:l.jsx(Wc,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(je,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(je.Input,{value:j,onValueChange:T,placeholder:s})}),l.jsx(je.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Bp,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(je.Empty,{className:"cny-ac-empty",children:i},"empty"),D.map(([B,X],K)=>{const W=X.map((Z,ce)=>{const ie=z.includes(Z.value);return l.jsxs(je.Item,{value:`${B} ${Z.label} ${Z.value}`,disabled:Z.disabled,onSelect:()=>L(Z),className:Y("cny-ac-item",ie&&"is-checked"),children:[N?l.jsx("span",{className:Y("cny-ac-checkbox",ie&&"is-checked"),children:ie&&l.jsx(cn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[Z.icon??null,!Z.icon&&ie&&l.jsx(cn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:Z.label}),Z.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:Z.hint})]},Z.value||`opt-${K}-${ce}`)});return B===""?l.jsx(je.Group,{children:W},`__ungrouped_${K}`):l.jsx(je.Group,{heading:B,children:W},B||`group_${K}`)})]})})]})})})]})}),xk=S.forwardRef(function({items:e,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(rn,{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:e.map((m,y)=>{const g=y===e.length-1,v=l.jsx("span",{className:Y("cny-breadcrumb-label",g&&"is-current"),children:m.label}),x=m.render?m.render(v):m.href&&!g?l.jsx("a",{href:m.href,className:"cny-breadcrumb-link",children:v}):v;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[g?l.jsx("span",{"aria-current":"page",children:v}):x,!g&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},y)})})]})});var bk=Object.defineProperty,ao=(t,e)=>bk(t,"name",{value:e,configurable:!0}),wl="Collapsible",[wk,$y]=Ce(wl),[Ck,Cl]=wk(wl),Sk=p.forwardRef(ao(function(e,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:i,onOpenChange:a,...c}=e,[u,d]=be({prop:o,defaultProp:s??!1,onChange:a,caller:wl});return l.jsx(Ck,{scope:r,disabled:i,contentId:$e(),open:u,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),children:l.jsx(ne.div,{"data-state":Ws(u),"data-disabled":i?"":void 0,...c,ref:n})})},"Collapsible")),Pk="CollapsibleTrigger",Rk=p.forwardRef(ao(function(e,n){const{__scopeCollapsible:r,...o}=e,s=Cl(Pk,r);return l.jsx(ne.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Ws(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:H(e.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),Ly="CollapsibleContent",Tk=p.forwardRef(ao(function(e,n){const{forceMount:r,...o}=e,s=Cl(Ly,e.__scopeCollapsible);return l.jsx(Ge,{present:r||s.open,children:({present:i})=>l.jsx(Mk,{...o,ref:n,present:i})})},"CollapsibleContent")),Mk=p.forwardRef(ao(function(e,n){const{__scopeCollapsible:r,present:o,children:s,...i}=e,a=Cl(Ly,r),[c,u]=p.useState(o),d=p.useRef(null),f=oe(n,d),h=p.useRef(0),m=h.current,y=p.useRef(0),g=y.current,v=a.open||c,x=p.useRef(v),w=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Te(()=>{const b=d.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();h.current=C.height,y.current=C.width,x.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),u(o)}},[a.open,o]),l.jsx(ne.div,{"data-state":Ws(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...i,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&s})},"CollapsibleContentImpl"));function Ws(t){return t?"open":"closed"}ao(Ws,"getState");var Ek=Sk,jk=Rk,Ak=Tk,Dk=Object.defineProperty,at=(t,e)=>Dk(t,"name",{value:e,configurable:!0}),Ot="Accordion",Ik=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Sl,Nk,kk]=ur(Ot),[Hs,L2]=Ce(Ot,[kk,$y]),Pl=$y(),_k=p.forwardRef(at(function(e,n){const{type:r,...o}=e,s=o,i=o;return l.jsx(Sl.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(Fk,{...i,ref:n}):l.jsx(Lk,{...s,ref:n})})},"Accordion")),[Fy,Ok]=Hs(Ot),[Vy,$k]=Hs(Ot,{collapsible:!1}),Lk=p.forwardRef(at(function(e,n){const{value:r,defaultValue:o,onValueChange:s=at(()=>{},"onValueChange"),collapsible:i=!1,...a}=e,[c,u]=be({prop:r,defaultProp:o??"",onChange:s,caller:Ot});return l.jsx(Fy,{scope:e.__scopeAccordion,value:p.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:p.useCallback(()=>i&&u(""),[i,u]),children:l.jsx(Vy,{scope:e.__scopeAccordion,collapsible:i,children:l.jsx(By,{...a,ref:n})})})},"AccordionImplSingle")),Fk=p.forwardRef(at(function(e,n){const{value:r,defaultValue:o,onValueChange:s=at(()=>{},"onValueChange"),...i}=e,[a,c]=be({prop:r,defaultProp:o??[],onChange:s,caller:Ot}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(Fy,{scope:e.__scopeAccordion,value:a,onItemOpen:u,onItemClose:d,children:l.jsx(Vy,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(By,{...i,ref:n})})})},"AccordionImplMultiple")),[Vk,Ks]=Hs(Ot),By=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:i="vertical",...a}=e,c=p.useRef(null),u=oe(c,n),d=Nk(r),h=Kt(s)==="ltr",m=H(e.onKeyDown,y=>{var T;if(!Ik.includes(y.key))return;const g=y.target,v=d().filter(E=>{var N;return!((N=E.ref.current)!=null&&N.disabled)}),x=v.findIndex(E=>E.ref.current===g),w=v.length;if(x===-1)return;y.preventDefault();let b=x;const C=0,P=w-1,R=at(()=>{b=x+1,b>P&&(b=C)},"moveNext"),M=at(()=>{b=x-1,b<C&&(b=P)},"movePrev");switch(y.key){case"Home":b=C;break;case"End":b=P;break;case"ArrowRight":i==="horizontal"&&(h?R():M());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(h?M():R());break;case"ArrowUp":i==="vertical"&&M();break}const j=b%w;(T=v[j].ref.current)==null||T.focus()});return l.jsx(Vk,{scope:r,disabled:o,direction:s,orientation:i,children:l.jsx(Sl.Slot,{scope:r,children:l.jsx(ne.div,{...a,"data-orientation":i,ref:u,onKeyDown:o?void 0:m})})})},"AccordionImpl")),Ua="AccordionItem",[Bk,Rl]=Hs(Ua),Gk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,value:o,...s}=e,i=Ks(Ua,r),a=Ok(Ua,r),c=Pl(r),u=$e(),d=o&&a.value.includes(o)||!1,f=i.disabled||e.disabled;return l.jsx(Bk,{scope:r,open:d,disabled:f,triggerId:u,children:l.jsx(Ek,{"data-orientation":i.orientation,"data-state":Tl(d),...c,...s,ref:n,disabled:f,open:d,onOpenChange:h=>{h?a.onItemOpen(o):a.onItemClose(o)}})})},"AccordionItem")),Uk="AccordionHeader",zk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=Ks(Ot,r),i=Rl(Uk,r);return l.jsx(ne.h3,{"data-orientation":s.orientation,"data-state":Tl(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),sf="AccordionTrigger",Wk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=Ks(Ot,r),i=Rl(sf,r),a=$k(sf,r),c=Pl(r);return l.jsx(Sl.ItemSlot,{scope:r,children:l.jsx(jk,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...c,...o,ref:n})})},"AccordionTrigger")),Hk="AccordionContent",Kk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=Ks(Ot,r),i=Rl(Hk,r),a=Pl(r);return l.jsx(Ak,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function Tl(t){return t?"open":"closed"}at(Tl,"getState");var Yk=_k,Xk=Gk,qk=zk,Zk=Wk,Qk=Kk;const Jk=S.forwardRef(function({variant:e="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-${e}`,n);return l.jsxs(Yk,{ref:a,className:c,style:u,...i,children:[d,s]})}),e2=S.forwardRef(function({className:e,...n},r){return l.jsx(Xk,{ref:r,className:Y("cny-accordion-item",e),...n})}),t2=S.forwardRef(function({children:e,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(qk,{className:"cny-accordion-header",children:l.jsxs(Zk,{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:e}),!o&&l.jsx(Xr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),n2=S.forwardRef(function({children:e,className:n,...r},o){return l.jsx(Qk,{ref:o,className:Y("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:e})})});var r2=Object.defineProperty,de=(t,e)=>r2(t,"name",{value:e,configurable:!0}),Gy=["PageUp","PageDown"],Uy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},co="Slider",[za,o2,s2]=ur(co),[Ml,F2]=Ce(co,[s2]),[i2,lo]=Ml(co),a2=p.forwardRef(de(function(e,n){const{name:r,min:o=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:f,onValueChange:h=de(()=>{},"onValueChange"),onValueCommit:m=de(()=>{},"onValueCommit"),inverted:y=!1,form:g,...v}=e,x=p.useRef(new Set),w=p.useRef(0),b=p.useRef(!1),P=a==="horizontal"?c2:l2,[R,M]=p.useState(null),j=oe(n,M),[T=[],E]=be({prop:f,defaultProp:d,onChange:de(I=>{var $;($=[...x.current][w.current])==null||$.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,h(I)},"onChange")}),N=p.useRef(T),_=p.useRef(T);p.useEffect(()=>{const I=g?R==null?void 0:R.ownerDocument.getElementById(g):R==null?void 0:R.closest("form");if(I instanceof HTMLFormElement){const L=de(()=>E(_.current),"reset");return I.addEventListener("reset",L),()=>I.removeEventListener("reset",L)}},[R,g,E]);function F(I){const L=Qy(T,I);z(I,L)}de(F,"handleSlideStart");function U(I){z(I,w.current)}de(U,"handleSlideMove");function J(){String(T)!==String(N.current)&&m(T)}de(J,"handleSlideEnd");function z(I,L,{commit:$}={commit:!1}){const D=jl(i),q=jr(Math.round((I-o)/i)*i+o,D),A=_r(q,[o,s]);E((G=[])=>{const O=qy(G,A,L);if(tv(O,u*i)){w.current=O.indexOf(A);const V=String(O)!==String(G);return V&&$&&m(O),V?O:G}else return G})}return de(z,"updateValues"),l.jsx(i2,{scope:e.__scopeSlider,name:r,disabled:c,min:o,max:s,valueIndexToChangeRef:w,thumbs:x.current,values:T,orientation:a,form:g,children:l.jsx(za.Provider,{scope:e.__scopeSlider,children:l.jsx(za.Slot,{scope:e.__scopeSlider,children:l.jsx(P,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:j,onPointerDown:H(v.onPointerDown,()=>{c||(N.current=T,b.current=!1)}),min:o,max:s,inverted:y,onSlideStart:c?void 0:F,onSlideMove:c?void 0:U,onSlideEnd:c?void 0:J,onHomeKeyDown:()=>{c||(b.current=!0,z(o,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,z(s,T.length-1,{commit:!0}))},onStepKeyDown:({event:I,direction:L})=>{if(!c){b.current=!0;const q=Gy.includes(I.key)||I.shiftKey&&Uy.includes(I.key)?10:1,A=w.current,G=T[A],O=nv(G,{min:o,step:i,direction:L,multiplier:q});z(O,A,{commit:!0})}}})})})})},"Slider")),[Wy,Hy]=Ml(co,{startEdge:"left",endEdge:"right",size:"width",direction:1}),c2=p.forwardRef(de(function(e,n){const{min:r,max:o,dir:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[h,m]=p.useState(null),y=oe(n,m),g=p.useRef(void 0),v=Kt(s),x=v==="ltr",w=x&&!i||!x&&i;function b(C){const P=g.current||h.getBoundingClientRect(),R=[0,P.width],j=Ys(R,w?[r,o]:[o,r]);return g.current=P,j(C-P.left)}return de(b,"getValueFromPointer"),l.jsx(Wy,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:l.jsx(Ky,{dir:v,"data-orientation":"horizontal",...f,ref:y,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const P=b(C.clientX);a==null||a(P)},onSlideMove:C=>{const P=b(C.clientX);c==null||c(P)},onSlideEnd:()=>{g.current=void 0,u==null||u()},onStepKeyDown:C=>{const R=zy[w?"from-left":"from-right"].includes(C.key);d==null||d({event:C,direction:R?-1:1})}})})},"SliderHorizontal")),l2=p.forwardRef(de(function(e,n){const{min:r,max:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=p.useRef(null),h=oe(n,f),m=p.useRef(void 0),y=!s;function g(v){const x=m.current||f.current.getBoundingClientRect(),w=[0,x.height],C=Ys(w,y?[o,r]:[r,o]);return m.current=x,C(v-x.top)}return de(g,"getValueFromPointer"),l.jsx(Wy,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:l.jsx(Ky,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const x=g(v.clientY);i==null||i(x)},onSlideMove:v=>{const x=g(v.clientY);a==null||a(x)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:v=>{const w=zy[y?"from-bottom":"from-top"].includes(v.key);u==null||u({event:v,direction:w?-1:1})}})})},"SliderVertical")),Ky=p.forwardRef(de(function(e,n){const{__scopeSlider:r,onSlideStart:o,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:u,...d}=e,f=lo(co,r);return l.jsx(ne.span,{...d,ref:n,onKeyDown:H(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(c(h),h.preventDefault()):Gy.concat(Uy).includes(h.key)&&(u(h),h.preventDefault())}),onPointerDown:H(e.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(h)}),onPointerMove:H(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:H(e.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),i(h))})})},"SliderImpl")),u2="SliderTrack",d2=p.forwardRef(de(function(e,n){const{__scopeSlider:r,...o}=e,s=lo(u2,r);return l.jsx(ne.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:n})},"SliderTrack")),af="SliderRange",f2=p.forwardRef(de(function(e,n){const{__scopeSlider:r,...o}=e,s=lo(af,r),i=Hy(af,r),a=p.useRef(null),c=oe(n,a),u=s.values.length,d=s.values.map(m=>El(m,s.min,s.max)),f=u>1?Math.min(...d):0,h=100-Math.max(...d);return l.jsx(ne.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:c,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:h+"%"}})},"SliderRange")),h2="SliderThumb",[p2,Yy]=Ml(h2),m2="SliderThumbProvider";function Xy(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:o}=t,s=lo(m2,e),i=o2(e),[a,c]=p.useState(null),u=p.useMemo(()=>a?i().findIndex(v=>v.ref.current===a):-1,[i,a]),d=gr(a),f=a?!!s.form||!!a.closest("form"):!0,h=s.values[u],m=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),y=h===void 0?0:El(h,s.min,s.max);p.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]);const g={value:h,name:m,form:s.form,isFormControl:f,index:u,thumb:a,onThumbChange:c,percent:y,size:d};return l.jsx(p2,{scope:e,...g,children:rv(o)?o(g):r})}de(Xy,"SliderThumbProvider");var Gi="SliderThumbTrigger",g2=p.forwardRef(de(function(e,n){const{__scopeSlider:r,...o}=e,s=lo(Gi,r),i=Hy(Gi,r),{index:a,value:c,percent:u,size:d,onThumbChange:f}=Yy(Gi,r),h=oe(n,f),m=Zy(a,s.values.length),y=d==null?void 0:d[i.size],g=y?Jy(y,u,i.direction):0;return l.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${u}% + ${g}px)`},children:l.jsx(za.ItemSlot,{scope:r,children:l.jsx(ne.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":c,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:c===void 0?{display:"none"}:e.style,onFocus:H(e.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})},"SliderThumbTrigger")),y2=p.forwardRef(de(function(e,n){const{__scopeSlider:r,name:o,...s}=e;return l.jsx(Xy,{__scopeSlider:r,name:o,internal_do_not_use_render:({index:i,isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(g2,{...s,ref:n,__scopeSlider:r}),a?l.jsx(x2,{__scopeSlider:r},i):null]})})},"SliderThumb")),v2="SliderBubbleInput",x2=p.forwardRef(de(function({__scopeSlider:e,...n},r){const{value:o,name:s,form:i}=Yy(v2,e),a=p.useRef(null),c=oe(a,r),u=_c(o);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==o&&m){const y=new Event("input",{bubbles:!0});m.call(d,o),d.dispatchEvent(y)}},[u,o]),l.jsx(ne.input,{style:{display:"none"},name:s,form:i,...n,ref:c,defaultValue:o})},"SliderBubbleInput"));function qy(t=[],e,n){const r=[...t];return r[n]=e,r.sort((o,s)=>o-s)}de(qy,"getNextSortedValues");function El(t,e,n){const s=100/(n-e)*(t-e);return _r(s,[0,100])}de(El,"convertValueToPercentage");function Zy(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}de(Zy,"getLabel");function Qy(t,e){if(t.length===1)return 0;const n=t.map(o=>Math.abs(o-e)),r=Math.min(...n);return n.indexOf(r)}de(Qy,"getClosestValueIndex");function Jy(t,e,n){const r=t/2,s=Ys([0,50],[0,r]);return(r-s(e)*n)*n}de(Jy,"getThumbInBoundsOffset");function ev(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}de(ev,"getStepsBetweenValues");function tv(t,e){if(e>0){const n=ev(t);return Math.min(...n)>=e}return!0}de(tv,"hasMinStepsBetweenValues");function Ys(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}de(Ys,"linearScale");function jl(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,o]=e.split("e"),s=r.split(".")[1]||"",i=Number(o);return Math.max(0,s.length-i)}const n=e.split(".")[1];return n?n.length:0}de(jl,"getDecimalCount");function jr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}de(jr,"roundValue");function nv(t,{min:e,step:n,direction:r,multiplier:o}){const s=jl(n),i=(t-e)/n,a=Math.round(i),c=jr(a*n+e,s)===jr(t,s);let u;return c?u=a+o*r:r>0?u=Math.ceil(i):u=Math.floor(i),jr(u*n+e,s)}de(nv,"getNextStepValue");function rv(t){return typeof t=="function"}de(rv,"isFunction");const b2=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",color:s="primary",showValue:i=!1,formatValue:a,value:c,defaultValue:u,...d},f){const h=c??u??[0],m=a??(x=>x),{className:y,style:g,styleTag:v}=re(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,e);return l.jsxs(a2,{ref:f,className:y,style:g,value:c,defaultValue:u,...d,children:[v,l.jsx(d2,{className:"cny-slider-track",children:l.jsx(f2,{className:"cny-slider-range"})}),h.map((x,w)=>l.jsx(y2,{className:"cny-slider-thumb","aria-label":`Value ${w+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:m(x)})},w))]})}),w2=S.forwardRef(function({steps:e,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:m}=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:[m,e.map((y,g)=>{const v=g<n?"complete":g===n?"active":"upcoming",x=v==="complete"&&!!s;return l.jsxs("li",{className:Y("cny-stepper-step",`is-${v}`),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":v==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:v==="complete"?l.jsx(cn,{size:14}):y.icon??g+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:y.label}),y.description&&l.jsx("span",{className:"cny-stepper-desc",children:y.description})]})]}),g<e.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},g)})]})}),C2=S.forwardRef(function({size:e=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const a=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),c=`cny-loader-fade-reveal-${a}`,u=`cny-loader-${a}`;return l.jsxs("div",{ref:i,className:Y("cny-loader",u,r),style:{width:e,height:e*(24/21.635),color:n,...o},...s,children:[l.jsx("style",{children:`
214
214
  @keyframes ${c} {
215
215
  0%, 100% { opacity: 0; transform: translateY(8px); }
216
216
  15%, 70% { opacity: 1; transform: translateY(0); }
@@ -228,5 +228,5 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
228
228
  @media (prefers-reduced-motion: reduce) {
229
229
  .${u} .cny-loader-path { animation: none; opacity: 1; transform: none; }
230
230
  }
231
- `}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21.635 24",width:"100%",height:"100%","aria-label":"Loading",role:"img",children:l.jsxs("g",{transform:"translate(-1.257)",children:[l.jsx("path",{className:"cny-loader-path cny-loader-path-1",d:"M12.1,0c.164.445.331.89.492,1.336.395,1.1.182.893,1.3,1.1a10.661,10.661,0,0,1,6.248,3.545,10.889,10.889,0,0,1,2.635,5.742,11.121,11.121,0,0,1-1.05,6.511.338.338,0,0,1-.5.2q-2.952-1.155-5.91-2.295c-.974-.376-1.947-.76-2.935-1.1a1.239,1.239,0,0,0-.776.039c-2.143.806-4.276,1.636-6.413,2.457-.779.3-1.56.59-2.336.895-.21.082-.342.07-.45-.159a11.861,11.861,0,0,1-1.136-5.711A10.322,10.322,0,0,1,3.325,6.821,10.552,10.552,0,0,1,8.058,3.065a20.428,20.428,0,0,1,2.754-.7.587.587,0,0,0,.5-.418c.226-.649.475-1.291.714-1.936ZM6.638,14.907l-.087-.079c.11-.279.224-.557.328-.838q1.362-3.7,2.721-7.4c.349-.948.7-1.893,1.052-2.841.142-.386.071-.465-.339-.4-.046.008-.093.015-.138.025A9.679,9.679,0,0,0,3.769,7.9,10.238,10.238,0,0,0,3,17.173a.353.353,0,0,0,.529.229c.5-.193,1.014-.372,1.518-.566,2.225-.856,4.446-1.722,6.676-2.564a1.115,1.115,0,0,1,.706.006c.984.351,1.954.739,2.93,1.114q2.6,1,5.191,2c.272.106.438.057.553-.224a10.579,10.579,0,0,0,.7-5.15,9.587,9.587,0,0,0-1.536-4.234,9.885,9.885,0,0,0-6.433-4.434c-.4-.087-.492.014-.355.4.368,1.027.75,2.049,1.128,3.073l2.272,6.144c.238.645.474,1.29.733,1.995-.154-.045-.241-.064-.323-.1-1.632-.629-3.262-1.266-4.9-1.883a.949.949,0,0,0-.6-.03c-.973.348-1.932.731-2.9,1.1C8.146,14.339,7.392,14.622,6.638,14.907Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-2",d:"M20.8,19.615a.488.488,0,0,1-.668.472c-2.54-.979-5.081-1.953-7.617-2.941a1.3,1.3,0,0,0-1.016.02q-3.751,1.468-7.516,2.9a.6.6,0,0,1-.5-.082c-.266-.217-.214-.414.108-.538,2.737-1.054,5.474-2.11,8.218-3.147a.99.99,0,0,1,.637.044c1.494.561,2.979,1.144,4.468,1.718,1.193.459,2.389.912,3.582,1.373A1.853,1.853,0,0,1,20.8,19.615Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-3",d:"M19.535,21.173c-.368.517-.49.556-1,.357-1.969-.764-3.952-1.5-5.9-2.306a2.146,2.146,0,0,0-1.741.243c-1.8.675-3.589,1.391-5.383,2.087-.418.162-.556.106-.924-.359.239-.109.461-.225.693-.315,2.145-.83,4.288-1.664,6.441-2.473a1.151,1.151,0,0,1,.742.014c2.252.847,4.5,1.718,6.739,2.585C19.311,21.051,19.419,21.115,19.535,21.173Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-4",d:"M6.313,22.58a2.5,2.5,0,0,1,.265-.145c1.686-.65,3.375-1.293,5.058-1.949a1.127,1.127,0,0,1,.881,0c1.649.649,3.3,1.282,4.956,1.923a2.96,2.96,0,0,1,.274.14.807.807,0,0,1-1.033.324c-1.184-.45-2.365-.909-3.548-1.363a5.8,5.8,0,0,0-.826-.3,1.219,1.219,0,0,0-.646.028c-1.407.522-2.812,1.053-4.2,1.613A1.082,1.082,0,0,1,6.313,22.58Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-5",d:"M8.657,23.713c.369-.141.659-.254.949-.364.745-.283,1.489-.57,2.238-.843a.633.633,0,0,1,.4-.027c1.012.375,2.017.767,3.024,1.157.03.011.052.043.126.106a1.809,1.809,0,0,1-1.424.168c-.51-.208-1.012-.442-1.535-.612a1.356,1.356,0,0,0-.742,0,6.489,6.489,0,0,0-1.177.461A2.017,2.017,0,0,1,8.657,23.713Z"})]})})]})});exports.Accordion=f$;exports.AccordionContent=m$;exports.AccordionItem=h$;exports.AccordionTrigger=p$;exports.Alert=FP;exports.AreaChart=TO;exports.AspectRatio=dT;exports.Autocomplete=WO;exports.Avatar=VP;exports.AvatarStack=BP;exports.BREAKPOINTS=Tf;exports.Badge=nO;exports.BarChart=RO;exports.Box=jn;exports.Breadcrumb=KO;exports.Button=Ir;exports.ButtonGroup=u1;exports.CHART_COLORS=oc;exports.CannyLoader=$$;exports.Card=OP;exports.Center=fT;exports.Checkbox=Va;exports.Chip=tO;exports.CommandPalette=LN;exports.CommandPaletteTrigger=FN;exports.ConfirmDialog=gy;exports.Container=cT;exports.ContextMenu=g_;exports.ContextMenuCheckboxItem=b_;exports.ContextMenuContent=v_;exports.ContextMenuItem=x_;exports.ContextMenuLabel=S_;exports.ContextMenuRadioGroup=w_;exports.ContextMenuRadioItem=C_;exports.ContextMenuSeparator=R_;exports.ContextMenuSub=P_;exports.ContextMenuSubContent=E_;exports.ContextMenuSubTrigger=T_;exports.ContextMenuTrigger=y_;exports.DataTable=CO;exports.DatePicker=ON;exports.Dialog=my;exports.DialogClose=HN;exports.DialogTrigger=zN;exports.Divider=lT;exports.Drawer=XN;exports.DrawerClose=ZN;exports.DrawerTrigger=qN;exports.FAB=d1;exports.Field=gT;exports.FileUploader=mO;exports.Grid=aT;exports.Group=hT;exports.IconButton=f1;exports.Input=_P;exports.LineChart=PO;exports.List=AO;exports.ListItem=NO;exports.ListSeparator=jO;exports.ListSubheader=IO;exports.Menu=gI;exports.MenuCheckboxItem=bI;exports.MenuContent=vI;exports.MenuItem=xI;exports.MenuLabel=SI;exports.MenuRadioGroup=wI;exports.MenuRadioItem=CI;exports.MenuSeparator=RI;exports.MenuSub=PI;exports.MenuSubContent=EI;exports.MenuSubTrigger=TI;exports.MenuTrigger=yI;exports.MultiSelect=nN;exports.Navbar=zP;exports.NavbarActions=qP;exports.NavbarBrand=HP;exports.NavbarItem=XP;exports.NavbarNav=YP;exports.Pagination=$x;exports.Panel=rc;exports.PanelGroup=yO;exports.PanelResizeHandle=Ox;exports.PieChart=EO;exports.Popover=q_;exports.PopoverAnchor=Q_;exports.PopoverClose=J_;exports.PopoverContent=eO;exports.PopoverTrigger=Z_;exports.Progress=GP;exports.ProgressRing=UP;exports.Radio=vN;exports.RadioGroup=yN;exports.ResponsiveContainer=MO;exports.RichTreeView=fO;exports.Row=iT;exports.Scroll=Gp;exports.ScrollRegion=KP;exports.Select=sA;exports.SelectGroup=aA;exports.SelectItem=iA;exports.SelectLabel=cA;exports.SelectSeparator=lA;exports.Sidebar=ZP;exports.SidebarFooter=JP;exports.SidebarHeader=QP;exports.SidebarItem=nT;exports.SidebarSection=tT;exports.SidebarToggle=eT;exports.Skeleton=Pa;exports.Slider=_$;exports.Spacer=uT;exports.Stack=sT;exports.Stepper=O$;exports.Switch=SN;exports.Tabs=FO;exports.TabsContent=GO;exports.TabsList=VO;exports.TabsTrigger=BO;exports.Text=mT;exports.Textarea=yT;exports.Timeline=rO;exports.TimelineConnector=aO;exports.TimelineContent=cO;exports.TimelineDot=iO;exports.TimelineItem=oO;exports.TimelineOppositeContent=lO;exports.TimelineSeparator=sO;exports.ToastProvider=UN;exports.ToggleButton=S1;exports.ToggleButtonGroup=K1;exports.ToggleButtonGroupItem=z1;exports.Tooltip=z_;exports.TooltipContent=X_;exports.TooltipProvider=K_;exports.TooltipRoot=H_;exports.TooltipTrigger=Y_;exports.TreeItem=kx;exports.TreeView=Dx;exports.disableGlobalCursorStyles=vO;exports.resolveSx=lc;exports.useCommandPalette=$N;exports.useConfirm=YN;exports.useFileDrop=_x;exports.useToast=KN;
231
+ `}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21.635 24",width:"100%",height:"100%","aria-label":"Loading",role:"img",children:l.jsxs("g",{transform:"translate(-1.257)",children:[l.jsx("path",{className:"cny-loader-path cny-loader-path-1",d:"M12.1,0c.164.445.331.89.492,1.336.395,1.1.182.893,1.3,1.1a10.661,10.661,0,0,1,6.248,3.545,10.889,10.889,0,0,1,2.635,5.742,11.121,11.121,0,0,1-1.05,6.511.338.338,0,0,1-.5.2q-2.952-1.155-5.91-2.295c-.974-.376-1.947-.76-2.935-1.1a1.239,1.239,0,0,0-.776.039c-2.143.806-4.276,1.636-6.413,2.457-.779.3-1.56.59-2.336.895-.21.082-.342.07-.45-.159a11.861,11.861,0,0,1-1.136-5.711A10.322,10.322,0,0,1,3.325,6.821,10.552,10.552,0,0,1,8.058,3.065a20.428,20.428,0,0,1,2.754-.7.587.587,0,0,0,.5-.418c.226-.649.475-1.291.714-1.936ZM6.638,14.907l-.087-.079c.11-.279.224-.557.328-.838q1.362-3.7,2.721-7.4c.349-.948.7-1.893,1.052-2.841.142-.386.071-.465-.339-.4-.046.008-.093.015-.138.025A9.679,9.679,0,0,0,3.769,7.9,10.238,10.238,0,0,0,3,17.173a.353.353,0,0,0,.529.229c.5-.193,1.014-.372,1.518-.566,2.225-.856,4.446-1.722,6.676-2.564a1.115,1.115,0,0,1,.706.006c.984.351,1.954.739,2.93,1.114q2.6,1,5.191,2c.272.106.438.057.553-.224a10.579,10.579,0,0,0,.7-5.15,9.587,9.587,0,0,0-1.536-4.234,9.885,9.885,0,0,0-6.433-4.434c-.4-.087-.492.014-.355.4.368,1.027.75,2.049,1.128,3.073l2.272,6.144c.238.645.474,1.29.733,1.995-.154-.045-.241-.064-.323-.1-1.632-.629-3.262-1.266-4.9-1.883a.949.949,0,0,0-.6-.03c-.973.348-1.932.731-2.9,1.1C8.146,14.339,7.392,14.622,6.638,14.907Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-2",d:"M20.8,19.615a.488.488,0,0,1-.668.472c-2.54-.979-5.081-1.953-7.617-2.941a1.3,1.3,0,0,0-1.016.02q-3.751,1.468-7.516,2.9a.6.6,0,0,1-.5-.082c-.266-.217-.214-.414.108-.538,2.737-1.054,5.474-2.11,8.218-3.147a.99.99,0,0,1,.637.044c1.494.561,2.979,1.144,4.468,1.718,1.193.459,2.389.912,3.582,1.373A1.853,1.853,0,0,1,20.8,19.615Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-3",d:"M19.535,21.173c-.368.517-.49.556-1,.357-1.969-.764-3.952-1.5-5.9-2.306a2.146,2.146,0,0,0-1.741.243c-1.8.675-3.589,1.391-5.383,2.087-.418.162-.556.106-.924-.359.239-.109.461-.225.693-.315,2.145-.83,4.288-1.664,6.441-2.473a1.151,1.151,0,0,1,.742.014c2.252.847,4.5,1.718,6.739,2.585C19.311,21.051,19.419,21.115,19.535,21.173Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-4",d:"M6.313,22.58a2.5,2.5,0,0,1,.265-.145c1.686-.65,3.375-1.293,5.058-1.949a1.127,1.127,0,0,1,.881,0c1.649.649,3.3,1.282,4.956,1.923a2.96,2.96,0,0,1,.274.14.807.807,0,0,1-1.033.324c-1.184-.45-2.365-.909-3.548-1.363a5.8,5.8,0,0,0-.826-.3,1.219,1.219,0,0,0-.646.028c-1.407.522-2.812,1.053-4.2,1.613A1.082,1.082,0,0,1,6.313,22.58Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-5",d:"M8.657,23.713c.369-.141.659-.254.949-.364.745-.283,1.489-.57,2.238-.843a.633.633,0,0,1,.4-.027c1.012.375,2.017.767,3.024,1.157.03.011.052.043.126.106a1.809,1.809,0,0,1-1.424.168c-.51-.208-1.012-.442-1.535-.612a1.356,1.356,0,0,0-.742,0,6.489,6.489,0,0,0-1.177.461A2.017,2.017,0,0,1,8.657,23.713Z"})]})})]})});exports.Accordion=Jk;exports.AccordionContent=n2;exports.AccordionItem=e2;exports.AccordionTrigger=t2;exports.Alert=FP;exports.AreaChart=HN;exports.AspectRatio=dR;exports.Autocomplete=vk;exports.Avatar=VP;exports.AvatarStack=BP;exports.BREAKPOINTS=uf;exports.Badge=CN;exports.BarChart=zN;exports.Box=_n;exports.Breadcrumb=xk;exports.Button=kr;exports.ButtonGroup=G0;exports.CHART_COLORS=Ga;exports.CannyLoader=C2;exports.Card=OP;exports.Center=fR;exports.Checkbox=_a;exports.Chip=wN;exports.CommandPalette=CA;exports.CommandPaletteTrigger=SA;exports.ConfirmDialog=Ng;exports.Container=cR;exports.ContextMenu=OI;exports.ContextMenuCheckboxItem=VI;exports.ContextMenuContent=LI;exports.ContextMenuItem=FI;exports.ContextMenuLabel=UI;exports.ContextMenuRadioGroup=BI;exports.ContextMenuRadioItem=GI;exports.ContextMenuSeparator=zI;exports.ContextMenuSub=WI;exports.ContextMenuSubContent=KI;exports.ContextMenuSubTrigger=HI;exports.ContextMenuTrigger=$I;exports.DataTable=GN;exports.DatePicker=lA;exports.Dialog=Ig;exports.DialogClose=DA;exports.DialogTrigger=AA;exports.Divider=lR;exports.Drawer=NA;exports.DrawerClose=_A;exports.DrawerTrigger=kA;exports.FAB=U0;exports.Field=gR;exports.FileUploader=_N;exports.Grid=aR;exports.Group=hR;exports.IconButton=z0;exports.Input=_P;exports.LineChart=WN;exports.List=XN;exports.ListItem=qN;exports.ListSeparator=ZN;exports.ListSubheader=QN;exports.Menu=HD;exports.MenuCheckboxItem=qD;exports.MenuContent=YD;exports.MenuItem=XD;exports.MenuLabel=JD;exports.MenuRadioGroup=ZD;exports.MenuRadioItem=QD;exports.MenuSeparator=eI;exports.MenuSub=tI;exports.MenuSubContent=rI;exports.MenuSubTrigger=nI;exports.MenuTrigger=KD;exports.MultiSelect=fj;exports.Navbar=HP;exports.NavbarActions=qP;exports.NavbarBrand=KP;exports.NavbarItem=XP;exports.NavbarNav=YP;exports.Pagination=Ny;exports.Panel=Ba;exports.PanelGroup=$N;exports.PanelResizeHandle=Iy;exports.PieChart=KN;exports.Popover=gN;exports.PopoverAnchor=vN;exports.PopoverClose=xN;exports.PopoverContent=bN;exports.PopoverTrigger=yN;exports.Progress=GP;exports.ProgressRing=UP;exports.Radio=Bj;exports.RadioGroup=Vj;exports.ResponsiveContainer=YN;exports.RichTreeView=IN;exports.Row=iR;exports.Scroll=zp;exports.ScrollRegion=WP;exports.Select=MM;exports.SelectGroup=jM;exports.SelectItem=EM;exports.SelectLabel=AM;exports.SelectSeparator=DM;exports.Sidebar=ZP;exports.SidebarFooter=JP;exports.SidebarHeader=QP;exports.SidebarItem=nR;exports.SidebarSection=tR;exports.SidebarToggle=eR;exports.Skeleton=ba;exports.Slider=b2;exports.Spacer=uR;exports.Stack=sR;exports.Stepper=w2;exports.Switch=qj;exports.Tabs=hk;exports.TabsContent=gk;exports.TabsList=pk;exports.TabsTrigger=mk;exports.Text=mR;exports.Textarea=yR;exports.Timeline=SN;exports.TimelineConnector=MN;exports.TimelineContent=EN;exports.TimelineDot=TN;exports.TimelineItem=PN;exports.TimelineOppositeContent=jN;exports.TimelineSeparator=RN;exports.ToastProvider=MA;exports.ToggleButton=dS;exports.ToggleButtonGroup=WS;exports.ToggleButtonGroupItem=HS;exports.Tooltip=fN;exports.TooltipContent=mN;exports.TooltipProvider=dN;exports.TooltipRoot=hN;exports.TooltipTrigger=pN;exports.TreeItem=Ay;exports.TreeView=jy;exports.disableGlobalCursorStyles=LN;exports.resolveSx=Wa;exports.useCommandPalette=wA;exports.useConfirm=IA;exports.useFileDrop=Dy;exports.useToast=jA;
232
232
  //# sourceMappingURL=index.cjs.map