canny-ui-react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/components/Alert/Alert.d.ts +2 -0
- package/dist/components/Alert/Alert.types.d.ts +8 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +3 -0
- package/dist/components/Avatar/Avatar.types.d.ts +13 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.types.d.ts +27 -0
- package/dist/components/Button/ButtonGroup.d.ts +13 -0
- package/dist/components/Button/FAB.d.ts +37 -0
- package/dist/components/Button/IconButton.d.ts +13 -0
- package/dist/components/Button/Ripple.d.ts +17 -0
- package/dist/components/Button/ToggleButton.d.ts +18 -0
- package/dist/components/Button/ToggleButtonGroup.d.ts +29 -0
- package/dist/components/Button/index.d.ts +11 -0
- package/dist/components/Card/Card.d.ts +2 -0
- package/dist/components/Card/Card.types.d.ts +6 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +10 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Field/Field.d.ts +31 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.types.d.ts +18 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Layout/Box.d.ts +19 -0
- package/dist/components/Layout/Container.d.ts +11 -0
- package/dist/components/Layout/Divider.d.ts +11 -0
- package/dist/components/Layout/Grid.d.ts +11 -0
- package/dist/components/Layout/Spacer.d.ts +4 -0
- package/dist/components/Layout/Stack.d.ts +12 -0
- package/dist/components/Layout/index.d.ts +13 -0
- package/dist/components/Layout/layout.types.d.ts +38 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +54 -0
- package/dist/components/MultiSelect/index.d.ts +2 -0
- package/dist/components/Navbar/Navbar.d.ts +6 -0
- package/dist/components/Navbar/Navbar.types.d.ts +19 -0
- package/dist/components/Navbar/index.d.ts +2 -0
- package/dist/components/Progress/Progress.d.ts +3 -0
- package/dist/components/Progress/Progress.types.d.ts +12 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +14 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Scroll/Scroll.d.ts +3 -0
- package/dist/components/Scroll/Scroll.types.d.ts +13 -0
- package/dist/components/Scroll/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +51 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +4 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +20 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +7 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +8 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +26 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +13 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/index.cjs +119 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +11531 -0
- package/dist/index.js.map +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/utils/cx.d.ts +2 -0
- package/package.json +83 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),C=require("react"),Ga=require("react-dom");function Ha(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=Ha(C),tr=Ha(Ga);function G(...e){return e.filter(Boolean).join(" ")}const Yo=C.createContext({});function Xo(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const hf=typeof window<"u",Ka=hf?C.useLayoutEffect:C.useEffect,nr=C.createContext(null);function qo(e,t){e.indexOf(t)===-1&&e.push(t)}function Fn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ve=(e,t,n)=>n>t?t:n<e?e:n;function ao(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Vt=()=>{},Fe=()=>{};var Ua;typeof process<"u"&&((Ua=process.env)==null?void 0:Ua.NODE_ENV)!=="production"&&(Vt=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ao(t,n))},Fe=(e,t,n)=>{if(!e)throw new Error(ao(t,n))});const ze={},za=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ya(e){return typeof e=="object"&&e!==null}const Xa=e=>/^0[^.\s]+$/u.test(e);function qa(e){let t;return()=>(t===void 0&&(t=e()),t)}const xe=e=>e,pf=(e,t)=>n=>t(e(n)),sn=(...e)=>e.reduce(pf),en=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Zo{constructor(){this.subscriptions=[]}add(t){return qo(this.subscriptions,t),()=>Fn(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,ye=e=>e/1e3;function Za(e,t){return t?e*(1e3/t):0}const Gs=new Set;function Qo(e,t,n){e||Gs.has(t)||(console.warn(ao(t,n)),Gs.add(t))}const Qa=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mf=1e-7,gf=12;function vf(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Qa(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>mf&&++a<gf);return i}function an(e,t,n,r){if(e===t&&n===r)return xe;const o=s=>vf(s,0,1,e,n);return s=>s===0||s===1?s:Qa(o(s),t,r)}const Ja=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ec=e=>t=>1-e(1-t),tc=an(.33,1.53,.69,.99),Jo=ec(tc),nc=Ja(Jo),rc=e=>e>=1?1:(e*=2)<1?.5*Jo(e):.5*(2-Math.pow(2,-10*(e-1))),es=e=>1-Math.sin(Math.acos(e)),oc=ec(es),sc=Ja(es),yf=an(.42,0,1,1),xf=an(0,0,.58,1),ic=an(.42,0,.58,1),wf=e=>Array.isArray(e)&&typeof e[0]!="number",ac=e=>Array.isArray(e)&&typeof e[0]=="number",Hs={linear:xe,easeIn:yf,easeInOut:ic,easeOut:xf,circIn:es,circInOut:sc,circOut:oc,backIn:Jo,backInOut:nc,backOut:tc,anticipate:rc},bf=e=>typeof e=="string",Ks=e=>{if(ac(e)){Fe(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return an(t,n,r,o)}else if(bf(e))return Fe(Hs[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Hs[e];return e},gn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Sf(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(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const y=f&&o?n:r;return d&&i.add(u),y.add(u),u},cancel:u=>{r.delete(u),i.delete(u)},process:u=>{if(a=u,o){s=!0;return}o=!0;const d=n;n=r,r=d,n.forEach(c),n.clear(),o=!1,s&&(s=!1,l.process(u))}};return l}const Cf=40;function cc(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=gn.reduce((b,S)=>(b[S]=Sf(s),b),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:h,postRender:y}=i,m=()=>{const b=ze.useManualTiming,S=b?o.timestamp:performance.now();n=!1,b||(o.delta=r?1e3/60:Math.max(Math.min(S-o.timestamp,Cf),1)),o.timestamp=S,o.isProcessing=!0,a.process(o),c.process(o),l.process(o),u.process(o),d.process(o),f.process(o),h.process(o),y.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:gn.reduce((b,S)=>{const P=i[S];return b[S]=(R,T=!1,E=!1)=>(n||v(),P.schedule(R,T,E)),b},{}),cancel:b=>{for(let S=0;S<gn.length;S++)i[gn[S]].cancel(b)},state:o,steps:i}}const{schedule:ne,cancel:Ye,state:ce,steps:Dr}=cc(typeof requestAnimationFrame<"u"?requestAnimationFrame:xe,!0);let En;function Pf(){En=void 0}const de={now:()=>(En===void 0&&de.set(ce.isProcessing||ze.useManualTiming?ce.timestamp:performance.now()),En),set:e=>{En=e,queueMicrotask(Pf)}},lc=e=>t=>typeof t=="string"&&t.startsWith(e),uc=lc("--"),Tf=lc("var(--"),ts=e=>Tf(e)?Rf.test(e.split("/*")[0].trim()):!1,Rf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zs(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Lt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},tn={...Lt,transform:e=>Ve(0,1,e)},vn={...Lt,default:1},Zt=e=>Math.round(e*1e5)/1e5,ns=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ef(e){return e==null}const Af=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rs=(e,t)=>n=>!!(typeof n=="string"&&Af.test(n)&&n.startsWith(e)||t&&!Ef(n)&&Object.prototype.hasOwnProperty.call(n,t)),dc=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(ns);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Mf=e=>Ve(0,255,e),Ir={...Lt,transform:e=>Math.round(Mf(e))},ct={test:rs("rgb","red"),parse:dc("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ir.transform(e)+", "+Ir.transform(t)+", "+Ir.transform(n)+", "+Zt(tn.transform(r))+")"};function Df(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 co={test:rs("#"),parse:Df,transform:ct.transform},cn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),We=cn("deg"),Oe=cn("%"),j=cn("px"),If=cn("vh"),kf=cn("vw"),Ys={...Oe,parse:e=>Oe.parse(e)/100,transform:e=>Oe.transform(e*100)},Tt={test:rs("hsl","hue"),parse:dc("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Oe.transform(Zt(t))+", "+Oe.transform(Zt(n))+", "+Zt(tn.transform(r))+")"},se={test:e=>ct.test(e)||co.test(e)||Tt.test(e),parse:e=>ct.test(e)?ct.parse(e):Tt.test(e)?Tt.parse(e):co.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ct.transform(e):Tt.transform(e),getAnimatableNone:e=>{const t=se.parse(e);return t.alpha=0,se.transform(t)}},Nf=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Of(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ns))==null?void 0:t.length)||0)+(((n=e.match(Nf))==null?void 0:n.length)||0)>0}const fc="number",hc="color",jf="var",Vf="var(",Xs="${}",Lf=/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 It(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Lf,c=>(se.test(c)?(r.color.push(s),o.push(hc),n.push(se.parse(c))):c.startsWith(Vf)?(r.var.push(s),o.push(jf),n.push(c)):(r.number.push(s),o.push(fc),n.push(parseFloat(c))),++s,Xs)).split(Xs);return{values:n,split:a,indexes:r,types:o}}function Ff(e){return It(e).values}function pc({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===fc?o+=Zt(r[s]):i===hc?o+=se.transform(r[s]):o+=r[s]}return o}}function _f(e){return pc(It(e))}const Bf=e=>typeof e=="number"?0:se.test(e)?se.getAnimatableNone(e):e,$f=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Bf(e);function Wf(e){const t=It(e);return pc(t)(t.values.map((r,o)=>$f(r,t.split[o])))}const Ce={test:Of,parse:Ff,createTransformer:_f,getAnimatableNone:Wf};function kr(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 Uf({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=kr(c,a,e+1/3),s=kr(c,a,e),i=kr(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function _n(e,t){return n=>n>0?t:e}const re=(e,t,n)=>e+(t-e)*n,Nr=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Gf=[co,ct,Tt],Hf=e=>Gf.find(t=>t.test(e));function qs(e){const t=Hf(e);if(Vt(!!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===Tt&&(n=Uf(n)),n}const Zs=(e,t)=>{const n=qs(e),r=qs(t);if(!n||!r)return _n(e,t);const o={...n};return s=>(o.red=Nr(n.red,r.red,s),o.green=Nr(n.green,r.green,s),o.blue=Nr(n.blue,r.blue,s),o.alpha=re(n.alpha,r.alpha,s),ct.transform(o))},lo=new Set(["none","hidden"]);function Kf(e,t){return lo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zf(e,t){return n=>re(e,t,n)}function os(e){return typeof e=="number"?zf:typeof e=="string"?ts(e)?_n:se.test(e)?Zs:qf:Array.isArray(e)?mc:typeof e=="object"?se.test(e)?Zs:Yf:_n}function mc(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>os(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Yf(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=os(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Xf(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 qf=(e,t)=>{const n=Ce.createTransformer(t),r=It(e),o=It(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?lo.has(e)&&!o.values.length||lo.has(t)&&!r.values.length?Kf(e,t):sn(mc(Xf(r,o),o.values),n):(Vt(!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"),_n(e,t))};function gc(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?re(e,t,n):os(e)(e,t)}const Zf=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ne.update(t,n),stop:()=>Ye(t),now:()=>ce.isProcessing?ce.timestamp:de.now()}},vc=(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)})`},Bn=2e4;function ss(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Bn;)t+=n,r=e.next(t);return t>=Bn?1/0:t}function Qf(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(ss(r),Bn);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:ye(o)}}const oe={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 uo(e,t){return e*Math.sqrt(1-t*t)}const Jf=12;function eh(e,t,n){let r=n;for(let o=1;o<Jf;o++)r=r-e(r)/t(r);return r}const Or=.001;function th({duration:e=oe.duration,bounce:t=oe.bounce,velocity:n=oe.velocity,mass:r=oe.mass}){let o,s;Vt(e<=he(oe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Ve(oe.minDamping,oe.maxDamping,i),e=Ve(oe.minDuration,oe.maxDuration,ye(e)),i<1?(o=l=>{const u=l*i,d=u*e,f=u-n,h=uo(l,i),y=Math.exp(-d);return Or-f/h*y},s=l=>{const d=l*i*e,f=d*n+n,h=Math.pow(i,2)*Math.pow(l,2)*e,y=Math.exp(-d),m=uo(Math.pow(l,2),i);return(-o(l)+Or>0?-1:1)*((f-h)*y)/m}):(o=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-Or+u*d},s=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=eh(o,s,a);if(e=he(e),isNaN(c))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const nh=["duration","bounce"],rh=["stiffness","damping","mass"];function Qs(e,t){return t.some(n=>e[n]!==void 0)}function oh(e){let t={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...e};if(!Qs(e,rh)&&Qs(e,nh))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*Ve(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:oe.mass,stiffness:o,damping:s}}else{const n=th({...e,velocity:0});t={...t,...n,mass:oe.mass},t.isResolvedFromDuration=!0}return t}function $n(e=oe.visualDuration,t=oe.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:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=oh({...n,velocity:-ye(n.velocity||0)}),y=f||0,m=l/(2*Math.sqrt(c*u)),v=i-s,x=ye(Math.sqrt(c/u)),w=Math.abs(v)<5;r||(r=w?oe.restSpeed.granular:oe.restSpeed.default),o||(o=w?oe.restDelta.granular:oe.restDelta.default);let b,S,P,R,T,E;if(m<1)P=uo(x,m),R=(y+m*x*v)/P,b=D=>{const O=Math.exp(-m*x*D);return i-O*(R*Math.sin(P*D)+v*Math.cos(P*D))},T=m*x*R+v*P,E=m*x*v-R*P,S=D=>Math.exp(-m*x*D)*(T*Math.sin(P*D)+E*Math.cos(P*D));else if(m===1){b=O=>i-Math.exp(-x*O)*(v+(y+x*v)*O);const D=y+x*v;S=O=>Math.exp(-x*O)*(x*D*O-y)}else{const D=x*Math.sqrt(m*m-1);b=_=>{const B=Math.exp(-m*x*_),A=Math.min(D*_,300);return i-B*((y+m*x*v)*Math.sinh(A)+D*v*Math.cosh(A))/D};const O=(y+m*x*v)/D,F=m*x*O-v*D,W=m*x*v-O*D;S=_=>{const B=Math.exp(-m*x*_),A=Math.min(D*_,300);return B*(F*Math.sinh(A)+W*Math.cosh(A))}}const k={calculatedDuration:h&&d||null,velocity:D=>he(S(D)),next:D=>{if(!h&&m<1){const F=Math.exp(-m*x*D),W=Math.sin(P*D),_=Math.cos(P*D),B=i-F*(R*W+v*_),A=he(F*(T*W+E*_));return a.done=Math.abs(A)<=r&&Math.abs(i-B)<=o,a.value=a.done?i:B,a}const O=b(D);if(h)a.done=D>=d;else{const F=he(S(D));a.done=Math.abs(F)<=r&&Math.abs(i-O)<=o}return a.value=a.done?i:O,a},toString:()=>{const D=Math.min(ss(k),Bn),O=vc(F=>k.next(D*F).value,D,30);return D+"ms "+O},toTransition:()=>{}};return k}$n.applyToOptions=e=>{const t=Qf(e,100,$n);return e.ease=t.ease,e.duration=he(t.duration),e.type="keyframes",e};const sh=5;function yc(e,t,n){const r=Math.max(t-sh,0);return Za(n-e(r),t-r)}function fo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=E=>a!==void 0&&E<a||c!==void 0&&E>c,y=E=>a===void 0?c:c===void 0||Math.abs(a-E)<Math.abs(c-E)?a:c;let m=n*t;const v=d+m,x=i===void 0?v:i(v);x!==v&&(m=x-d);const w=E=>-m*Math.exp(-E/r),b=E=>x+w(E),S=E=>{const k=w(E),D=b(E);f.done=Math.abs(k)<=l,f.value=f.done?x:D};let P,R;const T=E=>{h(f.value)&&(P=E,R=$n({keyframes:[f.value,y(f.value)],velocity:yc(b,E,f.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return T(0),{calculatedDuration:null,next:E=>{let k=!1;return!R&&P===void 0&&(k=!0,S(E),T(E)),P!==void 0&&E>=P?R.next(E-P):(!k&&S(E),f)}}}function ih(e,t,n){const r=[],o=n||ze.mix||gc,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]||xe:t;a=sn(c,a)}r.push(a)}return r}function ah(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(Fe(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=ih(t,r,o),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=en(e[d],e[d+1],u);return a[d](f)};return n?u=>l(Ve(e[0],e[s-1],u)):l}function ch(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=en(0,t,r);e.push(re(n,1,o))}}function lh(e){const t=[0];return ch(t,e.length-1),t}function uh(e,t){return e.map(n=>n*t)}function dh(e,t){return e.map(()=>t||ic).splice(0,e.length-1)}function Rt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=wf(r)?r.map(Ks):Ks(r),s={done:!1,value:t[0]},i=uh(n&&n.length===t.length?n:lh(t),e),a=ah(i,t,{ease:Array.isArray(o)?o:dh(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const fh=e=>e!==null;function rr(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(fh),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const hh={decay:fo,inertia:fo,tween:Rt,keyframes:Rt,spring:$n};function xc(e){typeof e.type=="string"&&(e.type=hh[e.type])}class is{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 ph=e=>e/100;class Wn extends is{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!==de.now()&&this.tick(de.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;xc(t);const{type:n=Rt,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Rt;process.env.NODE_ENV!=="production"&&c!==Rt&&Fe(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Rt&&typeof a[0]!="number"&&(this.mixKeyframes=sn(ph,gc(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=ss(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=l}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:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:h,type:y,onUpdate:m,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-l*(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,S=r;if(d){const E=Math.min(this.currentTime,o)/a;let k=Math.floor(E),D=E%1;!D&&E>=1&&(D=1),D===1&&k--,k=Math.min(k,d+1),!!(k%2)&&(f==="reverse"?(D=1-D,h&&(D-=h/a)):f==="mirror"&&(S=i)),b=Ve(0,1,D)*a}let P;w?(this.delayState.value=u[0],P=this.delayState):P=S.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 T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return T&&y!==fo&&(P.value=rr(u,this.options,v,this.speed)),m&&m(P.value),T&&this.finish(),P}then(t,n){return this.finished.then(t,n)}get duration(){return ye(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ye(t)}get time(){return ye(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 yc(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(de.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=ye(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Zf,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(de.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 mh(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const lt=e=>e*180/Math.PI,ho=e=>{const t=lt(Math.atan2(e[1],e[0]));return po(t)},gh={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ho,rotateZ:ho,skewX:e=>lt(Math.atan(e[1])),skewY:e=>lt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},po=e=>(e=e%360,e<0&&(e+=360),e),Js=ho,ei=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ti=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),vh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ei,scaleY:ti,scale:e=>(ei(e)+ti(e))/2,rotateX:e=>po(lt(Math.atan2(e[6],e[5]))),rotateY:e=>po(lt(Math.atan2(-e[2],e[0]))),rotateZ:Js,rotate:Js,skewX:e=>lt(Math.atan(e[4])),skewY:e=>lt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function mo(e){return e.includes("scale")?1:0}function go(e,t){if(!e||e==="none")return mo(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=vh,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=gh,o=a}if(!o)return mo(t);const s=r[t],i=o[1].split(",").map(xh);return typeof s=="function"?s(i):i[s]}const yh=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return go(n,t)};function xh(e){return parseFloat(e.trim())}const Ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_t=new Set(Ft),ni=e=>e===Lt||e===j,wh=new Set(["x","y","z"]),bh=Ft.filter(e=>!wh.has(e));function Sh(e){const t=[];return bh.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const He={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})=>go(t,"x"),y:(e,{transform:t})=>go(t,"y")};He.translateX=He.x;He.translateY=He.y;const ut=new Set;let vo=!1,yo=!1,xo=!1;function wc(){if(yo){const e=Array.from(ut).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=Sh(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)})}yo=!1,vo=!1,ut.forEach(e=>e.complete(xo)),ut.clear()}function bc(){ut.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yo=!0)})}function Ch(){xo=!0,bc(),wc(),xo=!1}class as{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?(ut.add(this),vo||(vo=!0,ne.read(bc),ne.resolveKeyframes(wc))):(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])}mh(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ph=e=>e.startsWith("--");function Sc(e,t,n){Ph(t)?e.style.setProperty(t,n):e.style[t]=n}const Th={};function Cc(e,t){const n=qa(e);return()=>Th[t]??n()}const Rh=Cc(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Pc=Cc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ri={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xt([0,.65,.55,1]),circOut:Xt([.55,0,1,.45]),backIn:Xt([.31,.01,.66,-.59]),backOut:Xt([.33,1.53,.69,.99])};function Tc(e,t){if(e)return typeof e=="function"?Pc()?vc(e,t):"ease-out":ac(e)?Xt(e):Array.isArray(e)?e.map(n=>Tc(n,t)||ri.easeOut):ri[e]}function Eh(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=Tc(a,o);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(u,f)}function Rc(e){return typeof e=="function"&&"applyToOptions"in e}function Ah({type:e,...t}){return Rc(e)&&Pc()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Ec extends is{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,Fe(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=Ah(t);this.animation=Eh(n,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=rr(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Sc(n,r,u),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 ye(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ye(t)}get time(){return ye(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&&Rh()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),xe):o(this)}}const Ac={anticipate:rc,backInOut:nc,circInOut:sc};function Mh(e){return e in Ac}function Dh(e){typeof e.ease=="string"&&Mh(e.ease)&&(e.ease=Ac[e.ease])}const jr=10;class Ih extends Ec{constructor(t){Dh(t),xc(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 Wn({...i,autoplay:!1}),c=Math.max(jr,de.now()-this.startTime),l=Ve(0,jr,c-jr),u=a.sample(c).value,{name:d}=this.options;s&&d&&Sc(s,d,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const oi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ce.test(e)||e==="0")&&!e.startsWith("url("));function kh(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 Nh(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=oi(o,t),a=oi(s,t);return Vt(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:kh(e)||(n==="spring"||Rc(n))&&r}function wo(e){e.duration=0,e.type="keyframes"}const Mc=new Set(["opacity","clipPath","filter","transform"]),Oh=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function jh(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Oh.test(e[t]))return!0;return!1}const Vh=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Lh=qa(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Fh(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Lh()&&n&&(Mc.has(n)||Vh.has(n)&&jh(a))&&(n!=="transform"||!u)&&!l&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const _h=40;class Bh extends is{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var y;super(),this.stop=()=>{var m,v;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=de.now();const f={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:l,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||as;this.keyframeResolver=new h(a,(m,v,x)=>this.onKeyframesResolved(m,v,f,!x),c,l,u),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,o){var x,w;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=de.now();let d=!0;Nh(t,s,i,a)||(d=!1,(ze.instantAnimations||!c)&&(u==null||u(rr(t,r,n))),t[0]=t[t.length-1],wo(r),r.repeat=0);const h={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>_h?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=d&&!l&&Fh(h),m=(w=(x=h.motionValue)==null?void 0:x.owner)==null?void 0:w.current;let v;if(y)try{v=new Ih({...h,element:m})}catch{v=new Wn(h)}else v=new Wn(h);v.finished.then(()=>{this.notifyFinished()}).catch(xe),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(),Ch()),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 Dc(e,t,n,r=0,o=1){const s=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const $h=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Wh(e){const t=$h.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const Uh=4;function Ic(e,t,n=1){Fe(n<=Uh,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Wh(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return za(i)?parseFloat(i):i}return ts(o)?Ic(o,t,n+1):o}const Gh={type:"spring",stiffness:500,damping:25,restSpeed:10},Hh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Kh={type:"keyframes",duration:.8},zh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yh=(e,{keyframes:t})=>t.length>2?Kh:_t.has(e)?e.startsWith("scale")?Hh(t[1]):Gh:zh;function kc(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function cs(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?kc(n,e):n}const Xh=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function qh(e){for(const t in e)if(!Xh.has(t))return!0;return!1}const ls=(e,t,n,r={},o,s)=>i=>{const a=cs(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-he(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};qh(a)||Object.assign(u,Yh(e,u)),u.duration&&(u.duration=he(u.duration)),u.repeatDelay&&(u.repeatDelay=he(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(wo(u),u.delay===0&&(d=!0)),(ze.instantAnimations||ze.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(d=!0,wo(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=rr(u.keyframes,a);if(f!==void 0){ne.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new Wn(u):new Bh(u)};function si(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function us(e,t,n,r){if(typeof t=="function"){const[o,s]=si(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]=si(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function dt(e,t,n){const r=e.getProps();return us(r,t,n!==void 0?n:r.custom,e)}const Nc=new Set(["width","height","top","left","right","bottom",...Ft]),ii=30,Zh=e=>!isNaN(parseFloat(e));class Qh{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=de.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=de.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zh(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Qo(!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 Zo);const r=this.events[t].add(n);return t==="change"?()=>{r(),ne.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=de.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ii)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ii);return Za(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 kt(e,t){return new Qh(e,t)}const bo=e=>Array.isArray(e);function Jh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,kt(n))}function ep(e){return bo(e)?e[e.length-1]||0:e}function tp(e,t){const n=dt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=ep(s[i]);Jh(e,i,a)}}const le=e=>!!(e&&e.getVelocity);function np(e){return!!(le(e)&&e.add)}function So(e,t){const n=e.getValue("willChange");if(np(n))return n.add(t);if(!n&&ze.WillChange){const r=new ze.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function ds(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const rp="framerAppearId",Oc="data-"+ds(rp);function jc(e){return e.props[Oc]}function op({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Vc(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=t;const c=e.getDefaultTransition();s=s?kc(s,c):c;const l=s==null?void 0:s.reduceMotion;r&&(s=r);const u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const f in a){const h=e.getValue(f,e.latestValues[f]??null),y=a[f];if(y===void 0||d&&op(d,f))continue;const m={delay:n,...cs(s||{},f)},v=h.get();if(v!==void 0&&!h.isAnimating()&&!Array.isArray(y)&&y===v&&!m.velocity){ne.update(()=>h.set(y));continue}let x=!1;if(window.MotionHandoffAnimation){const S=jc(e);if(S){const P=window.MotionHandoffAnimation(S,f,ne);P!==null&&(m.startTime=P,x=!0)}}So(e,f);const w=l??e.shouldReduceMotion;h.start(ls(f,h,y,w&&Nc.has(f)?{type:!1}:m,e,x));const b=h.animation;b&&u.push(b)}if(i){const f=()=>ne.update(()=>{i&&tp(e,i)});u.length?Promise.all(u).then(f):f()}return u}function Co(e,t,n={}){var c;const r=dt(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(Vc(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=o;return sp(e,t,l,u,d,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,u]=a==="beforeChildren"?[s,i]:[i,s];return l().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function sp(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(Co(c,t,{...i,delay:n+(typeof r=="function"?0:r)+Dc(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function ip(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>Co(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=Co(e,t,n);else{const o=typeof t=="function"?dt(e,t,n.custom):t;r=Promise.all(Vc(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const ap={test:e=>e==="auto",parse:e=>e},Lc=e=>t=>t.test(e),Fc=[Lt,j,Oe,We,kf,If,ap],ai=e=>Fc.find(Lc(e));function cp(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Xa(e):!0}const lp=new Set(["brightness","contrast","saturate","opacity"]);function up(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ns)||[];if(!r)return e;const o=n.replace(r,"");let s=lp.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const dp=/\b([a-z-]*)\(.*?\)/gu,Po={...Ce,getAnimatableNone:e=>{const t=e.match(dp);return t?t.map(up).join(" "):e}},To={...Ce,getAnimatableNone:e=>{const t=Ce.parse(e);return Ce.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},ci={...Lt,transform:Math.round},fp={rotate:We,rotateX:We,rotateY:We,rotateZ:We,scale:vn,scaleX:vn,scaleY:vn,scaleZ:vn,skew:We,skewX:We,skewY:We,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:tn,originX:Ys,originY:Ys,originZ:j},fs={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...fp,zIndex:ci,fillOpacity:tn,strokeOpacity:tn,numOctaves:ci},hp={...fs,color:se,backgroundColor:se,outlineColor:se,fill:se,stroke:se,borderColor:se,borderTopColor:se,borderRightColor:se,borderBottomColor:se,borderLeftColor:se,filter:Po,WebkitFilter:Po,mask:To,WebkitMask:To},_c=e=>hp[e],pp=new Set([Po,To]);function Bc(e,t){let n=_c(e);return pp.has(n)||(n=Ce),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const mp=new Set(["auto","none","0"]);function gp(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!mp.has(s)&&It(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Bc(n,o)}class vp extends as{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 u=0;u<t.length;u++){let d=t[u];if(typeof d=="string"&&(d=d.trim(),ts(d))){const f=Ic(d,n.current);f!==void 0&&(t[u]=f),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Nc.has(r)||t.length!==2)return;const[o,s]=t,i=ai(o),a=ai(s),c=zs(o),l=zs(s);if(c!==l&&He[r]){this.needsMeasurement=!0;return}if(i!==a)if(ni(i)&&ni(a))for(let u=0;u<t.length;u++){const d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else He[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||cp(t[o]))&&r.push(o);r.length&&gp(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=He[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]=He[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,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function $c(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 Wc=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function An(e){return Ya(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:hs}=cc(queueMicrotask,!1),be={x:!1,y:!1};function Uc(){return be.x||be.y}function yp(e){return e==="x"||e==="y"?be[e]?null:(be[e]=!0,()=>{be[e]=!1}):be.x||be.y?null:(be.x=be.y=!0,()=>{be.x=be.y=!1})}function Gc(e,t){const n=$c(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function xp(e){return!(e.pointerType==="touch"||Uc())}function wp(e,t,n={}){const[r,o,s]=Gc(e,n);return r.forEach(i=>{let a=!1,c=!1,l;const u=()=>{i.removeEventListener("pointerleave",y)},d=v=>{l&&(l(v),l=void 0),u()},f=v=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,d(v))},h=()=>{a=!0,window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",f,o)},y=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}d(v)}},m=v=>{if(!xp(v))return;c=!1;const x=t(i,v);typeof x=="function"&&(l=x,i.addEventListener("pointerleave",y,o))};i.addEventListener("pointerenter",m,o),i.addEventListener("pointerdown",h,o)}),s}const Hc=(e,t)=>t?e===t?!0:Hc(e,t.parentElement):!1,ps=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,bp=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Sp(e){return bp.has(e.tagName)||e.isContentEditable===!0}const Cp=new Set(["INPUT","SELECT","TEXTAREA"]);function Pp(e){return Cp.has(e.tagName)||e.isContentEditable===!0}const Mn=new WeakSet;function li(e){return t=>{t.key==="Enter"&&e(t)}}function Vr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Tp=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=li(()=>{if(Mn.has(n))return;Vr(n,"down");const o=li(()=>{Vr(n,"up")}),s=()=>Vr(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 ui(e){return ps(e)&&!Uc()}const di=new WeakSet;function Rp(e,t,n={}){const[r,o,s]=Gc(e,n),i=a=>{const c=a.currentTarget;if(!ui(a)||di.has(a))return;Mn.add(c),n.stopPropagation&&di.add(a);const l=t(c,a),u=(h,y)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Mn.has(c)&&Mn.delete(c),ui(h)&&typeof l=="function"&&l(h,{success:y})},d=h=>{u(h,c===window||c===document||n.useGlobalTarget||Hc(c,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),An(a)&&(a.addEventListener("focus",l=>Tp(l,o)),!Sp(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function ms(e){return Ya(e)&&"ownerSVGElement"in e}const Dn=new WeakMap;let Ue;const Kc=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:ms(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Ep=Kc("inline","width","offsetWidth"),Ap=Kc("block","height","offsetHeight");function Mp({target:e,borderBoxSize:t}){var n;(n=Dn.get(e))==null||n.forEach(r=>{r(e,{get width(){return Ep(e,t)},get height(){return Ap(e,t)}})})}function Dp(e){e.forEach(Mp)}function Ip(){typeof ResizeObserver>"u"||(Ue=new ResizeObserver(Dp))}function kp(e,t){Ue||Ip();const n=$c(e);return n.forEach(r=>{let o=Dn.get(r);o||(o=new Set,Dn.set(r,o)),o.add(t),Ue==null||Ue.observe(r)}),()=>{n.forEach(r=>{const o=Dn.get(r);o==null||o.delete(t),o!=null&&o.size||Ue==null||Ue.unobserve(r)})}}const In=new Set;let Et;function Np(){Et=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};In.forEach(t=>t(e))},window.addEventListener("resize",Et)}function Op(e){return In.add(e),Et||Np(),()=>{In.delete(e),!In.size&&typeof Et=="function"&&(window.removeEventListener("resize",Et),Et=void 0)}}function fi(e,t){return typeof e=="function"?Op(e):kp(e,t)}function jp(e){return ms(e)&&e.tagName==="svg"}const Vp=[...Fc,se,Ce],Lp=e=>Vp.find(Lc(e)),hi=()=>({translate:0,scale:1,origin:0,originPoint:0}),At=()=>({x:hi(),y:hi()}),pi=()=>({min:0,max:0}),ae=()=>({x:pi(),y:pi()}),Fp=new WeakMap;function or(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function nn(e){return typeof e=="string"||Array.isArray(e)}const gs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vs=["initial",...gs];function sr(e){return or(e.animate)||vs.some(t=>nn(e[t]))}function zc(e){return!!(sr(e)||e.variants)}function _p(e,t,n){for(const r in t){const o=t[r],s=n[r];if(le(o))e.addValue(r,o);else if(le(s))e.addValue(r,kt(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,kt(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ro={current:null},Yc={current:!1},Bp=typeof window<"u";function $p(){if(Yc.current=!0,!!Bp)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ro.current=e.matches;e.addEventListener("change",t),t()}else Ro.current=!1}const mi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Un={};function Xc(e){Un=e}function Wp(){return Un}class Up{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=as,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 h=de.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ne.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,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=sr(n),this.isVariantNode=zc(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const y=f[h];l[h]!==void 0&&le(y)&&y.set(l[h])}}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,Fp.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:(Yc.current||$p(),this.shouldReduceMotion=Ro.current),process.env.NODE_ENV!=="production"&&Qo(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(),Ye(this.notifyUpdate),Ye(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&&Mc.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,d=new Ec({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:he(u)}),f=i(d);this.valueSubscriptions.set(t,()=>{f(),d.cancel()});return}const r=_t.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ne.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 Un){const n=Un[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):ae()}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<mi.length;r++){const o=mi[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=_p(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=kt(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"&&(za(r)||Xa(r))?r=parseFloat(r):!Lp(r)&&Ce.test(n)&&(r=Bc(t,n)),this.setBaseTarget(t,le(r)?r.get():r)),le(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=us(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&&!le(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 Zo),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){hs.render(this.render)}}class qc extends Up{constructor(){super(...arguments),this.KeyframeResolver=vp}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;le(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Je{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Zc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Gp({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Hp(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 Lr(e){return e===void 0||e===1}function Eo({scale:e,scaleX:t,scaleY:n}){return!Lr(e)||!Lr(t)||!Lr(n)}function at(e){return Eo(e)||Qc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Qc(e){return gi(e.x)||gi(e.y)}function gi(e){return e&&e!=="0%"}function Gn(e,t,n){const r=e-n,o=t*r;return n+o}function vi(e,t,n,r,o){return o!==void 0&&(e=Gn(e,o,r)),Gn(e,n,r)+t}function Ao(e,t=0,n=1,r,o){e.min=vi(e.min,t,n,r,o),e.max=vi(e.max,t,n,r,o)}function Jc(e,{x:t,y:n}){Ao(e.x,t.translate,t.scale,t.originPoint),Ao(e.y,n.translate,n.scale,n.originPoint)}const yi=.999999999999,xi=1.0000000000001;function Kp(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:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Ie(e.x,-s.scroll.offset.x),Ie(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Jc(e,i)),r&&at(s.latestValues)&&kn(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<xi&&t.x>yi&&(t.x=1),t.y<xi&&t.y>yi&&(t.y=1)}function Ie(e,t){e.min+=t,e.max+=t}function wi(e,t,n,r,o=.5){const s=re(e.min,e.max,o);Ao(e,t,n,s,r)}function bi(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function kn(e,t,n){const r=n??e;wi(e.x,bi(t.x,r.x),t.scaleX,t.scale,t.originX),wi(e.y,bi(t.y,r.y),t.scaleY,t.scale,t.originY)}function el(e,t){return Zc(Hp(e.getBoundingClientRect(),t))}function zp(e,t,n){const r=el(e,n),{scroll:o}=t;return o&&(Ie(r.x,o.offset.x),Ie(r.y,o.offset.y)),r}const Yp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Xp=Ft.length;function qp(e,t,n){let r="",o=!0;for(let s=0;s<Xp;s++){const i=Ft[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 l=parseFloat(a);c=i.startsWith("scale")?l===1:l===0}if(!c||n){const l=Wc(a,fs[i]);if(!c){o=!1;const u=Yp[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function ys(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(_t.has(c)){i=!0;continue}else if(uc(c)){o[c]=l;continue}else{const u=Wc(l,fs[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=qp(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}function tl(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 Si(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const zt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(j.test(e))e=parseFloat(e);else return e;const n=Si(e,t.target.x),r=Si(e,t.target.y);return`${n}% ${r}%`}},Zp={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ce.parse(e);if(o.length>5)return r;const s=Ce.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 l=re(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),s(o)}},Mo={borderRadius:{...zt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zt,borderTopRightRadius:zt,borderBottomLeftRadius:zt,borderBottomRightRadius:zt,boxShadow:Zp};function nl(e,{layout:t,layoutId:n}){return _t.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Mo[e]||e==="opacity")}function xs(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)(le(r[a])||o&&le(o[a])||nl(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Qp(e){return window.getComputedStyle(e)}class Jp extends qc{constructor(){super(...arguments),this.type="html",this.renderInstance=tl}readValueFromInstance(t,n){var r;if(_t.has(n))return(r=this.projection)!=null&&r.isProjecting?mo(n):yh(t,n);{const o=Qp(t),s=(uc(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return el(t,n)}build(t,n,r){ys(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return xs(t,n,r)}}const em={offset:"stroke-dashoffset",array:"stroke-dasharray"},tm={offset:"strokeDashoffset",array:"strokeDasharray"};function nm(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?em:tm;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const rm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function rl(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,l,u){if(ys(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox);for(const h of rm)d[h]!==void 0&&(f[h]=d[h],delete d[h]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&nm(d,o,s,i,!1)}const ol=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"]),sl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function om(e,t,n,r){tl(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(ol.has(o)?o:ds(o),t.attrs[o])}function il(e,t,n){const r=xs(e,t,n);for(const o in e)if(le(e[o])||le(t[o])){const s=Ft.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}class sm extends qc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ae}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(_t.has(n)){const r=_c(n);return r&&r.default||0}return n=ol.has(n)?n:ds(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return il(t,n,r)}build(t,n,r){rl(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){om(t,n,r,o)}mount(t){this.isSVGTag=sl(t.tagName),super.mount(t)}}const im=vs.length;function al(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?al(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<im;n++){const r=vs[n],o=e.props[r];(nn(o)||o===!1)&&(t[r]=o)}return t}function cl(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 am=[...gs].reverse(),cm=gs.length;function lm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ip(e,n,r)))}function um(e){let t=lm(e),n=Ci(),r=!0,o=!1;const s=l=>(u,d)=>{var h;const f=dt(e,d,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:y,transitionEnd:m,...v}=f;u={...u,...v,...m}}return u};function i(l){t=l(e)}function a(l){const{props:u}=e,d=al(e.parent)||{},f=[],h=new Set;let y={},m=1/0;for(let x=0;x<cm;x++){const w=am[x],b=n[w],S=u[w]!==void 0?u[w]:d[w],P=nn(S),R=w===l?b.isActive:null;R===!1&&(m=x);let T=S===d[w]&&S!==u[w]&&P;if(T&&(r||o)&&e.manuallyAnimateOnMount&&(T=!1),b.protectedKeys={...y},!b.isActive&&R===null||!S&&!b.prevProp||or(S)||typeof S=="boolean")continue;if(w==="exit"&&b.isActive&&R!==!0){b.prevResolvedValues&&(y={...y,...b.prevResolvedValues});continue}const E=dm(b.prevProp,S);let k=E||w===l&&b.isActive&&!T&&P||x>m&&P,D=!1;const O=Array.isArray(S)?S:[S];let F=O.reduce(s(w),{});R===!1&&(F={});const{prevResolvedValues:W={}}=b,_={...W,...F},B=I=>{k=!0,h.has(I)&&(D=!0,h.delete(I)),b.needsAnimating[I]=!0;const H=e.getValue(I);H&&(H.liveStyle=!1)};for(const I in _){const H=F[I],te=W[I];if(y.hasOwnProperty(I))continue;let ie=!1;bo(H)&&bo(te)?ie=!cl(H,te):ie=H!==te,ie?H!=null?B(I):h.add(I):H!==void 0&&h.has(I)?B(I):b.protectedKeys[I]=!0}b.prevProp=S,b.prevResolvedValues=F,b.isActive&&(y={...y,...F}),(r||o)&&e.blockInitialAnimation&&(k=!1);const A=T&&E;k&&(!A||D)&&f.push(...O.map(I=>{const H={type:w};if(typeof I=="string"&&(r||o)&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:te}=e,ie=dt(te,I);if(te.enteringChildren&&ie){const{delayChildren:M}=ie.transition||{};H.delay=Dc(te.enteringChildren,e,M)}}return{animation:I,options:H}}))}if(h.size){const x={};if(typeof u.initial!="boolean"){const w=dt(e,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(x.transition=w.transition)}h.forEach(w=>{const b=e.getBaseTarget(w),S=e.getValue(w);S&&(S.liveStyle=!0),x[w]=b??null}),f.push({animation:x})}let v=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,o=!1,v?t(f):Promise.resolve()}function c(l,u){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var y;return(y=h.animationState)==null?void 0:y.setActive(l,u)}),n[l].isActive=u;const d=a(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ci(),o=!0}}}function dm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!cl(t,e):!1}function st(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ci(){return{animate:st(!0),whileInView:st(),whileHover:st(),whileTap:st(),whileDrag:st(),whileFocus:st(),exit:st()}}function Do(e,t){e.min=t.min,e.max=t.max}function we(e,t){Do(e.x,t.x),Do(e.y,t.y)}function Pi(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const ll=1e-4,fm=1-ll,hm=1+ll,ul=.01,pm=0-ul,mm=0+ul;function fe(e){return e.max-e.min}function gm(e,t,n){return Math.abs(e-t)<=n}function Ti(e,t,n,r=.5){e.origin=r,e.originPoint=re(t.min,t.max,e.origin),e.scale=fe(n)/fe(t),e.translate=re(n.min,n.max,e.origin)-e.originPoint,(e.scale>=fm&&e.scale<=hm||isNaN(e.scale))&&(e.scale=1),(e.translate>=pm&&e.translate<=mm||isNaN(e.translate))&&(e.translate=0)}function Qt(e,t,n,r){Ti(e.x,t.x,n.x,r?r.originX:void 0),Ti(e.y,t.y,n.y,r?r.originY:void 0)}function Ri(e,t,n,r=0){const o=r?re(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+fe(t)}function vm(e,t,n,r){Ri(e.x,t.x,n.x,r==null?void 0:r.x),Ri(e.y,t.y,n.y,r==null?void 0:r.y)}function Ei(e,t,n,r=0){const o=r?re(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+fe(t)}function Hn(e,t,n,r){Ei(e.x,t.x,n.x,r==null?void 0:r.x),Ei(e.y,t.y,n.y,r==null?void 0:r.y)}function Ai(e,t,n,r,o){return e-=t,e=Gn(e,1/n,r),o!==void 0&&(e=Gn(e,1/o,r)),e}function ym(e,t=0,n=1,r=.5,o,s=e,i=e){if(Oe.test(t)&&(t=parseFloat(t),t=re(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=re(s.min,s.max,r);e===s&&(a-=t),e.min=Ai(e.min,t,n,a,o),e.max=Ai(e.max,t,n,a,o)}function Mi(e,t,[n,r,o],s,i){ym(e,t[n],t[r],t[o],t.scale,s,i)}const xm=["x","scaleX","originX"],wm=["y","scaleY","originY"];function Di(e,t,n,r){Mi(e.x,t,xm,n?n.x:void 0,r?r.x:void 0),Mi(e.y,t,wm,n?n.y:void 0,r?r.y:void 0)}function Ii(e){return e.translate===0&&e.scale===1}function dl(e){return Ii(e.x)&&Ii(e.y)}function ki(e,t){return e.min===t.min&&e.max===t.max}function bm(e,t){return ki(e.x,t.x)&&ki(e.y,t.y)}function Ni(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fl(e,t){return Ni(e.x,t.x)&&Ni(e.y,t.y)}function Oi(e){return fe(e.x)/fe(e.y)}function ji(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function De(e){return[e("x"),e("y")]}function Sm(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:l,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:y}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}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 hl=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Cm=hl.length,Vi=e=>typeof e=="string"?parseFloat(e):e,Li=e=>typeof e=="number"||j.test(e);function Pm(e,t,n,r,o,s){o?(e.opacity=re(0,n.opacity??1,Tm(r)),e.opacityExit=re(t.opacity??1,0,Rm(r))):s&&(e.opacity=re(t.opacity??1,n.opacity??1,r));for(let i=0;i<Cm;i++){const a=hl[i];let c=Fi(t,a),l=Fi(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Li(c)===Li(l)?(e[a]=Math.max(re(Vi(c),Vi(l),r),0),(Oe.test(l)||Oe.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=re(t.rotate||0,n.rotate||0,r))}function Fi(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Tm=pl(0,.5,oc),Rm=pl(.5,.95,xe);function pl(e,t,n){return r=>r<e?0:r>t?1:n(en(e,t,r))}function Em(e,t,n){const r=le(e)?e:kt(e);return r.start(ls("",r,t,n)),r.animation}function rn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Am=(e,t)=>e.depth-t.depth;class Mm{constructor(){this.children=[],this.isDirty=!1}add(t){qo(this.children,t),this.isDirty=!0}remove(t){Fn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Am),this.isDirty=!1,this.children.forEach(t)}}function Dm(e,t){const n=de.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Ye(r),e(s-t))};return ne.setup(r,!0),()=>Ye(r)}function Nn(e){return le(e)?e.get():e}class Im{constructor(){this.members=[]}add(t){qo(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&&(Fn(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Fn(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 On={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Fr=["","X","Y","Z"],km=1e3;let Nm=0;function _r(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ml(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jc(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ne,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ml(r)}function gl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Nm++,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(Vm),this.nodes.forEach(Wm),this.nodes.forEach(Um),this.nodes.forEach(Lm)},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 Mm)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Zo),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=ms(i)&&!jp(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;ne.read(()=>{d=window.innerWidth}),e(i,()=>{const h=window.innerWidth;h!==d&&(d=h,this.root.updateBlockedByResize=!0,u&&u(),u=Dm(f,250),On.hasAnimatedSinceResize&&(On.hasAnimatedSinceResize=!1,this.nodes.forEach($i)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||l.getDefaultTransition()||Ym,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=l.getProps(),x=!this.targetLayout||!fl(this.targetLayout,h),w=!d&&f;if(this.options.layoutRoot||this.resumeFrom||w||d&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...cs(y,"layout"),onPlay:m,onComplete:v};(l.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(u,w)}else d||$i(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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(),Ye(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(Gm),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&&ml(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(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(_m),this.nodes.forEach(_i);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Bm),this.nodes.forEach($m),this.nodes.forEach(Om),this.nodes.forEach(jm)):this.nodes.forEach(Bi),this.clearAllSnapshots();const a=de.now();ce.delta=Ve(0,1e3/60,a-ce.timestamp),ce.timestamp=a,ce.isProcessing=!0,Dr.update.process(ce),Dr.preRender.process(ce),Dr.render.process(ce),ce.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Fm),this.sharedNodes.forEach(Hm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ne.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ne.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!fe(this.snapshot.measuredBox.x)&&!fe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ae()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!dl(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||at(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Xm(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return ae();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(qm))){const{scroll:u}=this.root;u&&(Ie(a.x,u.offset.x),Ie(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=ae();if(we(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&we(a,i),Ie(a.x,d.offset.x),Ie(a.y,d.offset.y))}return a}applyTransform(i,a=!1,c){var u,d;const l=c||ae();we(l,i);for(let f=0;f<this.path.length;f++){const h=this.path[f];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(Ie(l.x,-h.scroll.offset.x),Ie(l.y,-h.scroll.offset.y)),at(h.latestValues)&&kn(l,h.latestValues,(u=h.layout)==null?void 0:u.layoutBox)}return at(this.latestValues)&&kn(l,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),l}removeTransform(i){var c;const a=ae();we(a,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!at(u.latestValues))continue;let d;u.instance&&(Eo(u.latestValues)&&u.updateSnapshot(),d=ae(),we(d,u.measurePageBox())),Di(a,u.latestValues,(c=u.snapshot)==null?void 0:c.layoutBox,d)}return at(this.latestValues)&&Di(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!==ce.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var h;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||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=ce.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ae(),this.targetWithTransforms=ae()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vm(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):we(this.target,this.layout.layoutBox),Jc(this.target,this.targetDelta)):we(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Eo(this.parent.latestValues)||Qc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ae(),this.relativeTargetOrigin=ae(),Hn(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),we(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===ce.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;we(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Kp(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=ae());const{target:h}=i;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Pi(this.prevProjectionDelta.x,this.projectionDelta.x),Pi(this.prevProjectionDelta.y,this.projectionDelta.y)),Qt(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!ji(this.projectionDelta.x,this.prevProjectionDelta.x)||!ji(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}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=At(),this.projectionDelta=At(),this.projectionDeltaWithTransform=At()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=At();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=ae(),h=c?c.source:void 0,y=this.layout?this.layout.source:void 0,m=h!==y,v=this.getStack(),x=!v||v.members.length<=1,w=!!(m&&!x&&this.options.crossfade===!0&&!this.path.some(zm));this.animationProgress=0;let b;this.mixTargetDelta=S=>{const P=S/1e3;Wi(d.x,i.x,P),Wi(d.y,i.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hn(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Km(this.relativeTarget,this.relativeTargetOrigin,f,P),b&&bm(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=ae()),we(b,this.relativeTarget)),m&&(this.animationValues=u,Pm(u,l,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,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(),this.pendingAnimation&&(Ye(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ne.update(()=>{On.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=kt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Em(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},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(km),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&vl(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||ae();const d=fe(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const f=fe(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+f}we(a,c),kn(a,u),Qt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Im),this.sharedNodes.get(i).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.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 l=this.getStack();l&&l.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 l={};c.z&&_r("z",i,l,this.animationValues);for(let u=0;u<Fr.length;u++)_r(`rotate${Fr[u]}`,i,l,this.animationValues),_r(`skew${Fr[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);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=Nn(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Nn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=Sm(this.projectionDeltaWithTransform,this.treeScale,u);c&&(d=c(u,d)),i.transform=d;const{x:f,y:h}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${h.origin*100}% 0`,l.animationValues?i.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const y in Mo){if(u[y]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:x}=Mo[y],w=d==="none"?u[y]:m(u[y],l);if(v){const b=v.length;for(let S=0;S<b;S++)i[v[S]]=w}else x?this.options.visualElement.renderState.vars[y]=w:i[y]=w}this.options.layoutId&&(i.pointerEvents=l===this?Nn(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(_i),this.root.sharedNodes.clear()}}}function Om(e){e.updateLayout()}function jm(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")De(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=fe(f);f.min=r[d].min,f.max=f.min+h});else if(s==="x"||s==="y"){const d=s==="x"?"y":"x";Do(i?t.measuredBox[d]:t.layoutBox[d],r[d])}else vl(s,t.layoutBox,r)&&De(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=fe(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=At();Qt(a,r,t.layoutBox);const c=At();i?Qt(c,e.applyTransform(o,!0),t.measuredBox):Qt(c,r,t.layoutBox);const l=!dl(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const y=e.options.layoutAnchor||void 0,m=ae();Hn(m,t.layoutBox,f.layoutBox,y);const v=ae();Hn(v,r,h.layoutBox,y),fl(m,v)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Vm(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 Lm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Fm(e){e.clearSnapshot()}function _i(e){e.clearMeasurements()}function _m(e){e.isLayoutDirty=!0,e.updateLayout()}function Bi(e){e.isLayoutDirty=!1}function Bm(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function $m(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $i(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wm(e){e.resolveTargetDelta()}function Um(e){e.calcProjection()}function Gm(e){e.resetSkewAndRotation()}function Hm(e){e.removeLeadSnapshot()}function Wi(e,t,n){e.translate=re(t.translate,0,n),e.scale=re(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ui(e,t,n,r){e.min=re(t.min,n.min,r),e.max=re(t.max,n.max,r)}function Km(e,t,n,r){Ui(e.x,t.x,n.x,r),Ui(e.y,t.y,n.y,r)}function zm(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Ym={duration:.45,ease:[.4,0,.1,1]},Gi=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Hi=Gi("applewebkit/")&&!Gi("chrome/")?Math.round:xe;function Ki(e){e.min=Hi(e.min),e.max=Hi(e.max)}function Xm(e){Ki(e.x),Ki(e.y)}function vl(e,t,n){return e==="position"||e==="preserve-aspect"&&!gm(Oi(t),Oi(n),.2)}function qm(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Zm=gl({attachResizeListener:(e,t)=>rn(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}),Br={current:void 0},yl=gl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Br.current){const e=new Zm({});e.mount(window),e.setOptions({layoutScroll:!0}),Br.current=e}return Br.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ws=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function zi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qm(...e){return t=>{let n=!1;const r=e.map(o=>{const s=zi(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():zi(e[o],null)}}}}function Jm(...e){return p.useCallback(Qm(...e),e)}class eg extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(An(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=An(r)&&r.offsetWidth||0,s=An(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 tg({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){var f;const i=C.useId(),a=C.useRef(null),c=C.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=C.useContext(ws),u=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),d=Jm(a,u);return C.useInsertionEffect(()=>{const{width:h,height:y,top:m,left:v,right:x,bottom:w}=c.current;if(t||s===!1||!a.current||!h||!y)return;const b=n==="left"?`left: ${v}`:`right: ${x}`,S=r==="bottom"?`bottom: ${w}`:`top: ${m}`;a.current.dataset.motionPopId=i;const P=document.createElement("style");l&&(P.nonce=l);const R=o??document.head;return R.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${i}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${h}px !important;
|
|
5
|
+
height: ${y}px !important;
|
|
6
|
+
${b}px !important;
|
|
7
|
+
${S}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),R.contains(P)&&R.removeChild(P)}},[t]),g.jsx(eg,{isPresent:t,childRef:a,sizeRef:c,pop:s,children:s===!1?e:p.cloneElement(e,{ref:d})})}const ng=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:l})=>{const u=Xo(rg),d=C.useId();let f=!0,h=C.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:o,onExitComplete:y=>{u.set(y,!0);for(const m of u.values())if(!m)return;r&&r()},register:y=>(u.set(y,!1),()=>u.delete(y))}),[n,u,r]);return s&&f&&(h={...h}),C.useMemo(()=>{u.forEach((y,m)=>u.set(m,!1))},[n]),p.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=g.jsx(tg,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:l,children:e}),g.jsx(nr.Provider,{value:h,children:e})};function rg(){return new Map}function xl(e=!0){const t=C.useContext(nr);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 yn=e=>e.key||"";function Yi(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const wl=({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:l})=>{const[u,d]=xl(i),f=C.useMemo(()=>Yi(e),[e]),h=i&&!u?[]:f.map(yn),y=C.useRef(!0),m=C.useRef(f),v=Xo(()=>new Map),x=C.useRef(new Set),[w,b]=C.useState(f),[S,P]=C.useState(f);Ka(()=>{y.current=!1,m.current=f;for(let E=0;E<S.length;E++){const k=yn(S[E]);h.includes(k)?(v.delete(k),x.current.delete(k)):v.get(k)!==!0&&v.set(k,!1)}},[S,h.length,h.join("-")]);const R=[];if(f!==w){let E=[...f];for(let k=0;k<S.length;k++){const D=S[k],O=yn(D);h.includes(O)||(E.splice(k,0,D),R.push(D))}return s==="wait"&&R.length&&(E=R),P(Yi(E)),b(f),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(Yo);return g.jsx(g.Fragment,{children:S.map(E=>{const k=yn(E),D=i&&!u?!1:f===S||h.includes(k),O=()=>{if(x.current.has(k))return;if(v.has(k))x.current.add(k),v.set(k,!0);else return;let F=!0;v.forEach(W=>{W||(F=!1)}),F&&(T==null||T(),P(m.current),i&&(d==null||d()),r&&r())};return g.jsx(ng,{isPresent:D,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:l,onExitComplete:D?void 0:O,anchorX:a,anchorY:c,children:E},k)})})},bl=C.createContext({strict:!1}),Xi={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 qi=!1;function og(){if(qi)return;const e={};for(const t in Xi)e[t]={isEnabled:n=>Xi[t].some(r=>!!n[r])};Xc(e),qi=!0}function Sl(){return og(),Wp()}function sg(e){const t=Sl();for(const n in e)t[n]={...t[n],...e[n]};Xc(t)}const ig=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 Kn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ig.has(e)}let Cl=e=>!Kn(e);function ag(e){typeof e=="function"&&(Cl=t=>t.startsWith("on")?!Kn(t):e(t))}try{ag(require("@emotion/is-prop-valid").default)}catch{}function cg(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||le(e[o])||(Cl(o)||n===!0&&Kn(o)||!t&&!Kn(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const ir=C.createContext({});function lg(e,t){if(sr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||nn(n)?n:void 0,animate:nn(r)?r:void 0}}return e.inherit!==!1?t:{}}function ug(e){const{initial:t,animate:n}=lg(e,C.useContext(ir));return C.useMemo(()=>({initial:t,animate:n}),[Zi(t),Zi(n)])}function Zi(e){return Array.isArray(e)?e.join(" "):e}const bs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pl(e,t,n){for(const r in t)!le(t[r])&&!nl(r,n)&&(e[r]=t[r])}function dg({transformTemplate:e},t){return C.useMemo(()=>{const n=bs();return ys(n,t,e),Object.assign({},n.vars,n.style)},[t])}function fg(e,t){const n=e.style||{},r={};return Pl(r,n,e),Object.assign(r,dg(e,t)),r}function hg(e,t){const n={},r=fg(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 Tl=()=>({...bs(),attrs:{}});function pg(e,t,n,r){const o=C.useMemo(()=>{const s=Tl();return rl(s,t,sl(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Pl(s,e.style,e),o.style={...s,...o.style}}return o}const mg=["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 Ss(e){return typeof e!="string"||e.includes("-")?!1:!!(mg.indexOf(e)>-1||/[A-Z]/u.test(e))}function gg(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??Ss(e)?pg:hg)(t,r,o,e),l=cg(t,typeof e=="string",s),u=e!==C.Fragment?{...l,...c,ref:n}:{},{children:d}=t,f=C.useMemo(()=>le(d)?d.get():d,[d]);return C.createElement(e,{...u,children:f})}function vg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:yg(n,r,o,e),renderState:t()}}function yg(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=Nn(s[f]);let{initial:i,animate:a}=e;const c=sr(e),l=zc(e);t&&l&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!or(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const y=us(e,f[h]);if(y){const{transitionEnd:m,transition:v,...x}=y;for(const w in x){let b=x[w];if(Array.isArray(b)){const S=u?b.length-1:0;b=b[S]}b!==null&&(o[w]=b)}for(const w in m)o[w]=m[w]}}}return o}const Rl=e=>(t,n)=>{const r=C.useContext(ir),o=C.useContext(nr),s=()=>vg(e,t,r,o);return n?s():Xo(s)},xg=Rl({scrapeMotionValuesFromProps:xs,createRenderState:bs}),wg=Rl({scrapeMotionValuesFromProps:il,createRenderState:Tl}),bg=Symbol.for("motionComponentSymbol");function Sg(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 El=C.createContext({});function St(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Cg(e,t,n,r,o,s){var b,S;const{visualElement:i}=C.useContext(ir),a=C.useContext(bl),c=C.useContext(nr),l=C.useContext(ws),u=l.reducedMotion,d=l.skipAnimations,f=C.useRef(null),h=C.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:s}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const y=f.current,m=C.useContext(El);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&Pg(f.current,n,o,m);const v=C.useRef(!1);C.useInsertionEffect(()=>{y&&v.current&&y.update(n,c)});const x=n[Oc],w=C.useRef(!!x&&typeof window<"u"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,x))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,x)));return Ka(()=>{h.current=!0,y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),w.current&&y.animationState&&y.animationState.animateChanges())}),C.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 Pg(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Al(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&St(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Al(e){if(e)return e.options.allowProjection!==!1?e.projection:Al(e.parent)}function $r(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&sg(r);const s=n?n==="svg":Ss(e),i=s?wg:xg;function a(l,u){let d;const f={...C.useContext(ws),...l,layoutId:Tg(l)},{isStatic:h}=f,y=ug(l),m=i(l,h);if(!h&&typeof window<"u"){Rg(f,r);const v=Eg(f);d=v.MeasureLayout,y.visualElement=Cg(e,m,f,o,v.ProjectionNode,s)}return g.jsxs(ir.Provider,{value:y,children:[d&&y.visualElement?g.jsx(d,{visualElement:y.visualElement,...f}):null,gg(e,l,Sg(m,y.visualElement,u),m,h,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=C.forwardRef(a);return c[bg]=e,c}function Tg({layoutId:e}){const t=C.useContext(Yo).id;return t&&e!==void 0?t+"-"+e:e}function Rg(e,t){const n=C.useContext(bl).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?Vt(!1,r,"lazy-strict-mode"):Fe(!1,r,"lazy-strict-mode")}}function Eg(e){const t=Sl(),{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 Ag(e,t){if(typeof Proxy>"u")return $r;const n=new Map,r=(s,i)=>$r(s,i,e,t),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Qo(!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,$r(i,void 0,e,t)),n.get(i))})}const Mg=(e,t)=>t.isSVG??Ss(e)?new sm(t):new Jp(t,{allowProjection:e!==C.Fragment});class Dg extends Je{constructor(t){super(t),t.animationState||(t.animationState=um(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();or(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 Ig=0;class kg extends Je{constructor(){super(...arguments),this.id=Ig++,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=dt(this.node,i,a);if(c){const{transition:l,transitionEnd:u,...d}=c;for(const f in d)(s=this.node.getValue(f))==null||s.jump(d[f])}}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 Ng={animation:{Feature:Dg},exit:{Feature:kg}};function ln(e){return{point:{x:e.pageX,y:e.pageY}}}const Og=e=>t=>ps(t)&&e(t,ln(t));function Jt(e,t,n,r){return rn(e,t,Og(n),r)}const Ml=({current:e})=>e?e.ownerDocument.defaultView:null,Qi=(e,t)=>Math.abs(e-t);function jg(e,t){const n=Qi(e.x,t.x),r=Qi(e.y,t.y);return Math.sqrt(n**2+r**2)}const Ji=new Set(["auto","scroll"]);class Dl{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=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xn(this.lastRawMoveEventInfo,this.transformPagePoint));const h=Wr(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,m=jg(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!m)return;const{point:v}=h,{timestamp:x}=ce;this.history.push({...v,timestamp:x});const{onStart:w,onMove:b}=this.handlers;y||(w&&w(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,h)},this.handlePointerMove=(h,y)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=xn(y,this.transformPagePoint),ne.update(this.updatePoint,!0)},this.handlePointerUp=(h,y)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Wr(h.type==="pointercancel"?this.lastMoveEventInfo:xn(y,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,w),v&&v(h,w)},!ps(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=ln(t),l=xn(c,this.transformPagePoint),{point:u}=l,{timestamp:d}=ce;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Wr(l,this.history)),this.removeListeners=sn(Jt(this.contextWindow,"pointermove",this.handlePointerMove),Jt(this.contextWindow,"pointerup",this.handlePointerUp),Jt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Ji.has(r.overflowX)||Ji.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),ne.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ye(this.updatePoint)}}function xn(e,t){return t?{point:t(e.point)}:e}function ea(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Wr({point:e},t){return{point:e,delta:ea(e,Il(t)),offset:ea(e,Vg(t)),velocity:Lg(t,.1)}}function Vg(e){return e[0]}function Il(e){return e[e.length-1]}function Lg(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Il(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=ye(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 Fg(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?re(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?re(n,e,r.max):Math.min(e,n)),e}function ta(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 _g(e,{top:t,left:n,bottom:r,right:o}){return{x:ta(e.x,n,o),y:ta(e.y,t,r)}}function na(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 Bg(e,t){return{x:na(e.x,t.x),y:na(e.y,t.y)}}function $g(e,t){let n=.5;const r=fe(e),o=fe(t);return o>r?n=en(t.min,t.max-r,e.min):r>o&&(n=en(e.min,e.max-o,t.min)),Ve(0,1,n)}function Wg(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 Io=.35;function Ug(e=Io){return e===!1?e=0:e===!0&&(e=Io),{x:ra(e,"left","right"),y:ra(e,"top","bottom")}}function ra(e,t,n){return{min:oa(e,t),max:oa(e,n)}}function oa(e,t){return typeof e=="number"?e:e[t]||0}const Gg=new WeakMap;class Hg{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=ae(),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=d=>{n&&this.snapToCursor(ln(d).point),this.stopAnimation()},i=(d,f)=>{const{drag:h,dragPropagation:y,onDragStart:m}=this.getProps();if(h&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yp(h),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),De(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Oe.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const S=b.layout.layoutBox[x];S&&(w=fe(S)*(parseFloat(w)/100))}}this.originPoint[x]=w}),m&&ne.update(()=>m(d,f),!1,!0),So(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:h,dragDirectionLock:y,onDirectionLock:m,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:x}=f;if(y&&this.currentDirection===null){this.currentDirection=zg(x),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),v&&ne.update(()=>v(d,f),!1,!0)},c=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Dl(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Ml(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&&ne.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||!wn(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=Fg(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&&St(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_g(r.layoutBox,t):this.constraints=!1,this.elastic=Ug(n),o!==this.constraints&&!St(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&De(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Wg(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!St(t))return!1;const r=t.current;Fe(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=zp(r,o.root,this.visualElement.getTransformPagePoint());let i=Bg(o.layout.layoutBox,s);if(n){const a=n(Gp(i));this.hasMutatedConstraints=!!a,a&&(i=Zc(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=De(u=>{if(!wn(u,n,this.currentDirection))return;let d=c&&c[u]||{};(i===!0||i===u)&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,y)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return So(this.visualElement,t),r.start(ls(t,r,0,n,this.visualElement,!1))}stopAnimation(){De(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){De(n=>{const{drag:r}=this.getProps();if(!wn(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]-re(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!St(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};De(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=$g({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(),De(i=>{if(!wn(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(re(c,l,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Gg.set(this.visualElement,this);const t=this.visualElement.current,n=Jt(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps(),f=l.target,h=f!==t&&Pp(f);u&&d&&!h&&this.start(l)});let r;const o=()=>{const{dragConstraints:l}=this.getProps();St(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Kg(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ne.read(o);const a=rn(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(De(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].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=Io,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function sa(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Kg(e,t,n){const r=fi(e,sa(n)),o=fi(t,sa(n));return()=>{r(),o()}}function wn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zg(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Yg extends Je{constructor(t){super(t),this.removeGroupControls=xe,this.removeListeners=xe,this.controls=new Hg(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xe}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 Ur=e=>(t,n)=>{e&&ne.update(()=>e(t,n),!1,!0)};class Xg extends Je{constructor(){super(...arguments),this.removePointerDownListener=xe}onPointerDown(t){this.session=new Dl(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ml(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ur(t),onStart:Ur(n),onMove:Ur(r),onEnd:(s,i)=>{delete this.session,o&&ne.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Jt(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 Gr=!1;class qg 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),Gr&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),On.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}),Gr=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||ne.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(),hs.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Gr=!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 kl(e){const[t,n]=xl(),r=C.useContext(Yo);return g.jsx(qg,{...e,layoutGroup:r,switchLayoutGroup:C.useContext(El),isPresent:t,safeToRemove:n})}const Zg={pan:{Feature:Xg},drag:{Feature:Yg,ProjectionNode:yl,MeasureLayout:kl}};function ia(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&&ne.postRender(()=>s(t,ln(t)))}class Qg extends Je{mount(){const{current:t}=this.node;t&&(this.unmount=wp(t,(n,r)=>(ia(this.node,r,"Start"),o=>ia(this.node,o,"End"))))}unmount(){}}class Jg extends Je{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=sn(rn(this.node.current,"focus",()=>this.onFocus()),rn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function aa(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&&ne.postRender(()=>s(t,ln(t)))}class ev extends Je{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Rp(t,(o,s)=>(aa(this.node,s,"Start"),(i,{success:a})=>aa(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ko=new WeakMap,Hr=new WeakMap,tv=e=>{const t=ko.get(e.target);t&&t(e)},nv=e=>{e.forEach(tv)};function rv({root:e,...t}){const n=e||document;Hr.has(n)||Hr.set(n,{});const r=Hr.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(nv,{root:e,...t})),r[o]}function ov(e,t,n){const r=rv(t);return ko.set(e,n),r.observe(e),()=>{ko.delete(e),r.unobserve(e)}}const sv={some:0,all:1};class iv extends Je{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:sv[o]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(l)};this.stopObserver=ov(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(av(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function av({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const cv={inView:{Feature:iv},tap:{Feature:ev},focus:{Feature:Jg},hover:{Feature:Qg}},lv={layout:{ProjectionNode:yl,MeasureLayout:kl}},uv={...Ng,...cv,...Zg,...lv},Nl=Ag(uv,Mg);function Ol(){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,l=s.clientX-a.left-c/2,u=s.clientY-a.top-c/2,d=n.current++;t(f=>[...f,{id:d,x:l,y:u,size:c}])},[]),o=C.useCallback(s=>{t(i=>i.filter(a=>a.id!==s))},[]);return{ripples:e,add:r,remove:o}}function jl({ripples:e,onDone:t}){return g.jsx(wl,{children:e.map(n=>g.jsx(Nl.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 dv=()=>g.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),Vl=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:l=!1,disabled:u,className:d,children:f,onClick:h,...y},m){const{ripples:v,add:x,remove:w}=Ol(),b=u||i,S=E=>{b||(!l&&t!=="link"&&x(E),h==null||h(E))},P=G("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",d),R=i?g.jsx(dv,{}):c==="start"?a:null,T=!i&&c==="end"?a:null;return g.jsxs("button",{ref:m,className:P,onClick:S,disabled:b,"aria-busy":i||void 0,...y,children:[g.jsxs("span",{className:"btn-content",children:[R,f,T]}),!l&&t!=="link"&&g.jsx(jl,{ripples:v,onDone:w})]})}),fv=C.forwardRef(function({orientation:t="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=G("btn-group",t==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return g.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),hv=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:l,onClick:u,disabled:d,...f},h){const{ripples:y,add:m,remove:v}=Ol(),x=S=>{d||(s||m(S),u==null||u(S))},w=a!=null,b=G("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",w&&"extended",o!=="static"&&`fixed-${o}`,l);return g.jsx(wl,{children:c&&g.jsxs(Nl.button,{ref:h,type:"button",className:b,onClick:x,disabled:d,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...f,children:[g.jsxs("span",{className:"btn-content",children:[i,w&&a]}),!s&&g.jsx(jl,{ripples:y,onDone:v})]})})}),pv=C.forwardRef(function({icon:t,shape:n="circle",variant:r="ghost",...o},s){return g.jsx(Vl,{ref:s,shape:n,variant:r,icon:t,...o})});function K(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 ue=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},mv=p[" useInsertionEffect ".trim().toString()]||ue;function Pe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=gv({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const u=p.useRef(e!==void 0);p.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"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.`),u.current=a},[a,r])}const l=p.useCallback(u=>{var d;if(a){const f=vv(u)?u(e):u;f!==e&&((d=i.current)==null||d.call(i,f))}else s(u)},[a,e,s,i]);return[c,l]}function gv({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),s=p.useRef(t);return mv(()=>{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 vv(e){return typeof e=="function"}function ca(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ft(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ca(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():ca(e[o],null)}}}}function Q(...e){return p.useCallback(ft(...e),e)}function Nt(e){const t=yv(e),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(wv);if(c){const l=c.props.children,u=a.map(d=>d===c?p.Children.count(l)>1?p.Children.only(null):p.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:o,children:p.isValidElement(l)?p.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function yv(e){const t=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=Sv(o),a=bv(s,o.props);return o.type!==p.Fragment&&(a.ref=r?ft(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 xv=Symbol("radix.slottable");function wv(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xv}function bv(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 Sv(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 Cv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=Cv.reduce((e,t)=>{const n=Nt(`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),g.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Pv(e,t){e&&tr.flushSync(()=>e.dispatchEvent(t))}var Ll="Toggle",Cs=p.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...s}=e,[i,a]=Pe({prop:n,onChange:o,defaultProp:r??!1,caller:Ll});return g.jsx($.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:K(e.onClick,()=>{e.disabled||a(!i)})})});Cs.displayName=Ll;var Tv=Cs;const Rv=C.forwardRef(function({variant:t="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},l){const u=G("btn",t,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return g.jsx(Tv,{ref:l,className:u,...c,children:g.jsxs("span",{className:"btn-content",children:[s,a]})})});function Ev(e,t){const n=p.createContext(t),r=s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return g.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 Ee(e,t=[]){let n=[];function r(s,i){const a=p.createContext(i),c=n.length;n=[...n,i];const l=d=>{var x;const{scope:f,children:h,...y}=d,m=((x=f==null?void 0:f[e])==null?void 0:x[c])||a,v=p.useMemo(()=>y,Object.values(y));return g.jsx(m.Provider,{value:v,children:h})};l.displayName=s+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[c])||a,y=p.useContext(h);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}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,Av(o,...t)]}function Av(...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:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Fl(e){const t=e+"CollectionProvider",[n,r]=Ee(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:v,children:x}=m,w=C.useRef(null),b=C.useRef(new Map).current;return g.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=Nt(a),l=C.forwardRef((m,v)=>{const{scope:x,children:w}=m,b=s(a,x),S=Q(v,b.collectionRef);return g.jsx(c,{ref:S,children:w})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Nt(u),h=C.forwardRef((m,v)=>{const{scope:x,children:w,...b}=m,S=C.useRef(null),P=Q(v,S),R=s(u,x);return C.useEffect(()=>(R.itemMap.set(S,{ref:S,...b}),()=>void R.itemMap.delete(S))),g.jsx(f,{[d]:"",ref:P,children:w})});h.displayName=u;function y(m){const v=s(e+"CollectionConsumer",m);return C.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((R,T)=>b.indexOf(R.ref.current)-b.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},y,r]}var Mv=p[" useId ".trim().toString()]||(()=>{}),Dv=0;function pe(e){const[t,n]=p.useState(Mv());return ue(()=>{n(r=>r??String(Dv++))},[e]),e||(t?`radix-${t}`:"")}function Xe(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 Iv=p.createContext(void 0);function ar(e){const t=p.useContext(Iv);return e||t||"ltr"}var Kr="rovingFocusGroup.onEntryFocus",kv={bubbles:!1,cancelable:!0},un="RovingFocusGroup",[No,_l,Nv]=Fl(un),[Ov,cr]=Ee(un,[Nv]),[jv,Vv]=Ov(un),Bl=p.forwardRef((e,t)=>g.jsx(No.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(No.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Lv,{...e,ref:t})})}));Bl.displayName=un;var Lv=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=p.useRef(null),h=Q(t,f),y=ar(s),[m,v]=Pe({prop:i,defaultProp:a??null,onChange:c,caller:un}),[x,w]=p.useState(!1),b=Xe(l),S=_l(n),P=p.useRef(!1),[R,T]=p.useState(0);return p.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(Kr,b),()=>E.removeEventListener(Kr,b)},[b]),g.jsx(jv,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:m,onItemFocus:p.useCallback(E=>v(E),[v]),onItemShiftTab:p.useCallback(()=>w(!0),[]),onFocusableItemAdd:p.useCallback(()=>T(E=>E+1),[]),onFocusableItemRemove:p.useCallback(()=>T(E=>E-1),[]),children:g.jsx($.div,{tabIndex:x||R===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:K(e.onMouseDown,()=>{P.current=!0}),onFocus:K(e.onFocus,E=>{const k=!P.current;if(E.target===E.currentTarget&&k&&!x){const D=new CustomEvent(Kr,kv);if(E.currentTarget.dispatchEvent(D),!D.defaultPrevented){const O=S().filter(A=>A.focusable),F=O.find(A=>A.active),W=O.find(A=>A.id===m),B=[F,W,...O].filter(Boolean).map(A=>A.ref.current);Ul(B,u)}}P.current=!1}),onBlur:K(e.onBlur,()=>w(!1))})})}),$l="RovingFocusGroupItem",Wl=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=pe(),l=s||c,u=Vv($l,n),d=u.currentTabStopId===l,f=_l(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:m}=u;return p.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),g.jsx(No.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx($.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:K(e.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:K(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:K(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=Bv(v,u.orientation,u.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=f().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const S=b.indexOf(v.currentTarget);b=u.loop?$v(b,S+1):b.slice(S+1)}setTimeout(()=>Ul(b))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});Wl.displayName=$l;var Fv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _v(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bv(e,t,n){const r=_v(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Fv[r]}function Ul(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function $v(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gl=Bl,Hl=Wl,et="ToggleGroup",[Kl]=Ee(et,[cr]),zl=cr(),Ps=C.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(Wv,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(Uv,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${et}\``)});Ps.displayName=et;var[Yl,Xl]=Kl(et),Wv=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=Pe({prop:n,defaultProp:r??"",onChange:o,caller:et});return g.jsx(Yl,{scope:e.__scopeToggleGroup,type:"single",value:C.useMemo(()=>i?[i]:[],[i]),onItemActivate:a,onItemDeactivate:C.useCallback(()=>a(""),[a]),children:g.jsx(ql,{...s,ref:t})})}),Uv=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...s}=e,[i,a]=Pe({prop:n,defaultProp:r??[],onChange:o,caller:et}),c=C.useCallback(u=>a((d=[])=>[...d,u]),[a]),l=C.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return g.jsx(Yl,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:l,children:g.jsx(ql,{...s,ref:t})})});Ps.displayName=et;var[Gv,Hv]=Kl(et),ql=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:s,dir:i,loop:a=!0,...c}=e,l=zl(n),u=ar(i),d={role:"group",dir:u,...c};return g.jsx(Gv,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(Gl,{asChild:!0,...l,orientation:s,dir:u,loop:a,children:g.jsx($.div,{...d,ref:t})}):g.jsx($.div,{...d,ref:t})})}),zn="ToggleGroupItem",Zl=C.forwardRef((e,t)=>{const n=Xl(zn,e.__scopeToggleGroup),r=Hv(zn,e.__scopeToggleGroup),o=zl(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?g.jsx(Hl,{asChild:!0,...o,focusable:!i,active:s,ref:c,children:g.jsx(la,{...a,ref:t})}):g.jsx(la,{...a,ref:t})});Zl.displayName=zn;var la=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,s=Xl(zn,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?i:void 0;return g.jsx(Cs,{...a,...o,ref:t,onPressedChange:c=>{c?s.onItemActivate(r):s.onItemDeactivate(r)}})}),Kv=Ps,zv=Zl;const Ql=C.createContext({variant:"outline",color:"primary"}),Yv=C.forwardRef(function({variant:t="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},l){const u=G("btn-group",o==="spaced"&&"spaced",s&&"round",i);return g.jsx(Ql.Provider,{value:{variant:t,color:n,size:r},children:g.jsx(Kv,{ref:l,className:u,...c,children:a})})}),Xv=C.forwardRef(function({icon:t,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:l}=C.useContext(Ql),u=G("btn",a,c!=="primary"&&c,l==="sm"||l==="lg"?l:null,n&&n!=="default"&&n,r);return g.jsx(zv,{ref:i,className:u,...s,children:g.jsxs("span",{className:"btn-content",children:[t,o]})})});/**
|
|
10
|
+
* @license lucide-react v1.8.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/const Jl=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
15
|
+
* @license lucide-react v1.8.0 - ISC
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the ISC license.
|
|
18
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/const qv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
20
|
+
* @license lucide-react v1.8.0 - ISC
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the ISC license.
|
|
23
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/const Zv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
25
|
+
* @license lucide-react v1.8.0 - ISC
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the ISC license.
|
|
28
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/const ua=e=>{const t=Zv(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
30
|
+
* @license lucide-react v1.8.0 - ISC
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the ISC license.
|
|
33
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var zr={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
|
+
* @license lucide-react v1.8.0 - ISC
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the ISC license.
|
|
38
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/const Qv=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Jv=C.createContext({}),ey=()=>C.useContext(Jv),ty=C.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>{const{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:h=""}=ey()??{},y=r??d?Number(n??u)*24/Number(t??l):n??u;return C.createElement("svg",{ref:c,...zr,width:t??l??zr.width,height:t??l??zr.height,stroke:e??f,strokeWidth:y,className:Jl("lucide",h,o),...!s&&!Qv(a)&&{"aria-hidden":"true"},...a},[...i.map(([m,v])=>C.createElement(m,v)),...Array.isArray(s)?s:[s]])});/**
|
|
40
|
+
* @license lucide-react v1.8.0 - ISC
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the ISC license.
|
|
43
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/const Bt=(e,t)=>{const n=C.forwardRef(({className:r,...o},s)=>C.createElement(ty,{ref:s,iconNode:t,className:Jl(`lucide-${qv(ua(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ua(e),n};/**
|
|
45
|
+
* @license lucide-react v1.8.0 - ISC
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the ISC license.
|
|
48
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/const ny=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Yn=Bt("check",ny);/**
|
|
50
|
+
* @license lucide-react v1.8.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const ry=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],eu=Bt("chevron-down",ry);/**
|
|
55
|
+
* @license lucide-react v1.8.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const oy=[["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"}]],sy=Bt("eye-off",oy);/**
|
|
60
|
+
* @license lucide-react v1.8.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const iy=[["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"}]],ay=Bt("eye",iy);/**
|
|
65
|
+
* @license lucide-react v1.8.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const cy=[["path",{d:"M5 12h14",key:"1ays0h"}]],da=Bt("minus",cy);/**
|
|
70
|
+
* @license lucide-react v1.8.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const ly=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tu=Bt("x",ly),uy=C.forwardRef(function({color:t="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,type:c="text",disabled:l,className:u,value:d,defaultValue:f,onChange:h,...y},m){const v=d!==void 0,[x,w]=C.useState(f!=null?String(f):""),b=v?String(d??""):x,S=C.useRef(null);C.useImperativeHandle(m,()=>S.current,[]);const[P,R]=C.useState(!1),T=a&&P&&c==="password"?"text":c,E=s&&!l&&b!=="",k=E||a,D=r!=null||o!=null||k,O=B=>{v||w(B.target.value),h==null||h(B)},F=B=>{var V;B.preventDefault(),v||w("");const A=S.current;if(A){const I=(V=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:V.set;I==null||I.call(A,""),A.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},W=G("input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,u),_=g.jsx("input",{ref:S,type:T,className:W,disabled:l,value:v?d:void 0,defaultValue:v?void 0:f,onChange:O,...y});return D?g.jsxs("span",{className:G("cny-input-affix",r!=null&&"has-prefix",o!=null&&!k&&"has-suffix",k&&"has-action"),children:[r!=null&&g.jsx("span",{className:"cny-input-prefix",children:r}),_,o!=null&&!k&&g.jsx("span",{className:"cny-input-suffix",children:o}),E&&g.jsx("button",{type:"button",className:"cny-input-action",onClick:F,"aria-label":"Clear",tabIndex:-1,children:g.jsx(tu,{size:14,"aria-hidden":"true"})}),a&&c==="password"&&g.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>R(B=>!B),"aria-label":P?"Hide password":"Show password","aria-pressed":P,style:E?{right:36}:void 0,children:P?g.jsx(sy,{size:14,"aria-hidden":"true"}):g.jsx(ay,{size:14,"aria-hidden":"true"})})]}):_}),dy=C.forwardRef(function({color:t="default",className:n,children:r,...o},s){const i=G("card",t!=="default"&&t,n);return g.jsx("div",{ref:s,className:i,...o,children:r})}),fy=C.forwardRef(function({color:t="info",solid:n=!1,title:r,className:o,children:s,...i},a){const c=G("alert",t,n&&"solid",o),l=t==="danger"?"alert":"status";return g.jsx("div",{ref:a,role:l,className:c,...i,children:g.jsxs("div",{children:[r&&g.jsx("p",{className:"alert-title",children:r}),s&&g.jsx("p",{className:"alert-body",children:s})]})})}),hy=C.forwardRef(function({size:t="md",status:n,src:r,alt:o,className:s,children:i,...a},c){const l=G("avatar",t!=="md"&&t,n,s);return g.jsx("span",{ref:c,className:l,...a,children:r?g.jsx("img",{src:r,alt:o??""}):i})}),py=C.forwardRef(function({className:t,children:n,...r},o){return g.jsx("div",{ref:o,className:G("avatar-stack",t),...r,children:n})}),my=C.forwardRef(function({value:t=0,color:n="primary",indeterminate:r=!1,className:o,style:s,...i},a){const c=G("progress",r&&"indeterminate",n!=="primary"&&n,o),l=Math.max(0,Math.min(100,t)),u=r?s??{}:{...s??{},"--value":`${l}%`};return g.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:l,className:c,style:u,...i,children:g.jsx("span",{className:"progress-bar"})})}),gy=C.forwardRef(function({value:t,size:n="md",showLabel:r=!0,className:o,style:s,...i},a){const c=Math.max(0,Math.min(100,t)),l=G("progress-ring",n==="lg"&&"lg",o),u={...s??{},"--value":c};return g.jsx("span",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c,className:l,style:u,...i,children:r&&g.jsxs("span",{children:[c,"%"]})})}),vy={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},nu=C.forwardRef(function({variant:t="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,children:l,...u},d){const f=G(i?"cny-scroll-region":"cny-scroll",t!=="default"&&t,n==="primary"&&"primary",a);return g.jsx("div",{ref:d,className:f,style:{...vy[r],maxHeight:o,maxWidth:s,...c??{}},...u,children:l})}),yy=C.forwardRef(function(t,n){return g.jsx(nu,{ref:n,region:!0,...t})}),xy=C.forwardRef(function({shape:t="text",width:n,height:r,className:o,style:s,...i},a){return g.jsx("span",{ref:a,"aria-hidden":"true",className:G("skeleton",t,o),style:{...s??{},width:n,height:r},...i})}),wy=C.forwardRef(function({solid:t=!1,className:n,children:r,...o},s){return g.jsx("header",{ref:s,className:G("cny-navbar",t&&"solid",n),...o,children:r})}),by=C.forwardRef(function({mark:t=!0,className:n,children:r,...o},s){return g.jsxs("a",{ref:s,className:G("cny-navbar-brand",n),...o,children:[t&&g.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),Sy=C.forwardRef(function({className:t,children:n,...r},o){return g.jsx("nav",{ref:o,className:G("cny-navbar-nav",t),...r,children:n})}),Cy=C.forwardRef(function({active:t=!1,className:n,children:r,...o},s){return g.jsx("a",{ref:s,"aria-current":t?"page":void 0,className:G("cny-navbar-item",t&&"active",n),...o,children:r})}),Py=C.forwardRef(function({className:t,children:n,...r},o){return g.jsx("div",{ref:o,className:G("cny-navbar-actions",t),...r,children:n})}),Ty=C.forwardRef(function({width:t="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,className:s,children:i,...a},c){return g.jsx("aside",{ref:c,className:G("cny-sidebar",t!=="default"&&t,n&&"sticky",r&&"collapsed",o&&"responsive",s),...a,children:i})}),Ry=C.forwardRef(function({title:t,className:n,children:r,...o},s){return g.jsxs("div",{ref:s,className:G("cny-sidebar-section",n),...o,children:[t&&g.jsx("div",{className:"cny-sidebar-title",children:t}),g.jsx("nav",{className:"cny-sidebar-nav",children:r})]})}),Ey=C.forwardRef(function({active:t=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){return g.jsxs("a",{ref:c,"aria-current":t?"page":void 0,"aria-disabled":n||void 0,className:G("cny-sidebar-item",t&&"active",n&&"disabled",s),...a,children:[r&&g.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),g.jsx("span",{children:i}),o&&g.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function Ay(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}`),t}const dn=C.forwardRef(function({as:t,className:n,children:r,...o},s){const i=t??"div",{layoutProps:a,domProps:c}=My(o),l=G(...Ay(a),n);return C.createElement(i,{ref:s,className:l||void 0,...c},r)});function My(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"]),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 Dy=C.forwardRef(function(t,n){return g.jsx(dn,{ref:n,display:"flex",direction:"column",...t})}),Iy=C.forwardRef(function(t,n){const{align:r="center",...o}=t;return g.jsx(dn,{ref:n,display:"flex",direction:"row",align:r,...o})}),ky=C.forwardRef(function({cols:t,className:n,...r},o){return g.jsx(dn,{ref:o,display:"grid",className:G(t&&`grid-cols-${t}`,n),...r})}),Ny=C.forwardRef(function({size:t="lg",className:n,...r},o){return g.jsx(dn,{ref:o,className:G("cny-container",t,n),...r})}),Oy=C.forwardRef(function({orientation:t="horizontal",className:n,...r},o){const s=G("cny-divider",t,n);return t==="vertical"?g.jsx("span",{ref:o,role:"separator","aria-orientation":"vertical",className:s,...r}):g.jsx("hr",{ref:o,className:s,...r})}),jy=C.forwardRef(function({className:t,...n},r){return g.jsx("span",{ref:r,"aria-hidden":"true",className:G("cny-spacer",t),...n})}),Vy={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"},Ly=C.forwardRef(function({as:t,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,children:c,...l},u){const d=t??Vy[n],f=G("cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return C.createElement(d,{ref:u,className:f,...l},c)});function Fy({label:e,hint:t,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,children:l,...u}){const d=C.useId(),f=C.Children.only(l),h=f.props.id??d,y=n!=null&&n!==!1,m=a??(y?"danger":"default"),v=t||n?`${h}-hint`:void 0,x=C.cloneElement(f,{id:h,"aria-invalid":y||f.props["aria-invalid"]||void 0,"aria-describedby":v??f.props["aria-describedby"],className:G(f.props.className,m!=="default"&&m)}),w=i!=null&&s!=null&&s>i?"danger":"default";return g.jsxs("div",{className:G("cny-field",c),...u,children:[(e!=null||s!=null)&&g.jsxs("div",{className:"cny-field-label-row",children:[e!=null?g.jsxs("label",{htmlFor:h,className:"cny-field-label",children:[e,r&&g.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&g.jsx("span",{className:"cny-field-optional",children:"optional"})]}):g.jsx("span",{}),s!=null&&g.jsx("span",{className:G("cny-field-counter",w==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),x,(n||t)&&g.jsx("span",{id:v,className:G("cny-field-hint",m!=="default"&&m),children:n??t})]})}const _y=C.forwardRef(function({color:t="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,onChange:i,...a},c){const l=C.useRef(null);C.useImperativeHandle(c,()=>l.current,[]);const u=C.useCallback(()=>{const h=l.current;if(!h||!r)return;h.style.height="auto";const m=parseFloat(getComputedStyle(h).lineHeight||"20")*o;h.style.height=`${Math.min(h.scrollHeight,m)}px`,h.style.overflowY=h.scrollHeight>m?"auto":"hidden"},[r,o]);C.useEffect(()=>{u()},[u,a.value,a.defaultValue]);const d=h=>{i==null||i(h),r&&u()},f=G("input",t!=="primary"&&t,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return g.jsx("textarea",{ref:l,className:f,onChange:d,...a})});function fa(e,[t,n]){return Math.min(n,Math.max(t,e))}function By(e,t=globalThis==null?void 0:globalThis.document){const n=Xe(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 $y="DismissableLayer",Oo="dismissableLayer.update",Wy="dismissableLayer.pointerDownOutside",Uy="dismissableLayer.focusOutside",ha,ru=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,l=p.useContext(ru),[u,d]=p.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=p.useState({}),y=Q(t,T=>d(T)),m=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(v),w=u?m.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,S=w>=x,P=Ky(T=>{const E=T.target,k=[...l.branches].some(D=>D.contains(E));!S||k||(o==null||o(T),i==null||i(T),T.defaultPrevented||a==null||a())},f),R=zy(T=>{const E=T.target;[...l.branches].some(D=>D.contains(E))||(s==null||s(T),i==null||i(T),T.defaultPrevented||a==null||a())},f);return By(T=>{w===l.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},f),p.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ha=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),pa(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ha)}},[u,f,n,l]),p.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),pa())},[u,l]),p.useEffect(()=>{const T=()=>h({});return document.addEventListener(Oo,T),()=>document.removeEventListener(Oo,T)},[]),g.jsx($.div,{...c,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:K(e.onFocusCapture,R.onFocusCapture),onBlurCapture:K(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,P.onPointerDownCapture)})});lr.displayName=$y;var Gy="DismissableLayerBranch",Hy=p.forwardRef((e,t)=>{const n=p.useContext(ru),r=p.useRef(null),o=Q(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx($.div,{...e,ref:o})});Hy.displayName=Gy;function Ky(e,t=globalThis==null?void 0:globalThis.document){const n=Xe(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){ou(Wy,n,l,{discrete:!0})};const l={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 zy(e,t=globalThis==null?void 0:globalThis.document){const n=Xe(e),r=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!r.current&&ou(Uy,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 pa(){const e=new CustomEvent(Oo);document.dispatchEvent(e)}function ou(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?Pv(o,s):o.dispatchEvent(s)}var Yr=0;function Ts(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ma()),document.body.insertAdjacentElement("beforeend",e[1]??ma()),Yr++,()=>{Yr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yr--}},[])}function ma(){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 Xr="focusScope.autoFocusOnMount",qr="focusScope.autoFocusOnUnmount",ga={bubbles:!1,cancelable:!0},Yy="FocusScope",ur=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=p.useState(null),l=Xe(o),u=Xe(s),d=p.useRef(null),f=Q(t,m=>c(m)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let m=function(b){if(h.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:Ge(d.current,{select:!0})},v=function(b){if(h.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||Ge(d.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const P of b)P.removedNodes.length>0&&Ge(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),p.useEffect(()=>{if(a){ya.add(h);const m=document.activeElement;if(!a.contains(m)){const x=new CustomEvent(Xr,ga);a.addEventListener(Xr,l),a.dispatchEvent(x),x.defaultPrevented||(Xy(ex(su(a)),{select:!0}),document.activeElement===m&&Ge(a))}return()=>{a.removeEventListener(Xr,l),setTimeout(()=>{const x=new CustomEvent(qr,ga);a.addEventListener(qr,u),a.dispatchEvent(x),x.defaultPrevented||Ge(m??document.body,{select:!0}),a.removeEventListener(qr,u),ya.remove(h)},0)}}},[a,l,u,h]);const y=p.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(v&&x){const w=m.currentTarget,[b,S]=qy(w);b&&S?!m.shiftKey&&x===S?(m.preventDefault(),n&&Ge(b,{select:!0})):m.shiftKey&&x===b&&(m.preventDefault(),n&&Ge(S,{select:!0})):x===w&&m.preventDefault()}},[n,r,h.paused]);return g.jsx($.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});ur.displayName=Yy;function Xy(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ge(r,{select:t}),document.activeElement!==n)return}function qy(e){const t=su(e),n=va(t,e),r=va(t.reverse(),e);return[n,r]}function su(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 va(e,t){for(const n of e)if(!Zy(n,{upTo:t}))return n}function Zy(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 Qy(e){return e instanceof HTMLInputElement&&"select"in e}function Ge(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Qy(e)&&t&&e.select()}}var ya=Jy();function Jy(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xa(e,t),e.unshift(t)},remove(t){var n;e=xa(e,t),(n=e[0])==null||n.resume()}}}function xa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ex(e){return e.filter(t=>t.tagName!=="A")}const tx=["top","right","bottom","left"],qe=Math.min,ge=Math.max,Xn=Math.round,bn=Math.floor,je=e=>({x:e,y:e}),nx={left:"right",right:"left",bottom:"top",top:"bottom"};function jo(e,t,n){return ge(e,qe(t,n))}function _e(e,t){return typeof e=="function"?e(t):e}function Be(e){return e.split("-")[0]}function $t(e){return e.split("-")[1]}function Rs(e){return e==="x"?"y":"x"}function Es(e){return e==="y"?"height":"width"}function Ne(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function As(e){return Rs(Ne(e))}function rx(e,t,n){n===void 0&&(n=!1);const r=$t(e),o=As(e),s=Es(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=qn(i)),[i,qn(i)]}function ox(e){const t=qn(e);return[Vo(e),t,Vo(t)]}function Vo(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const wa=["left","right"],ba=["right","left"],sx=["top","bottom"],ix=["bottom","top"];function ax(e,t,n){switch(e){case"top":case"bottom":return n?t?ba:wa:t?wa:ba;case"left":case"right":return t?sx:ix;default:return[]}}function cx(e,t,n,r){const o=$t(e);let s=ax(Be(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Vo)))),s}function qn(e){const t=Be(e);return nx[t]+e.slice(t.length)}function lx(e){return{top:0,right:0,bottom:0,left:0,...e}}function iu(e){return typeof e!="number"?lx(e):{top:e,right:e,bottom:e,left:e}}function Zn(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 Sa(e,t,n){let{reference:r,floating:o}=e;const s=Ne(t),i=As(t),a=Es(i),c=Be(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch($t(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}async function ux(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=_e(t,e),y=iu(h),v=a[f?d==="floating"?"reference":"floating":d],x=Zn(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:l,rootBoundary:u,strategy:c})),w=d==="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)),S=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=Zn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-P.top+y.top)/S.y,bottom:(P.bottom-x.bottom+y.bottom)/S.y,left:(x.left-P.left+y.left)/S.x,right:(P.right-x.right+y.right)/S.x}}const dx=50,fx=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:ux},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Sa(l,r,c),f=r,h=0;const y={};for(let m=0;m<s.length;m++){const v=s[m];if(!v)continue;const{name:x,fn:w}=v,{x:b,y:S,data:P,reset:R}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:y,rects:l,platform:a,elements:{reference:e,floating:t}});u=b??u,d=S??d,y[x]={...y[x],...P},R&&h<dx&&(h++,typeof R=="object"&&(R.placement&&(f=R.placement),R.rects&&(l=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:u,y:d}=Sa(l,f,c)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:y}},hx=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:l,padding:u=0}=_e(e,t)||{};if(l==null)return{};const d=iu(u),f={x:n,y:r},h=As(o),y=Es(h),m=await i.getDimensions(l),v=h==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",S=s.reference[y]+s.reference[h]-f[h]-s.floating[y],P=f[h]-s.reference[h],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let T=R?R[b]:0;(!T||!await(i.isElement==null?void 0:i.isElement(R)))&&(T=a.floating[b]||s.floating[y]);const E=S/2-P/2,k=T/2-m[y]/2-1,D=qe(d[x],k),O=qe(d[w],k),F=D,W=T-m[y]-O,_=T/2-m[y]/2+E,B=jo(F,_,W),A=!c.arrow&&$t(o)!=null&&_!==B&&s.reference[y]/2-(_<F?D:O)-m[y]/2<0,V=A?_<F?_-F:_-W:0;return{[h]:f[h]+V,data:{[h]:B,centerOffset:_-B-V,...A&&{alignmentOffset:V}},reset:A}}}),px=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:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...v}=_e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Be(o),w=Ne(a),b=Be(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),P=f||(b||!m?[qn(a)]:ox(a)),R=y!=="none";!f&&R&&P.push(...cx(a,m,y,S));const T=[a,...P],E=await c.detectOverflow(t,v),k=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&k.push(E[x]),d){const _=rx(o,i,S);k.push(E[_[0]],E[_[1]])}if(D=[...D,{placement:o,overflows:k}],!k.every(_=>_<=0)){var O,F;const _=(((O=s.flip)==null?void 0:O.index)||0)+1,B=T[_];if(B&&(!(d==="alignment"?w!==Ne(B):!1)||D.every(I=>Ne(I.placement)===w?I.overflows[0]>0:!0)))return{data:{index:_,overflows:D},reset:{placement:B}};let A=(F=D.filter(V=>V.overflows[0]<=0).sort((V,I)=>V.overflows[1]-I.overflows[1])[0])==null?void 0:F.placement;if(!A)switch(h){case"bestFit":{var W;const V=(W=D.filter(I=>{if(R){const H=Ne(I.placement);return H===w||H==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(H=>H>0).reduce((H,te)=>H+te,0)]).sort((I,H)=>I[1]-H[1])[0])==null?void 0:W[0];V&&(A=V);break}case"initialPlacement":A=a;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function Ca(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pa(e){return tx.some(t=>e[t]>=0)}const mx=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=_e(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Ca(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Pa(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Ca(i,n.floating);return{data:{escapedOffsets:a,escaped:Pa(a)}}}default:return{}}}}},au=new Set(["left","top"]);async function gx(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Be(n),a=$t(n),c=Ne(n)==="y",l=au.has(i)?-1:1,u=s&&c?-1:1,d=_e(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const vx=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 gx(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}}}}},yx=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:w,y:b}=x;return{x:w,y:b}}},...l}=_e(e,t),u={x:n,y:r},d=await s.detectOverflow(t,l),f=Ne(Be(o)),h=Rs(f);let y=u[h],m=u[f];if(i){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=y+d[x],S=y-d[w];y=jo(b,y,S)}if(a){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",b=m+d[x],S=m-d[w];m=jo(b,m,S)}const v=c.fn({...t,[h]:y,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[f]:a}}}}}},xx=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:l=!0}=_e(e,t),u={x:n,y:r},d=Ne(o),f=Rs(d);let h=u[f],y=u[d];const m=_e(a,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const b=f==="y"?"height":"width",S=s.reference[f]-s.floating[b]+v.mainAxis,P=s.reference[f]+s.reference[b]-v.mainAxis;h<S?h=S:h>P&&(h=P)}if(l){var x,w;const b=f==="y"?"width":"height",S=au.has(Be(o)),P=s.reference[d]-s.floating[b]+(S&&((x=i.offset)==null?void 0:x[d])||0)+(S?0:v.crossAxis),R=s.reference[d]+s.reference[b]+(S?0:((w=i.offset)==null?void 0:w[d])||0)-(S?v.crossAxis:0);y<P?y=P:y>R&&(y=R)}return{[f]:h,[d]:y}}}},wx=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=()=>{},...l}=_e(e,t),u=await i.detectOverflow(t,l),d=Be(o),f=$t(o),h=Ne(o)==="y",{width:y,height:m}=s.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,v=f==="end"?"top":"bottom");const w=m-u.top-u.bottom,b=y-u.left-u.right,S=qe(m-u[v],w),P=qe(y-u[x],b),R=!t.middlewareData.shift;let T=S,E=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),R&&!f){const D=ge(u.left,0),O=ge(u.right,0),F=ge(u.top,0),W=ge(u.bottom,0);h?E=y-2*(D!==0||O!==0?D+O:ge(u.left,u.right)):T=m-2*(F!==0||W!==0?F+W:ge(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:T});const k=await i.getDimensions(a.floating);return y!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}};function dr(){return typeof window<"u"}function Wt(e){return cu(e)?(e.nodeName||"").toLowerCase():"#document"}function ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Le(e){var t;return(t=(cu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cu(e){return dr()?e instanceof Node||e instanceof ve(e).Node:!1}function Te(e){return dr()?e instanceof Element||e instanceof ve(e).Element:!1}function $e(e){return dr()?e instanceof HTMLElement||e instanceof ve(e).HTMLElement:!1}function Ta(e){return!dr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ve(e).ShadowRoot}function fn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Re(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function bx(e){return/^(table|td|th)$/.test(Wt(e))}function fr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Sx=/transform|translate|scale|rotate|perspective|filter/,Cx=/paint|layout|strict|content/,it=e=>!!e&&e!=="none";let Zr;function Ms(e){const t=Te(e)?Re(e):e;return it(t.transform)||it(t.translate)||it(t.scale)||it(t.rotate)||it(t.perspective)||!Ds()&&(it(t.backdropFilter)||it(t.filter))||Sx.test(t.willChange||"")||Cx.test(t.contain||"")}function Px(e){let t=Ze(e);for(;$e(t)&&!Ot(t);){if(Ms(t))return t;if(fr(t))return null;t=Ze(t)}return null}function Ds(){return Zr==null&&(Zr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Zr}function Ot(e){return/^(html|body|#document)$/.test(Wt(e))}function Re(e){return ve(e).getComputedStyle(e)}function hr(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if(Wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ta(e)&&e.host||Le(e);return Ta(t)?t.host:t}function lu(e){const t=Ze(e);return Ot(t)?e.ownerDocument?e.ownerDocument.body:e.body:$e(t)&&fn(t)?t:lu(t)}function on(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=lu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ve(o);if(s){const a=Lo(i);return t.concat(i,i.visualViewport||[],fn(o)?o:[],a&&n?on(a):[])}else return t.concat(o,on(o,[],n))}function Lo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uu(e){const t=Re(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$e(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Xn(n)!==s||Xn(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Is(e){return Te(e)?e:e.contextElement}function Mt(e){const t=Is(e);if(!$e(t))return je(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=uu(t);let i=(s?Xn(n.width):n.width)/r,a=(s?Xn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Tx=je(0);function du(e){const t=ve(e);return!Ds()||!t.visualViewport?Tx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ve(e)?!1:t}function ht(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Is(e);let i=je(1);t&&(r?Te(r)&&(i=Mt(r)):i=Mt(e));const a=Rx(s,n,r)?du(s):je(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=ve(s),h=r&&Te(r)?ve(r):r;let y=f,m=Lo(y);for(;m&&r&&h!==y;){const v=Mt(m),x=m.getBoundingClientRect(),w=Re(m),b=x.left+(m.clientLeft+parseFloat(w.paddingLeft))*v.x,S=x.top+(m.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,d*=v.y,c+=b,l+=S,y=ve(m),m=Lo(y)}}return Zn({width:u,height:d,x:c,y:l})}function pr(e,t){const n=hr(e).scrollLeft;return t?t.left+n:ht(Le(e)).left+n}function fu(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ex(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Le(r),a=t?fr(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=je(1);const u=je(0),d=$e(r);if((d||!d&&!s)&&((Wt(r)!=="body"||fn(i))&&(c=hr(r)),d)){const h=ht(r);l=Mt(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!s?fu(i,c):je(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ax(e){return Array.from(e.getClientRects())}function Mx(e){const t=Le(e),n=hr(e),r=e.ownerDocument.body,o=ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+pr(e);const a=-n.scrollTop;return Re(r).direction==="rtl"&&(i+=ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Ra=25;function Dx(e,t){const n=ve(e),r=Le(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const u=Ds();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=pr(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(r.clientWidth-d.clientWidth-h);y<=Ra&&(s-=y)}else l<=Ra&&(s+=l);return{width:s,height:i,x:a,y:c}}function Ix(e,t){const n=ht(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=$e(e)?Mt(e):je(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function Ea(e,t,n){let r;if(t==="viewport")r=Dx(e,n);else if(t==="document")r=Mx(Le(e));else if(Te(t))r=Ix(t,n);else{const o=du(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zn(r)}function hu(e,t){const n=Ze(e);return n===t||!Te(n)||Ot(n)?!1:Re(n).position==="fixed"||hu(n,t)}function kx(e,t){const n=t.get(e);if(n)return n;let r=on(e,[],!1).filter(a=>Te(a)&&Wt(a)!=="body"),o=null;const s=Re(e).position==="fixed";let i=s?Ze(e):e;for(;Te(i)&&!Ot(i);){const a=Re(i),c=Ms(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||fn(i)&&!c&&hu(e,i))?r=r.filter(u=>u!==i):o=a,i=Ze(i)}return t.set(e,r),r}function Nx(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?fr(t)?[]:kx(t,this._c):[].concat(n),r],a=Ea(t,i[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let f=1;f<i.length;f++){const h=Ea(t,i[f],o);c=ge(h.top,c),l=qe(h.right,l),u=qe(h.bottom,u),d=ge(h.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function Ox(e){const{width:t,height:n}=uu(e);return{width:t,height:n}}function jx(e,t,n){const r=$e(t),o=Le(t),s=n==="fixed",i=ht(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=je(0);function l(){c.x=pr(o)}if(r||!r&&!s)if((Wt(t)!=="body"||fn(o))&&(a=hr(t)),r){const h=ht(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?fu(o,a):je(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function Qr(e){return Re(e).position==="static"}function Aa(e,t){if(!$e(e)||Re(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Le(e)===n&&(n=n.ownerDocument.body),n}function pu(e,t){const n=ve(e);if(fr(e))return n;if(!$e(e)){let o=Ze(e);for(;o&&!Ot(o);){if(Te(o)&&!Qr(o))return o;o=Ze(o)}return n}let r=Aa(e,t);for(;r&&bx(r)&&Qr(r);)r=Aa(r,t);return r&&Ot(r)&&Qr(r)&&!Ms(r)?n:r||Px(e)||n}const Vx=async function(e){const t=this.getOffsetParent||pu,n=this.getDimensions,r=await n(e.floating);return{reference:jx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Lx(e){return Re(e).direction==="rtl"}const Fx={convertOffsetParentRelativeRectToViewportRelativeRect:Ex,getDocumentElement:Le,getClippingRect:Nx,getOffsetParent:pu,getElementRects:Vx,getClientRects:Ax,getDimensions:Ox,getScale:Mt,isElement:Te,isRTL:Lx};function mu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _x(e,t){let n=null,r;const o=Le(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 l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const y=bn(d),m=bn(o.clientWidth-(u+f)),v=bn(o.clientHeight-(d+h)),x=bn(u),b={rootMargin:-y+"px "+-m+"px "+-v+"px "+-x+"px",threshold:ge(0,qe(1,c))||1};let S=!0;function P(R){const T=R[0].intersectionRatio;if(T!==c){if(!S)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!mu(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(P,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(e)}return i(!0),s}function Bx(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,l=Is(e),u=o||s?[...l?on(l):[],...t?on(t):[]]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const d=l&&a?_x(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!c&&h.observe(l),t&&h.observe(t));let y,m=c?ht(e):null;c&&v();function v(){const x=ht(e);m&&!mu(m,x)&&n(),m=x,y=requestAnimationFrame(v)}return n(),()=>{var x;u.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(x=h)==null||x.disconnect(),h=null,c&&cancelAnimationFrame(y)}}const $x=vx,Wx=yx,Ux=px,Gx=wx,Hx=mx,Ma=hx,Kx=xx,zx=(e,t,n)=>{const r=new Map,o={platform:Fx,...n},s={...o.platform,_c:r};return fx(e,t,{...o,platform:s})};var Yx=typeof document<"u",Xx=function(){},jn=Yx?C.useLayoutEffect:Xx;function Qn(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(!Qn(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)&&!Qn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function gu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Da(e,t){const n=gu(e);return Math.round(t*n)/n}function Jr(e){const t=p.useRef(e);return jn(()=>{t.current=e}),t}function qx(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:l}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=p.useState(r);Qn(f,r)||h(r);const[y,m]=p.useState(null),[v,x]=p.useState(null),w=p.useCallback(I=>{I!==R.current&&(R.current=I,m(I))},[]),b=p.useCallback(I=>{I!==T.current&&(T.current=I,x(I))},[]),S=s||y,P=i||v,R=p.useRef(null),T=p.useRef(null),E=p.useRef(u),k=c!=null,D=Jr(c),O=Jr(o),F=Jr(l),W=p.useCallback(()=>{if(!R.current||!T.current)return;const I={placement:t,strategy:n,middleware:f};O.current&&(I.platform=O.current),zx(R.current,T.current,I).then(H=>{const te={...H,isPositioned:F.current!==!1};_.current&&!Qn(E.current,te)&&(E.current=te,tr.flushSync(()=>{d(te)}))})},[f,t,n,O,F]);jn(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[l]);const _=p.useRef(!1);jn(()=>(_.current=!0,()=>{_.current=!1}),[]),jn(()=>{if(S&&(R.current=S),P&&(T.current=P),S&&P){if(D.current)return D.current(S,P,W);W()}},[S,P,W,D,k]);const B=p.useMemo(()=>({reference:R,floating:T,setReference:w,setFloating:b}),[w,b]),A=p.useMemo(()=>({reference:S,floating:P}),[S,P]),V=p.useMemo(()=>{const I={position:n,left:0,top:0};if(!A.floating)return I;const H=Da(A.floating,u.x),te=Da(A.floating,u.y);return a?{...I,transform:"translate("+H+"px, "+te+"px)",...gu(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:te}},[n,a,A.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:W,refs:B,elements:A,floatingStyles:V}),[u,W,B,A,V])}const Zx=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?Ma({element:r.current,padding:o}).fn(n):{}:r?Ma({element:r,padding:o}).fn(n):{}}}},Qx=(e,t)=>{const n=$x(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jx=(e,t)=>{const n=Wx(e);return{name:n.name,fn:n.fn,options:[e,t]}},ew=(e,t)=>({fn:Kx(e).fn,options:[e,t]}),tw=(e,t)=>{const n=Ux(e);return{name:n.name,fn:n.fn,options:[e,t]}},nw=(e,t)=>{const n=Gx(e);return{name:n.name,fn:n.fn,options:[e,t]}},rw=(e,t)=>{const n=Hx(e);return{name:n.name,fn:n.fn,options:[e,t]}},ow=(e,t)=>{const n=Zx(e);return{name:n.name,fn:n.fn,options:[e,t]}};var sw="Arrow",vu=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return g.jsx($.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});vu.displayName=sw;var iw=vu;function mr(e){const[t,n]=p.useState(void 0);return ue(()=>{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,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.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 ks="Popper",[yu,gr]=Ee(ks),[aw,xu]=yu(ks),wu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return g.jsx(aw,{scope:t,anchor:r,onAnchorChange:o,children:n})};wu.displayName=ks;var bu="PopperAnchor",Su=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=xu(bu,n),i=p.useRef(null),a=Q(t,i),c=p.useRef(null);return p.useEffect(()=>{const l=c.current;c.current=(r==null?void 0:r.current)||i.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:g.jsx($.div,{...o,ref:a})});Su.displayName=bu;var Ns="PopperContent",[cw,lw]=yu(Ns),Cu=p.forwardRef((e,t)=>{var N,Y,q,Z,J,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:y,...m}=e,v=xu(Ns,n),[x,w]=p.useState(null),b=Q(t,me=>w(me)),[S,P]=p.useState(null),R=mr(S),T=(R==null?void 0:R.width)??0,E=(R==null?void 0:R.height)??0,k=r+(s!=="center"?"-"+s:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],F=O.length>0,W={padding:D,boundary:O.filter(dw),altBoundary:F},{refs:_,floatingStyles:B,placement:A,isPositioned:V,middlewareData:I}=qx({strategy:"fixed",placement:k,whileElementsMounted:(...me)=>Bx(...me,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Qx({mainAxis:o+E,alignmentAxis:i}),c&&Jx({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ew():void 0,...W}),c&&tw({...W}),nw({...W,apply:({elements:me,rects:Me,availableWidth:Gt,availableHeight:Ht})=>{const{width:Kt,height:ff}=Me.reference,mn=me.floating.style;mn.setProperty("--radix-popper-available-width",`${Gt}px`),mn.setProperty("--radix-popper-available-height",`${Ht}px`),mn.setProperty("--radix-popper-anchor-width",`${Kt}px`),mn.setProperty("--radix-popper-anchor-height",`${ff}px`)}}),S&&ow({element:S,padding:a}),fw({arrowWidth:T,arrowHeight:E}),f&&rw({strategy:"referenceHidden",...W})]}),[H,te]=Ru(A),ie=Xe(y);ue(()=>{V&&(ie==null||ie())},[V,ie]);const M=(N=I.arrow)==null?void 0:N.x,U=(Y=I.arrow)==null?void 0:Y.y,z=((q=I.arrow)==null?void 0:q.centerOffset)!==0,[L,X]=p.useState();return ue(()=>{x&&X(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:V?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:L,"--radix-popper-transform-origin":[(Z=I.transformOrigin)==null?void 0:Z.x,(J=I.transformOrigin)==null?void 0:J.y].join(" "),...((ee=I.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(cw,{scope:n,placedSide:H,onArrowChange:P,arrowX:M,arrowY:U,shouldHideArrow:z,children:g.jsx($.div,{"data-side":H,"data-align":te,...m,ref:b,style:{...m.style,animation:V?void 0:"none"}})})})});Cu.displayName=Ns;var Pu="PopperArrow",uw={top:"bottom",right:"left",bottom:"top",left:"right"},Tu=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=lw(Pu,r),i=uw[s.placedSide];return g.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:g.jsx(iw,{...o,ref:n,style:{...o.style,display:"block"}})})});Tu.displayName=Pu;function dw(e){return e!==null}var fw=e=>({name:"transformOrigin",options:e,fn(t){var v,x,w;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,[l,u]=Ru(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let y="",m="";return l==="bottom"?(y=i?d:`${f}px`,m=`${-c}px`):l==="top"?(y=i?d:`${f}px`,m=`${r.floating.height+c}px`):l==="right"?(y=`${-c}px`,m=i?d:`${h}px`):l==="left"&&(y=`${r.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:y,y:m}}}});function Ru(e){const[t,n="center"]=e.split("-");return[t,n]}var Eu=wu,Os=Su,Au=Cu,Mu=Tu,hw="Portal",vr=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=p.useState(!1);ue(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Ga.createPortal(g.jsx($.div,{...r,ref:t}),i):null});vr.displayName=hw;function yr(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 Du=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"}),pw="VisuallyHidden",mw=p.forwardRef((e,t)=>g.jsx($.span,{...e,ref:t,style:{...Du,...e.style}}));mw.displayName=pw;var gw=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yt=new WeakMap,Sn=new WeakMap,Cn={},eo=0,Iu=function(e){return e&&(e.host||Iu(e.parentNode))},vw=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Iu(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})},yw=function(e,t,n,r){var o=vw(t,Array.isArray(e)?e:[e]);Cn[n]||(Cn[n]=new WeakMap);var s=Cn[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),y=h!==null&&h!=="false",m=(yt.get(f)||0)+1,v=(s.get(f)||0)+1;yt.set(f,m),s.set(f,v),i.push(f),m===1&&y&&Sn.set(f,!0),v===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return u(t),a.clear(),eo++,function(){i.forEach(function(d){var f=yt.get(d)-1,h=s.get(d)-1;yt.set(d,f),s.set(d,h),f||(Sn.has(d)||d.removeAttribute(r),Sn.delete(d)),h||d.removeAttribute(n)}),eo--,eo||(yt=new WeakMap,yt=new WeakMap,Sn=new WeakMap,Cn={})}},js=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=gw(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),yw(r,o,n,"aria-hidden")):function(){return null}},ke=function(){return ke=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},ke.apply(this,arguments)};function ku(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 xw(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 Vn="right-scroll-bar-position",Ln="width-before-scroll-bar",ww="with-scroll-bars-hidden",bw="--removed-body-scroll-bar-size";function to(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Sw(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 Cw=typeof window<"u"?p.useLayoutEffect:p.useEffect,Ia=new WeakMap;function Pw(e,t){var n=Sw(null,function(r){return e.forEach(function(o){return to(o,r)})});return Cw(function(){var r=Ia.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||to(a,null)}),s.forEach(function(a){o.has(a)||to(a,i)})}Ia.set(n,e)},[e]),n}function Tw(e){return e}function Rw(e,t){t===void 0&&(t=Tw);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 u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function Ew(e){e===void 0&&(e={});var t=Rw(null);return t.options=ke({async:!0,ssr:!1},e),t}var Nu=function(e){var t=e.sideCar,n=ku(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,ke({},n))};Nu.isSideCarExport=!0;function Aw(e,t){return e.useMedium(t),Nu}var Ou=Ew(),no=function(){},xr=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:no,onWheelCapture:no,onTouchMoveCapture:no}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,y=e.noIsolation,m=e.inert,v=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,b=e.gapMode,S=ku(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=f,R=Pw([n,t]),T=ke(ke({},S),o);return p.createElement(p.Fragment,null,u&&p.createElement(P,{sideCar:Ou,removeScrollBar:l,shards:d,noRelative:h,noIsolation:y,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:b}),i?p.cloneElement(p.Children.only(a),ke(ke({},T),{ref:R})):p.createElement(w,ke({},T,{className:c,ref:R}),a))});xr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xr.classNames={fullWidth:Ln,zeroRight:Vn};var Mw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Mw();return t&&e.setAttribute("nonce",t),e}function Iw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Dw())&&(Iw(t,n),kw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ow=function(){var e=Nw();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ju=function(){var e=Ow(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},jw={left:0,top:0,right:0,gap:0},ro=function(e){return parseInt(e||"",10)||0},Vw=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[ro(n),ro(r),ro(o)]},Lw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jw;var t=Vw(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])}},Fw=ju(),Dt="data-scroll-locked",_w=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
75
|
+
.`.concat(ww,` {
|
|
76
|
+
overflow: hidden `).concat(r,`;
|
|
77
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
78
|
+
}
|
|
79
|
+
body[`).concat(Dt,`] {
|
|
80
|
+
overflow: hidden `).concat(r,`;
|
|
81
|
+
overscroll-behavior: contain;
|
|
82
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
83
|
+
padding-left: `.concat(o,`px;
|
|
84
|
+
padding-top: `).concat(s,`px;
|
|
85
|
+
padding-right: `).concat(i,`px;
|
|
86
|
+
margin-left:0;
|
|
87
|
+
margin-top:0;
|
|
88
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
89
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.`).concat(Vn,` {
|
|
93
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.`).concat(Ln,` {
|
|
97
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.`).concat(Vn," .").concat(Vn,` {
|
|
101
|
+
right: 0 `).concat(r,`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.`).concat(Ln," .").concat(Ln,` {
|
|
105
|
+
margin-right: 0 `).concat(r,`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
body[`).concat(Dt,`] {
|
|
109
|
+
`).concat(bw,": ").concat(a,`px;
|
|
110
|
+
}
|
|
111
|
+
`)},ka=function(){var e=parseInt(document.body.getAttribute(Dt)||"0",10);return isFinite(e)?e:0},Bw=function(){p.useEffect(function(){return document.body.setAttribute(Dt,(ka()+1).toString()),function(){var e=ka()-1;e<=0?document.body.removeAttribute(Dt):document.body.setAttribute(Dt,e.toString())}},[])},$w=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Bw();var s=p.useMemo(function(){return Lw(o)},[o]);return p.createElement(Fw,{styles:_w(s,!t,o,n?"":"!important")})},Fo=!1;if(typeof window<"u")try{var Pn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",Pn,Pn),window.removeEventListener("test",Pn,Pn)}catch{Fo=!1}var xt=Fo?{passive:!1}:!1,Ww=function(e){return e.tagName==="TEXTAREA"},Vu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ww(e)&&n[t]==="visible")},Uw=function(e){return Vu(e,"overflowY")},Gw=function(e){return Vu(e,"overflowX")},Na=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Lu(e,r);if(o){var s=Fu(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Hw=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Kw=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Lu=function(e,t){return e==="v"?Uw(t):Gw(t)},Fu=function(e,t){return e==="v"?Hw(t):Kw(t)},zw=function(e,t){return e==="h"&&t==="rtl"?-1:1},Yw=function(e,t,n,r,o){var s=zw(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,f=0;do{if(!a)break;var h=Fu(e,a),y=h[0],m=h[1],v=h[2],x=m-v-s*y;(y||x)&&Lu(e,a)&&(d+=x,f+=y);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(l=!0),l},Tn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Oa=function(e){return[e.deltaX,e.deltaY]},ja=function(e){return e&&"current"in e?e.current:e},Xw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qw=function(e){return`
|
|
112
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
113
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
114
|
+
`)},Zw=0,wt=[];function Qw(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(Zw++)[0],s=p.useState(ju)[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 m=xw([e.lockRef.current],(e.shards||[]).map(ja),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var x=Tn(m),w=n.current,b="deltaX"in m?m.deltaX:w[0]-x[0],S="deltaY"in m?m.deltaY:w[1]-x[1],P,R=m.target,T=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in m&&T==="h"&&R.type==="range")return!1;var E=window.getSelection(),k=E&&E.anchorNode,D=k?k===R||k.contains(R):!1;if(D)return!1;var O=Na(T,R);if(!O)return!0;if(O?P=T:(P=T==="v"?"h":"v",O=Na(T,R)),!O)return!1;if(!r.current&&"changedTouches"in m&&(b||S)&&(r.current=P),!P)return!0;var F=r.current||P;return Yw(F,v,m,F==="h"?b:S)},[]),c=p.useCallback(function(m){var v=m;if(!(!wt.length||wt[wt.length-1]!==s)){var x="deltaY"in v?Oa(v):Tn(v),w=t.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&Xw(P.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(ja).filter(Boolean).filter(function(P){return P.contains(v.target)}),S=b.length>0?a(v,b[0]):!i.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),l=p.useCallback(function(m,v,x,w){var b={name:m,delta:v,target:x,should:w,shadowParent:Jw(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),u=p.useCallback(function(m){n.current=Tn(m),r.current=void 0},[]),d=p.useCallback(function(m){l(m.type,Oa(m),m.target,a(m,e.lockRef.current))},[]),f=p.useCallback(function(m){l(m.type,Tn(m),m.target,a(m,e.lockRef.current))},[]);p.useEffect(function(){return wt.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,xt),document.addEventListener("touchmove",c,xt),document.addEventListener("touchstart",u,xt),function(){wt=wt.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,xt),document.removeEventListener("touchmove",c,xt),document.removeEventListener("touchstart",u,xt)}},[]);var h=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(s,{styles:qw(o)}):null,h?p.createElement($w,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const eb=Aw(Ou,Qw);var wr=p.forwardRef(function(e,t){return p.createElement(xr,ke({},e,{ref:t,sideCar:eb}))});wr.classNames=xr.classNames;var tb=[" ","Enter","ArrowUp","ArrowDown"],nb=[" ","Enter"],pt="Select",[br,Sr,rb]=Fl(pt),[Ut]=Ee(pt,[rb,gr]),Cr=gr(),[ob,tt]=Ut(pt),[sb,ib]=Ut(pt),_u=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:h,form:y}=e,m=Cr(t),[v,x]=p.useState(null),[w,b]=p.useState(null),[S,P]=p.useState(!1),R=ar(l),[T,E]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:pt}),[k,D]=Pe({prop:i,defaultProp:a,onChange:c,caller:pt}),O=p.useRef(null),F=v?y||!!v.closest("form"):!0,[W,_]=p.useState(new Set),B=Array.from(W).map(A=>A.props.value).join(";");return g.jsx(Eu,{...m,children:g.jsxs(ob,{required:h,scope:t,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:P,contentId:pe(),value:k,onValueChange:D,open:T,onOpenChange:E,dir:R,triggerPointerDownPosRef:O,disabled:f,children:[g.jsx(br.Provider,{scope:t,children:g.jsx(sb,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(A=>{_(V=>new Set(V).add(A))},[]),onNativeOptionRemove:p.useCallback(A=>{_(V=>{const I=new Set(V);return I.delete(A),I})},[]),children:n})}),F?g.jsxs(cd,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:k,onChange:A=>D(A.target.value),disabled:f,form:y,children:[k===void 0?g.jsx("option",{value:""}):null,Array.from(W)]},B):null]})})};_u.displayName=pt;var Bu="SelectTrigger",$u=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Cr(n),i=tt(Bu,n),a=i.disabled||r,c=Q(t,i.onTriggerChange),l=Sr(n),u=p.useRef("touch"),[d,f,h]=ud(m=>{const v=l().filter(b=>!b.disabled),x=v.find(b=>b.value===i.value),w=dd(v,m,x);w!==void 0&&i.onValueChange(w.value)}),y=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(Os,{asChild:!0,...s,children:g.jsx($.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":ld(i.value)?"":void 0,...o,ref:c,onClick:K(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&y(m)}),onPointerDown:K(o.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:K(o.onKeyDown,m=>{const v=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(v&&m.key===" ")&&tb.includes(m.key)&&(y(),m.preventDefault())})})})});$u.displayName=Bu;var Wu="SelectValue",Uu=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=tt(Wu,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=Q(t,c.onValueNodeChange);return ue(()=>{l(u)},[l,u]),g.jsx($.span,{...a,ref:d,style:{pointerEvents:"none"},children:ld(c.value)?g.jsx(g.Fragment,{children:i}):s})});Uu.displayName=Wu;var ab="SelectIcon",Gu=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx($.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Gu.displayName=ab;var cb="SelectPortal",Hu=e=>g.jsx(vr,{asChild:!0,...e});Hu.displayName=cb;var mt="SelectContent",Ku=p.forwardRef((e,t)=>{const n=tt(mt,e.__scopeSelect),[r,o]=p.useState();if(ue(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?tr.createPortal(g.jsx(zu,{scope:e.__scopeSelect,children:g.jsx(br.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),s):null}return g.jsx(Yu,{...e,ref:t})});Ku.displayName=mt;var Se=10,[zu,nt]=Ut(mt),lb="SelectContentImpl",ub=Nt("SelectContent.RemoveScroll"),Yu=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:v,...x}=e,w=tt(mt,n),[b,S]=p.useState(null),[P,R]=p.useState(null),T=Q(t,N=>S(N)),[E,k]=p.useState(null),[D,O]=p.useState(null),F=Sr(n),[W,_]=p.useState(!1),B=p.useRef(!1);p.useEffect(()=>{if(b)return js(b)},[b]),Ts();const A=p.useCallback(N=>{const[Y,...q]=F().map(ee=>ee.ref.current),[Z]=q.slice(-1),J=document.activeElement;for(const ee of N)if(ee===J||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===Y&&P&&(P.scrollTop=0),ee===Z&&P&&(P.scrollTop=P.scrollHeight),ee==null||ee.focus(),document.activeElement!==J))return},[F,P]),V=p.useCallback(()=>A([E,b]),[A,E,b]);p.useEffect(()=>{W&&V()},[W,V]);const{onOpenChange:I,triggerPointerDownPosRef:H}=w;p.useEffect(()=>{if(b){let N={x:0,y:0};const Y=Z=>{var J,ee;N={x:Math.abs(Math.round(Z.pageX)-(((J=H.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(Z.pageY)-(((ee=H.current)==null?void 0:ee.y)??0))}},q=Z=>{N.x<=10&&N.y<=10?Z.preventDefault():b.contains(Z.target)||I(!1),document.removeEventListener("pointermove",Y),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",q,{capture:!0})}}},[b,I,H]),p.useEffect(()=>{const N=()=>I(!1);return window.addEventListener("blur",N),window.addEventListener("resize",N),()=>{window.removeEventListener("blur",N),window.removeEventListener("resize",N)}},[I]);const[te,ie]=ud(N=>{const Y=F().filter(J=>!J.disabled),q=Y.find(J=>J.ref.current===document.activeElement),Z=dd(Y,N,q);Z&&setTimeout(()=>Z.ref.current.focus())}),M=p.useCallback((N,Y,q)=>{const Z=!B.current&&!q;(w.value!==void 0&&w.value===Y||Z)&&(k(N),Z&&(B.current=!0))},[w.value]),U=p.useCallback(()=>b==null?void 0:b.focus(),[b]),z=p.useCallback((N,Y,q)=>{const Z=!B.current&&!q;(w.value!==void 0&&w.value===Y||Z)&&O(N)},[w.value]),L=r==="popper"?_o:Xu,X=L===_o?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:v}:{};return g.jsx(zu,{scope:n,content:b,viewport:P,onViewportChange:R,itemRefCallback:M,selectedItem:E,onItemLeave:U,itemTextRefCallback:z,focusSelectedItem:V,selectedItemText:D,position:r,isPositioned:W,searchRef:te,children:g.jsx(wr,{as:ub,allowPinchZoom:!0,children:g.jsx(ur,{asChild:!0,trapped:w.open,onMountAutoFocus:N=>{N.preventDefault()},onUnmountAutoFocus:K(o,N=>{var Y;(Y=w.trigger)==null||Y.focus({preventScroll:!0}),N.preventDefault()}),children:g.jsx(lr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:N=>N.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:g.jsx(L,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:N=>N.preventDefault(),...x,...X,onPlaced:()=>_(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:K(x.onKeyDown,N=>{const Y=N.ctrlKey||N.altKey||N.metaKey;if(N.key==="Tab"&&N.preventDefault(),!Y&&N.key.length===1&&ie(N.key),["ArrowUp","ArrowDown","Home","End"].includes(N.key)){let Z=F().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(N.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(N.key)){const J=N.target,ee=Z.indexOf(J);Z=Z.slice(ee+1)}setTimeout(()=>A(Z)),N.preventDefault()}})})})})})})});Yu.displayName=lb;var db="SelectItemAlignedPosition",Xu=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=tt(mt,n),i=nt(mt,n),[a,c]=p.useState(null),[l,u]=p.useState(null),d=Q(t,T=>u(T)),f=Sr(n),h=p.useRef(!1),y=p.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:x,focusSelectedItem:w}=i,b=p.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&v&&x){const T=s.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),k=s.valueNode.getBoundingClientRect(),D=x.getBoundingClientRect();if(s.dir!=="rtl"){const J=D.left-E.left,ee=k.left-J,me=T.left-ee,Me=T.width+me,Gt=Math.max(Me,E.width),Ht=window.innerWidth-Se,Kt=fa(ee,[Se,Math.max(Se,Ht-Gt)]);a.style.minWidth=Me+"px",a.style.left=Kt+"px"}else{const J=E.right-D.right,ee=window.innerWidth-k.right-J,me=window.innerWidth-T.right-ee,Me=T.width+me,Gt=Math.max(Me,E.width),Ht=window.innerWidth-Se,Kt=fa(ee,[Se,Math.max(Se,Ht-Gt)]);a.style.minWidth=Me+"px",a.style.right=Kt+"px"}const O=f(),F=window.innerHeight-Se*2,W=m.scrollHeight,_=window.getComputedStyle(l),B=parseInt(_.borderTopWidth,10),A=parseInt(_.paddingTop,10),V=parseInt(_.borderBottomWidth,10),I=parseInt(_.paddingBottom,10),H=B+A+W+I+V,te=Math.min(v.offsetHeight*5,H),ie=window.getComputedStyle(m),M=parseInt(ie.paddingTop,10),U=parseInt(ie.paddingBottom,10),z=T.top+T.height/2-Se,L=F-z,X=v.offsetHeight/2,N=v.offsetTop+X,Y=B+A+N,q=H-Y;if(Y<=z){const J=O.length>0&&v===O[O.length-1].ref.current;a.style.bottom="0px";const ee=l.clientHeight-m.offsetTop-m.offsetHeight,me=Math.max(L,X+(J?U:0)+ee+V),Me=Y+me;a.style.height=Me+"px"}else{const J=O.length>0&&v===O[0].ref.current;a.style.top="0px";const me=Math.max(z,B+m.offsetTop+(J?M:0)+X)+q;a.style.height=me+"px",m.scrollTop=Y-z+m.offsetTop}a.style.margin=`${Se}px 0`,a.style.minHeight=te+"px",a.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,s.trigger,s.valueNode,a,l,m,v,x,s.dir,r]);ue(()=>b(),[b]);const[S,P]=p.useState();ue(()=>{l&&P(window.getComputedStyle(l).zIndex)},[l]);const R=p.useCallback(T=>{T&&y.current===!0&&(b(),w==null||w(),y.current=!1)},[b,w]);return g.jsx(hb,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:g.jsx($.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Xu.displayName=db;var fb="SelectPopperPosition",_o=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Se,...s}=e,i=Cr(n);return g.jsx(Au,{...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)"}})});_o.displayName=fb;var[hb,Vs]=Ut(mt,{}),Bo="SelectViewport",qu=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=nt(Bo,n),i=Vs(Bo,n),a=Q(t,s.onViewportChange),c=p.useRef(0);return g.jsxs(g.Fragment,{children:[g.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}),g.jsx(br.Slot,{scope:n,children:g.jsx($.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:K(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const y=window.innerHeight-Se*2,m=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),x=Math.max(m,v);if(x<y){const w=x+h,b=Math.min(y,w),S=w-b;d.style.height=b+"px",d.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});qu.displayName=Bo;var Zu="SelectGroup",[pb,mb]=Ut(Zu),Qu=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=pe();return g.jsx(pb,{scope:n,id:o,children:g.jsx($.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Qu.displayName=Zu;var Ju="SelectLabel",ed=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=mb(Ju,n);return g.jsx($.div,{id:o.id,...r,ref:t})});ed.displayName=Ju;var Jn="SelectItem",[gb,td]=Ut(Jn),nd=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=tt(Jn,n),c=nt(Jn,n),l=a.value===r,[u,d]=p.useState(s??""),[f,h]=p.useState(!1),y=Q(t,w=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,w,r,o)}),m=pe(),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 g.jsx(gb,{scope:n,value:r,disabled:o,textId:m,isSelected:l,onItemTextChange:p.useCallback(w=>{d(b=>b||((w==null?void 0:w.textContent)??"").trim())},[]),children:g.jsx(br.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:g.jsx($.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:y,onFocus:K(i.onFocus,()=>h(!0)),onBlur:K(i.onBlur,()=>h(!1)),onClick:K(i.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:K(i.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:K(i.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:K(i.onPointerMove,w=>{var b;v.current=w.pointerType,o?(b=c.onItemLeave)==null||b.call(c):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:K(i.onPointerLeave,w=>{var b;w.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:K(i.onKeyDown,w=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&w.key===" "||(nb.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});nd.displayName=Jn;var qt="SelectItemText",rd=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=tt(qt,n),a=nt(qt,n),c=td(qt,n),l=ib(qt,n),[u,d]=p.useState(null),f=Q(t,x=>d(x),c.onItemTextChange,x=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,x,c.value,c.disabled)}),h=u==null?void 0:u.textContent,y=p.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=l;return ue(()=>(m(y),()=>v(y)),[m,v,y]),g.jsxs(g.Fragment,{children:[g.jsx($.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?tr.createPortal(s.children,i.valueNode):null]})});rd.displayName=qt;var od="SelectItemIndicator",sd=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return td(od,n).isSelected?g.jsx($.span,{"aria-hidden":!0,...r,ref:t}):null});sd.displayName=od;var $o="SelectScrollUpButton",vb=p.forwardRef((e,t)=>{const n=nt($o,e.__scopeSelect),r=Vs($o,e.__scopeSelect),[o,s]=p.useState(!1),i=Q(t,r.onScrollButtonChange);return ue(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(id,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});vb.displayName=$o;var Wo="SelectScrollDownButton",yb=p.forwardRef((e,t)=>{const n=nt(Wo,e.__scopeSelect),r=Vs(Wo,e.__scopeSelect),[o,s]=p.useState(!1),i=Q(t,r.onScrollButtonChange);return ue(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(id,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});yb.displayName=Wo;var id=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=nt("SelectScrollButton",n),i=p.useRef(null),a=Sr(n),c=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>c(),[c]),ue(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),g.jsx($.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:K(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:K(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:K(o.onPointerLeave,()=>{c()})})}),xb="SelectSeparator",ad=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx($.div,{"aria-hidden":!0,...r,ref:t})});ad.displayName=xb;var Uo="SelectArrow",wb=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Cr(n),s=tt(Uo,n),i=nt(Uo,n);return s.open&&i.position==="popper"?g.jsx(Mu,{...o,...r,ref:t}):null});wb.displayName=Uo;var bb="SelectBubbleInput",cd=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=p.useRef(null),s=Q(r,o),i=yr(t);return p.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),g.jsx($.select,{...n,style:{...Du,...n.style},ref:s,defaultValue:t})});cd.displayName=bb;function ld(e){return e===""||e===void 0}function ud(e){const t=Xe(e),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(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 dd(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Sb(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Sb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Cb=_u,Pb=$u,Tb=Uu,Rb=Gu,Eb=Hu,Ab=Ku,Mb=qu,Db=Qu,Ib=ed,kb=nd,Nb=rd,Ob=sd,jb=ad;function Vb({placeholder:e,size:t,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,disabled:c,children:l,"aria-invalid":u,"aria-describedby":d,...f}){const h=G("cny-select-trigger",t==="sm"||t==="lg"?t:null,n!=="primary"&&n,a,o);return g.jsxs(Cb,{disabled:c,...f,children:[g.jsxs(Pb,{id:i,"aria-invalid":u,"aria-describedby":d,className:h,children:[r&&g.jsx("span",{style:{display:"inline-flex"},children:r}),g.jsx(Tb,{placeholder:e}),g.jsx(Rb,{className:"cny-select-chevron",asChild:!0,children:g.jsx(eu,{size:14,"aria-hidden":"true"})})]}),g.jsx(Eb,{children:g.jsx(Ab,{position:"popper",sideOffset:4,className:G("cny-select-content",s),children:g.jsx(Mb,{className:"cny-select-viewport",children:l})})})]})}const Lb=C.forwardRef(function({className:t,children:n,...r},o){return g.jsxs(kb,{ref:o,className:G("cny-select-item",t),...r,children:[g.jsx(Nb,{children:n}),g.jsx(Ob,{className:"cny-select-indicator",children:g.jsx(Yn,{size:14,"aria-hidden":"true"})})]})}),Fb=C.forwardRef(function(t,n){return g.jsx(Db,{ref:n,...t})}),_b=C.forwardRef(function({className:t,...n},r){return g.jsx(Ib,{ref:r,className:G("cny-select-group-label",t),...n})}),Bb=C.forwardRef(function({className:t,...n},r){return g.jsx(jb,{ref:r,className:G("cny-select-separator",t),...n})});function $b(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var rt=e=>{const{present:t,children:n}=e,r=Wb(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=Q(r.ref,Ub(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};rt.displayName="Presence";function Wb(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[a,c]=$b(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const l=Rn(r.current);s.current=a==="mounted"?l:"none"},[a]),ue(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,h=Rn(l);e?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ue(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const m=Rn(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=h=>{h.target===t&&(s.current=Rn(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Rn(e){return(e==null?void 0:e.animationName)||"none"}function Ub(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 Pr="Popover",[fd]=Ee(Pr,[gr]),hn=gr(),[Gb,ot]=fd(Pr),hd=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=hn(t),c=p.useRef(null),[l,u]=p.useState(!1),[d,f]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:Pr});return g.jsx(Eu,{...a,children:g.jsx(Gb,{scope:t,contentId:pe(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:l,onCustomAnchorAdd:p.useCallback(()=>u(!0),[]),onCustomAnchorRemove:p.useCallback(()=>u(!1),[]),modal:i,children:n})})};hd.displayName=Pr;var pd="PopoverAnchor",Hb=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(pd,n),s=hn(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return p.useEffect(()=>(i(),()=>a()),[i,a]),g.jsx(Os,{...s,...r,ref:t})});Hb.displayName=pd;var md="PopoverTrigger",gd=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(md,n),s=hn(n),i=Q(t,o.triggerRef),a=g.jsx($.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bd(o.open),...r,ref:i,onClick:K(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:g.jsx(Os,{asChild:!0,...s,children:a})});gd.displayName=md;var Ls="PopoverPortal",[Kb,zb]=fd(Ls,{forceMount:void 0}),vd=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=ot(Ls,t);return g.jsx(Kb,{scope:t,forceMount:n,children:g.jsx(rt,{present:n||s.open,children:g.jsx(vr,{asChild:!0,container:o,children:r})})})};vd.displayName=Ls;var jt="PopoverContent",yd=p.forwardRef((e,t)=>{const n=zb(jt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=ot(jt,e.__scopePopover);return g.jsx(rt,{present:r||s.open,children:s.modal?g.jsx(Xb,{...o,ref:t}):g.jsx(qb,{...o,ref:t})})});yd.displayName=jt;var Yb=Nt("PopoverContent.RemoveScroll"),Xb=p.forwardRef((e,t)=>{const n=ot(jt,e.__scopePopover),r=p.useRef(null),o=Q(t,r),s=p.useRef(!1);return p.useEffect(()=>{const i=r.current;if(i)return js(i)},[]),g.jsx(wr,{as:Yb,allowPinchZoom:!0,children:g.jsx(xd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:K(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),qb=p.forwardRef((e,t)=>{const n=ot(jt,e.__scopePopover),r=p.useRef(!1),o=p.useRef(!1);return g.jsx(xd,{...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,l;(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;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),xd=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ot(jt,n),h=hn(n);return Ts(),g.jsx(ur,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:g.jsx(lr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:g.jsx(Au,{"data-state":bd(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.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)"}})})})}),wd="PopoverClose",Zb=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ot(wd,n);return g.jsx($.button,{type:"button",...r,ref:t,onClick:K(e.onClick,()=>o.onOpenChange(!1))})});Zb.displayName=wd;var Qb="PopoverArrow",Jb=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=hn(n);return g.jsx(Mu,{...o,...r,ref:t})});Jb.displayName=Qb;function bd(e){return e?"open":"closed"}var eS=hd,tS=gd,nS=vd,rS=yd,Va=1,oS=.9,sS=.8,iS=.17,oo=.1,so=.999,aS=.9999,cS=.99,lS=/[\\\/_+.#"@\[\(\{&]/,uS=/[\\\/_+.#"@\[\(\{&]/g,dS=/[\s-]/,Sd=/[\s-]/g;function Go(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?Va:cS;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),l=n.indexOf(c,o),u=0,d,f,h,y;l>=0;)d=Go(e,t,n,r,l+1,s+1,i),d>u&&(l===o?d*=Va:lS.test(e.charAt(l-1))?(d*=sS,h=e.slice(o,l-1).match(uS),h&&o>0&&(d*=Math.pow(so,h.length))):dS.test(e.charAt(l-1))?(d*=oS,y=e.slice(o,l-1).match(Sd),y&&o>0&&(d*=Math.pow(so,y.length))):(d*=iS,o>0&&(d*=Math.pow(so,l-o))),e.charAt(l)!==t.charAt(s)&&(d*=aS)),(d<oo&&n.charAt(l-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(l-1)!==r.charAt(s))&&(f=Go(e,t,n,r,l+1,s+2,i),f*oo>d&&(d=f*oo)),d>u&&(u=d),l=n.indexOf(c,l+1);return i[a]=u,u}function La(e){return e.toLowerCase().replace(Sd," ")}function fS(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Go(e,t,La(e),La(t),0,0,{})}var Tr="Dialog",[Cd]=Ee(Tr),[hS,Ae]=Cd(Tr),Pd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=p.useRef(null),c=p.useRef(null),[l,u]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:Tr});return g.jsx(hS,{scope:t,triggerRef:a,contentRef:c,contentId:pe(),titleId:pe(),descriptionId:pe(),open:l,onOpenChange:u,onOpenToggle:p.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};Pd.displayName=Tr;var Td="DialogTrigger",pS=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ae(Td,n),s=Q(t,o.triggerRef);return g.jsx($.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bs(o.open),...r,ref:s,onClick:K(e.onClick,o.onOpenToggle)})});pS.displayName=Td;var Fs="DialogPortal",[mS,Rd]=Cd(Fs,{forceMount:void 0}),Ed=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Ae(Fs,t);return g.jsx(mS,{scope:t,forceMount:n,children:p.Children.map(r,i=>g.jsx(rt,{present:n||s.open,children:g.jsx(vr,{asChild:!0,container:o,children:i})}))})};Ed.displayName=Fs;var er="DialogOverlay",Ad=p.forwardRef((e,t)=>{const n=Rd(er,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ae(er,e.__scopeDialog);return s.modal?g.jsx(rt,{present:r||s.open,children:g.jsx(vS,{...o,ref:t})}):null});Ad.displayName=er;var gS=Nt("DialogOverlay.RemoveScroll"),vS=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ae(er,n);return g.jsx(wr,{as:gS,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx($.div,{"data-state":Bs(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),gt="DialogContent",Md=p.forwardRef((e,t)=>{const n=Rd(gt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ae(gt,e.__scopeDialog);return g.jsx(rt,{present:r||s.open,children:s.modal?g.jsx(yS,{...o,ref:t}):g.jsx(xS,{...o,ref:t})})});Md.displayName=gt;var yS=p.forwardRef((e,t)=>{const n=Ae(gt,e.__scopeDialog),r=p.useRef(null),o=Q(t,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return js(s)},[]),g.jsx(Dd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:K(e.onFocusOutside,s=>s.preventDefault())})}),xS=p.forwardRef((e,t)=>{const n=Ae(gt,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return g.jsx(Dd,{...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,l;(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;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Dd=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Ae(gt,n),c=p.useRef(null),l=Q(t,c);return Ts(),g.jsxs(g.Fragment,{children:[g.jsx(ur,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:g.jsx(lr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bs(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(CS,{titleId:a.titleId}),g.jsx(TS,{contentRef:c,descriptionId:a.descriptionId})]})]})}),_s="DialogTitle",wS=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ae(_s,n);return g.jsx($.h2,{id:o.titleId,...r,ref:t})});wS.displayName=_s;var Id="DialogDescription",bS=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ae(Id,n);return g.jsx($.p,{id:o.descriptionId,...r,ref:t})});bS.displayName=Id;var kd="DialogClose",SS=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ae(kd,n);return g.jsx($.button,{type:"button",...r,ref:t,onClick:K(e.onClick,()=>o.onOpenChange(!1))})});SS.displayName=kd;function Bs(e){return e?"open":"closed"}var Nd="DialogTitleWarning",[m0,Od]=Ev(Nd,{contentName:gt,titleName:_s,docsSlug:"dialog"}),CS=({titleId:e})=>{const t=Od(Nd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
115
|
+
|
|
116
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
117
|
+
|
|
118
|
+
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},PS="DialogDescriptionWarning",TS=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Od(PS).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},RS=Pd,ES=Ed,AS=Ad,MS=Md,Yt='[cmdk-group=""]',io='[cmdk-group-items=""]',DS='[cmdk-group-heading=""]',jd='[cmdk-item=""]',Fa=`${jd}:not([aria-disabled="true"])`,Ho="cmdk-item-select",Ct="data-value",IS=(e,t,n)=>fS(e,t,n),Vd=p.createContext(void 0),pn=()=>p.useContext(Vd),Ld=p.createContext(void 0),$s=()=>p.useContext(Ld),Fd=p.createContext(void 0),_d=p.forwardRef((e,t)=>{let n=Pt(()=>{var M,U;return{search:"",value:(U=(M=e.value)!=null?M:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Pt(()=>new Set),o=Pt(()=>new Map),s=Pt(()=>new Map),i=Pt(()=>new Set),a=Bd(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:h,loop:y,disablePointerSelection:m=!1,vimBindings:v=!0,...x}=e,w=pe(),b=pe(),S=pe(),P=p.useRef(null),R=WS();vt(()=>{if(u!==void 0){let M=u.trim();n.current.value=M,T.emit()}},[u]),vt(()=>{R(6,W)},[]);let T=p.useMemo(()=>({subscribe:M=>(i.current.add(M),()=>i.current.delete(M)),snapshot:()=>n.current,setState:(M,U,z)=>{var L,X,N,Y;if(!Object.is(n.current[M],U)){if(n.current[M]=U,M==="search")F(),D(),R(1,O);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let q=document.getElementById(S);q?q.focus():(L=document.getElementById(w))==null||L.focus()}if(R(7,()=>{var q;n.current.selectedItemId=(q=_())==null?void 0:q.id,T.emit()}),z||R(5,W),((X=a.current)==null?void 0:X.value)!==void 0){let q=U??"";(Y=(N=a.current).onValueChange)==null||Y.call(N,q);return}}T.emit()}},emit:()=>{i.current.forEach(M=>M())}}),[]),E=p.useMemo(()=>({value:(M,U,z)=>{var L;U!==((L=s.current.get(M))==null?void 0:L.value)&&(s.current.set(M,{value:U,keywords:z}),n.current.filtered.items.set(M,k(U,z)),R(2,()=>{D(),T.emit()}))},item:(M,U)=>(r.current.add(M),U&&(o.current.has(U)?o.current.get(U).add(M):o.current.set(U,new Set([M]))),R(3,()=>{F(),D(),n.current.value||O(),T.emit()}),()=>{s.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let z=_();R(4,()=>{F(),(z==null?void 0:z.getAttribute("id"))===M&&O(),T.emit()})}),group:M=>(o.current.has(M)||o.current.set(M,new Set),()=>{s.current.delete(M),o.current.delete(M)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:S,labelId:b,listInnerRef:P}),[]);function k(M,U){var z,L;let X=(L=(z=a.current)==null?void 0:z.filter)!=null?L:IS;return M?X(M,n.current.search,U):0}function D(){if(!n.current.search||a.current.shouldFilter===!1)return;let M=n.current.filtered.items,U=[];n.current.filtered.groups.forEach(L=>{let X=o.current.get(L),N=0;X.forEach(Y=>{let q=M.get(Y);N=Math.max(q,N)}),U.push([L,N])});let z=P.current;B().sort((L,X)=>{var N,Y;let q=L.getAttribute("id"),Z=X.getAttribute("id");return((N=M.get(Z))!=null?N:0)-((Y=M.get(q))!=null?Y:0)}).forEach(L=>{let X=L.closest(io);X?X.appendChild(L.parentElement===X?L:L.closest(`${io} > *`)):z.appendChild(L.parentElement===z?L:L.closest(`${io} > *`))}),U.sort((L,X)=>X[1]-L[1]).forEach(L=>{var X;let N=(X=P.current)==null?void 0:X.querySelector(`${Yt}[${Ct}="${encodeURIComponent(L[0])}"]`);N==null||N.parentElement.appendChild(N)})}function O(){let M=B().find(z=>z.getAttribute("aria-disabled")!=="true"),U=M==null?void 0:M.getAttribute(Ct);T.setState("value",U||void 0)}function F(){var M,U,z,L;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let X=0;for(let N of r.current){let Y=(U=(M=s.current.get(N))==null?void 0:M.value)!=null?U:"",q=(L=(z=s.current.get(N))==null?void 0:z.keywords)!=null?L:[],Z=k(Y,q);n.current.filtered.items.set(N,Z),Z>0&&X++}for(let[N,Y]of o.current)for(let q of Y)if(n.current.filtered.items.get(q)>0){n.current.filtered.groups.add(N);break}n.current.filtered.count=X}function W(){var M,U,z;let L=_();L&&(((M=L.parentElement)==null?void 0:M.firstChild)===L&&((z=(U=L.closest(Yt))==null?void 0:U.querySelector(DS))==null||z.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function _(){var M;return(M=P.current)==null?void 0:M.querySelector(`${jd}[aria-selected="true"]`)}function B(){var M;return Array.from(((M=P.current)==null?void 0:M.querySelectorAll(Fa))||[])}function A(M){let U=B()[M];U&&T.setState("value",U.getAttribute(Ct))}function V(M){var U;let z=_(),L=B(),X=L.findIndex(Y=>Y===z),N=L[X+M];(U=a.current)!=null&&U.loop&&(N=X+M<0?L[L.length-1]:X+M===L.length?L[0]:L[X+M]),N&&T.setState("value",N.getAttribute(Ct))}function I(M){let U=_(),z=U==null?void 0:U.closest(Yt),L;for(;z&&!L;)z=M>0?BS(z,Yt):$S(z,Yt),L=z==null?void 0:z.querySelector(Fa);L?T.setState("value",L.getAttribute(Ct)):V(M)}let H=()=>A(B().length-1),te=M=>{M.preventDefault(),M.metaKey?H():M.altKey?I(1):V(1)},ie=M=>{M.preventDefault(),M.metaKey?A(0):M.altKey?I(-1):V(-1)};return p.createElement($.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:M=>{var U;(U=x.onKeyDown)==null||U.call(x,M);let z=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||z))switch(M.key){case"n":case"j":{v&&M.ctrlKey&&te(M);break}case"ArrowDown":{te(M);break}case"p":case"k":{v&&M.ctrlKey&&ie(M);break}case"ArrowUp":{ie(M);break}case"Home":{M.preventDefault(),A(0);break}case"End":{M.preventDefault(),H();break}case"Enter":{M.preventDefault();let L=_();if(L){let X=new Event(Ho);L.dispatchEvent(X)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:GS},c),Rr(e,M=>p.createElement(Ld.Provider,{value:T},p.createElement(Vd.Provider,{value:E},M))))}),kS=p.forwardRef((e,t)=>{var n,r;let o=pe(),s=p.useRef(null),i=p.useContext(Fd),a=pn(),c=Bd(e),l=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;vt(()=>{if(!l)return a.item(o,i==null?void 0:i.id)},[l]);let u=$d(o,s,[e.value,e.children,s],e.keywords),d=$s(),f=Qe(R=>R.value&&R.value===u.current),h=Qe(R=>l||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);p.useEffect(()=>{let R=s.current;if(!(!R||e.disabled))return R.addEventListener(Ho,y),()=>R.removeEventListener(Ho,y)},[h,e.onSelect,e.disabled]);function y(){var R,T;m(),(T=(R=c.current).onSelect)==null||T.call(R,u.current)}function m(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:x,onSelect:w,forceMount:b,keywords:S,...P}=e;return p.createElement($.div,{ref:ft(s,t),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||a.getDisablePointerSelection()?void 0:m,onClick:v?void 0:y},e.children)}),NS=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=pe(),a=p.useRef(null),c=p.useRef(null),l=pe(),u=pn(),d=Qe(h=>o||u.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);vt(()=>u.group(i),[]),$d(i,a,[e.value,e.heading,c]);let f=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement($.div,{ref:ft(a,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),Rr(e,h=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},p.createElement(Fd.Provider,{value:f},h))))}),OS=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=p.useRef(null),s=Qe(i=>!i.search);return!n&&!s?null:p.createElement($.div,{ref:ft(o,t),...r,"cmdk-separator":"",role:"separator"})}),jS=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=$s(),i=Qe(l=>l.search),a=Qe(l=>l.selectedItemId),c=pn();return p.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),p.createElement($.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:l=>{o||s.setState("search",l.target.value),n==null||n(l.target.value)}})}),VS=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=p.useRef(null),i=p.useRef(null),a=Qe(l=>l.selectedItemId),c=pn();return p.useEffect(()=>{if(i.current&&s.current){let l=i.current,u=s.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let h=l.offsetHeight;u.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return f.observe(l),()=>{cancelAnimationFrame(d),f.unobserve(l)}}},[]),p.createElement($.div,{ref:ft(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Rr(e,l=>p.createElement("div",{ref:ft(i,c.listInnerRef),"cmdk-list-sizer":""},l)))}),LS=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return p.createElement(RS,{open:n,onOpenChange:r},p.createElement(ES,{container:i},p.createElement(AS,{"cmdk-overlay":"",className:o}),p.createElement(MS,{"aria-label":e.label,"cmdk-dialog":"",className:s},p.createElement(_d,{ref:t,...a}))))}),FS=p.forwardRef((e,t)=>Qe(n=>n.filtered.count===0)?p.createElement($.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),_S=p.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return p.createElement($.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Rr(e,i=>p.createElement("div",{"aria-hidden":!0},i)))}),bt=Object.assign(_d,{List:VS,Item:kS,Input:jS,Group:NS,Separator:OS,Dialog:LS,Empty:FS,Loading:_S});function BS(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $S(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Bd(e){let t=p.useRef(e);return vt(()=>{t.current=e}),t}var vt=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Pt(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Qe(e){let t=$s(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function $d(e,t,n,r=[]){let o=p.useRef(),s=pn();return vt(()=>{var i;let a=(()=>{var l;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(l=u.current.textContent)==null?void 0:l.trim():o.current}})(),c=r.map(l=>l.trim());s.value(e,a,c),(i=t.current)==null||i.setAttribute(Ct,a),o.current=a}),o}var WS=()=>{let[e,t]=p.useState(),n=Pt(()=>new Map);return vt(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function US(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Rr({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(US(t),{ref:t.ref},n(t.props.children)):n(t)}var GS={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function HS({options:e,value:t,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:l="primary",disabled:u=!1,id:d,className:f,"aria-invalid":h,"aria-describedby":y,"aria-label":m}){const[v,x]=C.useState(!1),[w,b]=C.useState(n??[]),[S,P]=C.useState(""),R=C.useRef(null),T=t??w,E=C.useCallback(A=>{t===void 0&&b(A),r==null||r(A)},[t,r]),k=C.useCallback(A=>{T.includes(A)?E(T.filter(V=>V!==A)):(a==null||T.length<a)&&E([...T,A])},[T,E,a]),D=C.useCallback(A=>E(T.filter(V=>V!==A)),[T,E]),O=C.useMemo(()=>{const A=new Map;for(const V of e)A.set(V.value,V);return A},[e]),F=C.useMemo(()=>{const A=new Map;for(const V of e){const I=V.group??"";A.has(I)||A.set(I,[]),A.get(I).push(V)}return A},[e]),W=A=>{A.key==="Backspace"&&S===""&&T.length>0&&(A.preventDefault(),D(T[T.length-1]))};C.useEffect(()=>{v&&queueMicrotask(()=>{var A;return(A=R.current)==null?void 0:A.focus()})},[v]);const _=G("cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,l!=="primary"&&l,f),B=a!=null&&T.length>=a;return g.jsxs(eS,{open:v,onOpenChange:A=>!u&&x(A),children:[g.jsx(tS,{asChild:!0,children:g.jsxs("div",{role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-invalid":h,"aria-describedby":y,"aria-label":m,"data-state":v?"open":"closed","data-disabled":u||void 0,id:d,className:_,onClick:()=>!u&&x(A=>!A),tabIndex:u?-1:0,onKeyDown:A=>{(A.key==="Enter"||A.key===" "||A.key==="ArrowDown")&&!v&&(A.preventDefault(),x(!0))},children:[T.length===0&&g.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(A=>{const V=O.get(A);return g.jsxs("span",{className:"cny-chip",children:[g.jsx("span",{className:"cny-chip-label",children:(V==null?void 0:V.label)??A}),!u&&g.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(V==null?void 0:V.label)??A}`,onClick:I=>{I.stopPropagation(),D(A)},children:g.jsx(tu,{size:12,"aria-hidden":"true"})})]},A)}),g.jsx(eu,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),g.jsx(nS,{children:g.jsx(rS,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:A=>A.preventDefault(),children:g.jsxs(bt,{shouldFilter:!0,label:"Options",children:[g.jsx(bt.Input,{ref:R,placeholder:s,value:S,onValueChange:P,onKeyDown:W}),g.jsxs(bt.List,{children:[g.jsx(bt.Empty,{children:i}),Array.from(F.entries()).map(([A,V])=>g.jsx(bt.Group,{heading:A||void 0,children:V.map(I=>{const H=T.includes(I.value),te=I.disabled||!H&&B;return g.jsxs(bt.Item,{value:`${I.label} ${I.description??""} ${I.value}`,disabled:te,onSelect:()=>k(I.value),children:[I.icon&&g.jsx("span",{style:{display:"inline-flex"},children:I.icon}),g.jsx("span",{children:I.label}),I.description&&g.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:I.description}),H&&g.jsx("span",{className:"cny-check",children:g.jsx(Yn,{size:14,"aria-hidden":"true"})})]},I.value)})},A||"default"))]})]})})})]})}var Er="Checkbox",[KS]=Ee(Er),[zS,Ws]=KS(Er);function YS(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,h]=Pe({prop:n,defaultProp:o??!1,onChange:c,caller:Er}),[y,m]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),b=y?!!i||!!y.closest("form"):!0,S={checked:f,disabled:s,setChecked:h,control:y,setControl:m,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:w,required:l,defaultChecked:Ke(o)?!1:o,isFormControl:b,bubbleInput:v,setBubbleInput:x};return g.jsx(zS,{scope:t,...S,children:XS(d)?d(S):r})}var Wd="CheckboxTrigger",Ud=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:y}=Ws(Wd,e),m=Q(o,u),v=p.useRef(c);return p.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const w=()=>d(v.current);return x.addEventListener("reset",w),()=>x.removeEventListener("reset",w)}},[s,d]),g.jsx($.button,{type:"button",role:"checkbox","aria-checked":Ke(c)?"mixed":c,"aria-required":l,"data-state":zd(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:m,onKeyDown:K(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:K(n,x=>{d(w=>Ke(w)?!0:!w),y&&h&&(f.current=x.isPropagationStopped(),f.current||x.stopPropagation())})})});Ud.displayName=Wd;var Ko=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return g.jsx(YS,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>g.jsxs(g.Fragment,{children:[g.jsx(Ud,{...d,ref:t,__scopeCheckbox:n}),f&&g.jsx(Kd,{__scopeCheckbox:n})]})})});Ko.displayName=Er;var Gd="CheckboxIndicator",zo=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Ws(Gd,n);return g.jsx(rt,{present:r||Ke(s.checked)||s.checked===!0,children:g.jsx($.span,{"data-state":zd(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});zo.displayName=Gd;var Hd="CheckboxBubbleInput",Kd=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:h}=Ws(Hd,e),y=Q(n,h),m=yr(s),v=mr(r);p.useEffect(()=>{const w=f;if(!w)return;const b=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(b,"checked").set,R=!o.current;if(m!==s&&P){const T=new Event("click",{bubbles:R});w.indeterminate=Ke(s),P.call(w,Ke(s)?!1:s),w.dispatchEvent(T)}},[f,m,s,o]);const x=p.useRef(Ke(s)?!1:s);return g.jsx($.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:y,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Kd.displayName=Hd;function XS(e){return typeof e=="function"}function Ke(e){return e==="indeterminate"}function zd(e){return Ke(e)?"indeterminate":e?"checked":"unchecked"}const qS=C.forwardRef(function({className:t,children:n,...r},o){return n?g.jsxs("label",{className:"control",children:[g.jsx(Ko,{ref:o,className:G("checkbox",t),...r,children:g.jsx(zo,{children:r.checked==="indeterminate"?g.jsx(da,{size:12,"aria-hidden":"true"}):g.jsx(Yn,{size:12,"aria-hidden":"true"})})}),g.jsx("span",{children:n})]}):g.jsx(Ko,{ref:o,className:G("checkbox",t),...r,children:g.jsx(zo,{children:r.checked==="indeterminate"?g.jsx(da,{size:12,"aria-hidden":"true"}):g.jsx(Yn,{size:12,"aria-hidden":"true"})})})});var Us="Radio",[ZS,Yd]=Ee(Us),[QS,JS]=ZS(Us),Xd=p.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:c,form:l,...u}=e,[d,f]=p.useState(null),h=Q(t,v=>f(v)),y=p.useRef(!1),m=d?l||!!d.closest("form"):!0;return g.jsxs(QS,{scope:n,checked:o,disabled:i,children:[g.jsx($.button,{type:"button",role:"radio","aria-checked":o,"data-state":Jd(o),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:h,onClick:K(e.onClick,v=>{o||c==null||c(),m&&(y.current=v.isPropagationStopped(),y.current||v.stopPropagation())})}),m&&g.jsx(Qd,{control:d,bubbles:!y.current,name:r,value:a,checked:o,required:s,disabled:i,form:l,style:{transform:"translateX(-100%)"}})]})});Xd.displayName=Us;var qd="RadioIndicator",Zd=p.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=JS(qd,n);return g.jsx(rt,{present:r||s.checked,children:g.jsx($.span,{"data-state":Jd(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Zd.displayName=qd;var e0="RadioBubbleInput",Qd=p.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=p.useRef(null),a=Q(i,s),c=yr(n),l=mr(t);return p.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&h){const y=new Event("click",{bubbles:r});h.call(u,n),u.dispatchEvent(y)}},[c,n,r]),g.jsx($.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Qd.displayName=e0;function Jd(e){return e?"checked":"unchecked"}var t0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ar="RadioGroup",[n0]=Ee(Ar,[cr,Yd]),ef=cr(),tf=Yd(),[r0,o0]=n0(Ar),nf=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,h=ef(n),y=ar(l),[m,v]=Pe({prop:s,defaultProp:o??null,onChange:d,caller:Ar});return g.jsx(r0,{scope:n,name:r,required:i,disabled:a,value:m,onValueChange:v,children:g.jsx(Gl,{asChild:!0,...h,orientation:c,dir:y,loop:u,children:g.jsx($.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:y,...f,ref:t})})})});nf.displayName=Ar;var rf="RadioGroupItem",of=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=o0(rf,n),i=s.disabled||r,a=ef(n),c=tf(n),l=p.useRef(null),u=Q(t,l),d=s.value===o.value,f=p.useRef(!1);return p.useEffect(()=>{const h=m=>{t0.includes(m.key)&&(f.current=!0)},y=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",y)}},[]),g.jsx(Hl,{asChild:!0,...a,focusable:!i,active:d,children:g.jsx(Xd,{disabled:i,required:s.required,checked:d,...c,...o,name:s.name,ref:u,onCheck:()=>s.onValueChange(o.value),onKeyDown:K(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:K(o.onFocus,()=>{var h;f.current&&((h=l.current)==null||h.click())})})})});of.displayName=rf;var s0="RadioGroupIndicator",sf=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=tf(n);return g.jsx(Zd,{...o,...r,ref:t})});sf.displayName=s0;var i0=nf,_a=of,Ba=sf;const a0=C.forwardRef(function({orientation:t="vertical",className:n,style:r,...o},s){return g.jsx(i0,{ref:s,className:n,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:t==="horizontal"?16:8,...r},...o})}),c0=C.forwardRef(function({className:t,children:n,...r},o){return n?g.jsxs("label",{className:"control",children:[g.jsx(_a,{ref:o,className:G("radio",t),...r,children:g.jsx(Ba,{})}),g.jsx("span",{children:n})]}):g.jsx(_a,{ref:o,className:G("radio",t),...r,children:g.jsx(Ba,{})})});var Mr="Switch",[l0]=Ee(Mr),[u0,d0]=l0(Mr),af=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:l,form:u,...d}=e,[f,h]=p.useState(null),y=Q(t,b=>h(b)),m=p.useRef(!1),v=f?u||!!f.closest("form"):!0,[x,w]=Pe({prop:o,defaultProp:s??!1,onChange:l,caller:Mr});return g.jsxs(u0,{scope:n,checked:x,disabled:a,children:[g.jsx($.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":df(x),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:y,onClick:K(e.onClick,b=>{w(S=>!S),v&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})}),v&&g.jsx(uf,{control:f,bubbles:!m.current,name:r,value:c,checked:x,required:i,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});af.displayName=Mr;var cf="SwitchThumb",lf=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=d0(cf,n);return g.jsx($.span,{"data-state":df(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});lf.displayName=cf;var f0="SwitchBubbleInput",uf=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=p.useRef(null),a=Q(i,s),c=yr(n),l=mr(t);return p.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&h){const y=new Event("click",{bubbles:r});h.call(u,n),u.dispatchEvent(y)}},[c,n,r]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});uf.displayName=f0;function df(e){return e?"checked":"unchecked"}var $a=af,Wa=lf;const h0=C.forwardRef(function({className:t,children:n,...r},o){return n?g.jsxs("label",{className:"control",children:[g.jsx($a,{ref:o,className:G("switch",t),...r,children:g.jsx(Wa,{className:"switch-thumb"})}),g.jsx("span",{children:n})]}):g.jsx($a,{ref:o,className:G("switch",t),...r,children:g.jsx(Wa,{className:"switch-thumb"})})});exports.Alert=fy;exports.Avatar=hy;exports.AvatarStack=py;exports.Box=dn;exports.Button=Vl;exports.ButtonGroup=fv;exports.Card=dy;exports.Checkbox=qS;exports.Container=Ny;exports.Divider=Oy;exports.FAB=hv;exports.Field=Fy;exports.Grid=ky;exports.IconButton=pv;exports.Input=uy;exports.MultiSelect=HS;exports.Navbar=wy;exports.NavbarActions=Py;exports.NavbarBrand=by;exports.NavbarItem=Cy;exports.NavbarNav=Sy;exports.Progress=my;exports.ProgressRing=gy;exports.Radio=c0;exports.RadioGroup=a0;exports.Row=Iy;exports.Scroll=nu;exports.ScrollRegion=yy;exports.Select=Vb;exports.SelectGroup=Fb;exports.SelectItem=Lb;exports.SelectLabel=_b;exports.SelectSeparator=Bb;exports.Sidebar=Ty;exports.SidebarItem=Ey;exports.SidebarSection=Ry;exports.Skeleton=xy;exports.Spacer=jy;exports.Stack=Dy;exports.Switch=h0;exports.Text=Ly;exports.Textarea=_y;exports.ToggleButton=Rv;exports.ToggleButtonGroup=Yv;exports.ToggleButtonGroupItem=Xv;
|
|
119
|
+
//# sourceMappingURL=index.cjs.map
|