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