framer-motion 7.1.1 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +45 -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/es/value/use-will-change/index.mjs +50 -0
- package/dist/framer-motion.dev.js +45 -2
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +9 -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/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 i=o(e),r=n(e);const s=("undefined"==typeof process||process.env,"production"),a=t=>({isEnabled:e=>t.some(t=>!!e[t])}),l={measureLayout:a(["layout","layoutId","drag"]),animation:a(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:a(["exit"]),drag:a(["drag","dragControls"]),focus:a(["whileFocus"]),hover:a(["whileHover","onHoverStart","onHoverEnd"]),tap:a(["whileTap","onTap","onTapStart","onTapCancel"]),pan:a(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:a(["whileInView","onViewportEnter","onViewportLeave"])};function u(t){for(const e in t)null!==t[e]&&("projectionNodeConstructor"===e?l.projectionNodeConstructor=t[e]:l[e].Component=t[e])}const c=e.createContext({strict:!1}),d=Object.keys(l),h=d.length;const f=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),p=e.createContext({});function m(){return e.useContext(p).visualElement}const g=e.createContext(null),v="undefined"!=typeof document,y=v?e.useLayoutEffect:e.useEffect,x={current:null};let b=!1;function E(){!b&&function(){if(b=!0,v)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>x.current=t.matches;t.addListener(e),e()}else x.current=!1}();const[t]=e.useState(x.current);return t}function w(){const t=E(),{reducedMotion:n}=e.useContext(f);return"never"!==n&&("always"===n||t)}function A(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function S(t){return Array.isArray(t)}function P(t){return"string"==typeof t||S(t)}function T(t,e,n,o={},i={}){var r;return"function"==typeof e&&(e=e(null!=n?n:t.custom,o,i)),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e&&(e=e(null!=n?n:t.custom,o,i)),e}function O(t,e,n){const o=t.getProps();return T(o,e,null!=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 j(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||P(t.initial)||P(t.animate)||P(t.whileHover)||P(t.whileDrag)||P(t.whileTap)||P(t.whileFocus)||P(t.exit)}function V(t){return Boolean(j(t)||t.variants)}function C(t){const{initial:n,animate:o}=function(t,e){if(j(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(p));return e.useMemo(()=>({initial:n,animate:o}),[M(n),M(o)])}function M(t){return Array.isArray(t)?t.join(" "):t}function R(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const L={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let k=1;const D=e.createContext({}),F=e.createContext({});class I extends r.default.Component{getSnapshotBeforeUpdate(){return this.updateProps(),null}componentDidUpdate(){}updateProps(){const{visualElement:t,props:e}=this.props;t&&t.setProps(e)}render(){return this.props.children}}function B({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:r,useVisualState:a,Component:x}){return t&&u(t),e.forwardRef((function(u,b){const E=function({layoutId:t}){var n;const o=null===(n=e.useContext(D))||void 0===n?void 0:n.id;return o&&void 0!==t?o+"-"+t:t}(u);u=Object.assign(Object.assign({},u),{layoutId:E});const S=e.useContext(f);let P=null;const T=C(u),O=S.isStatic?void 0:R(()=>{if(L.hasEverUpdated)return k++}),j=a(u,S.isStatic);return!S.isStatic&&v&&(T.visualElement=function(t,n,o,i){const r=e.useContext(c),s=m(),a=e.useContext(g),l=w(),u=e.useRef(void 0);i||(i=r.renderer),!u.current&&i&&(u.current=i(t,{visualState:n,parent:s,props:o,presenceId:null==a?void 0:a.id,blockInitialAnimation:!1===(null==a?void 0:a.initial),shouldReduceMotion:l}));const d=u.current;return y(()=>{null==d||d.syncRender()}),e.useEffect(()=>{var t;null===(t=null==d?void 0:d.animationState)||void 0===t||t.animateChanges()}),y(()=>()=>null==d?void 0:d.notifyUnmount(),[]),d}(x,j,Object.assign(Object.assign({},S),u),n),function(t,{layoutId:n,layout:o,drag:i,dragConstraints:r,layoutScroll:s},a,l){var u;const c=e.useContext(F);l&&a&&!(null==a?void 0:a.projection)&&(a.projection=new l(t,a.getLatestValues(),null===(u=a.parent)||void 0===u?void 0:u.projection),a.projection.setOptions({layoutId:n,layout:o,alwaysMeasureLayout:Boolean(i)||r&&A(r),visualElement:a,scheduleRender:()=>a.scheduleRender(),animationType:"string"==typeof o?o:"both",initialPromotionConfig:c,layoutScroll:s}))}(O,u,T.visualElement,o||l.projectionNodeConstructor),P=function(t,n,o){const r=[],a=e.useContext(c);if(!n)return null;"production"!==s&&o&&a.strict;for(let e=0;e<h;e++){const o=d[e],{isEnabled:s,Component:a}=l[o];s(t)&&a&&r.push(i.createElement(a,Object.assign({key:o},t,{visualElement:n})))}return r}(u,T.visualElement,t)),i.createElement(I,{visualElement:T.visualElement,props:Object.assign(Object.assign({},S),u)},P,i.createElement(p.Provider,{value:T},r(x,u,O,function(t,n,o){return e.useCallback(e=>{var i;e&&(null===(i=t.mount)||void 0===i||i.call(t,e)),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):A(o)&&(o.current=e))},[n])}(j,T.visualElement,b),j,S.isStatic,T.visualElement)))}))}function U(t){function e(e,n={}){return B(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 z=["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 N(t){return"string"==typeof t&&!t.includes("-")&&!!(z.indexOf(t)>-1||/[A-Z]/.test(t))}const W={};function H(t){Object.assign(W,t)}const $=["","X","Y","Z"],Y=["transformPerspective","x","y","z"];function X(t,e){return Y.indexOf(t)-Y.indexOf(e)}["translate","scale","rotate","skew"].forEach(t=>$.forEach(e=>Y.push(t+e)));const G=new Set(Y);function q(t){return G.has(t)}const Z=new Set(["originX","originY","originZ"]);function K(t){return Z.has(t)}function _(t,{layout:e,layoutId:n}){return q(t)||K(t)||(e||void 0!==n)&&(!!W[t]||"opacity"===t)}const J=t=>Boolean(null!==t&&"object"==typeof t&&t.getVelocity),Q={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function tt(t){return t.startsWith("--")}const et=(t,e)=>e&&"number"==typeof t?e.transform(t):t,nt=(t,e)=>n=>Math.max(Math.min(n,e),t),ot=t=>t%1?Number(t.toFixed(5)):t,it=/(-)?([\d]*\.?[\d])+/g,rt=/(#[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,st=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function at(t){return"string"==typeof t}const lt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ut=Object.assign(Object.assign({},lt),{transform:nt(0,1)}),ct=Object.assign(Object.assign({},lt),{default:1}),dt=t=>({test:e=>at(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ht=dt("deg"),ft=dt("%"),pt=dt("px"),mt=dt("vh"),gt=dt("vw"),vt=Object.assign(Object.assign({},ft),{parse:t=>ft.parse(t)/100,transform:t=>ft.transform(100*t)}),yt=(t,e)=>n=>Boolean(at(n)&&st.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),xt=(t,e,n)=>o=>{if(!at(o))return o;const[i,r,s,a]=o.match(it);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},bt={test:yt("hsl","hue"),parse:xt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+ft.transform(ot(e))+", "+ft.transform(ot(n))+", "+ot(ut.transform(o))+")"},Et=nt(0,255),wt=Object.assign(Object.assign({},lt),{transform:t=>Math.round(Et(t))}),At={test:yt("rgb","red"),parse:xt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+wt.transform(t)+", "+wt.transform(e)+", "+wt.transform(n)+", "+ot(ut.transform(o))+")"};const St={test:yt("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:At.transform},Pt={test:t=>At.test(t)||St.test(t)||bt.test(t),parse:t=>At.test(t)?At.parse(t):bt.test(t)?bt.parse(t):St.parse(t),transform:t=>at(t)?t:t.hasOwnProperty("red")?At.transform(t):bt.transform(t)};function Tt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(rt);o&&(n=o.length,t=t.replace(rt,"${c}"),e.push(...o.map(Pt.parse)));const i=t.match(it);return i&&(t=t.replace(it,"${n}"),e.push(...i.map(lt.parse))),{values:e,numColors:n,tokenised:t}}function Ot(t){return Tt(t).values}function jt(t){const{values:e,numColors:n,tokenised:o}=Tt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?Pt.transform(t[o]):ot(t[o]));return e}}const Vt=t=>"number"==typeof t?0:t;const Ct={test:function(t){var e,n,o,i;return isNaN(t)&&at(t)&&(null!==(n=null===(e=t.match(it))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(rt))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:Ot,createTransformer:jt,getAnimatableNone:function(t){const e=Ot(t);return jt(t)(e.map(Vt))}},Mt=new Set(["brightness","contrast","saturate","opacity"]);function Rt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(it)||[];if(!o)return t;const i=n.replace(o,"");let r=Mt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const Lt=/([a-z-]*)\(.*?\)/g,kt=Object.assign(Object.assign({},Ct),{getAnimatableNone:t=>{const e=t.match(Lt);return e?e.map(Rt).join(" "):t}}),Dt=Object.assign(Object.assign({},lt),{transform:Math.round}),Ft={borderWidth:pt,borderTopWidth:pt,borderRightWidth:pt,borderBottomWidth:pt,borderLeftWidth:pt,borderRadius:pt,radius:pt,borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomRightRadius:pt,borderBottomLeftRadius:pt,width:pt,maxWidth:pt,height:pt,maxHeight:pt,size:pt,top:pt,right:pt,bottom:pt,left:pt,padding:pt,paddingTop:pt,paddingRight:pt,paddingBottom:pt,paddingLeft:pt,margin:pt,marginTop:pt,marginRight:pt,marginBottom:pt,marginLeft:pt,rotate:ht,rotateX:ht,rotateY:ht,rotateZ:ht,scale:ct,scaleX:ct,scaleY:ct,scaleZ:ct,skew:ht,skewX:ht,skewY:ht,distance:pt,translateX:pt,translateY:pt,translateZ:pt,x:pt,y:pt,z:pt,perspective:pt,transformPerspective:pt,opacity:ut,originX:vt,originY:vt,originZ:pt,zIndex:Dt,fillOpacity:ut,strokeOpacity:ut,numOctaves:Dt};function It(t,e,n,o){var i;const{style:r,vars:s,transform:a,transformKeys:l,transformOrigin:u}=t;l.length=0;let c=!1,d=!1,h=!0;for(const t in e){const n=e[t];if(tt(t)){s[t]=n;continue}const o=Ft[t],f=et(n,o);if(q(t)){if(c=!0,a[t]=f,l.push(t),!h)continue;n!==(null!==(i=o.default)&&void 0!==i?i:0)&&(h=!1)}else K(t)?(u[t]=f,d=!0):r[t]=f}c?r.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(X);let a=!1;const l=e.length;for(let n=0;n<l;n++){const o=e[n];s+=`${Q[o]||o}(${t[o]}) `,"z"===o&&(a=!0)}return!a&&n&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}(t,n,h,o):o?r.transform=o({},""):!e.transform&&r.transform&&(r.transform="none"),d&&(r.transformOrigin=function({originX:t="50%",originY:e="50%",originZ:n=0}){return`${t} ${e} ${n}`}(u))}const Bt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Ut(t,e,n){for(const o in e)J(e[o])||_(o,n)||(t[o]=e[o])}function zt(t,n,o){let i={};return Ut(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};It(e,n,{enableHardwareAcceleration:!o},t);const{vars:i,style:r}=e;return Object.assign(Object.assign({},i),r)},[n])}(t,n,o)),t.transformValues&&(i=t.transformValues(i)),i}function Nt(t,e,n){const o={},i=zt(t,e,n);return Boolean(t.drag)&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const Wt=new Set(["initial","animate","exit","style","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","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function Ht(t){return Wt.has(t)}let $t=t=>!Ht(t);function Yt(t){t&&($t=e=>e.startsWith("on")?!Ht(e):t(e))}try{Yt(require("@emotion/is-prop-valid").default)}catch(t){}function Xt(t,e,n){const o={};for(const i in t)($t(i)||!0===n&&Ht(i)||!e&&!Ht(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function Gt(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 i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}function qt(t,e,n){return"string"==typeof t?t:pt.transform(e+n*t)}const Zt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Kt={offset:"strokeDashoffset",array:"strokeDasharray"};function _t(t,e,n,o){var{attrX:i,attrY:r,originX:s,originY:a,pathLength:l,pathSpacing:u=1,pathOffset:c=0}=e;It(t,Gt(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o),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!==s||void 0!==a||h.transform)&&(h.transformOrigin=function(t,e,n){return`${qt(e,t.x,t.width)} ${qt(n,t.y,t.height)}`}(f,void 0!==s?s:.5,void 0!==a?a:.5)),void 0!==i&&(d.x=i),void 0!==r&&(d.y=r),void 0!==l&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Zt:Kt;t[r.offset]=pt.transform(-o);const s=pt.transform(e),a=pt.transform(n);t[r.array]=`${s} ${a}`}(d,l,u,c,!1)}const Jt=()=>Object.assign(Object.assign({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}});function Qt(t,n){const o=e.useMemo(()=>{const e=Jt();return _t(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),Object.assign(Object.assign({},e.attrs),{style:Object.assign({},e.style)})},[n]);if(t.style){const e={};Ut(e,t.style,t),o.style=Object.assign(Object.assign({},e),o.style)}return o}function te(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(N(n)?Qt:Nt)(o,s,a),u=Xt(o,"string"==typeof n,t),c=Object.assign(Object.assign(Object.assign({},u),l),{ref:r});return i&&(c["data-projection-id"]=i),e.createElement(n,c)}}const ee=/([a-z])([A-Z])/g,ne=t=>t.replace(ee,"$1-$2").toLowerCase();function oe(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const ie=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function re(t,e,n,o){oe(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(ie.has(n)?n:ne(n),e.attrs[n])}function se(t){const{style:e}=t,n={};for(const o in e)(J(e[o])||_(o,t))&&(n[o]=e[o]);return n}function ae(t){const e=se(t);for(const n in t)if(J(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function le(t){return"object"==typeof t&&"function"==typeof t.start}const ue=t=>Array.isArray(t),ce=t=>ue(t)?t[t.length-1]||0:t;function de(t){const e=J(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}function he({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:pe(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}const fe=t=>(n,o)=>{const i=e.useContext(p),r=e.useContext(g);return o?he(t,n,i,r):R(()=>he(t,n,i,r))};function pe(t,e,n,o){const i={},r=!1===(null==n?void 0:n.initial),s=o(t);for(const t in s)i[t]=de(s[t]);let{initial:a,animate:l}=t;const u=j(t),c=V(t);e&&c&&!u&&!1!==t.inherit&&(null!=a||(a=e.initial),null!=l||(l=e.animate));const d=r||!1===a,h=d?l:a;if(h&&"boolean"!=typeof h&&!le(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=T(t,e);if(!n)return;const{transitionEnd:o,transition:r}=n,s=Gt(n,["transitionEnd","transition"]);for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[d?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const me={useVisualState:fe({scrapeMotionValuesFromProps:ae,createRenderState:Jt,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}}_t(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),re(e,n)}})},ge={useVisualState:fe({scrapeMotionValuesFromProps:se,createRenderState:Bt})};function ve(t,{forwardMotionProps:e=!1},n,o,i){const r=N(t)?me:ge;return Object.assign(Object.assign({},r),{preloadedFeatures:n,useRender:te(e),createVisualElement:o,projectionNodeConstructor:i,Component:t})}var ye;function xe(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function be(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return xe(e,n,o,i)},[t,n,o,i])}function Ee(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function we(t){return!!t.touches}t.AnimationType=void 0,(ye=t.AnimationType||(t.AnimationType={})).Animate="animate",ye.Hover="whileHover",ye.Tap="whileTap",ye.Drag="whileDrag",ye.Focus="whileFocus",ye.InView="whileInView",ye.Exit="exit";const Ae={pageX:0,pageY:0};function Se(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||Ae;return{x:n[e+"X"],y:n[e+"Y"]}}function Pe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function Te(t,e="page"){return{point:we(t)?Se(t,e):Pe(t,e)}}const Oe=(t,e=!1)=>{const n=e=>t(e,Te(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},je={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 Ce(t){return v&&null===window.onpointerdown?t:v&&null===window.ontouchstart?Ve[t]:v&&null===window.onmousedown?je[t]:t}function Me(t,e,n,o){return xe(t,Ce(e),Oe(n,"pointerdown"===e),o)}function Re(t,e,n,o){return be(t,Ce(e),n&&Oe(n,"pointerdown"===e),o)}function Le(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ke=Le("dragHorizontal"),De=Le("dragVertical");function Fe(t){let e=!1;if("y"===t)e=De();else if("x"===t)e=ke();else{const t=ke(),n=De();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ie(){const t=Fe(!0);return!t||(t(),!1)}function Be(e,n,o){return(i,r)=>{var s;Ee(i)&&!Ie()&&(null===(s=e.animationState)||void 0===s||s.setActive(t.AnimationType.Hover,n),null==o||o(i,r))}}const Ue=(t,e)=>!!e&&(t===e||Ue(t,e.parentElement));function ze(t){return e.useEffect(()=>()=>t(),[])}const Ne=(t,e,n)=>Math.min(Math.max(n,t),e);function We({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=Ne(.05,1,s),t=Ne(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/He(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=He(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=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}(i,r,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 He(t,e){return t*Math.sqrt(1-e*e)}const $e=["duration","bounce"],Ye=["stiffness","damping","mass"];function Xe(t,e){return e.some(e=>void 0!==t[e])}function Ge(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=Gt(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(!Xe(t,Ye)&&Xe(t,$e)){const n=We(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),f=qe,p=qe;function m(){const t=c?-c/1e3:0,o=n-e,r=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=He(s,r);f=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},p=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)f=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);f=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*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 r=1e3*p(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}Ge.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const qe=t=>0,Ze=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ke=(t,e,n)=>-n*t+n*e+t;function _e(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 Je({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=_e(a,o,t+1/3),r=_e(a,o,t),s=_e(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const Qe=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},tn=[St,At,bt],en=t=>tn.find(e=>e.test(t)),nn=(t,e)=>{let n=en(t),o=en(e),i=n.parse(t),r=o.parse(e);n===bt&&(i=Je(i),n=At),o===bt&&(r=Je(r),o=At);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=Qe(i[e],r[e],t));return s.alpha=Ke(i.alpha,r.alpha,t),n.transform(s)}},on=t=>"number"==typeof t,rn=(t,e)=>n=>e(t(n)),sn=(...t)=>t.reduce(rn);function an(t,e){return on(t)?n=>Ke(t,e,n):Pt.test(t)?nn(t,e):dn(t,e)}const ln=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>an(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},un=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=an(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function cn(t){const e=Ct.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const dn=(t,e)=>{const n=Ct.createTransformer(e),o=cn(t),i=cn(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?sn(ln(o.parsed,i.parsed),n):n=>""+(n>0?e:t)},hn=(t,e)=>n=>Ke(t,e,n);function fn(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?hn:"string"==typeof r?Pt.test(r)?nn:dn:Array.isArray(r)?ln:"object"==typeof r?un:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=sn(t,r)}o.push(r)}return o}function pn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=fn(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Ze(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Ze(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(Ne(t[0],t[r-1],e)):a}const mn=t=>e=>1-t(1-e),gn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,vn=t=>e=>e*e*((t+1)*e-t),yn=t=>t,xn=(bn=2,t=>Math.pow(t,bn));var bn;const En=mn(xn),wn=gn(xn),An=t=>1-Math.sin(Math.acos(t)),Sn=mn(An),Pn=gn(Sn),Tn=vn(1.525),On=mn(Tn),jn=gn(Tn),Vn=(t=>{const e=vn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),Cn=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},Mn=mn(Cn);function Rn(t,e){return t.map(()=>e||wn).splice(0,t.length-1)}function Ln({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={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),i);function l(){return pn(a,s,{ease:Array.isArray(n)?n:Rn(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}}const kn={keyframes:Ln,spring:Ge,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const Dn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Fn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Dn()),1/60*1e3);let In=!0,Bn=!1,Un=!1;const zn={delta:0,timestamp:0},Nn=["read","update","preRender","render","postRender"],Wn=Nn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!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())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Bn=!0),t),{}),Hn=Nn.reduce((t,e)=>{const n=Wn[e];return t[e]=(t,e=!1,o=!1)=>(Bn||qn(),n.schedule(t,e,o)),t},{}),$n=Nn.reduce((t,e)=>(t[e]=Wn[e].cancel,t),{}),Yn=Nn.reduce((t,e)=>(t[e]=()=>Wn[e].process(zn),t),{}),Xn=t=>Wn[t].process(zn),Gn=t=>{Bn=!1,zn.delta=In?1/60*1e3:Math.max(Math.min(t-zn.timestamp,40),1),zn.timestamp=t,Un=!0,Nn.forEach(Xn),Un=!1,Bn&&(In=!1,Fn(Gn))},qn=()=>{Bn=!0,In=!0,Un||Fn(Gn)},Zn=()=>zn;function Kn(t,e,n=0){return t-e-n}const _n=t=>{const e=({delta:e})=>t(e);return{start:()=>Hn.update(e,!0),stop:()=>$n.update(e)}};function Jn(t){var e,n,{from:o,autoplay:i=!0,driver:r=_n,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:d,onComplete:h,onRepeat:f,onUpdate:p}=t,m=Gt(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,A=!0;const S=function(t){if(Array.isArray(t.to))return Ln;if(kn[t.type])return kn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ln:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ge:Ln}(m);(null===(n=(e=S).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=pn([0,100],[o,x],{clamp:!1}),o=0,x=100);const P=S(Object.assign(Object.assign({},m),{from:o,to:x}));function T(){b++,"reverse"===l?(A=b%2==0,s=function(t,e,n=0,o=!0){return o?Kn(e+-t,e,n):e-(t-e)+n}(s,E,u,A)):(s=Kn(s,E,u),"mirror"===l&&P.flipTarget()),w=!1,f&&f()}function O(t){if(A||(t=-t),s+=t,!w){const t=P.next(Math.max(0,s));v=t.value,y&&(v=y(v)),w=A?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,A)&&T():(g.stop(),h&&h()))}return i&&(null==c||c(),g=r(O),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function Qn(t,e){return e?t*(1e3/e):0}const to=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),eo=t=>to(t)&&t.hasOwnProperty("z"),no=(t,e)=>Math.abs(t-e);function oo(t,e){if(on(t)&&on(e))return no(t,e);if(to(t)&&to(e)){const n=no(t.x,e.x),o=no(t.y,e.y),i=eo(t)&&eo(e)?no(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const io=(t,e)=>1-3*e+3*t,ro=(t,e)=>3*e-6*t,so=t=>3*t,ao=(t,e,n)=>((io(e,n)*t+ro(e,n))*t+so(e))*t,lo=(t,e,n)=>3*io(e,n)*t*t+2*ro(e,n)*t+so(e);function uo(t,e,n,o){if(t===e&&n===o)return yn;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=ao(.1*e,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=.1;--r;const s=o+.1*((e-i[r])/(i[r+1]-i[r])),a=lo(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=lo(e,n,o);if(0===i)return e;e-=(ao(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=ao(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:ao(r(t),e,o)}const co=new Set;function ho(t,e,n){t||co.has(e)||(console.warn(e),n&&console.warn(n),co.add(e))}const fo=new WeakMap,po=new WeakMap,mo=t=>{var e;null===(e=fo.get(t.target))||void 0===e||e(t)},go=t=>{t.forEach(mo)};function vo(t,e,n){const o=function(t){var{root:e}=t,n=Gt(t,["root"]);const o=e||document;po.has(o)||po.set(o,{});const i=po.get(o),r=JSON.stringify(n);return i[r]||(i[r]=new IntersectionObserver(go,Object.assign({root:e},n))),i[r]}(e);return fo.set(t,n),o.observe(t),()=>{fo.delete(t),o.unobserve(t)}}const yo={some:0,all:1};function xo(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:yo[a]};return vo(i.getInstance(),e,e=>{var n;const{isIntersecting:r}=e;if(o.isInView===r)return;if(o.isInView=r,l&&!r&&o.hasEnteredView)return;r&&(o.hasEnteredView=!0),null===(n=i.animationState)||void 0===n||n.setActive(t.AnimationType.InView,r);const s=i.getProps(),a=r?s.onViewportEnter:s.onViewportLeave;null==a||a(e)})},[n,r,s,a])}function bo(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==s&&ho(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{var e;o.hasEnteredView=!0;const{onViewportEnter:n}=i.getProps();null==n||n(null),null===(e=i.animationState)||void 0===e||e.setActive(t.AnimationType.InView,!0)}))},[n])}const Eo=t=>e=>(t(e),null),wo={inView:Eo((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?bo:xo)(a,s.current,t,r)})),tap:Eo((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||m)};function d(){var t;null===(t=u.current)||void 0===t||t.call(u),u.current=null}function h(){var e;return d(),l.current=!1,null===(e=s.animationState)||void 0===e||e.setActive(t.AnimationType.Tap,!1),!Ie()}function f(t,e){h()&&(Ue(s.getInstance(),t.target)?null==n||n(t,e):null==i||i(t,e))}function p(t,e){h()&&(null==i||i(t,e))}function m(e,n){var i;d(),l.current||(l.current=!0,u.current=sn(Me(window,"pointerup",f,c),Me(window,"pointercancel",p,c)),null===(i=s.animationState)||void 0===i||i.setActive(t.AnimationType.Tap,!0),null==o||o(e,n))}Re(s,"pointerdown",a?m:void 0,c),ze(d)})),focus:Eo((function({whileFocus:e,visualElement:n}){be(n,"focus",e?()=>{var e;null===(e=n.animationState)||void 0===e||e.setActive(t.AnimationType.Focus,!0)}:void 0),be(n,"blur",e?()=>{var e;null===(e=n.animationState)||void 0===e||e.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:Eo((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){Re(o,"pointerenter",t||n?Be(o,!0,t):void 0,{passive:!t}),Re(o,"pointerleave",e||n?Be(o,!1,e):void 0,{passive:!e})}))};function Ao(){const t=e.useContext(g);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>null==o?void 0:o(r)]:[!0]}function So(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,To={linear:yn,easeIn:xn,easeInOut:wn,easeOut:En,circIn:An,circInOut:Pn,circOut:Sn,backIn:Tn,backInOut:jn,backOut:On,anticipate:Vn,bounceIn:Mn,bounceInOut:t=>t<.5?.5*(1-Cn(1-2*t)):.5*Cn(2*t-1)+.5,bounceOut:Cn},Oo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return uo(e,n,o,i)}return"string"==typeof t?To[t]:t},jo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ct.test(e)||e.startsWith("url("))),Vo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Co=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Mo=()=>({type:"keyframes",ease:"linear",duration:.3}),Ro=t=>({type:"keyframes",duration:.8,values:t}),Lo={x:Vo,y:Vo,z:Vo,rotate:Vo,rotateX:Vo,rotateY:Vo,rotateZ:Vo,scaleX:Co,scaleY:Co,scale:Co,opacity:Mo,backgroundColor:Mo,color:Mo,default:Co},ko=Object.assign(Object.assign({},Ft),{color:Pt,backgroundColor:Pt,outlineColor:Pt,fill:Pt,stroke:Pt,borderColor:Pt,borderTopColor:Pt,borderRightColor:Pt,borderBottomColor:Pt,borderLeftColor:Pt,filter:kt,WebkitFilter:kt}),Do=t=>ko[t];function Fo(t,e){var n;let o=Do(t);return o!==kt&&(o=Ct),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Io={current:!1};function Bo(t){var{ease:e,times:n,yoyo:o,flip:i,loop:r}=t,s=Gt(t,["ease","times","yoyo","flip","loop"]);const a=Object.assign({},s);return n&&(a.offset=n),s.duration&&(a.duration=Po(s.duration)),s.repeatDelay&&(a.repeatDelay=Po(s.repeatDelay)),e&&(a.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Oo):Oo(e)),"tween"===s.type&&(a.type="keyframes"),(o||r||i)&&(o?a.repeatType="reverse":r?a.repeatType="loop":i&&(a.repeatType="mirror"),a.repeat=r||o||i||s.repeat),"spring"!==s.type&&(a.type="keyframes"),a}function Uo(t,e,n){var o;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function(t){var e=Gt(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object.assign(Object.assign({},t),((t,e)=>{let n;return n=ue(e)?Ro:Lo[t]||Lo.default,Object.assign({to:e},n(e))})(n,e.to))),Object.assign(Object.assign({},e),Bo(t))}function zo(t,e,n,o,i){var r;const s=Ho(o,t);let a=null!==(r=s.from)&&void 0!==r?r:e.get();const l=jo(t,n);"none"===a&&l&&"string"==typeof n?a=Fo(t,n):No(a)&&"string"==typeof n?a=Wo(n):!Array.isArray(n)&&No(n)&&"string"==typeof a&&(n=Wo(a));return jo(t,a)&&l&&!1!==s.type?function(){const o={from:a,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=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=Jn(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=i*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=Qn(t-c,Zn().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:m(o)?h:void 0})}return{stop:()=>null==p?void 0:p.stop()}}(Object.assign(Object.assign({},o),s)):Jn(Object.assign(Object.assign({},Uo(s,o,t)),{onUpdate:t=>{var e;o.onUpdate(t),null===(e=s.onUpdate)||void 0===e||e.call(s,t)},onComplete:()=>{var t;o.onComplete(),null===(t=s.onComplete)||void 0===t||t.call(s)}}))}:function(){var t,o;const r=ce(n);return e.set(r),i(),null===(t=null==s?void 0:s.onUpdate)||void 0===t||t.call(s,r),null===(o=null==s?void 0:s.onComplete)||void 0===o||o.call(s),{stop:()=>{}}}}function No(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Wo(t){return"number"==typeof t?0:Fo("",t)}function Ho(t,e){return t[e]||t.default||t}function $o(t,e,n,o={}){return Io.current&&(o={type:!1}),e.start(i=>{let r,s;const a=zo(t,e,n,o,i),l=function(t,e){var n,o;return null!==(o=null!==(n=(Ho(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),u=()=>s=a();return l?r=window.setTimeout(u,Po(l)):u(),()=>{clearTimeout(r),null==s||s.stop()}})}const Yo=t=>/^0[^.\s]+$/.test(t);function Xo(t,e){-1===t.indexOf(e)&&t.push(e)}function Go(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class qo{constructor(){this.subscriptions=[]}add(t){return Xo(this.subscriptions,t),()=>Go(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 i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Zo{constructor(t){var e;this.version="7.1.1",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new qo,this.velocityUpdateSubscribers=new qo,this.renderSubscribers=new qo,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Zn();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Hn.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=()=>Hn.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?Qn(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 Ko(t){return new Zo(t)}const _o=t=>e=>e.test(t),Jo=[lt,pt,ft,ht,gt,mt,{test:t=>"auto"===t,parse:t=>t}],Qo=t=>Jo.find(_o(t)),ti=[...Jo,Pt,Ct],ei=t=>ti.find(_o(t));function ni(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ko(n))}function oi(t,e){const n=O(t,e);let o=n?t.makeTargetAnimatable(n,!1):{},{transitionEnd:i={},transition:r={}}=o,s=Gt(o,["transitionEnd","transition"]);s=Object.assign(Object.assign({},s),i);for(const e in s){ni(t,e,ce(s[e]))}}function ii(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&oi(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{ii(t,e)})})}function ri(t,e,n){var o,i,r,s;const a=Object.keys(e).filter(e=>!t.hasValue(e)),l=a.length;if(l)for(let u=0;u<l;u++){const l=a[u],c=e[l];let d=null;Array.isArray(c)&&(d=c[0]),null===d&&(d=null!==(i=null!==(o=n[l])&&void 0!==o?o:t.readValue(l))&&void 0!==i?i:e[l]),null!=d&&("string"==typeof d&&(/^\-?\d*\.?\d+$/.test(d)||Yo(d))?d=parseFloat(d):!ei(d)&&Ct.test(c)&&(d=Fo(l,c)),t.addValue(l,Ko(d)),null!==(r=(s=n)[l])&&void 0!==r||(s[l]=d),t.setBaseTarget(l,d))}}function si(t,e){if(!e)return;return(e[t]||e.default||e).from}function ai(t,e,n){var o,i;const r={};for(const s in t)r[s]=null!==(o=si(s,e))&&void 0!==o?o:null===(i=n.getValue(s))||void 0===i?void 0:i.get();return r}function li(t){return Boolean(J(t)&&t.add)}function ui(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const i=e.map(e=>ci(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=ci(t,e,n);else{const i="function"==typeof e?O(t,e,n.custom):e;o=di(t,i,n)}return o.then(()=>t.notifyAnimationComplete(e))}function ci(t,e,n={}){var o;const i=O(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>di(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(hi).forEach((t,o)=>{s.push(ci(t,e,Object.assign(Object.assign({},r),{delay:n+l(o)})).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function di(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let s=t.makeTargetAnimatable(e),{transition:a=t.getDefaultTransition(),transitionEnd:l}=s,u=Gt(s,["transition","transitionEnd"]);const c=t.getValue("willChange");o&&(a=o);const d=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in u){const o=t.getValue(e),i=u[e];if(!o||void 0===i||h&&fi(h,e))continue;let r=Object.assign({delay:n},a);t.shouldReduceMotion&&q(e)&&(r=Object.assign(Object.assign({},r),{type:!1,delay:0}));let s=$o(e,o,i,r);li(c)&&(c.add(e),s=s.then(()=>c.remove(e))),d.push(s)}return Promise.all(d).then(()=>{l&&oi(t,l)})}function hi(t,e){return t.sortNodePosition(e)}function fi({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const pi=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],mi=[...pi].reverse(),gi=pi.length;function vi(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>ui(t,e,n)))}(e);const o={[t.AnimationType.Animate]:xi(!0),[t.AnimationType.InView]:xi(),[t.AnimationType.Hover]:xi(),[t.AnimationType.Tap]:xi(),[t.AnimationType.Drag]:xi(),[t.AnimationType.Focus]:xi(),[t.AnimationType.Exit]:xi()};let i=!0;const r=(t,n)=>{const o=O(e,n);if(o){const{transition:e,transitionEnd:n}=o,i=Gt(o,["transition","transitionEnd"]);t=Object.assign(Object.assign(Object.assign({},t),i),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<gi;n++){const p=mi[n],m=o[p],g=null!==(a=l[p])&&void 0!==a?a:u[p],v=P(g),y=p===s?m.isActive:null;!1===y&&(f=n);let x=g===u[p]&&g!==l[p]&&v;if(x&&i&&e.manuallyAnimateOnMount&&(x=!1),m.protectedKeys=Object.assign({},h),!m.isActive&&null===y||!g&&!m.prevProp||le(g)||"boolean"==typeof g)continue;const b=yi(m.prevProp,g);let E=b||p===s&&m.isActive&&!x&&v||n>f&&v;const w=Array.isArray(g)?g:[g];let A=w.reduce(r,{});!1===y&&(A={});const{prevResolvedValues:S={}}=m,T=Object.assign(Object.assign({},S),A),O=t=>{E=!0,d.delete(t),m.needsAnimating[t]=!0};for(const t in T){const e=A[t],n=S[t];h.hasOwnProperty(t)||(e!==n?ue(e)&&ue(n)?!So(e,n)||b?O(t):m.protectedKeys[t]=!0:void 0!==e?O(t):d.add(t):void 0!==e&&d.has(t)?O(t):m.protectedKeys[t]=!0)}m.prevProp=g,m.prevResolvedValues=A,m.isActive&&(h=Object.assign(Object.assign({},h),A)),i&&e.blockInitialAnimation&&(E=!1),E&&!x&&c.push(...w.map(e=>({animation:e,options:Object.assign({type:p},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 p=Boolean(c.length);return i&&!1===l.initial&&!e.manuallyAnimateOnMount&&(p=!1),i=!1,p?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.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(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function yi(t,e){return"string"==typeof e?e!==t:!!S(e)&&!So(e,t)}function xi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const bi={animation:Eo(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=vi(t)),le(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:Eo(n=>{const{custom:o,visualElement:i}=n,[r,s]=Ao(),a=e.useContext(g);e.useEffect(()=>{var e,n;i.isPresent=r;const l=null===(e=i.animationState)||void 0===e?void 0:e.setActive(t.AnimationType.Exit,!r,{custom:null!==(n=null==a?void 0:a.custom)&&void 0!==n?n:o});!r&&(null==l||l.then(s))},[r])})};class Ei{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=Si(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=oo(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Zn();this.history.push(Object.assign(Object.assign({},o),{timestamp:i}));const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=wi(e,this.transformPagePoint),Ee(t)&&0===t.buttons?this.handlePointerUp(t,e):Hn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=Si(wi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},we(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=wi(Te(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Zn();this.history=[Object.assign(Object.assign({},i),{timestamp:r})];const{onSessionStart:s}=e;s&&s(t,Si(o,this.history)),this.removeListeners=sn(Me(window,"pointermove",this.handlePointerMove),Me(window,"pointerup",this.handlePointerUp),Me(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$n.update(this.updatePoint)}}function wi(t,e){return e?{point:e(t.point)}:t}function Ai(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Si({point:t},e){return{point:t,delta:Ai(t,Ti(e)),offset:Ai(t,Pi(e)),velocity:Oi(e,.1)}}function Pi(t){return t[0]}function Ti(t){return t[t.length-1]}function Oi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=Ti(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>Po(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ji(t){return t.max-t.min}function Vi(t,e=0,n=.01){return oo(t,e)<n}function Ci(t,e,n,o=.5){t.origin=o,t.originPoint=Ke(e.min,e.max,t.origin),t.scale=ji(n)/ji(e),(Vi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ke(n.min,n.max,t.origin)-t.originPoint,(Vi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Mi(t,e,n,o){Ci(t.x,e.x,n.x,null==o?void 0:o.originX),Ci(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ri(t,e,n){t.min=n.min+e.min,t.max=t.min+ji(e)}function Li(t,e,n){t.min=e.min-n.min,t.max=t.min+ji(e)}function ki(t,e,n){Li(t.x,e.x,n.x),Li(t.y,e.y,n.y)}function Di(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 Fi(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 Ii=.35;function Bi(t,e,n){return{min:Ui(t,e),max:Ui(t,n)}}function Ui(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const zi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Ni(t){return[t("x"),t("y")]}function Wi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Hi(t){return void 0===t||1===t}function $i({scale:t,scaleX:e,scaleY:n}){return!Hi(t)||!Hi(e)||!Hi(n)}function Yi(t){return $i(t)||Xi(t.x)||Xi(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Xi(t){return t&&"0%"!==t}function Gi(t,e,n){return n+e*(t-n)}function qi(t,e,n,o,i){return void 0!==i&&(t=Gi(t,i,o)),Gi(t,n,o)+e}function Zi(t,e=0,n=1,o,i){t.min=qi(t.min,e,n,o,i),t.max=qi(t.max,e,n,o,i)}function Ki(t,{x:e,y:n}){Zi(t.x,e.translate,e.scale,e.originPoint),Zi(t.y,n.translate,n.scale,n.originPoint)}function _i(t,e){t.min=t.min+e,t.max=t.max+e}function Ji(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Ke(t.min,t.max,r);Zi(t,e[n],e[o],s,e.scale)}const Qi=["x","scaleX","originX"],tr=["y","scaleY","originY"];function er(t,e){Ji(t.x,e,Qi),Ji(t.y,e,tr)}function nr(t,e){return Wi(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 or=new WeakMap;class ir{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 Ei(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(Te(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Fe(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ni(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(ft.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(i){o=ji(i)*(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:i,onDrag:r}=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==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==r||r(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:i}=this.getProps();null==i||i(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||!rr(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ke(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ke(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&A(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:Di(t.x,n,i),y:Di(t.y,e,o)}}(n.actual,t),this.elastic=function(t=Ii){return!1===t?t=0:!0===t&&(t=Ii),{x:Bi(t,"left","right"),y:Bi(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ni(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||!A(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=nr(t,n),{scroll:i}=e;return i&&(_i(o.x,i.x),_i(o.y,i.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Fi(t.x,e.x),y:Fi(t.y,e.y)}}(o.layout.actual,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Wi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Ni(s=>{var l;if(!rr(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};r&&(u={min:0,max:0});const c=o?200:1e6,d=o?40:1e7,h=Object.assign(Object.assign({type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10},i),u);return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return $o(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Ni(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||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){Ni(e=>{const{drag:n}=this.getProps();if(!rr(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.actual[e];i.set(t[e]-Ke(n,r,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!A(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ni(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=ji(t),i=ji(e);return i>o?n=Ze(e.min,e.max-o,t.min):o>i&&(n=Ze(t.min,t.max-i,e.min)),Ne(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Ni(t=>{if(!rr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Ke(o,r,i[t]))})}addListeners(){var t;or.set(this.visualElement,this);const e=Me(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();A(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=xe(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ni(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=Ii,dragMomentum:s=!0}=t;return Object.assign(Object.assign({},t),{drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s})}}function rr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const sr={pan:Eo((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const s=t||n||o||i,a=e.useRef(null),{transformPagePoint:l}=e.useContext(f),u={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{a.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==a.current&&a.current.updateHandlers(u)}),Re(r,"pointerdown",s&&function(t){a.current=new Ei(t,u,{transformPagePoint:l})}),ze(()=>a.current&&a.current.end())})),drag:Eo((function(t){const{dragControls:n,visualElement:o}=t,i=R(()=>new ir(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))},ar=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const lr=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:o,measureViewportBox:i,render:r,readValueFromInstance:s,removeValueFromRenderState:a,sortNodePosition:l,scrapeMotionValuesFromProps:u})=>({parent:c,props:d,presenceId:h,blockInitialAnimation:f,visualState:p,shouldReduceMotion:m},g={})=>{let v=!1;const{latestValues:y,renderState:x}=p;let b;const E=function(){const t=ar.map(()=>new qo),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{ar.forEach(o=>{var i;const r="on"+o,s=t[r];null===(i=e[o])||void 0===i||i.call(e),s&&(e[o]=n[r](s))})}};return t.forEach((t,e)=>{n["on"+ar[e]]=e=>t.add(e),n["notify"+ar[e]]=(...e)=>t.notify(...e)}),n}(),w=new Map,A=new Map;let S={};const T=Object.assign({},y);let O;function C(){b&&v&&(M(),r(b,x,d.style,U.projection))}function M(){e(U,x,y,g,d)}function R(){E.notifyUpdate(y)}function L(t,e){const n=e.onChange(e=>{y[t]=e,d.onUpdate&&Hn.update(R,!1,!0)}),o=e.onRenderRequest(U.scheduleRender);A.set(t,()=>{n(),o()})}const k=u(d),{willChange:D}=k,F=Gt(k,["willChange"]);for(const t in F){const e=F[t];void 0!==y[t]&&J(e)&&(e.set(y[t],!1),li(D)&&D.add(t))}const I=j(d),B=V(d),U=Object.assign(Object.assign({treeType:t,current:null,depth:c?c.depth+1:0,parent:c,children:new Set,presenceId:h,shouldReduceMotion:m,variantChildren:B?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==c?void 0:c.isMounted()),blockInitialAnimation:f,isMounted:()=>Boolean(b),mount(t){v=!0,b=U.current=t,U.projection&&U.projection.mount(t),B&&c&&!I&&(O=null==c?void 0:c.addVariantChild(U)),w.forEach((t,e)=>L(e,t)),null==c||c.children.add(U),U.setProps(d)},unmount(){var t;null===(t=U.projection)||void 0===t||t.unmount(),$n.update(R),$n.render(C),A.forEach(t=>t()),null==O||O(),null==c||c.children.delete(U),E.clearAllListeners(),b=void 0,v=!1},addVariantChild(t){var e;const n=U.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>l&&t===e.treeType?l(U.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>B?U:null==c?void 0:c.getClosestVariantNode(),getLayoutId:()=>d.layoutId,getInstance:()=>b,getStaticValue:t=>y[t],setStaticValue:(t,e)=>y[t]=e,getLatestValues:()=>y,setVisibility(t){U.isVisible!==t&&(U.isVisible=t,U.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>o(U,t,d,e),measureViewportBox:()=>i(b,d),addValue(t,e){U.hasValue(t)&&U.removeValue(t),w.set(t,e),y[t]=e.get(),L(t,e)},removeValue(t){var e;w.delete(t),null===(e=A.get(t))||void 0===e||e(),A.delete(t),delete y[t],a(t,x)},hasValue:t=>w.has(t),getValue(t,e){let n=w.get(t);return void 0===n&&void 0!==e&&(n=Ko(e),U.addValue(t,n)),n},forEachValue:t=>w.forEach(t),readValue:t=>{var e;return null!==(e=y[t])&&void 0!==e?e:s(b,t,g)},setBaseTarget(t,e){T[t]=e},getBaseTarget(t){if(n){const e=n(d,t);if(void 0!==e&&!J(e))return e}return T[t]}},E),{build:()=>(M(),x),scheduleRender(){Hn.render(C,!1,!0)},syncRender:C,setProps(t){(t.transformTemplate||d.transformTemplate)&&U.scheduleRender(),d=t,E.updatePropListeners(t),S=function(t,e,n){var o;const{willChange:i}=e;for(const r in e){const s=e[r],a=n[r];if(J(s))t.addValue(r,s),li(i)&&i.add(r);else if(J(a))t.addValue(r,Ko(s)),li(i)&&i.remove(r);else if(a!==s)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(s)}else t.addValue(r,Ko(null!==(o=t.getStaticValue(r))&&void 0!==o?o:s))}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(U,u(d),S)},getProps:()=>d,getVariant:t=>{var e;return null===(e=d.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>d.transition,getTransformPagePoint:()=>d.transformPagePoint,getVariantContext(t=!1){if(t)return null==c?void 0:c.getVariantContext();if(!I){const t=(null==c?void 0:c.getVariantContext())||{};return void 0!==d.initial&&(t.initial=d.initial),t}const e={};for(let t=0;t<cr;t++){const n=ur[t],o=d[n];(P(o)||!1===o)&&(e[n]=o)}return e}});return U},ur=["initial",...pi],cr=ur.length;function dr(t){return"string"==typeof t&&t.startsWith("var(--")}const hr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function fr(t,e,n=1){const[o,i]=function(t){const e=hr.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():dr(i)?fr(i,e,n+1):i}const pr=new Set(["width","height","top","left","right","bottom","x","y"]),mr=t=>pr.has(t),gr=(t,e)=>{t.set(e,!1),t.set(e)},vr=t=>t===lt||t===pt;var yr;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(yr||(yr={}));const xr=(t,e)=>parseFloat(t.split(", ")[e]),br=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return xr(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?xr(e[1],t):0}},Er=new Set(["x","y","z"]),wr=Y.filter(t=>!Er.has(t));const Ar={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:br(4,13),y:br(5,14)},Sr=(t,e,n={},o={})=>{e=Object.assign({},e),o=Object.assign({},o);const i=Object.keys(e).filter(mr);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Qo(u);const d=e[i];let h;if(ue(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=Qo(u);for(let n=e;n<t;n++)h?Qo(d[n]):h=Qo(d[n])}else h=Qo(d);if(c!==h)if(vr(c)&&vr(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&h===pt&&(e[i]=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[i]=c.transform(d):(s||(r=function(t){const e=[];return wr.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(i),o[i]=void 0!==o[i]?o[i]:e[i],gr(l,d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Ar[t](o,r)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);gr(o,a[n]),t[n]=Ar[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),v&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function Pr(t,e,n,o){return(t=>Object.keys(t).some(mr))(e)?Sr(t,e,n,o):{target:e,transitionEnd:o}}const Tr=(t,e,n,o)=>{const i=function(t,e,n){var o,i=Gt(e,[]);const r=t.getInstance();if(!(r instanceof Element))return{target:i,transitionEnd:n};n&&(n=Object.assign({},n)),t.forEachValue(t=>{const e=t.get();if(!dr(e))return;const n=fr(e,r);n&&t.set(n)});for(const t in i){const e=i[t];if(!dr(e))continue;const s=fr(e,r);s&&(i[t]=s,n&&(null!==(o=n[t])&&void 0!==o||(n[t]=e)))}return{target:i,transitionEnd:n}}(t,e,o);return Pr(t,e=i.target,n,o=i.transitionEnd)};const Or={treeType:"dom",readValueFromInstance(t,e){if(q(e)){const t=Do(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(tt(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}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})=>nr(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,e,n,o){var{transition:i,transitionEnd:r}=e,s=Gt(e,["transition","transitionEnd"]),a=n.transformValues;void 0===o&&(o=!0);let l=ai(s,i||{},t);if(a&&(r&&(r=a(r)),s&&(s=a(s)),l&&(l=a(l))),o){ri(t,s,l);const e=Tr(t,s,l,r);r=e.transitionEnd,s=e.target}return Object.assign({transition:i,transitionEnd:r},s)},scrapeMotionValuesFromProps:se,build(t,e,n,o,i){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),It(e,n,o,i.transformTemplate)},render:oe},jr=lr(Or),Vr=lr(Object.assign(Object.assign({},Or),{getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return q(e)?(null===(n=Do(e))||void 0===n?void 0:n.default)||0:(e=ie.has(e)?e:ne(e),t.getAttribute(e))},scrapeMotionValuesFromProps:ae,build(t,e,n,o,i){_t(e,n,o,i.transformTemplate)},render:re})),Cr=(t,e)=>N(t)?Vr(e,{enableHardwareAcceleration:!1}):jr(e,{enableHardwareAcceleration:!0});function Mr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Rr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!pt.test(t))return t;t=parseFloat(t)}return`${Mr(t,e.target.x)}% ${Mr(t,e.target.y)}%`}},Lr={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(hr,t=>(r.push(t),"_$css")));const s=Ct.parse(t);if(s.length>5)return o;const a=Ct.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=Ke(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(i){let t=0;h=h.replace("_$css",()=>{const e=r[t];return t++,e})}return h}};class kr extends r.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;H(Dr),i&&((null==e?void 0:e.group)&&e.group.add(i),(null==n?void 0:n.register)&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions(Object.assign(Object.assign({},i.options),{onExitComplete:()=>this.safeToRemove()}))),L.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Hn.postRender(()=>{var t;(null===(t=r.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 Dr={borderRadius:Object.assign(Object.assign({},Rr),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Rr,borderTopRightRadius:Rr,borderBottomLeftRadius:Rr,borderBottomRightRadius:Rr,boxShadow:Lr},Fr={measureLayout:function(t){const[n,o]=Ao(),i=e.useContext(D);return r.default.createElement(kr,Object.assign({},t,{layoutGroup:i,switchLayoutGroup:e.useContext(F),isPresent:n,safeToRemove:o}))}};function Ir(t,e,n={}){const o=J(t)?t:Ko(t);return $o("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Br=["TopLeft","TopRight","BottomLeft","BottomRight"],Ur=Br.length,zr=t=>"string"==typeof t?parseFloat(t):t,Nr=t=>"number"==typeof t||pt.test(t);function Wr(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Hr=Yr(0,.5,Sn),$r=Yr(.5,.95,yn);function Yr(t,e,n){return o=>o<t?0:o>e?1:n(Ze(t,e,o))}function Xr(t,e){t.min=e.min,t.max=e.max}function Gr(t,e){Xr(t.x,e.x),Xr(t.y,e.y)}function qr(t,e,n,o,i){return t=Gi(t-=e,1/n,o),void 0!==i&&(t=Gi(t,1/i,o)),t}function Zr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(ft.test(e)){e=parseFloat(e);e=Ke(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ke(r.min,r.max,o);t===r&&(a-=e),t.min=qr(t.min,e,n,a,i),t.max=qr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Kr=["x","scaleX","originX"],_r=["y","scaleY","originY"];function Jr(t,e,n,o){Zr(t.x,e,Kr,null==n?void 0:n.x,null==o?void 0:o.x),Zr(t.y,e,_r,null==n?void 0:n.y,null==o?void 0:o.y)}function Qr(t){return 0===t.translate&&1===t.scale}function ts(t){return Qr(t.x)&&Qr(t.y)}function es(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}class ns{constructor(){this.members=[]}add(t){Xo(this.members,t),t.scheduleRender()}remove(t){if(Go(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:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}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:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}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 is=(t,e)=>t.depth-e.depth;class rs{constructor(){this.children=[],this.isDirty=!1}add(t){Xo(this.children,t),this.isDirty=!0}remove(t){Go(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}}function ss({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){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 qo),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:i,layout:r,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&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(o,250),L.hasAnimatedSinceResize&&(L.hasAnimatedSinceResize=!1,this.nodes.forEach(hs))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:bs,{onLayoutAnimationStart:d,onLayoutAnimationComplete:h}=s.getProps(),f=!this.targetLayout||!es(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=Object.assign(Object.assign({},Ho(c,"layout")),{onPlay:d,onComplete:h});s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),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,$n.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:i,layout:r}=this.options;if(void 0===i&&!r)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(),Yn.update(),Yn.preRender(),Yn.render())}clearAllSnapshots(){this.nodes.forEach(us),this.sharedNodes.forEach(gs)}scheduleUpdateProjection(){Hn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Hn.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(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!ts(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||Yi(this.latestValues)||s)&&(i(this.instance,r),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&&(_i(e.x,n.x),_i(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Gr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r,isScrollRoot:s}=o;if(o!==this.root&&i&&r.layoutScroll){if(s){Gr(e,t);const{scroll:n}=this.root;n&&(_i(e.x,-n.x),_i(e.y,-n.y))}_i(e.x,i.x),_i(e.y,i.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Gr(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&&er(n,{x:-o.scroll.x,y:-o.scroll.y}),Yi(o.latestValues)&&er(n,o.latestValues)}return Yi(this.latestValues)&&er(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Gr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Yi(o.latestValues))continue;$i(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Gr(i,o.measure()),Jr(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layout,i)}return Yi(this.latestValues)&&Jr(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){var e;this.options=Object.assign(Object.assign(Object.assign({},this.options),t),{crossfade:null===(e=t.crossfade)||void 0===e||e})}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,i,r;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}},ki(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Gr(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,i=this.relativeTarget,r=this.relativeParent.target,Ri(o.x,i.x,r.x),Ri(o.y,i.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Gr(this.target,this.layout.actual),Ki(this.target,this.targetDelta)):Gr(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}},ki(this.relativeTargetOrigin,this.target,this.relativeParent.target),Gr(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Yi(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();Gr(this.layoutCorrected,this.layout.actual),function(t,e,n,o=!1){var i,r;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===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&er(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Ki(t,l)),o&&Yi(a.latestValues)&&er(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:i}=o;if(!i)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 r=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;Mi(this.projectionDelta,this.layoutCorrected,i,this.latestValues),this.projectionTransform=os(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===r&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",i))}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,i=(null==o?void 0:o.latestValues)||{},r=Object.assign({},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)&&(ki(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=r,function(t,e,n,o,i,r){var s,a,l,u;i?(t.opacity=Ke(0,null!==(s=n.opacity)&&void 0!==s?s:1,Hr(o)),t.opacityExit=Ke(null!==(a=e.opacity)&&void 0!==a?a:1,0,$r(o))):r&&(t.opacity=Ke(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let i=0;i<Ur;i++){const r=`border${Br[i]}Radius`;let s=Wr(e,r),a=Wr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Nr(s)===Nr(a)?(t[r]=Math.max(Ke(zr(s),zr(a),o),0),(ft.test(a)||ft.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Ke(e.rotate||0,n.rotate||0,o))}(r,i,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&&($n.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Hn.update(()=>{L.hasAnimatedSinceResize=!0,this.currentAnimation=Ir(0,1e3,Object.assign(Object.assign({},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{targetWithTransforms:t,target:e,layout:n,latestValues:o}=this.getLead();t&&e&&n&&(Gr(t,e),er(t,o),Mi(this.projectionDeltaWithTransform,this.layoutCorrected,t,o))}registerSharedNode(t,e){var n,o,i;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===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.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<$.length;o++){const i="rotate"+$[o];t.getStaticValue(i)&&(e=!0,n[i]=t.getStaticValue(i),t.setStaticValue(i,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,i,r,s;const a={};if(!this.instance||this.isSVG)return a;if(!this.isVisible)return{visibility:"hidden"};a.visibility="";const l=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=de(t.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const e={};return this.options.layoutId&&(e.opacity=null!==(n=this.latestValues.opacity)&&void 0!==n?n:1,e.pointerEvents=de(t.pointerEvents)||""),this.hasProjected&&!Yi(this.latestValues)&&(e.transform=l?l({},""):"none",this.hasProjected=!1),e}const c=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=os(this.projectionDeltaWithTransform,this.treeScale,c),l&&(a.transform=l(c,a.transform));const{x:d,y:h}=this.projectionDelta;a.transformOrigin=`${100*d.origin}% ${100*h.origin}% 0`,u.animationValues?a.opacity=u===this?null!==(i=null!==(o=c.opacity)&&void 0!==o?o:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:a.opacity=u===this?null!==(r=c.opacity)&&void 0!==r?r:"":null!==(s=c.opacityExit)&&void 0!==s?s:0;for(const t in W){if(void 0===c[t])continue;const{correct:e,applyTo:n}=W[t],o=e(c[t],u);if(n){const t=n.length;for(let e=0;e<t;e++)a[n[e]]=o}else a[t]=o}return this.options.layoutId&&(a.pointerEvents=u===this?de(t.pointerEvents)||"":"none"),a}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,i;const r=null!==(n=null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)&&void 0!==n?n:t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout;"size"===t.options.animationType?Ni(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=ji(n);n.min=e[t].min,n.max=n.min+o}):"position"===t.options.animationType&&Ni(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=ji(e[t]);n.max=n.min+o});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Mi(o,e,r.layout);const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r.isShared?Mi(i,t.applyTransform(n,!0),r.measured):Mi(i,e,r.layout);const s=!ts(o);let a=!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}};ki(t,r.layout,n.layout);const i={x:{min:0,max:0},y:{min:0,max:0}};ki(i,e,o.actual),es(t,i)||(a=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:r,delta:i,layoutDelta:o,hasLayoutChanged:s,hasRelativeTargetChanged:a})}else t.isLead()&&(null===(i=(o=t.options).onExitComplete)||void 0===i||i.call(o));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=Ke(e.translate,0,n),t.scale=Ke(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ys(t,e,n,o){t.min=Ke(e.min,n.min,o),t.max=Ke(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 As(t){ws(t.x),ws(t.y)}const Ss=ss({attachResizeListener:(t,e)=>xe(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ps={current:void 0},Ts=ss({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ps.current){const t=new Ss(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Ps.current=t}return Ps.current},resetTransform:(t,e)=>{t.style.transform=null!=e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Os=Object.assign(Object.assign(Object.assign(Object.assign({},bi),wo),sr),Fr),js=U((t,e)=>ve(t,e,Os,Cr,Ts));const Vs=U(ve);function Cs(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Ms(){const t=Cs(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Hn.postRender(i),[i]),n]}const Rs=({children:t,initial:n,isPresent:o,onExitComplete:r,custom:s,presenceAffectsLayout:a})=>{const l=R(Ls),u=e.useId(),c=e.useMemo(()=>({id:u,initial:n,isPresent:o,custom:s,onExitComplete:t=>{l.set(t,!0);for(const t of l.values())if(!t)return;null==r||r()},register:t=>(l.set(t,!1),()=>l.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{l.forEach((t,e)=>l.set(e,!1))},[o]),i.useEffect(()=>{!o&&!l.size&&(null==r||r())},[o]),i.createElement(g.Provider,{value:c},t)};function Ls(){return new Map}const ks=t=>t.key||"";const Ds=e.createContext(null),Fs=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Is(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Fs);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const Bs=t=>!0===t,Us=({children:t,id:n,inheritId:o,inherit:r=!0})=>{var s,a;void 0!==o&&(r=o);const l=e.useContext(D),u=e.useContext(Ds),[c,d]=Ms(),h=e.useRef(null),f=null!==(s=l.id)&&void 0!==s?s:u;null===h.current&&((t=>Bs(!0===t)||"id"===t)(r)&&f&&(n=n?f+"-"+n:f),h.current={id:n,group:Bs(r)&&null!==(a=null==l?void 0:l.group)&&void 0!==a?a:Is()});const p=e.useMemo(()=>Object.assign(Object.assign({},h.current),{forceRender:c}),[d]);return i.createElement(D.Provider,{value:p},t)};let zs=0;function Ns(t){return"function"==typeof t}const Ws=e.createContext(null);const Hs=e.forwardRef((function(t,n){var{children:o,as:r="ul",axis:s="y",onReorder:a,values:l}=t,u=Gt(t,["children","as","axis","onReorder","values"]);const c=R(()=>js(r)),d=[],h=e.useRef(!1),f={axis:s,registerItem:(t,e)=>{e&&-1===d.findIndex(e=>t===e.value)&&(d.push({value:t,layout:e[s]}),d.sort(Ys))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Ke(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&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,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(d,t,e,n);d!==o&&(h.current=!0,a(o.map($s).filter(t=>-1!==l.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),i.createElement(c,Object.assign({},u,{ref:n}),i.createElement(Ws.Provider,{value:f},o))}));function $s(t){return t.value}function Ys(t,e){return t.layout.min-e.layout.min}function Xs(t){const n=R(()=>Ko(t)),{isStatic:o}=e.useContext(f);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Gs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=pn(i,r,Object.assign({mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0)},s));var l;return e?a(o):a}function qs(t,e){const n=Xs(e()),o=()=>n.set(e());return o(),function(t,e){y(()=>{const n=t.map(t=>t.onChange(e));return()=>n.forEach(t=>t())})}(t,()=>Hn.update(o,!1,!0)),n}function Zs(t,e,n,o){const i="function"==typeof e?e:Gs(e,n,o);return Array.isArray(t)?Ks(t,i):Ks([t],([t])=>i(t))}function Ks(t,e){const n=R(()=>[]);return qs(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function _s(t,e=0){return J(t)?t:Xs(e)}const Js={Group:Hs,Item:e.forwardRef((function(t,n){var{children:o,style:r,value:s,as:a="li",onDrag:l,layout:u=!0}=t,c=Gt(t,["children","style","value","as","onDrag","layout"]);const d=R(()=>js(a)),h=e.useContext(Ws),f={x:_s(null==r?void 0:r.x),y:_s(null==r?void 0:r.y)},p=Zs([f.x,f.y],([t,e])=>t||e?1:"unset"),m=e.useRef(null),{axis:g,registerItem:v,updateOrder:y}=h;return e.useEffect(()=>{v(s,m.current)},[h]),i.createElement(d,Object.assign({drag:g},c,{dragSnapToOrigin:!0,style:Object.assign(Object.assign({},r),{x:f.x,y:f.y,zIndex:p}),layout:u,onDrag:(t,e)=>{const{velocity:n}=e;n[g]&&y(s,f[g].get(),n[g]),null==l||l(t,e)},onLayoutMeasure:t=>{m.current=t},ref:n}),o)}))},Qs=Object.assign(Object.assign({renderer:Cr},bi),wo),ta=Object.assign(Object.assign(Object.assign(Object.assign({},Qs),sr),Fr),{projectionNodeConstructor:Ts});const ea=t=>"number"==typeof t;function na(t,e){return(t=>Array.isArray(t)&&!ea(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const oa=(t,e,n)=>-n*t+n*e+t,ia=t=>t,ra=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function sa(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=ra(0,e,o);t.push(oa(n,1,i))}}function aa(t){const e=[0];return sa(e,t-1),e}function la(t,e=aa(t.length),n=ia){const o=t.length,i=o-e.length;return i>0&&sa(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=ra(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=na(n,r)(s),oa(t[r],t[r+1],s)}}const ua=t=>"function"==typeof t,ca=t=>"string"==typeof t;function da(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 ha={any:0,all:1};const fa=new WeakMap;let pa;function ma({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=fa.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 ga(t){t.forEach(ma)}function va(t,e){pa||"undefined"!=typeof ResizeObserver&&(pa=new ResizeObserver(ga));const n=da(t);return n.forEach(t=>{let n=fa.get(t);n||(n=new Set,fa.set(t,n)),n.add(e),null==pa||pa.observe(t)}),()=>{n.forEach(t=>{const n=fa.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==pa||pa.unobserve(t)})}}const ya=new Set;let xa;function ba(t){return ya.add(t),xa||(xa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ya.forEach(t=>t(e))},window.addEventListener("resize",xa)),()=>{ya.delete(t),!ya.size&&xa&&(xa=void 0)}}const Ea={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function wa(t,e,n,o){const i=n[e],{length:r,position:s}=Ea[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=ra(0,i.scrollLength,i.current);const u=o-l;var c,d;i.velocity=u>50?0:(c=i.current-a,(d=u)?c*(1e3/d):0)}const Aa={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Sa={start:0,center:.5,end:1};function Pa(t,e,n=0){let o=0;if(void 0!==Sa[t]&&(t=Sa[t]),ca(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 ea(t)&&(o=e*t),n+o}const Ta=[0,0];function Oa(t,e,n,o){let i=Array.isArray(t)?t:Ta,r=0,s=0;return ea(t)?i=[t,t]:ca(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Sa[t]?t:"0"]),r=Pa(i[0],n,o),s=Pa(i[1],e),r-s}const ja={x:0,y:0};function Va(t,e,n){let{offset:o=Aa.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==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}(i,t):ja,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const d=o.length;for(let t=0;t<d;t++){const n=Oa(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=la(aa(d),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function Ca(t,e,n,o={}){const i=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){wa(t,"x",e,n),wa(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Va(t,n,o)},notify:ua(e)?()=>e(n):Ma(e,n[i])}}function Ma(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=ia),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const Ra=new WeakMap,La=new WeakMap,ka=new WeakMap,Da=t=>t===document.documentElement?window:t;function Fa(t,e={}){var{container:n=document.documentElement}=e,o=Gt(e,["container"]);let i=ka.get(n);i||(i=new Set,ka.set(n,i));const r=Ca(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(i.add(r),!Ra.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};Ra.set(n,t);const e=Da(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&La.set(n,function(t,e){return ua(t)?ba(t):va(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Ra.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=ka.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=Ra.get(n);Ra.delete(n),i&&(Da(n).removeEventListener("scroll",i),null===(e=La.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const Ia=()=>({scrollX:Ko(0),scrollY:Ko(0),scrollXProgress:Ko(0),scrollYProgress:Ko(0)});function Ba(t={}){var{container:e,target:n}=t,o=Gt(t,["container","target"]);const i=R(Ia);return y(()=>Fa(({x:t,y:e})=>{i.scrollX.set(t.current),i.scrollXProgress.set(t.progress),i.scrollY.set(e.current),i.scrollYProgress.set(e.progress)},Object.assign(Object.assign({},o),{container:(null==e?void 0:e.current)||void 0,target:(null==n?void 0:n.current)||void 0})),[]),i}function Ua(t){const n=e.useRef(0),{isStatic:o}=e.useContext(f);e.useEffect(()=>{if(o)return;const e=({timestamp:e})=>{n.current||(n.current=e),t(e-n.current)};return Hn.update(e,!0),()=>$n.update(e)},[t])}function za(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(ui(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?ii(t,e):"string"==typeof e?ii(t,[e]):oi(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 Na(){const t=R(za);return e.useEffect(t.mount,[]),t}const Wa=Na;class Ha{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 $a=()=>new Ha;function Ya(){return Xa}function Xa(t){Ps.current&&(Ps.current.isUpdating=!1,Ps.current.blockUpdate(),null==t||t())}const Ga=()=>({}),qa=lr({build(){},measureViewportBox:zi,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:Ga,readValueFromInstance:(t,e,n)=>n.initialState[e]||0,makeTargetAnimatable(t,e){var{transition:n,transitionEnd:o}=e,i=Gt(e,["transition","transitionEnd"]);return ri(t,i,ai(i,n||{},t)),Object.assign({transition:n,transitionEnd:o},i)}}),Za=fe({scrapeMotionValuesFromProps:Ga,createRenderState:Ga});const Ka=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:r,exitBeforeEnter:a,presenceAffectsLayout:l=!0})=>{let[u]=Ms();const c=e.useContext(D).forceRender;c&&(u=c);const d=Cs(),h=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=h;const p=new Set,m=e.useRef(f),g=e.useRef(new Map).current,v=e.useRef(!0);if(y(()=>{v.current=!1,function(t,e){t.forEach(t=>{const n=ks(t);e.set(n,t)})}(h,g),m.current=f}),ze(()=>{v.current=!0,g.clear(),p.clear()}),v.current)return i.createElement(i.Fragment,null,f.map(t=>i.createElement(Rs,{key:ks(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:l},t)));f=[...f];const x=m.current.map(ks),b=h.map(ks),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&p.add(e)}return a&&p.size&&(f=[]),p.forEach(t=>{if(-1!==b.indexOf(t))return;const e=g.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,i.createElement(Rs,{key:ks(e),isPresent:!1,onExitComplete:()=>{g.delete(t),p.delete(t);const e=m.current.findIndex(e=>e.key===t);if(m.current.splice(e,1),!p.size){if(m.current=h,!1===d.current)return;u(),r&&r()}},custom:n,presenceAffectsLayout:l},e))}),f=f.map(t=>{const e=t.key;return p.has(e)?t:i.createElement(Rs,{key:ks(t),isPresent:!0,presenceAffectsLayout:l},t)}),"production"!==s&&a&&f.length>1&&console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."),i.createElement(i.Fragment,null,p.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),i.createElement(Us,{id:R(()=>"asl-"+zs++)},t)),t.DeprecatedLayoutGroupContext=Ds,t.DragControls=Ha,t.FlatTree=rs,t.LayoutGroup=Us,t.LayoutGroupContext=D,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,r]=e.useState(!Ns(n)),s=e.useRef(void 0);if(!Ns(n)){const{renderer:t}=n,e=Gt(n,["renderer"]);s.current=t,u(e)}return e.useEffect(()=>{Ns(n)&&n().then(t=>{var{renderer:e}=t;u(Gt(t,["renderer"])),s.current=e,r(!0)})},[]),i.createElement(c.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function(t){var{children:n,isValidProp:o}=t,r=Gt(t,["children","isValidProp"]);o&&Yt(o),(r=Object.assign(Object.assign({},e.useContext(f)),r)).isStatic=R(()=>r.isStatic);const s=e.useMemo(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion]);return i.createElement(f.Provider,{value:s},n)},t.MotionConfigContext=f,t.MotionContext=p,t.MotionValue=Zo,t.PresenceContext=g,t.Reorder=Js,t.SwitchLayoutGroupContext=F,t.addPointerEvent=Me,t.addScaleCorrector=H,t.animate=Ir,t.animateVisualElement=ui,t.animationControls=za,t.animations=bi,t.calcLength=ji,t.checkTargetForNewValues=ri,t.createBox=zi,t.createDomMotionComponent=function(t){return B(ve(t,{forwardMotionProps:!1},Os,Cr,Ts))},t.createMotionComponent=B,t.domAnimation=Qs,t.domMax=ta,t.filterProps=Xt,t.isBrowser=v,t.isDragActive=Ie,t.isMotionValue=J,t.isValidMotionProp=Ht,t.m=Vs,t.makeUseVisualState=fe,t.motion=js,t.motionValue=Ko,t.resolveMotionValue=de,t.transform=Gs,t.useAnimation=Wa,t.useAnimationControls=Na,t.useAnimationFrame=Ua,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=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,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=Za({},!1),r=R(()=>qa({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),r.unmount),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o(Object.assign({},t))}})},[o,r]),[n,R(()=>t=>ui(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Xs(1),n=Xs(1);const o=m();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Zs(e,Ka),scaleY:Zs(n,Ka)}},t.useDomEvent=be,t.useDragControls=function(){return R($a)},t.useElementScroll=function(t){return ho(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Ba({container:t})},t.useForceUpdate=Ms,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{var e;if(!t.current||r&&s)return;const l={root:null!==(e=null==n?void 0:n.current)&&void 0!==e?e:void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=da(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);ua(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 i?i:ha[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),l)},[n,t,o,r]),s},t.useInstantLayoutTransition=Ya,t.useInstantTransition=function(){const[t,n]=Ms(),o=Ya();return e.useEffect(()=>{Hn.postRender(()=>Hn.postRender(()=>Io.current=!1))},[n]),e=>{o(()=>{Io.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(g))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return qs(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=Xs,t.usePresence=Ao,t.useReducedMotion=E,t.useReducedMotionConfig=w,t.useResetProjection=function(){return i.useCallback(()=>{const t=Ps.current;t&&t.resetTree()},[])},t.useScroll=Ba,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(f),i=e.useRef(null),r=Xs(J(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=Jn(Object.assign(Object.assign({from:r.get(),to:t,velocity:r.getVelocity()},n),{onUpdate:e})),r.get())),[JSON.stringify(n)]),function(t,e){y(()=>{if(J(t))return t.onChange(e)},[e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=Xs(0);return Ua(e=>t.set(e)),t},t.useTransform=Zs,t.useUnmountEffect=ze,t.useVelocity=function(t){const n=Xs(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return ho(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Ba()},t.useVisualElementContext=m,t.visualElement=lr,t.wrapHandler=Oe,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 i=o(e),r=n(e);const s=("undefined"==typeof process||process.env,"production"),a=t=>({isEnabled:e=>t.some(t=>!!e[t])}),l={measureLayout:a(["layout","layoutId","drag"]),animation:a(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:a(["exit"]),drag:a(["drag","dragControls"]),focus:a(["whileFocus"]),hover:a(["whileHover","onHoverStart","onHoverEnd"]),tap:a(["whileTap","onTap","onTapStart","onTapCancel"]),pan:a(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:a(["whileInView","onViewportEnter","onViewportLeave"])};function u(t){for(const e in t)null!==t[e]&&("projectionNodeConstructor"===e?l.projectionNodeConstructor=t[e]:l[e].Component=t[e])}const c=e.createContext({strict:!1}),d=Object.keys(l),h=d.length;const f=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),p=e.createContext({});function m(){return e.useContext(p).visualElement}const g=e.createContext(null),v="undefined"!=typeof document,y=v?e.useLayoutEffect:e.useEffect,x={current:null};let b=!1;function E(){!b&&function(){if(b=!0,v)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>x.current=t.matches;t.addListener(e),e()}else x.current=!1}();const[t]=e.useState(x.current);return t}function w(){const t=E(),{reducedMotion:n}=e.useContext(f);return"never"!==n&&("always"===n||t)}function S(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function A(t){return Array.isArray(t)}function P(t){return"string"==typeof t||A(t)}function T(t,e,n,o={},i={}){var r;return"function"==typeof e&&(e=e(null!=n?n:t.custom,o,i)),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e&&(e=e(null!=n?n:t.custom,o,i)),e}function O(t,e,n){const o=t.getProps();return T(o,e,null!=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 j(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||P(t.initial)||P(t.animate)||P(t.whileHover)||P(t.whileDrag)||P(t.whileTap)||P(t.whileFocus)||P(t.exit)}function V(t){return Boolean(j(t)||t.variants)}function C(t){const{initial:n,animate:o}=function(t,e){if(j(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(p));return e.useMemo(()=>({initial:n,animate:o}),[M(n),M(o)])}function M(t){return Array.isArray(t)?t.join(" "):t}function R(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const L={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let k=1;const D=e.createContext({}),F=e.createContext({});class I extends r.default.Component{getSnapshotBeforeUpdate(){return this.updateProps(),null}componentDidUpdate(){}updateProps(){const{visualElement:t,props:e}=this.props;t&&t.setProps(e)}render(){return this.props.children}}function B({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:r,useVisualState:a,Component:x}){return t&&u(t),e.forwardRef((function(u,b){const E=function({layoutId:t}){var n;const o=null===(n=e.useContext(D))||void 0===n?void 0:n.id;return o&&void 0!==t?o+"-"+t:t}(u);u=Object.assign(Object.assign({},u),{layoutId:E});const A=e.useContext(f);let P=null;const T=C(u),O=A.isStatic?void 0:R(()=>{if(L.hasEverUpdated)return k++}),j=a(u,A.isStatic);return!A.isStatic&&v&&(T.visualElement=function(t,n,o,i){const r=e.useContext(c),s=m(),a=e.useContext(g),l=w(),u=e.useRef(void 0);i||(i=r.renderer),!u.current&&i&&(u.current=i(t,{visualState:n,parent:s,props:o,presenceId:null==a?void 0:a.id,blockInitialAnimation:!1===(null==a?void 0:a.initial),shouldReduceMotion:l}));const d=u.current;return y(()=>{null==d||d.syncRender()}),e.useEffect(()=>{var t;null===(t=null==d?void 0:d.animationState)||void 0===t||t.animateChanges()}),y(()=>()=>null==d?void 0:d.notifyUnmount(),[]),d}(x,j,Object.assign(Object.assign({},A),u),n),function(t,{layoutId:n,layout:o,drag:i,dragConstraints:r,layoutScroll:s},a,l){var u;const c=e.useContext(F);l&&a&&!(null==a?void 0:a.projection)&&(a.projection=new l(t,a.getLatestValues(),null===(u=a.parent)||void 0===u?void 0:u.projection),a.projection.setOptions({layoutId:n,layout:o,alwaysMeasureLayout:Boolean(i)||r&&S(r),visualElement:a,scheduleRender:()=>a.scheduleRender(),animationType:"string"==typeof o?o:"both",initialPromotionConfig:c,layoutScroll:s}))}(O,u,T.visualElement,o||l.projectionNodeConstructor),P=function(t,n,o){const r=[],a=e.useContext(c);if(!n)return null;"production"!==s&&o&&a.strict;for(let e=0;e<h;e++){const o=d[e],{isEnabled:s,Component:a}=l[o];s(t)&&a&&r.push(i.createElement(a,Object.assign({key:o},t,{visualElement:n})))}return r}(u,T.visualElement,t)),i.createElement(I,{visualElement:T.visualElement,props:Object.assign(Object.assign({},A),u)},P,i.createElement(p.Provider,{value:T},r(x,u,O,function(t,n,o){return e.useCallback(e=>{var i;e&&(null===(i=t.mount)||void 0===i||i.call(t,e)),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):S(o)&&(o.current=e))},[n])}(j,T.visualElement,b),j,A.isStatic,T.visualElement)))}))}function U(t){function e(e,n={}){return B(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 z=["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 N(t){return"string"==typeof t&&!t.includes("-")&&!!(z.indexOf(t)>-1||/[A-Z]/.test(t))}const W={};function H(t){Object.assign(W,t)}const $=["","X","Y","Z"],Y=["transformPerspective","x","y","z"];function X(t,e){return Y.indexOf(t)-Y.indexOf(e)}["translate","scale","rotate","skew"].forEach(t=>$.forEach(e=>Y.push(t+e)));const G=new Set(Y);function q(t){return G.has(t)}const Z=new Set(["originX","originY","originZ"]);function K(t){return Z.has(t)}function _(t,{layout:e,layoutId:n}){return q(t)||K(t)||(e||void 0!==n)&&(!!W[t]||"opacity"===t)}const J=t=>Boolean(null!==t&&"object"==typeof t&&t.getVelocity),Q={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function tt(t){return t.startsWith("--")}const et=(t,e)=>e&&"number"==typeof t?e.transform(t):t,nt=(t,e)=>n=>Math.max(Math.min(n,e),t),ot=t=>t%1?Number(t.toFixed(5)):t,it=/(-)?([\d]*\.?[\d])+/g,rt=/(#[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,st=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function at(t){return"string"==typeof t}const lt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ut=Object.assign(Object.assign({},lt),{transform:nt(0,1)}),ct=Object.assign(Object.assign({},lt),{default:1}),dt=t=>({test:e=>at(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ht=dt("deg"),ft=dt("%"),pt=dt("px"),mt=dt("vh"),gt=dt("vw"),vt=Object.assign(Object.assign({},ft),{parse:t=>ft.parse(t)/100,transform:t=>ft.transform(100*t)}),yt=(t,e)=>n=>Boolean(at(n)&&st.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),xt=(t,e,n)=>o=>{if(!at(o))return o;const[i,r,s,a]=o.match(it);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},bt={test:yt("hsl","hue"),parse:xt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+ft.transform(ot(e))+", "+ft.transform(ot(n))+", "+ot(ut.transform(o))+")"},Et=nt(0,255),wt=Object.assign(Object.assign({},lt),{transform:t=>Math.round(Et(t))}),St={test:yt("rgb","red"),parse:xt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+wt.transform(t)+", "+wt.transform(e)+", "+wt.transform(n)+", "+ot(ut.transform(o))+")"};const At={test:yt("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:St.transform},Pt={test:t=>St.test(t)||At.test(t)||bt.test(t),parse:t=>St.test(t)?St.parse(t):bt.test(t)?bt.parse(t):At.parse(t),transform:t=>at(t)?t:t.hasOwnProperty("red")?St.transform(t):bt.transform(t)};function Tt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(rt);o&&(n=o.length,t=t.replace(rt,"${c}"),e.push(...o.map(Pt.parse)));const i=t.match(it);return i&&(t=t.replace(it,"${n}"),e.push(...i.map(lt.parse))),{values:e,numColors:n,tokenised:t}}function Ot(t){return Tt(t).values}function jt(t){const{values:e,numColors:n,tokenised:o}=Tt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?Pt.transform(t[o]):ot(t[o]));return e}}const Vt=t=>"number"==typeof t?0:t;const Ct={test:function(t){var e,n,o,i;return isNaN(t)&&at(t)&&(null!==(n=null===(e=t.match(it))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(rt))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:Ot,createTransformer:jt,getAnimatableNone:function(t){const e=Ot(t);return jt(t)(e.map(Vt))}},Mt=new Set(["brightness","contrast","saturate","opacity"]);function Rt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(it)||[];if(!o)return t;const i=n.replace(o,"");let r=Mt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const Lt=/([a-z-]*)\(.*?\)/g,kt=Object.assign(Object.assign({},Ct),{getAnimatableNone:t=>{const e=t.match(Lt);return e?e.map(Rt).join(" "):t}}),Dt=Object.assign(Object.assign({},lt),{transform:Math.round}),Ft={borderWidth:pt,borderTopWidth:pt,borderRightWidth:pt,borderBottomWidth:pt,borderLeftWidth:pt,borderRadius:pt,radius:pt,borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomRightRadius:pt,borderBottomLeftRadius:pt,width:pt,maxWidth:pt,height:pt,maxHeight:pt,size:pt,top:pt,right:pt,bottom:pt,left:pt,padding:pt,paddingTop:pt,paddingRight:pt,paddingBottom:pt,paddingLeft:pt,margin:pt,marginTop:pt,marginRight:pt,marginBottom:pt,marginLeft:pt,rotate:ht,rotateX:ht,rotateY:ht,rotateZ:ht,scale:ct,scaleX:ct,scaleY:ct,scaleZ:ct,skew:ht,skewX:ht,skewY:ht,distance:pt,translateX:pt,translateY:pt,translateZ:pt,x:pt,y:pt,z:pt,perspective:pt,transformPerspective:pt,opacity:ut,originX:vt,originY:vt,originZ:pt,zIndex:Dt,fillOpacity:ut,strokeOpacity:ut,numOctaves:Dt};function It(t,e,n,o){var i;const{style:r,vars:s,transform:a,transformKeys:l,transformOrigin:u}=t;l.length=0;let c=!1,d=!1,h=!0;for(const t in e){const n=e[t];if(tt(t)){s[t]=n;continue}const o=Ft[t],f=et(n,o);if(q(t)){if(c=!0,a[t]=f,l.push(t),!h)continue;n!==(null!==(i=o.default)&&void 0!==i?i:0)&&(h=!1)}else K(t)?(u[t]=f,d=!0):r[t]=f}c?r.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(X);let a=!1;const l=e.length;for(let n=0;n<l;n++){const o=e[n];s+=`${Q[o]||o}(${t[o]}) `,"z"===o&&(a=!0)}return!a&&n&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}(t,n,h,o):o?r.transform=o({},""):!e.transform&&r.transform&&(r.transform="none"),d&&(r.transformOrigin=function({originX:t="50%",originY:e="50%",originZ:n=0}){return`${t} ${e} ${n}`}(u))}const Bt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Ut(t,e,n){for(const o in e)J(e[o])||_(o,n)||(t[o]=e[o])}function zt(t,n,o){let i={};return Ut(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};It(e,n,{enableHardwareAcceleration:!o},t);const{vars:i,style:r}=e;return Object.assign(Object.assign({},i),r)},[n])}(t,n,o)),t.transformValues&&(i=t.transformValues(i)),i}function Nt(t,e,n){const o={},i=zt(t,e,n);return Boolean(t.drag)&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const Wt=new Set(["initial","animate","exit","style","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","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function Ht(t){return Wt.has(t)}let $t=t=>!Ht(t);function Yt(t){t&&($t=e=>e.startsWith("on")?!Ht(e):t(e))}try{Yt(require("@emotion/is-prop-valid").default)}catch(t){}function Xt(t,e,n){const o={};for(const i in t)($t(i)||!0===n&&Ht(i)||!e&&!Ht(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function Gt(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 i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}function qt(t,e,n){return"string"==typeof t?t:pt.transform(e+n*t)}const Zt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Kt={offset:"strokeDashoffset",array:"strokeDasharray"};function _t(t,e,n,o){var{attrX:i,attrY:r,originX:s,originY:a,pathLength:l,pathSpacing:u=1,pathOffset:c=0}=e;It(t,Gt(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o),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!==s||void 0!==a||h.transform)&&(h.transformOrigin=function(t,e,n){return`${qt(e,t.x,t.width)} ${qt(n,t.y,t.height)}`}(f,void 0!==s?s:.5,void 0!==a?a:.5)),void 0!==i&&(d.x=i),void 0!==r&&(d.y=r),void 0!==l&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Zt:Kt;t[r.offset]=pt.transform(-o);const s=pt.transform(e),a=pt.transform(n);t[r.array]=`${s} ${a}`}(d,l,u,c,!1)}const Jt=()=>Object.assign(Object.assign({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}});function Qt(t,n){const o=e.useMemo(()=>{const e=Jt();return _t(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),Object.assign(Object.assign({},e.attrs),{style:Object.assign({},e.style)})},[n]);if(t.style){const e={};Ut(e,t.style,t),o.style=Object.assign(Object.assign({},e),o.style)}return o}function te(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(N(n)?Qt:Nt)(o,s,a),u=Xt(o,"string"==typeof n,t),c=Object.assign(Object.assign(Object.assign({},u),l),{ref:r});return i&&(c["data-projection-id"]=i),e.createElement(n,c)}}const ee=/([a-z])([A-Z])/g,ne=t=>t.replace(ee,"$1-$2").toLowerCase();function oe(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const ie=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function re(t,e,n,o){oe(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(ie.has(n)?n:ne(n),e.attrs[n])}function se(t){const{style:e}=t,n={};for(const o in e)(J(e[o])||_(o,t))&&(n[o]=e[o]);return n}function ae(t){const e=se(t);for(const n in t)if(J(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function le(t){return"object"==typeof t&&"function"==typeof t.start}const ue=t=>Array.isArray(t),ce=t=>ue(t)?t[t.length-1]||0:t;function de(t){const e=J(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}function he({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:pe(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}const fe=t=>(n,o)=>{const i=e.useContext(p),r=e.useContext(g);return o?he(t,n,i,r):R(()=>he(t,n,i,r))};function pe(t,e,n,o){const i={},r=!1===(null==n?void 0:n.initial),s=o(t);for(const t in s)i[t]=de(s[t]);let{initial:a,animate:l}=t;const u=j(t),c=V(t);e&&c&&!u&&!1!==t.inherit&&(null!=a||(a=e.initial),null!=l||(l=e.animate));const d=r||!1===a,h=d?l:a;if(h&&"boolean"!=typeof h&&!le(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=T(t,e);if(!n)return;const{transitionEnd:o,transition:r}=n,s=Gt(n,["transitionEnd","transition"]);for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[d?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const me={useVisualState:fe({scrapeMotionValuesFromProps:ae,createRenderState:Jt,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}}_t(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),re(e,n)}})},ge={useVisualState:fe({scrapeMotionValuesFromProps:se,createRenderState:Bt})};function ve(t,{forwardMotionProps:e=!1},n,o,i){const r=N(t)?me:ge;return Object.assign(Object.assign({},r),{preloadedFeatures:n,useRender:te(e),createVisualElement:o,projectionNodeConstructor:i,Component:t})}var ye;function xe(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function be(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return xe(e,n,o,i)},[t,n,o,i])}function Ee(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function we(t){return!!t.touches}t.AnimationType=void 0,(ye=t.AnimationType||(t.AnimationType={})).Animate="animate",ye.Hover="whileHover",ye.Tap="whileTap",ye.Drag="whileDrag",ye.Focus="whileFocus",ye.InView="whileInView",ye.Exit="exit";const Se={pageX:0,pageY:0};function Ae(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||Se;return{x:n[e+"X"],y:n[e+"Y"]}}function Pe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function Te(t,e="page"){return{point:we(t)?Ae(t,e):Pe(t,e)}}const Oe=(t,e=!1)=>{const n=e=>t(e,Te(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},je={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 Ce(t){return v&&null===window.onpointerdown?t:v&&null===window.ontouchstart?Ve[t]:v&&null===window.onmousedown?je[t]:t}function Me(t,e,n,o){return xe(t,Ce(e),Oe(n,"pointerdown"===e),o)}function Re(t,e,n,o){return be(t,Ce(e),n&&Oe(n,"pointerdown"===e),o)}function Le(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ke=Le("dragHorizontal"),De=Le("dragVertical");function Fe(t){let e=!1;if("y"===t)e=De();else if("x"===t)e=ke();else{const t=ke(),n=De();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ie(){const t=Fe(!0);return!t||(t(),!1)}function Be(e,n,o){return(i,r)=>{var s;Ee(i)&&!Ie()&&(null===(s=e.animationState)||void 0===s||s.setActive(t.AnimationType.Hover,n),null==o||o(i,r))}}const Ue=(t,e)=>!!e&&(t===e||Ue(t,e.parentElement));function ze(t){return e.useEffect(()=>()=>t(),[])}const Ne=(t,e,n)=>Math.min(Math.max(n,t),e);function We({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=Ne(.05,1,s),t=Ne(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/He(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=He(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=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}(i,r,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 He(t,e){return t*Math.sqrt(1-e*e)}const $e=["duration","bounce"],Ye=["stiffness","damping","mass"];function Xe(t,e){return e.some(e=>void 0!==t[e])}function Ge(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=Gt(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(!Xe(t,Ye)&&Xe(t,$e)){const n=We(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),f=qe,p=qe;function m(){const t=c?-c/1e3:0,o=n-e,r=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=He(s,r);f=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},p=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)f=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);f=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*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 r=1e3*p(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}Ge.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const qe=t=>0,Ze=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ke=(t,e,n)=>-n*t+n*e+t;function _e(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 Je({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=_e(a,o,t+1/3),r=_e(a,o,t),s=_e(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const Qe=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},tn=[At,St,bt],en=t=>tn.find(e=>e.test(t)),nn=(t,e)=>{let n=en(t),o=en(e),i=n.parse(t),r=o.parse(e);n===bt&&(i=Je(i),n=St),o===bt&&(r=Je(r),o=St);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=Qe(i[e],r[e],t));return s.alpha=Ke(i.alpha,r.alpha,t),n.transform(s)}},on=t=>"number"==typeof t,rn=(t,e)=>n=>e(t(n)),sn=(...t)=>t.reduce(rn);function an(t,e){return on(t)?n=>Ke(t,e,n):Pt.test(t)?nn(t,e):dn(t,e)}const ln=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>an(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},un=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=an(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function cn(t){const e=Ct.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const dn=(t,e)=>{const n=Ct.createTransformer(e),o=cn(t),i=cn(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?sn(ln(o.parsed,i.parsed),n):n=>""+(n>0?e:t)},hn=(t,e)=>n=>Ke(t,e,n);function fn(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?hn:"string"==typeof r?Pt.test(r)?nn:dn:Array.isArray(r)?ln:"object"==typeof r?un:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=sn(t,r)}o.push(r)}return o}function pn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=fn(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Ze(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Ze(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(Ne(t[0],t[r-1],e)):a}const mn=t=>e=>1-t(1-e),gn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,vn=t=>e=>e*e*((t+1)*e-t),yn=t=>t,xn=(bn=2,t=>Math.pow(t,bn));var bn;const En=mn(xn),wn=gn(xn),Sn=t=>1-Math.sin(Math.acos(t)),An=mn(Sn),Pn=gn(An),Tn=vn(1.525),On=mn(Tn),jn=gn(Tn),Vn=(t=>{const e=vn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),Cn=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},Mn=mn(Cn);function Rn(t,e){return t.map(()=>e||wn).splice(0,t.length-1)}function Ln({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={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),i);function l(){return pn(a,s,{ease:Array.isArray(n)?n:Rn(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}}const kn={keyframes:Ln,spring:Ge,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const Dn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Fn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Dn()),1/60*1e3);let In=!0,Bn=!1,Un=!1;const zn={delta:0,timestamp:0},Nn=["read","update","preRender","render","postRender"],Wn=Nn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!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())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Bn=!0),t),{}),Hn=Nn.reduce((t,e)=>{const n=Wn[e];return t[e]=(t,e=!1,o=!1)=>(Bn||qn(),n.schedule(t,e,o)),t},{}),$n=Nn.reduce((t,e)=>(t[e]=Wn[e].cancel,t),{}),Yn=Nn.reduce((t,e)=>(t[e]=()=>Wn[e].process(zn),t),{}),Xn=t=>Wn[t].process(zn),Gn=t=>{Bn=!1,zn.delta=In?1/60*1e3:Math.max(Math.min(t-zn.timestamp,40),1),zn.timestamp=t,Un=!0,Nn.forEach(Xn),Un=!1,Bn&&(In=!1,Fn(Gn))},qn=()=>{Bn=!0,In=!0,Un||Fn(Gn)},Zn=()=>zn;function Kn(t,e,n=0){return t-e-n}const _n=t=>{const e=({delta:e})=>t(e);return{start:()=>Hn.update(e,!0),stop:()=>$n.update(e)}};function Jn(t){var e,n,{from:o,autoplay:i=!0,driver:r=_n,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:d,onComplete:h,onRepeat:f,onUpdate:p}=t,m=Gt(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 Ln;if(kn[t.type])return kn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ln:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ge:Ln}(m);(null===(n=(e=A).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=pn([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?Kn(e+-t,e,n):e-(t-e)+n}(s,E,u,S)):(s=Kn(s,E,u),"mirror"===l&&P.flipTarget()),w=!1,f&&f()}function O(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 i&&(null==c||c(),g=r(O),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function Qn(t,e){return e?t*(1e3/e):0}const to=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),eo=t=>to(t)&&t.hasOwnProperty("z"),no=(t,e)=>Math.abs(t-e);function oo(t,e){if(on(t)&&on(e))return no(t,e);if(to(t)&&to(e)){const n=no(t.x,e.x),o=no(t.y,e.y),i=eo(t)&&eo(e)?no(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const io=(t,e)=>1-3*e+3*t,ro=(t,e)=>3*e-6*t,so=t=>3*t,ao=(t,e,n)=>((io(e,n)*t+ro(e,n))*t+so(e))*t,lo=(t,e,n)=>3*io(e,n)*t*t+2*ro(e,n)*t+so(e);function uo(t,e,n,o){if(t===e&&n===o)return yn;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=ao(.1*e,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=.1;--r;const s=o+.1*((e-i[r])/(i[r+1]-i[r])),a=lo(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=lo(e,n,o);if(0===i)return e;e-=(ao(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=ao(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:ao(r(t),e,o)}const co=new Set;function ho(t,e,n){t||co.has(e)||(console.warn(e),n&&console.warn(n),co.add(e))}const fo=new WeakMap,po=new WeakMap,mo=t=>{var e;null===(e=fo.get(t.target))||void 0===e||e(t)},go=t=>{t.forEach(mo)};function vo(t,e,n){const o=function(t){var{root:e}=t,n=Gt(t,["root"]);const o=e||document;po.has(o)||po.set(o,{});const i=po.get(o),r=JSON.stringify(n);return i[r]||(i[r]=new IntersectionObserver(go,Object.assign({root:e},n))),i[r]}(e);return fo.set(t,n),o.observe(t),()=>{fo.delete(t),o.unobserve(t)}}const yo={some:0,all:1};function xo(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:yo[a]};return vo(i.getInstance(),e,e=>{var n;const{isIntersecting:r}=e;if(o.isInView===r)return;if(o.isInView=r,l&&!r&&o.hasEnteredView)return;r&&(o.hasEnteredView=!0),null===(n=i.animationState)||void 0===n||n.setActive(t.AnimationType.InView,r);const s=i.getProps(),a=r?s.onViewportEnter:s.onViewportLeave;null==a||a(e)})},[n,r,s,a])}function bo(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==s&&ho(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{var e;o.hasEnteredView=!0;const{onViewportEnter:n}=i.getProps();null==n||n(null),null===(e=i.animationState)||void 0===e||e.setActive(t.AnimationType.InView,!0)}))},[n])}const Eo=t=>e=>(t(e),null),wo={inView:Eo((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?bo:xo)(a,s.current,t,r)})),tap:Eo((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||m)};function d(){var t;null===(t=u.current)||void 0===t||t.call(u),u.current=null}function h(){var e;return d(),l.current=!1,null===(e=s.animationState)||void 0===e||e.setActive(t.AnimationType.Tap,!1),!Ie()}function f(t,e){h()&&(Ue(s.getInstance(),t.target)?null==n||n(t,e):null==i||i(t,e))}function p(t,e){h()&&(null==i||i(t,e))}function m(e,n){var i;d(),l.current||(l.current=!0,u.current=sn(Me(window,"pointerup",f,c),Me(window,"pointercancel",p,c)),null===(i=s.animationState)||void 0===i||i.setActive(t.AnimationType.Tap,!0),null==o||o(e,n))}Re(s,"pointerdown",a?m:void 0,c),ze(d)})),focus:Eo((function({whileFocus:e,visualElement:n}){be(n,"focus",e?()=>{var e;null===(e=n.animationState)||void 0===e||e.setActive(t.AnimationType.Focus,!0)}:void 0),be(n,"blur",e?()=>{var e;null===(e=n.animationState)||void 0===e||e.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:Eo((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){Re(o,"pointerenter",t||n?Be(o,!0,t):void 0,{passive:!t}),Re(o,"pointerleave",e||n?Be(o,!1,e):void 0,{passive:!e})}))};function So(){const t=e.useContext(g);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>null==o?void 0:o(r)]:[!0]}function Ao(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,To={linear:yn,easeIn:xn,easeInOut:wn,easeOut:En,circIn:Sn,circInOut:Pn,circOut:An,backIn:Tn,backInOut:jn,backOut:On,anticipate:Vn,bounceIn:Mn,bounceInOut:t=>t<.5?.5*(1-Cn(1-2*t)):.5*Cn(2*t-1)+.5,bounceOut:Cn},Oo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return uo(e,n,o,i)}return"string"==typeof t?To[t]:t},jo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ct.test(e)||e.startsWith("url("))),Vo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Co=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Mo=()=>({type:"keyframes",ease:"linear",duration:.3}),Ro=t=>({type:"keyframes",duration:.8,values:t}),Lo={x:Vo,y:Vo,z:Vo,rotate:Vo,rotateX:Vo,rotateY:Vo,rotateZ:Vo,scaleX:Co,scaleY:Co,scale:Co,opacity:Mo,backgroundColor:Mo,color:Mo,default:Co},ko=Object.assign(Object.assign({},Ft),{color:Pt,backgroundColor:Pt,outlineColor:Pt,fill:Pt,stroke:Pt,borderColor:Pt,borderTopColor:Pt,borderRightColor:Pt,borderBottomColor:Pt,borderLeftColor:Pt,filter:kt,WebkitFilter:kt}),Do=t=>ko[t];function Fo(t,e){var n;let o=Do(t);return o!==kt&&(o=Ct),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Io={current:!1};function Bo(t){var{ease:e,times:n,yoyo:o,flip:i,loop:r}=t,s=Gt(t,["ease","times","yoyo","flip","loop"]);const a=Object.assign({},s);return n&&(a.offset=n),s.duration&&(a.duration=Po(s.duration)),s.repeatDelay&&(a.repeatDelay=Po(s.repeatDelay)),e&&(a.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Oo):Oo(e)),"tween"===s.type&&(a.type="keyframes"),(o||r||i)&&(o?a.repeatType="reverse":r?a.repeatType="loop":i&&(a.repeatType="mirror"),a.repeat=r||o||i||s.repeat),"spring"!==s.type&&(a.type="keyframes"),a}function Uo(t,e,n){var o;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function(t){var e=Gt(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object.assign(Object.assign({},t),((t,e)=>{let n;return n=ue(e)?Ro:Lo[t]||Lo.default,Object.assign({to:e},n(e))})(n,e.to))),Object.assign(Object.assign({},e),Bo(t))}function zo(t,e,n,o,i){var r;const s=Ho(o,t);let a=null!==(r=s.from)&&void 0!==r?r:e.get();const l=jo(t,n);"none"===a&&l&&"string"==typeof n?a=Fo(t,n):No(a)&&"string"==typeof n?a=Wo(n):!Array.isArray(n)&&No(n)&&"string"==typeof a&&(n=Wo(a));return jo(t,a)&&l&&!1!==s.type?function(){const o={from:a,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=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=Jn(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=i*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=Qn(t-c,Zn().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:m(o)?h:void 0})}return{stop:()=>null==p?void 0:p.stop()}}(Object.assign(Object.assign({},o),s)):Jn(Object.assign(Object.assign({},Uo(s,o,t)),{onUpdate:t=>{var e;o.onUpdate(t),null===(e=s.onUpdate)||void 0===e||e.call(s,t)},onComplete:()=>{var t;o.onComplete(),null===(t=s.onComplete)||void 0===t||t.call(s)}}))}:function(){var t,o;const r=ce(n);return e.set(r),i(),null===(t=null==s?void 0:s.onUpdate)||void 0===t||t.call(s,r),null===(o=null==s?void 0:s.onComplete)||void 0===o||o.call(s),{stop:()=>{}}}}function No(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Wo(t){return"number"==typeof t?0:Fo("",t)}function Ho(t,e){return t[e]||t.default||t}function $o(t,e,n,o={}){return Io.current&&(o={type:!1}),e.start(i=>{let r,s;const a=zo(t,e,n,o,i),l=function(t,e){var n,o;return null!==(o=null!==(n=(Ho(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),u=()=>s=a();return l?r=window.setTimeout(u,Po(l)):u(),()=>{clearTimeout(r),null==s||s.stop()}})}const Yo=t=>/^0[^.\s]+$/.test(t);function Xo(t,e){-1===t.indexOf(e)&&t.push(e)}function Go(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class qo{constructor(){this.subscriptions=[]}add(t){return Xo(this.subscriptions,t),()=>Go(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 i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Zo{constructor(t){var e;this.version="7.1.2",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new qo,this.velocityUpdateSubscribers=new qo,this.renderSubscribers=new qo,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Zn();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Hn.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=()=>Hn.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?Qn(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 Ko(t){return new Zo(t)}const _o=t=>e=>e.test(t),Jo=[lt,pt,ft,ht,gt,mt,{test:t=>"auto"===t,parse:t=>t}],Qo=t=>Jo.find(_o(t)),ti=[...Jo,Pt,Ct],ei=t=>ti.find(_o(t));function ni(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ko(n))}function oi(t,e){const n=O(t,e);let o=n?t.makeTargetAnimatable(n,!1):{},{transitionEnd:i={},transition:r={}}=o,s=Gt(o,["transitionEnd","transition"]);s=Object.assign(Object.assign({},s),i);for(const e in s){ni(t,e,ce(s[e]))}}function ii(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&oi(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{ii(t,e)})})}function ri(t,e,n){var o,i,r,s;const a=Object.keys(e).filter(e=>!t.hasValue(e)),l=a.length;if(l)for(let u=0;u<l;u++){const l=a[u],c=e[l];let d=null;Array.isArray(c)&&(d=c[0]),null===d&&(d=null!==(i=null!==(o=n[l])&&void 0!==o?o:t.readValue(l))&&void 0!==i?i:e[l]),null!=d&&("string"==typeof d&&(/^\-?\d*\.?\d+$/.test(d)||Yo(d))?d=parseFloat(d):!ei(d)&&Ct.test(c)&&(d=Fo(l,c)),t.addValue(l,Ko(d)),null!==(r=(s=n)[l])&&void 0!==r||(s[l]=d),t.setBaseTarget(l,d))}}function si(t,e){if(!e)return;return(e[t]||e.default||e).from}function ai(t,e,n){var o,i;const r={};for(const s in t)r[s]=null!==(o=si(s,e))&&void 0!==o?o:null===(i=n.getValue(s))||void 0===i?void 0:i.get();return r}function li(t){return Boolean(J(t)&&t.add)}function ui(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const i=e.map(e=>ci(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=ci(t,e,n);else{const i="function"==typeof e?O(t,e,n.custom):e;o=di(t,i,n)}return o.then(()=>t.notifyAnimationComplete(e))}function ci(t,e,n={}){var o;const i=O(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>di(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(hi).forEach((t,o)=>{s.push(ci(t,e,Object.assign(Object.assign({},r),{delay:n+l(o)})).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function di(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let s=t.makeTargetAnimatable(e),{transition:a=t.getDefaultTransition(),transitionEnd:l}=s,u=Gt(s,["transition","transitionEnd"]);const c=t.getValue("willChange");o&&(a=o);const d=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in u){const o=t.getValue(e),i=u[e];if(!o||void 0===i||h&&fi(h,e))continue;let r=Object.assign({delay:n},a);t.shouldReduceMotion&&q(e)&&(r=Object.assign(Object.assign({},r),{type:!1,delay:0}));let s=$o(e,o,i,r);li(c)&&(c.add(e),s=s.then(()=>c.remove(e))),d.push(s)}return Promise.all(d).then(()=>{l&&oi(t,l)})}function hi(t,e){return t.sortNodePosition(e)}function fi({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const pi=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],mi=[...pi].reverse(),gi=pi.length;function vi(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>ui(t,e,n)))}(e);const o={[t.AnimationType.Animate]:xi(!0),[t.AnimationType.InView]:xi(),[t.AnimationType.Hover]:xi(),[t.AnimationType.Tap]:xi(),[t.AnimationType.Drag]:xi(),[t.AnimationType.Focus]:xi(),[t.AnimationType.Exit]:xi()};let i=!0;const r=(t,n)=>{const o=O(e,n);if(o){const{transition:e,transitionEnd:n}=o,i=Gt(o,["transition","transitionEnd"]);t=Object.assign(Object.assign(Object.assign({},t),i),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<gi;n++){const p=mi[n],m=o[p],g=null!==(a=l[p])&&void 0!==a?a:u[p],v=P(g),y=p===s?m.isActive:null;!1===y&&(f=n);let x=g===u[p]&&g!==l[p]&&v;if(x&&i&&e.manuallyAnimateOnMount&&(x=!1),m.protectedKeys=Object.assign({},h),!m.isActive&&null===y||!g&&!m.prevProp||le(g)||"boolean"==typeof g)continue;const b=yi(m.prevProp,g);let E=b||p===s&&m.isActive&&!x&&v||n>f&&v;const w=Array.isArray(g)?g:[g];let S=w.reduce(r,{});!1===y&&(S={});const{prevResolvedValues:A={}}=m,T=Object.assign(Object.assign({},A),S),O=t=>{E=!0,d.delete(t),m.needsAnimating[t]=!0};for(const t in T){const e=S[t],n=A[t];h.hasOwnProperty(t)||(e!==n?ue(e)&&ue(n)?!Ao(e,n)||b?O(t):m.protectedKeys[t]=!0:void 0!==e?O(t):d.add(t):void 0!==e&&d.has(t)?O(t):m.protectedKeys[t]=!0)}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(h=Object.assign(Object.assign({},h),S)),i&&e.blockInitialAnimation&&(E=!1),E&&!x&&c.push(...w.map(e=>({animation:e,options:Object.assign({type:p},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 p=Boolean(c.length);return i&&!1===l.initial&&!e.manuallyAnimateOnMount&&(p=!1),i=!1,p?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.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(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function yi(t,e){return"string"==typeof e?e!==t:!!A(e)&&!Ao(e,t)}function xi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const bi={animation:Eo(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=vi(t)),le(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:Eo(n=>{const{custom:o,visualElement:i}=n,[r,s]=So(),a=e.useContext(g);e.useEffect(()=>{var e,n;i.isPresent=r;const l=null===(e=i.animationState)||void 0===e?void 0:e.setActive(t.AnimationType.Exit,!r,{custom:null!==(n=null==a?void 0:a.custom)&&void 0!==n?n:o});!r&&(null==l||l.then(s))},[r])})};class Ei{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=Ai(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=oo(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Zn();this.history.push(Object.assign(Object.assign({},o),{timestamp:i}));const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=wi(e,this.transformPagePoint),Ee(t)&&0===t.buttons?this.handlePointerUp(t,e):Hn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=Ai(wi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},we(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=wi(Te(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Zn();this.history=[Object.assign(Object.assign({},i),{timestamp:r})];const{onSessionStart:s}=e;s&&s(t,Ai(o,this.history)),this.removeListeners=sn(Me(window,"pointermove",this.handlePointerMove),Me(window,"pointerup",this.handlePointerUp),Me(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$n.update(this.updatePoint)}}function wi(t,e){return e?{point:e(t.point)}:t}function Si(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ai({point:t},e){return{point:t,delta:Si(t,Ti(e)),offset:Si(t,Pi(e)),velocity:Oi(e,.1)}}function Pi(t){return t[0]}function Ti(t){return t[t.length-1]}function Oi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=Ti(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>Po(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ji(t){return t.max-t.min}function Vi(t,e=0,n=.01){return oo(t,e)<n}function Ci(t,e,n,o=.5){t.origin=o,t.originPoint=Ke(e.min,e.max,t.origin),t.scale=ji(n)/ji(e),(Vi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ke(n.min,n.max,t.origin)-t.originPoint,(Vi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Mi(t,e,n,o){Ci(t.x,e.x,n.x,null==o?void 0:o.originX),Ci(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ri(t,e,n){t.min=n.min+e.min,t.max=t.min+ji(e)}function Li(t,e,n){t.min=e.min-n.min,t.max=t.min+ji(e)}function ki(t,e,n){Li(t.x,e.x,n.x),Li(t.y,e.y,n.y)}function Di(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 Fi(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 Ii=.35;function Bi(t,e,n){return{min:Ui(t,e),max:Ui(t,n)}}function Ui(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const zi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Ni(t){return[t("x"),t("y")]}function Wi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Hi(t){return void 0===t||1===t}function $i({scale:t,scaleX:e,scaleY:n}){return!Hi(t)||!Hi(e)||!Hi(n)}function Yi(t){return $i(t)||Xi(t.x)||Xi(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Xi(t){return t&&"0%"!==t}function Gi(t,e,n){return n+e*(t-n)}function qi(t,e,n,o,i){return void 0!==i&&(t=Gi(t,i,o)),Gi(t,n,o)+e}function Zi(t,e=0,n=1,o,i){t.min=qi(t.min,e,n,o,i),t.max=qi(t.max,e,n,o,i)}function Ki(t,{x:e,y:n}){Zi(t.x,e.translate,e.scale,e.originPoint),Zi(t.y,n.translate,n.scale,n.originPoint)}function _i(t,e){t.min=t.min+e,t.max=t.max+e}function Ji(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Ke(t.min,t.max,r);Zi(t,e[n],e[o],s,e.scale)}const Qi=["x","scaleX","originX"],tr=["y","scaleY","originY"];function er(t,e){Ji(t.x,e,Qi),Ji(t.y,e,tr)}function nr(t,e){return Wi(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 or=new WeakMap;class ir{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 Ei(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(Te(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Fe(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ni(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(ft.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(i){o=ji(i)*(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:i,onDrag:r}=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==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==r||r(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:i}=this.getProps();null==i||i(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||!rr(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ke(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ke(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&S(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:Di(t.x,n,i),y:Di(t.y,e,o)}}(n.actual,t),this.elastic=function(t=Ii){return!1===t?t=0:!0===t&&(t=Ii),{x:Bi(t,"left","right"),y:Bi(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ni(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||!S(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=nr(t,n),{scroll:i}=e;return i&&(_i(o.x,i.x),_i(o.y,i.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Fi(t.x,e.x),y:Fi(t.y,e.y)}}(o.layout.actual,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Wi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Ni(s=>{var l;if(!rr(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};r&&(u={min:0,max:0});const c=o?200:1e6,d=o?40:1e7,h=Object.assign(Object.assign({type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10},i),u);return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return $o(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Ni(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||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){Ni(e=>{const{drag:n}=this.getProps();if(!rr(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.actual[e];i.set(t[e]-Ke(n,r,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!S(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ni(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=ji(t),i=ji(e);return i>o?n=Ze(e.min,e.max-o,t.min):o>i&&(n=Ze(t.min,t.max-i,e.min)),Ne(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Ni(t=>{if(!rr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Ke(o,r,i[t]))})}addListeners(){var t;or.set(this.visualElement,this);const e=Me(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();S(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=xe(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ni(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=Ii,dragMomentum:s=!0}=t;return Object.assign(Object.assign({},t),{drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s})}}function rr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const sr={pan:Eo((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const s=t||n||o||i,a=e.useRef(null),{transformPagePoint:l}=e.useContext(f),u={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{a.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==a.current&&a.current.updateHandlers(u)}),Re(r,"pointerdown",s&&function(t){a.current=new Ei(t,u,{transformPagePoint:l})}),ze(()=>a.current&&a.current.end())})),drag:Eo((function(t){const{dragControls:n,visualElement:o}=t,i=R(()=>new ir(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))},ar=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const lr=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:o,measureViewportBox:i,render:r,readValueFromInstance:s,removeValueFromRenderState:a,sortNodePosition:l,scrapeMotionValuesFromProps:u})=>({parent:c,props:d,presenceId:h,blockInitialAnimation:f,visualState:p,shouldReduceMotion:m},g={})=>{let v=!1;const{latestValues:y,renderState:x}=p;let b;const E=function(){const t=ar.map(()=>new qo),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{ar.forEach(o=>{var i;const r="on"+o,s=t[r];null===(i=e[o])||void 0===i||i.call(e),s&&(e[o]=n[r](s))})}};return t.forEach((t,e)=>{n["on"+ar[e]]=e=>t.add(e),n["notify"+ar[e]]=(...e)=>t.notify(...e)}),n}(),w=new Map,S=new Map;let A={};const T=Object.assign({},y);let O;function C(){b&&v&&(M(),r(b,x,d.style,U.projection))}function M(){e(U,x,y,g,d)}function R(){E.notifyUpdate(y)}function L(t,e){const n=e.onChange(e=>{y[t]=e,d.onUpdate&&Hn.update(R,!1,!0)}),o=e.onRenderRequest(U.scheduleRender);S.set(t,()=>{n(),o()})}const k=u(d),{willChange:D}=k,F=Gt(k,["willChange"]);for(const t in F){const e=F[t];void 0!==y[t]&&J(e)&&(e.set(y[t],!1),li(D)&&D.add(t))}const I=j(d),B=V(d),U=Object.assign(Object.assign({treeType:t,current:null,depth:c?c.depth+1:0,parent:c,children:new Set,presenceId:h,shouldReduceMotion:m,variantChildren:B?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==c?void 0:c.isMounted()),blockInitialAnimation:f,isMounted:()=>Boolean(b),mount(t){v=!0,b=U.current=t,U.projection&&U.projection.mount(t),B&&c&&!I&&(O=null==c?void 0:c.addVariantChild(U)),w.forEach((t,e)=>L(e,t)),null==c||c.children.add(U),U.setProps(d)},unmount(){var t;null===(t=U.projection)||void 0===t||t.unmount(),$n.update(R),$n.render(C),S.forEach(t=>t()),null==O||O(),null==c||c.children.delete(U),E.clearAllListeners(),b=void 0,v=!1},addVariantChild(t){var e;const n=U.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>l&&t===e.treeType?l(U.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>B?U:null==c?void 0:c.getClosestVariantNode(),getLayoutId:()=>d.layoutId,getInstance:()=>b,getStaticValue:t=>y[t],setStaticValue:(t,e)=>y[t]=e,getLatestValues:()=>y,setVisibility(t){U.isVisible!==t&&(U.isVisible=t,U.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>o(U,t,d,e),measureViewportBox:()=>i(b,d),addValue(t,e){U.hasValue(t)&&U.removeValue(t),w.set(t,e),y[t]=e.get(),L(t,e)},removeValue(t){var e;w.delete(t),null===(e=S.get(t))||void 0===e||e(),S.delete(t),delete y[t],a(t,x)},hasValue:t=>w.has(t),getValue(t,e){let n=w.get(t);return void 0===n&&void 0!==e&&(n=Ko(e),U.addValue(t,n)),n},forEachValue:t=>w.forEach(t),readValue:t=>{var e;return null!==(e=y[t])&&void 0!==e?e:s(b,t,g)},setBaseTarget(t,e){T[t]=e},getBaseTarget(t){if(n){const e=n(d,t);if(void 0!==e&&!J(e))return e}return T[t]}},E),{build:()=>(M(),x),scheduleRender(){Hn.render(C,!1,!0)},syncRender:C,setProps(t){(t.transformTemplate||d.transformTemplate)&&U.scheduleRender(),d=t,E.updatePropListeners(t),A=function(t,e,n){var o;const{willChange:i}=e;for(const r in e){const s=e[r],a=n[r];if(J(s))t.addValue(r,s),li(i)&&i.add(r);else if(J(a))t.addValue(r,Ko(s)),li(i)&&i.remove(r);else if(a!==s)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(s)}else t.addValue(r,Ko(null!==(o=t.getStaticValue(r))&&void 0!==o?o:s))}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(U,u(d),A)},getProps:()=>d,getVariant:t=>{var e;return null===(e=d.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>d.transition,getTransformPagePoint:()=>d.transformPagePoint,getVariantContext(t=!1){if(t)return null==c?void 0:c.getVariantContext();if(!I){const t=(null==c?void 0:c.getVariantContext())||{};return void 0!==d.initial&&(t.initial=d.initial),t}const e={};for(let t=0;t<cr;t++){const n=ur[t],o=d[n];(P(o)||!1===o)&&(e[n]=o)}return e}});return U},ur=["initial",...pi],cr=ur.length;function dr(t){return"string"==typeof t&&t.startsWith("var(--")}const hr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function fr(t,e,n=1){const[o,i]=function(t){const e=hr.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():dr(i)?fr(i,e,n+1):i}const pr=new Set(["width","height","top","left","right","bottom","x","y"]),mr=t=>pr.has(t),gr=(t,e)=>{t.set(e,!1),t.set(e)},vr=t=>t===lt||t===pt;var yr;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(yr||(yr={}));const xr=(t,e)=>parseFloat(t.split(", ")[e]),br=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return xr(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?xr(e[1],t):0}},Er=new Set(["x","y","z"]),wr=Y.filter(t=>!Er.has(t));const Sr={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:br(4,13),y:br(5,14)},Ar=(t,e,n={},o={})=>{e=Object.assign({},e),o=Object.assign({},o);const i=Object.keys(e).filter(mr);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Qo(u);const d=e[i];let h;if(ue(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=Qo(u);for(let n=e;n<t;n++)h?Qo(d[n]):h=Qo(d[n])}else h=Qo(d);if(c!==h)if(vr(c)&&vr(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&h===pt&&(e[i]=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[i]=c.transform(d):(s||(r=function(t){const e=[];return wr.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(i),o[i]=void 0!==o[i]?o[i]:e[i],gr(l,d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Sr[t](o,r)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);gr(o,a[n]),t[n]=Sr[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),v&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function Pr(t,e,n,o){return(t=>Object.keys(t).some(mr))(e)?Ar(t,e,n,o):{target:e,transitionEnd:o}}const Tr=(t,e,n,o)=>{const i=function(t,e,n){var o,i=Gt(e,[]);const r=t.getInstance();if(!(r instanceof Element))return{target:i,transitionEnd:n};n&&(n=Object.assign({},n)),t.forEachValue(t=>{const e=t.get();if(!dr(e))return;const n=fr(e,r);n&&t.set(n)});for(const t in i){const e=i[t];if(!dr(e))continue;const s=fr(e,r);s&&(i[t]=s,n&&(null!==(o=n[t])&&void 0!==o||(n[t]=e)))}return{target:i,transitionEnd:n}}(t,e,o);return Pr(t,e=i.target,n,o=i.transitionEnd)};const Or={treeType:"dom",readValueFromInstance(t,e){if(q(e)){const t=Do(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(tt(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}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})=>nr(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,e,n,o){var{transition:i,transitionEnd:r}=e,s=Gt(e,["transition","transitionEnd"]),a=n.transformValues;void 0===o&&(o=!0);let l=ai(s,i||{},t);if(a&&(r&&(r=a(r)),s&&(s=a(s)),l&&(l=a(l))),o){ri(t,s,l);const e=Tr(t,s,l,r);r=e.transitionEnd,s=e.target}return Object.assign({transition:i,transitionEnd:r},s)},scrapeMotionValuesFromProps:se,build(t,e,n,o,i){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),It(e,n,o,i.transformTemplate)},render:oe},jr=lr(Or),Vr=lr(Object.assign(Object.assign({},Or),{getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return q(e)?(null===(n=Do(e))||void 0===n?void 0:n.default)||0:(e=ie.has(e)?e:ne(e),t.getAttribute(e))},scrapeMotionValuesFromProps:ae,build(t,e,n,o,i){_t(e,n,o,i.transformTemplate)},render:re})),Cr=(t,e)=>N(t)?Vr(e,{enableHardwareAcceleration:!1}):jr(e,{enableHardwareAcceleration:!0});function Mr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Rr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!pt.test(t))return t;t=parseFloat(t)}return`${Mr(t,e.target.x)}% ${Mr(t,e.target.y)}%`}},Lr={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(hr,t=>(r.push(t),"_$css")));const s=Ct.parse(t);if(s.length>5)return o;const a=Ct.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=Ke(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(i){let t=0;h=h.replace("_$css",()=>{const e=r[t];return t++,e})}return h}};class kr extends r.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;H(Dr),i&&((null==e?void 0:e.group)&&e.group.add(i),(null==n?void 0:n.register)&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions(Object.assign(Object.assign({},i.options),{onExitComplete:()=>this.safeToRemove()}))),L.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Hn.postRender(()=>{var t;(null===(t=r.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 Dr={borderRadius:Object.assign(Object.assign({},Rr),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Rr,borderTopRightRadius:Rr,borderBottomLeftRadius:Rr,borderBottomRightRadius:Rr,boxShadow:Lr},Fr={measureLayout:function(t){const[n,o]=So(),i=e.useContext(D);return r.default.createElement(kr,Object.assign({},t,{layoutGroup:i,switchLayoutGroup:e.useContext(F),isPresent:n,safeToRemove:o}))}};function Ir(t,e,n={}){const o=J(t)?t:Ko(t);return $o("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Br=["TopLeft","TopRight","BottomLeft","BottomRight"],Ur=Br.length,zr=t=>"string"==typeof t?parseFloat(t):t,Nr=t=>"number"==typeof t||pt.test(t);function Wr(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Hr=Yr(0,.5,An),$r=Yr(.5,.95,yn);function Yr(t,e,n){return o=>o<t?0:o>e?1:n(Ze(t,e,o))}function Xr(t,e){t.min=e.min,t.max=e.max}function Gr(t,e){Xr(t.x,e.x),Xr(t.y,e.y)}function qr(t,e,n,o,i){return t=Gi(t-=e,1/n,o),void 0!==i&&(t=Gi(t,1/i,o)),t}function Zr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(ft.test(e)){e=parseFloat(e);e=Ke(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ke(r.min,r.max,o);t===r&&(a-=e),t.min=qr(t.min,e,n,a,i),t.max=qr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Kr=["x","scaleX","originX"],_r=["y","scaleY","originY"];function Jr(t,e,n,o){Zr(t.x,e,Kr,null==n?void 0:n.x,null==o?void 0:o.x),Zr(t.y,e,_r,null==n?void 0:n.y,null==o?void 0:o.y)}function Qr(t){return 0===t.translate&&1===t.scale}function ts(t){return Qr(t.x)&&Qr(t.y)}function es(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}class ns{constructor(){this.members=[]}add(t){Xo(this.members,t),t.scheduleRender()}remove(t){if(Go(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:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}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:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}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 is=(t,e)=>t.depth-e.depth;class rs{constructor(){this.children=[],this.isDirty=!1}add(t){Xo(this.children,t),this.isDirty=!0}remove(t){Go(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}}function ss({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){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 qo),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:i,layout:r,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&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(o,250),L.hasAnimatedSinceResize&&(L.hasAnimatedSinceResize=!1,this.nodes.forEach(hs))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:bs,{onLayoutAnimationStart:d,onLayoutAnimationComplete:h}=s.getProps(),f=!this.targetLayout||!es(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=Object.assign(Object.assign({},Ho(c,"layout")),{onPlay:d,onComplete:h});s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),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,$n.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:i,layout:r}=this.options;if(void 0===i&&!r)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(),Yn.update(),Yn.preRender(),Yn.render())}clearAllSnapshots(){this.nodes.forEach(us),this.sharedNodes.forEach(gs)}scheduleUpdateProjection(){Hn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Hn.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(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!ts(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||Yi(this.latestValues)||s)&&(i(this.instance,r),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&&(_i(e.x,n.x),_i(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Gr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r,isScrollRoot:s}=o;if(o!==this.root&&i&&r.layoutScroll){if(s){Gr(e,t);const{scroll:n}=this.root;n&&(_i(e.x,-n.x),_i(e.y,-n.y))}_i(e.x,i.x),_i(e.y,i.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Gr(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&&er(n,{x:-o.scroll.x,y:-o.scroll.y}),Yi(o.latestValues)&&er(n,o.latestValues)}return Yi(this.latestValues)&&er(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Gr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Yi(o.latestValues))continue;$i(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Gr(i,o.measure()),Jr(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layout,i)}return Yi(this.latestValues)&&Jr(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){var e;this.options=Object.assign(Object.assign(Object.assign({},this.options),t),{crossfade:null===(e=t.crossfade)||void 0===e||e})}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,i,r;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}},ki(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Gr(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,i=this.relativeTarget,r=this.relativeParent.target,Ri(o.x,i.x,r.x),Ri(o.y,i.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Gr(this.target,this.layout.actual),Ki(this.target,this.targetDelta)):Gr(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}},ki(this.relativeTargetOrigin,this.target,this.relativeParent.target),Gr(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Yi(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();Gr(this.layoutCorrected,this.layout.actual),function(t,e,n,o=!1){var i,r;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===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&er(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Ki(t,l)),o&&Yi(a.latestValues)&&er(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:i}=o;if(!i)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 r=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;Mi(this.projectionDelta,this.layoutCorrected,i,this.latestValues),this.projectionTransform=os(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===r&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",i))}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,i=(null==o?void 0:o.latestValues)||{},r=Object.assign({},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)&&(ki(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=r,function(t,e,n,o,i,r){var s,a,l,u;i?(t.opacity=Ke(0,null!==(s=n.opacity)&&void 0!==s?s:1,Hr(o)),t.opacityExit=Ke(null!==(a=e.opacity)&&void 0!==a?a:1,0,$r(o))):r&&(t.opacity=Ke(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let i=0;i<Ur;i++){const r=`border${Br[i]}Radius`;let s=Wr(e,r),a=Wr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Nr(s)===Nr(a)?(t[r]=Math.max(Ke(zr(s),zr(a),o),0),(ft.test(a)||ft.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Ke(e.rotate||0,n.rotate||0,o))}(r,i,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&&($n.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Hn.update(()=>{L.hasAnimatedSinceResize=!0,this.currentAnimation=Ir(0,1e3,Object.assign(Object.assign({},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{targetWithTransforms:t,target:e,layout:n,latestValues:o}=this.getLead();t&&e&&n&&(Gr(t,e),er(t,o),Mi(this.projectionDeltaWithTransform,this.layoutCorrected,t,o))}registerSharedNode(t,e){var n,o,i;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===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.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<$.length;o++){const i="rotate"+$[o];t.getStaticValue(i)&&(e=!0,n[i]=t.getStaticValue(i),t.setStaticValue(i,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,i,r,s;const a={};if(!this.instance||this.isSVG)return a;if(!this.isVisible)return{visibility:"hidden"};a.visibility="";const l=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=de(t.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const e={};return this.options.layoutId&&(e.opacity=null!==(n=this.latestValues.opacity)&&void 0!==n?n:1,e.pointerEvents=de(t.pointerEvents)||""),this.hasProjected&&!Yi(this.latestValues)&&(e.transform=l?l({},""):"none",this.hasProjected=!1),e}const c=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=os(this.projectionDeltaWithTransform,this.treeScale,c),l&&(a.transform=l(c,a.transform));const{x:d,y:h}=this.projectionDelta;a.transformOrigin=`${100*d.origin}% ${100*h.origin}% 0`,u.animationValues?a.opacity=u===this?null!==(i=null!==(o=c.opacity)&&void 0!==o?o:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:a.opacity=u===this?null!==(r=c.opacity)&&void 0!==r?r:"":null!==(s=c.opacityExit)&&void 0!==s?s:0;for(const t in W){if(void 0===c[t])continue;const{correct:e,applyTo:n}=W[t],o=e(c[t],u);if(n){const t=n.length;for(let e=0;e<t;e++)a[n[e]]=o}else a[t]=o}return this.options.layoutId&&(a.pointerEvents=u===this?de(t.pointerEvents)||"":"none"),a}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,i;const r=null!==(n=null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)&&void 0!==n?n:t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout;"size"===t.options.animationType?Ni(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=ji(n);n.min=e[t].min,n.max=n.min+o}):"position"===t.options.animationType&&Ni(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=ji(e[t]);n.max=n.min+o});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Mi(o,e,r.layout);const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r.isShared?Mi(i,t.applyTransform(n,!0),r.measured):Mi(i,e,r.layout);const s=!ts(o);let a=!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}};ki(t,r.layout,n.layout);const i={x:{min:0,max:0},y:{min:0,max:0}};ki(i,e,o.actual),es(t,i)||(a=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:r,delta:i,layoutDelta:o,hasLayoutChanged:s,hasRelativeTargetChanged:a})}else t.isLead()&&(null===(i=(o=t.options).onExitComplete)||void 0===i||i.call(o));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=Ke(e.translate,0,n),t.scale=Ke(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ys(t,e,n,o){t.min=Ke(e.min,n.min,o),t.max=Ke(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)}const As=ss({attachResizeListener:(t,e)=>xe(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ps={current:void 0},Ts=ss({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ps.current){const t=new As(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Ps.current=t}return Ps.current},resetTransform:(t,e)=>{t.style.transform=null!=e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Os=Object.assign(Object.assign(Object.assign(Object.assign({},bi),wo),sr),Fr),js=U((t,e)=>ve(t,e,Os,Cr,Ts));const Vs=U(ve);function Cs(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Ms(){const t=Cs(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Hn.postRender(i),[i]),n]}const Rs=({children:t,initial:n,isPresent:o,onExitComplete:r,custom:s,presenceAffectsLayout:a})=>{const l=R(Ls),u=e.useId(),c=e.useMemo(()=>({id:u,initial:n,isPresent:o,custom:s,onExitComplete:t=>{l.set(t,!0);for(const t of l.values())if(!t)return;null==r||r()},register:t=>(l.set(t,!1),()=>l.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{l.forEach((t,e)=>l.set(e,!1))},[o]),i.useEffect(()=>{!o&&!l.size&&(null==r||r())},[o]),i.createElement(g.Provider,{value:c},t)};function Ls(){return new Map}const ks=t=>t.key||"";const Ds=e.createContext(null),Fs=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Is(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Fs);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const Bs=t=>!0===t,Us=({children:t,id:n,inheritId:o,inherit:r=!0})=>{var s,a;void 0!==o&&(r=o);const l=e.useContext(D),u=e.useContext(Ds),[c,d]=Ms(),h=e.useRef(null),f=null!==(s=l.id)&&void 0!==s?s:u;null===h.current&&((t=>Bs(!0===t)||"id"===t)(r)&&f&&(n=n?f+"-"+n:f),h.current={id:n,group:Bs(r)&&null!==(a=null==l?void 0:l.group)&&void 0!==a?a:Is()});const p=e.useMemo(()=>Object.assign(Object.assign({},h.current),{forceRender:c}),[d]);return i.createElement(D.Provider,{value:p},t)};let zs=0;function Ns(t){return"function"==typeof t}const Ws=e.createContext(null);const Hs=e.forwardRef((function(t,n){var{children:o,as:r="ul",axis:s="y",onReorder:a,values:l}=t,u=Gt(t,["children","as","axis","onReorder","values"]);const c=R(()=>js(r)),d=[],h=e.useRef(!1),f={axis:s,registerItem:(t,e)=>{e&&-1===d.findIndex(e=>t===e.value)&&(d.push({value:t,layout:e[s]}),d.sort(Ys))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Ke(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&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,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(d,t,e,n);d!==o&&(h.current=!0,a(o.map($s).filter(t=>-1!==l.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),i.createElement(c,Object.assign({},u,{ref:n}),i.createElement(Ws.Provider,{value:f},o))}));function $s(t){return t.value}function Ys(t,e){return t.layout.min-e.layout.min}function Xs(t){const n=R(()=>Ko(t)),{isStatic:o}=e.useContext(f);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Gs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=pn(i,r,Object.assign({mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0)},s));var l;return e?a(o):a}function qs(t,e){const n=Xs(e()),o=()=>n.set(e());return o(),function(t,e){y(()=>{const n=t.map(t=>t.onChange(e));return()=>n.forEach(t=>t())})}(t,()=>Hn.update(o,!1,!0)),n}function Zs(t,e,n,o){const i="function"==typeof e?e:Gs(e,n,o);return Array.isArray(t)?Ks(t,i):Ks([t],([t])=>i(t))}function Ks(t,e){const n=R(()=>[]);return qs(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function _s(t,e=0){return J(t)?t:Xs(e)}const Js={Group:Hs,Item:e.forwardRef((function(t,n){var{children:o,style:r,value:s,as:a="li",onDrag:l,layout:u=!0}=t,c=Gt(t,["children","style","value","as","onDrag","layout"]);const d=R(()=>js(a)),h=e.useContext(Ws),f={x:_s(null==r?void 0:r.x),y:_s(null==r?void 0:r.y)},p=Zs([f.x,f.y],([t,e])=>t||e?1:"unset"),m=e.useRef(null),{axis:g,registerItem:v,updateOrder:y}=h;return e.useEffect(()=>{v(s,m.current)},[h]),i.createElement(d,Object.assign({drag:g},c,{dragSnapToOrigin:!0,style:Object.assign(Object.assign({},r),{x:f.x,y:f.y,zIndex:p}),layout:u,onDrag:(t,e)=>{const{velocity:n}=e;n[g]&&y(s,f[g].get(),n[g]),null==l||l(t,e)},onLayoutMeasure:t=>{m.current=t},ref:n}),o)}))},Qs=Object.assign(Object.assign({renderer:Cr},bi),wo),ta=Object.assign(Object.assign(Object.assign(Object.assign({},Qs),sr),Fr),{projectionNodeConstructor:Ts});const ea=t=>"number"==typeof t;function na(t,e){return(t=>Array.isArray(t)&&!ea(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const oa=(t,e,n)=>-n*t+n*e+t,ia=t=>t,ra=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function sa(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=ra(0,e,o);t.push(oa(n,1,i))}}function aa(t){const e=[0];return sa(e,t-1),e}function la(t,e=aa(t.length),n=ia){const o=t.length,i=o-e.length;return i>0&&sa(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=ra(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=na(n,r)(s),oa(t[r],t[r+1],s)}}const ua=t=>"function"==typeof t,ca=t=>"string"==typeof t;function da(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 ha={any:0,all:1};const fa=new WeakMap;let pa;function ma({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=fa.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 ga(t){t.forEach(ma)}function va(t,e){pa||"undefined"!=typeof ResizeObserver&&(pa=new ResizeObserver(ga));const n=da(t);return n.forEach(t=>{let n=fa.get(t);n||(n=new Set,fa.set(t,n)),n.add(e),null==pa||pa.observe(t)}),()=>{n.forEach(t=>{const n=fa.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==pa||pa.unobserve(t)})}}const ya=new Set;let xa;function ba(t){return ya.add(t),xa||(xa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ya.forEach(t=>t(e))},window.addEventListener("resize",xa)),()=>{ya.delete(t),!ya.size&&xa&&(xa=void 0)}}const Ea={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function wa(t,e,n,o){const i=n[e],{length:r,position:s}=Ea[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=ra(0,i.scrollLength,i.current);const u=o-l;var c,d;i.velocity=u>50?0:(c=i.current-a,(d=u)?c*(1e3/d):0)}const Sa={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Aa={start:0,center:.5,end:1};function Pa(t,e,n=0){let o=0;if(void 0!==Aa[t]&&(t=Aa[t]),ca(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 ea(t)&&(o=e*t),n+o}const Ta=[0,0];function Oa(t,e,n,o){let i=Array.isArray(t)?t:Ta,r=0,s=0;return ea(t)?i=[t,t]:ca(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Aa[t]?t:"0"]),r=Pa(i[0],n,o),s=Pa(i[1],e),r-s}const ja={x:0,y:0};function Va(t,e,n){let{offset:o=Sa.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==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}(i,t):ja,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const d=o.length;for(let t=0;t<d;t++){const n=Oa(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=la(aa(d),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function Ca(t,e,n,o={}){const i=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){wa(t,"x",e,n),wa(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Va(t,n,o)},notify:ua(e)?()=>e(n):Ma(e,n[i])}}function Ma(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=ia),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const Ra=new WeakMap,La=new WeakMap,ka=new WeakMap,Da=t=>t===document.documentElement?window:t;function Fa(t,e={}){var{container:n=document.documentElement}=e,o=Gt(e,["container"]);let i=ka.get(n);i||(i=new Set,ka.set(n,i));const r=Ca(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(i.add(r),!Ra.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};Ra.set(n,t);const e=Da(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&La.set(n,function(t,e){return ua(t)?ba(t):va(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Ra.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=ka.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=Ra.get(n);Ra.delete(n),i&&(Da(n).removeEventListener("scroll",i),null===(e=La.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const Ia=()=>({scrollX:Ko(0),scrollY:Ko(0),scrollXProgress:Ko(0),scrollYProgress:Ko(0)});function Ba(t={}){var{container:e,target:n}=t,o=Gt(t,["container","target"]);const i=R(Ia);return y(()=>Fa(({x:t,y:e})=>{i.scrollX.set(t.current),i.scrollXProgress.set(t.progress),i.scrollY.set(e.current),i.scrollYProgress.set(e.progress)},Object.assign(Object.assign({},o),{container:(null==e?void 0:e.current)||void 0,target:(null==n?void 0:n.current)||void 0})),[]),i}function Ua(t){const n=e.useRef(0),{isStatic:o}=e.useContext(f);e.useEffect(()=>{if(o)return;const e=({timestamp:e})=>{n.current||(n.current=e),t(e-n.current)};return Hn.update(e,!0),()=>$n.update(e)},[t])}class za extends Zo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;q(t)?(this.transforms.add(t),e="transform"):K(t)||tt(t)||"willChange"===t||(e=ne(t)),e&&(Xo(this.members,e),this.update())}remove(t){q(t)?(this.transforms.delete(t),this.transforms.size||Go(this.members,"transform")):Go(this.members,ne(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Na(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(ui(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?ii(t,e):"string"==typeof e?ii(t,[e]):oi(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 Wa(){const t=R(Na);return e.useEffect(t.mount,[]),t}const Ha=Wa;class $a{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 Ya=()=>new $a;function Xa(){return Ga}function Ga(t){Ps.current&&(Ps.current.isUpdating=!1,Ps.current.blockUpdate(),null==t||t())}const qa=()=>({}),Za=lr({build(){},measureViewportBox:zi,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:qa,readValueFromInstance:(t,e,n)=>n.initialState[e]||0,makeTargetAnimatable(t,e){var{transition:n,transitionEnd:o}=e,i=Gt(e,["transition","transitionEnd"]);return ri(t,i,ai(i,n||{},t)),Object.assign({transition:n,transitionEnd:o},i)}}),Ka=fe({scrapeMotionValuesFromProps:qa,createRenderState:qa});const _a=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:r,exitBeforeEnter:a,presenceAffectsLayout:l=!0})=>{let[u]=Ms();const c=e.useContext(D).forceRender;c&&(u=c);const d=Cs(),h=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=h;const p=new Set,m=e.useRef(f),g=e.useRef(new Map).current,v=e.useRef(!0);if(y(()=>{v.current=!1,function(t,e){t.forEach(t=>{const n=ks(t);e.set(n,t)})}(h,g),m.current=f}),ze(()=>{v.current=!0,g.clear(),p.clear()}),v.current)return i.createElement(i.Fragment,null,f.map(t=>i.createElement(Rs,{key:ks(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:l},t)));f=[...f];const x=m.current.map(ks),b=h.map(ks),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&p.add(e)}return a&&p.size&&(f=[]),p.forEach(t=>{if(-1!==b.indexOf(t))return;const e=g.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,i.createElement(Rs,{key:ks(e),isPresent:!1,onExitComplete:()=>{g.delete(t),p.delete(t);const e=m.current.findIndex(e=>e.key===t);if(m.current.splice(e,1),!p.size){if(m.current=h,!1===d.current)return;u(),r&&r()}},custom:n,presenceAffectsLayout:l},e))}),f=f.map(t=>{const e=t.key;return p.has(e)?t:i.createElement(Rs,{key:ks(t),isPresent:!0,presenceAffectsLayout:l},t)}),"production"!==s&&a&&f.length>1&&console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."),i.createElement(i.Fragment,null,p.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),i.createElement(Us,{id:R(()=>"asl-"+zs++)},t)),t.DeprecatedLayoutGroupContext=Ds,t.DragControls=$a,t.FlatTree=rs,t.LayoutGroup=Us,t.LayoutGroupContext=D,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,r]=e.useState(!Ns(n)),s=e.useRef(void 0);if(!Ns(n)){const{renderer:t}=n,e=Gt(n,["renderer"]);s.current=t,u(e)}return e.useEffect(()=>{Ns(n)&&n().then(t=>{var{renderer:e}=t;u(Gt(t,["renderer"])),s.current=e,r(!0)})},[]),i.createElement(c.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function(t){var{children:n,isValidProp:o}=t,r=Gt(t,["children","isValidProp"]);o&&Yt(o),(r=Object.assign(Object.assign({},e.useContext(f)),r)).isStatic=R(()=>r.isStatic);const s=e.useMemo(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion]);return i.createElement(f.Provider,{value:s},n)},t.MotionConfigContext=f,t.MotionContext=p,t.MotionValue=Zo,t.PresenceContext=g,t.Reorder=Js,t.SwitchLayoutGroupContext=F,t.addPointerEvent=Me,t.addScaleCorrector=H,t.animate=Ir,t.animateVisualElement=ui,t.animationControls=Na,t.animations=bi,t.calcLength=ji,t.checkTargetForNewValues=ri,t.createBox=zi,t.createDomMotionComponent=function(t){return B(ve(t,{forwardMotionProps:!1},Os,Cr,Ts))},t.createMotionComponent=B,t.domAnimation=Qs,t.domMax=ta,t.filterProps=Xt,t.isBrowser=v,t.isDragActive=Ie,t.isMotionValue=J,t.isValidMotionProp=Ht,t.m=Vs,t.makeUseVisualState=fe,t.motion=js,t.motionValue=Ko,t.resolveMotionValue=de,t.transform=Gs,t.useAnimation=Ha,t.useAnimationControls=Wa,t.useAnimationFrame=Ua,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=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,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=Ka({},!1),r=R(()=>Za({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),r.unmount),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o(Object.assign({},t))}})},[o,r]),[n,R(()=>t=>ui(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Xs(1),n=Xs(1);const o=m();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Zs(e,_a),scaleY:Zs(n,_a)}},t.useDomEvent=be,t.useDragControls=function(){return R(Ya)},t.useElementScroll=function(t){return ho(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Ba({container:t})},t.useForceUpdate=Ms,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{var e;if(!t.current||r&&s)return;const l={root:null!==(e=null==n?void 0:n.current)&&void 0!==e?e:void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=da(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);ua(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 i?i:ha[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),l)},[n,t,o,r]),s},t.useInstantLayoutTransition=Xa,t.useInstantTransition=function(){const[t,n]=Ms(),o=Xa();return e.useEffect(()=>{Hn.postRender(()=>Hn.postRender(()=>Io.current=!1))},[n]),e=>{o(()=>{Io.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(g))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return qs(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=Xs,t.usePresence=So,t.useReducedMotion=E,t.useReducedMotionConfig=w,t.useResetProjection=function(){return i.useCallback(()=>{const t=Ps.current;t&&t.resetTree()},[])},t.useScroll=Ba,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(f),i=e.useRef(null),r=Xs(J(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=Jn(Object.assign(Object.assign({from:r.get(),to:t,velocity:r.getVelocity()},n),{onUpdate:e})),r.get())),[JSON.stringify(n)]),function(t,e){y(()=>{if(J(t))return t.onChange(e)},[e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=Xs(0);return Ua(e=>t.set(e)),t},t.useTransform=Zs,t.useUnmountEffect=ze,t.useVelocity=function(t){const n=Xs(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return ho(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Ba()},t.useVisualElementContext=m,t.useWillChange=function(){return R(()=>new za("auto"))},t.visualElement=lr,t.wrapHandler=Oe,Object.defineProperty(t,"__esModule",{value:!0})}));
|