framer-motion 7.6.2 → 7.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -2
- package/dist/es/index.mjs +1 -0
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +3 -2
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +65 -1
- package/dist/projection.dev.js +2 -2
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/package.json +2 -2
package/dist/framer-motion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var r=n(e),i=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,d=c?e.useLayoutEffect:e.useEffect,h=e.createContext({strict:!1});function f(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function p(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return m(t.animate)||g.some(e=>p(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||p(e)?e:void 0,animate:p(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const E=t=>({isEnabled:e=>t.some(t=>!!e[t])}),w={measureLayout:E(["layout","layoutId","drag"]),animation:E(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:E(["exit"]),drag:E(["drag","dragControls"]),focus:E(["whileFocus"]),hover:E(["whileHover","onHoverStart","onHoverEnd"]),tap:E(["whileTap","onTap","onTapStart","onTapCancel"]),pan:E(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:E(["whileInView","onViewportEnter","onViewportLeave"])};function S(t){for(const e in t)"projectionNodeConstructor"===e?w.projectionNodeConstructor=t[e]:w[e].Component=t[e]}function A(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const P={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let T=1;const C=e.createContext({});class V extends r.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:r,useVisualState:p,Component:m}){t&&S(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:O(g)},{isStatic:b}=y;let E=null;const S=x(g),C=b?void 0:A(()=>{if(P.hasEverUpdated)return T++}),R=p(g,b);if(!b&&c){S.visualElement=function(t,n,o,r){const i=l(),a=e.useContext(h),c=e.useContext(u),f=e.useContext(s).reducedMotion,p=e.useRef(void 0);r=r||a.renderer,!p.current&&r&&(p.current=r(t,{visualState:n,parent:i,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:f}));const m=p.current;return d(()=>{m&&m.syncRender()}),e.useEffect(()=>{m&&m.animationState&&m.animationState.animateChanges()}),d(()=>()=>m&&m.notifyUnmount(),[]),m}(m,R,y,n);const r=e.useContext(h).strict,i=e.useContext(M);S.visualElement&&(E=S.visualElement.loadFeatures(y,r,t,C,o||w.projectionNodeConstructor,i))}return i.createElement(V,{visualElement:S.visualElement,props:y},E,i.createElement(a.Provider,{value:S},r(m,g,C,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):f(o)&&(o.current=e))},[n])}(R,S.visualElement,v),R,b,S.visualElement)))}));return g[R]=m,g}function O({layoutId:t}){const n=e.useContext(C).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const D=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function j(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const F={};function I(t){Object.assign(F,t)}const B=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(B);function z(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!F[t]||"opacity"===t)}const N=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>B.indexOf(t)-B.indexOf(e);function $(t){return t.startsWith("--")}const Y=(t,e)=>e&&"number"==typeof t?e.transform(t):t,X=(t,e)=>n=>Math.max(Math.min(n,e),t),G=t=>t%1?Number(t.toFixed(5)):t,q=/(-)?([\d]*\.?[\d])+/g,Z=/(#[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,K=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function _(t){return"string"==typeof t}const J={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Q=Object.assign(Object.assign({},J),{transform:X(0,1)}),tt=Object.assign(Object.assign({},J),{default:1}),et=t=>({test:e=>_(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),nt=et("deg"),ot=et("%"),rt=et("px"),it=et("vh"),st=et("vw"),at=Object.assign(Object.assign({},ot),{parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)}),lt=(t,e)=>n=>Boolean(_(n)&&K.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ut=(t,e,n)=>o=>{if(!_(o))return o;const[r,i,s,a]=o.match(q);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ct={test:lt("hsl","hue"),parse:ut("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+ot.transform(G(e))+", "+ot.transform(G(n))+", "+G(Q.transform(o))+")"},dt=X(0,255),ht=Object.assign(Object.assign({},J),{transform:t=>Math.round(dt(t))}),ft={test:lt("rgb","red"),parse:ut("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+ht.transform(t)+", "+ht.transform(e)+", "+ht.transform(n)+", "+G(Q.transform(o))+")"};const pt={test:lt("#"),parse:function(t){let e="",n="",o="",r="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),r=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),r=t.substr(4,1),e+=e,n+=n,o+=o,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}},transform:ft.transform},mt={test:t=>ft.test(t)||pt.test(t)||ct.test(t),parse:t=>ft.test(t)?ft.parse(t):ct.test(t)?ct.parse(t):pt.parse(t),transform:t=>_(t)?t:t.hasOwnProperty("red")?ft.transform(t):ct.transform(t)};function gt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(Z);o&&(n=o.length,t=t.replace(Z,"${c}"),e.push(...o.map(mt.parse)));const r=t.match(q);return r&&(t=t.replace(q,"${n}"),e.push(...r.map(J.parse))),{values:e,numColors:n,tokenised:t}}function vt(t){return gt(t).values}function yt(t){const{values:e,numColors:n,tokenised:o}=gt(t),r=e.length;return t=>{let e=o;for(let o=0;o<r;o++)e=e.replace(o<n?"${c}":"${n}",o<n?mt.transform(t[o]):G(t[o]));return e}}const xt=t=>"number"==typeof t?0:t;const bt={test:function(t){var e,n,o,r;return isNaN(t)&&_(t)&&(null!==(n=null===(e=t.match(q))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(r=null===(o=t.match(Z))||void 0===o?void 0:o.length)&&void 0!==r?r:0)>0},parse:vt,createTransformer:yt,getAnimatableNone:function(t){const e=vt(t);return yt(t)(e.map(xt))}},Et=new Set(["brightness","contrast","saturate","opacity"]);function wt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(q)||[];if(!o)return t;const r=n.replace(o,"");let i=Et.has(e)?1:0;return o!==n&&(i*=100),e+"("+i+r+")"}const St=/([a-z-]*)\(.*?\)/g,At=Object.assign(Object.assign({},bt),{getAnimatableNone:t=>{const e=t.match(St);return e?e.map(wt).join(" "):t}}),Pt={...J,transform:Math.round},Tt={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scale:tt,scaleX:tt,scaleY:tt,scaleZ:tt,skew:nt,skewX:nt,skewY:nt,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:Q,originX:at,originY:at,originZ:rt,zIndex:Pt,fillOpacity:Q,strokeOpacity:Q,numOctaves:Pt};function Ct(t,e,n,o){const{style:r,vars:i,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,d=!0;for(const t in e){const n=e[t];if($(t)){i[t]=n;continue}const o=Tt[t],h=Y(n,o);if(U.has(t)){if(u=!0,s[t]=h,a.push(t),!d)continue;n!==(o.default||0)&&(d=!1)}else t.startsWith("origin")?(c=!0,l[t]=h):r[t]=h}if(e.transform||(u||o?r.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},r,i){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),i?s=i(t,r?"":s):o&&r&&(s="none"),s}(t,n,d,o):r.transform&&(r.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;r.transformOrigin=`${t} ${e} ${n}`}}const Vt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Mt(t,e,n){for(const o in e)N(e[o])||z(o,n)||(t[o]=e[o])}function Rt(t,n,o){const r={};return Mt(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Ct(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(r):r}function Lt(t,e,n){const o={},r=Rt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=r,o}const Ot=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 kt(t){return Ot.has(t)}let Dt=t=>!kt(t);function jt(t){t&&(Dt=e=>e.startsWith("on")?!kt(e):t(e))}try{jt(require("@emotion/is-prop-valid").default)}catch(t){}function Ft(t,e,n){const o={};for(const r in t)(Dt(r)||!0===n&&kt(r)||!e&&!kt(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function It(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Bt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ut={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,{attrX:e,attrY:n,originX:o,originY:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Ct(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:f}=t;d.transform&&(f&&(h.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==r||h.transform)&&(h.transformOrigin=function(t,e,n){return`${It(e,t.x,t.width)} ${It(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&function(t,e,n=1,o=0,r=!0){t.pathLength=1;const i=r?Bt:Ut;t[i.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[i.array]=`${s} ${a}`}(d,i,s,a,!1)}const Nt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Wt(t,n){const o=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return zt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Mt(e,t.style,t),o.style={...e,...o.style}}return o}function Ht(t=!1){return(n,o,r,i,{latestValues:s},a)=>{const l=(j(n)?Wt:Lt)(o,s,a),u={...Ft(o,"string"==typeof n,t),...l,ref:i};return r&&(u["data-projection-id"]=r),e.createElement(n,u)}}const $t=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Yt(t,{style:e,vars:n},o,r){Object.assign(t.style,e,r&&r.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Xt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Gt(t,e,n,o){Yt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Xt.has(n)?n:$t(n),e.attrs[n])}function qt(t){const{style:e}=t,n={};for(const o in e)(N(e[o])||z(o,t))&&(n[o]=e[o]);return n}function Zt(t){const e=qt(t);for(const n in t)if(N(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Kt(t,e,n,o={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),e}const _t=t=>Array.isArray(t),Jt=t=>_t(t)?t[t.length-1]||0:t;function Qt(t){const e=N(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const te=t=>(n,o)=>{const r=e.useContext(a),i=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,r,i){const s={latestValues:ee(o,r,i,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,r,i);return o?s():A(s)};function ee(t,e,n,o){const r={},i=o(t);for(const t in i)r[t]=Qt(i[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;if(d&&"boolean"!=typeof d&&!m(d)){(Array.isArray(d)?d:[d]).forEach(e=>{const n=Kt(t,e);if(!n)return;const{transitionEnd:o,transition:i,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(r[t]=e)}for(const t in o)r[t]=o[t]})}return r}const ne={useVisualState:te({scrapeMotionValuesFromProps:Zt,createRenderState:Nt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}zt(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),Gt(e,n)}})},oe={useVisualState:te({scrapeMotionValuesFromProps:qt,createRenderState:Vt})};function re(t,{forwardMotionProps:e=!1},n,o,r){return{...j(t)?ne:oe,preloadedFeatures:n,useRender:Ht(e),createVisualElement:o,projectionNodeConstructor:r,Component:t}}var ie;function se(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function ae(t,n,o,r){e.useEffect(()=>{const e=t.current;if(o&&e)return se(e,n,o,r)},[t,n,o,r])}function le(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ue(t){return!!t.touches}t.AnimationType=void 0,(ie=t.AnimationType||(t.AnimationType={})).Animate="animate",ie.Hover="whileHover",ie.Tap="whileTap",ie.Drag="whileDrag",ie.Focus="whileFocus",ie.InView="whileInView",ie.Exit="exit";const ce={pageX:0,pageY:0};function de(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||ce;return{x:n[e+"X"],y:n[e+"Y"]}}function he(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function fe(t,e="page"){return{point:ue(t)?de(t,e):he(t,e)}}const pe=(t,e=!1)=>{const n=e=>t(e,fe(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},me={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ge={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ve(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ge[t]:c&&null===window.onmousedown?me[t]:t}function ye(t,e,n,o){return se(t,ve(e),pe(n,"pointerdown"===e),o)}function xe(t,e,n,o){return ae(t,ve(e),n&&pe(n,"pointerdown"===e),o)}function be(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Ee=be("dragHorizontal"),we=be("dragVertical");function Se(t){let e=!1;if("y"===t)e=we();else if("x"===t)e=Ee();else{const t=Ee(),n=we();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ae(){const t=Se(!0);return!t||(t(),!1)}function Pe(e,n,o){return(r,i)=>{le(r)&&!Ae()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(r,i))}}const Te=(t,e)=>!!e&&(t===e||Te(t,e.parentElement));function Ce(t){return e.useEffect(()=>()=>t(),[])}function Ve(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}const Me=(t,e,n)=>Math.min(Math.max(n,t),e);function Re({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let r,i,s=1-e;s=Me(.05,1,s),t=Me(.01,10,t/1e3),s<1?(r=e=>{const o=e*s,r=o*t;return.001-(o-n)/Le(e,s)*Math.exp(-r)},i=e=>{const o=e*s*t,i=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=Le(Math.pow(e,2),s);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(r,i,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function Le(t,e){return t*Math.sqrt(1-e*e)}const Oe=["duration","bounce"],ke=["stiffness","damping","mass"];function De(t,e){return e.some(e=>void 0!==t[e])}function je(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:r}=t,i=Ve(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:h}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!De(t,ke)&&De(t,Oe)){const n=Re(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(i),f=Fe,p=Fe;function m(){const t=c?-c/1e3:0,o=n-e,i=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===r&&(r=Math.min(Math.abs(n-e)/100,.4)),i<1){const e=Le(s,i);f=r=>{const a=Math.exp(-i*s*r);return n-a*((t+i*s*o)/e*Math.sin(e*r)+o*Math.cos(e*r))},p=n=>{const r=Math.exp(-i*s*n);return i*s*r*(Math.sin(e*n)*(t+i*s*o)/e+o*Math.cos(e*n))-r*(Math.cos(e*n)*(t+i*s*o)-e*o*Math.sin(e*n))}}else if(1===i)f=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(i*i-1);f=r=>{const a=Math.exp(-i*s*r),l=Math.min(e*r,300);return n-a*((t+i*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return m(),{next:t=>{const e=f(t);if(h)s.done=t>=d;else{const i=1e3*p(t),a=Math.abs(i)<=o,l=Math.abs(n-e)<=r;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}je.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Fe=t=>0,Ie=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Be=(t,e,n)=>-n*t+n*e+t;function Ue(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}function ze({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let r=0,i=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;r=Ue(a,o,t+1/3),i=Ue(a,o,t),s=Ue(a,o,t-1/3)}else r=i=s=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*s),alpha:o}}const Ne=(t,e,n)=>{const o=t*t,r=e*e;return Math.sqrt(Math.max(0,n*(r-o)+o))},We=[pt,ft,ct],He=t=>We.find(e=>e.test(t)),$e=(t,e)=>{let n=He(t),o=He(e),r=n.parse(t),i=o.parse(e);n===ct&&(r=ze(r),n=ft),o===ct&&(i=ze(i),o=ft);const s=Object.assign({},r);return t=>{for(const e in s)"alpha"!==e&&(s[e]=Ne(r[e],i[e],t));return s.alpha=Be(r.alpha,i.alpha,t),n.transform(s)}},Ye=t=>"number"==typeof t,Xe=(t,e)=>n=>e(t(n)),Ge=(...t)=>t.reduce(Xe);function qe(t,e){return Ye(t)?n=>Be(t,e,n):mt.test(t)?$e(t,e):Je(t,e)}const Ze=(t,e)=>{const n=[...t],o=n.length,r=t.map((t,n)=>qe(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=r[e](t);return n}},Ke=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(o[r]=qe(t[r],e[r]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function _e(t){const e=bt.parse(t),n=e.length;let o=0,r=0,i=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?i++:r++;return{parsed:e,numNumbers:o,numRGB:r,numHSL:i}}const Je=(t,e)=>{const n=bt.createTransformer(e),o=_e(t),r=_e(e);return o.numHSL===r.numHSL&&o.numRGB===r.numRGB&&o.numNumbers>=r.numNumbers?Ge(Ze(o.parsed,r.parsed),n):n=>""+(n>0?e:t)},Qe=(t,e)=>n=>Be(t,e,n);function tn(t,e,n){const o=[],r=n||("number"==typeof(i=t[0])?Qe:"string"==typeof i?mt.test(i)?$e:Je:Array.isArray(i)?Ze:"object"==typeof i?Ke:void 0);var i;const s=t.length-1;for(let n=0;n<s;n++){let i=r(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;i=Ge(t,i)}o.push(i)}return o}function en(t,e,{clamp:n=!0,ease:o,mixer:r}={}){const i=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[i-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=tn(e,o,r),a=2===i?function([t,e],[n]){return o=>n(Ie(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return r=>{let i=0,s=!1;if(r<=t[0]?s=!0:r>=t[o]&&(i=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>r||e===o);e++);i=e-1}const a=Ie(t[i],t[i+1],r);return e[i](a)}}(t,s);return n?e=>a(Me(t[0],t[i-1],e)):a}const nn=t=>e=>1-t(1-e),on=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rn=t=>e=>e*e*((t+1)*e-t),sn=t=>t,an=(ln=2,t=>Math.pow(t,ln));var ln;const un=nn(an),cn=on(an),dn=t=>1-Math.sin(Math.acos(t)),hn=nn(dn),fn=on(hn),pn=rn(1.525),mn=nn(pn),gn=on(pn),vn=(t=>{const e=rn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),yn=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},xn=nn(yn);function bn(t,e){return t.map(()=>e||cn).splice(0,t.length-1)}function En({from:t=0,to:e=1,ease:n,offset:o,duration:r=300}){const i={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),r);function l(){return en(a,s,{ease:Array.isArray(n)?n:bn(s,n)})}let u=l();return{next:t=>(i.value=u(t),i.done=t>=r,i),flipTarget:()=>{s.reverse(),u=l()}}}const wn={keyframes:En,spring:je,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:r=.5,modifyTarget:i}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===i?l:i(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>r||e<-r),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const Sn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),An="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Sn()),1/60*1e3);let Pn=!0,Tn=!1,Cn=!1;const Vn={delta:0,timestamp:0},Mn=["read","update","preRender","render","postRender"],Rn=Mn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,r=!1,i=!1;const s=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const l=a&&r,u=l?e:n;return i&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&r&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(r)i=!0;else{if(r=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}r=!1,i&&(i=!1,a.process(l))}}};return a}(()=>Tn=!0),t),{}),Ln=Mn.reduce((t,e)=>{const n=Rn[e];return t[e]=(t,e=!1,o=!1)=>(Tn||Fn(),n.schedule(t,e,o)),t},{}),On=Mn.reduce((t,e)=>(t[e]=Rn[e].cancel,t),{}),kn=Mn.reduce((t,e)=>(t[e]=()=>Rn[e].process(Vn),t),{}),Dn=t=>Rn[t].process(Vn),jn=t=>{Tn=!1,Vn.delta=Pn?1/60*1e3:Math.max(Math.min(t-Vn.timestamp,40),1),Vn.timestamp=t,Cn=!0,Mn.forEach(Dn),Cn=!1,Tn&&(Pn=!1,An(jn))},Fn=()=>{Tn=!0,Pn=!0,Cn||An(jn)},In=()=>Vn;function Bn(t,e,n=0){return t-e-n}const Un=t=>{const e=({delta:e})=>t(e);return{start:()=>Ln.update(e,!0),stop:()=>On.update(e)}};function zn(t){var e,n,{from:o,autoplay:r=!0,driver:i=Un,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:d,onComplete:h,onRepeat:f,onUpdate:p}=t,m=Ve(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:x}=m,b=0,E=m.duration,w=!1,S=!0;const A=function(t){if(Array.isArray(t.to))return En;if(wn[t.type])return wn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?En:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?je:En}(m);(null===(n=(e=A).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=en([0,100],[o,x],{clamp:!1}),o=0,x=100);const P=A(Object.assign(Object.assign({},m),{from:o,to:x}));function T(){b++,"reverse"===l?(S=b%2==0,s=function(t,e,n=0,o=!0){return o?Bn(e+-t,e,n):e-(t-e)+n}(s,E,u,S)):(s=Bn(s,E,u),"mirror"===l&&P.flipTarget()),w=!1,f&&f()}function C(t){if(S||(t=-t),s+=t,!w){const t=P.next(Math.max(0,s));v=t.value,y&&(v=y(v)),w=S?t.done:s<=0}null==p||p(v),w&&(0===b&&(null!=E||(E=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,S)&&T():(g.stop(),h&&h()))}return r&&(null==c||c(),g=i(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function Nn(t,e){return e?t*(1e3/e):0}const Wn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),Hn=t=>Wn(t)&&t.hasOwnProperty("z"),$n=(t,e)=>Math.abs(t-e);function Yn(t,e){if(Ye(t)&&Ye(e))return $n(t,e);if(Wn(t)&&Wn(e)){const n=$n(t.x,e.x),o=$n(t.y,e.y),r=Hn(t)&&Hn(e)?$n(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(r,2))}}const Xn=(t,e)=>1-3*e+3*t,Gn=(t,e)=>3*e-6*t,qn=t=>3*t,Zn=(t,e,n)=>((Xn(e,n)*t+Gn(e,n))*t+qn(e))*t,Kn=(t,e,n)=>3*Xn(e,n)*t*t+2*Gn(e,n)*t+qn(e);function _n(t,e,n,o){if(t===e&&n===o)return sn;const r=new Float32Array(11);for(let e=0;e<11;++e)r[e]=Zn(.1*e,t,n);function i(e){let o=0,i=1;for(;10!==i&&r[i]<=e;++i)o+=.1;--i;const s=o+.1*((e-r[i])/(r[i+1]-r[i])),a=Kn(s,t,n);return a>=.001?function(t,e,n,o){for(let r=0;r<8;++r){const r=Kn(e,n,o);if(0===r)return e;e-=(Zn(e,n,o)-t)/r}return e}(e,s,t,n):0===a?s:function(t,e,n,o,r){let i,s,a=0;do{s=e+(n-e)/2,i=Zn(s,o,r)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Zn(i(t),e,o)}const Jn=("undefined"==typeof process||process.env,"production"),Qn=new Set;function to(t,e,n){t||Qn.has(e)||(console.warn(e),n&&console.warn(n),Qn.add(e))}const eo=new WeakMap,no=new WeakMap,oo=t=>{const e=eo.get(t.target);e&&e(t)},ro=t=>{t.forEach(oo)};function io(t,e,n){const o=function({root:t,...e}){const n=t||document;no.has(n)||no.set(n,{});const o=no.get(n),r=JSON.stringify(e);return o[r]||(o[r]=new IntersectionObserver(ro,{root:t,...e})),o[r]}(e);return eo.set(t,n),o.observe(t),()=>{eo.delete(t),o.unobserve(t)}}const so={some:0,all:1};function ao(n,o,r,{root:i,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n)return;const e={root:null==i?void 0:i.current,rootMargin:s,threshold:"number"==typeof a?a:so[a]};return io(r.getInstance(),e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),r.animationState&&r.animationState.setActive(t.AnimationType.InView,n);const i=r.getProps(),s=n?i.onViewportEnter:i.onViewportLeave;s&&s(e)})},[n,i,s,a])}function lo(n,o,r,{fallback:i=!0}){e.useEffect(()=>{n&&i&&("production"!==Jn&&to(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=r.getProps();e&&e(null),r.animationState&&r.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const uo=t=>e=>(t(e),null),co={inView:uo((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:r,viewport:i={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||r);i.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?lo:ao)(a,s.current,t,i)})),tap:uo((function({onTap:n,onTapStart:o,onTapCancel:r,whileTap:i,visualElement:s}){const a=n||o||r||i,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||r||m)};function d(){u.current&&u.current(),u.current=null}function h(){return d(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Ae()}function f(t,e){h()&&(Te(s.getInstance(),t.target)?n&&n(t,e):r&&r(t,e))}function p(t,e){h()&&r&&r(t,e)}function m(e,n){d(),l.current||(l.current=!0,u.current=Ge(ye(window,"pointerup",f,c),ye(window,"pointercancel",p,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}xe(s,"pointerdown",a?m:void 0,c),Ce(d)})),focus:uo((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;ae(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),ae(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:uo((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){xe(o,"pointerenter",t||n?Pe(o,!0,t):void 0,{passive:!t}),xe(o,"pointerleave",e||n?Pe(o,!1,e):void 0,{passive:!e})}))};function ho(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,i=e.useId();e.useEffect(()=>r(i),[]);return!n&&o?[!1,()=>o&&o(i)]:[!0]}function fo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const po=t=>1e3*t,mo={linear:sn,easeIn:an,easeInOut:cn,easeOut:un,circIn:dn,circInOut:fn,circOut:hn,backIn:pn,backInOut:gn,backOut:mn,anticipate:vn,bounceIn:xn,bounceInOut:t=>t<.5?.5*(1-yn(1-2*t)):.5*yn(2*t-1)+.5,bounceOut:yn},go=t=>{if(Array.isArray(t)){t.length;const[e,n,o,r]=t;return _n(e,n,o,r)}return"string"==typeof t?mo[t]:t},vo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!bt.test(e)||e.startsWith("url("))),yo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),xo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),bo=()=>({type:"keyframes",ease:"linear",duration:.3}),Eo=t=>({type:"keyframes",duration:.8,values:t}),wo={x:yo,y:yo,z:yo,rotate:yo,rotateX:yo,rotateY:yo,rotateZ:yo,scaleX:xo,scaleY:xo,scale:xo,opacity:bo,backgroundColor:bo,color:bo,default:xo},So=(t,e)=>{let n;return n=_t(e)?Eo:wo[t]||wo.default,{to:e,...n(e)}},Ao={...Tt,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:At,WebkitFilter:At},Po=t=>Ao[t];function To(t,e){var n;let o=Po(t);return o!==At&&(o=bt),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Co={current:!1};function Vo(t,e){const n=performance.now(),o=({timestamp:r})=>{const i=r-n;i>=e&&(On.read(o),t(i-e))};return Ln.read(o,!0),()=>On.read(o)}function Mo({ease:t,times:e,yoyo:n,flip:o,loop:r,...i}){const s={...i};return e&&(s.offset=e),i.duration&&(s.duration=po(i.duration)),i.repeatDelay&&(s.repeatDelay=po(i.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(go):go(t)),"tween"===i.type&&(s.type="keyframes"),(n||r||o)&&(n?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||n||o||i.repeat),"spring"!==i.type&&(s.type="keyframes"),s}function Ro(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:r,repeat:i,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...So(n,e.to)}),{...e,...Mo(t)}}function Lo(t,e,n,o,r){const i=Do(o,t)||{};let s=void 0!==i.from?i.from:e.get();const a=vo(t,n);"none"===s&&a&&"string"==typeof n?s=To(t,n):Oo(s)&&"string"==typeof n?s=ko(n):!Array.isArray(n)&&Oo(n)&&"string"==typeof s&&(n=ko(s));return vo(t,s)&&a&&!1!==i.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:r,onUpdate:t=>e.set(t)};return"inertia"===i.type||"decay"===i.type?function({from:t=0,velocity:e=0,min:n,max:o,power:r=.8,timeConstant:i=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:d,onComplete:h,onStop:f}){let p;function m(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==p||p.stop(),p=zn(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==d||d(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:f}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(m(t))y({from:t,velocity:e,to:g(t)});else{let o=r*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,d;const h=t=>{c=d,d=t,e=Nn(t-c,In().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:i,power:r,restDelta:l,modifyTarget:u,onUpdate:m(o)?h:void 0})}return{stop:()=>null==p?void 0:p.stop()}}({...o,...i}):zn({...Ro(i,o,t),onUpdate:t=>{o.onUpdate(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{o.onComplete(),i.onComplete&&i.onComplete()}})}:function(){const t=Jt(n);return e.set(t),r(),i.onUpdate&&i.onUpdate(t),i.onComplete&&i.onComplete(),{stop:()=>{}}}}function Oo(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function ko(t){return"number"==typeof t?0:To("",t)}function Do(t,e){return t[e]||t.default||t}function jo(t,e,n,o={}){return Co.current&&(o={type:!1}),e.start(r=>{let i;const s=Lo(t,e,n,o,r),a=function(t,e){var n,o;return null!==(o=null!==(n=(Do(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),l=()=>i=s();let u;return a?u=Vo(l,po(a)):l(),()=>{u&&u(),i&&i.stop()}})}const Fo=t=>/^0[^.\s]+$/.test(t);function Io(t,e){-1===t.indexOf(e)&&t.push(e)}function Bo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Uo{constructor(){this.subscriptions=[]}add(t){return Io(this.subscriptions,t),()=>Bo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let r=0;r<o;r++){const o=this.subscriptions[r];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class zo{constructor(t){var e;this.version="7.6.2",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Uo,this.velocityUpdateSubscribers=new Uo,this.renderSubscribers=new Uo,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=In();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Ln.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ln.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Nn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function No(t){return new zo(t)}const Wo=t=>e=>e.test(t),Ho=[J,rt,ot,nt,st,it,{test:t=>"auto"===t,parse:t=>t}],$o=t=>Ho.find(Wo(t)),Yo=[...Ho,mt,bt],Xo=t=>Yo.find(Wo(t));function Go(t,e,n){const o=t.getProps();return Kt(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function qo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,No(n))}function Zo(t,e){const n=Go(t,e);let{transitionEnd:o={},transition:r={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...o};for(const e in i){qo(t,e,Jt(i[e]))}}function Ko(t,e){[...e].reverse().forEach(n=>{var o;const r=t.getVariant(n);r&&Zo(t,r),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{Ko(t,e)})})}function _o(t,e,n){var o,r;const i=Object.keys(e).filter(e=>!t.hasValue(e)),s=i.length;if(s)for(let a=0;a<s;a++){const s=i[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(r=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==r?r:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Fo(u))?u=parseFloat(u):!Xo(u)&&bt.test(l)&&(u=To(s,l)),t.addValue(s,No(u)),void 0===n[s]&&(n[s]=u),t.setBaseTarget(s,u))}}function Jo(t,e){if(!e)return;return(e[t]||e.default||e).from}function Qo(t,e,n){var o;const r={};for(const i in t){const t=Jo(i,e);r[i]=void 0!==t?t:null===(o=n.getValue(i))||void 0===o?void 0:o.get()}return r}function tr(t){return Boolean(N(t)&&t.add)}function er(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const r=e.map(e=>nr(t,e,n));o=Promise.all(r)}else if("string"==typeof e)o=nr(t,e,n);else{const r="function"==typeof e?Go(t,e,n.custom):e;o=or(t,r,n)}return o.then(()=>t.notifyAnimationComplete(e))}function nr(t,e,n={}){var o;const r=Go(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>or(t,r,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,o=0,r=1,i){const s=[],a=(t.variantChildren.size-1)*o,l=1===r?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(rr).forEach((t,o)=>{s.push(nr(t,e,{...i,delay:n+l(o)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(s)}(t,e,r+o,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function or(t,e,{delay:n=0,transitionOverride:o,type:r}={}){var i;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],d=r&&(null===(i=t.animationState)||void 0===i?void 0:i.getState()[r]);for(const e in l){const o=t.getValue(e),r=l[e];if(!o||void 0===r||d&&ir(d,e))continue;let i={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(i={...i,type:!1,delay:0});let a=jo(e,o,r,i);tr(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Zo(t,a)})}function rr(t,e){return t.sortNodePosition(e)}function ir({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const sr=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],ar=[...sr].reverse(),lr=sr.length;function ur(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>er(t,e,n)))}(e);const o={[t.AnimationType.Animate]:dr(!0),[t.AnimationType.InView]:dr(),[t.AnimationType.Hover]:dr(),[t.AnimationType.Tap]:dr(),[t.AnimationType.Drag]:dr(),[t.AnimationType.Focus]:dr(),[t.AnimationType.Exit]:dr()};let r=!0;const i=(t,n)=>{const o=Go(e,n);if(o){const{transition:e,transitionEnd:n,...r}=o;t={...t,...r,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],d=new Set;let h={},f=1/0;for(let n=0;n<lr;n++){const g=ar[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=p(y),b=g===s?v.isActive:null;!1===b&&(f=n);let E=y===u[g]&&y!==l[g]&&x;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...h},!v.isActive&&null===b||!y&&!v.prevProp||m(y)||"boolean"==typeof y)continue;const w=cr(v.prevProp,y);let S=w||g===s&&v.isActive&&!E&&x||n>f&&x;const A=Array.isArray(y)?y:[y];let P=A.reduce(i,{});!1===b&&(P={});const{prevResolvedValues:T={}}=v,C={...T,...P},V=t=>{S=!0,d.delete(t),v.needsAnimating[t]=!0};for(const t in C){const e=P[t],n=T[t];h.hasOwnProperty(t)||(e!==n?_t(e)&&_t(n)?!fo(e,n)||w?V(t):v.protectedKeys[t]=!0:void 0!==e?V(t):d.add(t):void 0!==e&&d.has(t)?V(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=P,v.isActive&&(h={...h,...P}),r&&e.blockInitialAnimation&&(S=!1),S&&!E&&c.push(...A.map(e=>({animation:e,options:{type:g,...t}})))}if(d.size){const t={};d.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return r&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,r){var i;if(o[t].isActive===n)return Promise.resolve();null===(i=e.variantChildren)||void 0===i||i.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(r,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function cr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fo(e,t)}function dr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const hr={animation:uo(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=ur(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:uo(n=>{const{custom:o,visualElement:r}=n,[i,s]=ho(),a=e.useContext(u);e.useEffect(()=>{r.isPresent=i;const e=r.animationState&&r.animationState.setActive(t.AnimationType.Exit,!i,{custom:a&&a.custom||o});e&&!i&&e.then(s)},[i])})};class fr{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=gr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Yn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:r}=In();this.history.push({...o,timestamp:r});const{onStart:i,onMove:s}=this.handlers;e||(i&&i(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=pr(e,this.transformPagePoint),le(t)&&0===t.buttons?this.handlePointerUp(t,e):Ln.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,r=gr(pr(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),o&&o(t,r)},ue(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=pr(fe(t),this.transformPagePoint),{point:r}=o,{timestamp:i}=In();this.history=[{...r,timestamp:i}];const{onSessionStart:s}=e;s&&s(t,gr(o,this.history)),this.removeListeners=Ge(ye(window,"pointermove",this.handlePointerMove),ye(window,"pointerup",this.handlePointerUp),ye(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),On.update(this.updatePoint)}}function pr(t,e){return e?{point:e(t.point)}:t}function mr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function gr({point:t},e){return{point:t,delta:mr(t,yr(e)),offset:mr(t,vr(e)),velocity:xr(e,.1)}}function vr(t){return t[0]}function yr(t){return t[t.length-1]}function xr(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const r=yr(t);for(;n>=0&&(o=t[n],!(r.timestamp-o.timestamp>po(e)));)n--;if(!o)return{x:0,y:0};const i=(r.timestamp-o.timestamp)/1e3;if(0===i)return{x:0,y:0};const s={x:(r.x-o.x)/i,y:(r.y-o.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function br(t){return t.max-t.min}function Er(t,e=0,n=.01){return Yn(t,e)<n}function wr(t,e,n,o=.5){t.origin=o,t.originPoint=Be(e.min,e.max,t.origin),t.scale=br(n)/br(e),(Er(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Be(n.min,n.max,t.origin)-t.originPoint,(Er(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Sr(t,e,n,o){wr(t.x,e.x,n.x,null==o?void 0:o.originX),wr(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ar(t,e,n){t.min=n.min+e.min,t.max=t.min+br(e)}function Pr(t,e,n){t.min=e.min-n.min,t.max=t.min+br(e)}function Tr(t,e,n){Pr(t.x,e.x,n.x),Pr(t.y,e.y,n.y)}function Cr(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 Vr(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Mr=.35;function Rr(t,e,n){return{min:Lr(t,e),max:Lr(t,n)}}function Lr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const Or=()=>({x:{min:0,max:0},y:{min:0,max:0}});function kr(t){return[t("x"),t("y")]}function Dr({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function jr(t){return void 0===t||1===t}function Fr({scale:t,scaleX:e,scaleY:n}){return!jr(t)||!jr(e)||!jr(n)}function Ir(t){return Fr(t)||Br(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Br(t){return Ur(t.x)||Ur(t.y)}function Ur(t){return t&&"0%"!==t}function zr(t,e,n){return n+e*(t-n)}function Nr(t,e,n,o,r){return void 0!==r&&(t=zr(t,r,o)),zr(t,n,o)+e}function Wr(t,e=0,n=1,o,r){t.min=Nr(t.min,e,n,o,r),t.max=Nr(t.max,e,n,o,r)}function Hr(t,{x:e,y:n}){Wr(t.x,e.translate,e.scale,e.originPoint),Wr(t.y,n.translate,n.scale,n.originPoint)}function $r(t,e){t.min=t.min+e,t.max=t.max+e}function Yr(t,e,[n,o,r]){const i=void 0!==e[r]?e[r]:.5,s=Be(t.min,t.max,i);Wr(t,e[n],e[o],s,e.scale)}const Xr=["x","scaleX","originX"],Gr=["y","scaleY","originY"];function qr(t,e){Yr(t.x,e,Xr),Yr(t.y,e,Gr)}function Zr(t,e){return Dr(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const Kr=new WeakMap;class _r{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(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new fr(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(fe(t,"page").point)},onStart:(e,n)=>{var o;const{drag:r,dragPropagation:i,onDragStart:s}=this.getProps();(!r||i||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Se(r),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),kr(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(ot.test(o)){const r=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(r){o=br(r)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:r,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&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}(s),void(null!==this.currentDirection&&(null==r||r(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==i||i(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:o}=e;this.startAnimation(o);const{onDragEnd:r}=this.getProps();null==r||r(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Jr(t,o,this.currentDirection))return;const r=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Be(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Be(n,t,o.max):Math.min(t,n)),t}(i,this.constraints[t],this.elastic[t])),r.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&f(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:r}){return{x:Cr(t.x,n,r),y:Cr(t.y,e,o)}}(n.actual,t),this.elastic=function(t=Mr){return!1===t?t=0:!0===t&&(t=Mr),{x:Rr(t,"left","right"),y:Rr(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&kr(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.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!f(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const r=function(t,e,n){const o=Zr(t,n),{scroll:r}=e;return r&&($r(o.x,r.x),$r(o.y,r.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let i=function(t,e){return{x:Vr(t.x,e.x),y:Vr(t.y,e.y)}}(o.layout.actual,r);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(i));this.hasMutatedConstraints=!!t,t&&(i=Dr(t))}return i}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:r,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=kr(s=>{var l;if(!Jr(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};i&&(u={min:0,max:0});const c=o?200:1e6,d=o?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...u};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return jo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){kr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),r=this.visualElement.getProps()[o];return r||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){kr(e=>{const{drag:n}=this.getProps();if(!Jr(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,r=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:i}=o.layout.actual[e];r.set(t[e]-Be(n,i,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!f(n)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};kr(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const o=br(t),r=br(e);return r>o?n=Ie(e.min,e.max-o,t.min):o>r&&(n=Ie(t.min,t.max-r,e.min)),Me(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=i?i({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),kr(t=>{if(!Jr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Be(o,i,r[t]))})}addListeners(){var t;Kr.set(this.visualElement,this);const e=ye(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();f(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const i=se(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(kr(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{i(),e(),r(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:r=!1,dragElastic:i=Mr,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:r,dragElastic:i,dragMomentum:s}}}function Jr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Qr={pan:uo((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:r,visualElement:i}){const a=t||n||o||r,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:r,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),xe(i,"pointerdown",a&&function(t){l.current=new fr(t,c,{transformPagePoint:u})}),Ce(()=>l.current&&l.current.end())})),drag:uo((function(t){const{dragControls:n,visualElement:o}=t,r=A(()=>new _r(o));e.useEffect(()=>n&&n.subscribe(r),[r,n]),e.useEffect(()=>r.addListeners(),[r])}))},ti={current:null},ei={current:!1};function ni(){if(ei.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ti.current=t.matches;t.addListener(e),e()}else ti.current=!1}const oi=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const ri=Object.keys(w),ii=ri.length,si=({treeType:t="",build:n,getBaseTarget:o,makeTargetAnimatable:r,measureViewportBox:i,render:s,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:d,props:h,presenceId:m,blockInitialAnimation:g,visualState:x,reducedMotionConfig:b},E={})=>{let S=!1;const{latestValues:A,renderState:P}=x;let T;const C=function(){const t=oi.map(()=>new Uo),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{oi.forEach(o=>{var r;const i="on"+o,s=t[i];null===(r=e[o])||void 0===r||r.call(e),s&&(e[o]=n[i](s))})}};return t.forEach((t,e)=>{n["on"+oi[e]]=e=>t.add(e),n["notify"+oi[e]]=(...e)=>t.notify(...e)}),n}(),V=new Map,M=new Map;let R={};const L={...A},O=h.initial?{...A}:{};let k;function D(){T&&S&&(j(),s(T,P,h.style,H.projection))}function j(){n(H,P,A,E,h)}function F(){C.notifyUpdate(A)}function I(t,e){const n=e.onChange(e=>{A[t]=e,h.onUpdate&&Ln.update(F,!1,!0)}),o=e.onRenderRequest(H.scheduleRender);M.set(t,()=>{n(),o()})}const{willChange:B,...U}=c(h);for(const t in U){const e=U[t];void 0!==A[t]&&N(e)&&(e.set(A[t],!1),tr(B)&&B.add(t))}if(h.values)for(const t in h.values){const e=h.values[t];void 0!==A[t]&&N(e)&&e.set(A[t])}const z=v(h),W=y(h),H={treeType:t,current:null,depth:d?d.depth+1:0,parent:d,children:new Set,presenceId:m,shouldReduceMotion:null,variantChildren:W?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==d?void 0:d.isMounted()),blockInitialAnimation:g,isMounted:()=>Boolean(T),mount(t){S=!0,T=H.current=t,H.projection&&H.projection.mount(t),W&&d&&!z&&(k=null==d?void 0:d.addVariantChild(H)),V.forEach((t,e)=>I(e,t)),ei.current||ni(),H.shouldReduceMotion="never"!==b&&("always"===b||ti.current),null==d||d.children.add(H),H.setProps(h)},unmount(){var t;null===(t=H.projection)||void 0===t||t.unmount(),On.update(F),On.render(D),M.forEach(t=>t()),null==k||k(),null==d||d.children.delete(H),C.clearAllListeners(),T=void 0,S=!1},loadFeatures(t,n,o,r,i,s){const a=[];for(let n=0;n<ii;n++){const o=ri[n],{isEnabled:r,Component:i}=w[o];r(t)&&i&&a.push(e.createElement(i,{key:o,...t,visualElement:H}))}if(!H.projection&&i){H.projection=new i(r,H.getLatestValues(),d&&d.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;H.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&f(a),visualElement:H,scheduleRender:()=>H.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a},addVariantChild(t){var e;const n=H.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(H.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>W?H:null==d?void 0:d.getClosestVariantNode(),getLayoutId:()=>h.layoutId,getInstance:()=>T,getStaticValue:t=>A[t],setStaticValue:(t,e)=>A[t]=e,getLatestValues:()=>A,setVisibility(t){H.isVisible!==t&&(H.isVisible=t,H.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>r(H,t,h,e),measureViewportBox:()=>i(T,h),addValue(t,e){H.hasValue(t)&&H.removeValue(t),V.set(t,e),A[t]=e.get(),I(t,e)},removeValue(t){var e;V.delete(t),null===(e=M.get(t))||void 0===e||e(),M.delete(t),delete A[t],l(t,P)},hasValue:t=>V.has(t),getValue(t,e){if(h.values&&h.values[t])return h.values[t];let n=V.get(t);return void 0===n&&void 0!==e&&(n=No(e),H.addValue(t,n)),n},forEachValue:t=>V.forEach(t),readValue:t=>void 0!==A[t]?A[t]:a(T,t,E),setBaseTarget(t,e){L[t]=e},getBaseTarget(t){var e;const{initial:n}=h,r="string"==typeof n||"object"==typeof n?null===(e=Kt(h,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;if(o){const e=o(h,t);if(void 0!==e&&!N(e))return e}return void 0!==O[t]&&void 0===r?void 0:L[t]},...C,build:()=>(j(),P),scheduleRender(){Ln.render(D,!1,!0)},syncRender:D,setProps(t){(t.transformTemplate||h.transformTemplate)&&H.scheduleRender(),h=t,C.updatePropListeners(t),R=function(t,e,n){const{willChange:o}=e;for(const r in e){const i=e[r],s=n[r];if(N(i))t.addValue(r,i),tr(o)&&o.add(r);else if(N(s))t.addValue(r,No(i)),tr(o)&&o.remove(r);else if(s!==i)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,No(void 0!==e?e:i))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(H,c(h),R)},getProps:()=>h,getVariant:t=>{var e;return null===(e=h.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>h.transition,getTransformPagePoint:()=>h.transformPagePoint,getVariantContext(t=!1){if(t)return null==d?void 0:d.getVariantContext();if(!z){const t=(null==d?void 0:d.getVariantContext())||{};return void 0!==h.initial&&(t.initial=h.initial),t}const e={};for(let t=0;t<li;t++){const n=ai[t],o=h[n];(p(o)||!1===o)&&(e[n]=o)}return e}};return H},ai=["initial",...sr],li=ai.length;function ui(t){return"string"==typeof t&&t.startsWith("var(--")}const ci=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function di(t,e,n=1){const[o,r]=function(t){const e=ci.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const i=window.getComputedStyle(e).getPropertyValue(o);return i?i.trim():ui(r)?di(r,e,n+1):r}const hi=new Set(["width","height","top","left","right","bottom","x","y"]),fi=t=>hi.has(t),pi=(t,e)=>{t.set(e,!1),t.set(e)},mi=t=>t===J||t===rt;var gi;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(gi||(gi={}));const vi=(t,e)=>parseFloat(t.split(", ")[e]),yi=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/);if(r)return vi(r[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?vi(e[1],t):0}},xi=new Set(["x","y","z"]),bi=B.filter(t=>!xi.has(t));const Ei={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:yi(4,13),y:yi(5,14)},wi=(t,e,n={},o={})=>{e={...e},o={...o};const r=Object.keys(e).filter(fi);let i=[],s=!1;const a=[];if(r.forEach(r=>{const l=t.getValue(r);if(!t.hasValue(r))return;let u=n[r],c=$o(u);const d=e[r];let h;if(_t(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=$o(u);for(let n=e;n<t;n++)h?$o(d[n]):h=$o(d[n])}else h=$o(d);if(c!==h)if(mi(c)&&mi(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[r]=parseFloat(d):Array.isArray(d)&&h===rt&&(e[r]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[r]=c.transform(d):(s||(i=function(t){const e=[];return bi.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),s=!0),a.push(r),o[r]=void 0!==o[r]?o[r]:e[r],pi(l,d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((t,e,n)=>{const o=e.measureViewportBox(),r=e.getInstance(),i=getComputedStyle(r),{display:s}=i,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Ei[t](o,i)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);pi(o,a[n]),t[n]=Ei[n](l,i)}),t})(e,t,a);return i.length&&i.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),c&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:o}}return{target:e,transitionEnd:o}};function Si(t,e,n,o){return(t=>Object.keys(t).some(fi))(e)?wi(t,e,n,o):{target:e,transitionEnd:o}}const Ai=(t,e,n,o)=>{const r=function(t,{...e},n){const o=t.getInstance();if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!ui(e))return;const n=di(e,o);n&&t.set(n)});for(const t in e){const r=e[t];if(!ui(r))continue;const i=di(r,o);i&&(e[t]=i,n&&void 0===n[t]&&(n[t]=r))}return{target:e,transitionEnd:n}}(t,e,o);return Si(t,e=r.target,n,o=r.transitionEnd)};const Pi={treeType:"dom",readValueFromInstance(t,e){if(U.has(e)){const t=Po(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),r=($(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof r?r.trim():r}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>Zr(t,e),resetTransform(t,e,n){const{transformTemplate:o}=n;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...o},{transformValues:r},i=!0){let s=Qo(o,e||{},t);if(r&&(n&&(n=r(n)),o&&(o=r(o)),s&&(s=r(s))),i){_o(t,o,s);const e=Ai(t,o,s,n);n=e.transitionEnd,o=e.target}return{transition:e,transitionEnd:n,...o}},scrapeMotionValuesFromProps:qt,build(t,e,n,o,r){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),Ct(e,n,o,r.transformTemplate)},render:Yt},Ti=si(Pi),Ci=si({...Pi,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=Po(e))||void 0===n?void 0:n.default)||0:(e=Xt.has(e)?e:$t(e),t.getAttribute(e))},scrapeMotionValuesFromProps:Zt,build(t,e,n,o,r){zt(e,n,o,r.transformTemplate)},render:Gt}),Vi=(t,e)=>j(t)?Ci(e,{enableHardwareAcceleration:!1}):Ti(e,{enableHardwareAcceleration:!0});function Mi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ri={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${Mi(t,e.target.x)}% ${Mi(t,e.target.y)}%`}},Li={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,r=t.includes("var("),i=[];r&&(t=t.replace(ci,t=>(i.push(t),"_$css")));const s=bt.parse(t);if(s.length>5)return o;const a=bt.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const d=Be(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=d),"number"==typeof s[3+l]&&(s[3+l]/=d);let h=a(s);if(r){let t=0;h=h.replace("_$css",()=>{const e=i[t];return t++,e})}return h}};class Oi extends r.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:r}=t;I(ki),r&&(e.group&&e.group.add(r),n&&n.register&&o&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),P.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:r}=this.props,i=n.projection;return i?(i.isPresent=r,o||t.layoutDependency!==e||void 0===e?i.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?i.promote():i.relegate()||Ln.postRender(()=>{var t;(null===(t=i.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:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const ki={borderRadius:{...Ri,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ri,borderTopRightRadius:Ri,borderBottomLeftRadius:Ri,borderBottomRightRadius:Ri,boxShadow:Li},Di={measureLayout:function(t){const[n,o]=ho(),i=e.useContext(C);return r.default.createElement(Oi,{...t,layoutGroup:i,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function ji(t,e,n={}){const o=N(t)?t:No(t);return jo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Fi=["TopLeft","TopRight","BottomLeft","BottomRight"],Ii=Fi.length,Bi=t=>"string"==typeof t?parseFloat(t):t,Ui=t=>"number"==typeof t||rt.test(t);function zi(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Ni=Hi(0,.5,hn),Wi=Hi(.5,.95,sn);function Hi(t,e,n){return o=>o<t?0:o>e?1:n(Ie(t,e,o))}function $i(t,e){t.min=e.min,t.max=e.max}function Yi(t,e){$i(t.x,e.x),$i(t.y,e.y)}function Xi(t,e,n,o,r){return t=zr(t-=e,1/n,o),void 0!==r&&(t=zr(t,1/r,o)),t}function Gi(t,e,[n,o,r],i,s){!function(t,e=0,n=1,o=.5,r,i=t,s=t){if(ot.test(e)){e=parseFloat(e);e=Be(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Be(i.min,i.max,o);t===i&&(a-=e),t.min=Xi(t.min,e,n,a,r),t.max=Xi(t.max,e,n,a,r)}(t,e[n],e[o],e[r],e.scale,i,s)}const qi=["x","scaleX","originX"],Zi=["y","scaleY","originY"];function Ki(t,e,n,o){Gi(t.x,e,qi,null==n?void 0:n.x,null==o?void 0:o.x),Gi(t.y,e,Zi,null==n?void 0:n.y,null==o?void 0:o.y)}function _i(t){return 0===t.translate&&1===t.scale}function Ji(t){return _i(t.x)&&_i(t.y)}function Qi(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 ts(t){return br(t.x)/br(t.y)}class es{constructor(){this.members=[]}add(t){Io(this.members,t),t.scheduleRender()}remove(t){if(Bo(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 o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,r,i;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(i=null===(o=t.resumingFrom)||void 0===o?void 0:(r=o.options).onExitComplete)||void 0===i||i.call(r)})}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 o=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(o+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:r}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),r&&(o+=`rotateY(${r}deg) `)}return o+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===o?"none":o}const os=(t,e)=>t.depth-e.depth;class rs{constructor(){this.children=[],this.isDirty=!1}add(t){Io(this.children,t),this.isDirty=!0}remove(t){Bo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(os),this.isDirty=!1,this.children.forEach(t)}}const is=["","X","Y","Z"];function ss({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!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(fs),this.nodes.forEach(ps)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.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 rs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Uo),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 o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:r,layout:i,visualElement:s}=this.options;if(s&&!s.getInstance()&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(i||r)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Vo(o,250),P.hasAnimatedSinceResize&&(P.hasAnimatedSinceResize=!1,this.nodes.forEach(hs))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var r,i,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(i=null!==(r=this.options.transition)&&void 0!==r?r:s.getDefaultTransition())&&void 0!==i?i:bs,{onLayoutAnimationStart:d,onLayoutAnimationComplete:h}=s.getProps(),f=!this.targetLayout||!Qi(this.targetLayout,o)||n,p=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||p||e&&(f||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,p);const e={...Do(c,"layout"),onPlay:d,onComplete:h};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||hs(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}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,On.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(ms))}willUpdate(t=!0){var e,n,o;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()}const{layoutId:r,layout:i}=this.options;if(void 0===r&&!i)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(cs);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Es),this.potentialNodes.clear()),this.nodes.forEach(ds),this.nodes.forEach(as),this.nodes.forEach(ls),this.clearAllSnapshots(),kn.update(),kn.preRender(),kn.render())}clearAllSnapshots(){this.nodes.forEach(us),this.sharedNodes.forEach(gs)}scheduleUpdateProjection(){Ln.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ln.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));Ss(e),this.snapshot={measured:t,layout:e,latestValues:{}}}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.measure();Ss(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=o(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!r)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Ji(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,i=null==o?void 0:o(this.latestValues,""),s=i!==this.prevTransformTemplateValue;e&&(n||Ir(this.latestValues)||s)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(){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&&($r(e.x,n.x),$r(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Yi(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:r,options:i,isScrollRoot:s}=o;if(o!==this.root&&r&&i.layoutScroll){if(s){Yi(e,t);const{scroll:n}=this.root;n&&($r(e.x,-n.x),$r(e.y,-n.y))}$r(e.x,r.x),$r(e.y,r.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Yi(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&qr(n,{x:-o.scroll.x,y:-o.scroll.y}),Ir(o.latestValues)&&qr(n,o.latestValues)}return Ir(this.latestValues)&&qr(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Yi(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Ir(o.latestValues))continue;Fr(o.latestValues)&&o.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Yi(r,o.measure()),Ki(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layout,r)}return Ir(this.latestValues)&&Ki(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,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{layout:e,layoutId:n}=this.options;var o,r,i;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Tr(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Yi(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(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,r=this.relativeTarget,i=this.relativeParent.target,Ar(o.x,r.x,i.x),Ar(o.y,r.y,i.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Yi(this.target,this.layout.actual),Hr(this.target,this.targetDelta)):Yi(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Tr(this.relativeTargetOrigin,this.target,this.relativeParent.target),Yi(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Fr(this.parent.latestValues)&&!Br(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=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||!e&&!n)return;const o=this.getLead();Yi(this.layoutCorrected,this.layout.actual),function(t,e,n,o=!1){var r,i;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(i=null===(r=a.instance)||void 0===r?void 0:r.style)||void 0===i?void 0:i.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&qr(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Hr(t,l)),o&&Ir(a.latestValues)&&qr(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:r}=o;if(!r)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const i=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;Sr(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=ns(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===i&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const o=this.snapshot,r=(null==o?void 0:o.latestValues)||{},i={...this.latestValues},s={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 a={x:{min:0,max:0},y:{min:0,max:0}},l=null==o?void 0:o.isShared,u=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(xs));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var d,h,f,p;vs(s.x,t.x,o),vs(s.y,t.y,o),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Tr(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,h=this.relativeTargetOrigin,f=a,p=o,ys(d.x,h.x,f.x,p),ys(d.y,h.y,f.y,p)),l&&(this.animationValues=i,function(t,e,n,o,r,i){var s,a,l,u;r?(t.opacity=Be(0,null!==(s=n.opacity)&&void 0!==s?s:1,Ni(o)),t.opacityExit=Be(null!==(a=e.opacity)&&void 0!==a?a:1,0,Wi(o))):i&&(t.opacity=Be(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let r=0;r<Ii;r++){const i=`border${Fi[r]}Radius`;let s=zi(e,i),a=zi(n,i);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Ui(s)===Ui(a)?(t[i]=Math.max(Be(Bi(s),Bi(a),o),0),(ot.test(a)||ot.test(s))&&(t[i]+="%")):t[i]=a}(e.rotate||n.rotate)&&(t.rotate=Be(e.rotate||0,n.rotate||0,o))}(i,r,this.latestValues,o,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},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&&(On.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ln.update(()=>{P.hasAnimatedSinceResize=!0,this.currentAnimation=ji(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:o,latestValues:r}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&As(this.options.animationType,this.layout.actual,o.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=br(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=br(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Yi(e,n),qr(e,r),Sr(this.projectionDeltaWithTransform,this.layoutCorrected,e,r)}}registerSharedNode(t,e){var n,o,r;this.sharedNodes.has(t)||this.sharedNodes.set(t,new es);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(r=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===r?void 0:r.call(o,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 o=this.getStack();o&&o.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 n={};for(let o=0;o<is.length;o++){const r="rotate"+is[o];t.getStaticValue(r)&&(e=!0,n[r]=t.getStaticValue(r),t.setStaticValue(r,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,o;const r={};if(!this.instance||this.isSVG)return r;if(!this.isVisible)return{visibility:"hidden"};r.visibility="";const i=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Qt(t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Qt(t.pointerEvents)||""),this.hasProjected&&!Ir(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),r.transform=ns(this.projectionDeltaWithTransform,this.treeScale,a),i&&(r.transform=i(a,r.transform));const{x:l,y:u}=this.projectionDelta;r.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?r.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:r.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in F){if(void 0===a[t])continue;const{correct:e,applyTo:n}=F[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=o}else r[t]=o}return this.options.layoutId&&(r.pointerEvents=s===this?Qt(t.pointerEvents)||"":"none"),r}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(cs),this.root.sharedNodes.clear()}}}function as(t){t.updateLayout()}function ls(t){var e,n,o;const r=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:o}=t.options;"size"===o?kr(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=br(n);n.min=e[t].min,n.max=n.min+o}):As(o,r.layout,e)&&kr(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=br(e[t]);n.max=n.min+o});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Sr(i,e,r.layout);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r.isShared?Sr(s,t.applyTransform(n,!0),r.measured):Sr(s,e,r.layout);const a=!Ji(i);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:o}=t.relativeParent;if(n&&o){const t={x:{min:0,max:0},y:{min:0,max:0}};Tr(t,r.layout,n.layout);const i={x:{min:0,max:0},y:{min:0,max:0}};Tr(i,e,o.actual),Qi(t,i)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function us(t){t.clearSnapshot()}function cs(t){t.clearMeasurements()}function ds(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function hs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function fs(t){t.resolveTargetDelta()}function ps(t){t.calcProjection()}function ms(t){t.resetRotation()}function gs(t){t.removeLeadSnapshot()}function vs(t,e,n){t.translate=Be(e.translate,0,n),t.scale=Be(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ys(t,e,n,o){t.min=Be(e.min,n.min,o),t.max=Be(e.max,n.max,o)}function xs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const bs={duration:.45,ease:[.4,0,.1,1]};function Es(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 o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function ws(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Ss(t){ws(t.x),ws(t.y)}function As(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Yn(t,e)<=n}(ts(e),ts(n),.2)}const Ps=ss({attachResizeListener:(t,e)=>se(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ts={current:void 0},Cs=ss({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ts.current){const t=new Ps(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Ts.current=t}return Ts.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Vs={...hr,...co,...Qr,...Di},Ms=k((t,e)=>re(t,e,Vs,Vi,Cs));const Rs=k(re);function Ls(){const t=e.useRef(!1);return d(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Os(){const t=Ls(),[n,o]=e.useState(0),r=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Ln.postRender(r),[r]),n]}class ks extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ds({children:t,isPresent:n}){const o=e.useId(),r=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:a}=s.current;if(n||!r.current||!t||!e)return;r.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${i}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),i.createElement(ks,{isPresent:n,childRef:r,sizeRef:s},i.cloneElement(t,{ref:r}))}const js=({children:t,initial:n,isPresent:o,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=A(Fs),d=e.useId(),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;r&&r()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),i.useEffect(()=>{!o&&!c.size&&r&&r()},[o]),"popLayout"===l&&(t=i.createElement(Ds,{isPresent:o},t)),i.createElement(u.Provider,{value:h},t)};function Fs(){return new Map}const Is=t=>t.key||"";const Bs=e.createContext(null),Us=t=>!t.isLayoutDirty&&t.willUpdate(!1);function zs(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Us);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var r;t.delete(o),null===(r=e.get(o))||void 0===r||r(),e.delete(o),n()},dirty:n}}const Ns=t=>!0===t,Ws=({children:t,id:n,inheritId:o,inherit:r=!0})=>{void 0!==o&&(r=o);const s=e.useContext(C),a=e.useContext(Bs),[l,u]=Os(),c=e.useRef(null),d=s.id||a;null===c.current&&((t=>Ns(!0===t)||"id"===t)(r)&&d&&(n=n?d+"-"+n:d),c.current={id:n,group:Ns(r)&&s.group||zs()});const h=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return i.createElement(C.Provider,{value:h},t)};let Hs=0;function $s(t){return"function"==typeof t}const Ys=e.createContext(null);const Xs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:r,values:s,...a},l){const u=A(()=>Ms(n)),c=[],d=e.useRef(!1),h={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(qs))},updateOrder:(t,e,n)=>{if(d.current)return;const o=function(t,e,n,o){if(!o)return t;const r=t.findIndex(t=>t.value===e);if(-1===r)return t;const i=o>0?1:-1,s=t[r+i];if(!s)return t;const a=t[r],l=s.layout,u=Be(l.min,l.max,.5);return 1===i&&a.layout.max+n>u||-1===i&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[r]=t.splice(e,1);t.splice(o,0,r)}return t}(t,r,r+i):t}(c,t,e,n);c!==o&&(d.current=!0,r(o.map(Gs).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{d.current=!1}),i.createElement(u,{...a,ref:l},i.createElement(Ys.Provider,{value:h},t))}));function Gs(t){return t.value}function qs(t,e){return t.layout.min-e.layout.min}function Zs(t){const n=A(()=>No(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Ks(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],r=t[1+n],i=t[2+n],s=t[3+n],a=en(r,i,{mixer:(l=i[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function _s(t,e){const n=Zs(e()),o=()=>n.set(e());return o(),function(t,e,n){d(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>Ln.update(o,!1,!0),()=>On.update(o)),n}function Js(t,e,n,o){const r="function"==typeof e?e:Ks(e,n,o);return Array.isArray(t)?Qs(t,r):Qs([t],([t])=>r(t))}function Qs(t,e){const n=A(()=>[]);return _s(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function ta(t,e=0){return N(t)?t:Zs(e)}const ea={Group:Xs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:r="li",onDrag:s,layout:a=!0,...l},u){const c=A(()=>Ms(r)),d=e.useContext(Ys),h={x:ta(n.x),y:ta(n.y)},f=Js([h.x,h.y],([t,e])=>t||e?1:"unset"),p=e.useRef(null),{axis:m,registerItem:g,updateOrder:v}=d;return e.useEffect(()=>{g(o,p.current)},[d]),i.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:h.x,y:h.y,zIndex:f},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&v(o,h[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{p.current=t},ref:u},t)}))},na={renderer:Vi,...hr,...co},oa={...na,...Qr,...Di,projectionNodeConstructor:Cs};const ra=t=>"number"==typeof t;function ia(t,e){return(t=>Array.isArray(t)&&!ra(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const sa=(t,e,n)=>-n*t+n*e+t,aa=t=>t,la=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ua(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const r=la(0,e,o);t.push(sa(n,1,r))}}function ca(t){const e=[0];return ua(e,t-1),e}function da(t,e=ca(t.length),n=aa){const o=t.length,r=o-e.length;return r>0&&ua(e,r),r=>{let i=0;for(;i<o-2&&!(r<e[i+1]);i++);let s=(a=0,l=1,u=la(e[i],e[i+1],r),Math.min(Math.max(u,a),l));var a,l,u;return s=ia(n,i)(s),sa(t[i],t[i+1],s)}}const ha=t=>"function"==typeof t,fa=t=>"string"==typeof t;function pa(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const ma={any:0,all:1};const ga=new WeakMap;let va;function ya({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=ga.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function xa(t){t.forEach(ya)}function ba(t,e){va||"undefined"!=typeof ResizeObserver&&(va=new ResizeObserver(xa));const n=pa(t);return n.forEach(t=>{let n=ga.get(t);n||(n=new Set,ga.set(t,n)),n.add(e),null==va||va.observe(t)}),()=>{n.forEach(t=>{const n=ga.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==va||va.unobserve(t)})}}const Ea=new Set;let wa;function Sa(t){return Ea.add(t),wa||(wa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Ea.forEach(t=>t(e))},window.addEventListener("resize",wa)),()=>{Ea.delete(t),!Ea.size&&wa&&(wa=void 0)}}const Aa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Pa(t,e,n,o){const r=n[e],{length:i,position:s}=Aa[e],a=r.current,l=n.time;r.current=t["scroll"+s],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=la(0,r.scrollLength,r.current);const u=o-l;var c,d;r.velocity=u>50?0:(c=r.current-a,(d=u)?c*(1e3/d):0)}const Ta={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ca={start:0,center:.5,end:1};function Va(t,e,n=0){let o=0;if(void 0!==Ca[t]&&(t=Ca[t]),fa(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return ra(t)&&(o=e*t),n+o}const Ma=[0,0];function Ra(t,e,n,o){let r=Array.isArray(t)?t:Ma,i=0,s=0;return ra(t)?r=[t,t]:fa(t)&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Ca[t]?t:"0"]),i=Va(r[0],n,o),s=Va(r[1],e),i-s}const La={x:0,y:0};function Oa(t,e,n){let{offset:o=Ta.All}=n;const{target:r=t,axis:i="y"}=n,s="y"===i?"height":"width",a=r!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(r,t):La,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:r.clientWidth,height:r.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const d=o.length;for(let t=0;t<d;t++){const n=Ra(o[t],u[s],l[s],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=da(ca(d),e[i].offset),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function ka(t,e,n,o={}){const r=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){Pa(t,"x",e,n),Pa(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Oa(t,n,o)},notify:ha(e)?()=>e(n):Da(e,n[r])}}function Da(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=aa),t.updateDuration(1);else{const r={duration:1e3};e||(r.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,r)}}),()=>{t.currentTime=e.progress}}const ja=new WeakMap,Fa=new WeakMap,Ia=new WeakMap,Ba=t=>t===document.documentElement?window:t;function Ua(t,e={}){var{container:n=document.documentElement}=e,o=Ve(e,["container"]);let r=Ia.get(n);r||(r=new Set,Ia.set(n,r));const i=ka(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(r.add(i),!ja.has(n)){const t=()=>{const t=performance.now();for(const t of r)t.measure();for(const e of r)e.update(t);for(const t of r)t.notify()};ja.set(n,t);const e=Ba(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Fa.set(n,function(t,e){return ha(t)?Sa(t):ba(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=ja.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=Ia.get(n);if(!o)return;if(o.delete(i),o.size)return;const r=ja.get(n);ja.delete(n),r&&(Ba(n).removeEventListener("scroll",r),null===(e=Fa.get(n))||void 0===e||e(),window.removeEventListener("resize",r))}}const za=()=>({scrollX:No(0),scrollY:No(0),scrollXProgress:No(0),scrollYProgress:No(0)});function Na({container:t,target:n,layoutEffect:o=!0,...r}={}){const i=A(za);return(o?d:e.useEffect)(()=>Ua(({x:t,y:e})=>{i.scrollX.set(t.current),i.scrollXProgress.set(t.progress),i.scrollY.set(e.current),i.scrollYProgress.set(e.progress)},{...r,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),i}function Wa(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return Ln.update(e,!0),()=>On.update(e)},[t])}class Ha extends zo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||$(t)||"willChange"===t||(e=$t(t)),e&&(Io(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Bo(this.members,"transform")):Bo(this.members,$t(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function $a(){!ei.current&&ni();const[t]=e.useState(ti.current);return t}function Ya(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,r){if(t){const t=[];return n.forEach(e=>{t.push(er(e,o,{transitionOverride:r}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,r],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?Ko(t,e):"string"==typeof e?Ko(t,[e]):Zo(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.forEachValue(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function Xa(){const t=A(Ya);return e.useEffect(t.mount,[]),t}const Ga=Xa;class qa{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}}const Za=()=>new qa;function Ka(t){return null!==t&&"object"==typeof t&&R in t}function _a(){return Ja}function Ja(t){Ts.current&&(Ts.current.isUpdating=!1,Ts.current.blockUpdate(),t&&t())}const Qa=()=>({}),tl=si({build(){},measureViewportBox:Or,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:Qa,readValueFromInstance:(t,e,n)=>n.initialState[e]||0,makeTargetAnimatable:(t,{transition:e,transitionEnd:n,...o})=>(_o(t,o,Qo(o,e||{},t)),{transition:e,transitionEnd:n,...o})}),el=te({scrapeMotionValuesFromProps:Qa,createRenderState:Qa});const nl=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:r,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",to(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=Os();const c=e.useContext(C).forceRender;c&&(u=c);const h=Ls(),f=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let p=f;const m=new Set,g=e.useRef(p),v=e.useRef(new Map).current,y=e.useRef(!0);if(d(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Is(t);e.set(n,t)})}(f,v),g.current=p}),Ce(()=>{y.current=!0,v.clear(),m.clear()}),y.current)return i.createElement(i.Fragment,null,p.map(t=>i.createElement(js,{key:Is(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));p=[...p];const x=g.current.map(Is),b=f.map(Is),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(p=[]),m.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);p.splice(o,0,i.createElement(js,{key:Is(e),isPresent:!1,onExitComplete:()=>{v.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=f,!1===h.current)return;u(),r&&r()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),p=p.map(t=>{const e=t.key;return m.has(e)?t:i.createElement(js,{key:Is(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==Jn&&"wait"===l&&p.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),i.createElement(i.Fragment,null,m.size?p:p.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),i.createElement(Ws,{id:A(()=>"asl-"+Hs++)},t)),t.DeprecatedLayoutGroupContext=Bs,t.DragControls=qa,t.FlatTree=rs,t.LayoutGroup=Ws,t.LayoutGroupContext=C,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,r]=e.useState(!$s(n)),s=e.useRef(void 0);if(!$s(n)){const{renderer:t,...e}=n;s.current=t,S(e)}return e.useEffect(()=>{$s(n)&&n().then(({renderer:t,...e})=>{S(e),s.current=t,r(!0)})},[]),i.createElement(h.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&jt(n),(o={...e.useContext(s),...o}).isStatic=A(()=>o.isStatic);const r=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return i.createElement(s.Provider,{value:r},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=zo,t.PresenceContext=u,t.Reorder=ea,t.SwitchLayoutGroupContext=M,t.addPointerEvent=ye,t.addScaleCorrector=I,t.animate=ji,t.animateVisualElement=er,t.animationControls=Ya,t.animations=hr,t.calcLength=br,t.checkTargetForNewValues=_o,t.createBox=Or,t.createDomMotionComponent=function(t){return L(re(t,{forwardMotionProps:!1},Vs,Vi,Cs))},t.createMotionComponent=L,t.delay=Vo,t.domAnimation=na,t.domMax=oa,t.filterProps=Ft,t.isBrowser=c,t.isDragActive=Ae,t.isMotionComponent=Ka,t.isMotionValue=N,t.isValidMotionProp=kt,t.m=Rs,t.makeUseVisualState=te,t.motion=Ms,t.motionValue=No,t.resolveMotionValue=Qt,t.transform=Ks,t.unwrapMotionComponent=function(t){if(Ka(t))return t[R]},t.useAnimation=Ga,t.useAnimationControls=Xa,t.useAnimationFrame=Wa,t.useCycle=function(...t){const n=e.useRef(0),[o,r]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,n.current+1):e,r(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),r=el({},!1),i=A(()=>tl({props:{},visualState:r},{initialState:t}));return e.useEffect(()=>(i.mount({}),i.unmount),[i]),e.useEffect(()=>{i.setProps({onUpdate:t=>{o({...t})}})},[o,i]),[n,A(()=>t=>er(i,t))]},t.useDeprecatedInvertedScale=function(t){let e=Zs(1),n=Zs(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Js(e,nl),scaleY:Js(n,nl)}},t.useDomEvent=ae,t.useDragControls=function(){return A(Za)},t.useElementScroll=function(t){return to(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Na({container:t})},t.useForceUpdate=Os,t.useInView=function(t,{root:n,margin:o,amount:r,once:i=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||i&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===r?"any":r};return function(t,e,{root:n,margin:o,amount:r="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const i=pa(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);ha(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof r?r:ma[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),i?void 0:()=>a(!1)),e)},[n,t,o,i]),s},t.useInstantLayoutTransition=_a,t.useInstantTransition=function(){const[t,n]=Os(),o=_a();return e.useEffect(()=>{Ln.postRender(()=>Ln.postRender(()=>Co.current=!1))},[n]),e=>{o(()=>{Co.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=d,t.useMotionTemplate=function(t,...e){const n=t.length;return _s(e,(function(){let o="";for(let r=0;r<n;r++){o+=t[r];e[r]&&(o+=e[r].get())}return o}))},t.useMotionValue=Zs,t.usePresence=ho,t.useReducedMotion=$a,t.useReducedMotionConfig=function(){const t=$a(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return i.useCallback(()=>{const t=Ts.current;t&&t.resetTree()},[])},t.useScroll=Na,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),r=e.useRef(null),i=Zs(N(t)?t.get():t);return e.useMemo(()=>i.attach((t,e)=>o?e(t):(r.current&&r.current.stop(),r.current=zn({from:i.get(),to:t,velocity:i.getVelocity(),...n,onUpdate:e}),i.get())),[JSON.stringify(n)]),function(t,e){d(()=>{if(N(t))return t.onChange(e)},[e])}(t,t=>i.set(parseFloat(t))),i},t.useTime=function(){const t=Zs(0);return Wa(e=>t.set(e)),t},t.useTransform=Js,t.useUnmountEffect=Ce,t.useVelocity=function(t){const n=Zs(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return to(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Na()},t.useVisualElementContext=l,t.useWillChange=function(){return A(()=>new Ha("auto"))},t.visualElement=si,t.wrapHandler=pe,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var r=n(e),i=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,d=c?e.useLayoutEffect:e.useEffect,h=e.createContext({strict:!1});function f(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function p(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return m(t.animate)||g.some(e=>p(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||p(e)?e:void 0,animate:p(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const E=t=>({isEnabled:e=>t.some(t=>!!e[t])}),w={measureLayout:E(["layout","layoutId","drag"]),animation:E(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:E(["exit"]),drag:E(["drag","dragControls"]),focus:E(["whileFocus"]),hover:E(["whileHover","onHoverStart","onHoverEnd"]),tap:E(["whileTap","onTap","onTapStart","onTapCancel"]),pan:E(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:E(["whileInView","onViewportEnter","onViewportLeave"])};function S(t){for(const e in t)"projectionNodeConstructor"===e?w.projectionNodeConstructor=t[e]:w[e].Component=t[e]}function A(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const P={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let T=1;const C=e.createContext({});class V extends r.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:r,useVisualState:p,Component:m}){t&&S(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:O(g)},{isStatic:b}=y;let E=null;const S=x(g),C=b?void 0:A(()=>{if(P.hasEverUpdated)return T++}),R=p(g,b);if(!b&&c){S.visualElement=function(t,n,o,r){const i=l(),a=e.useContext(h),c=e.useContext(u),f=e.useContext(s).reducedMotion,p=e.useRef(void 0);r=r||a.renderer,!p.current&&r&&(p.current=r(t,{visualState:n,parent:i,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:f}));const m=p.current;return d(()=>{m&&m.syncRender()}),e.useEffect(()=>{m&&m.animationState&&m.animationState.animateChanges()}),d(()=>()=>m&&m.notifyUnmount(),[]),m}(m,R,y,n);const r=e.useContext(h).strict,i=e.useContext(M);S.visualElement&&(E=S.visualElement.loadFeatures(y,r,t,C,o||w.projectionNodeConstructor,i))}return i.createElement(V,{visualElement:S.visualElement,props:y},E,i.createElement(a.Provider,{value:S},r(m,g,C,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):f(o)&&(o.current=e))},[n])}(R,S.visualElement,v),R,b,S.visualElement)))}));return g[R]=m,g}function O({layoutId:t}){const n=e.useContext(C).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const D=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function j(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const F={};function I(t){Object.assign(F,t)}const B=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(B);function z(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!F[t]||"opacity"===t)}const N=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>B.indexOf(t)-B.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},r,i){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),i?s=i(t,r?"":s):o&&r&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e)=>n=>Math.max(Math.min(n,e),t),q=t=>t%1?Number(t.toFixed(5)):t,Z=/(-)?([\d]*\.?[\d])+/g,K=/(#[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,_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function J(t){return"string"==typeof t}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt=Object.assign(Object.assign({},Q),{transform:G(0,1)}),et=Object.assign(Object.assign({},Q),{default:1}),nt=t=>({test:e=>J(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),rt=nt("%"),it=nt("px"),st=nt("vh"),at=nt("vw"),lt=Object.assign(Object.assign({},rt),{parse:t=>rt.parse(t)/100,transform:t=>rt.transform(100*t)}),ut=(t,e)=>n=>Boolean(J(n)&&_.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>o=>{if(!J(o))return o;const[r,i,s,a]=o.match(Z);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},dt={test:ut("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+rt.transform(q(e))+", "+rt.transform(q(n))+", "+q(tt.transform(o))+")"},ht=G(0,255),ft=Object.assign(Object.assign({},Q),{transform:t=>Math.round(ht(t))}),pt={test:ut("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+ft.transform(t)+", "+ft.transform(e)+", "+ft.transform(n)+", "+q(tt.transform(o))+")"};const mt={test:ut("#"),parse:function(t){let e="",n="",o="",r="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),r=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),r=t.substr(4,1),e+=e,n+=n,o+=o,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}},transform:pt.transform},gt={test:t=>pt.test(t)||mt.test(t)||dt.test(t),parse:t=>pt.test(t)?pt.parse(t):dt.test(t)?dt.parse(t):mt.parse(t),transform:t=>J(t)?t:t.hasOwnProperty("red")?pt.transform(t):dt.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(K);o&&(n=o.length,t=t.replace(K,"${c}"),e.push(...o.map(gt.parse)));const r=t.match(Z);return r&&(t=t.replace(Z,"${n}"),e.push(...r.map(Q.parse))),{values:e,numColors:n,tokenised:t}}function yt(t){return vt(t).values}function xt(t){const{values:e,numColors:n,tokenised:o}=vt(t),r=e.length;return t=>{let e=o;for(let o=0;o<r;o++)e=e.replace(o<n?"${c}":"${n}",o<n?gt.transform(t[o]):q(t[o]));return e}}const bt=t=>"number"==typeof t?0:t;const Et={test:function(t){var e,n,o,r;return isNaN(t)&&J(t)&&(null!==(n=null===(e=t.match(Z))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(r=null===(o=t.match(K))||void 0===o?void 0:o.length)&&void 0!==r?r:0)>0},parse:yt,createTransformer:xt,getAnimatableNone:function(t){const e=yt(t);return xt(t)(e.map(bt))}},wt=new Set(["brightness","contrast","saturate","opacity"]);function St(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(Z)||[];if(!o)return t;const r=n.replace(o,"");let i=wt.has(e)?1:0;return o!==n&&(i*=100),e+"("+i+r+")"}const At=/([a-z-]*)\(.*?\)/g,Pt=Object.assign(Object.assign({},Et),{getAnimatableNone:t=>{const e=t.match(At);return e?e.map(St).join(" "):t}}),Tt={...Q,transform:Math.round},Ct={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ot,skewX:ot,skewY:ot,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:tt,originX:lt,originY:lt,originZ:it,zIndex:Tt,fillOpacity:tt,strokeOpacity:tt,numOctaves:Tt};function Vt(t,e,n,o){const{style:r,vars:i,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,d=!0;for(const t in e){const n=e[t];if(Y(t)){i[t]=n;continue}const o=Ct[t],h=X(n,o);if(U.has(t)){if(u=!0,s[t]=h,a.push(t),!d)continue;n!==(o.default||0)&&(d=!1)}else t.startsWith("origin")?(c=!0,l[t]=h):r[t]=h}if(e.transform||(u||o?r.transform=$(t,n,d,o):r.transform&&(r.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;r.transformOrigin=`${t} ${e} ${n}`}}const Mt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Rt(t,e,n){for(const o in e)N(e[o])||z(o,n)||(t[o]=e[o])}function Lt(t,n,o){const r={};return Rt(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Vt(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(r):r}function Ot(t,e,n){const o={},r=Lt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=r,o}const kt=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 Dt(t){return kt.has(t)}let jt=t=>!Dt(t);function Ft(t){t&&(jt=e=>e.startsWith("on")?!Dt(e):t(e))}try{Ft(require("@emotion/is-prop-valid").default)}catch(t){}function It(t,e,n){const o={};for(const r in t)(jt(r)||!0===n&&Dt(r)||!e&&!Dt(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function Bt(t,e,n){return"string"==typeof t?t:it.transform(e+n*t)}const Ut={offset:"stroke-dashoffset",array:"stroke-dasharray"},zt={offset:"strokeDashoffset",array:"strokeDasharray"};function Nt(t,{attrX:e,attrY:n,originX:o,originY:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Vt(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:f}=t;d.transform&&(f&&(h.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==r||h.transform)&&(h.transformOrigin=function(t,e,n){return`${Bt(e,t.x,t.width)} ${Bt(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&function(t,e,n=1,o=0,r=!0){t.pathLength=1;const i=r?Ut:zt;t[i.offset]=it.transform(-o);const s=it.transform(e),a=it.transform(n);t[i.array]=`${s} ${a}`}(d,i,s,a,!1)}const Wt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Ht(t,n){const o=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return Nt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Rt(e,t.style,t),o.style={...e,...o.style}}return o}function $t(t=!1){return(n,o,r,i,{latestValues:s},a)=>{const l=(j(n)?Ht:Ot)(o,s,a),u={...It(o,"string"==typeof n,t),...l,ref:i};return r&&(u["data-projection-id"]=r),e.createElement(n,u)}}const Yt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Xt(t,{style:e,vars:n},o,r){Object.assign(t.style,e,r&&r.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Gt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function qt(t,e,n,o){Xt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Gt.has(n)?n:Yt(n),e.attrs[n])}function Zt(t){const{style:e}=t,n={};for(const o in e)(N(e[o])||z(o,t))&&(n[o]=e[o]);return n}function Kt(t){const e=Zt(t);for(const n in t)if(N(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function _t(t,e,n,o={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),e}const Jt=t=>Array.isArray(t),Qt=t=>Jt(t)?t[t.length-1]||0:t;function te(t){const e=N(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ee=t=>(n,o)=>{const r=e.useContext(a),i=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,r,i){const s={latestValues:ne(o,r,i,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,r,i);return o?s():A(s)};function ne(t,e,n,o){const r={},i=o(t);for(const t in i)r[t]=te(i[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;if(d&&"boolean"!=typeof d&&!m(d)){(Array.isArray(d)?d:[d]).forEach(e=>{const n=_t(t,e);if(!n)return;const{transitionEnd:o,transition:i,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(r[t]=e)}for(const t in o)r[t]=o[t]})}return r}const oe={useVisualState:ee({scrapeMotionValuesFromProps:Kt,createRenderState:Wt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}Nt(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),qt(e,n)}})},re={useVisualState:ee({scrapeMotionValuesFromProps:Zt,createRenderState:Mt})};function ie(t,{forwardMotionProps:e=!1},n,o,r){return{...j(t)?oe:re,preloadedFeatures:n,useRender:$t(e),createVisualElement:o,projectionNodeConstructor:r,Component:t}}var se;function ae(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function le(t,n,o,r){e.useEffect(()=>{const e=t.current;if(o&&e)return ae(e,n,o,r)},[t,n,o,r])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ce(t){return!!t.touches}t.AnimationType=void 0,(se=t.AnimationType||(t.AnimationType={})).Animate="animate",se.Hover="whileHover",se.Tap="whileTap",se.Drag="whileDrag",se.Focus="whileFocus",se.InView="whileInView",se.Exit="exit";const de={pageX:0,pageY:0};function he(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||de;return{x:n[e+"X"],y:n[e+"Y"]}}function fe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function pe(t,e="page"){return{point:ce(t)?he(t,e):fe(t,e)}}const me=(t,e=!1)=>{const n=e=>t(e,pe(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},ge={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ve={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ye(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ve[t]:c&&null===window.onmousedown?ge[t]:t}function xe(t,e,n,o){return ae(t,ye(e),me(n,"pointerdown"===e),o)}function be(t,e,n,o){return le(t,ye(e),n&&me(n,"pointerdown"===e),o)}function Ee(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const we=Ee("dragHorizontal"),Se=Ee("dragVertical");function Ae(t){let e=!1;if("y"===t)e=Se();else if("x"===t)e=we();else{const t=we(),n=Se();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Pe(){const t=Ae(!0);return!t||(t(),!1)}function Te(e,n,o){return(r,i)=>{ue(r)&&!Pe()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(r,i))}}const Ce=(t,e)=>!!e&&(t===e||Ce(t,e.parentElement));function Ve(t){return e.useEffect(()=>()=>t(),[])}function Me(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}const Re=(t,e,n)=>Math.min(Math.max(n,t),e);function Le({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let r,i,s=1-e;s=Re(.05,1,s),t=Re(.01,10,t/1e3),s<1?(r=e=>{const o=e*s,r=o*t;return.001-(o-n)/Oe(e,s)*Math.exp(-r)},i=e=>{const o=e*s*t,i=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=Oe(Math.pow(e,2),s);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(r,i,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function Oe(t,e){return t*Math.sqrt(1-e*e)}const ke=["duration","bounce"],De=["stiffness","damping","mass"];function je(t,e){return e.some(e=>void 0!==t[e])}function Fe(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:r}=t,i=Me(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:h}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!je(t,De)&&je(t,ke)){const n=Le(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(i),f=Ie,p=Ie;function m(){const t=c?-c/1e3:0,o=n-e,i=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===r&&(r=Math.min(Math.abs(n-e)/100,.4)),i<1){const e=Oe(s,i);f=r=>{const a=Math.exp(-i*s*r);return n-a*((t+i*s*o)/e*Math.sin(e*r)+o*Math.cos(e*r))},p=n=>{const r=Math.exp(-i*s*n);return i*s*r*(Math.sin(e*n)*(t+i*s*o)/e+o*Math.cos(e*n))-r*(Math.cos(e*n)*(t+i*s*o)-e*o*Math.sin(e*n))}}else if(1===i)f=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(i*i-1);f=r=>{const a=Math.exp(-i*s*r),l=Math.min(e*r,300);return n-a*((t+i*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return m(),{next:t=>{const e=f(t);if(h)s.done=t>=d;else{const i=1e3*p(t),a=Math.abs(i)<=o,l=Math.abs(n-e)<=r;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}Fe.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Ie=t=>0,Be=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ue=(t,e,n)=>-n*t+n*e+t;function ze(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}function Ne({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let r=0,i=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;r=ze(a,o,t+1/3),i=ze(a,o,t),s=ze(a,o,t-1/3)}else r=i=s=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*s),alpha:o}}const We=(t,e,n)=>{const o=t*t,r=e*e;return Math.sqrt(Math.max(0,n*(r-o)+o))},He=[mt,pt,dt],$e=t=>He.find(e=>e.test(t)),Ye=(t,e)=>{let n=$e(t),o=$e(e),r=n.parse(t),i=o.parse(e);n===dt&&(r=Ne(r),n=pt),o===dt&&(i=Ne(i),o=pt);const s=Object.assign({},r);return t=>{for(const e in s)"alpha"!==e&&(s[e]=We(r[e],i[e],t));return s.alpha=Ue(r.alpha,i.alpha,t),n.transform(s)}},Xe=t=>"number"==typeof t,Ge=(t,e)=>n=>e(t(n)),qe=(...t)=>t.reduce(Ge);function Ze(t,e){return Xe(t)?n=>Ue(t,e,n):gt.test(t)?Ye(t,e):Qe(t,e)}const Ke=(t,e)=>{const n=[...t],o=n.length,r=t.map((t,n)=>Ze(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=r[e](t);return n}},_e=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(o[r]=Ze(t[r],e[r]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function Je(t){const e=Et.parse(t),n=e.length;let o=0,r=0,i=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?i++:r++;return{parsed:e,numNumbers:o,numRGB:r,numHSL:i}}const Qe=(t,e)=>{const n=Et.createTransformer(e),o=Je(t),r=Je(e);return o.numHSL===r.numHSL&&o.numRGB===r.numRGB&&o.numNumbers>=r.numNumbers?qe(Ke(o.parsed,r.parsed),n):n=>""+(n>0?e:t)},tn=(t,e)=>n=>Ue(t,e,n);function en(t,e,n){const o=[],r=n||("number"==typeof(i=t[0])?tn:"string"==typeof i?gt.test(i)?Ye:Qe:Array.isArray(i)?Ke:"object"==typeof i?_e:void 0);var i;const s=t.length-1;for(let n=0;n<s;n++){let i=r(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;i=qe(t,i)}o.push(i)}return o}function nn(t,e,{clamp:n=!0,ease:o,mixer:r}={}){const i=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[i-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=en(e,o,r),a=2===i?function([t,e],[n]){return o=>n(Be(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return r=>{let i=0,s=!1;if(r<=t[0]?s=!0:r>=t[o]&&(i=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>r||e===o);e++);i=e-1}const a=Be(t[i],t[i+1],r);return e[i](a)}}(t,s);return n?e=>a(Re(t[0],t[i-1],e)):a}const on=t=>e=>1-t(1-e),rn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,sn=t=>e=>e*e*((t+1)*e-t),an=t=>t,ln=(un=2,t=>Math.pow(t,un));var un;const cn=on(ln),dn=rn(ln),hn=t=>1-Math.sin(Math.acos(t)),fn=on(hn),pn=rn(fn),mn=sn(1.525),gn=on(mn),vn=rn(mn),yn=(t=>{const e=sn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),xn=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},bn=on(xn);function En(t,e){return t.map(()=>e||dn).splice(0,t.length-1)}function wn({from:t=0,to:e=1,ease:n,offset:o,duration:r=300}){const i={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),r);function l(){return nn(a,s,{ease:Array.isArray(n)?n:En(s,n)})}let u=l();return{next:t=>(i.value=u(t),i.done=t>=r,i),flipTarget:()=>{s.reverse(),u=l()}}}const Sn={keyframes:wn,spring:Fe,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:r=.5,modifyTarget:i}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===i?l:i(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>r||e<-r),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const An="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Pn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(An()),1/60*1e3);let Tn=!0,Cn=!1,Vn=!1;const Mn={delta:0,timestamp:0},Rn=["read","update","preRender","render","postRender"],Ln=Rn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,r=!1,i=!1;const s=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const l=a&&r,u=l?e:n;return i&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&r&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(r)i=!0;else{if(r=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}r=!1,i&&(i=!1,a.process(l))}}};return a}(()=>Cn=!0),t),{}),On=Rn.reduce((t,e)=>{const n=Ln[e];return t[e]=(t,e=!1,o=!1)=>(Cn||In(),n.schedule(t,e,o)),t},{}),kn=Rn.reduce((t,e)=>(t[e]=Ln[e].cancel,t),{}),Dn=Rn.reduce((t,e)=>(t[e]=()=>Ln[e].process(Mn),t),{}),jn=t=>Ln[t].process(Mn),Fn=t=>{Cn=!1,Mn.delta=Tn?1/60*1e3:Math.max(Math.min(t-Mn.timestamp,40),1),Mn.timestamp=t,Vn=!0,Rn.forEach(jn),Vn=!1,Cn&&(Tn=!1,Pn(Fn))},In=()=>{Cn=!0,Tn=!0,Vn||Pn(Fn)},Bn=()=>Mn;function Un(t,e,n=0){return t-e-n}const zn=t=>{const e=({delta:e})=>t(e);return{start:()=>On.update(e,!0),stop:()=>kn.update(e)}};function Nn(t){var e,n,{from:o,autoplay:r=!0,driver:i=zn,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:d,onComplete:h,onRepeat:f,onUpdate:p}=t,m=Me(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:x}=m,b=0,E=m.duration,w=!1,S=!0;const A=function(t){if(Array.isArray(t.to))return wn;if(Sn[t.type])return Sn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?wn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Fe:wn}(m);(null===(n=(e=A).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=nn([0,100],[o,x],{clamp:!1}),o=0,x=100);const P=A(Object.assign(Object.assign({},m),{from:o,to:x}));function T(){b++,"reverse"===l?(S=b%2==0,s=function(t,e,n=0,o=!0){return o?Un(e+-t,e,n):e-(t-e)+n}(s,E,u,S)):(s=Un(s,E,u),"mirror"===l&&P.flipTarget()),w=!1,f&&f()}function C(t){if(S||(t=-t),s+=t,!w){const t=P.next(Math.max(0,s));v=t.value,y&&(v=y(v)),w=S?t.done:s<=0}null==p||p(v),w&&(0===b&&(null!=E||(E=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,S)&&T():(g.stop(),h&&h()))}return r&&(null==c||c(),g=i(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function Wn(t,e){return e?t*(1e3/e):0}const Hn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),$n=t=>Hn(t)&&t.hasOwnProperty("z"),Yn=(t,e)=>Math.abs(t-e);function Xn(t,e){if(Xe(t)&&Xe(e))return Yn(t,e);if(Hn(t)&&Hn(e)){const n=Yn(t.x,e.x),o=Yn(t.y,e.y),r=$n(t)&&$n(e)?Yn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(r,2))}}const Gn=(t,e)=>1-3*e+3*t,qn=(t,e)=>3*e-6*t,Zn=t=>3*t,Kn=(t,e,n)=>((Gn(e,n)*t+qn(e,n))*t+Zn(e))*t,_n=(t,e,n)=>3*Gn(e,n)*t*t+2*qn(e,n)*t+Zn(e);function Jn(t,e,n,o){if(t===e&&n===o)return an;const r=new Float32Array(11);for(let e=0;e<11;++e)r[e]=Kn(.1*e,t,n);function i(e){let o=0,i=1;for(;10!==i&&r[i]<=e;++i)o+=.1;--i;const s=o+.1*((e-r[i])/(r[i+1]-r[i])),a=_n(s,t,n);return a>=.001?function(t,e,n,o){for(let r=0;r<8;++r){const r=_n(e,n,o);if(0===r)return e;e-=(Kn(e,n,o)-t)/r}return e}(e,s,t,n):0===a?s:function(t,e,n,o,r){let i,s,a=0;do{s=e+(n-e)/2,i=Kn(s,o,r)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Kn(i(t),e,o)}const Qn=("undefined"==typeof process||process.env,"production"),to=new Set;function eo(t,e,n){t||to.has(e)||(console.warn(e),n&&console.warn(n),to.add(e))}const no=new WeakMap,oo=new WeakMap,ro=t=>{const e=no.get(t.target);e&&e(t)},io=t=>{t.forEach(ro)};function so(t,e,n){const o=function({root:t,...e}){const n=t||document;oo.has(n)||oo.set(n,{});const o=oo.get(n),r=JSON.stringify(e);return o[r]||(o[r]=new IntersectionObserver(io,{root:t,...e})),o[r]}(e);return no.set(t,n),o.observe(t),()=>{no.delete(t),o.unobserve(t)}}const ao={some:0,all:1};function lo(n,o,r,{root:i,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n)return;const e={root:null==i?void 0:i.current,rootMargin:s,threshold:"number"==typeof a?a:ao[a]};return so(r.getInstance(),e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),r.animationState&&r.animationState.setActive(t.AnimationType.InView,n);const i=r.getProps(),s=n?i.onViewportEnter:i.onViewportLeave;s&&s(e)})},[n,i,s,a])}function uo(n,o,r,{fallback:i=!0}){e.useEffect(()=>{n&&i&&("production"!==Qn&&eo(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=r.getProps();e&&e(null),r.animationState&&r.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const co=t=>e=>(t(e),null),ho={inView:co((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:r,viewport:i={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||r);i.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?uo:lo)(a,s.current,t,i)})),tap:co((function({onTap:n,onTapStart:o,onTapCancel:r,whileTap:i,visualElement:s}){const a=n||o||r||i,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||r||m)};function d(){u.current&&u.current(),u.current=null}function h(){return d(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Pe()}function f(t,e){h()&&(Ce(s.getInstance(),t.target)?n&&n(t,e):r&&r(t,e))}function p(t,e){h()&&r&&r(t,e)}function m(e,n){d(),l.current||(l.current=!0,u.current=qe(xe(window,"pointerup",f,c),xe(window,"pointercancel",p,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}be(s,"pointerdown",a?m:void 0,c),Ve(d)})),focus:co((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;le(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),le(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:co((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){be(o,"pointerenter",t||n?Te(o,!0,t):void 0,{passive:!t}),be(o,"pointerleave",e||n?Te(o,!1,e):void 0,{passive:!e})}))};function fo(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,i=e.useId();e.useEffect(()=>r(i),[]);return!n&&o?[!1,()=>o&&o(i)]:[!0]}function po(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const mo=t=>1e3*t,go={linear:an,easeIn:ln,easeInOut:dn,easeOut:cn,circIn:hn,circInOut:pn,circOut:fn,backIn:mn,backInOut:vn,backOut:gn,anticipate:yn,bounceIn:bn,bounceInOut:t=>t<.5?.5*(1-xn(1-2*t)):.5*xn(2*t-1)+.5,bounceOut:xn},vo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,r]=t;return Jn(e,n,o,r)}return"string"==typeof t?go[t]:t},yo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Et.test(e)||e.startsWith("url("))),xo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),bo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Eo=()=>({type:"keyframes",ease:"linear",duration:.3}),wo=t=>({type:"keyframes",duration:.8,values:t}),So={x:xo,y:xo,z:xo,rotate:xo,rotateX:xo,rotateY:xo,rotateZ:xo,scaleX:bo,scaleY:bo,scale:bo,opacity:Eo,backgroundColor:Eo,color:Eo,default:bo},Ao=(t,e)=>{let n;return n=Jt(e)?wo:So[t]||So.default,{to:e,...n(e)}},Po={...Ct,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:Pt,WebkitFilter:Pt},To=t=>Po[t];function Co(t,e){var n;let o=To(t);return o!==Pt&&(o=Et),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Vo={current:!1};function Mo(t,e){const n=performance.now(),o=({timestamp:r})=>{const i=r-n;i>=e&&(kn.read(o),t(i-e))};return On.read(o,!0),()=>kn.read(o)}function Ro({ease:t,times:e,yoyo:n,flip:o,loop:r,...i}){const s={...i};return e&&(s.offset=e),i.duration&&(s.duration=mo(i.duration)),i.repeatDelay&&(s.repeatDelay=mo(i.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(vo):vo(t)),"tween"===i.type&&(s.type="keyframes"),(n||r||o)&&(n?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||n||o||i.repeat),"spring"!==i.type&&(s.type="keyframes"),s}function Lo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:r,repeat:i,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Ao(n,e.to)}),{...e,...Ro(t)}}function Oo(t,e,n,o,r){const i=jo(o,t)||{};let s=void 0!==i.from?i.from:e.get();const a=yo(t,n);"none"===s&&a&&"string"==typeof n?s=Co(t,n):ko(s)&&"string"==typeof n?s=Do(n):!Array.isArray(n)&&ko(n)&&"string"==typeof s&&(n=Do(s));return yo(t,s)&&a&&!1!==i.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:r,onUpdate:t=>e.set(t)};return"inertia"===i.type||"decay"===i.type?function({from:t=0,velocity:e=0,min:n,max:o,power:r=.8,timeConstant:i=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:d,onComplete:h,onStop:f}){let p;function m(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==p||p.stop(),p=Nn(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==d||d(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:f}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(m(t))y({from:t,velocity:e,to:g(t)});else{let o=r*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,d;const h=t=>{c=d,d=t,e=Wn(t-c,Bn().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:i,power:r,restDelta:l,modifyTarget:u,onUpdate:m(o)?h:void 0})}return{stop:()=>null==p?void 0:p.stop()}}({...o,...i}):Nn({...Lo(i,o,t),onUpdate:t=>{o.onUpdate(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{o.onComplete(),i.onComplete&&i.onComplete()}})}:function(){const t=Qt(n);return e.set(t),r(),i.onUpdate&&i.onUpdate(t),i.onComplete&&i.onComplete(),{stop:()=>{}}}}function ko(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Do(t){return"number"==typeof t?0:Co("",t)}function jo(t,e){return t[e]||t.default||t}function Fo(t,e,n,o={}){return Vo.current&&(o={type:!1}),e.start(r=>{let i;const s=Oo(t,e,n,o,r),a=function(t,e){var n,o;return null!==(o=null!==(n=(jo(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),l=()=>i=s();let u;return a?u=Mo(l,mo(a)):l(),()=>{u&&u(),i&&i.stop()}})}const Io=t=>/^0[^.\s]+$/.test(t);function Bo(t,e){-1===t.indexOf(e)&&t.push(e)}function Uo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class zo{constructor(){this.subscriptions=[]}add(t){return Bo(this.subscriptions,t),()=>Uo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let r=0;r<o;r++){const o=this.subscriptions[r];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class No{constructor(t){var e;this.version="7.6.3",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new zo,this.velocityUpdateSubscribers=new zo,this.renderSubscribers=new zo,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Bn();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,On.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>On.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Wn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Wo(t){return new No(t)}const Ho=t=>e=>e.test(t),$o=[Q,it,rt,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],Yo=t=>$o.find(Ho(t)),Xo=[...$o,gt,Et],Go=t=>Xo.find(Ho(t));function qo(t,e,n){const o=t.getProps();return _t(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function Zo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wo(n))}function Ko(t,e){const n=qo(t,e);let{transitionEnd:o={},transition:r={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...o};for(const e in i){Zo(t,e,Qt(i[e]))}}function _o(t,e){[...e].reverse().forEach(n=>{var o;const r=t.getVariant(n);r&&Ko(t,r),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{_o(t,e)})})}function Jo(t,e,n){var o,r;const i=Object.keys(e).filter(e=>!t.hasValue(e)),s=i.length;if(s)for(let a=0;a<s;a++){const s=i[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(r=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==r?r:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Io(u))?u=parseFloat(u):!Go(u)&&Et.test(l)&&(u=Co(s,l)),t.addValue(s,Wo(u)),void 0===n[s]&&(n[s]=u),t.setBaseTarget(s,u))}}function Qo(t,e){if(!e)return;return(e[t]||e.default||e).from}function tr(t,e,n){var o;const r={};for(const i in t){const t=Qo(i,e);r[i]=void 0!==t?t:null===(o=n.getValue(i))||void 0===o?void 0:o.get()}return r}function er(t){return Boolean(N(t)&&t.add)}function nr(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const r=e.map(e=>or(t,e,n));o=Promise.all(r)}else if("string"==typeof e)o=or(t,e,n);else{const r="function"==typeof e?qo(t,e,n.custom):e;o=rr(t,r,n)}return o.then(()=>t.notifyAnimationComplete(e))}function or(t,e,n={}){var o;const r=qo(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>rr(t,r,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,o=0,r=1,i){const s=[],a=(t.variantChildren.size-1)*o,l=1===r?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(ir).forEach((t,o)=>{s.push(or(t,e,{...i,delay:n+l(o)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(s)}(t,e,r+o,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function rr(t,e,{delay:n=0,transitionOverride:o,type:r}={}){var i;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],d=r&&(null===(i=t.animationState)||void 0===i?void 0:i.getState()[r]);for(const e in l){const o=t.getValue(e),r=l[e];if(!o||void 0===r||d&&sr(d,e))continue;let i={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(i={...i,type:!1,delay:0});let a=Fo(e,o,r,i);er(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Ko(t,a)})}function ir(t,e){return t.sortNodePosition(e)}function sr({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const ar=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],lr=[...ar].reverse(),ur=ar.length;function cr(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>nr(t,e,n)))}(e);const o={[t.AnimationType.Animate]:hr(!0),[t.AnimationType.InView]:hr(),[t.AnimationType.Hover]:hr(),[t.AnimationType.Tap]:hr(),[t.AnimationType.Drag]:hr(),[t.AnimationType.Focus]:hr(),[t.AnimationType.Exit]:hr()};let r=!0;const i=(t,n)=>{const o=qo(e,n);if(o){const{transition:e,transitionEnd:n,...r}=o;t={...t,...r,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],d=new Set;let h={},f=1/0;for(let n=0;n<ur;n++){const g=lr[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=p(y),b=g===s?v.isActive:null;!1===b&&(f=n);let E=y===u[g]&&y!==l[g]&&x;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...h},!v.isActive&&null===b||!y&&!v.prevProp||m(y)||"boolean"==typeof y)continue;const w=dr(v.prevProp,y);let S=w||g===s&&v.isActive&&!E&&x||n>f&&x;const A=Array.isArray(y)?y:[y];let P=A.reduce(i,{});!1===b&&(P={});const{prevResolvedValues:T={}}=v,C={...T,...P},V=t=>{S=!0,d.delete(t),v.needsAnimating[t]=!0};for(const t in C){const e=P[t],n=T[t];h.hasOwnProperty(t)||(e!==n?Jt(e)&&Jt(n)?!po(e,n)||w?V(t):v.protectedKeys[t]=!0:void 0!==e?V(t):d.add(t):void 0!==e&&d.has(t)?V(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=P,v.isActive&&(h={...h,...P}),r&&e.blockInitialAnimation&&(S=!1),S&&!E&&c.push(...A.map(e=>({animation:e,options:{type:g,...t}})))}if(d.size){const t={};d.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return r&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,r){var i;if(o[t].isActive===n)return Promise.resolve();null===(i=e.variantChildren)||void 0===i||i.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(r,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function dr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!po(e,t)}function hr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const fr={animation:co(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=cr(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:co(n=>{const{custom:o,visualElement:r}=n,[i,s]=fo(),a=e.useContext(u);e.useEffect(()=>{r.isPresent=i;const e=r.animationState&&r.animationState.setActive(t.AnimationType.Exit,!i,{custom:a&&a.custom||o});e&&!i&&e.then(s)},[i])})};class pr{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=vr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Xn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:r}=Bn();this.history.push({...o,timestamp:r});const{onStart:i,onMove:s}=this.handlers;e||(i&&i(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=mr(e,this.transformPagePoint),ue(t)&&0===t.buttons?this.handlePointerUp(t,e):On.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,r=vr(mr(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),o&&o(t,r)},ce(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=mr(pe(t),this.transformPagePoint),{point:r}=o,{timestamp:i}=Bn();this.history=[{...r,timestamp:i}];const{onSessionStart:s}=e;s&&s(t,vr(o,this.history)),this.removeListeners=qe(xe(window,"pointermove",this.handlePointerMove),xe(window,"pointerup",this.handlePointerUp),xe(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),kn.update(this.updatePoint)}}function mr(t,e){return e?{point:e(t.point)}:t}function gr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function vr({point:t},e){return{point:t,delta:gr(t,xr(e)),offset:gr(t,yr(e)),velocity:br(e,.1)}}function yr(t){return t[0]}function xr(t){return t[t.length-1]}function br(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const r=xr(t);for(;n>=0&&(o=t[n],!(r.timestamp-o.timestamp>mo(e)));)n--;if(!o)return{x:0,y:0};const i=(r.timestamp-o.timestamp)/1e3;if(0===i)return{x:0,y:0};const s={x:(r.x-o.x)/i,y:(r.y-o.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Er(t){return t.max-t.min}function wr(t,e=0,n=.01){return Xn(t,e)<n}function Sr(t,e,n,o=.5){t.origin=o,t.originPoint=Ue(e.min,e.max,t.origin),t.scale=Er(n)/Er(e),(wr(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ue(n.min,n.max,t.origin)-t.originPoint,(wr(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Ar(t,e,n,o){Sr(t.x,e.x,n.x,null==o?void 0:o.originX),Sr(t.y,e.y,n.y,null==o?void 0:o.originY)}function Pr(t,e,n){t.min=n.min+e.min,t.max=t.min+Er(e)}function Tr(t,e,n){t.min=e.min-n.min,t.max=t.min+Er(e)}function Cr(t,e,n){Tr(t.x,e.x,n.x),Tr(t.y,e.y,n.y)}function Vr(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 Mr(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Rr=.35;function Lr(t,e,n){return{min:Or(t,e),max:Or(t,n)}}function Or(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const kr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Dr(t){return[t("x"),t("y")]}function jr({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Fr(t){return void 0===t||1===t}function Ir({scale:t,scaleX:e,scaleY:n}){return!Fr(t)||!Fr(e)||!Fr(n)}function Br(t){return Ir(t)||Ur(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Ur(t){return zr(t.x)||zr(t.y)}function zr(t){return t&&"0%"!==t}function Nr(t,e,n){return n+e*(t-n)}function Wr(t,e,n,o,r){return void 0!==r&&(t=Nr(t,r,o)),Nr(t,n,o)+e}function Hr(t,e=0,n=1,o,r){t.min=Wr(t.min,e,n,o,r),t.max=Wr(t.max,e,n,o,r)}function $r(t,{x:e,y:n}){Hr(t.x,e.translate,e.scale,e.originPoint),Hr(t.y,n.translate,n.scale,n.originPoint)}function Yr(t,e){t.min=t.min+e,t.max=t.max+e}function Xr(t,e,[n,o,r]){const i=void 0!==e[r]?e[r]:.5,s=Ue(t.min,t.max,i);Hr(t,e[n],e[o],s,e.scale)}const Gr=["x","scaleX","originX"],qr=["y","scaleY","originY"];function Zr(t,e){Xr(t.x,e,Gr),Xr(t.y,e,qr)}function Kr(t,e){return jr(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const _r=new WeakMap;class Jr{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(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new pr(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(pe(t,"page").point)},onStart:(e,n)=>{var o;const{drag:r,dragPropagation:i,onDragStart:s}=this.getProps();(!r||i||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ae(r),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Dr(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(rt.test(o)){const r=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(r){o=Er(r)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:r,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&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}(s),void(null!==this.currentDirection&&(null==r||r(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==i||i(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:o}=e;this.startAnimation(o);const{onDragEnd:r}=this.getProps();null==r||r(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Qr(t,o,this.currentDirection))return;const r=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ue(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ue(n,t,o.max):Math.min(t,n)),t}(i,this.constraints[t],this.elastic[t])),r.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&f(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:r}){return{x:Vr(t.x,n,r),y:Vr(t.y,e,o)}}(n.actual,t),this.elastic=function(t=Rr){return!1===t?t=0:!0===t&&(t=Rr),{x:Lr(t,"left","right"),y:Lr(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Dr(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.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!f(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const r=function(t,e,n){const o=Kr(t,n),{scroll:r}=e;return r&&(Yr(o.x,r.x),Yr(o.y,r.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let i=function(t,e){return{x:Mr(t.x,e.x),y:Mr(t.y,e.y)}}(o.layout.actual,r);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(i));this.hasMutatedConstraints=!!t,t&&(i=jr(t))}return i}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:r,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Dr(s=>{var l;if(!Qr(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};i&&(u={min:0,max:0});const c=o?200:1e6,d=o?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...u};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return Fo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Dr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),r=this.visualElement.getProps()[o];return r||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Dr(e=>{const{drag:n}=this.getProps();if(!Qr(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,r=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:i}=o.layout.actual[e];r.set(t[e]-Ue(n,i,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!f(n)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Dr(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const o=Er(t),r=Er(e);return r>o?n=Be(e.min,e.max-o,t.min):o>r&&(n=Be(t.min,t.max-r,e.min)),Re(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=i?i({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Dr(t=>{if(!Qr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Ue(o,i,r[t]))})}addListeners(){var t;_r.set(this.visualElement,this);const e=xe(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();f(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const i=ae(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Dr(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{i(),e(),r(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:r=!1,dragElastic:i=Rr,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:r,dragElastic:i,dragMomentum:s}}}function Qr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ti={pan:co((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:r,visualElement:i}){const a=t||n||o||r,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:r,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),be(i,"pointerdown",a&&function(t){l.current=new pr(t,c,{transformPagePoint:u})}),Ve(()=>l.current&&l.current.end())})),drag:co((function(t){const{dragControls:n,visualElement:o}=t,r=A(()=>new Jr(o));e.useEffect(()=>n&&n.subscribe(r),[r,n]),e.useEffect(()=>r.addListeners(),[r])}))},ei={current:null},ni={current:!1};function oi(){if(ni.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ei.current=t.matches;t.addListener(e),e()}else ei.current=!1}const ri=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const ii=Object.keys(w),si=ii.length,ai=({treeType:t="",build:n,getBaseTarget:o,makeTargetAnimatable:r,measureViewportBox:i,render:s,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:d,props:h,presenceId:m,blockInitialAnimation:g,visualState:x,reducedMotionConfig:b},E={})=>{let S=!1;const{latestValues:A,renderState:P}=x;let T;const C=function(){const t=ri.map(()=>new zo),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{ri.forEach(o=>{var r;const i="on"+o,s=t[i];null===(r=e[o])||void 0===r||r.call(e),s&&(e[o]=n[i](s))})}};return t.forEach((t,e)=>{n["on"+ri[e]]=e=>t.add(e),n["notify"+ri[e]]=(...e)=>t.notify(...e)}),n}(),V=new Map,M=new Map;let R={};const L={...A},O=h.initial?{...A}:{};let k;function D(){T&&S&&(j(),s(T,P,h.style,H.projection))}function j(){n(H,P,A,E,h)}function F(){C.notifyUpdate(A)}function I(t,e){const n=e.onChange(e=>{A[t]=e,h.onUpdate&&On.update(F,!1,!0)}),o=e.onRenderRequest(H.scheduleRender);M.set(t,()=>{n(),o()})}const{willChange:B,...U}=c(h);for(const t in U){const e=U[t];void 0!==A[t]&&N(e)&&(e.set(A[t],!1),er(B)&&B.add(t))}if(h.values)for(const t in h.values){const e=h.values[t];void 0!==A[t]&&N(e)&&e.set(A[t])}const z=v(h),W=y(h),H={treeType:t,current:null,depth:d?d.depth+1:0,parent:d,children:new Set,presenceId:m,shouldReduceMotion:null,variantChildren:W?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==d?void 0:d.isMounted()),blockInitialAnimation:g,isMounted:()=>Boolean(T),mount(t){S=!0,T=H.current=t,H.projection&&H.projection.mount(t),W&&d&&!z&&(k=null==d?void 0:d.addVariantChild(H)),V.forEach((t,e)=>I(e,t)),ni.current||oi(),H.shouldReduceMotion="never"!==b&&("always"===b||ei.current),null==d||d.children.add(H),H.setProps(h)},unmount(){var t;null===(t=H.projection)||void 0===t||t.unmount(),kn.update(F),kn.render(D),M.forEach(t=>t()),null==k||k(),null==d||d.children.delete(H),C.clearAllListeners(),T=void 0,S=!1},loadFeatures(t,n,o,r,i,s){const a=[];for(let n=0;n<si;n++){const o=ii[n],{isEnabled:r,Component:i}=w[o];r(t)&&i&&a.push(e.createElement(i,{key:o,...t,visualElement:H}))}if(!H.projection&&i){H.projection=new i(r,H.getLatestValues(),d&&d.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;H.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&f(a),visualElement:H,scheduleRender:()=>H.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a},addVariantChild(t){var e;const n=H.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(H.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>W?H:null==d?void 0:d.getClosestVariantNode(),getLayoutId:()=>h.layoutId,getInstance:()=>T,getStaticValue:t=>A[t],setStaticValue:(t,e)=>A[t]=e,getLatestValues:()=>A,setVisibility(t){H.isVisible!==t&&(H.isVisible=t,H.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>r(H,t,h,e),measureViewportBox:()=>i(T,h),addValue(t,e){H.hasValue(t)&&H.removeValue(t),V.set(t,e),A[t]=e.get(),I(t,e)},removeValue(t){var e;V.delete(t),null===(e=M.get(t))||void 0===e||e(),M.delete(t),delete A[t],l(t,P)},hasValue:t=>V.has(t),getValue(t,e){if(h.values&&h.values[t])return h.values[t];let n=V.get(t);return void 0===n&&void 0!==e&&(n=Wo(e),H.addValue(t,n)),n},forEachValue:t=>V.forEach(t),readValue:t=>void 0!==A[t]?A[t]:a(T,t,E),setBaseTarget(t,e){L[t]=e},getBaseTarget(t){var e;const{initial:n}=h,r="string"==typeof n||"object"==typeof n?null===(e=_t(h,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;if(o){const e=o(h,t);if(void 0!==e&&!N(e))return e}return void 0!==O[t]&&void 0===r?void 0:L[t]},...C,build:()=>(j(),P),scheduleRender(){On.render(D,!1,!0)},syncRender:D,setProps(t){(t.transformTemplate||h.transformTemplate)&&H.scheduleRender(),h=t,C.updatePropListeners(t),R=function(t,e,n){const{willChange:o}=e;for(const r in e){const i=e[r],s=n[r];if(N(i))t.addValue(r,i),er(o)&&o.add(r);else if(N(s))t.addValue(r,Wo(i)),er(o)&&o.remove(r);else if(s!==i)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,Wo(void 0!==e?e:i))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(H,c(h),R)},getProps:()=>h,getVariant:t=>{var e;return null===(e=h.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>h.transition,getTransformPagePoint:()=>h.transformPagePoint,getVariantContext(t=!1){if(t)return null==d?void 0:d.getVariantContext();if(!z){const t=(null==d?void 0:d.getVariantContext())||{};return void 0!==h.initial&&(t.initial=h.initial),t}const e={};for(let t=0;t<ui;t++){const n=li[t],o=h[n];(p(o)||!1===o)&&(e[n]=o)}return e}};return H},li=["initial",...ar],ui=li.length;function ci(t){return"string"==typeof t&&t.startsWith("var(--")}const di=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function hi(t,e,n=1){const[o,r]=function(t){const e=di.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const i=window.getComputedStyle(e).getPropertyValue(o);return i?i.trim():ci(r)?hi(r,e,n+1):r}const fi=new Set(["width","height","top","left","right","bottom","x","y"]),pi=t=>fi.has(t),mi=(t,e)=>{t.set(e,!1),t.set(e)},gi=t=>t===Q||t===it;var vi;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(vi||(vi={}));const yi=(t,e)=>parseFloat(t.split(", ")[e]),xi=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/);if(r)return yi(r[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?yi(e[1],t):0}},bi=new Set(["x","y","z"]),Ei=B.filter(t=>!bi.has(t));const wi={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:xi(4,13),y:xi(5,14)},Si=(t,e,n={},o={})=>{e={...e},o={...o};const r=Object.keys(e).filter(pi);let i=[],s=!1;const a=[];if(r.forEach(r=>{const l=t.getValue(r);if(!t.hasValue(r))return;let u=n[r],c=Yo(u);const d=e[r];let h;if(Jt(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=Yo(u);for(let n=e;n<t;n++)h?Yo(d[n]):h=Yo(d[n])}else h=Yo(d);if(c!==h)if(gi(c)&&gi(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[r]=parseFloat(d):Array.isArray(d)&&h===it&&(e[r]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[r]=c.transform(d):(s||(i=function(t){const e=[];return Ei.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),s=!0),a.push(r),o[r]=void 0!==o[r]?o[r]:e[r],mi(l,d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((t,e,n)=>{const o=e.measureViewportBox(),r=e.getInstance(),i=getComputedStyle(r),{display:s}=i,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=wi[t](o,i)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);mi(o,a[n]),t[n]=wi[n](l,i)}),t})(e,t,a);return i.length&&i.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),c&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:o}}return{target:e,transitionEnd:o}};function Ai(t,e,n,o){return(t=>Object.keys(t).some(pi))(e)?Si(t,e,n,o):{target:e,transitionEnd:o}}const Pi=(t,e,n,o)=>{const r=function(t,{...e},n){const o=t.getInstance();if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!ci(e))return;const n=hi(e,o);n&&t.set(n)});for(const t in e){const r=e[t];if(!ci(r))continue;const i=hi(r,o);i&&(e[t]=i,n&&void 0===n[t]&&(n[t]=r))}return{target:e,transitionEnd:n}}(t,e,o);return Ai(t,e=r.target,n,o=r.transitionEnd)};const Ti={treeType:"dom",readValueFromInstance(t,e){if(U.has(e)){const t=To(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),r=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof r?r.trim():r}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>Kr(t,e),resetTransform(t,e,n){const{transformTemplate:o}=n;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...o},{transformValues:r},i=!0){let s=tr(o,e||{},t);if(r&&(n&&(n=r(n)),o&&(o=r(o)),s&&(s=r(s))),i){Jo(t,o,s);const e=Pi(t,o,s,n);n=e.transitionEnd,o=e.target}return{transition:e,transitionEnd:n,...o}},scrapeMotionValuesFromProps:Zt,build(t,e,n,o,r){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),Vt(e,n,o,r.transformTemplate)},render:Xt},Ci=ai(Ti),Vi=ai({...Ti,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=To(e))||void 0===n?void 0:n.default)||0:(e=Gt.has(e)?e:Yt(e),t.getAttribute(e))},scrapeMotionValuesFromProps:Kt,build(t,e,n,o,r){Nt(e,n,o,r.transformTemplate)},render:qt}),Mi=(t,e)=>j(t)?Vi(e,{enableHardwareAcceleration:!1}):Ci(e,{enableHardwareAcceleration:!0});function Ri(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Li={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!it.test(t))return t;t=parseFloat(t)}return`${Ri(t,e.target.x)}% ${Ri(t,e.target.y)}%`}},Oi={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,r=t.includes("var("),i=[];r&&(t=t.replace(di,t=>(i.push(t),"_$css")));const s=Et.parse(t);if(s.length>5)return o;const a=Et.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const d=Ue(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=d),"number"==typeof s[3+l]&&(s[3+l]/=d);let h=a(s);if(r){let t=0;h=h.replace("_$css",()=>{const e=i[t];return t++,e})}return h}};class ki extends r.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:r}=t;I(Di),r&&(e.group&&e.group.add(r),n&&n.register&&o&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),P.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:r}=this.props,i=n.projection;return i?(i.isPresent=r,o||t.layoutDependency!==e||void 0===e?i.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?i.promote():i.relegate()||On.postRender(()=>{var t;(null===(t=i.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:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Di={borderRadius:{...Li,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Li,borderTopRightRadius:Li,borderBottomLeftRadius:Li,borderBottomRightRadius:Li,boxShadow:Oi},ji={measureLayout:function(t){const[n,o]=fo(),i=e.useContext(C);return r.default.createElement(ki,{...t,layoutGroup:i,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function Fi(t,e,n={}){const o=N(t)?t:Wo(t);return Fo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Ii=["TopLeft","TopRight","BottomLeft","BottomRight"],Bi=Ii.length,Ui=t=>"string"==typeof t?parseFloat(t):t,zi=t=>"number"==typeof t||it.test(t);function Ni(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Wi=$i(0,.5,fn),Hi=$i(.5,.95,an);function $i(t,e,n){return o=>o<t?0:o>e?1:n(Be(t,e,o))}function Yi(t,e){t.min=e.min,t.max=e.max}function Xi(t,e){Yi(t.x,e.x),Yi(t.y,e.y)}function Gi(t,e,n,o,r){return t=Nr(t-=e,1/n,o),void 0!==r&&(t=Nr(t,1/r,o)),t}function qi(t,e,[n,o,r],i,s){!function(t,e=0,n=1,o=.5,r,i=t,s=t){if(rt.test(e)){e=parseFloat(e);e=Ue(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ue(i.min,i.max,o);t===i&&(a-=e),t.min=Gi(t.min,e,n,a,r),t.max=Gi(t.max,e,n,a,r)}(t,e[n],e[o],e[r],e.scale,i,s)}const Zi=["x","scaleX","originX"],Ki=["y","scaleY","originY"];function _i(t,e,n,o){qi(t.x,e,Zi,null==n?void 0:n.x,null==o?void 0:o.x),qi(t.y,e,Ki,null==n?void 0:n.y,null==o?void 0:o.y)}function Ji(t){return 0===t.translate&&1===t.scale}function Qi(t){return Ji(t.x)&&Ji(t.y)}function ts(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 es(t){return Er(t.x)/Er(t.y)}class ns{constructor(){this.members=[]}add(t){Bo(this.members,t),t.scheduleRender()}remove(t){if(Uo(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 o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,r,i;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(i=null===(o=t.resumingFrom)||void 0===o?void 0:(r=o.options).onExitComplete)||void 0===i||i.call(r)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function os(t,e,n){let o=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(o+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:r}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),r&&(o+=`rotateY(${r}deg) `)}return o+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===o?"none":o}const rs=(t,e)=>t.depth-e.depth;class is{constructor(){this.children=[],this.isDirty=!1}add(t){Bo(this.children,t),this.isDirty=!0}remove(t){Uo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(rs),this.isDirty=!1,this.children.forEach(t)}}const ss=["","X","Y","Z"];function as({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!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(ps),this.nodes.forEach(ms)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.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 is)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new zo),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 o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:r,layout:i,visualElement:s}=this.options;if(s&&!s.getInstance()&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(i||r)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Mo(o,250),P.hasAnimatedSinceResize&&(P.hasAnimatedSinceResize=!1,this.nodes.forEach(fs))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var r,i,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(i=null!==(r=this.options.transition)&&void 0!==r?r:s.getDefaultTransition())&&void 0!==i?i:Es,{onLayoutAnimationStart:d,onLayoutAnimationComplete:h}=s.getProps(),f=!this.targetLayout||!ts(this.targetLayout,o)||n,p=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||p||e&&(f||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,p);const e={...jo(c,"layout"),onPlay:d,onComplete:h};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||fs(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}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,kn.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(gs))}willUpdate(t=!0){var e,n,o;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()}const{layoutId:r,layout:i}=this.options;if(void 0===r&&!i)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ds);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(ws),this.potentialNodes.clear()),this.nodes.forEach(hs),this.nodes.forEach(ls),this.nodes.forEach(us),this.clearAllSnapshots(),Dn.update(),Dn.preRender(),Dn.render())}clearAllSnapshots(){this.nodes.forEach(cs),this.sharedNodes.forEach(vs)}scheduleUpdateProjection(){On.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){On.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));As(e),this.snapshot={measured:t,layout:e,latestValues:{}}}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.measure();As(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=o(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!r)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Qi(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,i=null==o?void 0:o(this.latestValues,""),s=i!==this.prevTransformTemplateValue;e&&(n||Br(this.latestValues)||s)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(){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&&(Yr(e.x,n.x),Yr(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Xi(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:r,options:i,isScrollRoot:s}=o;if(o!==this.root&&r&&i.layoutScroll){if(s){Xi(e,t);const{scroll:n}=this.root;n&&(Yr(e.x,-n.x),Yr(e.y,-n.y))}Yr(e.x,r.x),Yr(e.y,r.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Xi(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Zr(n,{x:-o.scroll.x,y:-o.scroll.y}),Br(o.latestValues)&&Zr(n,o.latestValues)}return Br(this.latestValues)&&Zr(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Xi(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Br(o.latestValues))continue;Ir(o.latestValues)&&o.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Xi(r,o.measure()),_i(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layout,r)}return Br(this.latestValues)&&_i(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,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{layout:e,layoutId:n}=this.options;var o,r,i;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Cr(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Xi(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(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,r=this.relativeTarget,i=this.relativeParent.target,Pr(o.x,r.x,i.x),Pr(o.y,r.y,i.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Xi(this.target,this.layout.actual),$r(this.target,this.targetDelta)):Xi(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Cr(this.relativeTargetOrigin,this.target,this.relativeParent.target),Xi(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Ir(this.parent.latestValues)&&!Ur(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=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||!e&&!n)return;const o=this.getLead();Xi(this.layoutCorrected,this.layout.actual),function(t,e,n,o=!1){var r,i;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(i=null===(r=a.instance)||void 0===r?void 0:r.style)||void 0===i?void 0:i.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Zr(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,$r(t,l)),o&&Br(a.latestValues)&&Zr(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:r}=o;if(!r)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const i=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;Ar(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=os(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===i&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const o=this.snapshot,r=(null==o?void 0:o.latestValues)||{},i={...this.latestValues},s={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 a={x:{min:0,max:0},y:{min:0,max:0}},l=null==o?void 0:o.isShared,u=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(bs));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var d,h,f,p;ys(s.x,t.x,o),ys(s.y,t.y,o),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Cr(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,h=this.relativeTargetOrigin,f=a,p=o,xs(d.x,h.x,f.x,p),xs(d.y,h.y,f.y,p)),l&&(this.animationValues=i,function(t,e,n,o,r,i){var s,a,l,u;r?(t.opacity=Ue(0,null!==(s=n.opacity)&&void 0!==s?s:1,Wi(o)),t.opacityExit=Ue(null!==(a=e.opacity)&&void 0!==a?a:1,0,Hi(o))):i&&(t.opacity=Ue(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let r=0;r<Bi;r++){const i=`border${Ii[r]}Radius`;let s=Ni(e,i),a=Ni(n,i);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||zi(s)===zi(a)?(t[i]=Math.max(Ue(Ui(s),Ui(a),o),0),(rt.test(a)||rt.test(s))&&(t[i]+="%")):t[i]=a}(e.rotate||n.rotate)&&(t.rotate=Ue(e.rotate||0,n.rotate||0,o))}(i,r,this.latestValues,o,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},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&&(kn.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=On.update(()=>{P.hasAnimatedSinceResize=!0,this.currentAnimation=Fi(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:o,latestValues:r}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&Ps(this.options.animationType,this.layout.actual,o.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Er(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=Er(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Xi(e,n),Zr(e,r),Ar(this.projectionDeltaWithTransform,this.layoutCorrected,e,r)}}registerSharedNode(t,e){var n,o,r;this.sharedNodes.has(t)||this.sharedNodes.set(t,new ns);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(r=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===r?void 0:r.call(o,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 o=this.getStack();o&&o.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 n={};for(let o=0;o<ss.length;o++){const r="rotate"+ss[o];t.getStaticValue(r)&&(e=!0,n[r]=t.getStaticValue(r),t.setStaticValue(r,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,o;const r={};if(!this.instance||this.isSVG)return r;if(!this.isVisible)return{visibility:"hidden"};r.visibility="";const i=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=te(t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=te(t.pointerEvents)||""),this.hasProjected&&!Br(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),r.transform=os(this.projectionDeltaWithTransform,this.treeScale,a),i&&(r.transform=i(a,r.transform));const{x:l,y:u}=this.projectionDelta;r.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?r.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:r.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in F){if(void 0===a[t])continue;const{correct:e,applyTo:n}=F[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=o}else r[t]=o}return this.options.layoutId&&(r.pointerEvents=s===this?te(t.pointerEvents)||"":"none"),r}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(ds),this.root.sharedNodes.clear()}}}function ls(t){t.updateLayout()}function us(t){var e,n,o;const r=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:o}=t.options;"size"===o?Dr(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=Er(n);n.min=e[t].min,n.max=n.min+o}):Ps(o,r.layout,e)&&Dr(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=Er(e[t]);n.max=n.min+o});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ar(i,e,r.layout);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r.isShared?Ar(s,t.applyTransform(n,!0),r.measured):Ar(s,e,r.layout);const a=!Qi(i);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:o}=t.relativeParent;if(n&&o){const t={x:{min:0,max:0},y:{min:0,max:0}};Cr(t,r.layout,n.layout);const i={x:{min:0,max:0},y:{min:0,max:0}};Cr(i,e,o.actual),ts(t,i)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function cs(t){t.clearSnapshot()}function ds(t){t.clearMeasurements()}function hs(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function fs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ps(t){t.resolveTargetDelta()}function ms(t){t.calcProjection()}function gs(t){t.resetRotation()}function vs(t){t.removeLeadSnapshot()}function ys(t,e,n){t.translate=Ue(e.translate,0,n),t.scale=Ue(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function xs(t,e,n,o){t.min=Ue(e.min,n.min,o),t.max=Ue(e.max,n.max,o)}function bs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Es={duration:.45,ease:[.4,0,.1,1]};function ws(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 o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function Ss(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function As(t){Ss(t.x),Ss(t.y)}function Ps(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Xn(t,e)<=n}(es(e),es(n),.2)}const Ts=as({attachResizeListener:(t,e)=>ae(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cs={current:void 0},Vs=as({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cs.current){const t=new Ts(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Cs.current=t}return Cs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ms={...fr,...ho,...ti,...ji},Rs=k((t,e)=>ie(t,e,Ms,Mi,Vs));const Ls=k(ie);function Os(){const t=e.useRef(!1);return d(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function ks(){const t=Os(),[n,o]=e.useState(0),r=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>On.postRender(r),[r]),n]}class Ds extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function js({children:t,isPresent:n}){const o=e.useId(),r=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:a}=s.current;if(n||!r.current||!t||!e)return;r.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${i}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),i.createElement(Ds,{isPresent:n,childRef:r,sizeRef:s},i.cloneElement(t,{ref:r}))}const Fs=({children:t,initial:n,isPresent:o,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=A(Is),d=e.useId(),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;r&&r()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),i.useEffect(()=>{!o&&!c.size&&r&&r()},[o]),"popLayout"===l&&(t=i.createElement(js,{isPresent:o},t)),i.createElement(u.Provider,{value:h},t)};function Is(){return new Map}const Bs=t=>t.key||"";const Us=e.createContext(null),zs=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ns(){const t=new Set,e=new WeakMap,n=()=>t.forEach(zs);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var r;t.delete(o),null===(r=e.get(o))||void 0===r||r(),e.delete(o),n()},dirty:n}}const Ws=t=>!0===t,Hs=({children:t,id:n,inheritId:o,inherit:r=!0})=>{void 0!==o&&(r=o);const s=e.useContext(C),a=e.useContext(Us),[l,u]=ks(),c=e.useRef(null),d=s.id||a;null===c.current&&((t=>Ws(!0===t)||"id"===t)(r)&&d&&(n=n?d+"-"+n:d),c.current={id:n,group:Ws(r)&&s.group||Ns()});const h=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return i.createElement(C.Provider,{value:h},t)};let $s=0;function Ys(t){return"function"==typeof t}const Xs=e.createContext(null);const Gs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:r,values:s,...a},l){const u=A(()=>Rs(n)),c=[],d=e.useRef(!1),h={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Zs))},updateOrder:(t,e,n)=>{if(d.current)return;const o=function(t,e,n,o){if(!o)return t;const r=t.findIndex(t=>t.value===e);if(-1===r)return t;const i=o>0?1:-1,s=t[r+i];if(!s)return t;const a=t[r],l=s.layout,u=Ue(l.min,l.max,.5);return 1===i&&a.layout.max+n>u||-1===i&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[r]=t.splice(e,1);t.splice(o,0,r)}return t}(t,r,r+i):t}(c,t,e,n);c!==o&&(d.current=!0,r(o.map(qs).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{d.current=!1}),i.createElement(u,{...a,ref:l},i.createElement(Xs.Provider,{value:h},t))}));function qs(t){return t.value}function Zs(t,e){return t.layout.min-e.layout.min}function Ks(t){const n=A(()=>Wo(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function _s(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],r=t[1+n],i=t[2+n],s=t[3+n],a=nn(r,i,{mixer:(l=i[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function Js(t,e){const n=Ks(e()),o=()=>n.set(e());return o(),function(t,e,n){d(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>On.update(o,!1,!0),()=>kn.update(o)),n}function Qs(t,e,n,o){const r="function"==typeof e?e:_s(e,n,o);return Array.isArray(t)?ta(t,r):ta([t],([t])=>r(t))}function ta(t,e){const n=A(()=>[]);return Js(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function ea(t,e=0){return N(t)?t:Ks(e)}const na={Group:Gs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:r="li",onDrag:s,layout:a=!0,...l},u){const c=A(()=>Rs(r)),d=e.useContext(Xs),h={x:ea(n.x),y:ea(n.y)},f=Qs([h.x,h.y],([t,e])=>t||e?1:"unset"),p=e.useRef(null),{axis:m,registerItem:g,updateOrder:v}=d;return e.useEffect(()=>{g(o,p.current)},[d]),i.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:h.x,y:h.y,zIndex:f},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&v(o,h[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{p.current=t},ref:u},t)}))},oa={renderer:Mi,...fr,...ho},ra={...oa,...ti,...ji,projectionNodeConstructor:Vs};const ia=t=>"number"==typeof t;function sa(t,e){return(t=>Array.isArray(t)&&!ia(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const aa=(t,e,n)=>-n*t+n*e+t,la=t=>t,ua=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ca(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const r=ua(0,e,o);t.push(aa(n,1,r))}}function da(t){const e=[0];return ca(e,t-1),e}function ha(t,e=da(t.length),n=la){const o=t.length,r=o-e.length;return r>0&&ca(e,r),r=>{let i=0;for(;i<o-2&&!(r<e[i+1]);i++);let s=(a=0,l=1,u=ua(e[i],e[i+1],r),Math.min(Math.max(u,a),l));var a,l,u;return s=sa(n,i)(s),aa(t[i],t[i+1],s)}}const fa=t=>"function"==typeof t,pa=t=>"string"==typeof t;function ma(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const ga={any:0,all:1};const va=new WeakMap;let ya;function xa({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=va.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ba(t){t.forEach(xa)}function Ea(t,e){ya||"undefined"!=typeof ResizeObserver&&(ya=new ResizeObserver(ba));const n=ma(t);return n.forEach(t=>{let n=va.get(t);n||(n=new Set,va.set(t,n)),n.add(e),null==ya||ya.observe(t)}),()=>{n.forEach(t=>{const n=va.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==ya||ya.unobserve(t)})}}const wa=new Set;let Sa;function Aa(t){return wa.add(t),Sa||(Sa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};wa.forEach(t=>t(e))},window.addEventListener("resize",Sa)),()=>{wa.delete(t),!wa.size&&Sa&&(Sa=void 0)}}const Pa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Ta(t,e,n,o){const r=n[e],{length:i,position:s}=Pa[e],a=r.current,l=n.time;r.current=t["scroll"+s],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=ua(0,r.scrollLength,r.current);const u=o-l;var c,d;r.velocity=u>50?0:(c=r.current-a,(d=u)?c*(1e3/d):0)}const Ca={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Va={start:0,center:.5,end:1};function Ma(t,e,n=0){let o=0;if(void 0!==Va[t]&&(t=Va[t]),pa(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return ia(t)&&(o=e*t),n+o}const Ra=[0,0];function La(t,e,n,o){let r=Array.isArray(t)?t:Ra,i=0,s=0;return ia(t)?r=[t,t]:pa(t)&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Va[t]?t:"0"]),i=Ma(r[0],n,o),s=Ma(r[1],e),i-s}const Oa={x:0,y:0};function ka(t,e,n){let{offset:o=Ca.All}=n;const{target:r=t,axis:i="y"}=n,s="y"===i?"height":"width",a=r!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(r,t):Oa,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:r.clientWidth,height:r.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const d=o.length;for(let t=0;t<d;t++){const n=La(o[t],u[s],l[s],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=ha(da(d),e[i].offset),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function Da(t,e,n,o={}){const r=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){Ta(t,"x",e,n),Ta(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&ka(t,n,o)},notify:fa(e)?()=>e(n):ja(e,n[r])}}function ja(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=la),t.updateDuration(1);else{const r={duration:1e3};e||(r.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,r)}}),()=>{t.currentTime=e.progress}}const Fa=new WeakMap,Ia=new WeakMap,Ba=new WeakMap,Ua=t=>t===document.documentElement?window:t;function za(t,e={}){var{container:n=document.documentElement}=e,o=Me(e,["container"]);let r=Ba.get(n);r||(r=new Set,Ba.set(n,r));const i=Da(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(r.add(i),!Fa.has(n)){const t=()=>{const t=performance.now();for(const t of r)t.measure();for(const e of r)e.update(t);for(const t of r)t.notify()};Fa.set(n,t);const e=Ua(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Ia.set(n,function(t,e){return fa(t)?Aa(t):Ea(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Fa.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=Ba.get(n);if(!o)return;if(o.delete(i),o.size)return;const r=Fa.get(n);Fa.delete(n),r&&(Ua(n).removeEventListener("scroll",r),null===(e=Ia.get(n))||void 0===e||e(),window.removeEventListener("resize",r))}}const Na=()=>({scrollX:Wo(0),scrollY:Wo(0),scrollXProgress:Wo(0),scrollYProgress:Wo(0)});function Wa({container:t,target:n,layoutEffect:o=!0,...r}={}){const i=A(Na);return(o?d:e.useEffect)(()=>za(({x:t,y:e})=>{i.scrollX.set(t.current),i.scrollXProgress.set(t.progress),i.scrollY.set(e.current),i.scrollYProgress.set(e.progress)},{...r,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),i}function Ha(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return On.update(e,!0),()=>kn.update(e)},[t])}class $a extends No{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Yt(t)),e&&(Bo(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Uo(this.members,"transform")):Uo(this.members,Yt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Ya(){!ni.current&&oi();const[t]=e.useState(ei.current);return t}function Xa(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,r){if(t){const t=[];return n.forEach(e=>{t.push(nr(e,o,{transitionOverride:r}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,r],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?_o(t,e):"string"==typeof e?_o(t,[e]):Ko(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.forEachValue(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function Ga(){const t=A(Xa);return e.useEffect(t.mount,[]),t}const qa=Ga;class Za{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}}const Ka=()=>new Za;function _a(t){return null!==t&&"object"==typeof t&&R in t}function Ja(){return Qa}function Qa(t){Cs.current&&(Cs.current.isUpdating=!1,Cs.current.blockUpdate(),t&&t())}const tl=()=>({}),el=ai({build(){},measureViewportBox:kr,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:tl,readValueFromInstance:(t,e,n)=>n.initialState[e]||0,makeTargetAnimatable:(t,{transition:e,transitionEnd:n,...o})=>(Jo(t,o,tr(o,e||{},t)),{transition:e,transitionEnd:n,...o})}),nl=ee({scrapeMotionValuesFromProps:tl,createRenderState:tl});const ol=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:r,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",eo(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=ks();const c=e.useContext(C).forceRender;c&&(u=c);const h=Os(),f=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let p=f;const m=new Set,g=e.useRef(p),v=e.useRef(new Map).current,y=e.useRef(!0);if(d(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Bs(t);e.set(n,t)})}(f,v),g.current=p}),Ve(()=>{y.current=!0,v.clear(),m.clear()}),y.current)return i.createElement(i.Fragment,null,p.map(t=>i.createElement(Fs,{key:Bs(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));p=[...p];const x=g.current.map(Bs),b=f.map(Bs),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(p=[]),m.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);p.splice(o,0,i.createElement(Fs,{key:Bs(e),isPresent:!1,onExitComplete:()=>{v.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=f,!1===h.current)return;u(),r&&r()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),p=p.map(t=>{const e=t.key;return m.has(e)?t:i.createElement(Fs,{key:Bs(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==Qn&&"wait"===l&&p.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),i.createElement(i.Fragment,null,m.size?p:p.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),i.createElement(Hs,{id:A(()=>"asl-"+$s++)},t)),t.DeprecatedLayoutGroupContext=Us,t.DragControls=Za,t.FlatTree=is,t.LayoutGroup=Hs,t.LayoutGroupContext=C,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,r]=e.useState(!Ys(n)),s=e.useRef(void 0);if(!Ys(n)){const{renderer:t,...e}=n;s.current=t,S(e)}return e.useEffect(()=>{Ys(n)&&n().then(({renderer:t,...e})=>{S(e),s.current=t,r(!0)})},[]),i.createElement(h.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&Ft(n),(o={...e.useContext(s),...o}).isStatic=A(()=>o.isStatic);const r=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return i.createElement(s.Provider,{value:r},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=No,t.PresenceContext=u,t.Reorder=na,t.SwitchLayoutGroupContext=M,t.addPointerEvent=xe,t.addScaleCorrector=I,t.animate=Fi,t.animateVisualElement=nr,t.animationControls=Xa,t.animations=fr,t.buildTransform=$,t.calcLength=Er,t.checkTargetForNewValues=Jo,t.createBox=kr,t.createDomMotionComponent=function(t){return L(ie(t,{forwardMotionProps:!1},Ms,Mi,Vs))},t.createMotionComponent=L,t.delay=Mo,t.domAnimation=oa,t.domMax=ra,t.filterProps=It,t.isBrowser=c,t.isDragActive=Pe,t.isMotionComponent=_a,t.isMotionValue=N,t.isValidMotionProp=Dt,t.m=Ls,t.makeUseVisualState=ee,t.motion=Rs,t.motionValue=Wo,t.resolveMotionValue=te,t.transform=_s,t.unwrapMotionComponent=function(t){if(_a(t))return t[R]},t.useAnimation=qa,t.useAnimationControls=Ga,t.useAnimationFrame=Ha,t.useCycle=function(...t){const n=e.useRef(0),[o,r]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,n.current+1):e,r(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),r=nl({},!1),i=A(()=>el({props:{},visualState:r},{initialState:t}));return e.useEffect(()=>(i.mount({}),i.unmount),[i]),e.useEffect(()=>{i.setProps({onUpdate:t=>{o({...t})}})},[o,i]),[n,A(()=>t=>nr(i,t))]},t.useDeprecatedInvertedScale=function(t){let e=Ks(1),n=Ks(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Qs(e,ol),scaleY:Qs(n,ol)}},t.useDomEvent=le,t.useDragControls=function(){return A(Ka)},t.useElementScroll=function(t){return eo(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Wa({container:t})},t.useForceUpdate=ks,t.useInView=function(t,{root:n,margin:o,amount:r,once:i=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||i&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===r?"any":r};return function(t,e,{root:n,margin:o,amount:r="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const i=ma(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);fa(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof r?r:ga[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),i?void 0:()=>a(!1)),e)},[n,t,o,i]),s},t.useInstantLayoutTransition=Ja,t.useInstantTransition=function(){const[t,n]=ks(),o=Ja();return e.useEffect(()=>{On.postRender(()=>On.postRender(()=>Vo.current=!1))},[n]),e=>{o(()=>{Vo.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=d,t.useMotionTemplate=function(t,...e){const n=t.length;return Js(e,(function(){let o="";for(let r=0;r<n;r++){o+=t[r];e[r]&&(o+=e[r].get())}return o}))},t.useMotionValue=Ks,t.usePresence=fo,t.useReducedMotion=Ya,t.useReducedMotionConfig=function(){const t=Ya(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return i.useCallback(()=>{const t=Cs.current;t&&t.resetTree()},[])},t.useScroll=Wa,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),r=e.useRef(null),i=Ks(N(t)?t.get():t);return e.useMemo(()=>i.attach((t,e)=>o?e(t):(r.current&&r.current.stop(),r.current=Nn({from:i.get(),to:t,velocity:i.getVelocity(),...n,onUpdate:e}),i.get())),[JSON.stringify(n)]),function(t,e){d(()=>{if(N(t))return t.onChange(e)},[e])}(t,t=>i.set(parseFloat(t))),i},t.useTime=function(){const t=Ks(0);return Ha(e=>t.set(e)),t},t.useTransform=Qs,t.useUnmountEffect=Ve,t.useVelocity=function(t){const n=Ks(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return eo(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Wa()},t.useVisualElementContext=l,t.useWillChange=function(){return A(()=>new $a("auto"))},t.visualElement=ai,t.wrapHandler=me,Object.defineProperty(t,"__esModule",{value:!0})}));
|