mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-06 20:55:18 +02:00
2 lines
108 KiB
JavaScript
2 lines
108 KiB
JavaScript
import{r as S,j as he}from"./index-CZOPZUyu.js";function Ji(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>t(...s);return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}function $t(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const fe=t=>Array.isArray(t);function bs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function St(t){return typeof t=="string"||Array.isArray(t)}function cn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Me(t,e,n,s){if(typeof e=="function"){const[i,r]=cn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=cn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function zt(t,e,n){const s=t.getProps();return Me(s,e,n!==void 0?n:s.custom,t)}const Re=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ee=["initial",...Re],Ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],st=new Set(Ct),$=t=>t*1e3,z=t=>t/1e3,Qi={type:"spring",stiffness:500,damping:25,restSpeed:10},to=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),eo={type:"keyframes",duration:.8},no={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},so=(t,{keyframes:e})=>e.length>2?eo:st.has(t)?t.startsWith("scale")?to(e[1]):Qi:no;function Le(t,e){return t?t[e]||t.default||t:void 0}const io={skipAnimations:!1,useManualTiming:!1},oo=t=>t!==null;function Ht(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(oo),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const j=t=>t;let de=j;function ro(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){r.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,c=!1,h=!1)=>{const d=h&&s?e:n;return c&&r.add(u),d.has(u)||d.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(u))}};return l}const Lt=["read","resolveKeyframes","update","preRender","render","postRender"],ao=40;function ws(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Lt.reduce((m,v)=>(m[v]=ro(r),m),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:f}=o,d=()=>{const m=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(m-i.timestamp,ao),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(d))},p=()=>{n=!0,s=!0,i.isProcessing||t(d)};return{schedule:Lt.reduce((m,v)=>{const T=o[v];return m[v]=(b,P=!1,w=!1)=>(n||p(),T.schedule(b,P,w)),m},{}),cancel:m=>{for(let v=0;v<Lt.length;v++)o[Lt[v]].cancel(m)},state:i,steps:o}}const{schedule:V,cancel:Y,state:E,steps:Jt}=ws(typeof requestAnimationFrame<"u"?requestAnimationFrame:j,!0),Vs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,lo=1e-7,uo=12;function co(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Vs(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>lo&&++a<uo);return o}function Dt(t,e,n,s){if(t===e&&n===s)return j;const i=r=>co(r,0,1,t,n);return r=>r===0||r===1?r:Vs(i(r),e,s)}const Cs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ds=t=>e=>1-t(1-e),Ms=Dt(.33,1.53,.69,.99),Fe=Ds(Ms),Rs=Cs(Fe),Es=t=>(t*=2)<1?.5*Fe(t):.5*(2-Math.pow(2,-10*(t-1))),Be=t=>1-Math.sin(Math.acos(t)),Ls=Ds(Be),Fs=Cs(Be),Bs=t=>/^0[^.\s]+$/u.test(t);function ho(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Bs(t):!0}const ks=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),js=t=>e=>typeof e=="string"&&e.startsWith(t),Is=js("--"),fo=js("var(--"),ke=t=>fo(t)?mo.test(t.split("/*")[0].trim()):!1,mo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,po=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function go(t){const e=po.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Os(t,e,n=1){const[s,i]=go(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return ks(o)?parseFloat(o):o}return ke(i)?Os(i,e,n+1):i}const H=(t,e,n)=>n>e?e:n<t?t:n,dt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},At={...dt,transform:t=>H(0,1,t)},Ft={...dt,default:1},Mt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),X=Mt("deg"),K=Mt("%"),x=Mt("px"),yo=Mt("vh"),vo=Mt("vw"),hn={...K,parse:t=>K.parse(t)/100,transform:t=>K.transform(t*100)},xo=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),fn=t=>t===dt||t===x,dn=(t,e)=>parseFloat(t.split(", ")[e]),mn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return dn(i[1],e);{const r=s.match(/^matrix\((.+)\)$/u);return r?dn(r[1],t):0}},To=new Set(["x","y","z"]),Po=Ct.filter(t=>!To.has(t));function So(t){const e=[];return Po.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ct={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:mn(4,13),y:mn(5,14)};ct.translateX=ct.x;ct.translateY=ct.y;const Ns=t=>e=>e.test(t),Ao={test:t=>t==="auto",parse:t=>t},Us=[dt,x,K,X,vo,yo,Ao],pn=t=>Us.find(Ns(t)),nt=new Set;let me=!1,pe=!1;function _s(){if(pe){const t=Array.from(nt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=So(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}pe=!1,me=!1,nt.forEach(t=>t.complete()),nt.clear()}function Ks(){nt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(pe=!0)})}function bo(){Ks(),_s()}class je{constructor(e,n,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(nt.add(this),me||(me=!0,V.read(Ks),V.resolveKeyframes(_s))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let r=0;r<e.length;r++)if(e[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),nt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,nt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const vt=t=>Math.round(t*1e5)/1e5,Ie=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wo(t){return t==null}const Vo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Oe=(t,e)=>n=>!!(typeof n=="string"&&Vo.test(n)&&n.startsWith(t)||e&&!wo(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ws=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Ie);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Co=t=>H(0,255,t),Qt={...dt,transform:t=>Math.round(Co(t))},et={test:Oe("rgb","red"),parse:Ws("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Qt.transform(t)+", "+Qt.transform(e)+", "+Qt.transform(n)+", "+vt(At.transform(s))+")"};function Do(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ge={test:Oe("#"),parse:Do,transform:et.transform},ot={test:Oe("hsl","hue"),parse:Ws("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+K.transform(vt(e))+", "+K.transform(vt(n))+", "+vt(At.transform(s))+")"},L={test:t=>et.test(t)||ge.test(t)||ot.test(t),parse:t=>et.test(t)?et.parse(t):ot.test(t)?ot.parse(t):ge.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?et.transform(t):ot.transform(t)},Mo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ro(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ie))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Mo))===null||n===void 0?void 0:n.length)||0)>0}const Gs="number",$s="color",Eo="var",Lo="var(",gn="${}",Fo=/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 bt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Fo,l=>(L.test(l)?(s.color.push(r),i.push($s),n.push(L.parse(l))):l.startsWith(Lo)?(s.var.push(r),i.push(Eo),n.push(l)):(s.number.push(r),i.push(Gs),n.push(parseFloat(l))),++r,gn)).split(gn);return{values:n,split:a,indexes:s,types:i}}function zs(t){return bt(t).values}function Hs(t){const{split:e,types:n}=bt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===Gs?r+=vt(i[o]):a===$s?r+=L.transform(i[o]):r+=i[o]}return r}}const Bo=t=>typeof t=="number"?0:t;function ko(t){const e=zs(t);return Hs(t)(e.map(Bo))}const q={test:Ro,parse:zs,createTransformer:Hs,getAnimatableNone:ko},jo=new Set(["brightness","contrast","saturate","opacity"]);function Io(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ie)||[];if(!s)return t;const i=n.replace(s,"");let r=jo.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Oo=/\b([a-z-]*)\(.*?\)/gu,ye={...q,getAnimatableNone:t=>{const e=t.match(Oo);return e?e.map(Io).join(" "):t}},No={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x},Uo={rotate:X,rotateX:X,rotateY:X,rotateZ:X,scale:Ft,scaleX:Ft,scaleY:Ft,scaleZ:Ft,skew:X,skewX:X,skewY:X,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:At,originX:hn,originY:hn,originZ:x},yn={...dt,transform:Math.round},Ne={...No,...Uo,zIndex:yn,size:x,fillOpacity:At,strokeOpacity:At,numOctaves:yn},_o={...Ne,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:ye,WebkitFilter:ye},Ue=t=>_o[t];function Xs(t,e){let n=Ue(t);return n!==ye&&(n=q),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ko=new Set(["auto","none","0"]);function Wo(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Ko.has(r)&&bt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Xs(n,i)}class Ys extends je{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),ke(u))){const c=Os(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!xo.has(s)||e.length!==2)return;const[i,r]=e,o=pn(i),a=pn(r);if(o!==a)if(fn(o)&&fn(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)ho(e[i])&&s.push(i);s.length&&Wo(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ct[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const r=n.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=ct[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function _e(t){return typeof t=="function"}let kt;function Go(){kt=void 0}const W={now:()=>(kt===void 0&&W.set(E.isProcessing||io.useManualTiming?E.timestamp:performance.now()),kt),set:t=>{kt=t,queueMicrotask(Go)}},vn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(q.test(t)||t==="0")&&!t.startsWith("url("));function $o(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function zo(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=vn(i,e),a=vn(r,e);return!o||!a?!1:$o(t)||(n==="spring"||_e(n))&&s}const Ho=40;class qs{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=W.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Ho?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&bo(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=W.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!zo(e,s,i,r))if(o)this.options.duration=0;else{l==null||l(Ht(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const ht=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},Zs=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=t(ht(0,i-1,r))+", ";return`linear(${s.substring(0,s.length-2)})`};function Js(t,e){return e?t*(1e3/e):0}const Xo=5;function Qs(t,e,n){const s=Math.max(e-Xo,0);return Js(n-t(s),e-s)}const D={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},te=.001;function Yo({duration:t=D.duration,bounce:e=D.bounce,velocity:n=D.velocity,mass:s=D.mass}){let i,r,o=1-e;o=H(D.minDamping,D.maxDamping,o),t=H(D.minDuration,D.maxDuration,z(t)),o<1?(i=u=>{const c=u*o,h=c*t,f=c-n,d=ve(u,o),p=Math.exp(-h);return te-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),g=ve(Math.pow(u,2),o);return(-i(u)+te>0?-1:1)*((f-d)*p)/g}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-te+c*h},r=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Zo(i,r,a);if(t=$(t),isNaN(l))return{stiffness:D.stiffness,damping:D.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const qo=12;function Zo(t,e,n){let s=n;for(let i=1;i<qo;i++)s=s-t(s)/e(s);return s}function ve(t,e){return t*Math.sqrt(1-e*e)}const xe=2e4;function ti(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<xe;)e+=n,s=t.next(e);return e>=xe?1/0:e}const Jo=["duration","bounce"],Qo=["stiffness","damping","mass"];function xn(t,e){return e.some(n=>t[n]!==void 0)}function tr(t){let e={velocity:D.velocity,stiffness:D.stiffness,damping:D.damping,mass:D.mass,isResolvedFromDuration:!1,...t};if(!xn(t,Qo)&&xn(t,Jo))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*H(.05,1,1-t.bounce)*Math.sqrt(i);e={...e,mass:D.mass,stiffness:i,damping:r}}else{const n=Yo(t);e={...e,...n,mass:D.mass},e.isResolvedFromDuration=!0}return e}function ei(t=D.visualDuration,e=D.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=tr({...n,velocity:-z(n.velocity||0)}),p=f||0,g=u/(2*Math.sqrt(l*c)),y=o-r,m=z(Math.sqrt(l/c)),v=Math.abs(y)<5;s||(s=v?D.restSpeed.granular:D.restSpeed.default),i||(i=v?D.restDelta.granular:D.restDelta.default);let T;if(g<1){const P=ve(m,g);T=w=>{const R=Math.exp(-g*m*w);return o-R*((p+g*m*y)/P*Math.sin(P*w)+y*Math.cos(P*w))}}else if(g===1)T=P=>o-Math.exp(-m*P)*(y+(p+m*y)*P);else{const P=m*Math.sqrt(g*g-1);T=w=>{const R=Math.exp(-g*m*w),A=Math.min(P*w,300);return o-R*((p+g*m*y)*Math.sinh(A)+P*y*Math.cosh(A))/P}}const b={calculatedDuration:d&&h||null,next:P=>{const w=T(P);if(d)a.done=P>=h;else{let R=0;g<1&&(R=P===0?$(p):Qs(T,P,w));const A=Math.abs(R)<=s,k=Math.abs(o-w)<=i;a.done=A&&k}return a.value=a.done?o:w,a},toString:()=>{const P=Math.min(ti(b),xe),w=Zs(R=>b.next(P*R).value,P,30);return P+"ms "+w}};return b}function Tn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let g=n*e;const y=h+g,m=o===void 0?y:o(y);m!==y&&(g=m-h);const v=A=>-g*Math.exp(-A/s),T=A=>m+v(A),b=A=>{const k=v(A),O=T(A);f.done=Math.abs(k)<=u,f.value=f.done?m:O};let P,w;const R=A=>{d(f.value)&&(P=A,w=ei({keyframes:[f.value,p(f.value)],velocity:Qs(T,A,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return R(0),{calculatedDuration:null,next:A=>{let k=!1;return!w&&P===void 0&&(k=!0,b(A),R(A)),P!==void 0&&A>=P?w.next(A-P):(!k&&b(A),f)}}}const er=Dt(.42,0,1,1),nr=Dt(0,0,.58,1),ni=Dt(.42,0,.58,1),sr=t=>Array.isArray(t)&&typeof t[0]!="number",Ke=t=>Array.isArray(t)&&typeof t[0]=="number",Pn={linear:j,easeIn:er,easeInOut:ni,easeOut:nr,circIn:Be,circInOut:Fs,circOut:Ls,backIn:Fe,backInOut:Rs,backOut:Ms,anticipate:Es},Sn=t=>{if(Ke(t)){de(t.length===4);const[e,n,s,i]=t;return Dt(e,n,s,i)}else if(typeof t=="string")return de(Pn[t]!==void 0),Pn[t];return t},ir=(t,e)=>n=>e(t(n)),Rt=(...t)=>t.reduce(ir),C=(t,e,n)=>t+(e-t)*n;function ee(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function or({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ee(l,a,t+1/3),r=ee(l,a,t),o=ee(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Ot(t,e){return n=>n>0?e:t}const ne=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},rr=[ge,et,ot],ar=t=>rr.find(e=>e.test(t));function An(t){const e=ar(t);if(!e)return!1;let n=e.parse(t);return e===ot&&(n=or(n)),n}const bn=(t,e)=>{const n=An(t),s=An(e);if(!n||!s)return Ot(t,e);const i={...n};return r=>(i.red=ne(n.red,s.red,r),i.green=ne(n.green,s.green,r),i.blue=ne(n.blue,s.blue,r),i.alpha=C(n.alpha,s.alpha,r),et.transform(i))},Te=new Set(["none","hidden"]);function lr(t,e){return Te.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ur(t,e){return n=>C(t,e,n)}function We(t){return typeof t=="number"?ur:typeof t=="string"?ke(t)?Ot:L.test(t)?bn:fr:Array.isArray(t)?si:typeof t=="object"?L.test(t)?bn:cr:Ot}function si(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>We(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function cr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=We(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function hr(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[r]=l,i[o]++}return s}const fr=(t,e)=>{const n=q.createTransformer(e),s=bt(t),i=bt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Te.has(t)&&!i.values.length||Te.has(e)&&!s.values.length?lr(t,e):Rt(si(hr(s,i),i.values),n):Ot(t,e)};function ii(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?C(t,e,n):We(t)(t,e)}function dr(t,e,n){const s=[],i=n||ii,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||j:e;a=Rt(l,a)}s.push(a)}return s}function mr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(de(r===e.length),r===1)return()=>e[0];if(r===2&&t[0]===t[1])return()=>e[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=dr(e,s,i),a=o.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const h=ht(t[c],t[c+1],u);return o[c](h)};return n?u=>l(H(t[0],t[r-1],u)):l}function pr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=ht(0,e,s);t.push(C(n,1,i))}}function gr(t){const e=[0];return pr(e,t.length-1),e}function yr(t,e){return t.map(n=>n*e)}function vr(t,e){return t.map(()=>e||ni).splice(0,t.length-1)}function Nt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=sr(s)?s.map(Sn):Sn(s),r={done:!1,value:e[0]},o=yr(n&&n.length===e.length?n:gr(e),t),a=mr(o,e,{ease:Array.isArray(i)?i:vr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const xr=t=>{const e=({timestamp:n})=>t(n);return{start:()=>V.update(e,!0),stop:()=>Y(e),now:()=>E.isProcessing?E.timestamp:W.now()}},Tr={decay:Tn,inertia:Tn,tween:Nt,keyframes:Nt,spring:ei},Pr=t=>t/100;class Ge extends qs{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||je,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(r,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=_e(n)?n:Tr[n]||Nt;let l,u;a!==Nt&&typeof e[0]!="number"&&(l=Rt(Pr,ii(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});r==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=ti(c));const{calculatedDuration:h}=c,f=h+i,d=f*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:d}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:f,repeat:d,repeatType:p,repeatDelay:g,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const m=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?m<0:m>c;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let T=this.currentTime,b=r;if(d){const A=Math.min(this.currentTime,c)/h;let k=Math.floor(A),O=A%1;!O&&A>=1&&(O=1),O===1&&k--,k=Math.min(k,d+1),!!(k%2)&&(p==="reverse"?(O=1-O,g&&(O-=g/h)):p==="mirror"&&(b=o)),T=H(0,1,O)*h}const P=v?{done:!1,value:l[0]}:b.next(T);a&&(P.value=a(P.value));let{done:w}=P;!v&&u!==null&&(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return R&&i!==void 0&&(P.value=Ht(l,this.options,i)),y&&y(P.value),R&&this.finish(),P}get duration(){const{resolved:e}=this;return e?z(e.calculatedDuration):0}get time(){return z(this.currentTime)}set time(e){e=$(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=z(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=xr,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Sr=new Set(["opacity","clipPath","filter","transform"]);function $e(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ar={linearEasing:void 0};function br(t,e){const n=$e(t);return()=>{var s;return(s=Ar[e])!==null&&s!==void 0?s:n()}}const Ut=br(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function oi(t){return!!(typeof t=="function"&&Ut()||!t||typeof t=="string"&&(t in Pe||Ut())||Ke(t)||Array.isArray(t)&&t.every(oi))}const pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Pe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pt([0,.65,.55,1]),circOut:pt([.55,0,1,.45]),backIn:pt([.31,.01,.66,-.59]),backOut:pt([.33,1.53,.69,.99])};function ri(t,e){if(t)return typeof t=="function"&&Ut()?Zs(t,e):Ke(t)?pt(t):Array.isArray(t)?t.map(n=>ri(n,e)||Pe.easeOut):Pe[t]}function wr(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=ri(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function wn(t,e){t.timeline=e,t.onfinish=null}const Vr=$e(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),_t=10,Cr=2e4;function Dr(t){return _e(t.type)||t.type==="spring"||!oi(t.ease)}function Mr(t,e){const n=new Ge({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<Cr;)s=n.sample(r),i.push(s.value),r+=_t;return{times:void 0,keyframes:i,duration:r-_t,ease:"linear"}}const ai={anticipate:Es,backInOut:Rs,circInOut:Fs};function Rr(t){return t in ai}class Vn extends qs{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new Ys(r,(o,a)=>this.onKeyframesResolved(o,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){var s;let{duration:i=300,times:r,ease:o,type:a,motionValue:l,name:u,startTime:c}=this.options;if(!(!((s=l.owner)===null||s===void 0)&&s.current))return!1;if(typeof o=="string"&&Ut()&&Rr(o)&&(o=ai[o]),Dr(this.options)){const{onComplete:f,onUpdate:d,motionValue:p,element:g,...y}=this.options,m=Mr(e,y);e=m.keyframes,e.length===1&&(e[1]=e[0]),i=m.duration,r=m.times,o=m.ease,a="keyframes"}const h=wr(l.owner.current,u,e,{...this.options,duration:i,times:r,ease:o});return h.startTime=c??this.calcStartTime(),this.pendingTimeline?(wn(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:f}=this.options;l.set(Ht(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:r,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return z(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return z(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=$(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return j;const{animation:s}=n;wn(s,e)}return j}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:r,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:h,element:f,...d}=this.options,p=new Ge({...d,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),g=$(this.time);u.setWithVelocity(p.sample(g-_t).value,p.sample(g).value,_t)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=e;return Vr()&&s&&Sr.has(s)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}const Er=$e(()=>window.ScrollTimeline!==void 0);class Lr{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>Er()&&i.attachTimeline?i.attachTimeline(e):n(i));return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Fr({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const ze=(t,e,n,s={},i,r)=>o=>{const a=Le(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-$(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Fr(a)||(c={...c,...so(t,c)}),c.duration&&(c.duration=$(c.duration)),c.repeatDelay&&(c.repeatDelay=$(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),h&&!r&&e.get()!==void 0){const f=Ht(c.keyframes,a);if(f!==void 0)return V.update(()=>{c.onUpdate(f),c.onComplete()}),new Lr([])}return!r&&Vn.supports(c)?new Vn(c):new Ge(c)},Br=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),kr=t=>fe(t)?t[t.length-1]||0:t;function He(t,e){t.indexOf(e)===-1&&t.push(e)}function Xe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Ye{constructor(){this.subscriptions=[]}add(e){return He(this.subscriptions,e),()=>Xe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Cn=30,jr=t=>!isNaN(parseFloat(t));class Ir{constructor(e,n={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=W.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=W.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=jr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Ye);const s=this.events[e].add(n);return e==="change"?()=>{s(),V.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=W.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Cn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Cn);return Js(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wt(t,e){return new Ir(t,e)}function Or(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,wt(n))}function Nr(t,e){const n=zt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=kr(r[o]);Or(t,o,a)}}const qe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ur="framerAppearId",li="data-"+qe(Ur);function ui(t){return t.props[li]}const F=t=>!!(t&&t.getVelocity);function _r(t){return!!(F(t)&&t.add)}function Se(t,e){const n=t.getValue("willChange");if(_r(n))return n.add(e)}function Kr({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ci(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const f=t.getValue(h,(r=t.latestValues[h])!==null&&r!==void 0?r:null),d=l[h];if(d===void 0||c&&Kr(c,h))continue;const p={delay:n,...Le(o||{},h)};let g=!1;if(window.MotionHandoffAnimation){const m=ui(t);if(m){const v=window.MotionHandoffAnimation(m,h,V);v!==null&&(p.startTime=v,g=!0)}}Se(t,h),f.start(ze(h,f,d,t.shouldReduceMotion&&st.has(h)?{type:!1}:p,t,g));const y=f.animation;y&&u.push(y)}return a&&Promise.all(u).then(()=>{V.update(()=>{a&&Nr(t,a)})}),u}function Ae(t,e,n={}){var s;const i=zt(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(ci(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=r;return Wr(t,e,c+u,h,f,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function Wr(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(Gr).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Ae(u,e,{...r,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function Gr(t,e){return t.sortNodePosition(e)}function $r(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ae(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ae(t,e,n);else{const i=typeof e=="function"?zt(t,e,n.custom):e;s=Promise.all(ci(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const zr=Ee.length;function hi(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?hi(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<zr;n++){const s=Ee[n],i=t.props[s];(St(i)||i===!1)&&(e[s]=i)}return e}const Hr=[...Re].reverse(),Xr=Re.length;function Yr(t){return e=>Promise.all(e.map(({animation:n,options:s})=>$r(t,n,s)))}function qr(t){let e=Yr(t),n=Dn(),s=!0;const i=l=>(u,c)=>{var h;const f=zt(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(f){const{transition:d,transitionEnd:p,...g}=f;u={...u,...g,...p}}return u};function r(l){e=l(t)}function o(l){const{props:u}=t,c=hi(t.parent)||{},h=[],f=new Set;let d={},p=1/0;for(let y=0;y<Xr;y++){const m=Hr[y],v=n[m],T=u[m]!==void 0?u[m]:c[m],b=St(T),P=m===l?v.isActive:null;P===!1&&(p=y);let w=T===c[m]&&T!==u[m]&&b;if(w&&s&&t.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...d},!v.isActive&&P===null||!T&&!v.prevProp||$t(T)||typeof T=="boolean")continue;const R=Zr(v.prevProp,T);let A=R||m===l&&v.isActive&&!w&&b||y>p&&b,k=!1;const O=Array.isArray(T)?T:[T];let it=O.reduce(i(m),{});P===!1&&(it={});const{prevResolvedValues:ln={}}=v,Zi={...ln,...it},un=B=>{A=!0,f.has(B)&&(k=!0,f.delete(B)),v.needsAnimating[B]=!0;const G=t.getValue(B);G&&(G.liveStyle=!1)};for(const B in Zi){const G=it[B],qt=ln[B];if(d.hasOwnProperty(B))continue;let Zt=!1;fe(G)&&fe(qt)?Zt=!bs(G,qt):Zt=G!==qt,Zt?G!=null?un(B):f.add(B):G!==void 0&&f.has(B)?un(B):v.protectedKeys[B]=!0}v.prevProp=T,v.prevResolvedValues=it,v.isActive&&(d={...d,...it}),s&&t.blockInitialAnimation&&(A=!1),A&&(!(w&&R)||k)&&h.push(...O.map(B=>({animation:B,options:{type:m}})))}if(f.size){const y={};f.forEach(m=>{const v=t.getBaseTarget(m),T=t.getValue(m);T&&(T.liveStyle=!0),y[m]=v??null}),h.push({animation:y})}let g=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var d;return(d=f.animationState)===null||d===void 0?void 0:d.setActive(l,u)}),n[l].isActive=u;const h=o(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Dn(),s=!0}}}function Zr(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!bs(e,t):!1}function J(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dn(){return{animate:J(!0),whileInView:J(),whileHover:J(),whileTap:J(),whileDrag:J(),whileFocus:J(),exit:J()}}class Z{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Jr extends Z{constructor(e){super(e),e.animationState||(e.animationState=qr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();$t(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Qr=0;class ta extends Z{constructor(){super(...arguments),this.id=Qr++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const ea={animation:{Feature:Jr},exit:{Feature:ta}},_={x:!1,y:!1};function fi(){return _.x||_.y}function na(t,e,n){var s;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const r=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function di(t,e){const n=na(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Mn(t){return e=>{e.pointerType==="touch"||fi()||t(e)}}function sa(t,e,n={}){const[s,i,r]=di(t,n),o=Mn(a=>{const{target:l}=a,u=e(a);if(!u||!l)return;const c=Mn(h=>{u(h),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,i)});return s.forEach(a=>{a.addEventListener("pointerenter",o,i)}),r}const Ze=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,gt=new WeakSet;function Rn(t){return e=>{e.key==="Enter"&&t(e)}}function se(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const ia=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Rn(()=>{if(gt.has(n))return;se(n,"down");const i=Rn(()=>{se(n,"up")}),r=()=>se(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)},oa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ra(t){return oa.has(t.tagName)||t.tabIndex!==-1}const mi=(t,e)=>e?t===e?!0:mi(t,e.parentElement):!1;function En(t){return Ze(t)&&!fi()}function aa(t,e,n={}){const[s,i,r]=di(t,n),o=a=>{const l=a.currentTarget;if(!En(a)||gt.has(l))return;gt.add(l);const u=e(a),c=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),!(!En(d)||!gt.has(l))&&(gt.delete(l),u&&u(d,{success:p}))},h=d=>{c(d,n.useGlobalTarget||mi(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{ra(a)||(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",u=>ia(u,i),i)}),r}function la(t){return t==="x"||t==="y"?_[t]?null:(_[t]=!0,()=>{_[t]=!1}):_.x||_.y?null:(_.x=_.y=!0,()=>{_.x=_.y=!1})}function Et(t){return{point:{x:t.pageX,y:t.pageY}}}const ua=t=>e=>Ze(e)&&t(e,Et(e));function Vt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function xt(t,e,n,s){return Vt(t,e,ua(n),s)}const Ln=(t,e)=>Math.abs(t-e);function ca(t,e){const n=Ln(t.x,e.x),s=Ln(t.y,e.y);return Math.sqrt(n**2+s**2)}class pi{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=oe(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=ca(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:p}=h,{timestamp:g}=E;this.history.push({...p,timestamp:g});const{onStart:y,onMove:m}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=ie(f,this.transformPagePoint),V.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=oe(h.type==="pointercancel"?this.lastMoveEventInfo:ie(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,y),p&&p(h,y)},!Ze(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=Et(e),a=ie(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=E;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,oe(a,this.history)),this.removeListeners=Rt(xt(this.contextWindow,"pointermove",this.handlePointerMove),xt(this.contextWindow,"pointerup",this.handlePointerUp),xt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Y(this.updatePoint)}}function ie(t,e){return e?{point:e(t.point)}:t}function Fn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function oe({point:t},e){return{point:t,delta:Fn(t,gi(e)),offset:Fn(t,ha(e)),velocity:fa(e,.1)}}function ha(t){return t[0]}function gi(t){return t[t.length-1]}function fa(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=gi(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>$(e)));)n--;if(!s)return{x:0,y:0};const r=z(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function rt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const yi=1e-4,da=1-yi,ma=1+yi,vi=.01,pa=0-vi,ga=0+vi;function I(t){return t.max-t.min}function ya(t,e,n){return Math.abs(t-e)<=n}function Bn(t,e,n,s=.5){t.origin=s,t.originPoint=C(e.min,e.max,t.origin),t.scale=I(n)/I(e),t.translate=C(n.min,n.max,t.origin)-t.originPoint,(t.scale>=da&&t.scale<=ma||isNaN(t.scale))&&(t.scale=1),(t.translate>=pa&&t.translate<=ga||isNaN(t.translate))&&(t.translate=0)}function Tt(t,e,n,s){Bn(t.x,e.x,n.x,s?s.originX:void 0),Bn(t.y,e.y,n.y,s?s.originY:void 0)}function kn(t,e,n){t.min=n.min+e.min,t.max=t.min+I(e)}function va(t,e,n){kn(t.x,e.x,n.x),kn(t.y,e.y,n.y)}function jn(t,e,n){t.min=e.min-n.min,t.max=t.min+I(e)}function Pt(t,e,n){jn(t.x,e.x,n.x),jn(t.y,e.y,n.y)}function xa(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?C(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?C(n,t,s.max):Math.min(t,n)),t}function In(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ta(t,{top:e,left:n,bottom:s,right:i}){return{x:In(t.x,n,i),y:In(t.y,e,s)}}function On(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Pa(t,e){return{x:On(t.x,e.x),y:On(t.y,e.y)}}function Sa(t,e){let n=.5;const s=I(t),i=I(e);return i>s?n=ht(e.min,e.max-s,t.min):s>i&&(n=ht(t.min,t.max-i,e.min)),H(0,1,n)}function Aa(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const be=.35;function ba(t=be){return t===!1?t=0:t===!0&&(t=be),{x:Nn(t,"left","right"),y:Nn(t,"top","bottom")}}function Nn(t,e,n){return{min:Un(t,e),max:Un(t,n)}}function Un(t,e){return typeof t=="number"?t:t[e]||0}const _n=()=>({translate:0,scale:1,origin:0,originPoint:0}),at=()=>({x:_n(),y:_n()}),Kn=()=>({min:0,max:0}),M=()=>({x:Kn(),y:Kn()});function U(t){return[t("x"),t("y")]}function xi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function wa({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Va(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function re(t){return t===void 0||t===1}function we({scale:t,scaleX:e,scaleY:n}){return!re(t)||!re(e)||!re(n)}function Q(t){return we(t)||Ti(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ti(t){return Wn(t.x)||Wn(t.y)}function Wn(t){return t&&t!=="0%"}function Kt(t,e,n){const s=t-n,i=e*s;return n+i}function Gn(t,e,n,s,i){return i!==void 0&&(t=Kt(t,i,s)),Kt(t,n,s)+e}function Ve(t,e=0,n=1,s,i){t.min=Gn(t.min,e,n,s,i),t.max=Gn(t.max,e,n,s,i)}function Pi(t,{x:e,y:n}){Ve(t.x,e.translate,e.scale,e.originPoint),Ve(t.y,n.translate,n.scale,n.originPoint)}const $n=.999999999999,zn=1.0000000000001;function Ca(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ut(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Pi(t,o)),s&&Q(r.latestValues)&&ut(t,r.latestValues))}e.x<zn&&e.x>$n&&(e.x=1),e.y<zn&&e.y>$n&&(e.y=1)}function lt(t,e){t.min=t.min+e,t.max=t.max+e}function Hn(t,e,n,s,i=.5){const r=C(t.min,t.max,i);Ve(t,e,n,r,s)}function ut(t,e){Hn(t.x,e.x,e.scaleX,e.scale,e.originX),Hn(t.y,e.y,e.scaleY,e.scale,e.originY)}function Si(t,e){return xi(Va(t.getBoundingClientRect(),e))}function Da(t,e,n){const s=Si(t,n),{scroll:i}=e;return i&&(lt(s.x,i.offset.x),lt(s.y,i.offset.y)),s}const Ai=({current:t})=>t?t.ownerDocument.defaultView:null,Ma=new WeakMap;class Ra{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=M(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Et(c).point)},r=(c,h)=>{const{drag:f,dragPropagation:d,onDragStart:p}=this.getProps();if(f&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=la(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),U(y=>{let m=this.getAxisMotionValue(y).get()||0;if(K.test(m)){const{projection:v}=this.visualElement;if(v&&v.layout){const T=v.layout.layoutBox[y];T&&(m=I(T)*(parseFloat(m)/100))}}this.originPoint[y]=m}),p&&V.postRender(()=>p(c,h)),Se(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(c,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:p,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=h;if(d&&this.currentDirection===null){this.currentDirection=Ea(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&g(c,h)},a=(c,h)=>this.stop(c,h),l=()=>U(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new pi(e,{onSessionStart:i,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Ai(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&V.postRender(()=>r(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Bt(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=xa(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,r=this.constraints;n&&rt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Ta(i.layoutBox,n):this.constraints=!1,this.elastic=ba(s),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&U(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Aa(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!rt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=Da(s,i.root,this.visualElement.getTransformPagePoint());let o=Pa(i.layout.layoutBox,r);if(n){const a=n(wa(o));this.hasMutatedConstraints=!!a,a&&(o=xi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=U(c=>{if(!Bt(c,n,this.currentDirection))return;let h=l[c]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Se(this.visualElement,e),s.start(ze(e,s,0,n,this.visualElement,!1))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){U(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){U(n=>{const{drag:s}=this.getProps();if(!Bt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-C(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!rt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=Sa({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),U(o=>{if(!Bt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(C(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;Ma.set(this.visualElement,this);const e=this.visualElement.current,n=xt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();rt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),V.read(s);const o=Vt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(U(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=be,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Bt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Ea(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class La extends Z{constructor(e){super(e),this.removeGroupControls=j,this.removeListeners=j,this.controls=new Ra(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||j}unmount(){this.removeGroupControls(),this.removeListeners()}}const Xn=t=>(e,n)=>{t&&V.postRender(()=>t(e,n))};class Fa extends Z{constructor(){super(...arguments),this.removePointerDownListener=j}onPointerDown(e){this.session=new pi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ai(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Xn(e),onStart:Xn(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&V.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=xt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Je=S.createContext(null);function Ba(){const t=S.useContext(Je);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=S.useId();S.useEffect(()=>s(i),[]);const r=S.useCallback(()=>n&&n(i),[i,n]);return!e&&n?[!1,r]:[!0]}const bi=S.createContext({}),wi=S.createContext({}),jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Yn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const mt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;const n=Yn(t,e.target.x),s=Yn(t,e.target.y);return`${n}% ${s}%`}},ka={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=q.parse(t);if(i.length>5)return s;const r=q.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=C(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},Wt={};function ja(t){Object.assign(Wt,t)}const{schedule:Qe,cancel:wu}=ws(queueMicrotask,!1);class Ia extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;ja(Oa),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,o=s.projection;return o&&(o.isPresent=r,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||V.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Qe.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Vi(t){const[e,n]=Ba(),s=S.useContext(bi);return he.jsx(Ia,{...t,layoutGroup:s,switchLayoutGroup:S.useContext(wi),isPresent:e,safeToRemove:n})}const Oa={borderRadius:{...mt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomLeftRadius:mt,borderBottomRightRadius:mt,boxShadow:ka},Ci=["TopLeft","TopRight","BottomLeft","BottomRight"],Na=Ci.length,qn=t=>typeof t=="string"?parseFloat(t):t,Zn=t=>typeof t=="number"||x.test(t);function Ua(t,e,n,s,i,r){i?(t.opacity=C(0,n.opacity!==void 0?n.opacity:1,_a(s)),t.opacityExit=C(e.opacity!==void 0?e.opacity:1,0,Ka(s))):r&&(t.opacity=C(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<Na;o++){const a=`border${Ci[o]}Radius`;let l=Jn(e,a),u=Jn(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Zn(l)===Zn(u)?(t[a]=Math.max(C(qn(l),qn(u),s),0),(K.test(u)||K.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=C(e.rotate||0,n.rotate||0,s))}function Jn(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const _a=Di(0,.5,Ls),Ka=Di(.5,.95,j);function Di(t,e,n){return s=>s<t?0:s>e?1:n(ht(t,e,s))}function Qn(t,e){t.min=e.min,t.max=e.max}function N(t,e){Qn(t.x,e.x),Qn(t.y,e.y)}function ts(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function es(t,e,n,s,i){return t-=e,t=Kt(t,1/n,s),i!==void 0&&(t=Kt(t,1/i,s)),t}function Wa(t,e=0,n=1,s=.5,i,r=t,o=t){if(K.test(e)&&(e=parseFloat(e),e=C(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=C(r.min,r.max,s);t===r&&(a-=e),t.min=es(t.min,e,n,a,i),t.max=es(t.max,e,n,a,i)}function ns(t,e,[n,s,i],r,o){Wa(t,e[n],e[s],e[i],e.scale,r,o)}const Ga=["x","scaleX","originX"],$a=["y","scaleY","originY"];function ss(t,e,n,s){ns(t.x,e,Ga,n?n.x:void 0,s?s.x:void 0),ns(t.y,e,$a,n?n.y:void 0,s?s.y:void 0)}function is(t){return t.translate===0&&t.scale===1}function Mi(t){return is(t.x)&&is(t.y)}function os(t,e){return t.min===e.min&&t.max===e.max}function za(t,e){return os(t.x,e.x)&&os(t.y,e.y)}function rs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ri(t,e){return rs(t.x,e.x)&&rs(t.y,e.y)}function as(t){return I(t.x)/I(t.y)}function ls(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Ha{constructor(){this.members=[]}add(e){He(this.members,e),e.scheduleRender()}remove(e){if(Xe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Xa(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Ya=(t,e)=>t.depth-e.depth;class qa{constructor(){this.children=[],this.isDirty=!1}add(e){He(this.children,e),this.isDirty=!0}remove(e){Xe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ya),this.isDirty=!1,this.children.forEach(e)}}function It(t){const e=F(t)?t.get():t;return Br(e)?e.toValue():e}function Za(t,e){const n=W.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Y(s),t(r-e))};return V.read(s,!0),()=>Y(s)}function Ja(t){return t instanceof SVGElement&&t.tagName!=="svg"}function Qa(t,e,n){const s=F(t)?t:wt(t);return s.start(ze("",s,e,n)),s.animation}const tt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},yt=typeof window<"u"&&window.MotionDebug!==void 0,ae=["","X","Y","Z"],tl={visibility:"hidden"},us=1e3;let el=0;function le(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Ei(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ui(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",V,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Ei(s)}function Li({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=el++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,yt&&(tt.totalNodes=tt.resolvedTargetDeltas=tt.recalculatedProjection=0),this.nodes.forEach(il),this.nodes.forEach(ul),this.nodes.forEach(cl),this.nodes.forEach(ol),yt&&window.MotionDebug.record(tt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new qa)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ye),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ja(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Za(f,250),jt.hasAnimatedSinceResize&&(jt.hasAnimatedSinceResize=!1,this.nodes.forEach(hs))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||pl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:m}=c.getProps(),v=!this.targetLayout||!Ri(this.targetLayout,p)||d,T=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||T||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,T);const b={...Le(g,"layout"),onPlay:y,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||hs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Y(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hl),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ei(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(cs);return}this.isUpdating||this.nodes.forEach(al),this.isUpdating=!1,this.nodes.forEach(ll),this.nodes.forEach(nl),this.nodes.forEach(sl),this.clearAllSnapshots();const a=W.now();E.delta=H(0,1e3/60,a-E.timestamp),E.timestamp=a,E.isProcessing=!0,Jt.update.process(E),Jt.preRender.process(E),Jt.render.process(E),E.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qe.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rl),this.sharedNodes.forEach(fl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=M(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Mi(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Q(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),gl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return M();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(yl))){const{scroll:c}=this.root;c&&(lt(l.x,c.offset.x),lt(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=M();if(N(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&N(l,o),lt(l.x,h.offset.x),lt(l.y,h.offset.y))}return l}applyTransform(o,a=!1){const l=M();N(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ut(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Q(c.latestValues)&&ut(l,c.latestValues)}return Q(this.latestValues)&&ut(l,this.latestValues),l}removeTransform(o){const a=M();N(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Q(u.latestValues))continue;we(u.latestValues)&&u.updateSnapshot();const c=M(),h=u.measurePageBox();N(c,h),ss(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Q(this.latestValues)&&ss(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==E.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=E.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=M(),this.relativeTargetOrigin=M(),Pt(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),N(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=M(),this.targetWithTransforms=M()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),va(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):N(this.target,this.layout.layoutBox),Pi(this.target,this.targetDelta)):N(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=M(),this.relativeTargetOrigin=M(),Pt(this.relativeTargetOrigin,this.target,d.target),N(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}yt&&tt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||we(this.parent.latestValues)||Ti(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===E.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||h))return;N(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;Ca(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=M());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ts(this.prevProjectionDelta.x,this.projectionDelta.x),ts(this.prevProjectionDelta.y,this.projectionDelta.y)),Tt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!ls(this.projectionDelta.x,this.prevProjectionDelta.x)||!ls(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),yt&&tt.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=at(),this.projectionDelta=at(),this.projectionDeltaWithTransform=at()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=at();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=M(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=d!==p,y=this.getStack(),m=!y||y.members.length<=1,v=!!(g&&!m&&this.options.crossfade===!0&&!this.path.some(ml));this.animationProgress=0;let T;this.mixTargetDelta=b=>{const P=b/1e3;fs(h.x,o.x,P),fs(h.y,o.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Pt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dl(this.relativeTarget,this.relativeTargetOrigin,f,P),T&&za(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=M()),N(T,this.relativeTarget)),g&&(this.animationValues=c,Ua(c,u,this.latestValues,P,v,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{jt.hasAnimatedSinceResize=!0,this.currentAnimation=Qa(0,us,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(us),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Fi(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||M();const h=I(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=I(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}N(a,l),ut(a,c),Tt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ha),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&le("z",o,u,this.animationValues);for(let c=0;c<ae.length;c++)le(`rotate${ae[c]}`,o,u,this.animationValues),le(`skew${ae[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return tl;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=It(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=It(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Q(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=Xa(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:d,y:p}=this.projectionDelta;u.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,h.animationValues?u.opacity=h===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=h===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in Wt){if(f[g]===void 0)continue;const{correct:y,applyTo:m}=Wt[g],v=u.transform==="none"?f[g]:y(f[g],h);if(m){const T=m.length;for(let b=0;b<T;b++)u[m[b]]=v}else u[g]=v}return this.options.layoutId&&(u.pointerEvents=h===this?It(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(cs),this.root.sharedNodes.clear()}}}function nl(t){t.updateLayout()}function sl(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;r==="size"?U(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=I(f);f.min=s[h].min,f.max=f.min+d}):Fi(r,n.layoutBox,s)&&U(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=I(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=at();Tt(a,s,n.layoutBox);const l=at();o?Tt(l,t.applyTransform(i,!0),n.measuredBox):Tt(l,s,n.layoutBox);const u=!Mi(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=M();Pt(p,n.layoutBox,f.layoutBox);const g=M();Pt(g,s,d.layoutBox),Ri(p,g)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function il(t){yt&&tt.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ol(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function rl(t){t.clearSnapshot()}function cs(t){t.clearMeasurements()}function al(t){t.isLayoutDirty=!1}function ll(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function hs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ul(t){t.resolveTargetDelta()}function cl(t){t.calcProjection()}function hl(t){t.resetSkewAndRotation()}function fl(t){t.removeLeadSnapshot()}function fs(t,e,n){t.translate=C(e.translate,0,n),t.scale=C(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ds(t,e,n,s){t.min=C(e.min,n.min,s),t.max=C(e.max,n.max,s)}function dl(t,e,n,s){ds(t.x,e.x,n.x,s),ds(t.y,e.y,n.y,s)}function ml(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const pl={duration:.45,ease:[.4,0,.1,1]},ms=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ps=ms("applewebkit/")&&!ms("chrome/")?Math.round:j;function gs(t){t.min=ps(t.min),t.max=ps(t.max)}function gl(t){gs(t.x),gs(t.y)}function Fi(t,e,n){return t==="position"||t==="preserve-aspect"&&!ya(as(e),as(n),.2)}function yl(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const vl=Li({attachResizeListener:(t,e)=>Vt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ue={current:void 0},Bi=Li({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ue.current){const t=new vl({});t.mount(window),t.setOptions({layoutScroll:!0}),ue.current=t}return ue.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xl={pan:{Feature:Fa},drag:{Feature:La,ProjectionNode:Bi,MeasureLayout:Vi}};function ys(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&V.postRender(()=>r(e,Et(e)))}class Tl extends Z{mount(){const{current:e}=this.node;e&&(this.unmount=sa(e,n=>(ys(this.node,n,"Start"),s=>ys(this.node,s,"End"))))}unmount(){}}class Pl extends Z{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Rt(Vt(this.node.current,"focus",()=>this.onFocus()),Vt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function vs(t,e,n){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&V.postRender(()=>r(e,Et(e)))}class Sl extends Z{mount(){const{current:e}=this.node;e&&(this.unmount=aa(e,n=>(vs(this.node,n,"Start"),(s,{success:i})=>vs(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ce=new WeakMap,ce=new WeakMap,Al=t=>{const e=Ce.get(t.target);e&&e(t)},bl=t=>{t.forEach(Al)};function wl({root:t,...e}){const n=t||document;ce.has(n)||ce.set(n,{});const s=ce.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(bl,{root:t,...e})),s[i]}function Vl(t,e,n){const s=wl(e);return Ce.set(t,n),s.observe(t),()=>{Ce.delete(t),s.unobserve(t)}}const Cl={some:0,all:1};class Dl extends Z{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Cl[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Vl(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Ml(e,n))&&this.startObserver()}unmount(){}}function Ml({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Rl={inView:{Feature:Dl},tap:{Feature:Sl},focus:{Feature:Pl},hover:{Feature:Tl}},El={layout:{ProjectionNode:Bi,MeasureLayout:Vi}},ki=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Xt=S.createContext({}),tn=typeof window<"u",Ll=tn?S.useLayoutEffect:S.useEffect,ji=S.createContext({strict:!1});function Fl(t,e,n,s,i){var r,o;const{visualElement:a}=S.useContext(Xt),l=S.useContext(ji),u=S.useContext(Je),c=S.useContext(ki).reducedMotion,h=S.useRef(null);s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=h.current,d=S.useContext(wi);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Bl(h.current,n,i,d);const p=S.useRef(!1);S.useInsertionEffect(()=>{f&&p.current&&f.update(n,u)});const g=n[li],y=S.useRef(!!g&&!(!((r=window.MotionHandoffIsComplete)===null||r===void 0)&&r.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return Ll(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Qe.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges())}),S.useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)===null||m===void 0||m.call(window,g)}),y.current=!1))}),f}function Bl(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ii(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&rt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function Ii(t){if(t)return t.options.allowProjection!==!1?t.projection:Ii(t.parent)}function kl(t,e,n){return S.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):rt(n)&&(n.current=s))},[e])}function Yt(t){return $t(t.animate)||Ee.some(e=>St(t[e]))}function Oi(t){return!!(Yt(t)||t.variants)}function jl(t,e){if(Yt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||St(n)?n:void 0,animate:St(s)?s:void 0}}return t.inherit!==!1?e:{}}function Il(t){const{initial:e,animate:n}=jl(t,S.useContext(Xt));return S.useMemo(()=>({initial:e,animate:n}),[xs(e),xs(n)])}function xs(t){return Array.isArray(t)?t.join(" "):t}const Ts={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"]},ft={};for(const t in Ts)ft[t]={isEnabled:e=>Ts[t].some(n=>!!e[n])};function Ol(t){for(const e in t)ft[e]={...ft[e],...t[e]}}const Nl=Symbol.for("motionComponentSymbol");function Ul({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&Ol(t);function r(a,l){let u;const c={...S.useContext(ki),...a,layoutId:_l(a)},{isStatic:h}=c,f=Il(a),d=s(a,h);if(!h&&tn){Kl();const p=Wl(c);u=p.MeasureLayout,f.visualElement=Fl(i,d,c,e,p.ProjectionNode)}return he.jsxs(Xt.Provider,{value:f,children:[u&&f.visualElement?he.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,a,kl(d,f.visualElement,l),d,h,f.visualElement)]})}const o=S.forwardRef(r);return o[Nl]=i,o}function _l({layoutId:t}){const e=S.useContext(bi).id;return e&&t!==void 0?e+"-"+t:t}function Kl(t,e){S.useContext(ji).strict}function Wl(t){const{drag:e,layout:n}=ft;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Gl=["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 en(t){return typeof t!="string"||t.includes("-")?!1:!!(Gl.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ni(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const Ui=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 _i(t,e,n,s){Ni(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Ui.has(i)?i:qe(i),e.attrs[i])}function Ki(t,{layout:e,layoutId:n}){return st.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wt[t]||t==="opacity")}function nn(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(F(i[o])||e.style&&F(e.style[o])||Ki(o,t)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}function Wi(t,e,n){const s=nn(t,e,n);for(const i in t)if(F(t[i])||F(e[i])){const r=Ct.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}function $l(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}function zl({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,i,r){const o={latestValues:Hl(s,i,r,t),renderState:e()};return n&&(o.mount=a=>n(s,a,o)),o}const Gi=t=>(e,n)=>{const s=S.useContext(Xt),i=S.useContext(Je),r=()=>zl(t,e,s,i);return n?r():$l(r)};function Hl(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=It(r[f]);let{initial:o,animate:a}=t;const l=Yt(t),u=Oi(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!$t(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=Me(t,f[d]);if(p){const{transitionEnd:g,transition:y,...m}=p;for(const v in m){let T=m[v];if(Array.isArray(T)){const b=c?T.length-1:0;T=T[b]}T!==null&&(i[v]=T)}for(const v in g)i[v]=g[v]}}}return i}const sn=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),$i=()=>({...sn(),attrs:{}}),zi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Xl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Yl=Ct.length;function ql(t,e,n){let s="",i=!0;for(let r=0;r<Yl;r++){const o=Ct[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=zi(a,Ne[o]);if(!l){i=!1;const c=Xl[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function on(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(st.has(l)){o=!0;continue}else if(Is(l)){i[l]=u;continue}else{const c=zi(u,Ne[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=ql(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}function Ps(t,e,n){return typeof t=="string"?t:x.transform(e+n*t)}function Zl(t,e,n){const s=Ps(e,t.x,t.width),i=Ps(n,t.y,t.height);return`${s} ${i}`}const Jl={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ql={offset:"strokeDashoffset",array:"strokeDasharray"};function tu(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Jl:Ql;t[r.offset]=x.transform(-s);const o=x.transform(e),a=x.transform(n);t[r.array]=`${o} ${a}`}function rn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(on(t,u,h),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:p}=t;f.transform&&(p&&(d.transform=f.transform),delete f.transform),p&&(i!==void 0||r!==void 0||d.transform)&&(d.transformOrigin=Zl(p,i!==void 0?i:.5,r!==void 0?r:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),o!==void 0&&tu(f,o,a,l,!1)}const an=t=>typeof t=="string"&&t.toLowerCase()==="svg",eu={useVisualState:Gi({scrapeMotionValuesFromProps:Wi,createRenderState:$i,onMount:(t,e,{renderState:n,latestValues:s})=>{V.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),V.render(()=>{rn(n,s,an(e.tagName),t.transformTemplate),_i(e,n)})}})},nu={useVisualState:Gi({scrapeMotionValuesFromProps:nn,createRenderState:sn})};function Hi(t,e,n){for(const s in e)!F(e[s])&&!Ki(s,n)&&(t[s]=e[s])}function su({transformTemplate:t},e){return S.useMemo(()=>{const n=sn();return on(n,e,t),Object.assign({},n.vars,n.style)},[e])}function iu(t,e){const n=t.style||{},s={};return Hi(s,n,t),Object.assign(s,su(t,e)),s}function ou(t,e){const n={},s=iu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const ru=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 Gt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ru.has(t)}let Xi=t=>!Gt(t);function au(t){t&&(Xi=e=>e.startsWith("on")?!Gt(e):t(e))}try{au(require("@emotion/is-prop-valid").default)}catch{}function lu(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Xi(i)||n===!0&&Gt(i)||!e&&!Gt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function uu(t,e,n,s){const i=S.useMemo(()=>{const r=$i();return rn(r,e,an(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Hi(r,t.style,t),i.style={...r,...i.style}}return i}function cu(t=!1){return(n,s,i,{latestValues:r},o)=>{const l=(en(n)?uu:ou)(s,r,o,n),u=lu(s,typeof n=="string",t),c=n!==S.Fragment?{...u,...l,ref:i}:{},{children:h}=s,f=S.useMemo(()=>F(h)?h.get():h,[h]);return S.createElement(n,{...c,children:f})}}function hu(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...en(s)?eu:nu,preloadedFeatures:t,useRender:cu(i),createVisualElement:e,Component:s};return Ul(o)}}const De={current:null},Yi={current:!1};function fu(){if(Yi.current=!0,!!tn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>De.current=t.matches;t.addListener(e),e()}else De.current=!1}function du(t,e,n){for(const s in e){const i=e[s],r=n[s];if(F(i))t.addValue(s,i);else if(F(r))t.addValue(s,wt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,wt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ss=new WeakMap,mu=[...Us,L,q],pu=t=>mu.find(Ns(t)),As=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class gu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,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=je,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=W.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,V.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Yt(n),this.isVariantNode=Oi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&F(d)&&d.set(l[f],!1)}}mount(e){this.current=e,Ss.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Yi.current||fu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:De.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ss.delete(this.current),this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=st.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&V.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ft){const n=ft[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):M()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<As.length;s++){const i=As[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=du(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=wt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(ks(i)||Bs(i))?i=parseFloat(i):!pu(i)&&q.test(n)&&(i=Xs(e,n)),this.setBaseTarget(e,F(i)?i.get():i)),F(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Me(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!F(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Ye),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class qi extends gu{constructor(){super(...arguments),this.KeyframeResolver=Ys}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;F(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function yu(t){return window.getComputedStyle(t)}class vu extends qi{constructor(){super(...arguments),this.type="html",this.renderInstance=Ni}readValueFromInstance(e,n){if(st.has(n)){const s=Ue(n);return s&&s.default||0}else{const s=yu(e),i=(Is(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Si(e,n)}build(e,n,s){on(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return nn(e,n,s)}}class xu extends qi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=M}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(st.has(n)){const s=Ue(n);return s&&s.default||0}return n=Ui.has(n)?n:qe(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Wi(e,n,s)}build(e,n,s){rn(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){_i(e,n,s,i)}mount(e){this.isSVGTag=an(e.tagName),super.mount(e)}}const Tu=(t,e)=>en(t)?new xu(e):new vu(e,{allowProjection:t!==S.Fragment}),Pu=hu({...ea,...Rl,...xl,...El},Tu),Cu=Ji(Pu);export{Cu as m};
|