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