@telegraph/combobox 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @telegraph/combobox
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#701](https://github.com/knocklabs/telegraph/pull/701) [`16e678c`](https://github.com/knocklabs/telegraph/commit/16e678c5e8bc7f13613116954bc15099a8694bb7) Thanks [@ksorathia](https://github.com/ksorathia)! - Add surface-3 background color for interactive outlined variants.
8
+
9
+ - Updated dependencies [[`16e678c`](https://github.com/knocklabs/telegraph/commit/16e678c5e8bc7f13613116954bc15099a8694bb7)]:
10
+ - @telegraph/button@0.4.1
11
+ - @telegraph/input@0.2.2
12
+
3
13
  ## 0.2.1
4
14
 
5
15
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),ar=require("@radix-ui/react-dismissable-layer"),cr=require("@radix-ui/react-portal"),zt=require("@radix-ui/react-use-controllable-state"),ur=require("@radix-ui/react-visually-hidden"),ce=require("@telegraph/button"),Tt=require("@telegraph/compose-refs"),Fn=require("@telegraph/icon"),lr=require("@telegraph/input"),U=require("@telegraph/layout"),Ne=require("@telegraph/menu"),wt=require("@telegraph/typography"),te=require("lucide-react"),p=require("react"),fr=require("@telegraph/helpers"),St=require("@telegraph/tag"),dr=require("@telegraph/tooltip"),Dn=require("@telegraph/truncate");function kn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const hr=kn(cr),pr=kn(ur),mr={0:"5",1:"6",2:"8",3:"10"},K=e=>Array.isArray(e),z=e=>typeof e=="object"&&!Array.isArray(e)||typeof e=="string"||!e,gr=e=>{const t=(r,i=[])=>(p.Children.toArray(r).forEach(a=>{if(p.isValidElement(a)){const c=a.props;c.value?i.push(a):c.children&&t(c.children,i)}}),i);return t(e).map(r=>{var o;const i=r;return{value:i.props.value,label:((o=i.props)==null?void 0:o.label)||i.props.children||i.props.value}})},$=(e,t)=>{if(e)return t===!0?e==null?void 0:e.value:e},Je=(e,t,n)=>{if(!e||!t||t.length===0)return;const s=t.find(r=>r.value===$(e,n));if(s)return s},yr=({children:e,value:t,searchQuery:n})=>{const s=En(e);return(t==null?void 0:t.toLowerCase().includes(n.toLowerCase()))||s.some(r=>r.toLowerCase().includes(n.toLowerCase()))},En=e=>{const t=p.Children.toArray(e),n=[];return t.forEach(s=>{if(typeof s=="string"&&n.push(s),p.isValidElement(s)){const r=s.props;r.children&&n.push(...En(r.children))}}),n},br=p.createContext({});function vr(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const In=typeof window<"u",xr=In?p.useLayoutEffect:p.useEffect,On=p.createContext(null);function Tr(e,t){e.indexOf(t)===-1&&e.push(t)}function wr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Y=(e,t,n)=>n>t?t:n<e?e:n;function et(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let we=()=>{},ne=()=>{};var Rn;typeof process<"u"&&((Rn=process.env)==null?void 0:Rn.NODE_ENV)!=="production"&&(we=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(et(t,n))},ne=(e,t,n)=>{if(!e)throw new Error(et(t,n))});const W={},Bn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Sr(e){return typeof e=="object"&&e!==null}const jn=e=>/^0[^.\s]+$/u.test(e);function Ln(e){let t;return()=>(t===void 0&&(t=e()),t)}const ue=e=>e,Vr=(e,t)=>n=>t(e(n)),Ke=(...e)=>e.reduce(Vr),Nn=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class Kn{constructor(){this.subscriptions=[]}add(t){return Tr(this.subscriptions,t),()=>wr(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _=e=>e*1e3,j=e=>e/1e3;function $n(e,t){return t?e*(1e3/t):0}const Yt=new Set;function _n(e,t,n){e||Yt.has(t)||(console.warn(et(t,n)),Yt.add(t))}const Wn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cr=1e-7,Ar=12;function Mr(e,t,n,s,r){let i,o,a=0;do o=t+(n-t)/2,i=Wn(o,s,r)-e,i>0?n=o:t=o;while(Math.abs(i)>Cr&&++a<Ar);return o}function Se(e,t,n,s){if(e===t&&n===s)return ue;const r=i=>Mr(i,0,1,e,n);return i=>i===0||i===1?i:Wn(r(i),t,s)}const Hn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Gn=e=>t=>1-e(1-t),qn=Se(.33,1.53,.69,.99),Vt=Gn(qn),Un=Hn(Vt),zn=e=>(e*=2)<1?.5*Vt(e):.5*(2-Math.pow(2,-10*(e-1))),Ct=e=>1-Math.sin(Math.acos(e)),Pr=Gn(Ct),Yn=Hn(Ct),Rr=Se(.42,0,1,1),Fr=Se(0,0,.58,1),Xn=Se(.42,0,.58,1),Dr=e=>Array.isArray(e)&&typeof e[0]!="number",Qn=e=>Array.isArray(e)&&typeof e[0]=="number",Xt={linear:ue,easeIn:Rr,easeInOut:Xn,easeOut:Fr,circIn:Ct,circInOut:Yn,circOut:Pr,backIn:Vt,backInOut:Un,backOut:qn,anticipate:zn},kr=e=>typeof e=="string",Qt=e=>{if(Qn(e)){ne(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return Se(t,n,s,r)}else if(kr(e))return ne(Xt[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Xt[e];return e},Pe=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Er(e,t){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){o.has(l)&&(u.schedule(l),e()),l(a)}const u={schedule:(l,d=!1,f=!1)=>{const m=f&&r?n:s;return d&&o.add(l),m.has(l)||m.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,r){i=!0;return}r=!0,[n,s]=[s,n],n.forEach(c),n.clear(),r=!1,i&&(i=!1,u.process(l))}};return u}const Ir=40;function Zn(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Pe.reduce((T,C)=>(T[C]=Er(i),T),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:d,preRender:f,render:h,postRender:m}=o,y=()=>{const T=W.useManualTiming?r.timestamp:performance.now();n=!1,W.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(T-r.timestamp,Ir),1)),r.timestamp=T,r.isProcessing=!0,a.process(r),c.process(r),u.process(r),l.process(r),d.process(r),f.process(r),h.process(r),m.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(y))},b=()=>{n=!0,s=!0,r.isProcessing||e(y)};return{schedule:Pe.reduce((T,C)=>{const S=o[C];return T[C]=(A,P=!1,V=!1)=>(n||b(),S.schedule(A,P,V)),T},{}),cancel:T=>{for(let C=0;C<Pe.length;C++)o[Pe[C]].cancel(T)},state:r,steps:o}}const{schedule:N,cancel:tt,state:ke}=Zn(typeof requestAnimationFrame<"u"?requestAnimationFrame:ue,!0);let Fe;function Or(){Fe=void 0}const O={now:()=>(Fe===void 0&&O.set(ke.isProcessing||W.useManualTiming?ke.timestamp:performance.now()),Fe),set:e=>{Fe=e,queueMicrotask(Or)}},Jn=e=>t=>typeof t=="string"&&t.startsWith(e),es=Jn("--"),Br=Jn("var(--"),At=e=>Br(e)?jr.test(e.split("/*")[0].trim()):!1,jr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Zt(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const le={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ve={...le,transform:e=>Y(0,1,e)},Re={...le,default:1},ye=e=>Math.round(e*1e5)/1e5,Mt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Lr(e){return e==null}const Nr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pt=(e,t)=>n=>!!(typeof n=="string"&&Nr.test(n)&&n.startsWith(e)||t&&!Lr(n)&&Object.prototype.hasOwnProperty.call(n,t)),ts=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(Mt);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Kr=e=>Y(0,255,e),Ge={...le,transform:e=>Math.round(Kr(e))},Z={test:Pt("rgb","red"),parse:ts("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Ge.transform(e)+", "+Ge.transform(t)+", "+Ge.transform(n)+", "+ye(ve.transform(s))+")"};function $r(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const nt={test:Pt("#"),parse:$r,transform:Z.transform},Ve=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),G=Ve("deg"),oe=Ve("%"),v=Ve("px"),_r=Ve("vh"),Wr=Ve("vw"),Jt={...oe,parse:e=>oe.parse(e)/100,transform:e=>oe.transform(e*100)},re={test:Pt("hsl","hue"),parse:ts("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+oe.transform(ye(t))+", "+oe.transform(ye(n))+", "+ye(ve.transform(s))+")"},R={test:e=>Z.test(e)||nt.test(e)||re.test(e),parse:e=>Z.test(e)?Z.parse(e):re.test(e)?re.parse(e):nt.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Z.transform(e):re.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},Hr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Gr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Mt))==null?void 0:t.length)||0)+(((n=e.match(Hr))==null?void 0:n.length)||0)>0}const ns="number",ss="color",qr="var",Ur="var(",en="${}",zr=/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 xe(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(zr,c=>(R.test(c)?(s.color.push(i),r.push(ss),n.push(R.parse(c))):c.startsWith(Ur)?(s.var.push(i),r.push(qr),n.push(c)):(s.number.push(i),r.push(ns),n.push(parseFloat(c))),++i,en)).split(en);return{values:n,split:a,indexes:s,types:r}}function rs(e){return xe(e).values}function is(e){const{split:t,types:n}=xe(e),s=t.length;return r=>{let i="";for(let o=0;o<s;o++)if(i+=t[o],r[o]!==void 0){const a=n[o];a===ns?i+=ye(r[o]):a===ss?i+=R.transform(r[o]):i+=r[o]}return i}}const Yr=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function Xr(e){const t=rs(e);return is(e)(t.map(Yr))}const L={test:Gr,parse:rs,createTransformer:is,getAnimatableNone:Xr};function qe(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 Qr({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=qe(c,a,e+1/3),i=qe(c,a,e),o=qe(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Ee(e,t){return n=>n>0?t:e}const Ce=(e,t,n)=>e+(t-e)*n,Ue=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},Zr=[nt,Z,re],Jr=e=>Zr.find(t=>t.test(e));function tn(e){const t=Jr(e);if(we(!!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===re&&(n=Qr(n)),n}const nn=(e,t)=>{const n=tn(e),s=tn(t);if(!n||!s)return Ee(e,t);const r={...n};return i=>(r.red=Ue(n.red,s.red,i),r.green=Ue(n.green,s.green,i),r.blue=Ue(n.blue,s.blue,i),r.alpha=Ce(n.alpha,s.alpha,i),Z.transform(r))},st=new Set(["none","hidden"]);function ei(e,t){return st.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ti(e,t){return n=>Ce(e,t,n)}function Rt(e){return typeof e=="number"?ti:typeof e=="string"?At(e)?Ee:R.test(e)?nn:ri:Array.isArray(e)?os:typeof e=="object"?R.test(e)?nn:ni:Ee}function os(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>Rt(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function ni(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Rt(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function si(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const ri=(e,t)=>{const n=L.createTransformer(t),s=xe(e),r=xe(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?st.has(e)&&!r.values.length||st.has(t)&&!s.values.length?ei(e,t):Ke(os(si(s,r),r.values),n):(we(!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"),Ee(e,t))};function as(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ce(e,t,n):Rt(e)(e,t)}const ii=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>N.update(t,n),stop:()=>tt(t),now:()=>ke.isProcessing?ke.timestamp:O.now()}},cs=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Ie=2e4;function Ft(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Ie;)t+=n,s=e.next(t);return t>=Ie?1/0:t}function oi(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Ft(s),Ie);return{type:"keyframes",ease:i=>s.next(r*i).value/t,duration:j(r)}}const ai=5;function us(e,t,n){const s=Math.max(t-ai,0);return $n(n-e(s),t-s)}const M={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},ze=.001;function ci({duration:e=M.duration,bounce:t=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let r,i;we(e<=_(M.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Y(M.minDamping,M.maxDamping,o),e=Y(M.minDuration,M.maxDuration,j(e)),o<1?(r=u=>{const l=u*o,d=l*e,f=l-n,h=rt(u,o),m=Math.exp(-d);return ze-f/h*m},i=u=>{const d=u*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-d),y=rt(Math.pow(u,2),o);return(-r(u)+ze>0?-1:1)*((f-h)*m)/y}):(r=u=>{const l=Math.exp(-u*e),d=(u-n)*e+1;return-ze+l*d},i=u=>{const l=Math.exp(-u*e),d=(n-u)*(e*e);return l*d});const a=5/e,c=li(r,i,a);if(e=_(e),isNaN(c))return{stiffness:M.stiffness,damping:M.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const ui=12;function li(e,t,n){let s=n;for(let r=1;r<ui;r++)s=s-e(s)/t(s);return s}function rt(e,t){return e*Math.sqrt(1-t*t)}const fi=["duration","bounce"],di=["stiffness","damping","mass"];function sn(e,t){return t.some(n=>e[n]!==void 0)}function hi(e){let t={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...e};if(!sn(e,di)&&sn(e,fi))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*Y(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:M.mass,stiffness:r,damping:i}}else{const n=ci({...e,velocity:0});t={...t,...n,mass:M.mass},t.isResolvedFromDuration=!0}return t}function Oe(e=M.visualDuration,t=M.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:u,mass:l,duration:d,velocity:f,isResolvedFromDuration:h}=hi({...n,velocity:-j(n.velocity||0)}),m=f||0,y=u/(2*Math.sqrt(c*l)),b=o-i,g=j(Math.sqrt(c/l)),w=Math.abs(b)<5;s||(s=w?M.restSpeed.granular:M.restSpeed.default),r||(r=w?M.restDelta.granular:M.restDelta.default);let T;if(y<1){const S=rt(g,y);T=A=>{const P=Math.exp(-y*g*A);return o-P*((m+y*g*b)/S*Math.sin(S*A)+b*Math.cos(S*A))}}else if(y===1)T=S=>o-Math.exp(-g*S)*(b+(m+g*b)*S);else{const S=g*Math.sqrt(y*y-1);T=A=>{const P=Math.exp(-y*g*A),V=Math.min(S*A,300);return o-P*((m+y*g*b)*Math.sinh(V)+S*b*Math.cosh(V))/S}}const C={calculatedDuration:h&&d||null,next:S=>{const A=T(S);if(h)a.done=S>=d;else{let P=S===0?m:0;y<1&&(P=S===0?_(m):us(T,S,A));const V=Math.abs(P)<=s,F=Math.abs(o-A)<=r;a.done=V&&F}return a.value=a.done?o:A,a},toString:()=>{const S=Math.min(Ft(C),Ie),A=cs(P=>C.next(S*P).value,S,30);return S+"ms "+A},toTransition:()=>{}};return C}Oe.applyToOptions=e=>{const t=oi(e,100,Oe);return e.ease=t.ease,e.duration=_(t.duration),e.type="keyframes",e};function it({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){const d=e[0],f={done:!1,value:d},h=V=>a!==void 0&&V<a||c!==void 0&&V>c,m=V=>a===void 0?c:c===void 0||Math.abs(a-V)<Math.abs(c-V)?a:c;let y=n*t;const b=d+y,g=o===void 0?b:o(b);g!==b&&(y=g-d);const w=V=>-y*Math.exp(-V/s),T=V=>g+w(V),C=V=>{const F=w(V),D=T(V);f.done=Math.abs(F)<=u,f.value=f.done?g:D};let S,A;const P=V=>{h(f.value)&&(S=V,A=Oe({keyframes:[f.value,m(f.value)],velocity:us(T,V,f.value),damping:r,stiffness:i,restDelta:u,restSpeed:l}))};return P(0),{calculatedDuration:null,next:V=>{let F=!1;return!A&&S===void 0&&(F=!0,C(V),P(V)),S!==void 0&&V>=S?A.next(V-S):(!F&&C(V),f)}}}function pi(e,t,n){const s=[],r=n||W.mix||as,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||ue:t;a=Ke(c,a)}s.push(a)}return s}function mi(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(ne(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=pi(t,s,r),c=a.length,u=l=>{if(o&&l<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(l<e[d+1]);d++);const f=Nn(e[d],e[d+1],l);return a[d](f)};return n?l=>u(Y(e[0],e[i-1],l)):u}function gi(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=Nn(0,t,s);e.push(Ce(n,1,r))}}function yi(e){const t=[0];return gi(t,e.length-1),t}function bi(e,t){return e.map(n=>n*t)}function vi(e,t){return e.map(()=>t||Xn).splice(0,e.length-1)}function ie({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Dr(s)?s.map(Qt):Qt(s),i={done:!1,value:t[0]},o=bi(n&&n.length===t.length?n:yi(t),e),a=mi(o,t,{ease:Array.isArray(r)?r:vi(t,r)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const xi=e=>e!==null;function Dt(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(xi),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const Ti={decay:it,inertia:it,tween:ie,keyframes:ie,spring:Oe};function ls(e){typeof e.type=="string"&&(e.type=Ti[e.type])}class kt{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 wi=e=>e/100;class Et extends kt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==O.now()&&this.tick(O.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;ls(t);const{type:n=ie,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||ie;process.env.NODE_ENV!=="production"&&c!==ie&&ne(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==ie&&typeof a[0]!="number"&&(this.mixKeyframes=Ke(wi,as(a[0],a[1])),a=[0,100]);const u=c({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Ft(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:d,repeatType:f,repeatDelay:h,type:m,onUpdate:y,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let T=this.currentTime,C=s;if(d){const V=Math.min(this.currentTime,r)/a;let F=Math.floor(V),D=V%1;!D&&V>=1&&(D=1),D===1&&F--,F=Math.min(F,d+1),!!(F%2)&&(f==="reverse"?(D=1-D,h&&(D-=h/a)):f==="mirror"&&(C=o)),T=Y(0,1,D)*a}const S=w?{done:!1,value:l[0]}:C.next(T);i&&(S.value=i(S.value));let{done:A}=S;!w&&c!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return P&&m!==it&&(S.value=Dt(l,this.options,b,this.speed)),y&&y(S.value),P&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return j(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(this.currentTime)}set time(t){var n;t=_(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(O.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=j(this.currentTime))}play(){var r,i;if(this.isStopped)return;const{driver:t=ii,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(r=this.options).onPlay)==null||i.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(O.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 Si(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const J=e=>e*180/Math.PI,ot=e=>{const t=J(Math.atan2(e[1],e[0]));return at(t)},Vi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ot,rotateZ:ot,skewX:e=>J(Math.atan(e[1])),skewY:e=>J(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},at=e=>(e=e%360,e<0&&(e+=360),e),rn=ot,on=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),an=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ci={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:on,scaleY:an,scale:e=>(on(e)+an(e))/2,rotateX:e=>at(J(Math.atan2(e[6],e[5]))),rotateY:e=>at(J(Math.atan2(-e[2],e[0]))),rotateZ:rn,rotate:rn,skewX:e=>J(Math.atan(e[4])),skewY:e=>J(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ct(e){return e.includes("scale")?1:0}function ut(e,t){if(!e||e==="none")return ct(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Ci,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Vi,r=a}if(!r)return ct(t);const i=s[t],o=r[1].split(",").map(Mi);return typeof i=="function"?i(o):o[i]}const Ai=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ut(n,t)};function Mi(e){return parseFloat(e.trim())}const fe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],de=new Set(fe),cn=e=>e===le||e===v,Pi=new Set(["x","y","z"]),Ri=fe.filter(e=>!Pi.has(e));function Fi(e){const t=[];return Ri.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const q={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-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})=>ut(t,"x"),y:(e,{transform:t})=>ut(t,"y")};q.translateX=q.x;q.translateY=q.y;const ee=new Set;let lt=!1,ft=!1,dt=!1;function fs(){if(ft){const e=Array.from(ee).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=Fi(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,o])=>{var a;(a=s.getValue(i))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ft=!1,lt=!1,ee.forEach(e=>e.complete(dt)),ee.clear()}function ds(){ee.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ft=!0)})}function Di(){dt=!0,ds(),fs(),dt=!1}class It{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ee.add(this),lt||(lt=!0,N.read(ds),N.resolveKeyframes(fs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r==null?void 0:r.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}Si(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ee.delete(this)}cancel(){this.state==="scheduled"&&(ee.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ki=e=>e.startsWith("--");function Ei(e,t,n){ki(t)?e.style.setProperty(t,n):e.style[t]=n}const Ii={};function hs(e,t){const n=Ln(e);return()=>Ii[t]??n()}const Oi=hs(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),ps=hs(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),me=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,un={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:me([0,.65,.55,1]),circOut:me([.55,0,1,.45]),backIn:me([.31,.01,.66,-.59]),backOut:me([.33,1.53,.69,.99])};function ms(e,t){if(e)return typeof e=="function"?ps()?cs(e,t):"ease-out":Qn(e)?me(e):Array.isArray(e)?e.map(n=>ms(n,t)||un.easeOut):un[e]}function Bi(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[t]:n};c&&(l.offset=c);const d=ms(a,r);Array.isArray(d)&&(l.easing=d);const f={delay:s,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(l,f)}function gs(e){return typeof e=="function"&&"applyToOptions"in e}function ji({type:e,...t}){return gs(e)&&ps()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ys extends kt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,ne(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=ji(t);this.animation=Bi(n,s,r,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const l=Dt(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(l):Ei(n,s,l),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,s,r;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return j(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_(t)}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,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Oi()?(this.animation.timeline=t,ue):n(this)}}const bs={anticipate:zn,backInOut:Un,circInOut:Yn};function Li(e){return e in bs}function Ni(e){typeof e.ease=="string"&&Li(e.ease)&&(e.ease=bs[e.ease])}const Ye=10;class Ki extends ys{constructor(t){Ni(t),ls(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Et({...o,autoplay:!1}),c=Math.max(Ye,O.now()-this.startTime),u=Y(0,Ye,c-Ye);n.setWithVelocity(a.sample(Math.max(0,c-u)).value,a.sample(c).value,u),a.stop()}}const ln=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(L.test(e)||e==="0")&&!e.startsWith("url("));function $i(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 _i(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ln(r,t),a=ln(i,t);return we(o===a,`You are trying to animate ${t} from "${r}" to "${i}". "${o?i:r}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:$i(e)||(n==="spring"||gs(n))&&s}function ht(e){e.duration=0,e.type="keyframes"}const Wi=new Set(["opacity","clipPath","filter","transform"]),Hi=Ln(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Gi(e){var l;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=e;if(!(((l=t==null?void 0:t.owner)==null?void 0:l.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Hi()&&n&&Wi.has(n)&&(n!=="transform"||!u)&&!c&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const qi=40;class Ui extends kt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...d}){var m;super(),this.stop=()=>{var y,b;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=O.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:o,name:c,motionValue:u,element:l,...d},h=(l==null?void 0:l.KeyframeResolver)||It;this.keyframeResolver=new h(a,(y,b,g)=>this.onKeyframesResolved(y,b,f,!g),c,u,l),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,s,r){var b,g;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=O.now(),_i(t,i,o,a)||((W.instantAnimations||!c)&&(l==null||l(Dt(t,s,n))),t[0]=t[t.length-1],ht(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>qi?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!u&&Gi(f),m=(g=(b=f.motionValue)==null?void 0:b.owner)==null?void 0:g.current,y=h?new Ki({...f,element:m}):new Et(f);y.finished.then(()=>{this.notifyFinished()}).catch(ue),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Di()),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 vs(e,t,n,s=0,r=1){const i=Array.from(e).sort((u,l)=>u.sortNodePosition(l)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(i,o):r===1?i*s:a-i*s}const zi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yi(e){const t=zi.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const Xi=4;function xs(e,t,n=1){ne(n<=Xi,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=Yi(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Bn(o)?parseFloat(o):o}return At(r)?xs(r,t,n+1):r}const Qi={type:"spring",stiffness:500,damping:25,restSpeed:10},Zi=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ji={type:"keyframes",duration:.8},eo={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},to=(e,{keyframes:t})=>t.length>2?Ji:de.has(e)?e.startsWith("scale")?Zi(t[1]):Qi:eo,no=e=>e!==null;function so(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(no),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[i]}function Ts(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function ws(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Ts(n,e):n}function ro({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:c,elapsed:u,...l}){return!!Object.keys(l).length}const io=(e,t,n,s={},r,i)=>o=>{const a=ws(s,e)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-_(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};ro(a)||Object.assign(l,to(e,l)),l.duration&&(l.duration=_(l.duration)),l.repeatDelay&&(l.repeatDelay=_(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let d=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(ht(l),l.delay===0&&(d=!0)),(W.instantAnimations||W.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(d=!0,ht(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const f=so(l.keyframes,a);if(f!==void 0){N.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new Et(l):new Ui(l)};function fn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Ot(e,t,n,s){if(typeof t=="function"){const[r,i]=fn(s);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=fn(s);t=t(n!==void 0?n:e.custom,r,i)}return t}function ae(e,t,n){const s=e.getProps();return Ot(s,t,n!==void 0?n:s.custom,e)}const Ss=new Set(["width","height","top","left","right","bottom",...fe]),dn=30,oo=e=>!isNaN(parseFloat(e));class ao{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var i;const r=O.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=O.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=oo(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&_n(!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 Kn);const s=this.events[t].add(n);return t==="change"?()=>{s(),N.read(()=>{this.events.change.getSize()||this.stop()})}:s}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,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}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=O.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>dn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,dn);return $n(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 Be(e,t){return new ao(e,t)}const pt=e=>Array.isArray(e);function co(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Be(n))}function uo(e){return pt(e)?e[e.length-1]||0:e}function lo(e,t){const n=ae(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=uo(i[o]);co(e,o,a)}}const I=e=>!!(e&&e.getVelocity);function fo(e){return!!(I(e)&&e.add)}function ho(e,t){const n=e.getValue("willChange");if(fo(n))return n.add(t);if(!n&&W.WillChange){const s=new W.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Bt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const po="framerAppearId",Vs="data-"+Bt(po);function mo(e){return e.props[Vs]}function go({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Cs(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i,transitionEnd:o,...a}=t;const c=e.getDefaultTransition();i=i?Ts(i,c):c;const u=i==null?void 0:i.reduceMotion;s&&(i=s);const l=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in a){const h=e.getValue(f,e.latestValues[f]??null),m=a[f];if(m===void 0||d&&go(d,f))continue;const y={delay:n,...ws(i||{},f)},b=h.get();if(b!==void 0&&!h.isAnimating&&!Array.isArray(m)&&m===b&&!y.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const C=mo(e);if(C){const S=window.MotionHandoffAnimation(C,f,N);S!==null&&(y.startTime=S,g=!0)}}ho(e,f);const w=u??e.shouldReduceMotion;h.start(io(f,h,m,w&&Ss.has(f)?{type:!1}:y,e,g));const T=h.animation;T&&l.push(T)}if(o){const f=()=>N.update(()=>{o&&lo(e,o)});l.length?Promise.all(l).then(f):f()}return l}function mt(e,t,n={}){var c;const s=ae(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(Cs(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:l=0,staggerChildren:d,staggerDirection:f}=r;return yo(e,t,u,l,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[u,l]=a==="beforeChildren"?[i,o]:[o,i];return u().then(()=>l())}else return Promise.all([i(),o(n.delay)])}function yo(e,t,n=0,s=0,r=0,i=1,o){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(mt(c,t,{...o,delay:n+(typeof s=="function"?0:s)+vs(e.variantChildren,c,s,r,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function bo(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(i=>mt(e,i,n));s=Promise.all(r)}else if(typeof t=="string")s=mt(e,t,n);else{const r=typeof t=="function"?ae(e,t,n.custom):t;s=Promise.all(Cs(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const vo={test:e=>e==="auto",parse:e=>e},As=e=>t=>t.test(e),Ms=[le,v,oe,G,Wr,_r,vo],hn=e=>Ms.find(As(e));function xo(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jn(e):!0}const To=new Set(["brightness","contrast","saturate","opacity"]);function wo(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Mt)||[];if(!s)return e;const r=n.replace(s,"");let i=To.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const So=/\b([a-z-]*)\(.*?\)/gu,gt={...L,getAnimatableNone:e=>{const t=e.match(So);return t?t.map(wo).join(" "):e}},yt={...L,getAnimatableNone:e=>{const t=L.parse(e);return L.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},pn={...le,transform:Math.round},Vo={rotate:G,rotateX:G,rotateY:G,rotateZ:G,scale:Re,scaleX:Re,scaleY:Re,scaleZ:Re,skew:G,skewX:G,skewY:G,distance:v,translateX:v,translateY:v,translateZ:v,x:v,y:v,z:v,perspective:v,transformPerspective:v,opacity:ve,originX:Jt,originY:Jt,originZ:v},jt={borderWidth:v,borderTopWidth:v,borderRightWidth:v,borderBottomWidth:v,borderLeftWidth:v,borderRadius:v,borderTopLeftRadius:v,borderTopRightRadius:v,borderBottomRightRadius:v,borderBottomLeftRadius:v,width:v,maxWidth:v,height:v,maxHeight:v,top:v,right:v,bottom:v,left:v,inset:v,insetBlock:v,insetBlockStart:v,insetBlockEnd:v,insetInline:v,insetInlineStart:v,insetInlineEnd:v,padding:v,paddingTop:v,paddingRight:v,paddingBottom:v,paddingLeft:v,paddingBlock:v,paddingBlockStart:v,paddingBlockEnd:v,paddingInline:v,paddingInlineStart:v,paddingInlineEnd:v,margin:v,marginTop:v,marginRight:v,marginBottom:v,marginLeft:v,marginBlock:v,marginBlockStart:v,marginBlockEnd:v,marginInline:v,marginInlineStart:v,marginInlineEnd:v,fontSize:v,backgroundPositionX:v,backgroundPositionY:v,...Vo,zIndex:pn,fillOpacity:ve,strokeOpacity:ve,numOctaves:pn},Co={...jt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:gt,WebkitFilter:gt,mask:yt,WebkitMask:yt},Ps=e=>Co[e],Ao=new Set([gt,yt]);function Rs(e,t){let n=Ps(e);return Ao.has(n)||(n=L),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Mo=new Set(["auto","none","0"]);function Po(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!Mo.has(i)&&xe(i).values.length&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]=Rs(n,r)}class Ro extends It{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let d=t[l];if(typeof d=="string"&&(d=d.trim(),At(d))){const f=xs(d,n.current);f!==void 0&&(t[l]=f),l===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Ss.has(s)||t.length!==2)return;const[r,i]=t,o=hn(r),a=hn(i),c=Zt(r),u=Zt(i);if(c!==u&&q[s]){this.needsMeasurement=!0;return}if(o!==a)if(cn(o)&&cn(a))for(let l=0;l<t.length;l++){const d=t[l];typeof d=="string"&&(t[l]=parseFloat(d))}else q[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||xo(t[r]))&&s.push(r);s.length&&Po(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=q[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=q[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const Fo=new Set(["opacity","clipPath","filter","transform"]);function Do(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}const Fs=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ko(e){return Sr(e)&&"offsetHeight"in e}const{schedule:Eo}=Zn(queueMicrotask,!1),Io={y:!1};function Oo(){return Io.y}function Ds(e,t){const n=Do(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function Bo(e){return!(e.pointerType==="touch"||Oo())}function jo(e,t,n={}){const[s,r,i]=Ds(e,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",m)},d=b=>{u&&(u(b),u=void 0),l()},f=b=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,d(b))},h=()=>{a=!0,window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",f,r)},m=b=>{if(b.pointerType!=="touch"){if(a){c=!0;return}d(b)}},y=b=>{if(!Bo(b))return;c=!1;const g=t(o,b);typeof g=="function"&&(u=g,o.addEventListener("pointerleave",m,r))};o.addEventListener("pointerenter",y,r),o.addEventListener("pointerdown",h,r)}),i}const ks=(e,t)=>t?e===t?!0:ks(e,t.parentElement):!1,Lo=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,No=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ko(e){return No.has(e.tagName)||e.isContentEditable===!0}const De=new WeakSet;function mn(e){return t=>{t.key==="Enter"&&e(t)}}function Xe(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const $o=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=mn(()=>{if(De.has(n))return;Xe(n,"down");const r=mn(()=>{Xe(n,"up")}),i=()=>Xe(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function gn(e){return Lo(e)&&!0}const yn=new WeakSet;function _o(e,t,n={}){const[s,r,i]=Ds(e,n),o=a=>{const c=a.currentTarget;if(!gn(a)||yn.has(a))return;De.add(c),n.stopPropagation&&yn.add(a);const u=t(c,a),l=(h,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),De.has(c)&&De.delete(c),gn(h)&&typeof u=="function"&&u(h,{success:m})},d=h=>{l(h,c===window||c===document||n.useGlobalTarget||ks(c,h.target))},f=h=>{l(h,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),ko(a)&&(a.addEventListener("focus",u=>$o(u,r)),!Ko(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}const Wo=[...Ms,R,L],Ho=e=>Wo.find(As(e)),bn=()=>({min:0,max:0}),Es=()=>({x:bn(),y:bn()}),Go=new WeakMap;function $e(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Te(e){return typeof e=="string"||Array.isArray(e)}const Lt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Nt=["initial",...Lt];function _e(e){return $e(e.animate)||Nt.some(t=>Te(e[t]))}function Is(e){return!!(_e(e)||e.variants)}function qo(e,t,n){for(const s in t){const r=t[s],i=n[s];if(I(r))e.addValue(s,r);else if(I(i))e.addValue(s,Be(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,Be(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const bt={current:null},Os={current:!1},Uo=typeof window<"u";function zo(){if(Os.current=!0,!!Uo)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>bt.current=e.matches;e.addEventListener("change",t),t()}else bt.current=!1}const vn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let je={};function Bs(e){je=e}function Yo(){return je}class Xo{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:o,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=It,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=O.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,N.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=_e(n),this.isVariantNode=Is(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 m=f[h];u[h]!==void 0&&I(m)&&m.set(u[h])}}mount(t){var n,s;if(this.hasBeenMounted)for(const r in this.initialValues)(n=this.values.get(r))==null||n.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=t,Go.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((r,i)=>this.bindToMotionValue(i,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Os.current||zo(),this.shouldReduceMotion=bt.current),process.env.NODE_ENV!=="production"&&_n(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,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),tt(this.notifyUpdate),tt(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 s=this.features[n];s&&(s.unmount(),s.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&&Fo.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,d=new ys({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:_(l)}),f=o(d);this.valueSubscriptions.set(t,()=>{f(),d.cancel()});return}const s=de.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&N.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i&&i(),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 je){const n=je[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Es()}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 s=0;s<vn.length;s++){const r=vn[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=t[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=qo(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 s=this.values.get(t);n!==s&&(s&&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 s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Be(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Bn(s)||jn(s))?s=parseFloat(s):!Ho(s)&&L.test(n)&&(s=Rs(t,n)),this.setBaseTarget(t,I(s)?s.get():s)),I(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Ot(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!I(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Eo.render(this.render)}}class js extends Xo{constructor(){super(...arguments),this.KeyframeResolver=Ro}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class he{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Qo({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Zo(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Jo(e,t){return Qo(Zo(e.getBoundingClientRect(),t))}const ea={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ta=fe.length;function na(e,t,n){let s="",r=!0;for(let i=0;i<ta;i++){const o=fe[i],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=Fs(a,jt[o]);if(!c){r=!1;const l=ea[o]||o;s+=`${l}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Kt(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const u=t[c];if(de.has(c)){o=!0;continue}else if(es(c)){r[c]=u;continue}else{const l=Fs(u,jt[c]);c.startsWith("origin")?(a=!0,i[c]=l):s[c]=l}}if(t.transform||(o||n?s.transform=na(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=i;s.transformOrigin=`${c} ${u} ${l}`}}function Ls(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r==null||r.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function xn(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const pe={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(v.test(e))e=parseFloat(e);else return e;const n=xn(e,t.target.x),s=xn(e,t.target.y);return`${n}% ${s}%`}},sa={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=L.parse(e);if(r.length>5)return s;const i=L.createTransformer(e),o=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=a,r[1+o]/=c;const u=Ce(a,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),i(r)}},ra={borderRadius:{...pe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pe,borderTopRightRadius:pe,borderBottomLeftRadius:pe,borderBottomRightRadius:pe,boxShadow:sa};function Ns(e,{layout:t,layoutId:n}){return de.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ra[e]||e==="opacity")}function $t(e,t,n){var o;const s=e.style,r=t==null?void 0:t.style,i={};if(!s)return i;for(const a in s)(I(s[a])||r&&I(r[a])||Ns(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=s[a]);return i}function ia(e){return window.getComputedStyle(e)}class oa extends js{constructor(){super(...arguments),this.type="html",this.renderInstance=Ls}readValueFromInstance(t,n){var s;if(de.has(n))return(s=this.projection)!=null&&s.isProjecting?ct(n):Ai(t,n);{const r=ia(t),i=(es(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Jo(t,n)}build(t,n,s){Kt(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return $t(t,n,s)}}const aa={offset:"stroke-dashoffset",array:"stroke-dasharray"},ca={offset:"strokeDashoffset",array:"strokeDasharray"};function ua(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?aa:ca;e[i.offset]=`${-s}`,e[i.array]=`${t} ${n}`}const la=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ks(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},c,u,l){if(Kt(e,a,u),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=(l==null?void 0:l.transformBox)??"fill-box",delete d.transformBox);for(const h of la)d[h]!==void 0&&(f[h]=d[h],delete d[h]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&ua(d,r,i,o,!1)}const $s=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"]),_s=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fa(e,t,n,s){Ls(e,t,void 0,s);for(const r in t.attrs)e.setAttribute($s.has(r)?r:Bt(r),t.attrs[r])}function Ws(e,t,n){const s=$t(e,t,n);for(const r in e)if(I(e[r])||I(t[r])){const i=fe.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}class da extends js{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Es}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(de.has(n)){const s=Ps(n);return s&&s.default||0}return n=$s.has(n)?n:Bt(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ws(t,n,s)}build(t,n,s){Ks(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){fa(t,n,s,r)}mount(t){this.isSVGTag=_s(t.tagName),super.mount(t)}}const ha=Nt.length;function Hs(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Hs(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ha;n++){const s=Nt[n],r=e.props[s];(Te(r)||r===!1)&&(t[s]=r)}return t}function Gs(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const pa=[...Lt].reverse(),ma=Lt.length;function ga(e){return t=>Promise.all(t.map(({animation:n,options:s})=>bo(e,n,s)))}function ya(e){let t=ga(e),n=Tn(),s=!0;const r=c=>(u,l)=>{var f;const d=ae(e,l,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:m,...y}=d;u={...u,...y,...m}}return u};function i(c){t=c(e)}function o(c){const{props:u}=e,l=Hs(e.parent)||{},d=[],f=new Set;let h={},m=1/0;for(let b=0;b<ma;b++){const g=pa[b],w=n[g],T=u[g]!==void 0?u[g]:l[g],C=Te(T),S=g===c?w.isActive:null;S===!1&&(m=b);let A=T===l[g]&&T!==u[g]&&C;if(A&&s&&e.manuallyAnimateOnMount&&(A=!1),w.protectedKeys={...h},!w.isActive&&S===null||!T&&!w.prevProp||$e(T)||typeof T=="boolean")continue;if(g==="exit"&&w.isActive&&S!==!0){w.prevResolvedValues&&(h={...h,...w.prevResolvedValues});continue}const P=ba(w.prevProp,T);let V=P||g===c&&w.isActive&&!A&&C||b>m&&C,F=!1;const D=Array.isArray(T)?T:[T];let H=D.reduce(r(g),{});S===!1&&(H={});const{prevResolvedValues:Ae={}}=w,He={...Ae,...H},Me=k=>{V=!0,f.has(k)&&(F=!0,f.delete(k)),w.needsAnimating[k]=!0;const B=e.getValue(k);B&&(B.liveStyle=!1)};for(const k in He){const B=H[k],X=Ae[k];if(h.hasOwnProperty(k))continue;let se=!1;pt(B)&&pt(X)?se=!Gs(B,X):se=B!==X,se?B!=null?Me(k):f.add(k):B!==void 0&&f.has(k)?Me(k):w.protectedKeys[k]=!0}w.prevProp=T,w.prevResolvedValues=H,w.isActive&&(h={...h,...H}),s&&e.blockInitialAnimation&&(V=!1);const Ut=A&&P;V&&(!Ut||F)&&d.push(...D.map(k=>{const B={type:g};if(typeof k=="string"&&s&&!Ut&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,se=ae(X,k);if(X.enteringChildren&&se){const{delayChildren:or}=se.transition||{};B.delay=vs(X.enteringChildren,e,or)}}return{animation:k,options:B}}))}if(f.size){const b={};if(typeof u.initial!="boolean"){const g=ae(e,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(b.transition=g.transition)}f.forEach(g=>{const w=e.getBaseTarget(g),T=e.getValue(g);T&&(T.liveStyle=!0),b[g]=w??null}),d.push({animation:b})}let y=!!d.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),s=!1,y?t(d):Promise.resolve()}function a(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,u)}),n[c].isActive=u;const l=o(c);for(const f in n)n[f].protectedKeys={};return l}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Tn()}}}function ba(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Gs(t,e):!1}function Q(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tn(){return{animate:Q(!0),whileInView:Q(),whileHover:Q(),whileTap:Q(),whileDrag:Q(),whileFocus:Q(),exit:Q()}}function wn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function va(e){return I(e)?e.get():e}const qs=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),_t=p.createContext({strict:!1}),Sn={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 Vn=!1;function xa(){if(Vn)return;const e={};for(const t in Sn)e[t]={isEnabled:n=>Sn[t].some(s=>!!n[s])};Bs(e),Vn=!0}function Us(){return xa(),Yo()}function Cn(e){const t=Us();for(const n in e)t[n]={...t[n],...e[n]};Bs(t)}function Ta({children:e,features:t,strict:n=!1}){const[,s]=p.useState(!Qe(t)),r=p.useRef(void 0);if(!Qe(t)){const{renderer:i,...o}=t;r.current=i,Cn(o)}return p.useEffect(()=>{Qe(t)&&t().then(({renderer:i,...o})=>{Cn(o),r.current=i,s(!0)})},[]),x.jsx(_t.Provider,{value:{renderer:r.current,strict:n},children:e})}function Qe(e){return typeof e=="function"}const wa=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 Le(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wa.has(e)}let zs=e=>!Le(e);function Sa(e){typeof e=="function"&&(zs=t=>t.startsWith("on")?!Le(t):e(t))}try{Sa(require("@emotion/is-prop-valid").default)}catch{}function Va(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(zs(r)||n===!0&&Le(r)||!t&&!Le(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const We=p.createContext({});function Ca(e,t){if(_e(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Te(n)?n:void 0,animate:Te(s)?s:void 0}}return e.inherit!==!1?t:{}}function Aa(e){const{initial:t,animate:n}=Ca(e,p.useContext(We));return p.useMemo(()=>({initial:t,animate:n}),[An(t),An(n)])}function An(e){return Array.isArray(e)?e.join(" "):e}const Wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ys(e,t,n){for(const s in t)!I(t[s])&&!Ns(s,n)&&(e[s]=t[s])}function Ma({transformTemplate:e},t){return p.useMemo(()=>{const n=Wt();return Kt(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Pa(e,t){const n=e.style||{},s={};return Ys(s,n,e),Object.assign(s,Ma(e,t)),s}function Ra(e,t){const n={},s=Pa(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,n}const Xs=()=>({...Wt(),attrs:{}});function Fa(e,t,n,s){const r=p.useMemo(()=>{const i=Xs();return Ks(i,t,_s(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ys(i,e.style,e),r.style={...i,...r.style}}return r}const Da=["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 Ht(e){return typeof e!="string"||e.includes("-")?!1:!!(Da.indexOf(e)>-1||/[A-Z]/u.test(e))}function ka(e,t,n,{latestValues:s},r,i=!1,o){const c=(o??Ht(e)?Fa:Ra)(t,s,r,e),u=Va(t,typeof e=="string",i),l=e!==p.Fragment?{...u,...c,ref:n}:{},{children:d}=t,f=p.useMemo(()=>I(d)?d.get():d,[d]);return p.createElement(e,{...l,children:f})}function Ea({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:Ia(n,s,r,e),renderState:t()}}function Ia(e,t,n,s){const r={},i=s(e,{});for(const f in i)r[f]=va(i[f]);let{initial:o,animate:a}=e;const c=_e(e),u=Is(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const d=l?a:o;if(d&&typeof d!="boolean"&&!$e(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const m=Ot(e,f[h]);if(m){const{transitionEnd:y,transition:b,...g}=m;for(const w in g){let T=g[w];if(Array.isArray(T)){const C=l?T.length-1:0;T=T[C]}T!==null&&(r[w]=T)}for(const w in y)r[w]=y[w]}}}return r}const Qs=e=>(t,n)=>{const s=p.useContext(We),r=p.useContext(On),i=()=>Ea(e,t,s,r);return n?i():vr(i)},Oa=Qs({scrapeMotionValuesFromProps:$t,createRenderState:Wt}),Ba=Qs({scrapeMotionValuesFromProps:Ws,createRenderState:Xs}),ja=Symbol.for("motionComponentSymbol");function La(e,t,n){const s=p.useRef(n);p.useInsertionEffect(()=>{s.current=n});const r=p.useRef(null);return p.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=s.current;if(typeof o=="function")if(i){const c=o(i);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(i);else o&&(o.current=i)},[t])}const Na=p.createContext({});function Ka(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function $a(e,t,n,s,r,i){var T,C;const{visualElement:o}=p.useContext(We),a=p.useContext(_t),c=p.useContext(On),u=p.useContext(qs),l=u.reducedMotion,d=u.skipAnimations,f=p.useRef(null),h=p.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:d,isSVG:i}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,y=p.useContext(Na);m&&!m.projection&&r&&(m.type==="html"||m.type==="svg")&&_a(f.current,n,r,y);const b=p.useRef(!1);p.useInsertionEffect(()=>{m&&b.current&&m.update(n,c)});const g=n[Vs],w=p.useRef(!!g&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return xr(()=>{h.current=!0,m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),w.current&&m.animationState&&m.animationState.animateChanges())}),p.useEffect(()=>{m&&(!w.current&&m.animationState&&m.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,g)}),w.current=!1),m.enteringChildren=void 0)}),m}function _a(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:l}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Zs(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&Ka(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:l,layoutScroll:c,layoutRoot:u})}function Zs(e){if(e)return e.options.allowProjection!==!1?e.projection:Zs(e.parent)}function Wa(e,{forwardMotionProps:t=!1,type:n}={},s,r){const i=n?n==="svg":Ht(e),o=i?Ba:Oa;function a(u,l){let d;const f={...p.useContext(qs),...u,layoutId:Ha(u)},{isStatic:h}=f,m=Aa(u),y=o(u,h);if(!h&&In){Ga(f,s);const b=qa(f);d=b.MeasureLayout,m.visualElement=$a(e,y,f,r,b.ProjectionNode,i)}return x.jsxs(We.Provider,{value:m,children:[d&&m.visualElement?x.jsx(d,{visualElement:m.visualElement,...f}):null,ka(e,u,La(y,m.visualElement,l),y,h,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=p.forwardRef(a);return c[ja]=e,c}function Ha({layoutId:e}){const t=p.useContext(br).id;return t&&e!==void 0?t+"-"+e:e}function Ga(e,t){p.useContext(_t).strict,process.env.NODE_ENV}function qa(e){const t=Us(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(e)||s!=null&&s.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Ua=(e,t)=>t.isSVG??Ht(e)?new da(t):new oa(t,{allowProjection:e!==p.Fragment});class za extends he{constructor(t){super(t),t.animationState||(t.animationState=ya(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$e(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 Ya=0;class Xa extends he{constructor(){super(...arguments),this.id=Ya++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Qa={animation:{Feature:za},exit:{Feature:Xa}};function Js(e){return{point:{x:e.pageX,y:e.pageY}}}function Mn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&N.postRender(()=>i(t,Js(t)))}class Za extends he{mount(){const{current:t}=this.node;t&&(this.unmount=jo(t,(n,s)=>(Mn(this.node,s,"Start"),r=>Mn(this.node,r,"End"))))}unmount(){}}class Ja extends he{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=Ke(wn(this.node.current,"focus",()=>this.onFocus()),wn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Pn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&N.postRender(()=>i(t,Js(t)))}class ec extends he{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=_o(t,(r,i)=>(Pn(this.node,i,"Start"),(o,{success:a})=>Pn(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const vt=new WeakMap,Ze=new WeakMap,tc=e=>{const t=vt.get(e.target);t&&t(e)},nc=e=>{e.forEach(tc)};function sc({root:e,...t}){const n=e||document;Ze.has(n)||Ze.set(n,{});const s=Ze.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(nc,{root:e,...t})),s[r]}function rc(e,t,n){const s=sc(t);return vt.set(e,n),s.observe(e),()=>{vt.delete(e),s.unobserve(e)}}const ic={some:0,all:1};class oc extends he{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:ic[r]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:l,onViewportLeave:d}=this.node.getProps(),f=u?l:d;f&&f(c)};return rc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ac(t,n))&&this.startObserver()}unmount(){}}function ac({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const cc={inView:{Feature:oc},tap:{Feature:ec},focus:{Feature:Ja},hover:{Feature:Za}},uc={renderer:Ua,...Qa,...cc};function er(e,t){return Wa(e,t)}const lc=er("div"),Gt=er("span"),fc=({icon:e=te.ChevronsUpDown,"aria-hidden":t=!0,...n})=>{const s=p.useContext(E);return x.jsx(ce.Button.Icon,{as:Gt,animate:{rotate:s.open?180:0},transition:{duration:.15,type:"spring",bounce:0},icon:e,"aria-hidden":t,...n})},dc=({tooltipProps:e,...t})=>{const n=p.useContext(E),s=()=>{var i,o;if(K(n.value)){const a=n.onValueChange;a==null||a([])}if(z(n.value)){const a=n.onValueChange;a==null||a(void 0)}(o=(i=n.triggerRef)==null?void 0:i.current)==null||o.focus()};return p.useMemo(()=>{var i;if(z(n.value))return n.clearable&&n.value;if(K(n.value))return n.clearable&&((i=n.value)==null?void 0:i.length)>0},[n.clearable,n.value])?x.jsx(dr.Tooltip,{label:"Clear field",...e,children:x.jsx(ce.Button,{type:"button",icon:{icon:te.X,alt:"Clear field"},size:"0",variant:"ghost",onClick:i=>{n.value&&(i.stopPropagation(),s())},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),i.preventDefault(),s())},"data-tgph-combobox-clear":!0,style:{marginTop:"calc(-1 * var(--tgph-spacing-1)",marginBottom:"calc(-1 * var(--tgph-spacing-1)"},...t})}):null},tr=({children:e,...t})=>{const n=p.useContext(E),s=p.useMemo(()=>{var a;if(!z(n.value))return;const r=Je(n.value,n.options,n.legacyBehavior),i=(r==null?void 0:r.label)||(r==null?void 0:r.value)||n.placeholder,o=n.legacyBehavior&&((a=n==null?void 0:n.value)==null?void 0:a.label);return o||i},[n.value,n.options,n.legacyBehavior,n.placeholder]);return x.jsx(Dn.TooltipIfTruncated,{children:x.jsx(ce.Button.Text,{color:n.value?"default":"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||s})})},xt=({children:e,...t})=>{const n=p.useContext(E);return x.jsx(Dn.TooltipIfTruncated,{children:x.jsx(ce.Button.Text,{color:"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||n.placeholder})})},nr=({children:e})=>{const t=p.useContext(E);if(!K(t.value))return null;const n=t.layout||"truncate",r=(t.value.length-2).toString().split("");return x.jsxs(U.Stack,{gap:"0_5",w:"full",wrap:n==="wrap"?"wrap":"nowrap",align:"center",style:{position:"relative",flexGrow:1},children:[e,n==="truncate"&&t.value.length>2&&x.jsx(U.Stack,{as:lc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},h:"full",pr:"1",pl:"8",align:"center","aria-label":`${t.value.length-2} more selected`,position:"absolute",right:"0",style:{backgroundImage:"linear-gradient(to left, var(--tgph-surface-1) 0 60%, transparent 90% 100%)"},children:x.jsxs(wt.Text,{as:"span",size:"1",style:{whiteSpace:"nowrap"},children:["+",r.map(i=>x.jsx(U.Box,{as:Gt,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},w:"2",display:"inline-block",children:i},i))," ","more"]})})]})},qt=p.createContext({value:""}),hc=({value:e,children:t,...n})=>x.jsx(qt.Provider,{value:{value:e},children:x.jsx(St.Tag.Root,{as:Gt,initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.1,type:"spring",bounce:0},size:"1",maxH:"5",rounded:"1",layout:"position",...n,children:t})}),pc=({children:e,...t})=>{const n=p.useContext(E),s=p.useContext(qt),r=p.useMemo(()=>{const i=n.options.find(c=>c.value===s.value);if(i)return i.label||i.value;if(!n.value)return;const a=n.value.find(c=>$(c,n.legacyBehavior)===s.value);if(a)return a},[n.options,n.value,s.value,n.legacyBehavior]);return x.jsx(St.Tag.Text,{...t,children:e||r})},mc=({children:e,...t})=>{const n=p.useContext(E),s=p.useContext(qt);return x.jsx(St.Tag.Button,{icon:{icon:te.X,alt:`Remove ${s.value}`},height:"full",onClick:r=>{if(!n.onValueChange)return;const i=n.onValueChange,a=n.value.filter(c=>$(c,n.legacyBehavior)!==s.value);i==null||i(a),r.stopPropagation(),r.preventDefault()},"data-tgph-combobox-tag-button":!0,...t,children:e})},gc=({value:e,children:t,...n})=>x.jsxs(be.Root,{value:e,...n,children:[x.jsx(be.Text,{children:t}),x.jsx(be.Button,{})]}),yc=e=>x.jsx(U.Stack,{align:"center",gap:"1",...e}),bc=()=>{const e=p.useContext(E);if(e.value&&K(e.value)){const t=e.layout||"truncate";return e.value.length===0?x.jsx(xt,{}):x.jsx(Ta,{features:uc,children:x.jsx(nr,{children:e.value.map((n,s)=>{const r=$(n,e.legacyBehavior);if(r&&(t==="truncate"&&s<=1||t==="wrap"))return x.jsx(fr.RefToTgphRef,{children:x.jsx(be.Default,{value:r})},r)})})})}if(e&&z(e.value))return e.value?x.jsx(tr,{}):x.jsx(xt,{})},be={Root:hc,Text:pc,Button:mc,Default:gc},ge={TriggerIndicator:fc,TriggerClear:dc,TriggerText:tr,TriggerPlaceholder:xt,TriggerTagsContainer:nr,TriggerActionsContainer:yc,TriggerTag:be,TriggerValue:bc},vc=["ArrowDown","PageUp","Home"],xc=["ArrowUp","PageDown","End"],sr=["Enter"," "],E=p.createContext({value:void 0,onValueChange:()=>{},contentId:"",triggerId:"",open:!1,setOpen:()=>{},onOpenToggle:()=>{},clearable:!1,disabled:!1,options:[],legacyBehavior:!1}),Tc=({modal:e=!0,closeOnSelect:t=!0,clearable:n=!1,disabled:s=!1,legacyBehavior:r=!1,open:i,onOpenChange:o,defaultOpen:a,value:c,defaultValue:u,onValueChange:l,errored:d,placeholder:f,layout:h,defaultScrollToValue:m,children:y,...b})=>{const g=p.useId(),w=p.useId(),T=p.useRef(null),C=p.useRef(null),S=p.useRef(null),A=p.useMemo(()=>gr(y),[y]),[P,V]=p.useState(""),[F=!1,D]=zt.useControllableState({prop:i,defaultProp:a??!1,onChange:o}),[H,Ae]=zt.useControllableState({prop:c,defaultProp:u,onChange:l}),He=p.useCallback(()=>{D(Me=>!Me)},[D]);return p.useEffect(()=>{F||V("")},[F]),x.jsx(E.Provider,{value:{contentId:g,triggerId:w,value:H,onValueChange:Ae,placeholder:f,open:F,setOpen:D,onOpenToggle:He,closeOnSelect:t,clearable:n,disabled:s,searchQuery:P,setSearchQuery:V,triggerRef:T,searchRef:C,contentRef:S,errored:d,layout:h,options:A,legacyBehavior:r,defaultScrollToValue:m},children:x.jsx(Ne.Menu.Root,{open:F,onOpenChange:D,modal:e,...b,children:y})})},wc=({size:e="1",children:t,...n})=>{const s=p.useContext(E),r=K(s.value)&&s.value.length>0,i=p.useMemo(()=>{if(s.value){if(z(s.value))return Je(s.value,s.options,s.legacyBehavior);if(K(s.value))return s.value.map(a=>Je(a,s.options,s.legacyBehavior))}},[s.value,s.options,s.legacyBehavior]),o=p.useCallback(()=>i?z(i)?(i==null?void 0:i.label)||(i==null?void 0:i.value)||s.placeholder:K(i)&&i.map(a=>(a==null?void 0:a.label)||(a==null?void 0:a.value)).join(", ")||s.placeholder:s.placeholder,[i,s.placeholder]);return x.jsx(Ne.Menu.Trigger,{...n,asChild:!0,onClick:a=>{var c,u;a.preventDefault(),s.onOpenToggle(),(u=(c=s.triggerRef)==null?void 0:c.current)==null||u.focus()},onKeyDown:a=>{var c;if(a.target===((c=s.triggerRef)==null?void 0:c.current)){if(a.key==="Tab"){a.stopPropagation();return}if(a.key==="ArrowDown"||sr.includes(a.key)){a.stopPropagation(),a.preventDefault(),s.onOpenToggle();return}}},tgphRef:s.triggerRef,children:x.jsx(ce.Button.Root,{id:s.triggerId,type:"button",bg:"surface-1",variant:"outline",align:"center",minH:mr[e],h:"full",w:"full",py:"0_5",pr:"1_5",pl:r?"0_5":"1_5",size:e,color:s.errored?"red":"gray",justify:"space-between",role:"combobox","aria-label":o(),"aria-controls":s.contentId,"aria-expanded":s.open,"aria-haspopup":"listbox","data-tgph-combobox-trigger":!0,"data-tgph-combobox-trigger-open":s.open,disabled:s.disabled,...n,children:t?typeof t=="function"?t({value:i}):t:x.jsxs(x.Fragment,{children:[x.jsx(ge.TriggerValue,{}),x.jsxs(ge.TriggerActionsContainer,{children:[x.jsx(ge.TriggerClear,{}),x.jsx(ge.TriggerIndicator,{})]})]})})})},Sc=({style:e,children:t,tgphRef:n,...s})=>{const r=p.useContext(E),i=p.useRef(!1),o=Tt.useComposedRefs(n,r.contentRef),a=p.useRef(null),[c,u]=p.useState(0),[l,d]=p.useState(!1),f=p.useCallback(h=>{const m=h==null?void 0:h.getBoundingClientRect();m&&u(m.height),l||d(!0)},[l]);return p.useEffect(()=>{const h=new ResizeObserver(m=>{for(const y of m){const b=y.target;f(b)}});return a.current&&l&&h.observe(a.current),()=>h.disconnect()},[l,f]),p.useEffect(()=>{l===!0&&r.open===!1&&d(!1)},[r.open,l]),p.useEffect(()=>{let h;return r.open&&(h=setTimeout(()=>{f(a.current)},10)),()=>h&&clearTimeout(h)},[r.open,f]),x.jsx(hr.Root,{asChild:!0,children:x.jsx(ar.DismissableLayer,{onEscapeKeyDown:h=>{r.open&&(h.stopPropagation(),h.preventDefault(),r.setOpen(!1))},children:x.jsx(Ne.Menu.Content,{className:"tgph",mt:"1",onCloseAutoFocus:h=>{var m,y;i.current||(y=(m=r.triggerRef)==null?void 0:m.current)==null||y.focus(),i.current=!1,h.preventDefault()},bg:"surface-1",style:{width:"var(--tgph-combobox-trigger-width)",transition:"min-height 200ms ease-in-out",minHeight:c?`${c}px`:"0",...e,"--tgph-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--tgph-combobox-content-available-width":"var(--radix-popper-available-width)","--tgph-combobox-content-available-height":"calc(var(--radix-popper-available-height) - var(--tgph-spacing-8))","--tgph-combobox-trigger-width":"var(--radix-popper-anchor-width)","--tgph-combobox-trigger-height":"var(--radix-popper-anchor-height)"},...s,tgphRef:o,"data-tgph-combobox-content":!0,"data-tgph-combobox-content-open":r.open,role:void 0,"aria-orientation":void 0,onKeyDown:h=>{var y,b,g,w;h.stopPropagation();const m=(b=(y=r.contentRef)==null?void 0:y.current)==null?void 0:b.querySelectorAll("[data-tgph-combobox-option]");document.activeElement===(m==null?void 0:m[0])&&xc.includes(h.key)&&((w=(g=r.searchRef)==null?void 0:g.current)==null||w.focus())},children:x.jsx(U.Stack,{direction:"column",gap:"1",tgphRef:a,children:t})})})})},Vc=({tgphRef:e,...t})=>{const n=p.useContext(E),s=p.useRef(null),r=Tt.useComposedRefs(e,s);return p.useEffect(()=>{n.open&&s.current&&requestAnimationFrame(()=>{var a;const o=(z(n.value)?$(n.value,n.legacyBehavior):K(n.value)&&n.value.length>0?$(n.value[0],n.legacyBehavior):null)??n.defaultScrollToValue;if(o){const c=(a=s.current)==null?void 0:a.querySelectorAll("[data-tgph-combobox-option]"),u=Array.from(c||[]).find(l=>l.getAttribute("data-tgph-combobox-option-value")===o);u&&typeof u.scrollIntoView=="function"&&u.scrollIntoView({block:"center"})}})},[n.open,n.value,n.legacyBehavior,n.defaultScrollToValue]),x.jsx(U.Stack,{id:n.contentId,direction:"column",gap:"1",style:{overflowY:"auto","--max-height":t.maxHeight?void 0:"calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))"},role:"listbox",tgphRef:r,...t})},rr=({value:e,label:t,selected:n,onSelect:s,children:r,...i})=>{const o=p.useContext(E),[a,c]=p.useState(!1),u=o.value,l=!o.searchQuery||yr({children:t||r,value:e,searchQuery:o.searchQuery}),d=K(u)?u.some(h=>$(h,o.legacyBehavior)===e):$(u,o.legacyBehavior)===e,f=h=>{var y,b;h.stopPropagation();const m=h;if(!(m.key&&!sr.includes(m.key))){if(h.preventDefault(),o.closeOnSelect===!0&&o.setOpen(!1),s)return s(h);if(z(u)){const g=o.onValueChange;o.legacyBehavior===!0?g==null||g({value:e,label:t}):g==null||g(e)}else if(K(u)){const g=o.onValueChange,w=o.value,T=d?w.filter(C=>$(C,o.legacyBehavior)!==e):[...w,o.legacyBehavior===!0?{value:e,label:t}:e];g==null||g(T)}(b=(y=o.triggerRef)==null?void 0:y.current)==null||b.focus()}};if(l)return x.jsx(Ne.Menu.Button,{type:"button",onSelect:f,onKeyDown:f,selected:n===null?null:n??d,onFocus:()=>c(!0),onBlur:()=>c(!1),role:"option","aria-selected":d?"true":"false","data-tgph-combobox-option":!0,"data-tgph-combobox-option-focused":a,"data-tgph-combobox-option-value":e,"data-tgph-combobox-option-label":t,...i,children:t||r||e})},Cc=({label:e="Search",placeholder:t="Search",tgphRef:n,value:s,onValueChange:r,...i})=>{var d;const o=p.useId(),a=p.useContext(E),c=Tt.useComposedRefs(n,a.searchRef),u=s??a.searchQuery,l=r??a.setSearchQuery;return p.useEffect(()=>{var m;const f=y=>{var b,g;vc.includes(y.key)&&((g=(b=a.contentRef)==null?void 0:b.current)==null||g.focus({preventScroll:!0})),y.key==="Escape"&&a.setOpen(!1),y.stopPropagation()},h=(m=a.searchRef)==null?void 0:m.current;if(h)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f)}},[a]),x.jsxs(U.Box,{borderBottom:"px",px:"1",pb:"1",children:[x.jsx(pr.Root,{children:x.jsx(wt.Text,{as:"label",htmlFor:o,children:e})}),x.jsx(lr.Input,{id:o,variant:"ghost",placeholder:t,value:u,onChange:f=>{l(f.target.value)},LeadingComponent:x.jsx(Fn.Icon,{icon:te.Search,alt:"Search Icon"}),TrailingComponent:a!=null&&a.searchQuery&&((d=a==null?void 0:a.searchQuery)==null?void 0:d.length)>0?x.jsx(ce.Button,{variant:"ghost",color:"gray",icon:{icon:te.X,alt:"Clear Search Query"},onClick:()=>{var f;return(f=a.setSearchQuery)==null?void 0:f.call(a,"")}}):null,autoFocus:!0,"data-tgph-combobox-search":!0,"aria-controls":a.contentId,...i,tgphRef:c})]})},Ac=({icon:e={icon:te.Search,alt:"Search Icon"},message:t="No results found",children:n,...s})=>{const r=p.useContext(E),[i,o]=p.useState(!1);if(p.useEffect(()=>{var c,u;const a=(u=(c=r.contentRef)==null?void 0:c.current)==null?void 0:u.querySelectorAll("[data-tgph-combobox-option]");(a==null?void 0:a.length)===0?o(!0):o(!1)},[r.searchQuery,r.contentRef,n]),i)return x.jsxs(U.Stack,{gap:"1",align:"center",justify:"center",w:"full",my:"8","data-tgph-combobox-empty":!0,...s,children:[e===null?x.jsx(x.Fragment,{}):x.jsx(Fn.Icon,{...e}),t===null?x.jsx(x.Fragment,{}):x.jsx(wt.Text,{as:"span",children:t})]})},Mc=({leadingText:e="Create",values:t,onCreate:n,selected:s=null,legacyBehavior:r=!1,...i})=>{const o=p.useContext(E),a=p.useCallback(c=>!t||(t==null?void 0:t.length)===0?!1:t.some(u=>$(u,r)===c),[t,r]);if(o.searchQuery&&!a(o.searchQuery))return x.jsx(rr,{leadingIcon:{icon:te.Plus,"aria-hidden":!0},mx:"1",value:o.searchQuery,label:`${e} "${o.searchQuery}"`,selected:s,onSelect:()=>{var c;if(n&&o.searchQuery){const u=r===!0?{value:o.searchQuery}:o.searchQuery;n(u),(c=o.setSearchQuery)==null||c.call(o,"")}},...i})},ir={};Object.assign(ir,{Root:Tc,Trigger:wc,Content:Sc,Options:Vc,Option:rr,Search:Cc,Empty:Ac,Create:Mc,Primitives:ge});exports.Combobox=ir;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),ar=require("@radix-ui/react-dismissable-layer"),cr=require("@radix-ui/react-portal"),zt=require("@radix-ui/react-use-controllable-state"),ur=require("@radix-ui/react-visually-hidden"),ce=require("@telegraph/button"),Tt=require("@telegraph/compose-refs"),Fn=require("@telegraph/icon"),lr=require("@telegraph/input"),U=require("@telegraph/layout"),Ne=require("@telegraph/menu"),wt=require("@telegraph/typography"),te=require("lucide-react"),p=require("react"),fr=require("@telegraph/helpers"),St=require("@telegraph/tag"),dr=require("@telegraph/tooltip"),Dn=require("@telegraph/truncate");function kn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const hr=kn(cr),pr=kn(ur),mr={0:"5",1:"6",2:"8",3:"10"},K=e=>Array.isArray(e),z=e=>typeof e=="object"&&!Array.isArray(e)||typeof e=="string"||!e,gr=e=>{const t=(r,i=[])=>(p.Children.toArray(r).forEach(a=>{if(p.isValidElement(a)){const c=a.props;c.value?i.push(a):c.children&&t(c.children,i)}}),i);return t(e).map(r=>{var o;const i=r;return{value:i.props.value,label:((o=i.props)==null?void 0:o.label)||i.props.children||i.props.value}})},$=(e,t)=>{if(e)return t===!0?e==null?void 0:e.value:e},Je=(e,t,n)=>{if(!e||!t||t.length===0)return;const s=t.find(r=>r.value===$(e,n));if(s)return s},yr=({children:e,value:t,searchQuery:n})=>{const s=En(e);return(t==null?void 0:t.toLowerCase().includes(n.toLowerCase()))||s.some(r=>r.toLowerCase().includes(n.toLowerCase()))},En=e=>{const t=p.Children.toArray(e),n=[];return t.forEach(s=>{if(typeof s=="string"&&n.push(s),p.isValidElement(s)){const r=s.props;r.children&&n.push(...En(r.children))}}),n},br=p.createContext({});function vr(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const In=typeof window<"u",xr=In?p.useLayoutEffect:p.useEffect,On=p.createContext(null);function Tr(e,t){e.indexOf(t)===-1&&e.push(t)}function wr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Y=(e,t,n)=>n>t?t:n<e?e:n;function et(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let we=()=>{},ne=()=>{};var Rn;typeof process<"u"&&((Rn=process.env)==null?void 0:Rn.NODE_ENV)!=="production"&&(we=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(et(t,n))},ne=(e,t,n)=>{if(!e)throw new Error(et(t,n))});const W={},Bn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Sr(e){return typeof e=="object"&&e!==null}const jn=e=>/^0[^.\s]+$/u.test(e);function Ln(e){let t;return()=>(t===void 0&&(t=e()),t)}const ue=e=>e,Vr=(e,t)=>n=>t(e(n)),Ke=(...e)=>e.reduce(Vr),Nn=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class Kn{constructor(){this.subscriptions=[]}add(t){return Tr(this.subscriptions,t),()=>wr(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _=e=>e*1e3,j=e=>e/1e3;function $n(e,t){return t?e*(1e3/t):0}const Yt=new Set;function _n(e,t,n){e||Yt.has(t)||(console.warn(et(t,n)),Yt.add(t))}const Wn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cr=1e-7,Ar=12;function Mr(e,t,n,s,r){let i,o,a=0;do o=t+(n-t)/2,i=Wn(o,s,r)-e,i>0?n=o:t=o;while(Math.abs(i)>Cr&&++a<Ar);return o}function Se(e,t,n,s){if(e===t&&n===s)return ue;const r=i=>Mr(i,0,1,e,n);return i=>i===0||i===1?i:Wn(r(i),t,s)}const Hn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Gn=e=>t=>1-e(1-t),qn=Se(.33,1.53,.69,.99),Vt=Gn(qn),Un=Hn(Vt),zn=e=>(e*=2)<1?.5*Vt(e):.5*(2-Math.pow(2,-10*(e-1))),Ct=e=>1-Math.sin(Math.acos(e)),Pr=Gn(Ct),Yn=Hn(Ct),Rr=Se(.42,0,1,1),Fr=Se(0,0,.58,1),Xn=Se(.42,0,.58,1),Dr=e=>Array.isArray(e)&&typeof e[0]!="number",Qn=e=>Array.isArray(e)&&typeof e[0]=="number",Xt={linear:ue,easeIn:Rr,easeInOut:Xn,easeOut:Fr,circIn:Ct,circInOut:Yn,circOut:Pr,backIn:Vt,backInOut:Un,backOut:qn,anticipate:zn},kr=e=>typeof e=="string",Qt=e=>{if(Qn(e)){ne(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return Se(t,n,s,r)}else if(kr(e))return ne(Xt[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Xt[e];return e},Pe=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Er(e,t){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){o.has(l)&&(u.schedule(l),e()),l(a)}const u={schedule:(l,d=!1,f=!1)=>{const m=f&&r?n:s;return d&&o.add(l),m.has(l)||m.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,r){i=!0;return}r=!0,[n,s]=[s,n],n.forEach(c),n.clear(),r=!1,i&&(i=!1,u.process(l))}};return u}const Ir=40;function Zn(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Pe.reduce((T,C)=>(T[C]=Er(i),T),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:d,preRender:f,render:h,postRender:m}=o,y=()=>{const T=W.useManualTiming?r.timestamp:performance.now();n=!1,W.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(T-r.timestamp,Ir),1)),r.timestamp=T,r.isProcessing=!0,a.process(r),c.process(r),u.process(r),l.process(r),d.process(r),f.process(r),h.process(r),m.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(y))},b=()=>{n=!0,s=!0,r.isProcessing||e(y)};return{schedule:Pe.reduce((T,C)=>{const S=o[C];return T[C]=(A,P=!1,V=!1)=>(n||b(),S.schedule(A,P,V)),T},{}),cancel:T=>{for(let C=0;C<Pe.length;C++)o[Pe[C]].cancel(T)},state:r,steps:o}}const{schedule:N,cancel:tt,state:ke}=Zn(typeof requestAnimationFrame<"u"?requestAnimationFrame:ue,!0);let Fe;function Or(){Fe=void 0}const O={now:()=>(Fe===void 0&&O.set(ke.isProcessing||W.useManualTiming?ke.timestamp:performance.now()),Fe),set:e=>{Fe=e,queueMicrotask(Or)}},Jn=e=>t=>typeof t=="string"&&t.startsWith(e),es=Jn("--"),Br=Jn("var(--"),At=e=>Br(e)?jr.test(e.split("/*")[0].trim()):!1,jr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Zt(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const le={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ve={...le,transform:e=>Y(0,1,e)},Re={...le,default:1},ye=e=>Math.round(e*1e5)/1e5,Mt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Lr(e){return e==null}const Nr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pt=(e,t)=>n=>!!(typeof n=="string"&&Nr.test(n)&&n.startsWith(e)||t&&!Lr(n)&&Object.prototype.hasOwnProperty.call(n,t)),ts=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(Mt);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Kr=e=>Y(0,255,e),Ge={...le,transform:e=>Math.round(Kr(e))},Z={test:Pt("rgb","red"),parse:ts("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Ge.transform(e)+", "+Ge.transform(t)+", "+Ge.transform(n)+", "+ye(ve.transform(s))+")"};function $r(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const nt={test:Pt("#"),parse:$r,transform:Z.transform},Ve=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),G=Ve("deg"),oe=Ve("%"),v=Ve("px"),_r=Ve("vh"),Wr=Ve("vw"),Jt={...oe,parse:e=>oe.parse(e)/100,transform:e=>oe.transform(e*100)},re={test:Pt("hsl","hue"),parse:ts("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+oe.transform(ye(t))+", "+oe.transform(ye(n))+", "+ye(ve.transform(s))+")"},R={test:e=>Z.test(e)||nt.test(e)||re.test(e),parse:e=>Z.test(e)?Z.parse(e):re.test(e)?re.parse(e):nt.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Z.transform(e):re.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},Hr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Gr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Mt))==null?void 0:t.length)||0)+(((n=e.match(Hr))==null?void 0:n.length)||0)>0}const ns="number",ss="color",qr="var",Ur="var(",en="${}",zr=/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 xe(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(zr,c=>(R.test(c)?(s.color.push(i),r.push(ss),n.push(R.parse(c))):c.startsWith(Ur)?(s.var.push(i),r.push(qr),n.push(c)):(s.number.push(i),r.push(ns),n.push(parseFloat(c))),++i,en)).split(en);return{values:n,split:a,indexes:s,types:r}}function rs(e){return xe(e).values}function is(e){const{split:t,types:n}=xe(e),s=t.length;return r=>{let i="";for(let o=0;o<s;o++)if(i+=t[o],r[o]!==void 0){const a=n[o];a===ns?i+=ye(r[o]):a===ss?i+=R.transform(r[o]):i+=r[o]}return i}}const Yr=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function Xr(e){const t=rs(e);return is(e)(t.map(Yr))}const L={test:Gr,parse:rs,createTransformer:is,getAnimatableNone:Xr};function qe(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 Qr({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=qe(c,a,e+1/3),i=qe(c,a,e),o=qe(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Ee(e,t){return n=>n>0?t:e}const Ce=(e,t,n)=>e+(t-e)*n,Ue=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},Zr=[nt,Z,re],Jr=e=>Zr.find(t=>t.test(e));function tn(e){const t=Jr(e);if(we(!!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===re&&(n=Qr(n)),n}const nn=(e,t)=>{const n=tn(e),s=tn(t);if(!n||!s)return Ee(e,t);const r={...n};return i=>(r.red=Ue(n.red,s.red,i),r.green=Ue(n.green,s.green,i),r.blue=Ue(n.blue,s.blue,i),r.alpha=Ce(n.alpha,s.alpha,i),Z.transform(r))},st=new Set(["none","hidden"]);function ei(e,t){return st.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ti(e,t){return n=>Ce(e,t,n)}function Rt(e){return typeof e=="number"?ti:typeof e=="string"?At(e)?Ee:R.test(e)?nn:ri:Array.isArray(e)?os:typeof e=="object"?R.test(e)?nn:ni:Ee}function os(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>Rt(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function ni(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Rt(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function si(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const ri=(e,t)=>{const n=L.createTransformer(t),s=xe(e),r=xe(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?st.has(e)&&!r.values.length||st.has(t)&&!s.values.length?ei(e,t):Ke(os(si(s,r),r.values),n):(we(!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"),Ee(e,t))};function as(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ce(e,t,n):Rt(e)(e,t)}const ii=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>N.update(t,n),stop:()=>tt(t),now:()=>ke.isProcessing?ke.timestamp:O.now()}},cs=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Ie=2e4;function Ft(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Ie;)t+=n,s=e.next(t);return t>=Ie?1/0:t}function oi(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Ft(s),Ie);return{type:"keyframes",ease:i=>s.next(r*i).value/t,duration:j(r)}}const ai=5;function us(e,t,n){const s=Math.max(t-ai,0);return $n(n-e(s),t-s)}const M={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},ze=.001;function ci({duration:e=M.duration,bounce:t=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let r,i;we(e<=_(M.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Y(M.minDamping,M.maxDamping,o),e=Y(M.minDuration,M.maxDuration,j(e)),o<1?(r=u=>{const l=u*o,d=l*e,f=l-n,h=rt(u,o),m=Math.exp(-d);return ze-f/h*m},i=u=>{const d=u*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-d),y=rt(Math.pow(u,2),o);return(-r(u)+ze>0?-1:1)*((f-h)*m)/y}):(r=u=>{const l=Math.exp(-u*e),d=(u-n)*e+1;return-ze+l*d},i=u=>{const l=Math.exp(-u*e),d=(n-u)*(e*e);return l*d});const a=5/e,c=li(r,i,a);if(e=_(e),isNaN(c))return{stiffness:M.stiffness,damping:M.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const ui=12;function li(e,t,n){let s=n;for(let r=1;r<ui;r++)s=s-e(s)/t(s);return s}function rt(e,t){return e*Math.sqrt(1-t*t)}const fi=["duration","bounce"],di=["stiffness","damping","mass"];function sn(e,t){return t.some(n=>e[n]!==void 0)}function hi(e){let t={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...e};if(!sn(e,di)&&sn(e,fi))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*Y(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:M.mass,stiffness:r,damping:i}}else{const n=ci({...e,velocity:0});t={...t,...n,mass:M.mass},t.isResolvedFromDuration=!0}return t}function Oe(e=M.visualDuration,t=M.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:u,mass:l,duration:d,velocity:f,isResolvedFromDuration:h}=hi({...n,velocity:-j(n.velocity||0)}),m=f||0,y=u/(2*Math.sqrt(c*l)),b=o-i,g=j(Math.sqrt(c/l)),w=Math.abs(b)<5;s||(s=w?M.restSpeed.granular:M.restSpeed.default),r||(r=w?M.restDelta.granular:M.restDelta.default);let T;if(y<1){const S=rt(g,y);T=A=>{const P=Math.exp(-y*g*A);return o-P*((m+y*g*b)/S*Math.sin(S*A)+b*Math.cos(S*A))}}else if(y===1)T=S=>o-Math.exp(-g*S)*(b+(m+g*b)*S);else{const S=g*Math.sqrt(y*y-1);T=A=>{const P=Math.exp(-y*g*A),V=Math.min(S*A,300);return o-P*((m+y*g*b)*Math.sinh(V)+S*b*Math.cosh(V))/S}}const C={calculatedDuration:h&&d||null,next:S=>{const A=T(S);if(h)a.done=S>=d;else{let P=S===0?m:0;y<1&&(P=S===0?_(m):us(T,S,A));const V=Math.abs(P)<=s,F=Math.abs(o-A)<=r;a.done=V&&F}return a.value=a.done?o:A,a},toString:()=>{const S=Math.min(Ft(C),Ie),A=cs(P=>C.next(S*P).value,S,30);return S+"ms "+A},toTransition:()=>{}};return C}Oe.applyToOptions=e=>{const t=oi(e,100,Oe);return e.ease=t.ease,e.duration=_(t.duration),e.type="keyframes",e};function it({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){const d=e[0],f={done:!1,value:d},h=V=>a!==void 0&&V<a||c!==void 0&&V>c,m=V=>a===void 0?c:c===void 0||Math.abs(a-V)<Math.abs(c-V)?a:c;let y=n*t;const b=d+y,g=o===void 0?b:o(b);g!==b&&(y=g-d);const w=V=>-y*Math.exp(-V/s),T=V=>g+w(V),C=V=>{const F=w(V),D=T(V);f.done=Math.abs(F)<=u,f.value=f.done?g:D};let S,A;const P=V=>{h(f.value)&&(S=V,A=Oe({keyframes:[f.value,m(f.value)],velocity:us(T,V,f.value),damping:r,stiffness:i,restDelta:u,restSpeed:l}))};return P(0),{calculatedDuration:null,next:V=>{let F=!1;return!A&&S===void 0&&(F=!0,C(V),P(V)),S!==void 0&&V>=S?A.next(V-S):(!F&&C(V),f)}}}function pi(e,t,n){const s=[],r=n||W.mix||as,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||ue:t;a=Ke(c,a)}s.push(a)}return s}function mi(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(ne(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=pi(t,s,r),c=a.length,u=l=>{if(o&&l<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(l<e[d+1]);d++);const f=Nn(e[d],e[d+1],l);return a[d](f)};return n?l=>u(Y(e[0],e[i-1],l)):u}function gi(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=Nn(0,t,s);e.push(Ce(n,1,r))}}function yi(e){const t=[0];return gi(t,e.length-1),t}function bi(e,t){return e.map(n=>n*t)}function vi(e,t){return e.map(()=>t||Xn).splice(0,e.length-1)}function ie({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Dr(s)?s.map(Qt):Qt(s),i={done:!1,value:t[0]},o=bi(n&&n.length===t.length?n:yi(t),e),a=mi(o,t,{ease:Array.isArray(r)?r:vi(t,r)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const xi=e=>e!==null;function Dt(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(xi),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const Ti={decay:it,inertia:it,tween:ie,keyframes:ie,spring:Oe};function ls(e){typeof e.type=="string"&&(e.type=Ti[e.type])}class kt{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 wi=e=>e/100;class Et extends kt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==O.now()&&this.tick(O.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;ls(t);const{type:n=ie,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||ie;process.env.NODE_ENV!=="production"&&c!==ie&&ne(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==ie&&typeof a[0]!="number"&&(this.mixKeyframes=Ke(wi,as(a[0],a[1])),a=[0,100]);const u=c({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Ft(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:d,repeatType:f,repeatDelay:h,type:m,onUpdate:y,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let T=this.currentTime,C=s;if(d){const V=Math.min(this.currentTime,r)/a;let F=Math.floor(V),D=V%1;!D&&V>=1&&(D=1),D===1&&F--,F=Math.min(F,d+1),!!(F%2)&&(f==="reverse"?(D=1-D,h&&(D-=h/a)):f==="mirror"&&(C=o)),T=Y(0,1,D)*a}const S=w?{done:!1,value:l[0]}:C.next(T);i&&(S.value=i(S.value));let{done:A}=S;!w&&c!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return P&&m!==it&&(S.value=Dt(l,this.options,b,this.speed)),y&&y(S.value),P&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return j(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(this.currentTime)}set time(t){var n;t=_(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(O.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=j(this.currentTime))}play(){var r,i;if(this.isStopped)return;const{driver:t=ii,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(r=this.options).onPlay)==null||i.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(O.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 Si(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const J=e=>e*180/Math.PI,ot=e=>{const t=J(Math.atan2(e[1],e[0]));return at(t)},Vi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ot,rotateZ:ot,skewX:e=>J(Math.atan(e[1])),skewY:e=>J(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},at=e=>(e=e%360,e<0&&(e+=360),e),rn=ot,on=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),an=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ci={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:on,scaleY:an,scale:e=>(on(e)+an(e))/2,rotateX:e=>at(J(Math.atan2(e[6],e[5]))),rotateY:e=>at(J(Math.atan2(-e[2],e[0]))),rotateZ:rn,rotate:rn,skewX:e=>J(Math.atan(e[4])),skewY:e=>J(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ct(e){return e.includes("scale")?1:0}function ut(e,t){if(!e||e==="none")return ct(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Ci,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Vi,r=a}if(!r)return ct(t);const i=s[t],o=r[1].split(",").map(Mi);return typeof i=="function"?i(o):o[i]}const Ai=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ut(n,t)};function Mi(e){return parseFloat(e.trim())}const fe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],de=new Set(fe),cn=e=>e===le||e===v,Pi=new Set(["x","y","z"]),Ri=fe.filter(e=>!Pi.has(e));function Fi(e){const t=[];return Ri.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const q={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-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})=>ut(t,"x"),y:(e,{transform:t})=>ut(t,"y")};q.translateX=q.x;q.translateY=q.y;const ee=new Set;let lt=!1,ft=!1,dt=!1;function fs(){if(ft){const e=Array.from(ee).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=Fi(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,o])=>{var a;(a=s.getValue(i))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ft=!1,lt=!1,ee.forEach(e=>e.complete(dt)),ee.clear()}function ds(){ee.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ft=!0)})}function Di(){dt=!0,ds(),fs(),dt=!1}class It{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ee.add(this),lt||(lt=!0,N.read(ds),N.resolveKeyframes(fs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r==null?void 0:r.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}Si(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ee.delete(this)}cancel(){this.state==="scheduled"&&(ee.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ki=e=>e.startsWith("--");function Ei(e,t,n){ki(t)?e.style.setProperty(t,n):e.style[t]=n}const Ii={};function hs(e,t){const n=Ln(e);return()=>Ii[t]??n()}const Oi=hs(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),ps=hs(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),me=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,un={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:me([0,.65,.55,1]),circOut:me([.55,0,1,.45]),backIn:me([.31,.01,.66,-.59]),backOut:me([.33,1.53,.69,.99])};function ms(e,t){if(e)return typeof e=="function"?ps()?cs(e,t):"ease-out":Qn(e)?me(e):Array.isArray(e)?e.map(n=>ms(n,t)||un.easeOut):un[e]}function Bi(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[t]:n};c&&(l.offset=c);const d=ms(a,r);Array.isArray(d)&&(l.easing=d);const f={delay:s,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(l,f)}function gs(e){return typeof e=="function"&&"applyToOptions"in e}function ji({type:e,...t}){return gs(e)&&ps()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ys extends kt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,ne(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=ji(t);this.animation=Bi(n,s,r,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const l=Dt(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(l):Ei(n,s,l),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,s,r;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return j(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_(t)}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,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Oi()?(this.animation.timeline=t,ue):n(this)}}const bs={anticipate:zn,backInOut:Un,circInOut:Yn};function Li(e){return e in bs}function Ni(e){typeof e.ease=="string"&&Li(e.ease)&&(e.ease=bs[e.ease])}const Ye=10;class Ki extends ys{constructor(t){Ni(t),ls(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Et({...o,autoplay:!1}),c=Math.max(Ye,O.now()-this.startTime),u=Y(0,Ye,c-Ye);n.setWithVelocity(a.sample(Math.max(0,c-u)).value,a.sample(c).value,u),a.stop()}}const ln=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(L.test(e)||e==="0")&&!e.startsWith("url("));function $i(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 _i(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ln(r,t),a=ln(i,t);return we(o===a,`You are trying to animate ${t} from "${r}" to "${i}". "${o?i:r}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:$i(e)||(n==="spring"||gs(n))&&s}function ht(e){e.duration=0,e.type="keyframes"}const Wi=new Set(["opacity","clipPath","filter","transform"]),Hi=Ln(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Gi(e){var l;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=e;if(!(((l=t==null?void 0:t.owner)==null?void 0:l.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Hi()&&n&&Wi.has(n)&&(n!=="transform"||!u)&&!c&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const qi=40;class Ui extends kt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...d}){var m;super(),this.stop=()=>{var y,b;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=O.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:o,name:c,motionValue:u,element:l,...d},h=(l==null?void 0:l.KeyframeResolver)||It;this.keyframeResolver=new h(a,(y,b,g)=>this.onKeyframesResolved(y,b,f,!g),c,u,l),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,s,r){var b,g;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=O.now(),_i(t,i,o,a)||((W.instantAnimations||!c)&&(l==null||l(Dt(t,s,n))),t[0]=t[t.length-1],ht(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>qi?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!u&&Gi(f),m=(g=(b=f.motionValue)==null?void 0:b.owner)==null?void 0:g.current,y=h?new Ki({...f,element:m}):new Et(f);y.finished.then(()=>{this.notifyFinished()}).catch(ue),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Di()),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 vs(e,t,n,s=0,r=1){const i=Array.from(e).sort((u,l)=>u.sortNodePosition(l)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(i,o):r===1?i*s:a-i*s}const zi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yi(e){const t=zi.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const Xi=4;function xs(e,t,n=1){ne(n<=Xi,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=Yi(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Bn(o)?parseFloat(o):o}return At(r)?xs(r,t,n+1):r}const Qi={type:"spring",stiffness:500,damping:25,restSpeed:10},Zi=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ji={type:"keyframes",duration:.8},eo={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},to=(e,{keyframes:t})=>t.length>2?Ji:de.has(e)?e.startsWith("scale")?Zi(t[1]):Qi:eo,no=e=>e!==null;function so(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(no),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[i]}function Ts(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function ws(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Ts(n,e):n}function ro({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:c,elapsed:u,...l}){return!!Object.keys(l).length}const io=(e,t,n,s={},r,i)=>o=>{const a=ws(s,e)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-_(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};ro(a)||Object.assign(l,to(e,l)),l.duration&&(l.duration=_(l.duration)),l.repeatDelay&&(l.repeatDelay=_(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let d=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(ht(l),l.delay===0&&(d=!0)),(W.instantAnimations||W.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(d=!0,ht(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const f=so(l.keyframes,a);if(f!==void 0){N.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new Et(l):new Ui(l)};function fn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Ot(e,t,n,s){if(typeof t=="function"){const[r,i]=fn(s);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=fn(s);t=t(n!==void 0?n:e.custom,r,i)}return t}function ae(e,t,n){const s=e.getProps();return Ot(s,t,n!==void 0?n:s.custom,e)}const Ss=new Set(["width","height","top","left","right","bottom",...fe]),dn=30,oo=e=>!isNaN(parseFloat(e));class ao{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var i;const r=O.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=O.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=oo(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&_n(!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 Kn);const s=this.events[t].add(n);return t==="change"?()=>{s(),N.read(()=>{this.events.change.getSize()||this.stop()})}:s}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,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}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=O.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>dn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,dn);return $n(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 Be(e,t){return new ao(e,t)}const pt=e=>Array.isArray(e);function co(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Be(n))}function uo(e){return pt(e)?e[e.length-1]||0:e}function lo(e,t){const n=ae(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=uo(i[o]);co(e,o,a)}}const I=e=>!!(e&&e.getVelocity);function fo(e){return!!(I(e)&&e.add)}function ho(e,t){const n=e.getValue("willChange");if(fo(n))return n.add(t);if(!n&&W.WillChange){const s=new W.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Bt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const po="framerAppearId",Vs="data-"+Bt(po);function mo(e){return e.props[Vs]}function go({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Cs(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i,transitionEnd:o,...a}=t;const c=e.getDefaultTransition();i=i?Ts(i,c):c;const u=i==null?void 0:i.reduceMotion;s&&(i=s);const l=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in a){const h=e.getValue(f,e.latestValues[f]??null),m=a[f];if(m===void 0||d&&go(d,f))continue;const y={delay:n,...ws(i||{},f)},b=h.get();if(b!==void 0&&!h.isAnimating&&!Array.isArray(m)&&m===b&&!y.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const C=mo(e);if(C){const S=window.MotionHandoffAnimation(C,f,N);S!==null&&(y.startTime=S,g=!0)}}ho(e,f);const w=u??e.shouldReduceMotion;h.start(io(f,h,m,w&&Ss.has(f)?{type:!1}:y,e,g));const T=h.animation;T&&l.push(T)}if(o){const f=()=>N.update(()=>{o&&lo(e,o)});l.length?Promise.all(l).then(f):f()}return l}function mt(e,t,n={}){var c;const s=ae(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(Cs(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:l=0,staggerChildren:d,staggerDirection:f}=r;return yo(e,t,u,l,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[u,l]=a==="beforeChildren"?[i,o]:[o,i];return u().then(()=>l())}else return Promise.all([i(),o(n.delay)])}function yo(e,t,n=0,s=0,r=0,i=1,o){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(mt(c,t,{...o,delay:n+(typeof s=="function"?0:s)+vs(e.variantChildren,c,s,r,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function bo(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(i=>mt(e,i,n));s=Promise.all(r)}else if(typeof t=="string")s=mt(e,t,n);else{const r=typeof t=="function"?ae(e,t,n.custom):t;s=Promise.all(Cs(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const vo={test:e=>e==="auto",parse:e=>e},As=e=>t=>t.test(e),Ms=[le,v,oe,G,Wr,_r,vo],hn=e=>Ms.find(As(e));function xo(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jn(e):!0}const To=new Set(["brightness","contrast","saturate","opacity"]);function wo(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Mt)||[];if(!s)return e;const r=n.replace(s,"");let i=To.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const So=/\b([a-z-]*)\(.*?\)/gu,gt={...L,getAnimatableNone:e=>{const t=e.match(So);return t?t.map(wo).join(" "):e}},yt={...L,getAnimatableNone:e=>{const t=L.parse(e);return L.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},pn={...le,transform:Math.round},Vo={rotate:G,rotateX:G,rotateY:G,rotateZ:G,scale:Re,scaleX:Re,scaleY:Re,scaleZ:Re,skew:G,skewX:G,skewY:G,distance:v,translateX:v,translateY:v,translateZ:v,x:v,y:v,z:v,perspective:v,transformPerspective:v,opacity:ve,originX:Jt,originY:Jt,originZ:v},jt={borderWidth:v,borderTopWidth:v,borderRightWidth:v,borderBottomWidth:v,borderLeftWidth:v,borderRadius:v,borderTopLeftRadius:v,borderTopRightRadius:v,borderBottomRightRadius:v,borderBottomLeftRadius:v,width:v,maxWidth:v,height:v,maxHeight:v,top:v,right:v,bottom:v,left:v,inset:v,insetBlock:v,insetBlockStart:v,insetBlockEnd:v,insetInline:v,insetInlineStart:v,insetInlineEnd:v,padding:v,paddingTop:v,paddingRight:v,paddingBottom:v,paddingLeft:v,paddingBlock:v,paddingBlockStart:v,paddingBlockEnd:v,paddingInline:v,paddingInlineStart:v,paddingInlineEnd:v,margin:v,marginTop:v,marginRight:v,marginBottom:v,marginLeft:v,marginBlock:v,marginBlockStart:v,marginBlockEnd:v,marginInline:v,marginInlineStart:v,marginInlineEnd:v,fontSize:v,backgroundPositionX:v,backgroundPositionY:v,...Vo,zIndex:pn,fillOpacity:ve,strokeOpacity:ve,numOctaves:pn},Co={...jt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:gt,WebkitFilter:gt,mask:yt,WebkitMask:yt},Ps=e=>Co[e],Ao=new Set([gt,yt]);function Rs(e,t){let n=Ps(e);return Ao.has(n)||(n=L),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Mo=new Set(["auto","none","0"]);function Po(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!Mo.has(i)&&xe(i).values.length&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]=Rs(n,r)}class Ro extends It{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let d=t[l];if(typeof d=="string"&&(d=d.trim(),At(d))){const f=xs(d,n.current);f!==void 0&&(t[l]=f),l===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Ss.has(s)||t.length!==2)return;const[r,i]=t,o=hn(r),a=hn(i),c=Zt(r),u=Zt(i);if(c!==u&&q[s]){this.needsMeasurement=!0;return}if(o!==a)if(cn(o)&&cn(a))for(let l=0;l<t.length;l++){const d=t[l];typeof d=="string"&&(t[l]=parseFloat(d))}else q[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||xo(t[r]))&&s.push(r);s.length&&Po(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=q[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=q[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const Fo=new Set(["opacity","clipPath","filter","transform"]);function Do(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}const Fs=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ko(e){return Sr(e)&&"offsetHeight"in e}const{schedule:Eo}=Zn(queueMicrotask,!1),Io={y:!1};function Oo(){return Io.y}function Ds(e,t){const n=Do(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function Bo(e){return!(e.pointerType==="touch"||Oo())}function jo(e,t,n={}){const[s,r,i]=Ds(e,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",m)},d=b=>{u&&(u(b),u=void 0),l()},f=b=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,d(b))},h=()=>{a=!0,window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",f,r)},m=b=>{if(b.pointerType!=="touch"){if(a){c=!0;return}d(b)}},y=b=>{if(!Bo(b))return;c=!1;const g=t(o,b);typeof g=="function"&&(u=g,o.addEventListener("pointerleave",m,r))};o.addEventListener("pointerenter",y,r),o.addEventListener("pointerdown",h,r)}),i}const ks=(e,t)=>t?e===t?!0:ks(e,t.parentElement):!1,Lo=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,No=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ko(e){return No.has(e.tagName)||e.isContentEditable===!0}const De=new WeakSet;function mn(e){return t=>{t.key==="Enter"&&e(t)}}function Xe(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const $o=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=mn(()=>{if(De.has(n))return;Xe(n,"down");const r=mn(()=>{Xe(n,"up")}),i=()=>Xe(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function gn(e){return Lo(e)&&!0}const yn=new WeakSet;function _o(e,t,n={}){const[s,r,i]=Ds(e,n),o=a=>{const c=a.currentTarget;if(!gn(a)||yn.has(a))return;De.add(c),n.stopPropagation&&yn.add(a);const u=t(c,a),l=(h,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),De.has(c)&&De.delete(c),gn(h)&&typeof u=="function"&&u(h,{success:m})},d=h=>{l(h,c===window||c===document||n.useGlobalTarget||ks(c,h.target))},f=h=>{l(h,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),ko(a)&&(a.addEventListener("focus",u=>$o(u,r)),!Ko(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}const Wo=[...Ms,R,L],Ho=e=>Wo.find(As(e)),bn=()=>({min:0,max:0}),Es=()=>({x:bn(),y:bn()}),Go=new WeakMap;function $e(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Te(e){return typeof e=="string"||Array.isArray(e)}const Lt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Nt=["initial",...Lt];function _e(e){return $e(e.animate)||Nt.some(t=>Te(e[t]))}function Is(e){return!!(_e(e)||e.variants)}function qo(e,t,n){for(const s in t){const r=t[s],i=n[s];if(I(r))e.addValue(s,r);else if(I(i))e.addValue(s,Be(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,Be(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const bt={current:null},Os={current:!1},Uo=typeof window<"u";function zo(){if(Os.current=!0,!!Uo)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>bt.current=e.matches;e.addEventListener("change",t),t()}else bt.current=!1}const vn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let je={};function Bs(e){je=e}function Yo(){return je}class Xo{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:o,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=It,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=O.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,N.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=_e(n),this.isVariantNode=Is(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 m=f[h];u[h]!==void 0&&I(m)&&m.set(u[h])}}mount(t){var n,s;if(this.hasBeenMounted)for(const r in this.initialValues)(n=this.values.get(r))==null||n.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=t,Go.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((r,i)=>this.bindToMotionValue(i,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Os.current||zo(),this.shouldReduceMotion=bt.current),process.env.NODE_ENV!=="production"&&_n(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,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),tt(this.notifyUpdate),tt(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 s=this.features[n];s&&(s.unmount(),s.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&&Fo.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,d=new ys({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:_(l)}),f=o(d);this.valueSubscriptions.set(t,()=>{f(),d.cancel()});return}const s=de.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&N.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i&&i(),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 je){const n=je[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Es()}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 s=0;s<vn.length;s++){const r=vn[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=t[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=qo(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 s=this.values.get(t);n!==s&&(s&&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 s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Be(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Bn(s)||jn(s))?s=parseFloat(s):!Ho(s)&&L.test(n)&&(s=Rs(t,n)),this.setBaseTarget(t,I(s)?s.get():s)),I(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Ot(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!I(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Eo.render(this.render)}}class js extends Xo{constructor(){super(...arguments),this.KeyframeResolver=Ro}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class he{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Qo({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Zo(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Jo(e,t){return Qo(Zo(e.getBoundingClientRect(),t))}const ea={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ta=fe.length;function na(e,t,n){let s="",r=!0;for(let i=0;i<ta;i++){const o=fe[i],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=Fs(a,jt[o]);if(!c){r=!1;const l=ea[o]||o;s+=`${l}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Kt(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const u=t[c];if(de.has(c)){o=!0;continue}else if(es(c)){r[c]=u;continue}else{const l=Fs(u,jt[c]);c.startsWith("origin")?(a=!0,i[c]=l):s[c]=l}}if(t.transform||(o||n?s.transform=na(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=i;s.transformOrigin=`${c} ${u} ${l}`}}function Ls(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r==null||r.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function xn(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const pe={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(v.test(e))e=parseFloat(e);else return e;const n=xn(e,t.target.x),s=xn(e,t.target.y);return`${n}% ${s}%`}},sa={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=L.parse(e);if(r.length>5)return s;const i=L.createTransformer(e),o=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=a,r[1+o]/=c;const u=Ce(a,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),i(r)}},ra={borderRadius:{...pe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pe,borderTopRightRadius:pe,borderBottomLeftRadius:pe,borderBottomRightRadius:pe,boxShadow:sa};function Ns(e,{layout:t,layoutId:n}){return de.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ra[e]||e==="opacity")}function $t(e,t,n){var o;const s=e.style,r=t==null?void 0:t.style,i={};if(!s)return i;for(const a in s)(I(s[a])||r&&I(r[a])||Ns(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=s[a]);return i}function ia(e){return window.getComputedStyle(e)}class oa extends js{constructor(){super(...arguments),this.type="html",this.renderInstance=Ls}readValueFromInstance(t,n){var s;if(de.has(n))return(s=this.projection)!=null&&s.isProjecting?ct(n):Ai(t,n);{const r=ia(t),i=(es(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Jo(t,n)}build(t,n,s){Kt(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return $t(t,n,s)}}const aa={offset:"stroke-dashoffset",array:"stroke-dasharray"},ca={offset:"strokeDashoffset",array:"strokeDasharray"};function ua(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?aa:ca;e[i.offset]=`${-s}`,e[i.array]=`${t} ${n}`}const la=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ks(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},c,u,l){if(Kt(e,a,u),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=(l==null?void 0:l.transformBox)??"fill-box",delete d.transformBox);for(const h of la)d[h]!==void 0&&(f[h]=d[h],delete d[h]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&ua(d,r,i,o,!1)}const $s=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"]),_s=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fa(e,t,n,s){Ls(e,t,void 0,s);for(const r in t.attrs)e.setAttribute($s.has(r)?r:Bt(r),t.attrs[r])}function Ws(e,t,n){const s=$t(e,t,n);for(const r in e)if(I(e[r])||I(t[r])){const i=fe.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}class da extends js{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Es}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(de.has(n)){const s=Ps(n);return s&&s.default||0}return n=$s.has(n)?n:Bt(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ws(t,n,s)}build(t,n,s){Ks(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){fa(t,n,s,r)}mount(t){this.isSVGTag=_s(t.tagName),super.mount(t)}}const ha=Nt.length;function Hs(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Hs(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ha;n++){const s=Nt[n],r=e.props[s];(Te(r)||r===!1)&&(t[s]=r)}return t}function Gs(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const pa=[...Lt].reverse(),ma=Lt.length;function ga(e){return t=>Promise.all(t.map(({animation:n,options:s})=>bo(e,n,s)))}function ya(e){let t=ga(e),n=Tn(),s=!0;const r=c=>(u,l)=>{var f;const d=ae(e,l,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:m,...y}=d;u={...u,...y,...m}}return u};function i(c){t=c(e)}function o(c){const{props:u}=e,l=Hs(e.parent)||{},d=[],f=new Set;let h={},m=1/0;for(let b=0;b<ma;b++){const g=pa[b],w=n[g],T=u[g]!==void 0?u[g]:l[g],C=Te(T),S=g===c?w.isActive:null;S===!1&&(m=b);let A=T===l[g]&&T!==u[g]&&C;if(A&&s&&e.manuallyAnimateOnMount&&(A=!1),w.protectedKeys={...h},!w.isActive&&S===null||!T&&!w.prevProp||$e(T)||typeof T=="boolean")continue;if(g==="exit"&&w.isActive&&S!==!0){w.prevResolvedValues&&(h={...h,...w.prevResolvedValues});continue}const P=ba(w.prevProp,T);let V=P||g===c&&w.isActive&&!A&&C||b>m&&C,F=!1;const D=Array.isArray(T)?T:[T];let H=D.reduce(r(g),{});S===!1&&(H={});const{prevResolvedValues:Ae={}}=w,He={...Ae,...H},Me=k=>{V=!0,f.has(k)&&(F=!0,f.delete(k)),w.needsAnimating[k]=!0;const B=e.getValue(k);B&&(B.liveStyle=!1)};for(const k in He){const B=H[k],X=Ae[k];if(h.hasOwnProperty(k))continue;let se=!1;pt(B)&&pt(X)?se=!Gs(B,X):se=B!==X,se?B!=null?Me(k):f.add(k):B!==void 0&&f.has(k)?Me(k):w.protectedKeys[k]=!0}w.prevProp=T,w.prevResolvedValues=H,w.isActive&&(h={...h,...H}),s&&e.blockInitialAnimation&&(V=!1);const Ut=A&&P;V&&(!Ut||F)&&d.push(...D.map(k=>{const B={type:g};if(typeof k=="string"&&s&&!Ut&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,se=ae(X,k);if(X.enteringChildren&&se){const{delayChildren:or}=se.transition||{};B.delay=vs(X.enteringChildren,e,or)}}return{animation:k,options:B}}))}if(f.size){const b={};if(typeof u.initial!="boolean"){const g=ae(e,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(b.transition=g.transition)}f.forEach(g=>{const w=e.getBaseTarget(g),T=e.getValue(g);T&&(T.liveStyle=!0),b[g]=w??null}),d.push({animation:b})}let y=!!d.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),s=!1,y?t(d):Promise.resolve()}function a(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,u)}),n[c].isActive=u;const l=o(c);for(const f in n)n[f].protectedKeys={};return l}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Tn()}}}function ba(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Gs(t,e):!1}function Q(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tn(){return{animate:Q(!0),whileInView:Q(),whileHover:Q(),whileTap:Q(),whileDrag:Q(),whileFocus:Q(),exit:Q()}}function wn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function va(e){return I(e)?e.get():e}const qs=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),_t=p.createContext({strict:!1}),Sn={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 Vn=!1;function xa(){if(Vn)return;const e={};for(const t in Sn)e[t]={isEnabled:n=>Sn[t].some(s=>!!n[s])};Bs(e),Vn=!0}function Us(){return xa(),Yo()}function Cn(e){const t=Us();for(const n in e)t[n]={...t[n],...e[n]};Bs(t)}function Ta({children:e,features:t,strict:n=!1}){const[,s]=p.useState(!Qe(t)),r=p.useRef(void 0);if(!Qe(t)){const{renderer:i,...o}=t;r.current=i,Cn(o)}return p.useEffect(()=>{Qe(t)&&t().then(({renderer:i,...o})=>{Cn(o),r.current=i,s(!0)})},[]),x.jsx(_t.Provider,{value:{renderer:r.current,strict:n},children:e})}function Qe(e){return typeof e=="function"}const wa=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 Le(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wa.has(e)}let zs=e=>!Le(e);function Sa(e){typeof e=="function"&&(zs=t=>t.startsWith("on")?!Le(t):e(t))}try{Sa(require("@emotion/is-prop-valid").default)}catch{}function Va(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(zs(r)||n===!0&&Le(r)||!t&&!Le(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const We=p.createContext({});function Ca(e,t){if(_e(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Te(n)?n:void 0,animate:Te(s)?s:void 0}}return e.inherit!==!1?t:{}}function Aa(e){const{initial:t,animate:n}=Ca(e,p.useContext(We));return p.useMemo(()=>({initial:t,animate:n}),[An(t),An(n)])}function An(e){return Array.isArray(e)?e.join(" "):e}const Wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ys(e,t,n){for(const s in t)!I(t[s])&&!Ns(s,n)&&(e[s]=t[s])}function Ma({transformTemplate:e},t){return p.useMemo(()=>{const n=Wt();return Kt(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Pa(e,t){const n=e.style||{},s={};return Ys(s,n,e),Object.assign(s,Ma(e,t)),s}function Ra(e,t){const n={},s=Pa(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,n}const Xs=()=>({...Wt(),attrs:{}});function Fa(e,t,n,s){const r=p.useMemo(()=>{const i=Xs();return Ks(i,t,_s(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ys(i,e.style,e),r.style={...i,...r.style}}return r}const Da=["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 Ht(e){return typeof e!="string"||e.includes("-")?!1:!!(Da.indexOf(e)>-1||/[A-Z]/u.test(e))}function ka(e,t,n,{latestValues:s},r,i=!1,o){const c=(o??Ht(e)?Fa:Ra)(t,s,r,e),u=Va(t,typeof e=="string",i),l=e!==p.Fragment?{...u,...c,ref:n}:{},{children:d}=t,f=p.useMemo(()=>I(d)?d.get():d,[d]);return p.createElement(e,{...l,children:f})}function Ea({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:Ia(n,s,r,e),renderState:t()}}function Ia(e,t,n,s){const r={},i=s(e,{});for(const f in i)r[f]=va(i[f]);let{initial:o,animate:a}=e;const c=_e(e),u=Is(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const d=l?a:o;if(d&&typeof d!="boolean"&&!$e(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const m=Ot(e,f[h]);if(m){const{transitionEnd:y,transition:b,...g}=m;for(const w in g){let T=g[w];if(Array.isArray(T)){const C=l?T.length-1:0;T=T[C]}T!==null&&(r[w]=T)}for(const w in y)r[w]=y[w]}}}return r}const Qs=e=>(t,n)=>{const s=p.useContext(We),r=p.useContext(On),i=()=>Ea(e,t,s,r);return n?i():vr(i)},Oa=Qs({scrapeMotionValuesFromProps:$t,createRenderState:Wt}),Ba=Qs({scrapeMotionValuesFromProps:Ws,createRenderState:Xs}),ja=Symbol.for("motionComponentSymbol");function La(e,t,n){const s=p.useRef(n);p.useInsertionEffect(()=>{s.current=n});const r=p.useRef(null);return p.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=s.current;if(typeof o=="function")if(i){const c=o(i);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(i);else o&&(o.current=i)},[t])}const Na=p.createContext({});function Ka(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function $a(e,t,n,s,r,i){var T,C;const{visualElement:o}=p.useContext(We),a=p.useContext(_t),c=p.useContext(On),u=p.useContext(qs),l=u.reducedMotion,d=u.skipAnimations,f=p.useRef(null),h=p.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:d,isSVG:i}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,y=p.useContext(Na);m&&!m.projection&&r&&(m.type==="html"||m.type==="svg")&&_a(f.current,n,r,y);const b=p.useRef(!1);p.useInsertionEffect(()=>{m&&b.current&&m.update(n,c)});const g=n[Vs],w=p.useRef(!!g&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return xr(()=>{h.current=!0,m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),w.current&&m.animationState&&m.animationState.animateChanges())}),p.useEffect(()=>{m&&(!w.current&&m.animationState&&m.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,g)}),w.current=!1),m.enteringChildren=void 0)}),m}function _a(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:l}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Zs(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&Ka(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:l,layoutScroll:c,layoutRoot:u})}function Zs(e){if(e)return e.options.allowProjection!==!1?e.projection:Zs(e.parent)}function Wa(e,{forwardMotionProps:t=!1,type:n}={},s,r){const i=n?n==="svg":Ht(e),o=i?Ba:Oa;function a(u,l){let d;const f={...p.useContext(qs),...u,layoutId:Ha(u)},{isStatic:h}=f,m=Aa(u),y=o(u,h);if(!h&&In){Ga(f,s);const b=qa(f);d=b.MeasureLayout,m.visualElement=$a(e,y,f,r,b.ProjectionNode,i)}return x.jsxs(We.Provider,{value:m,children:[d&&m.visualElement?x.jsx(d,{visualElement:m.visualElement,...f}):null,ka(e,u,La(y,m.visualElement,l),y,h,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=p.forwardRef(a);return c[ja]=e,c}function Ha({layoutId:e}){const t=p.useContext(br).id;return t&&e!==void 0?t+"-"+e:e}function Ga(e,t){p.useContext(_t).strict,process.env.NODE_ENV}function qa(e){const t=Us(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(e)||s!=null&&s.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Ua=(e,t)=>t.isSVG??Ht(e)?new da(t):new oa(t,{allowProjection:e!==p.Fragment});class za extends he{constructor(t){super(t),t.animationState||(t.animationState=ya(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$e(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 Ya=0;class Xa extends he{constructor(){super(...arguments),this.id=Ya++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Qa={animation:{Feature:za},exit:{Feature:Xa}};function Js(e){return{point:{x:e.pageX,y:e.pageY}}}function Mn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&N.postRender(()=>i(t,Js(t)))}class Za extends he{mount(){const{current:t}=this.node;t&&(this.unmount=jo(t,(n,s)=>(Mn(this.node,s,"Start"),r=>Mn(this.node,r,"End"))))}unmount(){}}class Ja extends he{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=Ke(wn(this.node.current,"focus",()=>this.onFocus()),wn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Pn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&N.postRender(()=>i(t,Js(t)))}class ec extends he{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=_o(t,(r,i)=>(Pn(this.node,i,"Start"),(o,{success:a})=>Pn(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const vt=new WeakMap,Ze=new WeakMap,tc=e=>{const t=vt.get(e.target);t&&t(e)},nc=e=>{e.forEach(tc)};function sc({root:e,...t}){const n=e||document;Ze.has(n)||Ze.set(n,{});const s=Ze.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(nc,{root:e,...t})),s[r]}function rc(e,t,n){const s=sc(t);return vt.set(e,n),s.observe(e),()=>{vt.delete(e),s.unobserve(e)}}const ic={some:0,all:1};class oc extends he{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:ic[r]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:l,onViewportLeave:d}=this.node.getProps(),f=u?l:d;f&&f(c)};return rc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ac(t,n))&&this.startObserver()}unmount(){}}function ac({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const cc={inView:{Feature:oc},tap:{Feature:ec},focus:{Feature:Ja},hover:{Feature:Za}},uc={renderer:Ua,...Qa,...cc};function er(e,t){return Wa(e,t)}const lc=er("div"),Gt=er("span"),fc=({icon:e=te.ChevronsUpDown,"aria-hidden":t=!0,...n})=>{const s=p.useContext(E);return x.jsx(ce.Button.Icon,{as:Gt,animate:{rotate:s.open?180:0},transition:{duration:.15,type:"spring",bounce:0},icon:e,"aria-hidden":t,...n})},dc=({tooltipProps:e,...t})=>{const n=p.useContext(E),s=()=>{var i,o;if(K(n.value)){const a=n.onValueChange;a==null||a([])}if(z(n.value)){const a=n.onValueChange;a==null||a(void 0)}(o=(i=n.triggerRef)==null?void 0:i.current)==null||o.focus()};return p.useMemo(()=>{var i;if(z(n.value))return n.clearable&&n.value;if(K(n.value))return n.clearable&&((i=n.value)==null?void 0:i.length)>0},[n.clearable,n.value])?x.jsx(dr.Tooltip,{label:"Clear field",...e,children:x.jsx(ce.Button,{type:"button",icon:{icon:te.X,alt:"Clear field"},size:"0",variant:"ghost",onClick:i=>{n.value&&(i.stopPropagation(),s())},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),i.preventDefault(),s())},"data-tgph-combobox-clear":!0,style:{marginTop:"calc(-1 * var(--tgph-spacing-1)",marginBottom:"calc(-1 * var(--tgph-spacing-1)"},...t})}):null},tr=({children:e,...t})=>{const n=p.useContext(E),s=p.useMemo(()=>{var a;if(!z(n.value))return;const r=Je(n.value,n.options,n.legacyBehavior),i=(r==null?void 0:r.label)||(r==null?void 0:r.value)||n.placeholder,o=n.legacyBehavior&&((a=n==null?void 0:n.value)==null?void 0:a.label);return o||i},[n.value,n.options,n.legacyBehavior,n.placeholder]);return x.jsx(Dn.TooltipIfTruncated,{children:x.jsx(ce.Button.Text,{color:n.value?"default":"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||s})})},xt=({children:e,...t})=>{const n=p.useContext(E);return x.jsx(Dn.TooltipIfTruncated,{children:x.jsx(ce.Button.Text,{color:"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||n.placeholder})})},nr=({children:e})=>{const t=p.useContext(E);if(!K(t.value))return null;const n=t.layout||"truncate",r=(t.value.length-2).toString().split("");return x.jsxs(U.Stack,{gap:"0_5",w:"full",wrap:n==="wrap"?"wrap":"nowrap",align:"center",style:{position:"relative",flexGrow:1},children:[e,n==="truncate"&&t.value.length>2&&x.jsx(U.Stack,{as:lc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},h:"full",pr:"1",pl:"8",align:"center","aria-label":`${t.value.length-2} more selected`,position:"absolute",right:"0",style:{backgroundImage:"linear-gradient(to left, var(--tgph-surface-1) 0 60%, transparent 90% 100%)"},children:x.jsxs(wt.Text,{as:"span",size:"1",style:{whiteSpace:"nowrap"},children:["+",r.map(i=>x.jsx(U.Box,{as:Gt,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},w:"2",display:"inline-block",children:i},i))," ","more"]})})]})},qt=p.createContext({value:""}),hc=({value:e,children:t,...n})=>x.jsx(qt.Provider,{value:{value:e},children:x.jsx(St.Tag.Root,{as:Gt,initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.1,type:"spring",bounce:0},size:"1",maxH:"5",rounded:"1",layout:"position",...n,children:t})}),pc=({children:e,...t})=>{const n=p.useContext(E),s=p.useContext(qt),r=p.useMemo(()=>{const i=n.options.find(c=>c.value===s.value);if(i)return i.label||i.value;if(!n.value)return;const a=n.value.find(c=>$(c,n.legacyBehavior)===s.value);if(a)return a},[n.options,n.value,s.value,n.legacyBehavior]);return x.jsx(St.Tag.Text,{...t,children:e||r})},mc=({children:e,...t})=>{const n=p.useContext(E),s=p.useContext(qt);return x.jsx(St.Tag.Button,{icon:{icon:te.X,alt:`Remove ${s.value}`},height:"full",onClick:r=>{if(!n.onValueChange)return;const i=n.onValueChange,a=n.value.filter(c=>$(c,n.legacyBehavior)!==s.value);i==null||i(a),r.stopPropagation(),r.preventDefault()},"data-tgph-combobox-tag-button":!0,...t,children:e})},gc=({value:e,children:t,...n})=>x.jsxs(be.Root,{value:e,...n,children:[x.jsx(be.Text,{children:t}),x.jsx(be.Button,{})]}),yc=e=>x.jsx(U.Stack,{align:"center",gap:"1",...e}),bc=()=>{const e=p.useContext(E);if(e.value&&K(e.value)){const t=e.layout||"truncate";return e.value.length===0?x.jsx(xt,{}):x.jsx(Ta,{features:uc,children:x.jsx(nr,{children:e.value.map((n,s)=>{const r=$(n,e.legacyBehavior);if(r&&(t==="truncate"&&s<=1||t==="wrap"))return x.jsx(fr.RefToTgphRef,{children:x.jsx(be.Default,{value:r})},r)})})})}if(e&&z(e.value))return e.value?x.jsx(tr,{}):x.jsx(xt,{})},be={Root:hc,Text:pc,Button:mc,Default:gc},ge={TriggerIndicator:fc,TriggerClear:dc,TriggerText:tr,TriggerPlaceholder:xt,TriggerTagsContainer:nr,TriggerActionsContainer:yc,TriggerTag:be,TriggerValue:bc},vc=["ArrowDown","PageUp","Home"],xc=["ArrowUp","PageDown","End"],sr=["Enter"," "],E=p.createContext({value:void 0,onValueChange:()=>{},contentId:"",triggerId:"",open:!1,setOpen:()=>{},onOpenToggle:()=>{},clearable:!1,disabled:!1,options:[],legacyBehavior:!1}),Tc=({modal:e=!0,closeOnSelect:t=!0,clearable:n=!1,disabled:s=!1,legacyBehavior:r=!1,open:i,onOpenChange:o,defaultOpen:a,value:c,defaultValue:u,onValueChange:l,errored:d,placeholder:f,layout:h,defaultScrollToValue:m,children:y,...b})=>{const g=p.useId(),w=p.useId(),T=p.useRef(null),C=p.useRef(null),S=p.useRef(null),A=p.useMemo(()=>gr(y),[y]),[P,V]=p.useState(""),[F=!1,D]=zt.useControllableState({prop:i,defaultProp:a??!1,onChange:o}),[H,Ae]=zt.useControllableState({prop:c,defaultProp:u,onChange:l}),He=p.useCallback(()=>{D(Me=>!Me)},[D]);return p.useEffect(()=>{F||V("")},[F]),x.jsx(E.Provider,{value:{contentId:g,triggerId:w,value:H,onValueChange:Ae,placeholder:f,open:F,setOpen:D,onOpenToggle:He,closeOnSelect:t,clearable:n,disabled:s,searchQuery:P,setSearchQuery:V,triggerRef:T,searchRef:C,contentRef:S,errored:d,layout:h,options:A,legacyBehavior:r,defaultScrollToValue:m},children:x.jsx(Ne.Menu.Root,{open:F,onOpenChange:D,modal:e,...b,children:y})})},wc=({size:e="1",children:t,...n})=>{const s=p.useContext(E),r=K(s.value)&&s.value.length>0,i=p.useMemo(()=>{if(s.value){if(z(s.value))return Je(s.value,s.options,s.legacyBehavior);if(K(s.value))return s.value.map(a=>Je(a,s.options,s.legacyBehavior))}},[s.value,s.options,s.legacyBehavior]),o=p.useCallback(()=>i?z(i)?(i==null?void 0:i.label)||(i==null?void 0:i.value)||s.placeholder:K(i)&&i.map(a=>(a==null?void 0:a.label)||(a==null?void 0:a.value)).join(", ")||s.placeholder:s.placeholder,[i,s.placeholder]);return x.jsx(Ne.Menu.Trigger,{...n,asChild:!0,onClick:a=>{var c,u;a.preventDefault(),s.onOpenToggle(),(u=(c=s.triggerRef)==null?void 0:c.current)==null||u.focus()},onKeyDown:a=>{var c;if(a.target===((c=s.triggerRef)==null?void 0:c.current)){if(a.key==="Tab"){a.stopPropagation();return}if(a.key==="ArrowDown"||sr.includes(a.key)){a.stopPropagation(),a.preventDefault(),s.onOpenToggle();return}}},tgphRef:s.triggerRef,children:x.jsx(ce.Button.Root,{id:s.triggerId,type:"button",bg:"surface-3",variant:"outline",align:"center",minH:mr[e],h:"full",w:"full",py:"0_5",pr:"1_5",pl:r?"0_5":"1_5",size:e,color:s.errored?"red":"gray",justify:"space-between",role:"combobox","aria-label":o(),"aria-controls":s.contentId,"aria-expanded":s.open,"aria-haspopup":"listbox","data-tgph-combobox-trigger":!0,"data-tgph-combobox-trigger-open":s.open,disabled:s.disabled,...n,children:t?typeof t=="function"?t({value:i}):t:x.jsxs(x.Fragment,{children:[x.jsx(ge.TriggerValue,{}),x.jsxs(ge.TriggerActionsContainer,{children:[x.jsx(ge.TriggerClear,{}),x.jsx(ge.TriggerIndicator,{})]})]})})})},Sc=({style:e,children:t,tgphRef:n,...s})=>{const r=p.useContext(E),i=p.useRef(!1),o=Tt.useComposedRefs(n,r.contentRef),a=p.useRef(null),[c,u]=p.useState(0),[l,d]=p.useState(!1),f=p.useCallback(h=>{const m=h==null?void 0:h.getBoundingClientRect();m&&u(m.height),l||d(!0)},[l]);return p.useEffect(()=>{const h=new ResizeObserver(m=>{for(const y of m){const b=y.target;f(b)}});return a.current&&l&&h.observe(a.current),()=>h.disconnect()},[l,f]),p.useEffect(()=>{l===!0&&r.open===!1&&d(!1)},[r.open,l]),p.useEffect(()=>{let h;return r.open&&(h=setTimeout(()=>{f(a.current)},10)),()=>h&&clearTimeout(h)},[r.open,f]),x.jsx(hr.Root,{asChild:!0,children:x.jsx(ar.DismissableLayer,{onEscapeKeyDown:h=>{r.open&&(h.stopPropagation(),h.preventDefault(),r.setOpen(!1))},children:x.jsx(Ne.Menu.Content,{className:"tgph",mt:"1",onCloseAutoFocus:h=>{var m,y;i.current||(y=(m=r.triggerRef)==null?void 0:m.current)==null||y.focus(),i.current=!1,h.preventDefault()},bg:"surface-1",style:{width:"var(--tgph-combobox-trigger-width)",transition:"min-height 200ms ease-in-out",minHeight:c?`${c}px`:"0",...e,"--tgph-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--tgph-combobox-content-available-width":"var(--radix-popper-available-width)","--tgph-combobox-content-available-height":"calc(var(--radix-popper-available-height) - var(--tgph-spacing-8))","--tgph-combobox-trigger-width":"var(--radix-popper-anchor-width)","--tgph-combobox-trigger-height":"var(--radix-popper-anchor-height)"},...s,tgphRef:o,"data-tgph-combobox-content":!0,"data-tgph-combobox-content-open":r.open,role:void 0,"aria-orientation":void 0,onKeyDown:h=>{var y,b,g,w;h.stopPropagation();const m=(b=(y=r.contentRef)==null?void 0:y.current)==null?void 0:b.querySelectorAll("[data-tgph-combobox-option]");document.activeElement===(m==null?void 0:m[0])&&xc.includes(h.key)&&((w=(g=r.searchRef)==null?void 0:g.current)==null||w.focus())},children:x.jsx(U.Stack,{direction:"column",gap:"1",tgphRef:a,children:t})})})})},Vc=({tgphRef:e,...t})=>{const n=p.useContext(E),s=p.useRef(null),r=Tt.useComposedRefs(e,s);return p.useEffect(()=>{n.open&&s.current&&requestAnimationFrame(()=>{var a;const o=(z(n.value)?$(n.value,n.legacyBehavior):K(n.value)&&n.value.length>0?$(n.value[0],n.legacyBehavior):null)??n.defaultScrollToValue;if(o){const c=(a=s.current)==null?void 0:a.querySelectorAll("[data-tgph-combobox-option]"),u=Array.from(c||[]).find(l=>l.getAttribute("data-tgph-combobox-option-value")===o);u&&typeof u.scrollIntoView=="function"&&u.scrollIntoView({block:"center"})}})},[n.open,n.value,n.legacyBehavior,n.defaultScrollToValue]),x.jsx(U.Stack,{id:n.contentId,direction:"column",gap:"1",style:{overflowY:"auto","--max-height":t.maxHeight?void 0:"calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))"},role:"listbox",tgphRef:r,...t})},rr=({value:e,label:t,selected:n,onSelect:s,children:r,...i})=>{const o=p.useContext(E),[a,c]=p.useState(!1),u=o.value,l=!o.searchQuery||yr({children:t||r,value:e,searchQuery:o.searchQuery}),d=K(u)?u.some(h=>$(h,o.legacyBehavior)===e):$(u,o.legacyBehavior)===e,f=h=>{var y,b;h.stopPropagation();const m=h;if(!(m.key&&!sr.includes(m.key))){if(h.preventDefault(),o.closeOnSelect===!0&&o.setOpen(!1),s)return s(h);if(z(u)){const g=o.onValueChange;o.legacyBehavior===!0?g==null||g({value:e,label:t}):g==null||g(e)}else if(K(u)){const g=o.onValueChange,w=o.value,T=d?w.filter(C=>$(C,o.legacyBehavior)!==e):[...w,o.legacyBehavior===!0?{value:e,label:t}:e];g==null||g(T)}(b=(y=o.triggerRef)==null?void 0:y.current)==null||b.focus()}};if(l)return x.jsx(Ne.Menu.Button,{type:"button",onSelect:f,onKeyDown:f,selected:n===null?null:n??d,onFocus:()=>c(!0),onBlur:()=>c(!1),role:"option","aria-selected":d?"true":"false","data-tgph-combobox-option":!0,"data-tgph-combobox-option-focused":a,"data-tgph-combobox-option-value":e,"data-tgph-combobox-option-label":t,...i,children:t||r||e})},Cc=({label:e="Search",placeholder:t="Search",tgphRef:n,value:s,onValueChange:r,...i})=>{var d;const o=p.useId(),a=p.useContext(E),c=Tt.useComposedRefs(n,a.searchRef),u=s??a.searchQuery,l=r??a.setSearchQuery;return p.useEffect(()=>{var m;const f=y=>{var b,g;vc.includes(y.key)&&((g=(b=a.contentRef)==null?void 0:b.current)==null||g.focus({preventScroll:!0})),y.key==="Escape"&&a.setOpen(!1),y.stopPropagation()},h=(m=a.searchRef)==null?void 0:m.current;if(h)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f)}},[a]),x.jsxs(U.Box,{borderBottom:"px",px:"1",pb:"1",children:[x.jsx(pr.Root,{children:x.jsx(wt.Text,{as:"label",htmlFor:o,children:e})}),x.jsx(lr.Input,{id:o,variant:"ghost",placeholder:t,value:u,onChange:f=>{l(f.target.value)},LeadingComponent:x.jsx(Fn.Icon,{icon:te.Search,alt:"Search Icon"}),TrailingComponent:a!=null&&a.searchQuery&&((d=a==null?void 0:a.searchQuery)==null?void 0:d.length)>0?x.jsx(ce.Button,{variant:"ghost",color:"gray",icon:{icon:te.X,alt:"Clear Search Query"},onClick:()=>{var f;return(f=a.setSearchQuery)==null?void 0:f.call(a,"")}}):null,autoFocus:!0,"data-tgph-combobox-search":!0,"aria-controls":a.contentId,...i,tgphRef:c})]})},Ac=({icon:e={icon:te.Search,alt:"Search Icon"},message:t="No results found",children:n,...s})=>{const r=p.useContext(E),[i,o]=p.useState(!1);if(p.useEffect(()=>{var c,u;const a=(u=(c=r.contentRef)==null?void 0:c.current)==null?void 0:u.querySelectorAll("[data-tgph-combobox-option]");(a==null?void 0:a.length)===0?o(!0):o(!1)},[r.searchQuery,r.contentRef,n]),i)return x.jsxs(U.Stack,{gap:"1",align:"center",justify:"center",w:"full",my:"8","data-tgph-combobox-empty":!0,...s,children:[e===null?x.jsx(x.Fragment,{}):x.jsx(Fn.Icon,{...e}),t===null?x.jsx(x.Fragment,{}):x.jsx(wt.Text,{as:"span",children:t})]})},Mc=({leadingText:e="Create",values:t,onCreate:n,selected:s=null,legacyBehavior:r=!1,...i})=>{const o=p.useContext(E),a=p.useCallback(c=>!t||(t==null?void 0:t.length)===0?!1:t.some(u=>$(u,r)===c),[t,r]);if(o.searchQuery&&!a(o.searchQuery))return x.jsx(rr,{leadingIcon:{icon:te.Plus,"aria-hidden":!0},mx:"1",value:o.searchQuery,label:`${e} "${o.searchQuery}"`,selected:s,onSelect:()=>{var c;if(n&&o.searchQuery){const u=r===!0?{value:o.searchQuery}:o.searchQuery;n(u),(c=o.setSearchQuery)==null||c.call(o,"")}},...i})},ir={};Object.assign(ir,{Root:Tc,Trigger:wc,Content:Sc,Options:Vc,Option:rr,Search:Cc,Empty:Ac,Create:Mc,Primitives:ge});exports.Combobox=ir;
2
2
  //# sourceMappingURL=index.js.map