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