framer-motion 7.6.18 → 7.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{q as r,t as a,v as l,w as u,x as c,y as h,z as d,A as p,B as m,i as f,C as v,D as g,E as y,a as x,u as b,M as P,P as T,F as V,G as E,g as A,L as S,S as w,d as M,r as C,H as D,I as R,J as B,K as L,n as k,N as F,O as j,m as I,c as U,b as O,l as N,f as z,Q as $,h as G,p as H,R as W,T as Y,U as X,s as q,j as K,o as Z,k as _}from"./size-rollup-dom-max-assets.js";const J=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Q=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},tt={test:J("hsl","hue"),parse:Q("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},et=p(0,255),nt=Object.assign(Object.assign({},d),{transform:t=>Math.round(et(t))}),it={test:J("rgb","red"),parse:Q("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+c(h.transform(i))+")"};const ot={test:J("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:it.transform},st={test:t=>it.test(t)||ot.test(t)||tt.test(t),parse:t=>it.test(t)?it.parse(t):tt.test(t)?tt.parse(t):ot.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?it.transform(t):tt.transform(t)};function rt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(st.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function at(t){return rt(t).values}function lt(t){const{values:e,numColors:n,tokenised:i}=rt(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?st.transform(t[i]):c(t[i]));return e}}const ut=t=>"number"==typeof t?0:t;const ct={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:at,createTransformer:lt,getAnimatableNone:function(t){const e=at(t);return lt(t)(e.map(ut))}},ht=new Set(["brightness","contrast","saturate","opacity"]);function dt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=ht.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const pt=/([a-z-]*)\(.*?\)/g,mt=Object.assign(Object.assign({},ct),{getAnimatableNone:t=>{const e=t.match(pt);return e?e.map(dt).join(" "):t}});function ft(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vt(t){return!!t.touches}const gt={pageX:0,pageY:0};function yt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||gt;return{x:n[e+"X"],y:n[e+"Y"]}}function xt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function bt(t,e="page"){return{point:vt(t)?yt(t,e):xt(t,e)}}const Pt=(t,e=!1)=>{const n=e=>t(e,bt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},Tt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Vt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Tt()),1/60*1e3);let Et=!0,At=!1,St=!1;const wt={delta:0,timestamp:0},Mt=["read","update","preRender","render","postRender"],Ct=Mt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>At=!0),t),{}),Dt=Mt.reduce((t,e)=>{const n=Ct[e];return t[e]=(t,e=!1,i=!1)=>(At||Ft(),n.schedule(t,e,i)),t},{}),Rt=Mt.reduce((t,e)=>(t[e]=Ct[e].cancel,t),{}),Bt=Mt.reduce((t,e)=>(t[e]=()=>Ct[e].process(wt),t),{}),Lt=t=>Ct[t].process(wt),kt=t=>{At=!1,wt.delta=Et?1/60*1e3:Math.max(Math.min(t-wt.timestamp,40),1),wt.timestamp=t,St=!0,Mt.forEach(Lt),St=!1,At&&(Et=!1,Vt(kt))},Ft=()=>{At=!0,Et=!0,St||Vt(kt)},jt=()=>wt,It=t=>1e3*t;function Ut(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Ot(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return Ut(e,n,i,o)},[t,n,i,o])}const Nt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},zt={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function $t(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?zt[t]:f&&null===window.onmousedown?Nt[t]:t}function Gt(t,e,n,i){return Ut(t,$t(e),Pt(n,"pointerdown"===e),i)}function Ht(t,e,n,i){return Ot(t,$t(e),n&&Pt(n,"pointerdown"===e),i)}const Wt=(t,e)=>n=>e(t(n)),Yt=(...t)=>t.reduce(Wt),Xt=(t,e)=>Math.abs(t-e);class qt{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=_t(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Xt(t.x,e.x),i=Xt(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=jt();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Kt(e,this.transformPagePoint),ft(t)&&0===t.buttons?this.handlePointerUp(t,e):Dt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=_t(Kt(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},vt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=Kt(bt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=jt();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,_t(i,this.history)),this.removeListeners=Yt(Gt(window,"pointermove",this.handlePointerMove),Gt(window,"pointerup",this.handlePointerUp),Gt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Rt.update(this.updatePoint)}}function Kt(t,e){return e?{point:e(t.point)}:t}function Zt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function _t({point:t},e){return{point:t,delta:Zt(t,Qt(e)),offset:Zt(t,Jt(e)),velocity:te(e,.1)}}function Jt(t){return t[0]}function Qt(t){return t[t.length-1]}function te(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=Qt(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>It(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ee(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ne=ee("dragHorizontal"),ie=ee("dragVertical");function oe(t){let e=!1;if("y"===t)e=ie();else if("x"===t)e=ne();else{const t=ne(),n=ie();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function se(){const t=oe(!0);return!t||(t(),!1)}const re=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ae=(t,e,n)=>-n*t+n*e+t;function le(t){return t.max-t.min}function ue(t,e=0,n=.01){return Math.abs(t-e)<=n}function ce(t,e,n,i=.5){t.origin=i,t.originPoint=ae(e.min,e.max,t.origin),t.scale=le(n)/le(e),(ue(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=ae(n.min,n.max,t.origin)-t.originPoint,(ue(t.translate)||isNaN(t.translate))&&(t.translate=0)}function he(t,e,n,i){ce(t.x,e.x,n.x,null==i?void 0:i.originX),ce(t.y,e.y,n.y,null==i?void 0:i.originY)}function de(t,e,n){t.min=n.min+e.min,t.max=t.min+le(e)}function pe(t,e,n){t.min=e.min-n.min,t.max=t.min+le(e)}function me(t,e,n){pe(t.x,e.x,n.x),pe(t.y,e.y,n.y)}const fe=(t,e,n)=>Math.min(Math.max(n,t),e);function ve(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 ge(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const ye=.35;function xe(t,e,n){return{min:be(t,e),max:be(t,n)}}function be(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var Pe;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Pe||(Pe={}));function Te(t){return[t("x"),t("y")]}function Ve({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ee(t){return void 0===t||1===t}function Ae({scale:t,scaleX:e,scaleY:n}){return!Ee(t)||!Ee(e)||!Ee(n)}function Se(t){return Ae(t)||we(t)||t.z||t.rotate||t.rotateX||t.rotateY}function we(t){return Me(t.x)||Me(t.y)}function Me(t){return t&&"0%"!==t}function Ce(t,e,n){return n+e*(t-n)}function De(t,e,n,i,o){return void 0!==o&&(t=Ce(t,o,i)),Ce(t,n,i)+e}function Re(t,e=0,n=1,i,o){t.min=De(t.min,e,n,i,o),t.max=De(t.max,e,n,i,o)}function Be(t,{x:e,y:n}){Re(t.x,e.translate,e.scale,e.originPoint),Re(t.y,n.translate,n.scale,n.originPoint)}function Le(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ke(t,e){t.min=t.min+e,t.max=t.max+e}function Fe(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=ae(t.min,t.max,s);Re(t,e[n],e[i],r,e.scale)}const je=["x","scaleX","originX"],Ie=["y","scaleY","originY"];function Ue(t,e){Fe(t.x,e,je),Fe(t.y,e,Ie)}function Oe(t,e){return Ve(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Ne=t=>t,ze=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $e(t,e,n,i){if(t===e&&n===i)return Ne;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=ze(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:ze(o(t),e,i)}const Ge=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,He=t=>e=>1-t(1-e),We=t=>t*t,Ye=He(We),Xe=Ge(We),qe=t=>1-Math.sin(Math.acos(t)),Ke=He(qe),Ze=Ge(Ke),_e=(t=1.525)=>e=>e*e*((t+1)*e-t),Je=_e(),Qe=He(Je),tn=Ge(Je),en=(t=>{const e=_e(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(),nn={linear:Ne,easeIn:We,easeInOut:Xe,easeOut:Ye,circIn:qe,circInOut:Ze,circOut:Ke,backIn:Je,backInOut:tn,backOut:Qe,anticipate:en},on=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return $e(e,n,i,o)}return"string"==typeof t?nn[t]:t},sn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ct.test(e)||e.startsWith("url("))),rn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),an=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),ln=()=>({type:"keyframes",ease:"linear",duration:.3}),un=t=>({type:"keyframes",duration:.8,values:t}),cn={x:rn,y:rn,z:rn,rotate:rn,rotateX:rn,rotateY:rn,rotateZ:rn,scaleX:an,scaleY:an,scale:an,opacity:ln,backgroundColor:ln,color:ln,default:an},hn=(t,e)=>{let n;return n=v(e)?un:cn[t]||cn.default,{to:e,...n(e)}},dn={...g,color:st,backgroundColor:st,outlineColor:st,fill:st,stroke:st,borderColor:st,borderTopColor:st,borderRightColor:st,borderBottomColor:st,borderLeftColor:st,filter:mt,WebkitFilter:mt},pn=t=>dn[t];function mn(t,e){var n;let i=pn(t);return i!==mt&&(i=ct),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const fn=!1;function vn(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Rt.read(i),t(s-e))};return Dt.read(i,!0),()=>Rt.read(i)}function gn(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 yn=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},xn=[ot,it,tt];function bn(t){const e=(n=t,xn.find(t=>t.test(n)));var n;let i=e.parse(t);return e===tt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=gn(a,i,t+1/3),s=gn(a,i,t),r=gn(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}(i)),i}const Pn=(t,e)=>{const n=bn(t),i=bn(e),o={...n};return t=>(o.red=yn(n.red,i.red,t),o.green=yn(n.green,i.green,t),o.blue=yn(n.blue,i.blue,t),o.alpha=ae(n.alpha,i.alpha,t),it.transform(o))};function Tn(t,e){return"number"==typeof t?n=>ae(t,e,n):st.test(t)?Pn(t,e):Sn(t,e)}const Vn=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>Tn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},En=(t,e)=>{const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Tn(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function An(t){const e=ct.parse(t),n=e.length;let i=0,o=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:o++;return{parsed:e,numNumbers:i,numColors:o}}const Sn=(t,e)=>{const n=ct.createTransformer(e),i=An(t),o=An(e);return i.numColors===o.numColors&&i.numNumbers>=o.numNumbers?Yt(Vn(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},wn=(t,e)=>n=>ae(t,e,n);function Mn(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?wn:"string"==typeof s?st.test(s)?Pn:Sn:Array.isArray(s)?Vn:"object"==typeof s?En:wn);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=Yt(t,s)}i.push(s)}return i}function Cn(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Mn(e,i,o),a=r.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=re(t[n],t[n+1],e);return r[n](i)};return n?e=>l(fe(t[0],t[s-1],e)):l}function Dn(t,e){return t.map(()=>e||Xe).splice(0,t.length-1)}function Rn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=fe(.05,1,r),t=fe(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/Bn(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Bn(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Bn(t,e){return t*Math.sqrt(1-e*e)}const Ln=["duration","bounce"],kn=["stiffness","damping","mass"];function Fn(t,e){return e.some(e=>void 0!==t[e])}function jn({from:t=0,to:e=1,restSpeed:n=2,restDelta:i=.01,...o}){const s={done:!1,value:t};let{stiffness:r,damping:a,mass:l,velocity:u,duration:c,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Fn(t,kn)&&Fn(t,Ln)){const n=Rn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(o),d=In,p=In;function m(){const n=u?-u/1e3:0,o=e-t,s=a/(2*Math.sqrt(r*l)),c=Math.sqrt(r/l)/1e3;if(void 0===i&&(i=Math.min(Math.abs(e-t)/100,.4)),s<1){const t=Bn(c,s);d=i=>{const r=Math.exp(-s*c*i);return e-r*((n+s*c*o)/t*Math.sin(t*i)+o*Math.cos(t*i))},p=e=>{const i=Math.exp(-s*c*e);return s*c*i*(Math.sin(t*e)*(n+s*c*o)/t+o*Math.cos(t*e))-i*(Math.cos(t*e)*(n+s*c*o)-t*o*Math.sin(t*e))}}else if(1===s)d=t=>e-Math.exp(-c*t)*(o+(n+c*o)*t);else{const t=c*Math.sqrt(s*s-1);d=i=>{const r=Math.exp(-s*c*i),a=Math.min(t*i,300);return e-r*((n+s*c*o)*Math.sinh(a)+t*o*Math.cosh(a))/t}}}return m(),{next:t=>{const o=d(t);if(h)s.done=t>=c;else{const r=1e3*p(t),a=Math.abs(r)<=n,l=Math.abs(e-o)<=i;s.done=a&&l}return s.value=s.done?e:o,s},flipTarget:()=>{u=-u,[t,e]=[e,t],m()}}}jn.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const In=t=>0;const Un={decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}},keyframes:function({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return Cn(a,r,{ease:Array.isArray(n)?n:Dn(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}},spring:jn};function On(t,e,n=0){return t-e-n}const Nn=t=>{const e=({delta:e})=>t(e);return{start:()=>Dt.update(e,!0),stop:()=>Rt.update(e)}};function zn({from:t,autoplay:e=!0,driver:n=Nn,elapsed:i=0,repeat:o=0,repeatType:s="loop",repeatDelay:r=0,onPlay:a,onStop:l,onComplete:u,onRepeat:c,onUpdate:h,type:d="keyframes",...p}){var m,f;let v,g,y,{to:x}=p,b=0,P=p.duration,T=!1,V=!0;const E=Un[Array.isArray(x)?"keyframes":d];(null===(f=(m=E).needsInterpolation)||void 0===f?void 0:f.call(m,t,x))&&(y=Cn([0,100],[t,x],{clamp:!1}),t=0,x=100);const A=E({...p,from:t,to:x});function S(){b++,"reverse"===s?(V=b%2==0,i=function(t,e=0,n=0,i=!0){return i?On(e+-t,e,n):e-(t-e)+n}(i,P,r,V)):(i=On(i,P,r),"mirror"===s&&A.flipTarget()),T=!1,c&&c()}function w(t){if(V||(t=-t),i+=t,!T){const t=A.next(Math.max(0,i));g=t.value,y&&(g=y(g)),T=V?t.done:i<=0}null==h||h(g),T&&(0===b&&(null!=P||(P=i)),b<o?function(t,e,n,i){return i?t>=e+n:t<=-n}(i,P,r,V)&&S():(v.stop(),u&&u()))}return e&&(null==a||a(),v=n(w),v.start()),{stop:()=>{null==l||l(),v.stop()}}}function $n(t,e){return e?t*(1e3/e):0}function Gn({ease:t,times:e,yoyo:n,flip:i,loop:o,...s}){const r={...s};return e&&(r.offset=e),s.duration&&(r.duration=It(s.duration)),s.repeatDelay&&(r.repeatDelay=It(s.repeatDelay)),t&&(r.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(on):on(t)),"tween"===s.type&&(r.type="keyframes"),(n||o||i)&&(n?r.repeatType="reverse":o?r.repeatType="loop":i&&(r.repeatType="mirror"),r.repeat=o||n||i||s.repeat),"spring"!==s.type&&(r.type="keyframes"),r}function Hn(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...hn(n,e.to)}),{...e,...Gn(t)}}function Wn(t,e,n,i,o){const s=qn(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=sn(t,n);"none"===r&&a&&"string"==typeof n?r=mn(t,n):Yn(r)&&"string"==typeof n?r=Xn(n):!Array.isArray(n)&&Yn(n)&&"string"==typeof r&&(n=Xn(r));return sn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=zn({...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p})}function y(t){g({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=$n(t-c,jt().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):zn({...Hn(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function Yn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Xn(t){return"number"==typeof t?0:mn("",t)}function qn(t,e){return t[e]||t.default||t}function Kn(t,e,n,i={}){return fn&&(i={type:!1}),e.start(o=>{let s;const r=Wn(t,e,n,i,o),a=function(t,e){var n,i;return null!==(i=null!==(n=(qn(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),l=()=>s=r();let u;return a?u=vn(l,It(a)):l(),()=>{u&&u(),s&&s.stop()}})}const Zn=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}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new qt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(bt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=oe(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Te(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(o){i=le(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(Pe.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&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&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),null==s||s(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:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(Pe.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Jn(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?ae(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ae(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:ve(t.x,n,o),y:ve(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=ye){return!1===t?t=0:!0===t&&(t=ye),{x:xe(t,"left","right"),y:xe(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Te(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||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=Oe(t,n),{scroll:o}=e;return o&&(ke(i.x,o.offset.x),ke(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:ge(t.x,e.x),y:ge(t.y,e.y)}}(i.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=Ve(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Te(r=>{var l;if(!Jn(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return Kn(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Te(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Te(e=>{const{drag:n}=this.getProps();if(!Jn(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e];o.set(t[e]-ae(n,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Te(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=le(t),o=le(e);return o>i?n=re(e.min,e.max-i,t.min):i>o&&(n=re(t.min,t.max-o,e.min)),fe(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Te(t=>{if(!Jn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(ae(i,s,o[t]))})}addListeners(){var t;if(!this.visualElement.current)return;Zn.set(this.visualElement,this);const e=Gt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=Ut(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Te(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=ye,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function Jn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Qn(t){return e(()=>()=>t(),[])}const ti=t=>e=>(t(e),null),ei={pan:ti((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Ht(a,"pointerdown",l&&function(t){u.current=new qt(t,h,{transformPagePoint:c})}),Qn(()=>u.current&&u.current.end())})),drag:ti((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new _n(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function ni(){const t=i(T);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function ii(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const oi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!V.test(t))return t;t=parseFloat(t)}return`${ii(t,e.target.x)}% ${ii(t,e.target.y)}%`}};function si(t){return"string"==typeof t&&t.startsWith("var(--")}const ri=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ai(t,e,n=1){const[i,o]=function(t){const e=ri.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():si(o)?ai(o,e,n+1):o}const li={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(ri,t=>(s.push(t),"_$css")));const r=ct.parse(t);if(r.length>5)return i;const a=ct.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=ae(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class ui extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;E(ci),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Dt.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0: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:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const ci={borderRadius:{...oi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oi,borderTopRightRadius:oi,borderBottomLeftRadius:oi,borderBottomRightRadius:oi,boxShadow:li},hi={measureLayout:function(e){const[n,o]=ni(),s=i(S);return t.createElement(ui,{...e,layoutGroup:s,switchLayoutGroup:i(w),isPresent:n,safeToRemove:o})}};function di(t,e){-1===t.indexOf(e)&&t.push(e)}function pi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class mi{constructor(){this.subscriptions=[]}add(t){return di(this.subscriptions,t),()=>pi(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class fi{constructor(t){var e;this.version="7.6.18",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new mi,this.velocityUpdateSubscribers=new mi,this.renderSubscribers=new mi,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=jt();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Dt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Dt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$n(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function vi(t){return new fi(t)}const gi=["TopLeft","TopRight","BottomLeft","BottomRight"],yi=gi.length,xi=t=>"string"==typeof t?parseFloat(t):t,bi=t=>"number"==typeof t||V.test(t);function Pi(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Ti=Ei(0,.5,Ke),Vi=Ei(.5,.95,Ne);function Ei(t,e,n){return i=>i<t?0:i>e?1:n(re(t,e,i))}function Ai(t,e){t.min=e.min,t.max=e.max}function Si(t,e){Ai(t.x,e.x),Ai(t.y,e.y)}function wi(t,e,n,i,o){return t=Ce(t-=e,1/n,i),void 0!==o&&(t=Ce(t,1/o,i)),t}function Mi(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=ae(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=ae(s.min,s.max,i);t===s&&(a-=e),t.min=wi(t.min,e,n,a,o),t.max=wi(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Ci=["x","scaleX","originX"],Di=["y","scaleY","originY"];function Ri(t,e,n,i){Mi(t.x,e,Ci,null==n?void 0:n.x,null==i?void 0:i.x),Mi(t.y,e,Di,null==n?void 0:n.y,null==i?void 0:i.y)}function Bi(t){return 0===t.translate&&1===t.scale}function Li(t){return Bi(t.x)&&Bi(t.y)}function ki(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 Fi(t){return le(t.x)/le(t.y)}class ji{constructor(){this.members=[]}add(t){di(this.members,t),t.scheduleRender()}remove(t){if(pi(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){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ii(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y;if((o||s)&&(i=`translate3d(${o}px, ${s}px, 0) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(i+=`scale(${r}, ${a})`),i||"none"}const Ui=(t,e)=>t.depth-e.depth;class Oi{constructor(){this.children=[],this.isDirty=!1}add(t){di(this.children,t),this.isDirty=!0}remove(t){pi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ui),this.isDirty=!1,this.children.forEach(t)}}const Ni=["","X","Y","Z"];let zi=0;function $i({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=zi++,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(Wi),this.nodes.forEach(Zi),this.nodes.forEach(_i)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.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 Oi)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new mi),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=vn(i,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(Ki))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:io,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!ki(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...qn(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Ki(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Rt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(Ji),this.animationId++)}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));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")}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Xi);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(oo),this.potentialNodes.clear()),this.nodes.forEach(qi),this.nodes.forEach(Gi),this.nodes.forEach(Hi),this.clearAllSnapshots(),Bt.update(),Bt.preRender(),Bt.render())}clearAllSnapshots(){this.nodes.forEach(Yi),this.sharedNodes.forEach(Qi)}scheduleUpdateProjection(){Dt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;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 e=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),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}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:i(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Li(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||Se(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),so((i=n).x),so(i.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&&(ke(e.x,n.offset.x),ke(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Si(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;if(i!==this.root&&o&&s.layoutScroll){if(o.isRoot){Si(e,t);const{scroll:n}=this.root;n&&(ke(e.x,-n.offset.x),ke(e.y,-n.offset.y))}ke(e.x,o.offset.x),ke(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Si(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Ue(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Se(i.latestValues)&&Ue(n,i.latestValues)}return Se(this.latestValues)&&Ue(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Si(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Se(i.latestValues))continue;Ae(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};Si(o,i.measurePageBox()),Ri(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layoutBox,o)}return Se(this.latestValues)&&Ri(n,this.latestValues),n}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(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:i}=this.options;if(this.layout&&(n||i)){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}},me(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Si(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,s,r;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&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(o=this.target,s=this.relativeTarget,r=this.relativeParent.target,de(o.x,s.x,r.x),de(o.y,s.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Si(this.target,this.layout.layoutBox),Be(this.target,this.targetDelta)):Si(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}},me(this.relativeTargetOrigin,this.target,t.target),Si(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Ae(this.parent.latestValues)&&!we(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const i=this.getLead(),o=Boolean(this.resumingFrom)||this!==i;let s=!0;if(e&&(s=!1),o&&n&&(s=!1),s)return;const{layout:r,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!a)return;Si(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ue(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Be(t,l)),i&&Se(a.latestValues)&&Ue(t,a.latestValues));e.x=Le(e.x),e.y=Le(e.y)}(this.layoutCorrected,this.treeScale,this.path,o);const{target:l}=i;if(!l)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 u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;he(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=Ii(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,i;const o=this.snapshot,s=(null==o?void 0:o.latestValues)||{},r={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},c=(null==o?void 0:o.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),h=((null===(i=this.getStack())||void 0===i?void 0:i.members.length)||0)<=1,d=Boolean(c&&!h&&!0===this.options.crossfade&&!this.path.some(no));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var o,p,m,f;to(a.x,t.x,i),to(a.y,t.y,i),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(me(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),o=this.relativeTarget,p=this.relativeTargetOrigin,m=l,f=i,eo(o.x,p.x,m.x,f),eo(o.y,p.y,m.y,f)),c&&(this.animationValues=r,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=ae(0,null!==(r=n.opacity)&&void 0!==r?r:1,Ti(i)),t.opacityExit=ae(null!==(a=e.opacity)&&void 0!==a?a:1,0,Vi(i))):s&&(t.opacity=ae(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<yi;o++){const s=`border${gi[o]}Radius`;let r=Pi(e,s),a=Pi(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||bi(r)===bi(a)?(t[s]=Math.max(ae(xi(r),xi(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=ae(e.rotate||0,n.rotate||0,i))}(r,s,this.latestValues,i,d,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Rt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dt.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:vi(t);return Kn("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&ro(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=le(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=le(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Si(e,n),Ue(e,o),he(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new ji);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}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 i=this.getStack();i&&i.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 i={};for(let e=0;e<Ni.length;e++){const o="rotate"+Ni[e];n[o]&&(i[o]=n[o],t.setStaticValue(o,0))}null==t||t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!Se(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=Ii(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(i=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in D){if(void 0===a[t])continue;const{correct:e,applyTo:n}=D[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}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(Xi),this.root.sharedNodes.clear()}}}function Gi(t){t.updateLayout()}function Hi(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:i}=t.options,s=o.source!==t.layout.source;"size"===i?Te(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=le(n);n.min=e[t].min,n.max=n.min+i}):ro(i,o.layoutBox,e)&&Te(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=le(e[t]);n.max=n.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};he(r,e,o.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?he(a,t.applyTransform(n,!0),o.measuredBox):he(a,e,o.layoutBox);const l=!Li(r);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:i}=n;if(t&&i){const n={x:{min:0,max:0},y:{min:0,max:0}};me(n,o.layoutBox,t.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};me(s,e,i.layoutBox),ki(n,s)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function Wi(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Yi(t){t.clearSnapshot()}function Xi(t){t.clearMeasurements()}function qi(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ki(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Zi(t){t.resolveTargetDelta()}function _i(t){t.calcProjection()}function Ji(t){t.resetRotation()}function Qi(t){t.removeLeadSnapshot()}function to(t,e,n){t.translate=ae(e.translate,0,n),t.scale=ae(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function eo(t,e,n,i){t.min=ae(e.min,n.min,i),t.max=ae(e.max,n.max,i)}function no(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const io={duration:.45,ease:[.4,0,.1,1]};function oo(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 i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function so(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ro(t,e,n){return"position"===t||"preserve-aspect"===t&&!ue(Fi(e),Fi(n),.2)}const ao=$i({attachResizeListener:(t,e)=>Ut(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lo={current:void 0},uo=$i({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!lo.current){const t=new ao(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),lo.current=t}return lo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),co=t=>/^0[^.\s]+$/.test(t),ho=t=>e=>e.test(t),po=[d,V,u,R,B,L,{test:t=>"auto"===t,parse:t=>t}],mo=t=>po.find(ho(t)),fo=[...po,st,ct],vo=t=>fo.find(ho(t));function go(t,e,n){const i=t.getProps();return k(i,e,void 0!==n?n:i.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 yo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vi(n))}function xo(t,e){if(!e)return;return(e[t]||e.default||e).from}const bo=new Set(["width","height","top","left","right","bottom","x","y"]),Po=t=>bo.has(t),To=(t,e)=>{t.set(e,!1),t.set(e)},Vo=t=>t===d||t===V;var Eo;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Eo||(Eo={}));const Ao=(t,e)=>parseFloat(t.split(", ")[e]),So=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return Ao(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?Ao(e[1],t):0}},wo=new Set(["x","y","z"]),Mo=F.filter(t=>!wo.has(t));const Co={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:So(4,13),y:So(5,14)},Do=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(Po);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=mo(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=mo(u);for(let n=e;n<t;n++)d?mo(h[n]):d=mo(h[n])}else d=mo(h);if(c!==d)if(Vo(c)&&Vo(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===V&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return Mo.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],To(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Co[t](i,s)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);To(i,a[n]),t[n]=Co[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function Ro(t,e,n,i){return(t=>Object.keys(t).some(Po))(e)?Do(t,e,n,i):{target:e,transitionEnd:i}}const Bo=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.current;if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!si(e))return;const n=ai(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!si(o))continue;const s=ai(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return Ro(t,e=o.target,n,i=o.transitionEnd)},Lo=("undefined"==typeof process||process.env,"production"),ko={current:null},Fo={current:!1};function jo(t){return Boolean(M(t)&&t.add)}function Io(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function Uo(t,e,n={}){var i;const o=go(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>Oo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(No).forEach((t,i)=>{r.push(Uo(t,e,{...s,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function Oo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&zo(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&j.has(e)&&(s={...s,type:!1,delay:0});let a=Kn(e,i,o,s);jo(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=go(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){yo(t,e,y(s[e]))}}(t,a)})}function No(t,e){return t.sortNodePosition(e)}function zo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const $o=[Pe.Animate,Pe.InView,Pe.Focus,Pe.Hover,Pe.Tap,Pe.Drag,Pe.Exit],Go=[...$o].reverse(),Ho=$o.length;function Wo(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>Uo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Uo(t,e,n);else{const o="function"==typeof e?go(t,e,n.custom):e;i=Oo(t,o,n)}return i.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Yo(t){let e=Wo(t);const n={[Pe.Animate]:qo(!0),[Pe.InView]:qo(),[Pe.Hover]:qo(),[Pe.Tap]:qo(),[Pe.Drag]:qo(),[Pe.Focus]:qo(),[Pe.Exit]:qo()};let i=!0;const o=(e,n)=>{const i=go(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<Ho;e++){const m=Go[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||I(g)||"boolean"==typeof g)continue;const P=Xo(f.prevProp,g);let T=P||m===r&&f.isActive&&!b&&y||e>p&&y;const V=Array.isArray(g)?g:[g];let E=V.reduce(o,{});!1===x&&(E={});const{prevResolvedValues:A={}}=f,S={...A,...E},w=t=>{T=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in S){const e=E[t],n=A[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!Io(e,n)||P?w(t):f.protectedKeys[t]=!0:void 0!==e?w(t):h.add(t):void 0!==e&&h.has(t)?w(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=E,f.isActive&&(d={...d,...E}),i&&t.blockInitialAnimation&&(T=!1),T&&!b&&c.push(...V.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)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,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Xo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Io(e,t)}function qo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Ko=new Set;const Zo=Object.keys(z),_o=Zo.length,Jo=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const Qo=["initial",...$o],ts=Qo.length;class es extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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=()=>Dt.render(this.render,!1,!0);const{latestValues:s,renderState:r}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=r,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=O(e),this.isVariantNode=N(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==s[t]&&M(e)&&(e.set(s[t],!1),jo(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Fo.current||function(){if(Fo.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ko.current=t.matches;t.addListener(e),e()}else ko.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ko.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),Rt.update(this.notifyUpdate),Rt.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=j.has(t),i=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&Dt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<_o;e++){const n=Zo[e],{isEnabled:i,Component:o}=z[n];i(t)&&o&&a.push(s(o,{key:n,...t,visualElement:this}))}if(!this.projection&&o){this.projection=new o(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a}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)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<Jo.length;e++){const n=Jo[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),jo(i)&&i.add(o);else if(M(r))t.addValue(o,vi(s)),jo(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,vi(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const i={};for(let t=0;t<ts;t++){const e=Qo[t],n=this.props[e];(U(n)||!1===n)&&(i[e]=n)}return i}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=vi(e),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,i="string"==typeof n||"object"==typeof n?null===(e=k(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==i)return i;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||M(o)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new mi),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:i},o){let s=function(t,e,n){var i;const o={};for(const s in t){const t=xo(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(n,t||{},this);if(i&&(e&&(e=i(e)),n&&(n=i(n)),s&&(s=i(s))),o){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||co(u))?u=parseFloat(u):!vo(u)&&ct.test(l)&&(u=mn(r,l)),t.addValue(r,vi(u)),void 0===n[r]&&(n[r]=u),null!==u&&t.setBaseTarget(r,u))}}(this,n,s);const t=Bo(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class ns extends es{readValueFromInstance(t,e){if(j.has(e)){const t=pn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Oe(t,e)}build(t,e,n,i){G(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t){return H(t)}renderInstance(t,e,n,i){W(t,e,n,i)}}const is={animation:ti(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Yo(t)),I(n)&&e(()=>n.subscribe(t),[n])}),exit:ti(t=>{const{custom:n,visualElement:o}=t,[s,r]=ni(),a=i(T);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(Pe.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function os(t,e,n){return(i,o)=>{ft(i)&&!se()&&(t.animationState&&t.animationState.setActive(Pe.Hover,e),n&&n(i,o))}}const ss=(t,e)=>!!e&&(t===e||ss(t,e.parentElement));const rs=new WeakMap,as=new WeakMap,ls=t=>{const e=rs.get(t.target);e&&e(t)},us=t=>{t.forEach(ls)};function cs(t,e,n){const i=function({root:t,...e}){const n=t||document;as.has(n)||as.set(n,{});const i=as.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(us,{root:t,...e})),i[o]}(e);return rs.set(t,n),i.observe(t),()=>{rs.delete(t),i.unobserve(t)}}const hs={some:0,all:1};function ds(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t||!i.current)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:hs[r]};return cs(i.current,e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(Pe.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function ps(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==Lo&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Ko.has(e)||(console.warn(e),s&&console.warn(s),Ko.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(Pe.InView,!0)}))},[t])}const ms={inView:ti((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ps:ds)(a,r.current,t,s)})),tap:ti((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(Pe.Tap,!1),!se()}function d(e,n){h()&&(ss(s.current,e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=Yt(Gt(window,"pointerup",d,u),Gt(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(Pe.Tap,!0),e&&e(t,n))}Ht(s,"pointerdown",r?m:void 0,u),Qn(c)})),focus:ti((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Ot(e,"focus",t?()=>{n&&n.setActive(Pe.Focus,!0)}:void 0),Ot(e,"blur",t?()=>{n&&n.setActive(Pe.Focus,!1)}:void 0)})),hover:ti((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Ht(i,"pointerenter",t||n?os(i,!0,t):void 0,{passive:!t}),Ht(i,"pointerleave",e||n?os(i,!1,e):void 0,{passive:!e})}))};class fs extends es{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return j.has(e)?(null===(n=pn(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return q(t)}build(t,e,n,i){K(t,e,n,i.transformTemplate)}renderInstance(t,e,n,i){Z(t,e,n,i)}}const vs={...{renderer:(t,e)=>_(t)?new fs(e,{enableHardwareAcceleration:!1}):new ns(e,{enableHardwareAcceleration:!0}),...is,...ms},...ei,...hi,projectionNodeConstructor:uo};export{vs as domMax};
1
+ import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{t as r,v as a,w as l,x as u,y as c,z as h,A as d,B as p,C as m,i as f,D as v,E as g,F as y,a as x,u as b,M as P,P as V,G as T,H as E,g as A,L as S,S as w,d as M,r as C,I as D,J as R,K as B,N as L,o as k,O as F,Q as j,n as I,c as U,b as O,m as N,f as z,R as $,h as G,q as H,T as W,U as Y,V as X,s as q,j as K,p as Z,k as _,l as J}from"./size-rollup-dom-max-assets.js";const Q=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),tt=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},et={test:Q("hsl","hue"),parse:tt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},nt=p(0,255),it=Object.assign(Object.assign({},d),{transform:t=>Math.round(nt(t))}),ot={test:Q("rgb","red"),parse:tt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+it.transform(t)+", "+it.transform(e)+", "+it.transform(n)+", "+c(h.transform(i))+")"};const st={test:Q("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:ot.transform},rt={test:t=>ot.test(t)||st.test(t)||et.test(t),parse:t=>ot.test(t)?ot.parse(t):et.test(t)?et.parse(t):st.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?ot.transform(t):et.transform(t)};function at(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(rt.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function lt(t){return at(t).values}function ut(t){const{values:e,numColors:n,tokenised:i}=at(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?rt.transform(t[i]):c(t[i]));return e}}const ct=t=>"number"==typeof t?0:t;const ht={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:lt,createTransformer:ut,getAnimatableNone:function(t){const e=lt(t);return ut(t)(e.map(ct))}},dt=new Set(["brightness","contrast","saturate","opacity"]);function pt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=dt.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const mt=/([a-z-]*)\(.*?\)/g,ft=Object.assign(Object.assign({},ht),{getAnimatableNone:t=>{const e=t.match(mt);return e?e.map(pt).join(" "):t}});function vt(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function gt(t){return!!t.touches}const yt={pageX:0,pageY:0};function xt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||yt;return{x:n[e+"X"],y:n[e+"Y"]}}function bt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function Pt(t,e="page"){return{point:gt(t)?xt(t,e):bt(t,e)}}const Vt=(t,e=!1)=>{const n=e=>t(e,Pt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},Tt="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Et="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Tt()),1/60*1e3);let At=!0,St=!1,wt=!1;const Mt={delta:0,timestamp:0},Ct=["read","update","preRender","render","postRender"],Dt=Ct.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>St=!0),t),{}),Rt=Ct.reduce((t,e)=>{const n=Dt[e];return t[e]=(t,e=!1,i=!1)=>(St||jt(),n.schedule(t,e,i)),t},{}),Bt=Ct.reduce((t,e)=>(t[e]=Dt[e].cancel,t),{}),Lt=Ct.reduce((t,e)=>(t[e]=()=>Dt[e].process(Mt),t),{}),kt=t=>Dt[t].process(Mt),Ft=t=>{St=!1,Mt.delta=At?1/60*1e3:Math.max(Math.min(t-Mt.timestamp,40),1),Mt.timestamp=t,wt=!0,Ct.forEach(kt),wt=!1,St&&(At=!1,Et(Ft))},jt=()=>{St=!0,At=!0,wt||Et(Ft)},It=()=>Mt,Ut=t=>1e3*t;function Ot(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Nt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return Ot(e,n,i,o)},[t,n,i,o])}const zt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},$t={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Gt(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?$t[t]:f&&null===window.onmousedown?zt[t]:t}function Ht(t,e,n,i){return Ot(t,Gt(e),Vt(n,"pointerdown"===e),i)}function Wt(t,e,n,i){return Nt(t,Gt(e),n&&Vt(n,"pointerdown"===e),i)}const Yt=(t,e)=>n=>e(t(n)),Xt=(...t)=>t.reduce(Yt),qt=(t,e)=>Math.abs(t-e);class Kt{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=Jt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=qt(t.x,e.x),i=qt(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=It();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Zt(e,this.transformPagePoint),vt(t)&&0===t.buttons?this.handlePointerUp(t,e):Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=Jt(Zt(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},gt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=Zt(Pt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=It();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,Jt(i,this.history)),this.removeListeners=Xt(Ht(window,"pointermove",this.handlePointerMove),Ht(window,"pointerup",this.handlePointerUp),Ht(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bt.update(this.updatePoint)}}function Zt(t,e){return e?{point:e(t.point)}:t}function _t(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Jt({point:t},e){return{point:t,delta:_t(t,te(e)),offset:_t(t,Qt(e)),velocity:ee(e,.1)}}function Qt(t){return t[0]}function te(t){return t[t.length-1]}function ee(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=te(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>Ut(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ne(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ie=ne("dragHorizontal"),oe=ne("dragVertical");function se(t){let e=!1;if("y"===t)e=oe();else if("x"===t)e=ie();else{const t=ie(),n=oe();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function re(){const t=se(!0);return!t||(t(),!1)}const ae=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},le=(t,e,n)=>-n*t+n*e+t;function ue(t){return t.max-t.min}function ce(t,e=0,n=.01){return Math.abs(t-e)<=n}function he(t,e,n,i=.5){t.origin=i,t.originPoint=le(e.min,e.max,t.origin),t.scale=ue(n)/ue(e),(ce(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=le(n.min,n.max,t.origin)-t.originPoint,(ce(t.translate)||isNaN(t.translate))&&(t.translate=0)}function de(t,e,n,i){he(t.x,e.x,n.x,null==i?void 0:i.originX),he(t.y,e.y,n.y,null==i?void 0:i.originY)}function pe(t,e,n){t.min=n.min+e.min,t.max=t.min+ue(e)}function me(t,e,n){t.min=e.min-n.min,t.max=t.min+ue(e)}function fe(t,e,n){me(t.x,e.x,n.x),me(t.y,e.y,n.y)}const ve=(t,e,n)=>Math.min(Math.max(n,t),e);function ge(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 ye(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const xe=.35;function be(t,e,n){return{min:Pe(t,e),max:Pe(t,n)}}function Pe(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var Ve;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Ve||(Ve={}));function Te(t){return[t("x"),t("y")]}function Ee({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ae(t){return void 0===t||1===t}function Se({scale:t,scaleX:e,scaleY:n}){return!Ae(t)||!Ae(e)||!Ae(n)}function we(t){return Se(t)||Me(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Me(t){return Ce(t.x)||Ce(t.y)}function Ce(t){return t&&"0%"!==t}function De(t,e,n){return n+e*(t-n)}function Re(t,e,n,i,o){return void 0!==o&&(t=De(t,o,i)),De(t,n,i)+e}function Be(t,e=0,n=1,i,o){t.min=Re(t.min,e,n,i,o),t.max=Re(t.max,e,n,i,o)}function Le(t,{x:e,y:n}){Be(t.x,e.translate,e.scale,e.originPoint),Be(t.y,n.translate,n.scale,n.originPoint)}function ke(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Fe(t,e){t.min=t.min+e,t.max=t.max+e}function je(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=le(t.min,t.max,s);Be(t,e[n],e[i],r,e.scale)}const Ie=["x","scaleX","originX"],Ue=["y","scaleY","originY"];function Oe(t,e){je(t.x,e,Ie),je(t.y,e,Ue)}function Ne(t,e){return Ee(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const ze=t=>t,$e=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ge(t,e,n,i){if(t===e&&n===i)return ze;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=$e(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:$e(o(t),e,i)}const He=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,We=t=>e=>1-t(1-e),Ye=t=>t*t,Xe=We(Ye),qe=He(Ye),Ke=t=>1-Math.sin(Math.acos(t)),Ze=We(Ke),_e=He(Ze),Je=(t=1.525)=>e=>e*e*((t+1)*e-t),Qe=Je(),tn=We(Qe),en=He(Qe),nn=(t=>{const e=Je(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(),on={linear:ze,easeIn:Ye,easeInOut:qe,easeOut:Xe,circIn:Ke,circInOut:_e,circOut:Ze,backIn:Qe,backInOut:en,backOut:tn,anticipate:nn},sn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Ge(e,n,i,o)}return"string"==typeof t?on[t]:t},rn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ht.test(e)||e.startsWith("url("))),an=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),ln=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),un=()=>({type:"keyframes",ease:"linear",duration:.3}),cn=t=>({type:"keyframes",duration:.8,values:t}),hn={x:an,y:an,z:an,rotate:an,rotateX:an,rotateY:an,rotateZ:an,scaleX:ln,scaleY:ln,scale:ln,opacity:un,backgroundColor:un,color:un,default:ln},dn=(t,e)=>{let n;return n=v(e)?cn:hn[t]||hn.default,{to:e,...n(e)}},pn={...g,color:rt,backgroundColor:rt,outlineColor:rt,fill:rt,stroke:rt,borderColor:rt,borderTopColor:rt,borderRightColor:rt,borderBottomColor:rt,borderLeftColor:rt,filter:ft,WebkitFilter:ft},mn=t=>pn[t];function fn(t,e){var n;let i=mn(t);return i!==ft&&(i=ht),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const vn=!1;function gn(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Bt.read(i),t(s-e))};return Rt.read(i,!0),()=>Bt.read(i)}function yn(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 xn=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},bn=[st,ot,et];function Pn(t){const e=(n=t,bn.find(t=>t.test(n)));var n;let i=e.parse(t);return e===et&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=yn(a,i,t+1/3),s=yn(a,i,t),r=yn(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}(i)),i}const Vn=(t,e)=>{const n=Pn(t),i=Pn(e),o={...n};return t=>(o.red=xn(n.red,i.red,t),o.green=xn(n.green,i.green,t),o.blue=xn(n.blue,i.blue,t),o.alpha=le(n.alpha,i.alpha,t),ot.transform(o))};function Tn(t,e){return"number"==typeof t?n=>le(t,e,n):rt.test(t)?Vn(t,e):wn(t,e)}const En=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>Tn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},An=(t,e)=>{const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Tn(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function Sn(t){const e=ht.parse(t),n=e.length;let i=0,o=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:o++;return{parsed:e,numNumbers:i,numColors:o}}const wn=(t,e)=>{const n=ht.createTransformer(e),i=Sn(t),o=Sn(e);return i.numColors===o.numColors&&i.numNumbers>=o.numNumbers?Xt(En(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},Mn=(t,e)=>n=>le(t,e,n);function Cn(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?Mn:"string"==typeof s?rt.test(s)?Vn:wn:Array.isArray(s)?En:"object"==typeof s?An:Mn);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=Xt(t,s)}i.push(s)}return i}function Dn(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Cn(e,i,o),a=r.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=ae(t[n],t[n+1],e);return r[n](i)};return n?e=>l(ve(t[0],t[s-1],e)):l}function Rn(t,e){return t.map(()=>e||qe).splice(0,t.length-1)}function Bn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=ve(.05,1,r),t=ve(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/Ln(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Ln(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Ln(t,e){return t*Math.sqrt(1-e*e)}const kn=["duration","bounce"],Fn=["stiffness","damping","mass"];function jn(t,e){return e.some(e=>void 0!==t[e])}function In({from:t=0,to:e=1,restSpeed:n=2,restDelta:i=.01,...o}){const s={done:!1,value:t};let{stiffness:r,damping:a,mass:l,velocity:u,duration:c,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!jn(t,Fn)&&jn(t,kn)){const n=Bn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(o),d=Un,p=Un;function m(){const n=u?-u/1e3:0,o=e-t,s=a/(2*Math.sqrt(r*l)),c=Math.sqrt(r/l)/1e3;if(void 0===i&&(i=Math.min(Math.abs(e-t)/100,.4)),s<1){const t=Ln(c,s);d=i=>{const r=Math.exp(-s*c*i);return e-r*((n+s*c*o)/t*Math.sin(t*i)+o*Math.cos(t*i))},p=e=>{const i=Math.exp(-s*c*e);return s*c*i*(Math.sin(t*e)*(n+s*c*o)/t+o*Math.cos(t*e))-i*(Math.cos(t*e)*(n+s*c*o)-t*o*Math.sin(t*e))}}else if(1===s)d=t=>e-Math.exp(-c*t)*(o+(n+c*o)*t);else{const t=c*Math.sqrt(s*s-1);d=i=>{const r=Math.exp(-s*c*i),a=Math.min(t*i,300);return e-r*((n+s*c*o)*Math.sinh(a)+t*o*Math.cosh(a))/t}}}return m(),{next:t=>{const o=d(t);if(h)s.done=t>=c;else{const r=1e3*p(t),a=Math.abs(r)<=n,l=Math.abs(e-o)<=i;s.done=a&&l}return s.value=s.done?e:o,s},flipTarget:()=>{u=-u,[t,e]=[e,t],m()}}}In.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Un=t=>0;const On={decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}},keyframes:function({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return Dn(a,r,{ease:Array.isArray(n)?n:Rn(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}},spring:In};function Nn(t,e,n=0){return t-e-n}const zn=t=>{const e=({delta:e})=>t(e);return{start:()=>Rt.update(e,!0),stop:()=>Bt.update(e)}};function $n({from:t,autoplay:e=!0,driver:n=zn,elapsed:i=0,repeat:o=0,repeatType:s="loop",repeatDelay:r=0,onPlay:a,onStop:l,onComplete:u,onRepeat:c,onUpdate:h,type:d="keyframes",...p}){var m,f;let v,g,y,{to:x}=p,b=0,P=p.duration,V=!1,T=!0;const E=On[Array.isArray(x)?"keyframes":d];(null===(f=(m=E).needsInterpolation)||void 0===f?void 0:f.call(m,t,x))&&(y=Dn([0,100],[t,x],{clamp:!1}),t=0,x=100);const A=E({...p,from:t,to:x});function S(){b++,"reverse"===s?(T=b%2==0,i=function(t,e=0,n=0,i=!0){return i?Nn(e+-t,e,n):e-(t-e)+n}(i,P,r,T)):(i=Nn(i,P,r),"mirror"===s&&A.flipTarget()),V=!1,c&&c()}function w(t){if(T||(t=-t),i+=t,!V){const t=A.next(Math.max(0,i));g=t.value,y&&(g=y(g)),V=T?t.done:i<=0}null==h||h(g),V&&(0===b&&(null!=P||(P=i)),b<o?function(t,e,n,i){return i?t>=e+n:t<=-n}(i,P,r,T)&&S():(v.stop(),u&&u()))}return e&&(null==a||a(),v=n(w),v.start()),{stop:()=>{null==l||l(),v.stop()}}}function Gn(t,e){return e?t*(1e3/e):0}function Hn({ease:t,times:e,...n}){const i={...n};return e&&(i.offset=e),n.duration&&(i.duration=Ut(n.duration)),n.repeatDelay&&(i.repeatDelay=Ut(n.repeatDelay)),t&&(i.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(sn):sn(t)),"tween"===n.type&&(i.type="keyframes"),"spring"!==n.type&&(i.type="keyframes"),i}function Wn(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...dn(n,e.to)}),{...e,...Hn(t)}}function Yn(t,e,n,i,o){const s=Kn(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=rn(t,n);"none"===r&&a&&"string"==typeof n?r=fn(t,n):Xn(r)&&"string"==typeof n?r=qn(n):!Array.isArray(n)&&Xn(n)&&"string"==typeof r&&(n=qn(r));return rn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=$n({...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p})}function y(t){g({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=Gn(t-c,It().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):$n({...Wn(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function Xn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function qn(t){return"number"==typeof t?0:fn("",t)}function Kn(t,e){return t[e]||t.default||t}function Zn(t,e,n,i={}){return vn&&(i={type:!1}),e.start(o=>{let s;const r=Yn(t,e,n,i,o),a=function(t,e){var n,i;return null!==(i=null!==(n=(Kn(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),l=()=>s=r();let u;return a?u=gn(l,Ut(a)):l(),()=>{u&&u(),s&&s.stop()}})}const _n=new WeakMap;class Jn{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}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Kt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(Pt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=se(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Te(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(o){i=ue(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(Ve.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&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&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),null==s||s(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:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(Ve.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Qn(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?le(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?le(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:ge(t.x,n,o),y:ge(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=xe){return!1===t?t=0:!0===t&&(t=xe),{x:be(t,"left","right"),y:be(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Te(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||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=Ne(t,n),{scroll:o}=e;return o&&(Fe(i.x,o.offset.x),Fe(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:ye(t.x,e.x),y:ye(t.y,e.y)}}(i.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=Ee(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Te(r=>{var l;if(!Qn(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return Zn(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Te(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Te(e=>{const{drag:n}=this.getProps();if(!Qn(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e];o.set(t[e]-le(n,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Te(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=ue(t),o=ue(e);return o>i?n=ae(e.min,e.max-i,t.min):i>o&&(n=ae(t.min,t.max-o,e.min)),ve(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Te(t=>{if(!Qn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(le(i,s,o[t]))})}addListeners(){var t;if(!this.visualElement.current)return;_n.set(this.visualElement,this);const e=Ht(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=Ot(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Te(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=xe,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function Qn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function ti(t){return e(()=>()=>t(),[])}const ei=t=>e=>(t(e),null),ni={pan:ei((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Wt(a,"pointerdown",l&&function(t){u.current=new Kt(t,h,{transformPagePoint:c})}),ti(()=>u.current&&u.current.end())})),drag:ei((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new Jn(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function ii(){const t=i(V);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function oi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const si={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!T.test(t))return t;t=parseFloat(t)}return`${oi(t,e.target.x)}% ${oi(t,e.target.y)}%`}};function ri(t){return"string"==typeof t&&t.startsWith("var(--")}const ai=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function li(t,e,n=1){const[i,o]=function(t){const e=ai.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():ri(o)?li(o,e,n+1):o}const ui={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(ai,t=>(s.push(t),"_$css")));const r=ht.parse(t);if(r.length>5)return i;const a=ht.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=le(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class ci extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;E(hi),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0: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:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const hi={borderRadius:{...si,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:si,borderTopRightRadius:si,borderBottomLeftRadius:si,borderBottomRightRadius:si,boxShadow:ui},di={measureLayout:function(e){const[n,o]=ii(),s=i(S);return t.createElement(ci,{...e,layoutGroup:s,switchLayoutGroup:i(w),isPresent:n,safeToRemove:o})}};function pi(t,e){-1===t.indexOf(e)&&t.push(e)}function mi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class fi{constructor(){this.subscriptions=[]}add(t){return pi(this.subscriptions,t),()=>mi(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class vi{constructor(t){var e;this.version="7.7.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new fi,this.velocityUpdateSubscribers=new fi,this.renderSubscribers=new fi,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=It();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Rt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Rt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Gn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function gi(t){return new vi(t)}const yi=["TopLeft","TopRight","BottomLeft","BottomRight"],xi=yi.length,bi=t=>"string"==typeof t?parseFloat(t):t,Pi=t=>"number"==typeof t||T.test(t);function Vi(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Ti=Ai(0,.5,Ze),Ei=Ai(.5,.95,ze);function Ai(t,e,n){return i=>i<t?0:i>e?1:n(ae(t,e,i))}function Si(t,e){t.min=e.min,t.max=e.max}function wi(t,e){Si(t.x,e.x),Si(t.y,e.y)}function Mi(t,e,n,i,o){return t=De(t-=e,1/n,i),void 0!==o&&(t=De(t,1/o,i)),t}function Ci(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=le(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=le(s.min,s.max,i);t===s&&(a-=e),t.min=Mi(t.min,e,n,a,o),t.max=Mi(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Di=["x","scaleX","originX"],Ri=["y","scaleY","originY"];function Bi(t,e,n,i){Ci(t.x,e,Di,null==n?void 0:n.x,null==i?void 0:i.x),Ci(t.y,e,Ri,null==n?void 0:n.y,null==i?void 0:i.y)}function Li(t){return 0===t.translate&&1===t.scale}function ki(t){return Li(t.x)&&Li(t.y)}function Fi(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 ji(t){return ue(t.x)/ue(t.y)}class Ii{constructor(){this.members=[]}add(t){pi(this.members,t),t.scheduleRender()}remove(t){if(mi(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){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ui(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y;if((o||s)&&(i=`translate3d(${o}px, ${s}px, 0) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(i+=`scale(${r}, ${a})`),i||"none"}const Oi=(t,e)=>t.depth-e.depth;class Ni{constructor(){this.children=[],this.isDirty=!1}add(t){pi(this.children,t),this.isDirty=!0}remove(t){mi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Oi),this.isDirty=!1,this.children.forEach(t)}}const zi=["","X","Y","Z"];let $i=0;function Gi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=$i++,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(Yi),this.nodes.forEach(_i),this.nodes.forEach(Ji)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.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 Ni)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new fi),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=gn(i,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(Zi))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:oo,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Fi(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...Kn(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Zi(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Bt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(Qi),this.animationId++)}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));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")}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(qi);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(so),this.potentialNodes.clear()),this.nodes.forEach(Ki),this.nodes.forEach(Hi),this.nodes.forEach(Wi),this.clearAllSnapshots(),Lt.update(),Lt.preRender(),Lt.render())}clearAllSnapshots(){this.nodes.forEach(Xi),this.sharedNodes.forEach(to)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;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 e=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),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}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:i(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!ki(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||we(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),ro((i=n).x),ro(i.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&&(Fe(e.x,n.offset.x),Fe(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};wi(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;if(i!==this.root&&o&&s.layoutScroll){if(o.isRoot){wi(e,t);const{scroll:n}=this.root;n&&(Fe(e.x,-n.offset.x),Fe(e.y,-n.offset.y))}Fe(e.x,o.offset.x),Fe(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};wi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Oe(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),we(i.latestValues)&&Oe(n,i.latestValues)}return we(this.latestValues)&&Oe(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};wi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!we(i.latestValues))continue;Se(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};wi(o,i.measurePageBox()),Bi(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layoutBox,o)}return we(this.latestValues)&&Bi(n,this.latestValues),n}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(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:i}=this.options;if(this.layout&&(n||i)){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}},fe(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),wi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,s,r;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&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(o=this.target,s=this.relativeTarget,r=this.relativeParent.target,pe(o.x,s.x,r.x),pe(o.y,s.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):wi(this.target,this.layout.layoutBox),Le(this.target,this.targetDelta)):wi(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}},fe(this.relativeTargetOrigin,this.target,t.target),wi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Se(this.parent.latestValues)&&!Me(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const i=this.getLead(),o=Boolean(this.resumingFrom)||this!==i;let s=!0;if(e&&(s=!1),o&&n&&(s=!1),s)return;const{layout:r,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!a)return;wi(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Oe(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Le(t,l)),i&&we(a.latestValues)&&Oe(t,a.latestValues));e.x=ke(e.x),e.y=ke(e.y)}(this.layoutCorrected,this.treeScale,this.path,o);const{target:l}=i;if(!l)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 u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;de(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=Ui(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,i;const o=this.snapshot,s=(null==o?void 0:o.latestValues)||{},r={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},c=(null==o?void 0:o.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),h=((null===(i=this.getStack())||void 0===i?void 0:i.members.length)||0)<=1,d=Boolean(c&&!h&&!0===this.options.crossfade&&!this.path.some(io));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var o,p,m,f;eo(a.x,t.x,i),eo(a.y,t.y,i),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(fe(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),o=this.relativeTarget,p=this.relativeTargetOrigin,m=l,f=i,no(o.x,p.x,m.x,f),no(o.y,p.y,m.y,f)),c&&(this.animationValues=r,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=le(0,null!==(r=n.opacity)&&void 0!==r?r:1,Ti(i)),t.opacityExit=le(null!==(a=e.opacity)&&void 0!==a?a:1,0,Ei(i))):s&&(t.opacity=le(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<xi;o++){const s=`border${yi[o]}Radius`;let r=Vi(e,s),a=Vi(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Pi(r)===Pi(a)?(t[s]=Math.max(le(bi(r),bi(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=le(e.rotate||0,n.rotate||0,i))}(r,s,this.latestValues,i,d,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Bt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:gi(t);return Zn("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&ao(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ue(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=ue(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}wi(e,n),Oe(e,o),de(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ii);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}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 i=this.getStack();i&&i.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 i={};for(let e=0;e<zi.length;e++){const o="rotate"+zi[e];n[o]&&(i[o]=n[o],t.setStaticValue(o,0))}null==t||t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!we(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=Ui(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(i=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in D){if(void 0===a[t])continue;const{correct:e,applyTo:n}=D[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}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(qi),this.root.sharedNodes.clear()}}}function Hi(t){t.updateLayout()}function Wi(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:i}=t.options,s=o.source!==t.layout.source;"size"===i?Te(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=ue(n);n.min=e[t].min,n.max=n.min+i}):ao(i,o.layoutBox,e)&&Te(t=>{const n=s?o.measuredBox[t]:o.layoutBox[t],i=ue(e[t]);n.max=n.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};de(r,e,o.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?de(a,t.applyTransform(n,!0),o.measuredBox):de(a,e,o.layoutBox);const l=!ki(r);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:i}=n;if(t&&i){const n={x:{min:0,max:0},y:{min:0,max:0}};fe(n,o.layoutBox,t.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};fe(s,e,i.layoutBox),Fi(n,s)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function Yi(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Xi(t){t.clearSnapshot()}function qi(t){t.clearMeasurements()}function Ki(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Zi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function _i(t){t.resolveTargetDelta()}function Ji(t){t.calcProjection()}function Qi(t){t.resetRotation()}function to(t){t.removeLeadSnapshot()}function eo(t,e,n){t.translate=le(e.translate,0,n),t.scale=le(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function no(t,e,n,i){t.min=le(e.min,n.min,i),t.max=le(e.max,n.max,i)}function io(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const oo={duration:.45,ease:[.4,0,.1,1]};function so(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 i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function ro(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ao(t,e,n){return"position"===t||"preserve-aspect"===t&&!ce(ji(e),ji(n),.2)}const lo=Gi({attachResizeListener:(t,e)=>Ot(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),uo={current:void 0},co=Gi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!uo.current){const t=new lo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),uo.current=t}return uo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ho=t=>/^0[^.\s]+$/.test(t),po=t=>e=>e.test(t),mo=[d,T,u,R,B,L,{test:t=>"auto"===t,parse:t=>t}],fo=t=>mo.find(po(t)),vo=[...mo,rt,ht],go=t=>vo.find(po(t));function yo(t,e,n){const i=t.getProps();return k(i,e,void 0!==n?n:i.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 xo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,gi(n))}function bo(t,e){if(!e)return;return(e[t]||e.default||e).from}const Po=new Set(["width","height","top","left","right","bottom","x","y"]),Vo=t=>Po.has(t),To=(t,e)=>{t.set(e,!1),t.set(e)},Eo=t=>t===d||t===T;var Ao;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Ao||(Ao={}));const So=(t,e)=>parseFloat(t.split(", ")[e]),wo=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return So(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?So(e[1],t):0}},Mo=new Set(["x","y","z"]),Co=F.filter(t=>!Mo.has(t));const Do={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:wo(4,13),y:wo(5,14)},Ro=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(Vo);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=fo(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=fo(u);for(let n=e;n<t;n++)d?fo(h[n]):d=fo(h[n])}else d=fo(h);if(c!==d)if(Eo(c)&&Eo(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===T&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return Co.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],To(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Do[t](i,s)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);To(i,a[n]),t[n]=Do[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function Bo(t,e,n,i){return(t=>Object.keys(t).some(Vo))(e)?Ro(t,e,n,i):{target:e,transitionEnd:i}}const Lo=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.current;if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!ri(e))return;const n=li(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!ri(o))continue;const s=li(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return Bo(t,e=o.target,n,i=o.transitionEnd)},ko=("undefined"==typeof process||process.env,"production"),Fo={current:null},jo={current:!1};function Io(t){return Boolean(M(t)&&t.add)}function Uo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function Oo(t,e,n={}){var i;const o=yo(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>No(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(zo).forEach((t,i)=>{r.push(Oo(t,e,{...s,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function No(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&$o(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&j.has(e)&&(s={...s,type:!1,delay:0});let a=Zn(e,i,o,s);Io(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=yo(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){xo(t,e,y(s[e]))}}(t,a)})}function zo(t,e){return t.sortNodePosition(e)}function $o({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Go=[Ve.Animate,Ve.InView,Ve.Focus,Ve.Hover,Ve.Tap,Ve.Drag,Ve.Exit],Ho=[...Go].reverse(),Wo=Go.length;function Yo(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>Oo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Oo(t,e,n);else{const o="function"==typeof e?yo(t,e,n.custom):e;i=No(t,o,n)}return i.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Xo(t){let e=Yo(t);const n={[Ve.Animate]:Ko(!0),[Ve.InView]:Ko(),[Ve.Hover]:Ko(),[Ve.Tap]:Ko(),[Ve.Drag]:Ko(),[Ve.Focus]:Ko(),[Ve.Exit]:Ko()};let i=!0;const o=(e,n)=>{const i=yo(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<Wo;e++){const m=Ho[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||I(g)||"boolean"==typeof g)continue;const P=qo(f.prevProp,g);let V=P||m===r&&f.isActive&&!b&&y||e>p&&y;const T=Array.isArray(g)?g:[g];let E=T.reduce(o,{});!1===x&&(E={});const{prevResolvedValues:A={}}=f,S={...A,...E},w=t=>{V=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in S){const e=E[t],n=A[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!Uo(e,n)||P?w(t):f.protectedKeys[t]=!0:void 0!==e?w(t):h.add(t):void 0!==e&&h.has(t)?w(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=E,f.isActive&&(d={...d,...E}),i&&t.blockInitialAnimation&&(V=!1),V&&!b&&c.push(...T.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)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,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function qo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Uo(e,t)}function Ko(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Zo=new Set;const _o=Object.keys(z),Jo=_o.length,Qo=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const ts=["initial",...Go],es=ts.length;class ns extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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=()=>Rt.render(this.render,!1,!0);const{latestValues:s,renderState:r}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=r,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=O(e),this.isVariantNode=N(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==s[t]&&M(e)&&(e.set(s[t],!1),Io(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),jo.current||function(){if(jo.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fo.current=t.matches;t.addListener(e),e()}else Fo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Fo.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),Bt.update(this.notifyUpdate),Bt.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=j.has(t),i=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&Rt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<Jo;e++){const n=_o[e],{isEnabled:i,Component:o}=z[n];i(t)&&o&&a.push(s(o,{key:n,...t,visualElement:this}))}if(!this.projection&&o){this.projection=new o(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a}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)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<Qo.length;e++){const n=Qo[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),Io(i)&&i.add(o);else if(M(r))t.addValue(o,gi(s)),Io(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,gi(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const i={};for(let t=0;t<es;t++){const e=ts[t],n=this.props[e];(U(n)||!1===n)&&(i[e]=n)}return i}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=gi(e),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,i="string"==typeof n||"object"==typeof n?null===(e=k(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==i)return i;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||M(o)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new fi),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:i},o){let s=function(t,e,n){var i;const o={};for(const s in t){const t=bo(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(n,t||{},this);if(i&&(e&&(e=i(e)),n&&(n=i(n)),s&&(s=i(s))),o){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||ho(u))?u=parseFloat(u):!go(u)&&ht.test(l)&&(u=fn(r,l)),t.addValue(r,gi(u)),void 0===n[r]&&(n[r]=u),null!==u&&t.setBaseTarget(r,u))}}(this,n,s);const t=Lo(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class is extends ns{readValueFromInstance(t,e){if(j.has(e)){const t=mn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ne(t,e)}build(t,e,n,i){G(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t){return H(t)}renderInstance(t,e,n,i){W(t,e,n,i)}}const os={animation:ei(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Xo(t)),I(n)&&e(()=>n.subscribe(t),[n])}),exit:ei(t=>{const{custom:n,visualElement:o}=t,[s,r]=ii(),a=i(V);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(Ve.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function ss(t,e,n){return(i,o)=>{vt(i)&&!re()&&(t.animationState&&t.animationState.setActive(Ve.Hover,e),n&&n(i,o))}}const rs=(t,e)=>!!e&&(t===e||rs(t,e.parentElement));const as=new WeakMap,ls=new WeakMap,us=t=>{const e=as.get(t.target);e&&e(t)},cs=t=>{t.forEach(us)};function hs(t,e,n){const i=function({root:t,...e}){const n=t||document;ls.has(n)||ls.set(n,{});const i=ls.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(cs,{root:t,...e})),i[o]}(e);return as.set(t,n),i.observe(t),()=>{as.delete(t),i.unobserve(t)}}const ds={some:0,all:1};function ps(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t||!i.current)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:ds[r]};return hs(i.current,e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(Ve.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function ms(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==ko&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Zo.has(e)||(console.warn(e),s&&console.warn(s),Zo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(Ve.InView,!0)}))},[t])}const fs={inView:ei((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ms:ps)(a,r.current,t,s)})),tap:ei((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(Ve.Tap,!1),!re()}function d(e,n){h()&&(rs(s.current,e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=Xt(Ht(window,"pointerup",d,u),Ht(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(Ve.Tap,!0),e&&e(t,n))}Wt(s,"pointerdown",r?m:void 0,u),ti(c)})),focus:ei((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Nt(e,"focus",t?()=>{n&&n.setActive(Ve.Focus,!0)}:void 0),Nt(e,"blur",t?()=>{n&&n.setActive(Ve.Focus,!1)}:void 0)})),hover:ei((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Wt(i,"pointerenter",t||n?ss(i,!0,t):void 0,{passive:!t}),Wt(i,"pointerleave",e||n?ss(i,!1,e):void 0,{passive:!e})}))};class vs extends ns{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return j.has(e)?(null===(n=mn(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return q(t)}build(t,e,n,i){K(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){Z(t,e,n,i)}mount(t){this.isSVGTag=_(t.tagName),super.mount(t)}}const gs={...{renderer:(t,e)=>J(t)?new vs(e,{enableHardwareAcceleration:!1}):new is(e,{enableHardwareAcceleration:!0}),...os,...fs},...ni,...di,projectionNodeConstructor:co};export{gs as domMax};
@@ -1 +1 @@
1
- import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?o:a,y=e({strict:!1});function h(t,n,e,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i();o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:s,props:e,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;return g(()=>{h&&h.render()}),a(()=>{h&&h.animationState&&h.animationState.animateChanges()}),g(()=>()=>h&&h.notify("Unmount"),[]),h}function v(t,n,e){return s(r=>{var o;r&&t.mount&&t.mount(r),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):"object"==typeof(o=e)&&Object.prototype.hasOwnProperty.call(o,"current")&&(e.current=r))},[n])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const S=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function x(t){return b(t.animate)||S.some(n=>w(t[n]))}function V(t){const{initial:n,animate:e}=function(t,n){if(x(t)){const{initial:n,animate:e}=t;return{initial:!1===n||w(n)?n:void 0,animate:w(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(d));return c(()=>({initial:n,animate:e}),[C(n),C(e)])}function C(t){return Array.isArray(t)?t.join(" "):t}const O=t=>({isEnabled:n=>t.some(t=>!!n[t])}),T={measureLayout:O(["layout","layoutId","drag"]),animation:O(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:O(["exit"]),drag:O(["drag","dragControls"]),focus:O(["whileFocus"]),hover:O(["whileHover","onHoverStart","onHoverEnd"]),tap:O(["whileTap","onTap","onTapStart","onTapCancel"]),pan:O(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:O(["whileInView","onViewportEnter","onViewportLeave"])};function E(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}const P=!1;let k=1;const A=e({});class j extends n.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const L=e({}),M=Symbol.for("motionComponentSymbol");function D({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){n&&function(t){for(const n in t)"projectionNodeConstructor"===n?T.projectionNodeConstructor=t[n]:T[n].Component=t[n]}(n);const c=l((function(c,l){const u={...r(f),...c,layoutId:R(c)},{isStatic:m}=u;let g=null;const w=V(c),b=m?void 0:E(()=>{if(P)return k++}),S=i(c,m);if(!m&&p){w.visualElement=h(s,S,u,e);const t=r(y).strict,a=r(L);w.visualElement&&(g=w.visualElement.loadFeatures(u,t,n,b,o||T.projectionNodeConstructor,a))}return t.createElement(j,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,b,v(S,w.visualElement,l),S,m,w.visualElement)))}));return c[M]=s,c}function R({layoutId:t}){const n=r(A).id;return n&&void 0!==t?n+"-"+t:t}const B=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","text","tspan","use","view"];function W(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const X={},Y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(Y);function F(t,{layout:n,layoutId:e}){return H.has(t)||t.startsWith("origin")||(n||void 0!==e)&&(!!X[t]||"opacity"===t)}const I=t=>!!(null==t?void 0:t.getVelocity),$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Z=(t,n)=>Y.indexOf(t)-Y.indexOf(n);function z(t){return t.startsWith("--")}const U=(t,n)=>n&&"number"==typeof t?n.transform(t):t;const K={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},N=Object.assign(Object.assign({},K),{transform:(q=0,_=1,t=>Math.max(Math.min(t,_),q))});var q,_;const G=Object.assign(Object.assign({},K),{default:1}),J=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),Q=J("deg"),tt=J("%"),nt=J("px"),et=Object.assign(Object.assign({},tt),{parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)}),rt={...K,transform:Math.round},ot={borderWidth:nt,borderTopWidth:nt,borderRightWidth:nt,borderBottomWidth:nt,borderLeftWidth:nt,borderRadius:nt,radius:nt,borderTopLeftRadius:nt,borderTopRightRadius:nt,borderBottomRightRadius:nt,borderBottomLeftRadius:nt,width:nt,maxWidth:nt,height:nt,maxHeight:nt,size:nt,top:nt,right:nt,bottom:nt,left:nt,padding:nt,paddingTop:nt,paddingRight:nt,paddingBottom:nt,paddingLeft:nt,margin:nt,marginTop:nt,marginRight:nt,marginBottom:nt,marginLeft:nt,rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:Q,skewX:Q,skewY:Q,distance:nt,translateX:nt,translateY:nt,translateZ:nt,x:nt,y:nt,z:nt,perspective:nt,transformPerspective:nt,opacity:N,originX:et,originY:et,originZ:nt,zIndex:rt,fillOpacity:N,strokeOpacity:N,numOctaves:rt};function at(t,n,e,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in n){const e=n[t];if(z(t)){a[t]=e;continue}const r=ot[t],d=U(e,r);if(H.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;e!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(n.transform||(l||r?o.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort(Z);for(const e of n)i+=`${$[e]||e}(${t[e]}) `;return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,f,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:n="50%",originZ:e=0}=c;o.transformOrigin=`${t} ${n} ${e}`}}const it=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function st(t,n,e){for(const r in n)I(n[r])||F(r,e)||(t[r]=n[r])}function ct(t,n,e){const r={};return st(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return at(r,n,{enableHardwareAcceleration:!e},t),Object.assign({},r.vars,r.style)},[n])}(t,n,e)),t.transformValues?t.transformValues(r):r}function lt(t,n,e){const r={},o=ct(t,n,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const ut=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function ft(t){return ut.has(t)}let dt=t=>!ft(t);try{(mt=require("@emotion/is-prop-valid").default)&&(dt=t=>t.startsWith("on")?!ft(t):mt(t))}catch(t){}var mt;function pt(t,n,e){return"string"==typeof t?t:nt.transform(n+e*t)}const gt={offset:"stroke-dashoffset",array:"stroke-dasharray"},yt={offset:"strokeDashoffset",array:"strokeDasharray"};function ht(t,{attrX:n,attrY:e,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u){at(t,c,l,u),t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:m}=t;f.transform&&(m&&(d.transform=f.transform),delete f.transform),m&&(void 0!==r||void 0!==o||d.transform)&&(d.transformOrigin=function(t,n,e){return`${pt(n,t.x,t.width)} ${pt(e,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==n&&(f.x=n),void 0!==e&&(f.y=e),void 0!==a&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?gt:yt;t[a.offset]=nt.transform(-r);const i=nt.transform(n),s=nt.transform(e);t[a.array]=`${i} ${s}`}(f,a,i,s,!1)}const vt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function wt(t,n){const e=c(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return ht(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const n={};st(n,t.style,t),e.style={...n,...e.style}}return e}function bt(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(W(n)?wt:lt)(e,a,i),c={...function(t,n,e){const r={};for(const o in t)(dt(o)||!0===e&&ft(o)||!n&&!ft(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),...s,ref:o};return r&&(c["data-projection-id"]=r),u(n,c)}}const St=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function xt(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(St.has(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n.attrs[e])}function Vt(t){const{style:n}=t,e={};for(const r in n)(I(n[r])||F(r,t))&&(e[r]=n[r]);return e}function Ct(t){const n=I(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}const Ot=t=>(n,e)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Tt(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}(t,n,o,a);return e?i():E(i)};function Tt(t,n,e,r){const o={},a=r(t);for(const t in a)o[t]=Ct(a[t]);let{initial:i,animate:s}=t;const c=x(t),l=function(t){return Boolean(x(t)||t.variants)}(t);n&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let u=!!e&&!1===e.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(n=>{const e=function(t,n,e,r={},o={}){return"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),"string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a,...i}=e;for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[u?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}return o}const Et={useVisualState:Ot({scrapeMotionValuesFromProps:function(t){const n=Vt(t);for(const e in t)if(I(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:vt,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}ht(e,r,{enableHardwareAcceleration:!1},t.transformTemplate),xt(n,e)}})},Pt={useVisualState:Ot({scrapeMotionValuesFromProps:Vt,createRenderState:it})};const kt=function(t){function n(n,e={}){return D(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){return{...W(t)?Et:Pt,preloadedFeatures:e,useRender:bt(n),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{kt as m};
1
+ import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?o:a,y=e({strict:!1});function h(t,n,e,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i();o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:s,props:e,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;return g(()=>{h&&h.render()}),a(()=>{h&&h.animationState&&h.animationState.animateChanges()}),g(()=>()=>h&&h.notify("Unmount"),[]),h}function v(t,n,e){return s(r=>{var o;r&&t.mount&&t.mount(r),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):"object"==typeof(o=e)&&Object.prototype.hasOwnProperty.call(o,"current")&&(e.current=r))},[n])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const S=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function x(t){return b(t.animate)||S.some(n=>w(t[n]))}function C(t){const{initial:n,animate:e}=function(t,n){if(x(t)){const{initial:n,animate:e}=t;return{initial:!1===n||w(n)?n:void 0,animate:w(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(d));return c(()=>({initial:n,animate:e}),[O(n),O(e)])}function O(t){return Array.isArray(t)?t.join(" "):t}const V=t=>({isEnabled:n=>t.some(t=>!!n[t])}),T={measureLayout:V(["layout","layoutId","drag"]),animation:V(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:V(["exit"]),drag:V(["drag","dragControls"]),focus:V(["whileFocus"]),hover:V(["whileHover","onHoverStart","onHoverEnd"]),tap:V(["whileTap","onTap","onTapStart","onTapCancel"]),pan:V(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:V(["whileInView","onViewportEnter","onViewportLeave"])};function E(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}const P=!1;let k=1;const A=e({});class L extends n.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const j=e({}),B=Symbol.for("motionComponentSymbol");function M({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){n&&function(t){for(const n in t)"projectionNodeConstructor"===n?T.projectionNodeConstructor=t[n]:T[n].Component=t[n]}(n);const c=l((function(c,l){const u={...r(f),...c,layoutId:D(c)},{isStatic:m}=u;let g=null;const w=C(c),b=m?void 0:E(()=>{if(P)return k++}),S=i(c,m);if(!m&&p){w.visualElement=h(s,S,u,e);const t=r(y).strict,a=r(j);w.visualElement&&(g=w.visualElement.loadFeatures(u,t,n,b,o||T.projectionNodeConstructor,a))}return t.createElement(L,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,b,v(S,w.visualElement,l),S,m,w.visualElement)))}));return c[B]=s,c}function D({layoutId:t}){const n=r(A).id;return n&&void 0!==t?n+"-"+t:t}const R=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function W(t){return"string"==typeof t&&!t.includes("-")&&!!(R.indexOf(t)>-1||/[A-Z]/.test(t))}const X={},Y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(Y);function F(t,{layout:n,layoutId:e}){return H.has(t)||t.startsWith("origin")||(n||void 0!==e)&&(!!X[t]||"opacity"===t)}const I=t=>!!(null==t?void 0:t.getVelocity),$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Z=(t,n)=>Y.indexOf(t)-Y.indexOf(n);function z(t){return t.startsWith("--")}const N=(t,n)=>n&&"number"==typeof t?n.transform(t):t;const U={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},K=Object.assign(Object.assign({},U),{transform:(q=0,_=1,t=>Math.max(Math.min(t,_),q))});var q,_;const G=Object.assign(Object.assign({},U),{default:1}),J=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),Q=J("deg"),tt=J("%"),nt=J("px"),et=Object.assign(Object.assign({},tt),{parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)}),rt={...U,transform:Math.round},ot={borderWidth:nt,borderTopWidth:nt,borderRightWidth:nt,borderBottomWidth:nt,borderLeftWidth:nt,borderRadius:nt,radius:nt,borderTopLeftRadius:nt,borderTopRightRadius:nt,borderBottomRightRadius:nt,borderBottomLeftRadius:nt,width:nt,maxWidth:nt,height:nt,maxHeight:nt,size:nt,top:nt,right:nt,bottom:nt,left:nt,padding:nt,paddingTop:nt,paddingRight:nt,paddingBottom:nt,paddingLeft:nt,margin:nt,marginTop:nt,marginRight:nt,marginBottom:nt,marginLeft:nt,rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:Q,skewX:Q,skewY:Q,distance:nt,translateX:nt,translateY:nt,translateZ:nt,x:nt,y:nt,z:nt,perspective:nt,transformPerspective:nt,opacity:K,originX:et,originY:et,originZ:nt,zIndex:rt,fillOpacity:K,strokeOpacity:K,numOctaves:rt};function at(t,n,e,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in n){const e=n[t];if(z(t)){a[t]=e;continue}const r=ot[t],d=N(e,r);if(H.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;e!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(n.transform||(l||r?o.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort(Z);for(const e of n)i+=`${$[e]||e}(${t[e]}) `;return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,f,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:n="50%",originZ:e=0}=c;o.transformOrigin=`${t} ${n} ${e}`}}const it=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function st(t,n,e){for(const r in n)I(n[r])||F(r,e)||(t[r]=n[r])}function ct(t,n,e){const r={};return st(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return at(r,n,{enableHardwareAcceleration:!e},t),Object.assign({},r.vars,r.style)},[n])}(t,n,e)),t.transformValues?t.transformValues(r):r}function lt(t,n,e){const r={},o=ct(t,n,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const ut=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function ft(t){return ut.has(t)}let dt=t=>!ft(t);try{(mt=require("@emotion/is-prop-valid").default)&&(dt=t=>t.startsWith("on")?!ft(t):mt(t))}catch(t){}var mt;function pt(t,n,e){return"string"==typeof t?t:nt.transform(n+e*t)}const gt={offset:"stroke-dashoffset",array:"stroke-dasharray"},yt={offset:"strokeDashoffset",array:"strokeDasharray"};function ht(t,{attrX:n,attrY:e,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u,f){if(at(t,c,l,f),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(void 0!==r||void 0!==o||m.transform)&&(m.transformOrigin=function(t,n,e){return`${pt(n,t.x,t.width)} ${pt(e,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==n&&(d.x=n),void 0!==e&&(d.y=e),void 0!==a&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?gt:yt;t[a.offset]=nt.transform(-r);const i=nt.transform(n),s=nt.transform(e);t[a.array]=`${i} ${s}`}(d,a,i,s,!1)}const vt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),wt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function bt(t,n,e,r){const o=c(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return ht(e,n,{enableHardwareAcceleration:!1},wt(r),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const n={};st(n,t.style,t),o.style={...n,...o.style}}return o}function St(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(W(n)?bt:lt)(e,a,i,n),c={...function(t,n,e){const r={};for(const o in t)(dt(o)||!0===e&&ft(o)||!n&&!ft(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),...s,ref:o};return r&&(c["data-projection-id"]=r),u(n,c)}}const xt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ct(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(xt.has(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n.attrs[e])}function Ot(t){const{style:n}=t,e={};for(const r in n)(I(n[r])||F(r,t))&&(e[r]=n[r]);return e}function Vt(t){const n=I(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}const Tt=t=>(n,e)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Et(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}(t,n,o,a);return e?i():E(i)};function Et(t,n,e,r){const o={},a=r(t);for(const t in a)o[t]=Vt(a[t]);let{initial:i,animate:s}=t;const c=x(t),l=function(t){return Boolean(x(t)||t.variants)}(t);n&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let u=!!e&&!1===e.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(n=>{const e=function(t,n,e,r={},o={}){return"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),"string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a,...i}=e;for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[u?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}return o}const Pt={useVisualState:Tt({scrapeMotionValuesFromProps:function(t){const n=Ot(t);for(const e in t)if(I(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:vt,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}ht(e,r,{enableHardwareAcceleration:!1},wt(n.tagName),t.transformTemplate),Ct(n,e)}})},kt={useVisualState:Tt({scrapeMotionValuesFromProps:Ot,createRenderState:it})};const At=function(t){function n(n,e={}){return M(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){return{...W(t)?Pt:kt,preloadedFeatures:e,useRender:St(n),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{At as m};