framer-motion 9.1.2 → 9.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +116 -23
- package/dist/es/debug/record.mjs +7 -0
- package/dist/es/projection/node/create-projection-node.mjs +110 -22
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +116 -23
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/projection.dev.js +116 -23
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/dist/three-entry.d.ts +3 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,u as e,v as n,w as s,x as i,y as o,z as r,A as a,B as l,C as h,D as u,a as c,d as p,E as d,g as m,r as f,F as g,G as y,H as v,I as x,J as P,o as T,K as b,M as V,N as A,i as w,O as E,b as S,m as C,f as M,c as D,Q as L,h as R,q as k,R as B,P as F,T as j,L as I,S as U,U as O,n as N,V as $,s as z,j as G,p as H,k as W,l as q}from"./size-rollup-dom-max-assets.js";import Y,{useContext as X,useId as K,useEffect as Z}from"react";class _{constructor(t){this.isMounted=!1,this.node=t}update(){}}const J=t=>t;let Q=J,tt=J;const et=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function nt(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const st="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),it="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(st()),1/60*1e3);const ot={delta:0,timestamp:0};let rt=!0,at=!1,lt=!1;const ht=["read","update","preRender","render","postRender"],ut=ht.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,h=l?e:n;return o&&r.add(t),-1===h.indexOf(t)&&(h.push(t),l&&i&&(s=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let n=0;n<s;n++){const s=e[n];s(l),r.has(s)&&(a.schedule(s),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>at=!0),t),{}),ct=ht.reduce((t,e)=>{const n=ut[e];return t[e]=(t,e=!1,s=!1)=>(at||gt(),n.schedule(t,e,s)),t},{}),pt=ht.reduce((t,e)=>(t[e]=ut[e].cancel,t),{}),dt=ht.reduce((t,e)=>(t[e]=()=>ut[e].process(ot),t),{}),mt=t=>ut[t].process(ot),ft=t=>{at=!1,ot.delta=rt?1/60*1e3:Math.max(Math.min(t-ot.timestamp,40),1),ot.timestamp=t,lt=!0,ht.forEach(mt),lt=!1,at&&(rt=!1,it(ft))},gt=()=>{at=!0,rt=!0,lt||it(ft)},yt=t=>1e3*t;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,(t=>e=>et(e)&&t(e,nt(e)))(n),s)}const Pt=(t,e)=>n=>e(t(n)),Tt=(...t)=>t.reduce(Pt),bt=(t,e)=>Math.abs(t-e);class Vt{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Et(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=bt(t.x,e.x),s=bt(t.y,e.y);return Math.sqrt(n**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:s}=t,{timestamp:i}=ot;this.history.push({...s,timestamp:i});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=At(e,this.transformPagePoint),ct.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:s}=this.handlers,i=Et("pointercancel"===t.type?this.lastMoveEventInfo:At(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),s&&s(t,i)},!et(t))return;this.handlers=e,this.transformPagePoint=n;const s=At(nt(t),this.transformPagePoint),{point:i}=s,{timestamp:o}=ot;this.history=[{...i,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,Et(s,this.history)),this.removeListeners=Tt(xt(window,"pointermove",this.handlePointerMove),xt(window,"pointerup",this.handlePointerUp),xt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pt.update(this.updatePoint)}}function At(t,e){return e?{point:e(t.point)}:t}function wt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Et({point:t},e){return{point:t,delta:wt(t,Ct(e)),offset:wt(t,St(e)),velocity:Mt(e,.1)}}function St(t){return t[0]}function Ct(t){return t[t.length-1]}function Mt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ct(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>yt(e)));)n--;if(!s)return{x:0,y:0};const o=(i.timestamp-s.timestamp)/1e3;if(0===o)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Dt(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Lt=Dt("dragHorizontal"),Rt=Dt("dragVertical");function kt(t){let e=!1;if("y"===t)e=Rt();else if("x"===t)e=Lt();else{const t=Lt(),n=Rt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Bt(){const t=kt(!0);return!t||(t(),!1)}const Ft=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},jt=(t,e,n)=>-n*t+n*e+t;function It(t){return t.max-t.min}function Ut(t,e=0,n=.01){return Math.abs(t-e)<=n}function Ot(t,e,n,s=.5){t.origin=s,t.originPoint=jt(e.min,e.max,t.origin),t.scale=It(n)/It(e),(Ut(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=jt(n.min,n.max,t.origin)-t.originPoint,(Ut(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Nt(t,e,n,s){Ot(t.x,e.x,n.x,s?s.originX:void 0),Ot(t.y,e.y,n.y,s?s.originY:void 0)}function $t(t,e,n){t.min=n.min+e.min,t.max=t.min+It(e)}function zt(t,e,n){t.min=e.min-n.min,t.max=t.min+It(e)}function Gt(t,e,n){zt(t.x,e.x,n.x),zt(t.y,e.y,n.y)}function Ht(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Wt(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}}const qt=.35;function Yt(t,e,n){return{min:Xt(t,e),max:Xt(t,n)}}function Xt(t,e){return"number"==typeof t?t:t[e]||0}function Kt(t){return[t("x"),t("y")]}function Zt({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function _t(t){return void 0===t||1===t}function Jt({scale:t,scaleX:e,scaleY:n}){return!_t(t)||!_t(e)||!_t(n)}function Qt(t){return Jt(t)||te(t)||t.z||t.rotate||t.rotateX||t.rotateY}function te(t){return ee(t.x)||ee(t.y)}function ee(t){return t&&"0%"!==t}function ne(t,e,n){return n+e*(t-n)}function se(t,e,n,s,i){return void 0!==i&&(t=ne(t,i,s)),ne(t,n,s)+e}function ie(t,e=0,n=1,s,i){t.min=se(t.min,e,n,s,i),t.max=se(t.max,e,n,s,i)}function oe(t,{x:e,y:n}){ie(t.x,e.translate,e.scale,e.originPoint),ie(t.y,n.translate,n.scale,n.originPoint)}function re(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ae(t,e){t.min=t.min+e,t.max=t.max+e}function le(t,e,[n,s,i]){const o=void 0!==e[i]?e[i]:.5,r=jt(t.min,t.max,o);ie(t,e[n],e[s],r,e.scale)}const he=["x","scaleX","originX"],ue=["y","scaleY","originY"];function ce(t,e){le(t.x,e,he),le(t.y,e,ue)}function pe(t,e){return Zt(function(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}}(t.getBoundingClientRect(),e))}const de=!1,me=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,fe=t=>e=>1-t(1-e),ge=t=>t*t,ye=fe(ge),ve=me(ge),xe=(t,s)=>i=>Boolean(e(i)&&n.test(i)&&i.startsWith(t)||s&&Object.prototype.hasOwnProperty.call(i,s)),Pe=(t,n,i)=>o=>{if(!e(o))return o;const[r,a,l,h]=o.match(s);return{[t]:parseFloat(r),[n]:parseFloat(a),[i]:parseFloat(l),alpha:void 0!==h?parseFloat(h):1}},Te={...r,transform:e=>Math.round((e=>t(0,255,e))(e))},be={test:xe("rgb","red"),parse:Pe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Te.transform(t)+", "+Te.transform(e)+", "+Te.transform(n)+", "+i(o.transform(s))+")"};const Ve={test:xe("#"),parse:function(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}},transform:be.transform},Ae={test:xe("hsl","hue"),parse:Pe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+a.transform(i(e))+", "+a.transform(i(n))+", "+i(o.transform(s))+")"},we={test:t=>be.test(t)||Ve.test(t)||Ae.test(t),parse:t=>be.test(t)?be.parse(t):Ae.test(t)?Ae.parse(t):Ve.parse(t),transform:t=>e(t)?t:t.hasOwnProperty("red")?be.transform(t):Ae.transform(t)};function Ee(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Se=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},Ce=[Ve,be,Ae];function Me(t){const e=(n=t,Ce.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Ae&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,o=0,r=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Ee(a,s,t+1/3),o=Ee(a,s,t),r=Ee(a,s,t-1/3)}else i=o=r=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*r),alpha:s}}(s)),s}const De=(t,e)=>{const n=Me(t),s=Me(e),i={...n};return t=>(i.red=Se(n.red,s.red,t),i.green=Se(n.green,s.green,t),i.blue=Se(n.blue,s.blue,t),i.alpha=jt(n.alpha,s.alpha,t),be.transform(i))};function Le(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(l);o&&(n=o.length,t=t.replace(l,"${c}"),e.push(...o.map(we.parse)));const a=t.match(s);return a&&(i=a.length,t=t.replace(s,"${n}"),e.push(...a.map(r.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function Re(t){return Le(t).values}function ke(t){const{values:e,numColors:n,tokenised:s}=Le(t),o=e.length;return t=>{let e=s;for(let s=0;s<o;s++)e=e.replace(s<n?"${c}":"${n}",s<n?we.transform(t[s]):i(t[s]));return e}}const Be=t=>"number"==typeof t?0:t;const Fe={test:function(t){var n,i;return isNaN(t)&&e(t)&&((null===(n=t.match(s))||void 0===n?void 0:n.length)||0)+((null===(i=t.match(l))||void 0===i?void 0:i.length)||0)>0},parse:Re,createTransformer:ke,getAnimatableNone:function(t){const e=Re(t);return ke(t)(e.map(Be))}};function je(t,e){return"number"==typeof t?n=>jt(t,e,n):we.test(t)?De(t,e):Oe(t,e)}const Ie=(t,e)=>{const n=[...t],s=n.length,i=t.map((t,n)=>je(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}},Ue=(t,e)=>{const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=je(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}},Oe=(t,e)=>{const n=Fe.createTransformer(e),s=Le(t),i=Le(e);return s.numColors===i.numColors&&s.numNumbers>=i.numNumbers?Tt(Ie(s.values,i.values),n):n=>""+(n>0?e:t)},Ne=(t,e)=>n=>jt(t,e,n);function $e(t,e,n){const s=[],i=n||("number"==typeof(o=t[0])?Ne:"string"==typeof o?we.test(o)?De:Oe:Array.isArray(o)?Ie:"object"==typeof o?Ue:Ne);var o;const r=t.length-1;for(let n=0;n<r;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=Tt(t,o)}s.push(o)}return s}function ze(e,n,{clamp:s=!0,ease:i,mixer:o}={}){const r=e.length;tt(r===n.length),tt(!i||!Array.isArray(i)||i.length===r-1),e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const a=$e(n,i,o),l=a.length,h=t=>{let n=0;if(l>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=Ft(e[n],e[n+1],t);return a[n](s)};return s?n=>h(t(e[0],e[r-1],n)):h}function Ge(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ft(0,e,s);t.push(jt(n,1,i))}}(e,t.length-1),e}const He=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function We(t,e,n,s){if(t===e&&n===s)return J;const i=e=>function(t,e,n,s,i){let o,r,a=0;do{r=e+(n-e)/2,o=He(r,s,i)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:He(i(t),e,s)}const qe=t=>1-Math.sin(Math.acos(t)),Ye=fe(qe),Xe=me(Ye),Ke=We(.33,1.53,.69,.99),Ze=fe(Ke),_e=me(Ze),Je={linear:J,easeIn:ge,easeInOut:ve,easeOut:ye,circIn:qe,circInOut:Xe,circOut:Ye,backIn:Ze,backInOut:_e,backOut:Ke,anticipate:t=>(t*=2)<1?.5*Ze(t):.5*(2-Math.pow(2,-10*(t-1)))},Qe=t=>{if(Array.isArray(t)){tt(4===t.length);const[e,n,s,i]=t;return We(e,n,s,i)}return"string"==typeof t?Je[t]:t};function tn({keyframes:t,ease:e=ve,times:n,duration:s=300}){t=[...t];const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Qe):Qe(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:Ge(t),s);function a(){return ze(r,t,{ease:Array.isArray(i)?i:(e=t,n=i,e.map(()=>n||ve).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=s,o),flipTarget:()=>{t.reverse(),l=a()}}}function en({duration:e=800,bounce:n=.25,velocity:s=0,mass:i=1}){let o,r;Q(e<=1e4);let a=1-n;a=t(.05,1,a),e=t(.01,10,e/1e3),a<1?(o=t=>{const n=t*a,i=n*e;return.001-(n-s)/nn(t,a)*Math.exp(-i)},r=t=>{const n=t*a*e,i=n*s+s,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),h=nn(Math.pow(t,2),a);return(.001-o(t)>0?-1:1)*((i-r)*l)/h}):(o=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(s-t)));const l=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(o,r,5/e);if(e*=1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(l,2)*i;return{stiffness:t,damping:2*a*Math.sqrt(i*t),duration:e}}}function nn(t,e){return t*Math.sqrt(1-e*e)}function sn(t,e){return e?t*(1e3/e):0}const on=["duration","bounce"],rn=["stiffness","damping","mass"];function an(t,e){return e.some(e=>void 0!==t[e])}function ln({keyframes:t,restDelta:e,restSpeed:n,...s}){let i=t[0],o=t[t.length-1];const r={done:!1,value:i},{stiffness:a,damping:l,mass:h,velocity:u,duration:c,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!an(t,rn)&&an(t,on)){const n=en(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(s);let d=hn,m=u?-u/1e3:0;const f=l/(2*Math.sqrt(a*h));function g(){const t=o-i,s=Math.sqrt(a/h)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=nn(s,f);d=n=>{const i=Math.exp(-f*s*n);return o-i*((m+f*s*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)d=e=>o-Math.exp(-s*e)*(t+(m+s*t)*e);else{const e=s*Math.sqrt(f*f-1);d=n=>{const i=Math.exp(-f*s*n),r=Math.min(e*n,300);return o-i*((m+f*s*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{next:t=>{const s=d(t);if(p)r.done=t>=c;else{let i=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);i=sn(s-d(e),t-e)}else i=0;const a=Math.abs(i)<=n,l=Math.abs(o-s)<=e;r.done=a&&l}return r.value=r.done?o:s,r},flipTarget:()=>{m=-m,[i,o]=[o,i],g()}}}ln.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const hn=t=>0;const un={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:i=.5,modifyTarget:o}){const r=t[0],a={done:!1,value:r};let l=n*e;const h=r+l,u=void 0===o?h:o(h);return u!==h&&(l=u-r),{next:t=>{const e=-l*Math.exp(-t/s);return a.done=!(e>i||e<-i),a.value=a.done?u:u+e,a},flipTarget:()=>{}}},keyframes:tn,tween:tn,spring:ln};function cn(t,e,n=0){return t-e-n}const pn=t=>{const e=({delta:e})=>t(e);return{start:()=>ct.update(e,!0),stop:()=>pt.update(e)}};function dn({duration:t,driver:e=pn,elapsed:n=0,repeat:s=0,repeatType:i="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:h,onComplete:u,onRepeat:c,onUpdate:p,type:d="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,T=!0;const b=un[r.length>2?"keyframes":d]||tn,V=r[0],A=r[r.length-1];let w={done:!1,value:V};const{needsInterpolation:E}=b;E&&E(V,A)&&(y=ze([0,100],[V,A],{clamp:!1}),r=[0,100]);const S=b({...m,duration:t,keyframes:r});function C(){v++,"reverse"===i?(T=v%2==0,n=function(t,e=0,n=0,s=!0){return s?cn(e+-t,e,n):e-(t-e)+n}(n,x,o,T)):(n=cn(n,x,o),"mirror"===i&&S.flipTarget()),P=!1,c&&c()}function M(t){T||(t=-t),n+=t,P||(w=S.next(Math.max(0,n)),y&&(w.value=y(w.value)),P=T?w.done:n<=0),p&&p(w.value),P&&(0===v&&(x=void 0!==x?x:n),v<s?function(t,e,n,s){return s?t>=e+n:t<=-n}(n,x,o,T)&&C():(g&&g.stop(),u&&u()))}return a&&(l&&l(),g=e(M),g.start()),{stop:()=>{h&&h(),g&&g.stop()},set currentTime(t){n=f,M(t)},sample:e=>{n=f;const s=t&&"number"==typeof t?Math.max(.5*t,50):50;let i=0;for(M(0);i<=e;){const t=e-i;M(Math.min(t,s)),i+=s}return w}}}const mn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,fn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:mn([0,.65,.55,1]),circOut:mn([.55,0,1,.45]),backIn:mn([.31,.01,.66,-.59]),backOut:mn([.33,1.53,.69,.99])};function gn(t){if(t)return Array.isArray(t)?mn(t):fn[t]}const yn={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},vn={},xn={};for(const t in yn)xn[t]=()=>(void 0===vn[t]&&(vn[t]=yn[t]()),vn[t]);const Pn=new Set(["opacity","clipPath","filter","transform"]);function Tn(t,e,{onUpdate:n,onComplete:s,...i}){if(!(xn.waapi()&&Pn.has(e)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=i;if("spring"===i.type||!(!(h=i.ease)||Array.isArray(h)||"string"==typeof h&&fn[h])){if(i.repeat===1/0)return;const t=dn({...i,elapsed:0});let e={done:!1,value:o[0]};const n=[];let s=0;for(;!e.done&&s<2e4;)e=t.sample(s),n.push(e.value),s+=10;o=n,r=s-10,l="linear"}var h;const u=function(t,e,n,{delay:s=0,duration:i,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:s,duration:i,easing:gn(a),fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}(t.owner.current,e,o,{...i,delay:-a,duration:r,ease:l});return u.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,i)),ct.update(()=>u.cancel()),s&&s()},{get currentTime(){return u.currentTime||0},set currentTime(t){u.currentTime=t},stop:()=>{const{currentTime:e}=u;if(e){const n=dn({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}ct.update(()=>u.cancel())}}}function bn(t,e){const n=performance.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(pt.read(s),t(o-e))};return ct.read(s,!0),()=>pt.read(s)}function Vn({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const i=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:bn(i,-e)}:i()}const An={type:"spring",stiffness:500,damping:25,restSpeed:10},wn={type:"keyframes",duration:.8},En={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Sn=(t,{keyframes:e})=>e.length>2?wn:h.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:An:En,Cn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Fe.test(e)||e.startsWith("url("))),Mn=new Set(["brightness","contrast","saturate","opacity"]);function Dn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(s)||[];if(!i)return t;const o=n.replace(i,"");let r=Mn.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+o+")"}const Ln=/([a-z-]*)\(.*?\)/g,Rn={...Fe,getAnimatableNone:t=>{const e=t.match(Ln);return e?e.map(Dn).join(" "):t}},kn={...u,color:we,backgroundColor:we,outlineColor:we,fill:we,stroke:we,borderColor:we,borderTopColor:we,borderRightColor:we,borderBottomColor:we,borderLeftColor:we,filter:Rn,WebkitFilter:Rn},Bn=t=>kn[t];function Fn(t,e){let n=Bn(t);return n!==Rn&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function jn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function In(t){return"number"==typeof t?0:Fn("",t)}function Un(t,e){return t[e]||t.default||t}const On=(t,e,n,s={})=>i=>{const o=Un(s,t)||{},r=o.delay||s.delay||0;let{elapsed:a=0}=s;a-=yt(r);const l=function(t,e,n,s){const i=Cn(e,n);let o=void 0!==s.from?s.from:t.get();return"none"===o&&i&&"string"==typeof n?o=Fn(e,n):jn(o)&&"string"==typeof n?o=In(n):!Array.isArray(n)&&jn(n)&&"string"==typeof o&&(n=In(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),h=l[0],u=l[l.length-1],c=Cn(t,h),p=Cn(t,u);let d={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(!c||!p||de||!1===o.type)return Vn(d);if("inertia"===o.type)return function({keyframes:t,velocity:e=0,min:n,max:s,power:i=.8,timeConstant:o=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:h,driver:u,onUpdate:c,onComplete:p,onStop:d}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==s&&t>s}function y(t){return void 0===n?s:void 0===s||Math.abs(n-t)<Math.abs(s-t)?n:s}function v(t){f&&f.stop(),f=dn({keyframes:[0,1],velocity:0,...t,driver:u,onUpdate:e=>{c&&c(e),t.onUpdate&&t.onUpdate(e)},onComplete:p,onStop:d})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=i*e+m;void 0!==h&&(t=h(t));const s=y(t),r=s===n?-1:1;let a,u;const c=t=>{a=u,u=t,e=sn(t-a,ot.delta),(1===r&&t>s||-1===r&&t<s)&&x({keyframes:[t,s],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:i,restDelta:l,modifyTarget:h,onUpdate:g(t)?c:void 0})}return{stop:()=>f&&f.stop()}}(d);if(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length}(o)||(d={...d,...Sn(t,d)}),d.duration&&(d.duration=yt(d.duration)),d.repeatDelay&&(d.repeatDelay=yt(d.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=Tn(e,t,d);if(n)return n}return dn(d)},Nn=new WeakMap;class $n{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;this.panSession=new Vt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(nt(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:s,onDragStart:i}=this.getProps();if(n&&!s&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=kt(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kt(t=>{let e=this.getAxisMotionValue(t).get()||0;if(a.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const s=n.layout.layoutBox[t];if(s){e=It(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),i&&i(t,e);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:s,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(s&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&i(t,e)}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!zn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},s){return void 0!==e&&t<e?t=s?jt(e,t,s.min):Math.max(t,e):void 0!==n&&t>n&&(t=s?jt(n,t,s.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},s=this.constraints;t&&c(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:s,right:i}){return{x:Ht(t.x,n,i),y:Ht(t.y,e,s)}}(n.layoutBox,t),this.elastic=function(t=qt){return!1===t?t=0:!0===t&&(t=qt),{x:Yt(t,"left","right"),y:Yt(t,"top","bottom")}}(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Kt(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!c(t))return!1;const n=t.current;tt(null!==n);const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=function(t,e,n){const s=pe(t,n),{scroll:i}=e;return i&&(ae(s.x,i.offset.x),ae(s.y,i.offset.y)),s}(n,s.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Wt(t.x,e.x),y:Wt(t.y,e.y)}}(s.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Zt(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Kt(r=>{if(!zn(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=s?200:1e6,u=s?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(On(t,n,0,e))}stopAnimation(){Kt(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),s=n[e];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Kt(e=>{const{drag:n}=this.getProps();if(!zn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:n,max:o}=s.layout.layoutBox[e];i.set(t[e]-jt(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!c(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Kt(e=>{const n=this.getAxisMotionValue(e);if(n){const s=n.get();i[e]=function(e,n){let s=.5;const i=It(e),o=It(n);return o>i?s=Ft(n.min,n.max-i,e.min):i>o&&(s=Ft(e.min,e.max-o,n.min)),t(0,1,s)}({min:s,max:s},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Kt(t=>{if(!zn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:s,max:o}=this.constraints[t];n.set(jt(s,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;Nn.set(this.visualElement,this);const t=xt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();c(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,s=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=vt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Kt(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=qt,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:r}}}function zn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Gn(t,e){-1===t.indexOf(e)&&t.push(e)}function Hn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Wn{constructor(){this.subscriptions=[]}add(t){return Gn(this.subscriptions,t),()=>Hn(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class qn{constructor(t,e={}){var n;this.version="9.1.2",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:s}=ot;this.lastUpdated!==s&&(this.timeDelta=n,this.lastUpdated=s,ct.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ct.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Wn);const n=this.events[t].add(e);return"change"===t?()=>{n(),ct.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?sn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yn(t,e){return new qn(t,e)}const Xn=["TopLeft","TopRight","BottomLeft","BottomRight"],Kn=Xn.length,Zn=t=>"string"==typeof t?parseFloat(t):t,_n=t=>"number"==typeof t||d.test(t);function Jn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Qn=es(0,.5,Ye),ts=es(.5,.95,J);function es(t,e,n){return s=>s<t?0:s>e?1:n(Ft(t,e,s))}function ns(t,e){t.min=e.min,t.max=e.max}function ss(t,e){ns(t.x,e.x),ns(t.y,e.y)}function is(t,e,n,s,i){return t=ne(t-=e,1/n,s),void 0!==i&&(t=ne(t,1/i,s)),t}function os(t,e,[n,s,i],o,r){!function(t,e=0,n=1,s=.5,i,o=t,r=t){if(a.test(e)){e=parseFloat(e);e=jt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let l=jt(o.min,o.max,s);t===o&&(l-=e),t.min=is(t.min,e,n,l,i),t.max=is(t.max,e,n,l,i)}(t,e[n],e[s],e[i],e.scale,o,r)}const rs=["x","scaleX","originX"],as=["y","scaleY","originY"];function ls(t,e,n,s){os(t.x,e,rs,n?n.x:void 0,s?s.x:void 0),os(t.y,e,as,n?n.y:void 0,s?s.y:void 0)}function hs(t){return 0===t.translate&&1===t.scale}function us(t){return hs(t.x)&&hs(t.y)}function cs(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function ps(t){return It(t.x)/It(t.y)}class ds{constructor(){this.members=[]}add(t){Gn(this.members,t),t.scheduleRender()}remove(t){if(Hn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ms(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(s=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(s+=`rotate(${t}deg) `),e&&(s+=`rotateX(${e}deg) `),i&&(s+=`rotateY(${i}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(s+=`scale(${r}, ${a})`),s||"none"}const fs=(t,e)=>t.depth-e.depth;class gs{constructor(){this.children=[],this.isDirty=!1}add(t){Gn(this.children,t),this.isDirty=!0}remove(t){Hn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fs),this.isDirty=!1,this.children.forEach(t)}}const ys=["","X","Y","Z"];let vs=0;function xs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(t,n={},s=(null==e?void 0:e())){this.id=vs++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(bs),this.nodes.forEach(Ss),this.nodes.forEach(Cs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new gs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Wn),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:s,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(i||s)&&(this.isLayoutDirty=!0),t){let n;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=bn(s,250),m.hasAnimatedSinceResize&&(m.hasAnimatedSinceResize=!1,this.nodes.forEach(Es))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&o&&(s||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||o.getDefaultTransition()||Bs,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!cs(this.targetLayout,s)||n,h=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);const e={...Un(i,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Es(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pt.preRender(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(Ms),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(As);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Fs),this.potentialNodes.clear()),this.nodes.forEach(ws),this.nodes.forEach(Ps),this.nodes.forEach(Ts),this.clearAllSnapshots(),dt.update(),dt.preRender(),dt.render())}clearAllSnapshots(){this.nodes.forEach(Vs),this.sharedNodes.forEach(Ds)}scheduleUpdateProjection(){ct.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!us(this.projectionDelta),n=this.getTransformTemplate(),s=n?n(this.latestValues,""):void 0,o=s!==this.prevTransformTemplateValue;t&&(e||Qt(this.latestValues)||o)&&(i(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var s;return t&&(n=this.removeTransform(n)),js((s=n).x),js(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(ae(e.x,n.offset.x),ae(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ss(e,t);for(let n=0;n<this.path.length;n++){const s=this.path[n],{scroll:i,options:o}=s;if(s!==this.root&&i&&o.layoutScroll){if(i.isRoot){ss(e,t);const{scroll:n}=this.root;n&&(ae(e.x,-n.offset.x),ae(e.y,-n.offset.y))}ae(e.x,i.offset.x),ae(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};ss(n,t);for(let t=0;t<this.path.length;t++){const s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ce(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),Qt(s.latestValues)&&ce(n,s.latestValues)}return Qt(this.latestValues)&&ce(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ss(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Qt(n.latestValues))continue;Jt(n.latestValues)&&n.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};ss(s,n.measurePageBox()),ls(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,s)}return Qt(this.latestValues)&&ls(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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}resolveTargetDelta(){const t=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:e,layoutId:n}=this.options;if(this.layout&&(e||n)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Gt(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),ss(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var s,i,o;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(s=this.target,i=this.relativeTarget,o=this.relativeParent.target,$t(s.x,i.x,o.x),$t(s.y,i.y,o.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ss(this.target,this.layout.layoutBox),oe(this.target,this.targetDelta)):ss(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Gt(this.relativeTargetOrigin,this.target,t.target),ss(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Jt(this.parent.latestValues)&&!te(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta||this.parent.options.layoutRoot)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){const{isProjectionDirty:t,isTransformDirty:e}=this;this.isProjectionDirty=this.isTransformDirty=!1;const n=this.getLead(),s=Boolean(this.resumingFrom)||this!==n;let i=!0;if(t&&(i=!1),s&&e&&(i=!1),i)return;const{layout:o,layoutId:r}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!r)return;ss(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,s=!1){const i=n.length;if(!i)return;let o,r;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ce(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,oe(t,r)),s&&Qt(o.latestValues)&&ce(t,o.latestValues))}e.x=re(e.x),e.y=re(e.y)}(this.layoutCorrected,this.treeScale,this.path,s);const{target:a}=n;if(!a)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const l=this.treeScale.x,h=this.treeScale.y,u=this.projectionTransform;Nt(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.projectionTransform=ms(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===l&&this.treeScale.y===h||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,s=n?n.latestValues:{},i={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(ks));this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var h,p,d,m;Ls(o.x,t.x,n),Ls(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gt(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,d=r,m=n,Rs(h.x,p.x,d.x,m),Rs(h.y,p.y,d.y,m)),l&&(this.animationValues=i,function(t,e,n,s,i,o){i?(t.opacity=jt(0,void 0!==n.opacity?n.opacity:1,Qn(s)),t.opacityExit=jt(void 0!==e.opacity?e.opacity:1,0,ts(s))):o&&(t.opacity=jt(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,s));for(let i=0;i<Kn;i++){const o=`border${Xn[i]}Radius`;let r=Jn(e,o),l=Jn(n,o);if(void 0===r&&void 0===l)continue;r||(r=0),l||(l=0);0===r||0===l||_n(r)===_n(l)?(t[o]=Math.max(jt(Zn(r),Zn(l),s),0),(a.test(l)||a.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||n.rotate)&&(t.rotate=jt(e.rotate||0,n.rotate||0,s))}(i,s,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ct.update(()=>{m.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const s=p(t)?t:Yn(t);return s.start(On("",s,e,n)),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:s,latestValues:i}=t;if(e&&n&&s){if(this!==t&&this.layout&&s&&Is(this.options.animationType,this.layout.layoutBox,s.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=It(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const s=It(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+s}ss(e,n),ce(e,i),Nt(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new ds);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const s=this.getStack();s&&s.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const s={};for(let e=0;e<ys.length;e++){const i="rotate"+ys[e];n[i]&&(s[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in s)t.setStaticValue(e,s[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const s={};if(!this.instance||this.isSVG)return s;if(!this.isVisible)return{visibility:"hidden"};s.visibility="";const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=f(t.pointerEvents)||"",s.transform=i?i(this.latestValues,""):"none",s;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=f(t.pointerEvents)||""),this.hasProjected&&!Qt(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),s.transform=ms(this.projectionDeltaWithTransform,this.treeScale,r),i&&(s.transform=i(r,s.transform));const{x:a,y:l}=this.projectionDelta;s.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?s.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:s.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in g){if(void 0===r[t])continue;const{correct:e,applyTo:n}=g[t],i="none"===s.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)s[n[e]]=i}else s[t]=i}return this.options.layoutId&&(s.pointerEvents=o===this?f(t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(As),this.root.sharedNodes.clear()}}}function Ps(t){t.updateLayout()}function Ts(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?Kt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=It(s);s.min=e[t].min,s.max=s.min+i}):Is(i,n.layoutBox,e)&&Kt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=It(e[t]);s.max=s.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Nt(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Nt(a,t.applyTransform(s,!0),n.measuredBox):Nt(a,e,n.layoutBox);const l=!us(r);let h=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:i,layout:o}=s;if(i&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Gt(r,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Gt(a,e,o.layoutBox),cs(r,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function bs(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Vs(t){t.clearSnapshot()}function As(t){t.clearMeasurements()}function ws(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Es(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Ss(t){t.resolveTargetDelta()}function Cs(t){t.calcProjection()}function Ms(t){t.resetRotation()}function Ds(t){t.removeLeadSnapshot()}function Ls(t,e,n){t.translate=jt(e.translate,0,n),t.scale=jt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Rs(t,e,n,s){t.min=jt(e.min,n.min,s),t.max=jt(e.max,n.max,s)}function ks(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Bs={duration:.45,ease:[.4,0,.1,1]};function Fs(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const s=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);s&&t.mount(s,!0)}function js(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Is(t,e,n){return"position"===t||"preserve-aspect"===t&&!Ut(ps(e),ps(n),.2)}const Us=xs({attachResizeListener:(t,e)=>vt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Os={current:void 0},Ns=xs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Os.current){const t=new Us(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Os.current=t}return Os.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function $s(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const zs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!d.test(t))return t;t=parseFloat(t)}return`${$s(t,e.target.x)}% ${$s(t,e.target.y)}%`}},Gs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Hs(t,e,n=1){const[s,i]=function(t){const e=Gs.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);return o?o.trim():y(i)?Hs(i,e,n+1):i}const Ws={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=t.includes("var("),o=[];i&&(t=t.replace(Gs,t=>(o.push(t),"_$css")));const r=Fe.parse(t);if(r.length>5)return s;const a=Fe.createTransformer(t),l="number"!=typeof r[0]?1:0,h=n.x.scale*e.x,u=n.y.scale*e.y;r[0+l]/=h,r[1+l]/=u;const c=jt(h,u,.5);"number"==typeof r[2+l]&&(r[2+l]/=c),"number"==typeof r[3+l]&&(r[3+l]/=c);let p=a(r);if(i){let t=0;p=p.replace("_$css",()=>{const e=o[t];return t++,e})}return p}},qs=t=>/^0[^.\s]+$/.test(t),Ys=t=>e=>e.test(t),Xs=[r,d,a,v,x,P,{test:t=>"auto"===t,parse:t=>t}],Ks=t=>Xs.find(Ys(t)),Zs=[...Xs,we,Fe],_s=t=>Zs.find(Ys(t));function Js(t,e,n){const s=t.getProps();return T(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Qs(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Yn(n))}function ti(t,e){if(!e)return;return(e[t]||e.default||e).from}const ei=new Set(["width","height","top","left","right","bottom","x","y"]),ni=t=>ei.has(t),si=t=>t===r||t===d,ii=(t,e)=>parseFloat(t.split(", ")[e]),oi=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/);if(i)return ii(i[1],e);{const e=s.match(/^matrix\((.+)\)$/);return e?ii(e[1],t):0}},ri=new Set(["x","y","z"]),ai=V.filter(t=>!ri.has(t));const li={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:oi(4,13),y:oi(5,14)},hi=(t,e,n={},s={})=>{e={...e},s={...s};const i=Object.keys(e).filter(ni);let o=[],r=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let h=n[i],u=Ks(h);const c=e[i];let p;if(A(c)){const t=c.length,e=null===c[0]?1:0;h=c[e],u=Ks(h);for(let n=e;n<t;n++)p?tt(Ks(c[n])===p):p=Ks(c[n])}else p=Ks(c);if(u!==p)if(si(u)&&si(p)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof c?e[i]=parseFloat(c):Array.isArray(c)&&p===d&&(e[i]=c.map(parseFloat))}else(null==u?void 0:u.transform)&&(null==p?void 0:p.transform)&&(0===h||0===c)?0===h?l.set(p.transform(h)):e[i]=u.transform(c):(r||(o=function(t){const e=[];return ai.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(i),s[i]=void 0!==s[i]?s[i]:e[i],l.jump(c))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const s=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:r}=o,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=li[t](s,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const s=e.getValue(n);s&&s.jump(a[n]),t[n]=li[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),w&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:s}}return{target:e,transitionEnd:s}};function ui(t,e,n,s){return(t=>Object.keys(t).some(ni))(e)?hi(t,e,n,s):{target:e,transitionEnd:s}}const ci=(t,e,n,s)=>{const i=function(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!y(e))return;const n=Hs(e,s);n&&t.set(n)});for(const t in e){const i=e[t];if(!y(i))continue;const o=Hs(i,s);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,s);return ui(t,e=i.target,n,s=i.transitionEnd)},pi={current:null},di={current:!1};function mi(t){return Boolean(p(t)&&t.add)}const fi=Object.keys(M),gi=fi.length,yi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],vi=E.length;class xi extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>ct.render(this.render,!1,!0);const{latestValues:r,renderState:a}=i;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=S(e),this.isVariantNode=C(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...h}=this.scrapeMotionValuesFromProps(e,{});for(const t in h){const e=h[t];void 0!==r[t]&&p(e)&&(e.set(r[t],!1),mi(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),di.current||function(){if(di.current=!0,w)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>pi.current=t.matches;t.addListener(e),e()}else pi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||pi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pt.update(this.notifyUpdate),pt.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=h.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&ct.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,i,o){let r,a;for(let t=0;t<gi;t++){const n=fi[t],{isEnabled:s,Feature:i,ProjectionNode:o,MeasureLayout:l}=M[n];o&&(r=o),s(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(a=l))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:h}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||a&&c(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<yi.length;e++){const n=yi[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(p(o))t.addValue(i,o),mi(s)&&s.add(i);else if(p(r))t.addValue(i,Yn(o,{owner:t})),mi(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Yn(void 0!==e?e:o,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<vi;t++){const n=E[t],s=this.props[n];(D(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Yn(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,s="string"==typeof n||"object"==typeof n?null===(e=T(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||p(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Wn),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:s},i){let o=function(t,e,n){const s={};for(const i in t){const t=ti(i,e);if(void 0!==t)s[i]=t;else{const t=n.getValue(i);t&&(s[i]=t.get())}}return s}(n,t||{},this);if(s&&(e&&(e=s(e)),n&&(n=s(n)),o&&(o=s(o))),i){!function(t,e,n){var s,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),r=o.length;if(r)for(let a=0;a<r;a++){const r=o[a],l=e[r];let h=null;Array.isArray(l)&&(h=l[0]),null===h&&(h=null!==(i=null!==(s=n[r])&&void 0!==s?s:t.readValue(r))&&void 0!==i?i:e[r]),null!=h&&("string"==typeof h&&(/^\-?\d*\.?\d+$/.test(h)||qs(h))?h=parseFloat(h):!_s(h)&&Fe.test(l)&&(h=Fn(r,l)),t.addValue(r,Yn(h,{owner:t})),void 0===n[r]&&(n[r]=h),null!==h&&t.setBaseTarget(r,h))}}(this,n,o);const t=ci(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Pi extends xi{readValueFromInstance(t,e){if(h.has(e)){const t=Bn(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(L(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return pe(t,e)}build(t,e,n,s){R(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return k(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;p(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){B(t,e,n,s)}}class Ti extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:s}=this.props,{projection:i}=t;j(Vi),i&&(e.group&&e.group.add(i),n&&n.register&&s&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),m.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:s,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,s||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ct.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bi(t){const[e,n]=function(){const t=X(F);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=K();return Z(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),s=X(I);return Y.createElement(Ti,{...t,layoutGroup:s,switchLayoutGroup:X(U),isPresent:e,safeToRemove:n})}const Vi={borderRadius:{...zs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zs,borderTopRightRadius:zs,borderBottomLeftRadius:zs,borderBottomRightRadius:zs,boxShadow:Ws},Ai={pan:{Feature:class extends _{constructor(){super(...arguments),this.removePointerDownListener=J}onPointerDown(t){this.session=new Vt(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,s&&s(t,e)}}}mount(){this.removePointerDownListener=xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends _{constructor(t){super(t),this.removeGroupControls=J,this.removeListeners=J,this.controls=new $n(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||J}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Ns,MeasureLayout:bi}},wi={layout:{ProjectionNode:Ns,MeasureLayout:bi}};function Ei(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}const Si="data-"+O("framerAppearId");function Ci(t,e,n={}){const s=Js(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Mi(t,s,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(Di).forEach((t,s)=>{t.notify("AnimationStart",e),r.push(Ci(t,e,{...o,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+s,r,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(e)}return Promise.all([o(),r(n.delay)])}function Mi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e),i=a[e];if(!s||void 0===i||c&&Li(c,e))continue;const r={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!s.hasAnimated){const n=t.getProps()[Si];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,s,ct))}let p=s.start(On(e,s,i,t.shouldReduceMotion&&h.has(e)?{type:!1}:r));mi(l)&&(l.add(e),p=p.then(()=>l.remove(e))),u.push(p)}return Promise.all(u).then(()=>{r&&function(t,e){const n=Js(t,e);let{transitionEnd:s={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...s};for(const e in o){Qs(t,e,b(o[e]))}}(t,r)})}function Di(t,e){return t.sortNodePosition(e)}function Li({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}const Ri=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ki=[...Ri].reverse(),Bi=Ri.length;function Fi(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Ci(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=Ci(t,e,n);else{const i="function"==typeof e?Js(t,e,n.custom):e;s=Mi(t,i,n)}return s.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function ji(t){let e=Fi(t);const n={animate:Ui(!0),whileInView:Ui(),whileHover:Ui(),whileTap:Ui(),whileDrag:Ui(),whileFocus:Ui(),exit:Ui()};let s=!0;const i=(e,n)=>{const s=Js(t,n);if(s){const{transition:t,transitionEnd:n,...i}=s;e={...e,...i,...n}}return e};function o(o,r){const a=t.getProps(),l=t.getVariantContext(!0)||{},h=[],u=new Set;let c={},p=1/0;for(let e=0;e<Bi;e++){const d=ki[e],m=n[d],f=void 0!==a[d]?a[d]:l[d],g=D(f),y=d===r?m.isActive:null;!1===y&&(p=e);let v=f===l[d]&&f!==a[d]&&g;if(v&&s&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...c},!m.isActive&&null===y||!f&&!m.prevProp||N(f)||"boolean"==typeof f)continue;const x=Ii(m.prevProp,f);let P=x||d===r&&m.isActive&&!v&&g||e>p&&g;const T=Array.isArray(f)?f:[f];let b=T.reduce(i,{});!1===y&&(b={});const{prevResolvedValues:V={}}=m,w={...V,...b},E=t=>{P=!0,u.delete(t),m.needsAnimating[t]=!0};for(const t in w){const e=b[t],n=V[t];c.hasOwnProperty(t)||(e!==n?A(e)&&A(n)?!Ei(e,n)||x?E(t):m.protectedKeys[t]=!0:void 0!==e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=b,m.isActive&&(c={...c,...b}),s&&t.blockInitialAnimation&&(P=!1),P&&!v&&h.push(...T.map(t=>({animation:t,options:{type:d,...o}})))}if(u.size){const e={};u.forEach(n=>{const s=t.getBaseTarget(n);void 0!==s&&(e[n]=s)}),h.push({animation:e})}let d=Boolean(h.length);return s&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),s=!1,d?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,s,i){var r;if(n[e].isActive===s)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Ii(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ei(e,t)}function Ui(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let Oi=0;const Ni={animation:{Feature:class extends _{constructor(t){super(t),t.animationState||(t.animationState=ji(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),N(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends _{constructor(){super(...arguments),this.id=Oi++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function $i(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End");return xt(t.current,n,(n,i)=>{if("touch"===n.type||Bt())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[s]&&o[s](n,i)},{passive:!t.getProps()[s]})}const zi=(t,e)=>!!e&&(t===e||zi(t,e.parentElement));function Gi(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,nt(n))}const Hi=new WeakMap,Wi=new WeakMap,qi=t=>{const e=Hi.get(t.target);e&&e(t)},Yi=t=>{t.forEach(qi)};function Xi(t,e,n){const s=function({root:t,...e}){const n=t||document;Wi.has(n)||Wi.set(n,{});const s=Wi.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Yi,{root:t,...e})),s[i]}(e);return Hi.set(t,n),s.observe(t),()=>{Hi.delete(t),s.unobserve(t)}}const Ki={some:0,all:1};const Zi={inView:{Feature:class extends _{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:t}=this.node.getProps();t&&t(null),this.node.animationState&&this.node.animationState.setActive("whileInView",!0)})}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i,fallback:o=!0}=t;if("undefined"==typeof IntersectionObserver)return void(o&&this.viewportFallback());const r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Ki[s]};return Xi(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),o=e?n:s;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends _{constructor(){super(...arguments),this.removeStartListeners=J,this.removeEndListeners=J,this.removeAccessibleListeners=J,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=xt(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:s}=this.node.getProps();zi(this.node.current,t.target)?n&&n(t,e):s&&s(t,e)},{passive:!(n.onTap||n.onPointerUp)}),i=xt(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Tt(s,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=vt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=vt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&Gi("up",this.node.getProps().onTap)}),Gi("down",(t,e)=>{this.startPress(t,e)})}),e=vt(this.node.current,"blur",()=>{this.isPressing&&Gi("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Tt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Bt()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=xt(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=vt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Tt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends _{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Tt(vt(this.node.current,"focus",()=>this.onFocus()),vt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends _{mount(){this.unmount=Tt($i(this.node,!0),$i(this.node,!1))}unmount(){}}}};class _i extends xi{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(h.has(e)){const t=Bn(e);return t&&t.default||0}return e=$.has(e)?e:O(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return z(t,e)}build(t,e,n,s){G(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){H(t,e,n,s)}mount(t){this.isSVGTag=W(t.tagName),super.mount(t)}}const Ji={...{renderer:(t,e)=>q(t)?new _i(e,{enableHardwareAcceleration:!1}):new Pi(e,{enableHardwareAcceleration:!0}),...Ni,...Zi},...Ai,...wi};export{Ji as domMax};
|
|
1
|
+
import{t,u as e,v as n,w as s,x as i,y as o,z as r,A as a,B as l,C as h,D as c,a as u,d,E as p,g as m,r as f,F as g,G as y,H as v,I as x,J as P,o as T,K as b,M as V,N as S,i as A,O as w,b as E,m as C,f as D,c as M,Q as L,h as R,q as k,R as j,P as B,T as F,L as I,S as U,U as O,n as N,V as $,s as z,j as G,p as H,k as W,l as q}from"./size-rollup-dom-max-assets.js";import Y,{useContext as X,useId as K,useEffect as Z}from"react";class _{constructor(t){this.isMounted=!1,this.node=t}update(){}}const J=t=>t;let Q=J,tt=J;const et=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function nt(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const st="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),it="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(st()),1/60*1e3);const ot={delta:0,timestamp:0};let rt=!0,at=!1,lt=!1;const ht=["read","update","preRender","render","postRender"],ct=ht.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,h=l?e:n;return o&&r.add(t),-1===h.indexOf(t)&&(h.push(t),l&&i&&(s=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let n=0;n<s;n++){const s=e[n];s(l),r.has(s)&&(a.schedule(s),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>at=!0),t),{}),ut=ht.reduce((t,e)=>{const n=ct[e];return t[e]=(t,e=!1,s=!1)=>(at||gt(),n.schedule(t,e,s)),t},{}),dt=ht.reduce((t,e)=>(t[e]=ct[e].cancel,t),{}),pt=ht.reduce((t,e)=>(t[e]=()=>ct[e].process(ot),t),{}),mt=t=>ct[t].process(ot),ft=t=>{at=!1,ot.delta=rt?1/60*1e3:Math.max(Math.min(t-ot.timestamp,40),1),ot.timestamp=t,lt=!0,ht.forEach(mt),lt=!1,at&&(rt=!1,it(ft))},gt=()=>{at=!0,rt=!0,lt||it(ft)},yt=t=>1e3*t;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,(t=>e=>et(e)&&t(e,nt(e)))(n),s)}const Pt=(t,e)=>n=>e(t(n)),Tt=(...t)=>t.reduce(Pt),bt=(t,e)=>Math.abs(t-e);class Vt{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=wt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=bt(t.x,e.x),s=bt(t.y,e.y);return Math.sqrt(n**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:s}=t,{timestamp:i}=ot;this.history.push({...s,timestamp:i});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=St(e,this.transformPagePoint),ut.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:s}=this.handlers,i=wt("pointercancel"===t.type?this.lastMoveEventInfo:St(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),s&&s(t,i)},!et(t))return;this.handlers=e,this.transformPagePoint=n;const s=St(nt(t),this.transformPagePoint),{point:i}=s,{timestamp:o}=ot;this.history=[{...i,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,wt(s,this.history)),this.removeListeners=Tt(xt(window,"pointermove",this.handlePointerMove),xt(window,"pointerup",this.handlePointerUp),xt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),dt.update(this.updatePoint)}}function St(t,e){return e?{point:e(t.point)}:t}function At(t,e){return{x:t.x-e.x,y:t.y-e.y}}function wt({point:t},e){return{point:t,delta:At(t,Ct(e)),offset:At(t,Et(e)),velocity:Dt(e,.1)}}function Et(t){return t[0]}function Ct(t){return t[t.length-1]}function Dt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ct(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>yt(e)));)n--;if(!s)return{x:0,y:0};const o=(i.timestamp-s.timestamp)/1e3;if(0===o)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Mt(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Lt=Mt("dragHorizontal"),Rt=Mt("dragVertical");function kt(t){let e=!1;if("y"===t)e=Rt();else if("x"===t)e=Lt();else{const t=Lt(),n=Rt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function jt(){const t=kt(!0);return!t||(t(),!1)}const Bt=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},Ft=(t,e,n)=>-n*t+n*e+t;function It(t){return t.max-t.min}function Ut(t,e=0,n=.01){return Math.abs(t-e)<=n}function Ot(t,e,n,s=.5){t.origin=s,t.originPoint=Ft(e.min,e.max,t.origin),t.scale=It(n)/It(e),(Ut(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ft(n.min,n.max,t.origin)-t.originPoint,(Ut(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Nt(t,e,n,s){Ot(t.x,e.x,n.x,s?s.originX:void 0),Ot(t.y,e.y,n.y,s?s.originY:void 0)}function $t(t,e,n){t.min=n.min+e.min,t.max=t.min+It(e)}function zt(t,e,n){t.min=e.min-n.min,t.max=t.min+It(e)}function Gt(t,e,n){zt(t.x,e.x,n.x),zt(t.y,e.y,n.y)}function Ht(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Wt(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}}const qt=.35;function Yt(t,e,n){return{min:Xt(t,e),max:Xt(t,n)}}function Xt(t,e){return"number"==typeof t?t:t[e]||0}function Kt(t){return[t("x"),t("y")]}function Zt({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function _t(t){return void 0===t||1===t}function Jt({scale:t,scaleX:e,scaleY:n}){return!_t(t)||!_t(e)||!_t(n)}function Qt(t){return Jt(t)||te(t)||t.z||t.rotate||t.rotateX||t.rotateY}function te(t){return ee(t.x)||ee(t.y)}function ee(t){return t&&"0%"!==t}function ne(t,e,n){return n+e*(t-n)}function se(t,e,n,s,i){return void 0!==i&&(t=ne(t,i,s)),ne(t,n,s)+e}function ie(t,e=0,n=1,s,i){t.min=se(t.min,e,n,s,i),t.max=se(t.max,e,n,s,i)}function oe(t,{x:e,y:n}){ie(t.x,e.translate,e.scale,e.originPoint),ie(t.y,n.translate,n.scale,n.originPoint)}function re(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ae(t,e){t.min=t.min+e,t.max=t.max+e}function le(t,e,[n,s,i]){const o=void 0!==e[i]?e[i]:.5,r=Ft(t.min,t.max,o);ie(t,e[n],e[s],r,e.scale)}const he=["x","scaleX","originX"],ce=["y","scaleY","originY"];function ue(t,e){le(t.x,e,he),le(t.y,e,ce)}function de(t,e){return Zt(function(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}}(t.getBoundingClientRect(),e))}const pe=!1,me=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,fe=t=>e=>1-t(1-e),ge=t=>t*t,ye=fe(ge),ve=me(ge),xe=(t,s)=>i=>Boolean(e(i)&&n.test(i)&&i.startsWith(t)||s&&Object.prototype.hasOwnProperty.call(i,s)),Pe=(t,n,i)=>o=>{if(!e(o))return o;const[r,a,l,h]=o.match(s);return{[t]:parseFloat(r),[n]:parseFloat(a),[i]:parseFloat(l),alpha:void 0!==h?parseFloat(h):1}},Te={...r,transform:e=>Math.round((e=>t(0,255,e))(e))},be={test:xe("rgb","red"),parse:Pe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Te.transform(t)+", "+Te.transform(e)+", "+Te.transform(n)+", "+i(o.transform(s))+")"};const Ve={test:xe("#"),parse:function(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}},transform:be.transform},Se={test:xe("hsl","hue"),parse:Pe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+a.transform(i(e))+", "+a.transform(i(n))+", "+i(o.transform(s))+")"},Ae={test:t=>be.test(t)||Ve.test(t)||Se.test(t),parse:t=>be.test(t)?be.parse(t):Se.test(t)?Se.parse(t):Ve.parse(t),transform:t=>e(t)?t:t.hasOwnProperty("red")?be.transform(t):Se.transform(t)};function we(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Ee=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},Ce=[Ve,be,Se];function De(t){const e=(n=t,Ce.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Se&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,o=0,r=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=we(a,s,t+1/3),o=we(a,s,t),r=we(a,s,t-1/3)}else i=o=r=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*r),alpha:s}}(s)),s}const Me=(t,e)=>{const n=De(t),s=De(e),i={...n};return t=>(i.red=Ee(n.red,s.red,t),i.green=Ee(n.green,s.green,t),i.blue=Ee(n.blue,s.blue,t),i.alpha=Ft(n.alpha,s.alpha,t),be.transform(i))};function Le(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(l);o&&(n=o.length,t=t.replace(l,"${c}"),e.push(...o.map(Ae.parse)));const a=t.match(s);return a&&(i=a.length,t=t.replace(s,"${n}"),e.push(...a.map(r.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function Re(t){return Le(t).values}function ke(t){const{values:e,numColors:n,tokenised:s}=Le(t),o=e.length;return t=>{let e=s;for(let s=0;s<o;s++)e=e.replace(s<n?"${c}":"${n}",s<n?Ae.transform(t[s]):i(t[s]));return e}}const je=t=>"number"==typeof t?0:t;const Be={test:function(t){var n,i;return isNaN(t)&&e(t)&&((null===(n=t.match(s))||void 0===n?void 0:n.length)||0)+((null===(i=t.match(l))||void 0===i?void 0:i.length)||0)>0},parse:Re,createTransformer:ke,getAnimatableNone:function(t){const e=Re(t);return ke(t)(e.map(je))}};function Fe(t,e){return"number"==typeof t?n=>Ft(t,e,n):Ae.test(t)?Me(t,e):Oe(t,e)}const Ie=(t,e)=>{const n=[...t],s=n.length,i=t.map((t,n)=>Fe(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}},Ue=(t,e)=>{const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Fe(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}},Oe=(t,e)=>{const n=Be.createTransformer(e),s=Le(t),i=Le(e);return s.numColors===i.numColors&&s.numNumbers>=i.numNumbers?Tt(Ie(s.values,i.values),n):n=>""+(n>0?e:t)},Ne=(t,e)=>n=>Ft(t,e,n);function $e(t,e,n){const s=[],i=n||("number"==typeof(o=t[0])?Ne:"string"==typeof o?Ae.test(o)?Me:Oe:Array.isArray(o)?Ie:"object"==typeof o?Ue:Ne);var o;const r=t.length-1;for(let n=0;n<r;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=Tt(t,o)}s.push(o)}return s}function ze(e,n,{clamp:s=!0,ease:i,mixer:o}={}){const r=e.length;tt(r===n.length),tt(!i||!Array.isArray(i)||i.length===r-1),e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const a=$e(n,i,o),l=a.length,h=t=>{let n=0;if(l>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=Bt(e[n],e[n+1],t);return a[n](s)};return s?n=>h(t(e[0],e[r-1],n)):h}function Ge(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Bt(0,e,s);t.push(Ft(n,1,i))}}(e,t.length-1),e}const He=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function We(t,e,n,s){if(t===e&&n===s)return J;const i=e=>function(t,e,n,s,i){let o,r,a=0;do{r=e+(n-e)/2,o=He(r,s,i)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:He(i(t),e,s)}const qe=t=>1-Math.sin(Math.acos(t)),Ye=fe(qe),Xe=me(Ye),Ke=We(.33,1.53,.69,.99),Ze=fe(Ke),_e=me(Ze),Je={linear:J,easeIn:ge,easeInOut:ve,easeOut:ye,circIn:qe,circInOut:Xe,circOut:Ye,backIn:Ze,backInOut:_e,backOut:Ke,anticipate:t=>(t*=2)<1?.5*Ze(t):.5*(2-Math.pow(2,-10*(t-1)))},Qe=t=>{if(Array.isArray(t)){tt(4===t.length);const[e,n,s,i]=t;return We(e,n,s,i)}return"string"==typeof t?Je[t]:t};function tn({keyframes:t,ease:e=ve,times:n,duration:s=300}){t=[...t];const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Qe):Qe(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:Ge(t),s);function a(){return ze(r,t,{ease:Array.isArray(i)?i:(e=t,n=i,e.map(()=>n||ve).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=s,o),flipTarget:()=>{t.reverse(),l=a()}}}function en({duration:e=800,bounce:n=.25,velocity:s=0,mass:i=1}){let o,r;Q(e<=1e4);let a=1-n;a=t(.05,1,a),e=t(.01,10,e/1e3),a<1?(o=t=>{const n=t*a,i=n*e;return.001-(n-s)/nn(t,a)*Math.exp(-i)},r=t=>{const n=t*a*e,i=n*s+s,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),h=nn(Math.pow(t,2),a);return(.001-o(t)>0?-1:1)*((i-r)*l)/h}):(o=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(s-t)));const l=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(o,r,5/e);if(e*=1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(l,2)*i;return{stiffness:t,damping:2*a*Math.sqrt(i*t),duration:e}}}function nn(t,e){return t*Math.sqrt(1-e*e)}function sn(t,e){return e?t*(1e3/e):0}const on=["duration","bounce"],rn=["stiffness","damping","mass"];function an(t,e){return e.some(e=>void 0!==t[e])}function ln({keyframes:t,restDelta:e,restSpeed:n,...s}){let i=t[0],o=t[t.length-1];const r={done:!1,value:i},{stiffness:a,damping:l,mass:h,velocity:c,duration:u,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!an(t,rn)&&an(t,on)){const n=en(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(s);let p=hn,m=c?-c/1e3:0;const f=l/(2*Math.sqrt(a*h));function g(){const t=o-i,s=Math.sqrt(a/h)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=nn(s,f);p=n=>{const i=Math.exp(-f*s*n);return o-i*((m+f*s*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>o-Math.exp(-s*e)*(t+(m+s*t)*e);else{const e=s*Math.sqrt(f*f-1);p=n=>{const i=Math.exp(-f*s*n),r=Math.min(e*n,300);return o-i*((m+f*s*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{next:t=>{const s=p(t);if(d)r.done=t>=u;else{let i=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);i=sn(s-p(e),t-e)}else i=0;const a=Math.abs(i)<=n,l=Math.abs(o-s)<=e;r.done=a&&l}return r.value=r.done?o:s,r},flipTarget:()=>{m=-m,[i,o]=[o,i],g()}}}ln.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const hn=t=>0;const cn={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:i=.5,modifyTarget:o}){const r=t[0],a={done:!1,value:r};let l=n*e;const h=r+l,c=void 0===o?h:o(h);return c!==h&&(l=c-r),{next:t=>{const e=-l*Math.exp(-t/s);return a.done=!(e>i||e<-i),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:tn,tween:tn,spring:ln};function un(t,e,n=0){return t-e-n}const dn=t=>{const e=({delta:e})=>t(e);return{start:()=>ut.update(e,!0),stop:()=>dt.update(e)}};function pn({duration:t,driver:e=dn,elapsed:n=0,repeat:s=0,repeatType:i="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:h,onComplete:c,onRepeat:u,onUpdate:d,type:p="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,T=!0;const b=cn[r.length>2?"keyframes":p]||tn,V=r[0],S=r[r.length-1];let A={done:!1,value:V};const{needsInterpolation:w}=b;w&&w(V,S)&&(y=ze([0,100],[V,S],{clamp:!1}),r=[0,100]);const E=b({...m,duration:t,keyframes:r});function C(){v++,"reverse"===i?(T=v%2==0,n=function(t,e=0,n=0,s=!0){return s?un(e+-t,e,n):e-(t-e)+n}(n,x,o,T)):(n=un(n,x,o),"mirror"===i&&E.flipTarget()),P=!1,u&&u()}function D(t){T||(t=-t),n+=t,P||(A=E.next(Math.max(0,n)),y&&(A.value=y(A.value)),P=T?A.done:n<=0),d&&d(A.value),P&&(0===v&&(x=void 0!==x?x:n),v<s?function(t,e,n,s){return s?t>=e+n:t<=-n}(n,x,o,T)&&C():(g&&g.stop(),c&&c()))}return a&&(l&&l(),g=e(D),g.start()),{stop:()=>{h&&h(),g&&g.stop()},set currentTime(t){n=f,D(t)},sample:e=>{n=f;const s=t&&"number"==typeof t?Math.max(.5*t,50):50;let i=0;for(D(0);i<=e;){const t=e-i;D(Math.min(t,s)),i+=s}return A}}}const mn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,fn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:mn([0,.65,.55,1]),circOut:mn([.55,0,1,.45]),backIn:mn([.31,.01,.66,-.59]),backOut:mn([.33,1.53,.69,.99])};function gn(t){if(t)return Array.isArray(t)?mn(t):fn[t]}const yn={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},vn={},xn={};for(const t in yn)xn[t]=()=>(void 0===vn[t]&&(vn[t]=yn[t]()),vn[t]);const Pn=new Set(["opacity","clipPath","filter","transform"]);function Tn(t,e,{onUpdate:n,onComplete:s,...i}){if(!(xn.waapi()&&Pn.has(e)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=i;if("spring"===i.type||!(!(h=i.ease)||Array.isArray(h)||"string"==typeof h&&fn[h])){if(i.repeat===1/0)return;const t=pn({...i,elapsed:0});let e={done:!1,value:o[0]};const n=[];let s=0;for(;!e.done&&s<2e4;)e=t.sample(s),n.push(e.value),s+=10;o=n,r=s-10,l="linear"}var h;const c=function(t,e,n,{delay:s=0,duration:i,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:s,duration:i,easing:gn(a),fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}(t.owner.current,e,o,{...i,delay:-a,duration:r,ease:l});return c.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,i)),ut.update(()=>c.cancel()),s&&s()},{get currentTime(){return c.currentTime||0},set currentTime(t){c.currentTime=t},stop:()=>{const{currentTime:e}=c;if(e){const n=pn({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}ut.update(()=>c.cancel())}}}function bn(t,e){const n=performance.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(dt.read(s),t(o-e))};return ut.read(s,!0),()=>dt.read(s)}function Vn({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const i=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:bn(i,-e)}:i()}const Sn={type:"spring",stiffness:500,damping:25,restSpeed:10},An={type:"keyframes",duration:.8},wn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},En=(t,{keyframes:e})=>e.length>2?An:h.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Sn:wn,Cn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Be.test(e)||e.startsWith("url("))),Dn=new Set(["brightness","contrast","saturate","opacity"]);function Mn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(s)||[];if(!i)return t;const o=n.replace(i,"");let r=Dn.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+o+")"}const Ln=/([a-z-]*)\(.*?\)/g,Rn={...Be,getAnimatableNone:t=>{const e=t.match(Ln);return e?e.map(Mn).join(" "):t}},kn={...c,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:Rn,WebkitFilter:Rn},jn=t=>kn[t];function Bn(t,e){let n=jn(t);return n!==Rn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function Fn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function In(t){return"number"==typeof t?0:Bn("",t)}function Un(t,e){return t[e]||t.default||t}const On=(t,e,n,s={})=>i=>{const o=Un(s,t)||{},r=o.delay||s.delay||0;let{elapsed:a=0}=s;a-=yt(r);const l=function(t,e,n,s){const i=Cn(e,n);let o=void 0!==s.from?s.from:t.get();return"none"===o&&i&&"string"==typeof n?o=Bn(e,n):Fn(o)&&"string"==typeof n?o=In(n):!Array.isArray(n)&&Fn(n)&&"string"==typeof o&&(n=In(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),h=l[0],c=l[l.length-1],u=Cn(t,h),d=Cn(t,c);let p={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(!u||!d||pe||!1===o.type)return Vn(p);if("inertia"===o.type)return function({keyframes:t,velocity:e=0,min:n,max:s,power:i=.8,timeConstant:o=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:h,driver:c,onUpdate:u,onComplete:d,onStop:p}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==s&&t>s}function y(t){return void 0===n?s:void 0===s||Math.abs(n-t)<Math.abs(s-t)?n:s}function v(t){f&&f.stop(),f=pn({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{u&&u(e),t.onUpdate&&t.onUpdate(e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=i*e+m;void 0!==h&&(t=h(t));const s=y(t),r=s===n?-1:1;let a,c;const u=t=>{a=c,c=t,e=sn(t-a,ot.delta),(1===r&&t>s||-1===r&&t<s)&&x({keyframes:[t,s],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:i,restDelta:l,modifyTarget:h,onUpdate:g(t)?u:void 0})}return{stop:()=>f&&f.stop()}}(p);if(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...c}){return!!Object.keys(c).length}(o)||(p={...p,...En(t,p)}),p.duration&&(p.duration=yt(p.duration)),p.repeatDelay&&(p.repeatDelay=yt(p.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=Tn(e,t,p);if(n)return n}return pn(p)},Nn=new WeakMap;class $n{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;this.panSession=new Vt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(nt(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:s,onDragStart:i}=this.getProps();if(n&&!s&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=kt(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kt(t=>{let e=this.getAxisMotionValue(t).get()||0;if(a.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const s=n.layout.layoutBox[t];if(s){e=It(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),i&&i(t,e);const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:s,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(s&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&i(t,e)}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!zn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},s){return void 0!==e&&t<e?t=s?Ft(e,t,s.min):Math.max(t,e):void 0!==n&&t>n&&(t=s?Ft(n,t,s.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},s=this.constraints;t&&u(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:s,right:i}){return{x:Ht(t.x,n,i),y:Ht(t.y,e,s)}}(n.layoutBox,t),this.elastic=function(t=qt){return!1===t?t=0:!0===t&&(t=qt),{x:Yt(t,"left","right"),y:Yt(t,"top","bottom")}}(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Kt(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!u(t))return!1;const n=t.current;tt(null!==n);const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=function(t,e,n){const s=de(t,n),{scroll:i}=e;return i&&(ae(s.x,i.offset.x),ae(s.y,i.offset.y)),s}(n,s.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Wt(t.x,e.x),y:Wt(t.y,e.y)}}(s.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Zt(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Kt(r=>{if(!zn(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=s?200:1e6,c=s?40:1e7,u={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(r,u)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(On(t,n,0,e))}stopAnimation(){Kt(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),s=n[e];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Kt(e=>{const{drag:n}=this.getProps();if(!zn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:n,max:o}=s.layout.layoutBox[e];i.set(t[e]-Ft(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!u(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Kt(e=>{const n=this.getAxisMotionValue(e);if(n){const s=n.get();i[e]=function(e,n){let s=.5;const i=It(e),o=It(n);return o>i?s=Bt(n.min,n.max-i,e.min):i>o&&(s=Bt(e.min,e.max-o,n.min)),t(0,1,s)}({min:s,max:s},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Kt(t=>{if(!zn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:s,max:o}=this.constraints[t];n.set(Ft(s,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;Nn.set(this.visualElement,this);const t=xt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();u(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,s=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=vt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Kt(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=qt,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:r}}}function zn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Gn(t,e){-1===t.indexOf(e)&&t.push(e)}function Hn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Wn{constructor(){this.subscriptions=[]}add(t){return Gn(this.subscriptions,t),()=>Hn(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class qn{constructor(t,e={}){var n;this.version="9.1.3",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:s}=ot;this.lastUpdated!==s&&(this.timeDelta=n,this.lastUpdated=s,ut.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ut.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Wn);const n=this.events[t].add(e);return"change"===t?()=>{n(),ut.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?sn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yn(t,e){return new qn(t,e)}const Xn=["TopLeft","TopRight","BottomLeft","BottomRight"],Kn=Xn.length,Zn=t=>"string"==typeof t?parseFloat(t):t,_n=t=>"number"==typeof t||p.test(t);function Jn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Qn=es(0,.5,Ye),ts=es(.5,.95,J);function es(t,e,n){return s=>s<t?0:s>e?1:n(Bt(t,e,s))}function ns(t,e){t.min=e.min,t.max=e.max}function ss(t,e){ns(t.x,e.x),ns(t.y,e.y)}function is(t,e,n,s,i){return t=ne(t-=e,1/n,s),void 0!==i&&(t=ne(t,1/i,s)),t}function os(t,e,[n,s,i],o,r){!function(t,e=0,n=1,s=.5,i,o=t,r=t){if(a.test(e)){e=parseFloat(e);e=Ft(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let l=Ft(o.min,o.max,s);t===o&&(l-=e),t.min=is(t.min,e,n,l,i),t.max=is(t.max,e,n,l,i)}(t,e[n],e[s],e[i],e.scale,o,r)}const rs=["x","scaleX","originX"],as=["y","scaleY","originY"];function ls(t,e,n,s){os(t.x,e,rs,n?n.x:void 0,s?s.x:void 0),os(t.y,e,as,n?n.y:void 0,s?s.y:void 0)}function hs(t){return 0===t.translate&&1===t.scale}function cs(t){return hs(t.x)&&hs(t.y)}function us(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function ds(t){return It(t.x)/It(t.y)}class ps{constructor(){this.members=[]}add(t){Gn(this.members,t),t.scheduleRender()}remove(t){if(Hn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ms(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(s=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(s+=`rotate(${t}deg) `),e&&(s+=`rotateX(${e}deg) `),i&&(s+=`rotateY(${i}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(s+=`scale(${r}, ${a})`),s||"none"}const fs=(t,e)=>t.depth-e.depth;class gs{constructor(){this.children=[],this.isDirty=!1}add(t){Gn(this.children,t),this.isDirty=!0}remove(t){Hn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fs),this.isDirty=!1,this.children.forEach(t)}}const ys=["","X","Y","Z"];let vs=0;const xs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Ps({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(t,n={},s=(null==e?void 0:e())){this.id=vs++,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.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;xs.totalNodes=xs.resolvedTargetDeltas=xs.recalculatedProjection=0,this.nodes.forEach(Vs),this.nodes.forEach(Ds),this.nodes.forEach(Ms),this.nodes.forEach(Ss),t=xs,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new gs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Wn),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:s,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(i||s)&&(this.isLayoutDirty=!0),t){let n;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=bn(s,250),m.hasAnimatedSinceResize&&(m.hasAnimatedSinceResize=!1,this.nodes.forEach(Cs))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&o&&(s||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||o.getDefaultTransition()||Fs,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!us(this.targetLayout,s)||n,h=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);const e={...Un(i,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Cs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,dt.preRender(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(Ls),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ws);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Is),this.potentialNodes.clear()),this.nodes.forEach(Es),this.nodes.forEach(Ts),this.nodes.forEach(bs),this.clearAllSnapshots(),pt.update(),pt.preRender(),pt.render())}clearAllSnapshots(){this.nodes.forEach(As),this.sharedNodes.forEach(Rs)}scheduleUpdateProjection(){ut.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){ut.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!cs(this.projectionDelta),n=this.getTransformTemplate(),s=n?n(this.latestValues,""):void 0,o=s!==this.prevTransformTemplateValue;t&&(e||Qt(this.latestValues)||o)&&(i(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var s;return t&&(n=this.removeTransform(n)),Us((s=n).x),Us(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(ae(e.x,n.offset.x),ae(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ss(e,t);for(let n=0;n<this.path.length;n++){const s=this.path[n],{scroll:i,options:o}=s;if(s!==this.root&&i&&o.layoutScroll){if(i.isRoot){ss(e,t);const{scroll:n}=this.root;n&&(ae(e.x,-n.offset.x),ae(e.y,-n.offset.y))}ae(e.x,i.offset.x),ae(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};ss(n,t);for(let t=0;t<this.path.length;t++){const s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ue(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),Qt(s.latestValues)&&ue(n,s.latestValues)}return Qt(this.latestValues)&&ue(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ss(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Qt(n.latestValues))continue;Jt(n.latestValues)&&n.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};ss(s,n.measurePageBox()),ls(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,s)}return Qt(this.latestValues)&&ls(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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}resolveTargetDelta(){var t;const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);if(!((Boolean(this.resumingFrom)||this!==e)&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:n,layoutId:s}=this.options;if(this.layout&&(n||s)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Gt(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),ss(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,o,r;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(i=this.target,o=this.relativeTarget,r=this.relativeParent.target,$t(i.x,o.x,r.x),$t(i.y,o.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ss(this.target,this.layout.layoutBox),oe(this.target,this.targetDelta)):ss(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Gt(this.relativeTargetOrigin,this.target,t.target),ss(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}xs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!Jt(this.parent.latestValues)&&!te(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let s=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(s=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),s)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;ss(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,s=!1){const i=n.length;if(!i)return;let o,r;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ue(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,oe(t,r)),s&&Qt(o.latestValues)&&ue(t,o.latestValues))}e.x=re(e.x),e.y=re(e.y)}(this.layoutCorrected,this.treeScale,this.path,n);const{target:r}=e;if(!r)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const a=this.treeScale.x,l=this.treeScale.y,h=this.projectionTransform;Nt(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=ms(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===a&&this.treeScale.y===l||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r)),xs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,s=n?n.latestValues:{},i={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),c=!h||h.members.length<=1,u=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(Bs));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var h,p,m,f;ks(o.x,t.x,n),ks(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gt(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=r,f=n,js(h.x,p.x,m.x,f),js(h.y,p.y,m.y,f),d&&us(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ss(d,this.relativeTarget)),l&&(this.animationValues=i,function(t,e,n,s,i,o){i?(t.opacity=Ft(0,void 0!==n.opacity?n.opacity:1,Qn(s)),t.opacityExit=Ft(void 0!==e.opacity?e.opacity:1,0,ts(s))):o&&(t.opacity=Ft(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,s));for(let i=0;i<Kn;i++){const o=`border${Xn[i]}Radius`;let r=Jn(e,o),l=Jn(n,o);if(void 0===r&&void 0===l)continue;r||(r=0),l||(l=0);0===r||0===l||_n(r)===_n(l)?(t[o]=Math.max(Ft(Zn(r),Zn(l),s),0),(a.test(l)||a.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||n.rotate)&&(t.rotate=Ft(e.rotate||0,n.rotate||0,s))}(i,s,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(dt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ut.update(()=>{m.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const s=d(t)?t:Yn(t);return s.start(On("",s,e,n)),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:s,latestValues:i}=t;if(e&&n&&s){if(this!==t&&this.layout&&s&&Os(this.options.animationType,this.layout.layoutBox,s.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=It(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const s=It(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+s}ss(e,n),ue(e,i),Nt(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new ps);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const s=this.getStack();s&&s.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const s={};for(let e=0;e<ys.length;e++){const i="rotate"+ys[e];n[i]&&(s[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in s)t.setStaticValue(e,s[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const s={};if(!this.instance||this.isSVG)return s;if(!this.isVisible)return{visibility:"hidden"};s.visibility="";const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=f(t.pointerEvents)||"",s.transform=i?i(this.latestValues,""):"none",s;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=f(t.pointerEvents)||""),this.hasProjected&&!Qt(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),s.transform=ms(this.projectionDeltaWithTransform,this.treeScale,r),i&&(s.transform=i(r,s.transform));const{x:a,y:l}=this.projectionDelta;s.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?s.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:s.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in g){if(void 0===r[t])continue;const{correct:e,applyTo:n}=g[t],i="none"===s.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)s[n[e]]=i}else s[t]=i}return this.options.layoutId&&(s.pointerEvents=o===this?f(t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(ws),this.root.sharedNodes.clear()}}}function Ts(t){t.updateLayout()}function bs(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?Kt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=It(s);s.min=e[t].min,s.max=s.min+i}):Os(i,n.layoutBox,e)&&Kt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=It(e[t]);s.max=s.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Nt(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Nt(a,t.applyTransform(s,!0),n.measuredBox):Nt(a,e,n.layoutBox);const l=!cs(r);let h=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:i,layout:o}=s;if(i&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Gt(r,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Gt(a,e,o.layoutBox),us(r,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Vs(t){xs.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Ss(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function As(t){t.clearSnapshot()}function ws(t){t.clearMeasurements()}function Es(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Cs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Ds(t){t.resolveTargetDelta()}function Ms(t){t.calcProjection()}function Ls(t){t.resetRotation()}function Rs(t){t.removeLeadSnapshot()}function ks(t,e,n){t.translate=Ft(e.translate,0,n),t.scale=Ft(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function js(t,e,n,s){t.min=Ft(e.min,n.min,s),t.max=Ft(e.max,n.max,s)}function Bs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Fs={duration:.45,ease:[.4,0,.1,1]};function Is(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const s=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);s&&t.mount(s,!0)}function Us(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Os(t,e,n){return"position"===t||"preserve-aspect"===t&&!Ut(ds(e),ds(n),.2)}const Ns=Ps({attachResizeListener:(t,e)=>vt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$s={current:void 0},zs=Ps({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!$s.current){const t=new Ns(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),$s.current=t}return $s.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Gs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Hs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!p.test(t))return t;t=parseFloat(t)}return`${Gs(t,e.target.x)}% ${Gs(t,e.target.y)}%`}},Ws=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function qs(t,e,n=1){const[s,i]=function(t){const e=Ws.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);return o?o.trim():y(i)?qs(i,e,n+1):i}const Ys={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=t.includes("var("),o=[];i&&(t=t.replace(Ws,t=>(o.push(t),"_$css")));const r=Be.parse(t);if(r.length>5)return s;const a=Be.createTransformer(t),l="number"!=typeof r[0]?1:0,h=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=h,r[1+l]/=c;const u=Ft(h,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=u),"number"==typeof r[3+l]&&(r[3+l]/=u);let d=a(r);if(i){let t=0;d=d.replace("_$css",()=>{const e=o[t];return t++,e})}return d}},Xs=t=>/^0[^.\s]+$/.test(t),Ks=t=>e=>e.test(t),Zs=[r,p,a,v,x,P,{test:t=>"auto"===t,parse:t=>t}],_s=t=>Zs.find(Ks(t)),Js=[...Zs,Ae,Be],Qs=t=>Js.find(Ks(t));function ti(t,e,n){const s=t.getProps();return T(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function ei(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Yn(n))}function ni(t,e){if(!e)return;return(e[t]||e.default||e).from}const si=new Set(["width","height","top","left","right","bottom","x","y"]),ii=t=>si.has(t),oi=t=>t===r||t===p,ri=(t,e)=>parseFloat(t.split(", ")[e]),ai=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/);if(i)return ri(i[1],e);{const e=s.match(/^matrix\((.+)\)$/);return e?ri(e[1],t):0}},li=new Set(["x","y","z"]),hi=V.filter(t=>!li.has(t));const ci={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:ai(4,13),y:ai(5,14)},ui=(t,e,n={},s={})=>{e={...e},s={...s};const i=Object.keys(e).filter(ii);let o=[],r=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let h=n[i],c=_s(h);const u=e[i];let d;if(S(u)){const t=u.length,e=null===u[0]?1:0;h=u[e],c=_s(h);for(let n=e;n<t;n++)d?tt(_s(u[n])===d):d=_s(u[n])}else d=_s(u);if(c!==d)if(oi(c)&&oi(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof u?e[i]=parseFloat(u):Array.isArray(u)&&d===p&&(e[i]=u.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===h||0===u)?0===h?l.set(d.transform(h)):e[i]=c.transform(u):(r||(o=function(t){const e=[];return hi.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(i),s[i]=void 0!==s[i]?s[i]:e[i],l.jump(u))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const s=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:r}=o,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ci[t](s,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const s=e.getValue(n);s&&s.jump(a[n]),t[n]=ci[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),A&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:s}}return{target:e,transitionEnd:s}};function di(t,e,n,s){return(t=>Object.keys(t).some(ii))(e)?ui(t,e,n,s):{target:e,transitionEnd:s}}const pi=(t,e,n,s)=>{const i=function(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!y(e))return;const n=qs(e,s);n&&t.set(n)});for(const t in e){const i=e[t];if(!y(i))continue;const o=qs(i,s);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,s);return di(t,e=i.target,n,s=i.transitionEnd)},mi={current:null},fi={current:!1};function gi(t){return Boolean(d(t)&&t.add)}const yi=Object.keys(D),vi=yi.length,xi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Pi=w.length;class Ti extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>ut.render(this.render,!1,!0);const{latestValues:r,renderState:a}=i;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=E(e),this.isVariantNode=C(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...h}=this.scrapeMotionValuesFromProps(e,{});for(const t in h){const e=h[t];void 0!==r[t]&&d(e)&&(e.set(r[t],!1),gi(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),fi.current||function(){if(fi.current=!0,A)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>mi.current=t.matches;t.addListener(e),e()}else mi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||mi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),dt.update(this.notifyUpdate),dt.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=h.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&ut.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,i,o){let r,a;for(let t=0;t<vi;t++){const n=yi[t],{isEnabled:s,Feature:i,ProjectionNode:o,MeasureLayout:l}=D[n];o&&(r=o),s(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(a=l))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:h}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||a&&u(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<xi.length;e++){const n=xi[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(d(o))t.addValue(i,o),gi(s)&&s.add(i);else if(d(r))t.addValue(i,Yn(o,{owner:t})),gi(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Yn(void 0!==e?e:o,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Pi;t++){const n=w[t],s=this.props[n];(M(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Yn(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,s="string"==typeof n||"object"==typeof n?null===(e=T(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||d(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Wn),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:s},i){let o=function(t,e,n){const s={};for(const i in t){const t=ni(i,e);if(void 0!==t)s[i]=t;else{const t=n.getValue(i);t&&(s[i]=t.get())}}return s}(n,t||{},this);if(s&&(e&&(e=s(e)),n&&(n=s(n)),o&&(o=s(o))),i){!function(t,e,n){var s,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),r=o.length;if(r)for(let a=0;a<r;a++){const r=o[a],l=e[r];let h=null;Array.isArray(l)&&(h=l[0]),null===h&&(h=null!==(i=null!==(s=n[r])&&void 0!==s?s:t.readValue(r))&&void 0!==i?i:e[r]),null!=h&&("string"==typeof h&&(/^\-?\d*\.?\d+$/.test(h)||Xs(h))?h=parseFloat(h):!Qs(h)&&Be.test(l)&&(h=Bn(r,l)),t.addValue(r,Yn(h,{owner:t})),void 0===n[r]&&(n[r]=h),null!==h&&t.setBaseTarget(r,h))}}(this,n,o);const t=pi(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class bi extends Ti{readValueFromInstance(t,e){if(h.has(e)){const t=jn(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(L(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return de(t,e)}build(t,e,n,s){R(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return k(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;d(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){j(t,e,n,s)}}class Vi extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:s}=this.props,{projection:i}=t;F(Ai),i&&(e.group&&e.group.add(i),n&&n.register&&s&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),m.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:s,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,s||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ut.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Si(t){const[e,n]=function(){const t=X(B);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=K();return Z(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),s=X(I);return Y.createElement(Vi,{...t,layoutGroup:s,switchLayoutGroup:X(U),isPresent:e,safeToRemove:n})}const Ai={borderRadius:{...Hs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Hs,borderTopRightRadius:Hs,borderBottomLeftRadius:Hs,borderBottomRightRadius:Hs,boxShadow:Ys},wi={pan:{Feature:class extends _{constructor(){super(...arguments),this.removePointerDownListener=J}onPointerDown(t){this.session=new Vt(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,s&&s(t,e)}}}mount(){this.removePointerDownListener=xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends _{constructor(t){super(t),this.removeGroupControls=J,this.removeListeners=J,this.controls=new $n(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||J}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:zs,MeasureLayout:Si}},Ei={layout:{ProjectionNode:zs,MeasureLayout:Si}};function Ci(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}const Di="data-"+O("framerAppearId");function Mi(t,e,n={}){const s=ti(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Li(t,s,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(Ri).forEach((t,s)=>{t.notify("AnimationStart",e),r.push(Mi(t,e,{...o,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+s,r,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(e)}return Promise.all([o(),r(n.delay)])}function Li(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");s&&(o=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e),i=a[e];if(!s||void 0===i||u&&ki(u,e))continue;const r={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!s.hasAnimated){const n=t.getProps()[Di];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,s,ut))}let d=s.start(On(e,s,i,t.shouldReduceMotion&&h.has(e)?{type:!1}:r));gi(l)&&(l.add(e),d=d.then(()=>l.remove(e))),c.push(d)}return Promise.all(c).then(()=>{r&&function(t,e){const n=ti(t,e);let{transitionEnd:s={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...s};for(const e in o){ei(t,e,b(o[e]))}}(t,r)})}function Ri(t,e){return t.sortNodePosition(e)}function ki({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}const ji=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bi=[...ji].reverse(),Fi=ji.length;function Ii(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Mi(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=Mi(t,e,n);else{const i="function"==typeof e?ti(t,e,n.custom):e;s=Li(t,i,n)}return s.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Ui(t){let e=Ii(t);const n={animate:Ni(!0),whileInView:Ni(),whileHover:Ni(),whileTap:Ni(),whileDrag:Ni(),whileFocus:Ni(),exit:Ni()};let s=!0;const i=(e,n)=>{const s=ti(t,n);if(s){const{transition:t,transitionEnd:n,...i}=s;e={...e,...i,...n}}return e};function o(o,r){const a=t.getProps(),l=t.getVariantContext(!0)||{},h=[],c=new Set;let u={},d=1/0;for(let e=0;e<Fi;e++){const p=Bi[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=M(f),y=p===r?m.isActive:null;!1===y&&(d=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&s&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...u},!m.isActive&&null===y||!f&&!m.prevProp||N(f)||"boolean"==typeof f)continue;const x=Oi(m.prevProp,f);let P=x||p===r&&m.isActive&&!v&&g||e>d&&g;const T=Array.isArray(f)?f:[f];let b=T.reduce(i,{});!1===y&&(b={});const{prevResolvedValues:V={}}=m,A={...V,...b},w=t=>{P=!0,c.delete(t),m.needsAnimating[t]=!0};for(const t in A){const e=b[t],n=V[t];u.hasOwnProperty(t)||(e!==n?S(e)&&S(n)?!Ci(e,n)||x?w(t):m.protectedKeys[t]=!0:void 0!==e?w(t):c.add(t):void 0!==e&&c.has(t)?w(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=b,m.isActive&&(u={...u,...b}),s&&t.blockInitialAnimation&&(P=!1),P&&!v&&h.push(...T.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const s=t.getBaseTarget(n);void 0!==s&&(e[n]=s)}),h.push({animation:e})}let p=Boolean(h.length);return s&&!1===a.initial&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,s,i){var r;if(n[e].isActive===s)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,s)}),n[e].isActive=s;const a=o(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Oi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ci(e,t)}function Ni(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $i=0;const zi={animation:{Feature:class extends _{constructor(t){super(t),t.animationState||(t.animationState=Ui(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),N(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends _{constructor(){super(...arguments),this.id=$i++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function Gi(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End");return xt(t.current,n,(n,i)=>{if("touch"===n.type||jt())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e),o[s]&&o[s](n,i)},{passive:!t.getProps()[s]})}const Hi=(t,e)=>!!e&&(t===e||Hi(t,e.parentElement));function Wi(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,nt(n))}const qi=new WeakMap,Yi=new WeakMap,Xi=t=>{const e=qi.get(t.target);e&&e(t)},Ki=t=>{t.forEach(Xi)};function Zi(t,e,n){const s=function({root:t,...e}){const n=t||document;Yi.has(n)||Yi.set(n,{});const s=Yi.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ki,{root:t,...e})),s[i]}(e);return qi.set(t,n),s.observe(t),()=>{qi.delete(t),s.unobserve(t)}}const _i={some:0,all:1};const Ji={inView:{Feature:class extends _{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:t}=this.node.getProps();t&&t(null),this.node.animationState&&this.node.animationState.setActive("whileInView",!0)})}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i,fallback:o=!0}=t;if("undefined"==typeof IntersectionObserver)return void(o&&this.viewportFallback());const r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:_i[s]};return Zi(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),o=e?n:s;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends _{constructor(){super(...arguments),this.removeStartListeners=J,this.removeEndListeners=J,this.removeAccessibleListeners=J,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=xt(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:s}=this.node.getProps();Hi(this.node.current,t.target)?n&&n(t,e):s&&s(t,e)},{passive:!(n.onTap||n.onPointerUp)}),i=xt(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Tt(s,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=vt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=vt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&Wi("up",this.node.getProps().onTap)}),Wi("down",(t,e)=>{this.startPress(t,e)})}),e=vt(this.node.current,"blur",()=>{this.isPressing&&Wi("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Tt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!jt()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=xt(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=vt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Tt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends _{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Tt(vt(this.node.current,"focus",()=>this.onFocus()),vt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends _{mount(){this.unmount=Tt(Gi(this.node,!0),Gi(this.node,!1))}unmount(){}}}};class Qi extends Ti{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(h.has(e)){const t=jn(e);return t&&t.default||0}return e=$.has(e)?e:O(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return z(t,e)}build(t,e,n,s){G(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){H(t,e,n,s)}mount(t){this.isSVGTag=W(t.tagName),super.mount(t)}}const to={...{renderer:(t,e)=>q(t)?new Qi(e,{enableHardwareAcceleration:!1}):new bi(e,{enableHardwareAcceleration:!0}),...zi,...Ji},...wi,...Ei};export{to as domMax};
|