react-markdown-typewriter 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import {createContext,useRef,useContext,forwardRef,useMemo,useInsertionEffect,useLayoutEffect,useEffect,useCallback,Fragment,createElement,useId,Component}from'react';import {jsx,jsxs}from'react/jsx-runtime';var Aa=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ne=createContext({});function ii(t){let e=useRef(null);return e.current===null&&(e.current=t()),e.current}var Ut=createContext(null);var Ue=createContext({transformPagePoint:t=>t,isStatic:false,reducedMotion:"never"});function ni(t=true){let e=useContext(Ut);if(e===null)return [true,null];let{isPresent:o,onExitComplete:r,register:i}=e,s=useId();useEffect(()=>{if(t)return i(s)},[t]);let n=useCallback(()=>t&&r&&r(s),[s,r,t]);return !o&&r?[false,n]:[true]}var Kt=typeof window<"u";var si=Kt?useLayoutEffect:useEffect;var E=t=>t;var J=E,G=E;process.env.NODE_ENV!=="production"&&(J=(t,e)=>{!t&&typeof console<"u"&&console.warn(e);},G=(t,e)=>{if(!t)throw new Error(e)});var Mt={useManualTiming:false};var Ve=["read","resolveKeyframes","update","preRender","render","postRender"];function ai(t,e){let o=new Set,r=new Set,i=false,s=false,n=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function u(c){n.has(c)&&(m.schedule(c),t()),c(a);}let m={schedule:(c,f=false,p=false)=>{let d=p&&i?o:r;return f&&n.add(c),d.has(c)||d.add(c),c},cancel:c=>{r.delete(c),n.delete(c);},process:c=>{if(a=c,i){s=true;return}i=true,[o,r]=[r,o],o.forEach(u),o.clear(),i=false,s&&(s=false,m.process(c));}};return m}var Oa=40;function Ke(t,e){let o=false,r=true,i={delta:0,timestamp:0,isProcessing:false},s=()=>o=true,n=Ve.reduce((g,v)=>(g[v]=ai(s),g),{}),{read:a,resolveKeyframes:l,update:u,preRender:m,render:c,postRender:f}=n,p=()=>{let g=performance.now();o=false,(i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,Oa),1)),i.timestamp=g,i.isProcessing=true,a.process(i),l.process(i),u.process(i),m.process(i),c.process(i),f.process(i),i.isProcessing=false,o&&e&&(r=false,t(p));},h=()=>{o=true,r=true,i.isProcessing||t(p);};return {schedule:Ve.reduce((g,v)=>{let T=n[v];return g[v]=(A,P=false,C=false)=>(o||h(),T.schedule(A,P,C)),g},{}),cancel:g=>{for(let v=0;v<Ve.length;v++)n[Ve[v]].cancel(g);},state:i,steps:n}}var{schedule:S,cancel:Y,state:R,steps:_e}=Ke(typeof requestAnimationFrame<"u"?requestAnimationFrame:E,true);var Ge=createContext({strict:false});var li={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},at={};for(let t in li)at[t]={isEnabled:e=>li[t].some(o=>!!e[o])};function ui(t){for(let e in t)at[e]={...at[e],...t[e]};}var ja=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function be(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ja.has(t)}var mi=t=>!be(t);function Na(t){t&&(mi=e=>e.startsWith("on")?!be(e):t(e));}try{Na(Aa("@emotion/is-prop-valid").default);}catch{}function ci(t,e,o){let r={};for(let i in t)i==="values"&&typeof t.values=="object"||(mi(i)||o===true&&be(i)||!e&&!be(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}var fi=new Set;function yt(t,e,o){t||fi.has(e)||(console.warn(e),fi.add(e));}function pi(t){if(typeof Proxy>"u")return t;let e=new Map,o=(...r)=>(process.env.NODE_ENV!=="production"&&yt(false,"motion() is deprecated. Use motion.create() instead."),t(...r));return new Proxy(o,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}var xt=createContext({});function vt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function lt(t){return typeof t=="string"||Array.isArray(t)}var $e=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ae=["initial",...$e];function wt(t){return vt(t.animate)||Ae.some(e=>lt(t[e]))}function We(t){return !!(wt(t)||t.variants)}function hi(t,e){if(wt(t)){let{initial:o,animate:r}=t;return {initial:o===false||lt(o)?o:void 0,animate:lt(r)?r:void 0}}return t.inherit!==false?e:{}}function gi(t){let{initial:e,animate:o}=hi(t,useContext(xt));return useMemo(()=>({initial:e,animate:o}),[di(e),di(o)])}function di(t){return Array.isArray(t)?t.join(" "):t}var yi=Symbol.for("motionComponentSymbol");function ut(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function xi(t,e,o){return useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),o&&(typeof o=="function"?o(r):ut(o)&&(o.current=r));},[e])}var _t=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var $a="framerAppearId",ze="data-"+_t($a);var{schedule:Gt}=Ke(queueMicrotask,false);var He=createContext({});function vi(t,e,o,r,i){var s,n;let{visualElement:a}=useContext(xt),l=useContext(Ge),u=useContext(Ut),m=useContext(Ue).reducedMotion,c=useRef(null);r=r||l.renderer,!c.current&&r&&(c.current=r(t,{visualState:e,parent:a,props:o,presenceContext:u,blockInitialAnimation:u?u.initial===false:false,reducedMotionConfig:m}));let f=c.current,p=useContext(He);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Ya(c.current,o,i,p);let h=useRef(false);useInsertionEffect(()=>{f&&h.current&&f.update(o,u);});let d=o[ze],y=useRef(!!d&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,d))&&((n=window.MotionHasOptimisedAnimation)===null||n===void 0?void 0:n.call(window,d)));return si(()=>{f&&(h.current=true,window.MotionIsMounted=true,f.updateFeatures(),Gt.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges());}),useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,d);}),y.current=false));}),f}function Ya(t,e,o,r){let{layoutId:i,layout:s,drag:n,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new o(t.latestValues,e["data-framer-portal-id"]?void 0:Ti(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!n||a&&ut(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u});}function Ti(t){if(t)return t.options.allowProjection!==false?t.projection:Ti(t.parent)}function Pi({preloadedFeatures:t,createVisualElement:e,useRender:o,useVisualState:r,Component:i}){var s,n;t&&ui(t);function a(u,m){let c,f={...useContext(Ue),...u,layoutId:Ja(u)},{isStatic:p}=f,h=gi(u),d=r(u,p);if(!p&&Kt){Qa(f,t);let y=tl(f);c=y.MeasureLayout,h.visualElement=vi(i,d,f,e,y.ProjectionNode);}return jsxs(xt.Provider,{value:h,children:[c&&h.visualElement?jsx(c,{visualElement:h.visualElement,...f}):null,o(i,u,xi(d,h.visualElement,m),d,p,h.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(n=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&n!==void 0?n:""})`}`;let l=forwardRef(a);return l[yi]=i,l}function Ja({layoutId:t}){let e=useContext(Ne).id;return e&&t!==void 0?e+"-"+t:t}function Qa(t,e){let o=useContext(Ge).strict;if(process.env.NODE_ENV!=="production"&&e&&o){let r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?J(false,r):G(false,r);}}function tl(t){let{drag:e,layout:o}=at;if(!e&&!o)return {};let r={...e,...o};return {MeasureLayout:e?.isEnabled(t)||o?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var Si=t=>e=>typeof e=="string"&&e.startsWith(t),$t=Si("--"),el=Si("var(--"),Wt=t=>el(t)?ol.test(t.split("/*")[0].trim()):false,ol=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var Dt={};function Vi(t){for(let e in t)Dt[e]=t[e],$t(e)&&(Dt[e].isCSSVariable=true);}var tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$=new Set(tt);function Ye(t,{layout:e,layoutId:o}){return $.has(t)||t.startsWith("origin")||(e||o!==void 0)&&(!!Dt[t]||t==="opacity")}var M=t=>!!(t&&t.getVelocity);var qe=(t,e)=>e&&typeof t=="number"?e.transform(t):t;var O=(t,e,o)=>o>e?e:o<t?t:o;var et={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},mt={...et,transform:t=>O(0,1,t)},Me={...et,default:1};var we=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ot=we("deg"),U=we("%"),x=we("px"),bi=we("vh"),Ai=we("vw"),mr={...U,parse:t=>U.parse(t)/100,transform:t=>U.transform(t*100)};var Ci={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x};var Mi={rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:Me,scaleX:Me,scaleY:Me,scaleZ:Me,skew:ot,skewX:ot,skewY:ot,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:mt,originX:mr,originY:mr,originZ:x};var cr={...et,transform:Math.round};var zt={...Ci,...Mi,zIndex:cr,size:x,fillOpacity:mt,strokeOpacity:mt,numOctaves:cr};var rl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},il=tt.length;function wi(t,e,o){let r="",i=true;for(let s=0;s<il;s++){let n=tt[s],a=t[n];if(a===void 0)continue;let l=true;if(typeof a=="number"?l=a===(n.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||o){let u=qe(a,zt[n]);if(!l){i=false;let m=rl[n]||n;r+=`${m}(${u}) `;}o&&(e[n]=u);}}return r=r.trim(),o?r=o(e,i?"":r):i&&(r="none"),r}function Ht(t,e,o){let{style:r,vars:i,transformOrigin:s}=t,n=false,a=false;for(let l in e){let u=e[l];if($.has(l)){n=true;continue}else if($t(l)){i[l]=u;continue}else {let m=qe(u,zt[l]);l.startsWith("origin")?(a=true,s[l]=m):r[l]=m;}}if(e.transform||(n||o?r.transform=wi(e,t.transform,o):r.transform&&(r.transform="none")),a){let{originX:l="50%",originY:u="50%",originZ:m=0}=s;r.transformOrigin=`${l} ${u} ${m}`;}}var Yt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fr(t,e,o){for(let r in e)!M(e[r])&&!Ye(r,o)&&(t[r]=e[r]);}function sl({transformTemplate:t},e){return useMemo(()=>{let o=Yt();return Ht(o,e,t),Object.assign({},o.vars,o.style)},[e])}function al(t,e){let o=t.style||{},r={};return fr(r,o,t),Object.assign(r,sl(t,e)),r}function Di(t,e){let o={},r=al(t,e);return t.drag&&t.dragListener!==false&&(o.draggable=false,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===true?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=r,o}var Ei=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qt(t){return typeof t!="string"||t.includes("-")?false:!!(Ei.indexOf(t)>-1||/[A-Z]/u.test(t))}var ll={offset:"stroke-dashoffset",array:"stroke-dasharray"},ul={offset:"strokeDashoffset",array:"strokeDasharray"};function Ri(t,e,o=1,r=0,i=true){t.pathLength=1;let s=i?ll:ul;t[s.offset]=x.transform(-r);let n=x.transform(e),a=x.transform(o);t[s.array]=`${n} ${a}`;}function Li(t,e,o){return typeof t=="string"?t:x.transform(e+o*t)}function Bi(t,e,o){let r=Li(e,t.x,t.width),i=Li(o,t.y,t.height);return `${r} ${i}`}function Xt(t,{attrX:e,attrY:o,attrScale:r,originX:i,originY:s,pathLength:n,pathSpacing:a=1,pathOffset:l=0,...u},m,c){if(Ht(t,u,c),m){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:f,style:p,dimensions:h}=t;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Bi(h,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(f.x=e),o!==void 0&&(f.y=o),r!==void 0&&(f.scale=r),n!==void 0&&Ri(f,n,a,l,false);}var Xe=()=>({...Yt(),attrs:{}});var Zt=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Fi(t,e,o,r){let i=useMemo(()=>{let s=Xe();return Xt(s,e,Zt(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){let s={};fr(s,t.style,t),i.style={...s,...i.style};}return i}function Ii(t=false){return (o,r,i,{latestValues:s},n)=>{let l=(qt(o)?Fi:Di)(r,s,n,o),u=ci(r,typeof o=="string",t),m=o!==Fragment?{...u,...l,ref:i}:{},{children:c}=r,f=useMemo(()=>M(c)?c.get():c,[c]);return createElement(o,{...m,children:f})}}function Oi(t){let e=[{},{}];return t?.values.forEach((o,r)=>{e[0][r]=o.get(),e[1][r]=o.getVelocity();}),e}function Jt(t,e,o,r){if(typeof e=="function"){let[i,s]=Oi(r);e=e(o!==void 0?o:t.custom,i,s);}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){let[i,s]=Oi(r);e=e(o!==void 0?o:t.custom,i,s);}return e}var De=t=>Array.isArray(t);var ki=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),ji=t=>De(t)?t[t.length-1]||0:t;function Qt(t){let e=M(t)?t.get():t;return ki(e)?e.toValue():e}function hl({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:o},r,i,s){let n={latestValues:dl(r,i,s,t),renderState:e()};return o&&(n.onMount=a=>o({props:r,current:a,...n}),n.onUpdate=a=>o(a)),n}var Ze=t=>(e,o)=>{let r=useContext(xt),i=useContext(Ut),s=()=>hl(t,e,r,i);return o?s():ii(s)};function dl(t,e,o,r){let i={},s=r(t,{});for(let f in s)i[f]=Qt(s[f]);let{initial:n,animate:a}=t,l=wt(t),u=We(t);e&&u&&!l&&t.inherit!==false&&(n===void 0&&(n=e.initial),a===void 0&&(a=e.animate));let m=o?o.initial===false:false;m=m||n===false;let c=m?a:n;if(c&&typeof c!="boolean"&&!vt(c)){let f=Array.isArray(c)?c:[c];for(let p=0;p<f.length;p++){let h=Jt(t,f[p]);if(h){let{transitionEnd:d,transition:y,...g}=h;for(let v in g){let T=g[v];if(Array.isArray(T)){let A=m?T.length-1:0;T=T[A];}T!==null&&(i[v]=T);}for(let v in d)i[v]=d[v];}}}return i}function te(t,e,o){var r;let{style:i}=t,s={};for(let n in i)(M(i[n])||e.style&&M(e.style[n])||Ye(n,t)||((r=o?.getValue(n))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[n]=i[n]);return s}var Ui={useVisualState:Ze({scrapeMotionValuesFromProps:te,createRenderState:Yt})};function Je(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect();}catch{e.dimensions={x:0,y:0,width:0,height:0};}}function Qe(t,{style:e,vars:o},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(let s in o)t.style.setProperty(s,o[s]);}var to=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function eo(t,e,o,r){Qe(t,e,void 0,r);for(let i in e.attrs)t.setAttribute(to.has(i)?i:_t(i),e.attrs[i]);}function oo(t,e,o){let r=te(t,e,o);for(let i in t)if(M(t[i])||M(e[i])){let s=tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i];}return r}var Ki=["x","y","width","height","cx","cy","r"],_i={useVisualState:Ze({scrapeMotionValuesFromProps:oo,createRenderState:Xe,onUpdate:({props:t,prevProps:e,current:o,renderState:r,latestValues:i})=>{if(!o)return;let s=!!t.drag;if(!s){for(let a in i)if($.has(a)){s=true;break}}if(!s)return;let n=!e;if(e)for(let a=0;a<Ki.length;a++){let l=Ki[a];t[l]!==e[l]&&(n=true);}n&&S.read(()=>{Je(o,r),S.render(()=>{Xt(r,i,Zt(o.tagName),t.transformTemplate),eo(o,r);});});}})};function Gi(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:false}){let n={...qt(r)?_i:Ui,preloadedFeatures:t,useRender:Ii(i),createVisualElement:e,Component:r};return Pi(n)}}function ct(t,e,o){let r=t.getProps();return Jt(r,e,o!==void 0?o:r.custom,t)}function ee(t,e){return t?t[e]||t.default||t:void 0}var ro=new Set(["width","height","top","left","right","bottom",...tt]);var io;function gl(){io=void 0;}var k={now:()=>(io===void 0&&k.set(R.isProcessing||Mt.useManualTiming?R.timestamp:performance.now()),io),set:t=>{io=t,queueMicrotask(gl);}};function oe(t,e){t.indexOf(e)===-1&&t.push(e);}function re(t,e){let o=t.indexOf(e);o>-1&&t.splice(o,1);}var Tt=class{constructor(){this.subscriptions=[];}add(e){return oe(this.subscriptions,e),()=>re(this.subscriptions,e)}notify(e,o,r){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,o,r);else for(let s=0;s<i;s++){let n=this.subscriptions[s];n&&n(e,o,r);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};function no(t,e){return e?t*(1e3/e):0}var $i=30,yl=t=>!isNaN(parseFloat(t)),pr=class{constructor(e,o={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=true)=>{let s=k.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current);},this.hasAnimated=false,this.setCurrent(e),this.owner=o.owner;}setCurrent(e){this.current=e,this.updatedAt=k.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=yl(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&yt(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,o){this.events[e]||(this.events[e]=new Tt);let r=this.events[e].add(o);return e==="change"?()=>{r(),S.read(()=>{this.events.change.getSize()||this.stop();});}:r}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,o){this.passiveEffect=e,this.stopPassiveEffect=o;}set(e,o=true){!o||!this.passiveEffect?this.updateAndNotify(e,o):this.passiveEffect(e,this.updateAndNotify);}setWithVelocity(e,o,r){this.set(o),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r;}jump(e,o=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>$i)return 0;let o=Math.min(this.updatedAt-this.prevUpdatedAt,$i);return no(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(e){return this.stop(),new Promise(o=>{this.hasAnimated=true,this.animation=e(o),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function ft(t,e){return new pr(t,e)}function xl(t,e,o){t.hasValue(e)?t.getValue(e).set(o):t.addValue(e,ft(o));}function zi(t,e){let o=ct(t,e),{transitionEnd:r={},transition:i={},...s}=o||{};s={...s,...r};for(let n in s){let a=ji(s[n]);xl(t,n,a);}}function Hi(t){return !!(M(t)&&t.add)}function Ee(t,e){let o=t.getValue("willChange");if(Hi(o))return o.add(e)}function so(t){return t.props[ze]}function ie(t){let e;return ()=>(e===void 0&&(e=t()),e)}var Yi=ie(()=>window.ScrollTimeline!==void 0);var ao=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,o){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=o;}attachTimeline(e,o){let r=this.animations.map(i=>{if(Yi()&&i.attachTimeline)return i.attachTimeline(e);if(typeof o=="function")return o(i)});return ()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let o=0;o<this.animations.length;o++)e=Math.max(e,this.animations[o].duration);return e}runAll(e){this.animations.forEach(o=>o[e]());}flatten(){this.runAll("flatten");}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var lo=class extends ao{then(e,o){return Promise.all(this.animations).then(e).catch(o)}};var j=t=>t*1e3,W=t=>t/1e3;function ne(t){return typeof t=="function"}function hr(t,e){t.timeline=e,t.onfinish=null;}var Re=t=>Array.isArray(t)&&typeof t[0]=="number";var qi={linearEasing:void 0};function Xi(t,e){let o=ie(t);return ()=>{var r;return (r=qi[e])!==null&&r!==void 0?r:o()}}var se=Xi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Q=(t,e,o)=>{let r=e-t;return r===0?1:(o-t)/r};var mo=(t,e,o=10)=>{let r="",i=Math.max(Math.round(e/o),2);for(let s=0;s<i;s++)r+=t(Q(0,i-1,s))+", ";return `linear(${r.substring(0,r.length-2)})`};function gr(t){return !!(typeof t=="function"&&se()||!t||typeof t=="string"&&(t in dr||se())||Re(t)||Array.isArray(t)&&t.every(gr))}var Le=([t,e,o,r])=>`cubic-bezier(${t}, ${e}, ${o}, ${r})`,dr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Le([0,.65,.55,1]),circOut:Le([.55,0,1,.45]),backIn:Le([.31,.01,.66,-0.59]),backOut:Le([.33,1.53,.69,.99])};function yr(t,e){if(t)return typeof t=="function"&&se()?mo(t,e):Re(t)?Le(t):Array.isArray(t)?t.map(o=>yr(o,e)||dr.easeOut):dr[t]}var Zi=(t,e,o)=>(((1-3*o+3*e)*t+(3*o-6*e))*t+3*e)*t,vl=1e-7,Tl=12;function Pl(t,e,o,r,i){let s,n,a=0;do n=e+(o-e)/2,s=Zi(n,r,i)-t,s>0?o=n:e=n;while(Math.abs(s)>vl&&++a<Tl);return n}function Pt(t,e,o,r){if(t===e&&o===r)return E;let i=s=>Pl(s,0,1,t,o);return s=>s===0||s===1?s:Zi(i(s),e,r)}var co=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2;var fo=t=>e=>1-t(1-e);var xr=Pt(.33,1.53,.69,.99),Be=fo(xr),po=co(Be);var ho=t=>(t*=2)<1?.5*Be(t):.5*(2-Math.pow(2,-10*(t-1)));var go=t=>1-Math.sin(Math.acos(t)),yo=fo(go),xo=co(go);var vo=t=>/^0[^.\s]+$/u.test(t);function Ji(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||vo(t):true}var St=t=>Math.round(t*1e5)/1e5;var ae=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qi(t){return t==null}var tn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var le=(t,e)=>o=>!!(typeof o=="string"&&tn.test(o)&&o.startsWith(t)||e&&!Qi(o)&&Object.prototype.hasOwnProperty.call(o,e)),To=(t,e,o)=>r=>{if(typeof r!="string")return r;let[i,s,n,a]=r.match(ae);return {[t]:parseFloat(i),[e]:parseFloat(s),[o]:parseFloat(n),alpha:a!==void 0?parseFloat(a):1}};var Sl=t=>O(0,255,t),vr={...et,transform:t=>Math.round(Sl(t))},rt={test:le("rgb","red"),parse:To("red","green","blue"),transform:({red:t,green:e,blue:o,alpha:r=1})=>"rgba("+vr.transform(t)+", "+vr.transform(e)+", "+vr.transform(o)+", "+St(mt.transform(r))+")"};function Vl(t){let e="",o="",r="",i="";return t.length>5?(e=t.substring(1,3),o=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),o=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,o+=o,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(o,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Fe={test:le("#"),parse:Vl,transform:rt.transform};var Vt={test:le("hsl","hue"),parse:To("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+U.transform(St(e))+", "+U.transform(St(o))+", "+St(mt.transform(r))+")"};var L={test:t=>rt.test(t)||Fe.test(t)||Vt.test(t),parse:t=>rt.test(t)?rt.parse(t):Vt.test(t)?Vt.parse(t):Fe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):Vt.transform(t)};var en=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function bl(t){var e,o;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ae))===null||e===void 0?void 0:e.length)||0)+(((o=t.match(en))===null||o===void 0?void 0:o.length)||0)>0}var rn="number",nn="color",Al="var",Cl="var(",on="${}",Ml=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Et(t){let e=t.toString(),o=[],r={color:[],number:[],var:[]},i=[],s=0,a=e.replace(Ml,l=>(L.test(l)?(r.color.push(s),i.push(nn),o.push(L.parse(l))):l.startsWith(Cl)?(r.var.push(s),i.push(Al),o.push(l)):(r.number.push(s),i.push(rn),o.push(parseFloat(l))),++s,on)).split(on);return {values:o,split:a,indexes:r,types:i}}function sn(t){return Et(t).values}function an(t){let{split:e,types:o}=Et(t),r=e.length;return i=>{let s="";for(let n=0;n<r;n++)if(s+=e[n],i[n]!==void 0){let a=o[n];a===rn?s+=St(i[n]):a===nn?s+=L.transform(i[n]):s+=i[n];}return s}}var wl=t=>typeof t=="number"?0:t;function Dl(t){let e=sn(t);return an(t)(e.map(wl))}var K={test:bl,parse:sn,createTransformer:an,getAnimatableNone:Dl};var El=new Set(["brightness","contrast","saturate","opacity"]);function Rl(t){let[e,o]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;let[r]=o.match(ae)||[];if(!r)return t;let i=o.replace(r,""),s=El.has(e)?1:0;return r!==o&&(s*=100),e+"("+s+i+")"}var Ll=/\b([a-z-]*)\(.*?\)/gu,Ie={...K,getAnimatableNone:t=>{let e=t.match(Ll);return e?e.map(Rl).join(" "):t}};var Bl={...zt,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:Ie,WebkitFilter:Ie},ue=t=>Bl[t];function Po(t,e){let o=ue(t);return o!==Ie&&(o=K),o.getAnimatableNone?o.getAnimatableNone(e):void 0}var Fl=new Set(["auto","none","0"]);function ln(t,e,o){let r=0,i;for(;r<t.length&&!i;){let s=t[r];typeof s=="string"&&!Fl.has(s)&&Et(s).values.length&&(i=t[r]),r++;}if(i&&o)for(let s of e)t[s]=Po(o,i);}var Tr=t=>t===et||t===x,un=(t,e)=>parseFloat(t.split(", ")[e]),mn=(t,e)=>(o,{transform:r})=>{if(r==="none"||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/u);if(i)return un(i[1],e);{let s=r.match(/^matrix\((.+)\)$/u);return s?un(s[1],t):0}},Il=new Set(["x","y","z"]),Ol=tt.filter(t=>!Il.has(t));function cn(t){let e=[];return Ol.forEach(o=>{let r=t.getValue(o);r!==void 0&&(e.push([o,r.get()]),r.set(o.startsWith("scale")?1:0));}),e}var Rt={width:({x:t},{paddingLeft:e="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(e)-parseFloat(o),height:({y:t},{paddingTop:e="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(e)-parseFloat(o),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:mn(4,13),y:mn(5,14)};Rt.translateX=Rt.x;Rt.translateY=Rt.y;var Lt=new Set,Pr=false,Sr=false;function fn(){if(Sr){let t=Array.from(Lt).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),o=new Map;e.forEach(r=>{let i=cn(r);i.length&&(o.set(r,i),r.render());}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();let i=o.get(r);i&&i.forEach(([s,n])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(n);});}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY);});}Sr=false,Pr=false,Lt.forEach(t=>t.complete()),Lt.clear();}function pn(){Lt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Sr=true);});}function hn(){pn(),fn();}var bt=class{constructor(e,o,r,i,s,n=false){this.isComplete=false,this.isAsync=false,this.needsMeasurement=false,this.isScheduled=false,this.unresolvedKeyframes=[...e],this.onComplete=o,this.name=r,this.motionValue=i,this.element=s,this.isAsync=n;}scheduleResolve(){this.isScheduled=true,this.isAsync?(Lt.add(this),Pr||(Pr=true,S.read(pn),S.resolveKeyframes(fn))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:o,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){let n=i?.get(),a=e[e.length-1];if(n!==void 0)e[0]=n;else if(r&&o){let l=r.readValue(o,a);l!=null&&(e[0]=l);}e[0]===void 0&&(e[0]=a),i&&n===void 0&&i.set(e[0]);}else e[s]=e[s-1];}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=true,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Lt.delete(this);}cancel(){this.isComplete||(this.isScheduled=false,Lt.delete(this));}resume(){this.isComplete||this.scheduleResolve();}};var So=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);var kl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function jl(t){let e=kl.exec(t);if(!e)return [,];let[,o,r,i]=e;return [`--${o??r}`,i]}var Nl=4;function Vr(t,e,o=1){G(o<=Nl,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[r,i]=jl(t);if(!r)return;let s=window.getComputedStyle(e).getPropertyValue(r);if(s){let n=s.trim();return So(n)?parseFloat(n):n}return Wt(i)?Vr(i,e,o+1):i}var Vo=t=>e=>e.test(t);var dn={test:t=>t==="auto",parse:t=>t};var br=[et,x,U,ot,Ai,bi,dn],Ar=t=>br.find(Vo(t));var me=class extends bt{constructor(e,o,r,i,s){super(e,o,r,i,s,true);}readKeyframes(){let{unresolvedKeyframes:e,element:o,name:r}=this;if(!o||!o.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),Wt(u))){let m=Vr(u,o.current);m!==void 0&&(e[l]=m),l===e.length-1&&(this.finalKeyframe=u);}}if(this.resolveNoneKeyframes(),!ro.has(r)||e.length!==2)return;let[i,s]=e,n=Ar(i),a=Ar(s);if(n!==a)if(Tr(n)&&Tr(a))for(let l=0;l<e.length;l++){let u=e[l];typeof u=="string"&&(e[l]=parseFloat(u));}else this.needsMeasurement=true;}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:o}=this,r=[];for(let i=0;i<e.length;i++)Ji(e[i])&&r.push(i);r.length&&ln(e,r,o);}measureInitialState(){let{element:e,unresolvedKeyframes:o,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Rt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),o[0]=this.measuredOrigin;let i=o[o.length-1];i!==void 0&&e.getValue(r,i).jump(i,false);}measureEndState(){var e;let{element:o,name:r,unresolvedKeyframes:i}=this;if(!o||!o.current)return;let s=o.getValue(r);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,a=i[n];i[n]=Rt[r](o.measureViewportBox(),window.getComputedStyle(o.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{o.getValue(l).set(u);}),this.resolveNoneKeyframes();}};var Cr=(t,e)=>e==="zIndex"?false:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(K.test(t)||t==="0")&&!t.startsWith("url("));function Ul(t){let e=t[0];if(t.length===1)return true;for(let o=0;o<t.length;o++)if(t[o]!==e)return true}function gn(t,e,o,r){let i=t[0];if(i===null)return false;if(e==="display"||e==="visibility")return true;let s=t[t.length-1],n=Cr(i,e),a=Cr(s,e);return J(n===a,`You are trying to animate ${e} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!n||!a?false:Ul(t)||(o==="spring"||ne(o))&&r}var Kl=t=>t!==null;function At(t,{repeat:e,repeatType:o="loop"},r){let i=t.filter(Kl),s=e&&o!=="loop"&&e%2===1?0:i.length-1;return !s||r===void 0?i[s]:r}var _l=40,ce=class{constructor({autoplay:e=true,delay:o=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:n="loop",...a}){this.isStopped=false,this.hasAttemptedResolve=false,this.createdAt=k.now(),this.options={autoplay:e,delay:o,type:r,repeat:i,repeatDelay:s,repeatType:n,...a},this.updateFinishedPromise();}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>_l?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return !this._resolved&&!this.hasAttemptedResolve&&hn(),this._resolved}onKeyframesResolved(e,o){this.resolvedAt=k.now(),this.hasAttemptedResolve=true;let{name:r,type:i,velocity:s,delay:n,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!gn(e,r,i,s))if(!n){l&&l(At(e,this.options,o)),a&&a(),this.resolveFinishedPromise();return}else this.options.duration=0;let m=this.initPlayback(e,o);m!==false&&(this._resolved={keyframes:e,finalKeyframe:o,...m},this.onPostResolved());}onPostResolved(){}then(e,o){return this.currentFinishedPromise.then(e,o)}flatten(){this.options.type="keyframes",this.options.ease="linear";}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e;});}};function bo(t){let e=0,o=50,r=t.next(e);for(;!r.done&&e<2e4;)e+=o,r=t.next(e);return e>=2e4?1/0:e}var b=(t,e,o)=>t+(e-t)*o;function Mr(t,e,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(e-t)*6*o:o<1/2?e:o<2/3?t+(e-t)*(2/3-o)*6:t}function yn({hue:t,saturation:e,lightness:o,alpha:r}){t/=360,e/=100,o/=100;let i=0,s=0,n=0;if(!e)i=s=n=o;else {let a=o<.5?o*(1+e):o+e-o*e,l=2*o-a;i=Mr(l,a,t+1/3),s=Mr(l,a,t),n=Mr(l,a,t-1/3);}return {red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(n*255),alpha:r}}function fe(t,e){return o=>o>0?e:t}var wr=(t,e,o)=>{let r=t*t,i=o*(e*e-r)+r;return i<0?0:Math.sqrt(i)},Gl=[Fe,rt,Vt],$l=t=>Gl.find(e=>e.test(t));function xn(t){let e=$l(t);if(J(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return false;let o=e.parse(t);return e===Vt&&(o=yn(o)),o}var Dr=(t,e)=>{let o=xn(t),r=xn(e);if(!o||!r)return fe(t,e);let i={...o};return s=>(i.red=wr(o.red,r.red,s),i.green=wr(o.green,r.green,s),i.blue=wr(o.blue,r.blue,s),i.alpha=b(o.alpha,r.alpha,s),rt.transform(i))};var Wl=(t,e)=>o=>e(t(o)),nt=(...t)=>t.reduce(Wl);var Ao=new Set(["none","hidden"]);function vn(t,e){return Ao.has(t)?o=>o<=0?t:e:o=>o>=1?e:t}function zl(t,e){return o=>b(t,e,o)}function Co(t){return typeof t=="number"?zl:typeof t=="string"?Wt(t)?fe:L.test(t)?Dr:ql:Array.isArray(t)?Tn:typeof t=="object"?L.test(t)?Dr:Hl:fe}function Tn(t,e){let o=[...t],r=o.length,i=t.map((s,n)=>Co(s)(s,e[n]));return s=>{for(let n=0;n<r;n++)o[n]=i[n](s);return o}}function Hl(t,e){let o={...t,...e},r={};for(let i in o)t[i]!==void 0&&e[i]!==void 0&&(r[i]=Co(t[i])(t[i],e[i]));return i=>{for(let s in r)o[s]=r[s](i);return o}}function Yl(t,e){var o;let r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],a=t.indexes[n][i[n]],l=(o=t.values[a])!==null&&o!==void 0?o:0;r[s]=l,i[n]++;}return r}var ql=(t,e)=>{let o=K.createTransformer(e),r=Et(t),i=Et(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ao.has(t)&&!i.values.length||Ao.has(e)&&!r.values.length?vn(t,e):nt(Tn(Yl(r,i),i.values),o):(J(true,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),fe(t,e))};function Mo(t,e,o){return typeof t=="number"&&typeof e=="number"&&typeof o=="number"?b(t,e,o):Co(t)(t,e)}var Xl=5;function wo(t,e,o){let r=Math.max(e-Xl,0);return no(o-t(r),e-r)}var w={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Er=.001;function Pn({duration:t=w.duration,bounce:e=w.bounce,velocity:o=w.velocity,mass:r=w.mass}){let i,s;J(t<=j(w.maxDuration),"Spring duration must be 10 seconds or less");let n=1-e;n=O(w.minDamping,w.maxDamping,n),t=O(w.minDuration,w.maxDuration,W(t)),n<1?(i=u=>{let m=u*n,c=m*t,f=m-o,p=Do(u,n),h=Math.exp(-c);return Er-f/p*h},s=u=>{let c=u*n*t,f=c*o+o,p=Math.pow(n,2)*Math.pow(u,2)*t,h=Math.exp(-c),d=Do(Math.pow(u,2),n);return (-i(u)+Er>0?-1:1)*((f-p)*h)/d}):(i=u=>{let m=Math.exp(-u*t),c=(u-o)*t+1;return -1e-3+m*c},s=u=>{let m=Math.exp(-u*t),c=(o-u)*(t*t);return m*c});let a=5/t,l=Jl(i,s,a);if(t=j(t),isNaN(l))return {stiffness:w.stiffness,damping:w.damping,duration:t};{let u=Math.pow(l,2)*r;return {stiffness:u,damping:n*2*Math.sqrt(r*u),duration:t}}}var Zl=12;function Jl(t,e,o){let r=o;for(let i=1;i<Zl;i++)r=r-t(r)/e(r);return r}function Do(t,e){return t*Math.sqrt(1-e*e)}var tu=["duration","bounce"],eu=["stiffness","damping","mass"];function Sn(t,e){return e.some(o=>t[o]!==void 0)}function ou(t){let e={velocity:w.velocity,stiffness:w.stiffness,damping:w.damping,mass:w.mass,isResolvedFromDuration:false,...t};if(!Sn(t,eu)&&Sn(t,tu))if(t.visualDuration){let o=t.visualDuration,r=2*Math.PI/(o*1.2),i=r*r,s=2*O(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:w.mass,stiffness:i,damping:s};}else {let o=Pn(t);e={...e,...o,mass:w.mass},e.isResolvedFromDuration=true;}return e}function Eo(t=w.visualDuration,e=w.bounce){let o=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:r,restDelta:i}=o,s=o.keyframes[0],n=o.keyframes[o.keyframes.length-1],a={done:false,value:s},{stiffness:l,damping:u,mass:m,duration:c,velocity:f,isResolvedFromDuration:p}=ou({...o,velocity:-W(o.velocity||0)}),h=f||0,d=u/(2*Math.sqrt(l*m)),y=n-s,g=W(Math.sqrt(l/m)),v=Math.abs(y)<5;r||(r=v?w.restSpeed.granular:w.restSpeed.default),i||(i=v?w.restDelta.granular:w.restDelta.default);let T;if(d<1){let P=Do(g,d);T=C=>{let I=Math.exp(-d*g*C);return n-I*((h+d*g*y)/P*Math.sin(P*C)+y*Math.cos(P*C))};}else if(d===1)T=P=>n-Math.exp(-g*P)*(y+(h+g*y)*P);else {let P=g*Math.sqrt(d*d-1);T=C=>{let I=Math.exp(-d*g*C),V=Math.min(P*C,300);return n-I*((h+d*g*y)*Math.sinh(V)+P*y*Math.cosh(V))/P};}let A={calculatedDuration:p&&c||null,next:P=>{let C=T(P);if(p)a.done=P>=c;else {let I=0;d<1&&(I=P===0?j(h):wo(T,P,C));let V=Math.abs(I)<=r,_=Math.abs(n-C)<=i;a.done=V&&_;}return a.value=a.done?n:C,a},toString:()=>{let P=Math.min(bo(A),2e4),C=mo(I=>A.next(P*I).value,P,30);return P+"ms "+C}};return A}function Rr({keyframes:t,velocity:e=0,power:o=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:n,min:a,max:l,restDelta:u=.5,restSpeed:m}){let c=t[0],f={done:false,value:c},p=V=>a!==void 0&&V<a||l!==void 0&&V>l,h=V=>a===void 0?l:l===void 0||Math.abs(a-V)<Math.abs(l-V)?a:l,d=o*e,y=c+d,g=n===void 0?y:n(y);g!==y&&(d=g-c);let v=V=>-d*Math.exp(-V/r),T=V=>g+v(V),A=V=>{let _=v(V),X=T(V);f.done=Math.abs(_)<=u,f.value=f.done?g:X;},P,C,I=V=>{p(f.value)&&(P=V,C=Eo({keyframes:[f.value,h(f.value)],velocity:wo(T,V,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:m}));};return I(0),{calculatedDuration:null,next:V=>{let _=false;return !C&&P===void 0&&(_=true,A(V),I(V)),P!==void 0&&V>=P?C.next(V-P):(!_&&A(V),f)}}}var Vn=Pt(.42,0,1,1),bn=Pt(0,0,.58,1),Ro=Pt(.42,0,.58,1);var An=t=>Array.isArray(t)&&typeof t[0]!="number";var Cn={linear:E,easeIn:Vn,easeInOut:Ro,easeOut:bn,circIn:go,circInOut:xo,circOut:yo,backIn:Be,backInOut:po,backOut:xr,anticipate:ho},Lr=t=>{if(Re(t)){G(t.length===4,"Cubic bezier arrays must contain four numerical values.");let[e,o,r,i]=t;return Pt(e,o,r,i)}else if(typeof t=="string")return G(Cn[t]!==void 0,`Invalid easing type '${t}'`),Cn[t];return t};function ru(t,e,o){let r=[],i=o||Mo,s=t.length-1;for(let n=0;n<s;n++){let a=i(t[n],t[n+1]);if(e){let l=Array.isArray(e)?e[n]||E:e;a=nt(l,a);}r.push(a);}return r}function Mn(t,e,{clamp:o=true,ease:r,mixer:i}={}){let s=t.length;if(G(s===e.length,"Both input and output ranges must be the same length"),s===1)return ()=>e[0];if(s===2&&e[0]===e[1])return ()=>e[1];let n=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=ru(e,r,i),l=a.length,u=m=>{if(n&&m<t[0])return e[0];let c=0;if(l>1)for(;c<t.length-2&&!(m<t[c+1]);c++);let f=Q(t[c],t[c+1],m);return a[c](f)};return o?m=>u(O(t[0],t[s-1],m)):u}function wn(t,e){let o=t[t.length-1];for(let r=1;r<=e;r++){let i=Q(0,e,r);t.push(b(o,1,i));}}function Dn(t){let e=[0];return wn(e,t.length-1),e}function En(t,e){return t.map(o=>o*e)}function iu(t,e){return t.map(()=>e||Ro).splice(0,t.length-1)}function pe({duration:t=300,keyframes:e,times:o,ease:r="easeInOut"}){let i=An(r)?r.map(Lr):Lr(r),s={done:false,value:e[0]},n=En(o&&o.length===e.length?o:Dn(e),t),a=Mn(n,e,{ease:Array.isArray(i)?i:iu(e,i)});return {calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}var Rn=t=>{let e=({timestamp:o})=>t(o);return {start:()=>S.update(e,true),stop:()=>Y(e),now:()=>R.isProcessing?R.timestamp:k.now()}};var nu={decay:Rr,inertia:Rr,tween:pe,keyframes:pe,spring:Eo},su=t=>t/100,Bt=class extends ce{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=true,this.state==="idle")return;this.teardown();let{onStop:l}=this.options;l&&l();};let{name:o,motionValue:r,element:i,keyframes:s}=this.options,n=i?.KeyframeResolver||bt,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new n(s,a,o,r,i),this.resolver.scheduleResolve();}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes));}initPlayback(e){let{type:o="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:n=0}=this.options,a=ne(o)?o:nu[o]||pe,l,u;process.env.NODE_ENV!=="production"&&a!==pe&&G(e.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a!==pe&&typeof e[0]!="number"&&(l=nt(su,Mo(e[0],e[1])),e=[0,100]);let m=a({...this.options,keyframes:e});s==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-n})),m.calculatedDuration===null&&(m.calculatedDuration=bo(m));let{calculatedDuration:c}=m,f=c+i,p=f*(r+1)-i;return {generator:m,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:p}}onPostResolved(){let{autoplay:e=true}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState;}tick(e,o=false){let{resolved:r}=this;if(!r){let{keyframes:V}=this.options;return {done:true,value:V[V.length-1]}}let{finalKeyframe:i,generator:s,mirroredGenerator:n,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:m,resolvedDuration:c}=r;if(this.startTime===null)return s.next(0);let{delay:f,repeat:p,repeatType:h,repeatDelay:d,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-m/this.speed,this.startTime)),o?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;let g=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>m;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=m);let T=this.currentTime,A=s;if(p){let V=Math.min(this.currentTime,m)/c,_=Math.floor(V),X=V%1;!X&&V>=1&&(X=1),X===1&&_--,_=Math.min(_,p+1),!!(_%2)&&(h==="reverse"?(X=1-X,d&&(X-=d/c)):h==="mirror"&&(A=n)),T=O(0,1,X)*c;}let P=v?{done:false,value:l[0]}:A.next(T);a&&(P.value=a(P.value));let{done:C}=P;!v&&u!==null&&(C=this.speed>=0?this.currentTime>=m:this.currentTime<=0);let I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return I&&i!==void 0&&(P.value=At(l,this.options,i)),y&&y(P.value),I&&this.finish(),P}get duration(){let{resolved:e}=this;return e?W(e.calculatedDuration):0}get time(){return W(this.currentTime)}set time(e){e=j(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed);}get speed(){return this.playbackSpeed}set speed(e){let o=this.playbackSpeed!==e;this.playbackSpeed=e,o&&(this.time=W(this.currentTime));}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:e=Rn,onPlay:o,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),o&&o();let i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start();}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0;}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null;}finish(){this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e();}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise();}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel();}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}};var Ln=new Set(["opacity","clipPath","filter","transform"]);function Bn(t,e,o,{delay:r=0,duration:i=300,repeat:s=0,repeatType:n="loop",ease:a="easeInOut",times:l}={}){let u={[e]:o};l&&(u.offset=l);let m=yr(a,i);Array.isArray(m)&&(u.easing=m);let c=t.animate(u,{delay:r,duration:i,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:s+1,direction:n==="reverse"?"alternate":"normal"});return c}var Fn=ie(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Lo=10,au=2e4;function lu(t){return ne(t.type)||t.type==="spring"||!gr(t.ease)}function uu(t,e){let o=new Bt({...e,keyframes:t,repeat:0,delay:0,isGenerator:true}),r={done:false,value:t[0]},i=[],s=0;for(;!r.done&&s<au;)r=o.sample(s),i.push(r.value),s+=Lo;return {times:void 0,keyframes:i,duration:s-Lo,ease:"linear"}}var In={anticipate:ho,backInOut:po,circInOut:xo};function mu(t){return t in In}var Oe=class extends ce{constructor(e){super(e);let{name:o,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new me(s,(n,a)=>this.onKeyframesResolved(n,a),o,r,i),this.resolver.scheduleResolve();}initPlayback(e,o){let{duration:r=300,times:i,ease:s,type:n,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return false;if(typeof s=="string"&&se()&&mu(s)&&(s=In[s]),lu(this.options)){let{onComplete:c,onUpdate:f,motionValue:p,element:h,...d}=this.options,y=uu(e,d);e=y.keyframes,e.length===1&&(e[1]=e[0]),r=y.duration,i=y.times,s=y.ease,n="keyframes";}let m=Bn(a.owner.current,l,e,{...this.options,duration:r,times:i,ease:s});return m.startTime=u??this.calcStartTime(),this.pendingTimeline?(hr(m,this.pendingTimeline),this.pendingTimeline=void 0):m.onfinish=()=>{let{onComplete:c}=this.options;a.set(At(e,this.options,o)),c&&c(),this.cancel(),this.resolveFinishedPromise();},{animation:m,duration:r,times:i,type:n,ease:s,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:o}=e;return W(o)}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:o}=e;return W(o.currentTime||0)}set time(e){let{resolved:o}=this;if(!o)return;let{animation:r}=o;r.currentTime=j(e);}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:o}=e;return o.playbackRate}set speed(e){let{resolved:o}=this;if(!o)return;let{animation:r}=o;r.playbackRate=e;}get state(){let{resolved:e}=this;if(!e)return "idle";let{animation:o}=e;return o.playState}get startTime(){let{resolved:e}=this;if(!e)return null;let{animation:o}=e;return o.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else {let{resolved:o}=this;if(!o)return E;let{animation:r}=o;hr(r,e);}return E}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:o}=e;o.playState==="finished"&&this.updateFinishedPromise(),o.play();}pause(){let{resolved:e}=this;if(!e)return;let{animation:o}=e;o.pause();}stop(){if(this.resolver.cancel(),this.isStopped=true,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:o,keyframes:r,duration:i,type:s,ease:n,times:a}=e;if(o.playState==="idle"||o.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:m,onComplete:c,element:f,...p}=this.options,h=new Bt({...p,keyframes:r,duration:i,type:s,ease:n,times:a,isGenerator:true}),d=j(this.time);u.setWithVelocity(h.sample(d-Lo).value,h.sample(d).value,Lo);}let{onStop:l}=this.options;l&&l(),this.cancel();}complete(){let{resolved:e}=this;e&&e.animation.finish();}cancel(){let{resolved:e}=this;e&&e.animation.cancel();}static supports(e){let{motionValue:o,name:r,repeatDelay:i,repeatType:s,damping:n,type:a}=e;if(!o||!o.owner||!(o.owner.current instanceof HTMLElement))return false;let{onUpdate:l,transformTemplate:u}=o.owner.getProps();return Fn()&&r&&Ln.has(r)&&!l&&!u&&!i&&s!=="mirror"&&n!==0&&a!=="inertia"}};var cu={type:"spring",stiffness:500,damping:25,restSpeed:10},fu=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),pu={type:"keyframes",duration:.8},hu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},On=(t,{keyframes:e})=>e.length>2?pu:$.has(t)?t.startsWith("scale")?fu(e[1]):cu:hu;function kn({when:t,delay:e,delayChildren:o,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:n,repeatDelay:a,from:l,elapsed:u,...m}){return !!Object.keys(m).length}var he=(t,e,o,r={},i,s)=>n=>{let a=ee(r,t)||{},l=a.delay||r.delay||0,{elapsed:u=0}=r;u=u-j(l);let m={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f);},onComplete:()=>{n(),a.onComplete&&a.onComplete();},name:t,motionValue:e,element:s?void 0:i};kn(a)||(m={...m,...On(t,m)}),m.duration&&(m.duration=j(m.duration)),m.repeatDelay&&(m.repeatDelay=j(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let c=false;if((m.type===false||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(c=true)),c&&!s&&e.get()!==void 0){let f=At(m.keyframes,a);if(f!==void 0)return S.update(()=>{m.onUpdate(f),m.onComplete();}),new lo([])}return !s&&Oe.supports(m)?new Oe(m):new Bt(m)};function du({protectedKeys:t,needsAnimating:e},o){let r=t.hasOwnProperty(o)&&e[o]!==true;return e[o]=false,r}function Bo(t,e,{delay:o=0,transitionOverride:r,type:i}={}){var s;let{transition:n=t.getDefaultTransition(),transitionEnd:a,...l}=e;r&&(n=r);let u=[],m=i&&t.animationState&&t.animationState.getState()[i];for(let c in l){let f=t.getValue(c,(s=t.latestValues[c])!==null&&s!==void 0?s:null),p=l[c];if(p===void 0||m&&du(m,c))continue;let h={delay:o,...ee(n||{},c)},d=false;if(window.MotionHandoffAnimation){let g=so(t);if(g){let v=window.MotionHandoffAnimation(g,c,S);v!==null&&(h.startTime=v,d=true);}}Ee(t,c),f.start(he(c,f,p,t.shouldReduceMotion&&ro.has(c)?{type:false}:h,t,d));let y=f.animation;y&&u.push(y);}return a&&Promise.all(u).then(()=>{S.update(()=>{a&&zi(t,a);});}),u}function Fo(t,e,o={}){var r;let i=ct(t,e,o.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0),{transition:s=t.getDefaultTransition()||{}}=i||{};o.transitionOverride&&(s=o.transitionOverride);let n=i?()=>Promise.all(Bo(t,i,o)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{let{delayChildren:m=0,staggerChildren:c,staggerDirection:f}=s;return gu(t,e,m+u,c,f,o)}:()=>Promise.resolve(),{when:l}=s;if(l){let[u,m]=l==="beforeChildren"?[n,a]:[a,n];return u().then(()=>m())}else return Promise.all([n(),a(o.delay)])}function gu(t,e,o=0,r=0,i=1,s){let n=[],a=(t.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(t.variantChildren).sort(yu).forEach((u,m)=>{u.notify("AnimationStart",e),n.push(Fo(u,e,{...s,delay:o+l(m)}).then(()=>u.notify("AnimationComplete",e)));}),Promise.all(n)}function yu(t,e){return t.sortNodePosition(e)}function jn(t,e,o={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){let i=e.map(s=>Fo(t,s,o));r=Promise.all(i);}else if(typeof e=="string")r=Fo(t,e,o);else {let i=typeof e=="function"?ct(t,e,o.custom):e;r=Promise.all(Bo(t,i,o));}return r.then(()=>{t.notify("AnimationComplete",e);})}function Br(t,e){if(!Array.isArray(e))return false;let o=e.length;if(o!==t.length)return false;for(let r=0;r<o;r++)if(e[r]!==t[r])return false;return true}var xu=Ae.length;function Fr(t){if(!t)return;if(!t.isControllingVariants){let o=t.parent?Fr(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}let e={};for(let o=0;o<xu;o++){let r=Ae[o],i=t.props[r];(lt(i)||i===false)&&(e[r]=i);}return e}var vu=[...$e].reverse(),Tu=$e.length;function Pu(t){return e=>Promise.all(e.map(({animation:o,options:r})=>jn(t,o,r)))}function Un(t){let e=Pu(t),o=Nn(),r=true,i=l=>(u,m)=>{var c;let f=ct(t,m,l==="exit"?(c=t.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:p,transitionEnd:h,...d}=f;u={...u,...d,...h};}return u};function s(l){e=l(t);}function n(l){let{props:u}=t,m=Fr(t.parent)||{},c=[],f=new Set,p={},h=1/0;for(let y=0;y<Tu;y++){let g=vu[y],v=o[g],T=u[g]!==void 0?u[g]:m[g],A=lt(T),P=g===l?v.isActive:null;P===false&&(h=y);let C=T===m[g]&&T!==u[g]&&A;if(C&&r&&t.manuallyAnimateOnMount&&(C=false),v.protectedKeys={...p},!v.isActive&&P===null||!T&&!v.prevProp||vt(T)||typeof T=="boolean")continue;let I=Su(v.prevProp,T),V=I||g===l&&v.isActive&&!C&&A||y>h&&A,_=false,X=Array.isArray(T)?T:[T],Nt=X.reduce(i(g),{});P===false&&(Nt={});let{prevResolvedValues:oi={}}=v,ba={...oi,...Nt},ri=N=>{V=true,f.has(N)&&(_=true,f.delete(N)),v.needsAnimating[N]=true;let st=t.getValue(N);st&&(st.liveStyle=false);};for(let N in ba){let st=Nt[N],sr=oi[N];if(p.hasOwnProperty(N))continue;let ar=false;De(st)&&De(sr)?ar=!Br(st,sr):ar=st!==sr,ar?st!=null?ri(N):f.add(N):st!==void 0&&f.has(N)?ri(N):v.protectedKeys[N]=true;}v.prevProp=T,v.prevResolvedValues=Nt,v.isActive&&(p={...p,...Nt}),r&&t.blockInitialAnimation&&(V=false),V&&(!(C&&I)||_)&&c.push(...X.map(N=>({animation:N,options:{type:g}})));}if(f.size){let y={};if(typeof u.initial!="boolean"){let g=ct(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(y.transition=g.transition);}f.forEach(g=>{let v=t.getBaseTarget(g),T=t.getValue(g);T&&(T.liveStyle=true),y[g]=v??null;}),c.push({animation:y});}let d=!!c.length;return r&&(u.initial===false||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(d=false),r=false,d?e(c):Promise.resolve()}function a(l,u){var m;if(o[l].isActive===u)return Promise.resolve();(m=t.variantChildren)===null||m===void 0||m.forEach(f=>{var p;return (p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),o[l].isActive=u;let c=n(l);for(let f in o)o[f].protectedKeys={};return c}return {animateChanges:n,setActive:a,setAnimateFunction:s,getState:()=>o,reset:()=>{o=Nn(),r=true;}}}function Su(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Br(e,t):false}function Ft(t=false){return {isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Nn(){return {animate:Ft(true),whileInView:Ft(),whileHover:Ft(),whileTap:Ft(),whileDrag:Ft(),whileFocus:Ft(),exit:Ft()}}var F=class{constructor(e){this.isMounted=false,this.node=e;}update(){}};var Io=class extends F{constructor(e){super(e),e.animationState||(e.animationState=Un(e));}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();vt(e)&&(this.unmountControls=e.subscribe(this.node));}mount(){this.updateAnimationControlsSubscription();}update(){let{animate:e}=this.node.getProps(),{animate:o}=this.node.prevProps||{};e!==o&&this.updateAnimationControlsSubscription();}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this);}};var Vu=0,Oo=class extends F{constructor(){super(...arguments),this.id=Vu++;}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:o}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let i=this.node.animationState.setActive("exit",!e);o&&!e&&i.then(()=>{o(this.id);});}mount(){let{register:e,onExitComplete:o}=this.node.presenceContext||{};o&&o(this.id),e&&(this.unmount=e(this.id));}unmount(){}};var Kn={animation:{Feature:Io},exit:{Feature:Oo}};var Z={x:false,y:false};function ko(){return Z.x||Z.y}function _n(t){return t==="x"||t==="y"?Z[t]?null:(Z[t]=true,()=>{Z[t]=false;}):Z.x||Z.y?null:(Z.x=Z.y=true,()=>{Z.x=Z.y=false;})}function pt(t,e,o,r={passive:true}){return t.addEventListener(e,o,r),()=>t.removeEventListener(e,o)}var de=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==false;function ht(t){return {point:{x:t.pageX,y:t.pageY}}}var Gn=t=>e=>de(e)&&t(e,ht(e));function dt(t,e,o,r){return pt(t,e,Gn(o),r)}function jo({top:t,left:e,right:o,bottom:r}){return {x:{min:e,max:o},y:{min:t,max:r}}}function $n({x:t,y:e}){return {top:e.min,right:t.max,bottom:e.max,left:t.min}}function Wn(t,e){if(!e)return t;let o=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return {top:o.y,left:o.x,bottom:r.y,right:r.x}}var qn=1e-4,bu=1-qn,Au=1+qn,Xn=.01,Cu=0-Xn,Mu=0+Xn;function B(t){return t.max-t.min}function Zn(t,e,o){return Math.abs(t-e)<=o}function zn(t,e,o,r=.5){t.origin=r,t.originPoint=b(e.min,e.max,t.origin),t.scale=B(o)/B(e),t.translate=b(o.min,o.max,t.origin)-t.originPoint,(t.scale>=bu&&t.scale<=Au||isNaN(t.scale))&&(t.scale=1),(t.translate>=Cu&&t.translate<=Mu||isNaN(t.translate))&&(t.translate=0);}function ge(t,e,o,r){zn(t.x,e.x,o.x,r?r.originX:void 0),zn(t.y,e.y,o.y,r?r.originY:void 0);}function Hn(t,e,o){t.min=o.min+e.min,t.max=t.min+B(e);}function Jn(t,e,o){Hn(t.x,e.x,o.x),Hn(t.y,e.y,o.y);}function Yn(t,e,o){t.min=e.min-o.min,t.max=t.min+B(e);}function ye(t,e,o){Yn(t.x,e.x,o.x),Yn(t.y,e.y,o.y);}var Qn=()=>({translate:0,scale:1,origin:0,originPoint:0}),It=()=>({x:Qn(),y:Qn()}),ts=()=>({min:0,max:0}),D=()=>({x:ts(),y:ts()});function z(t){return [t("x"),t("y")]}function Ir(t){return t===void 0||t===1}function No({scale:t,scaleX:e,scaleY:o}){return !Ir(t)||!Ir(e)||!Ir(o)}function gt(t){return No(t)||Or(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Or(t){return es(t.x)||es(t.y)}function es(t){return t&&t!=="0%"}function ke(t,e,o){let r=t-o,i=e*r;return o+i}function os(t,e,o,r,i){return i!==void 0&&(t=ke(t,i,r)),ke(t,o,r)+e}function kr(t,e=0,o=1,r,i){t.min=os(t.min,e,o,r,i),t.max=os(t.max,e,o,r,i);}function jr(t,{x:e,y:o}){kr(t.x,e.translate,e.scale,e.originPoint),kr(t.y,o.translate,o.scale,o.originPoint);}var rs=.999999999999,is=1.0000000000001;function ss(t,e,o,r=false){let i=o.length;if(!i)return;e.x=e.y=1;let s,n;for(let a=0;a<i;a++){s=o[a],n=s.projectionDelta;let{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ot(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),n&&(e.x*=n.x.scale,e.y*=n.y.scale,jr(t,n)),r&&gt(s.latestValues)&&Ot(t,s.latestValues));}e.x<is&&e.x>rs&&(e.x=1),e.y<is&&e.y>rs&&(e.y=1);}function Ct(t,e){t.min=t.min+e,t.max=t.max+e;}function ns(t,e,o,r,i=.5){let s=b(t.min,t.max,i);kr(t,e,o,s,r);}function Ot(t,e){ns(t.x,e.x,e.scaleX,e.scale,e.originX),ns(t.y,e.y,e.scaleY,e.scale,e.originY);}function Nr(t,e){return jo(Wn(t.getBoundingClientRect(),e))}function as(t,e,o){let r=Nr(t,o),{scroll:i}=e;return i&&(Ct(r.x,i.offset.x),Ct(r.y,i.offset.y)),r}function xe(t,e){let o=`${e}PointerCapture`;if(t.target instanceof Element&&o in t.target&&t.pointerId!==void 0)try{t.target[o](t.pointerId);}catch{}}var ls=(t,e)=>Math.abs(t-e);function us(t,e){let o=ls(t.x,e.x),r=ls(t.y,e.y);return Math.sqrt(o**2+r**2)}var ve=class{constructor(e,o,{transformPagePoint:r,dragSnapToOrigin:i=false}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let m=Kr(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=us(m.offset,{x:0,y:0})>=3;if(!c&&!f)return;let{point:p}=m,{timestamp:h}=R;this.history.push({...p,timestamp:h});let{onStart:d,onMove:y}=this.handlers;c||(d&&d(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,m);},this.handlePointerMove=(m,c)=>{if(m.target instanceof Element&&m.target.hasPointerCapture&&m.pointerId!==void 0)try{if(!m.target.hasPointerCapture(m.pointerId))return}catch{}this.lastMoveEvent=m,this.lastMoveEventInfo=Ur(c,this.transformPagePoint),S.update(this.updatePoint,true);},this.handlePointerUp=(m,c)=>{xe(m,"release"),this.end();let{onEnd:f,onSessionEnd:p,resumeAnimation:h}=this.handlers;if(this.dragSnapToOrigin&&h&&h(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let d=Kr(m.type==="pointercancel"||m.type==="lostpointercapture"?this.lastMoveEventInfo:Ur(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(m,d),p&&p(m,d);},!de(e))return;this.dragSnapToOrigin=i,this.handlers=o,this.transformPagePoint=r;let s=ht(e),n=Ur(s,this.transformPagePoint),{point:a}=n,{timestamp:l}=R;this.history=[{...a,timestamp:l}];let{onSessionStart:u}=o;u&&u(e,Kr(n,this.history)),xe(e,"set"),this.removeListeners=nt(dt(e.currentTarget,"pointermove",this.handlePointerMove),dt(e.currentTarget,"pointerup",this.handlePointerUp),dt(e.currentTarget,"pointercancel",this.handlePointerUp),dt(e.currentTarget,"lostpointercapture",this.handlePointerUp));}updateHandlers(e){this.handlers=e;}end(){this.removeListeners&&this.removeListeners(),Y(this.updatePoint);}};function Ur(t,e){return e?{point:e(t.point)}:t}function ms(t,e){return {x:t.x-e.x,y:t.y-e.y}}function Kr({point:t},e){return {point:t,delta:ms(t,cs(e)),offset:ms(t,wu(e)),velocity:Du(e,.1)}}function wu(t){return t[0]}function cs(t){return t[t.length-1]}function Du(t,e){if(t.length<2)return {x:0,y:0};let o=t.length-1,r=null,i=cs(t);for(;o>=0&&(r=t[o],!(i.timestamp-r.timestamp>j(e)));)o--;if(!r)return {x:0,y:0};let s=W(i.timestamp-r.timestamp);if(s===0)return {x:0,y:0};let n={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function gs(t,{min:e,max:o},r){return e!==void 0&&t<e?t=r?b(e,t,r.min):Math.max(t,e):o!==void 0&&t>o&&(t=r?b(o,t,r.max):Math.min(t,o)),t}function fs(t,e,o){return {min:e!==void 0?t.min+e:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function ys(t,{top:e,left:o,bottom:r,right:i}){return {x:fs(t.x,o,i),y:fs(t.y,e,r)}}function ps(t,e){let o=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([o,r]=[r,o]),{min:o,max:r}}function xs(t,e){return {x:ps(t.x,e.x),y:ps(t.y,e.y)}}function vs(t,e){let o=.5,r=B(t),i=B(e);return i>r?o=Q(e.min,e.max-r,t.min):r>i&&(o=Q(t.min,t.max-i,e.min)),O(0,1,o)}function Ts(t,e){let o={};return e.min!==void 0&&(o.min=e.min-t.min),e.max!==void 0&&(o.max=e.max-t.min),o}var Uo=.35;function Ps(t=Uo){return t===false?t=0:t===true&&(t=Uo),{x:hs(t,"left","right"),y:hs(t,"top","bottom")}}function hs(t,e,o){return {min:ds(t,e),max:ds(t,o)}}function ds(t,e){return typeof t=="number"?t:t[e]||0}var Eu=new WeakMap,_o=class{constructor(e){this.openDragLock=null,this.isDragging=false,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=false,this.hasMutatedConstraints=false,this.elastic=D(),this.visualElement=e;}start(e,{snapToCursor:o=false}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===false)return;let i=m=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(ht(m).point);},s=(m,c)=>{let{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_n(f),!this.openDragLock))return;this.isDragging=true,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=true,this.visualElement.projection.target=void 0),z(y=>{let g=this.getAxisMotionValue(y).get()||0;if(U.test(g)){let{projection:v}=this.visualElement;if(v&&v.layout){let T=v.layout.layoutBox[y];T&&(g=B(T)*(parseFloat(g)/100));}}this.originPoint[y]=g;}),h&&S.postRender(()=>h(m,c)),Ee(this.visualElement,"transform");let{animationState:d}=this.visualElement;d&&d.setActive("whileDrag",true);},n=(m,c)=>{let{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:d}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:y}=c;if(p&&this.currentDirection===null){this.currentDirection=Ru(y),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",c.point,y),this.updateAxis("y",c.point,y),this.visualElement.render(),d&&d(m,c);},a=(m,c)=>this.stop(m,c),l=()=>z(m=>{var c;return this.getAnimationState(m)==="paused"&&((c=this.getAxisMotionValue(m).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ve(e,{onSessionStart:i,onStart:s,onMove:n,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u});}stop(e,o){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:i}=o;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&S.postRender(()=>s(e,o));}cancel(){this.isDragging=false;let{projection:e,animationState:o}=this.visualElement;e&&(e.isAnimationBlocked=false),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),o&&o.setActive("whileDrag",false);}updateAxis(e,o,r){let{drag:i}=this.getProps();if(!r||!Ko(e,i,this.currentDirection))return;let s=this.getAxisMotionValue(e),n=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(n=gs(n,this.constraints[e],this.elastic[e])),s.set(n);}resolveConstraints(){var e;let{dragConstraints:o,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(false):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;o&&ut(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&i?this.constraints=ys(i.layoutBox,o):this.constraints=false,this.elastic=Ps(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&z(n=>{this.constraints!==false&&this.getAxisMotionValue(n)&&(this.constraints[n]=Ts(i.layoutBox[n],this.constraints[n]));});}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:o}=this.getProps();if(!e||!ut(e))return false;let r=e.current;G(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return false;let s=as(r,i.root,this.visualElement.getTransformPagePoint()),n=xs(i.layout.layoutBox,s);if(o){let a=o($n(n));this.hasMutatedConstraints=!!a,a&&(n=jo(a));}return n}startAnimation(e){let{drag:o,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=z(m=>{if(!Ko(m,o,this.currentDirection))return;let c=l&&l[m]||{};n&&(c={min:0,max:0});let f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:r?e[m]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...c};return this.startAxisValueAnimation(m,h)});return Promise.all(u).then(a)}startAxisValueAnimation(e,o){let r=this.getAxisMotionValue(e);return Ee(this.visualElement,e),r.start(he(e,r,0,o,this.visualElement,false))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop());}pauseAnimation(){z(e=>{var o;return (o=this.getAxisMotionValue(e).animation)===null||o===void 0?void 0:o.pause()});}getAnimationState(e){var o;return (o=this.getAxisMotionValue(e).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(e){let o=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[o];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){z(o=>{let{drag:r}=this.getProps();if(!Ko(o,r,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(o);if(i&&i.layout){let{min:n,max:a}=i.layout.layoutBox[o];s.set(e[o]-b(n,a,.5));}});}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:o}=this.getProps(),{projection:r}=this.visualElement;if(!ut(o)||!r||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};z(n=>{let a=this.getAxisMotionValue(n);if(a&&this.constraints!==false){let l=a.get();i[n]=vs({min:l,max:l},this.constraints[n]);}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),z(n=>{if(!Ko(n,e,null))return;let a=this.getAxisMotionValue(n),{min:l,max:u}=this.constraints[n];a.set(b(l,u,i[n]));});}addListeners(){if(!this.visualElement.current)return;Eu.set(this.visualElement,this);let e=this.visualElement.current,o=dt(e,"pointerdown",l=>{let{drag:u,dragListener:m=true}=this.getProps();u&&m&&this.start(l);}),r=()=>{let{dragConstraints:l}=this.getProps();ut(l)&&l.current&&(this.constraints=this.resolveRefConstraints());},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),S.read(r);let n=pt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(z(m=>{let c=this.getAxisMotionValue(m);c&&(this.originPoint[m]+=l[m].translate,c.set(c.get()+l[m].translate));}),this.visualElement.render());});return ()=>{n(),o(),s(),a&&a();}}getProps(){let e=this.visualElement.getProps(),{drag:o=false,dragDirectionLock:r=false,dragPropagation:i=false,dragConstraints:s=false,dragElastic:n=Uo,dragMomentum:a=true}=e;return {...e,drag:o,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:n,dragMomentum:a}}};function Ko(t,e,o){return (e===true||e===t)&&(o===null||o===t)}function Ru(t,e=10){let o=null;return Math.abs(t.y)>e?o="y":Math.abs(t.x)>e&&(o="x"),o}var Go=class extends F{constructor(e){super(e),this.removeGroupControls=E,this.removeListeners=E,this.controls=new _o(e);}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||E;}unmount(){this.removeGroupControls(),this.removeListeners();}};var Ss=t=>(e,o)=>{t&&S.postRender(()=>t(e,o));},$o=class extends F{constructor(){super(...arguments),this.removePointerDownListener=E;}onPointerDown(e){this.session=new ve(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()});}createPanHandlers(){let{onPanSessionStart:e,onPanStart:o,onPan:r,onPanEnd:i}=this.node.getProps();return {onSessionStart:Ss(e),onStart:Ss(o),onMove:r,onEnd:(s,n)=>{delete this.session,i&&S.postRender(()=>i(s,n));}}}mount(){this.removePointerDownListener=dt(this.node.current,"pointerdown",e=>this.onPointerDown(e));}update(){this.session&&this.session.updateHandlers(this.createPanHandlers());}unmount(){this.removePointerDownListener(),this.session&&this.session.end();}};var Te={hasAnimatedSinceResize:true,hasEverUpdated:false};function Vs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}var Pe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;let o=Vs(t,e.target.x),r=Vs(t,e.target.y);return `${o}% ${r}%`}};var bs={correct:(t,{treeScale:e,projectionDelta:o})=>{let r=t,i=K.parse(t);if(i.length>5)return r;let s=K.createTransformer(t),n=typeof i[0]!="number"?1:0,a=o.x.scale*e.x,l=o.y.scale*e.y;i[0+n]/=a,i[1+n]/=l;let u=b(a,l,.5);return typeof i[2+n]=="number"&&(i[2+n]/=u),typeof i[3+n]=="number"&&(i[3+n]/=u),s(i)}};var _r=class extends Component{componentDidMount(){let{visualElement:e,layoutGroup:o,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;Vi(Fu),s&&(o.group&&o.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove();}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Te.hasEverUpdated=true;}getSnapshotBeforeUpdate(e){let{layoutDependency:o,visualElement:r,drag:i,isPresent:s}=this.props,n=r.projection;return n&&(n.isPresent=s,i||e.layoutDependency!==o||o===void 0?n.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?n.promote():n.relegate()||S.postRender(()=>{let a=n.getStack();(!a||!a.members.length)&&this.safeToRemove();}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Gt.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove();}));}componentWillUnmount(){let{visualElement:e,layoutGroup:o,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(i),r&&r.deregister&&r.deregister(i));}safeToRemove(){let{safeToRemove:e}=this.props;e&&e();}render(){return null}};function Wo(t){let[e,o]=ni(),r=useContext(Ne);return jsx(_r,{...t,layoutGroup:r,switchLayoutGroup:useContext(He),isPresent:e,safeToRemove:o})}var Fu={borderRadius:{...Pe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomLeftRadius:Pe,borderBottomRightRadius:Pe,boxShadow:bs};function Cs(t,e,o){let r=M(t)?t:ft(t);return r.start(he("",r,e,o)),r.animation}function Ms(t){return t instanceof SVGElement&&t.tagName!=="svg"}var ws=(t,e)=>t.depth-e.depth;var zo=class{constructor(){this.children=[],this.isDirty=false;}add(e){oe(this.children,e),this.isDirty=true;}remove(e){re(this.children,e),this.isDirty=true;}forEach(e){this.isDirty&&this.children.sort(ws),this.isDirty=false,this.children.forEach(e);}};function Ds(t,e){let o=k.now(),r=({timestamp:i})=>{let s=i-o;s>=e&&(Y(r),t(s-e));};return S.read(r,true),()=>Y(r)}var Bs=["TopLeft","TopRight","BottomLeft","BottomRight"],Iu=Bs.length,Es=t=>typeof t=="string"?parseFloat(t):t,Rs=t=>typeof t=="number"||x.test(t);function Fs(t,e,o,r,i,s){i?(t.opacity=b(0,o.opacity!==void 0?o.opacity:1,Ou(r)),t.opacityExit=b(e.opacity!==void 0?e.opacity:1,0,ku(r))):s&&(t.opacity=b(e.opacity!==void 0?e.opacity:1,o.opacity!==void 0?o.opacity:1,r));for(let n=0;n<Iu;n++){let a=`border${Bs[n]}Radius`,l=Ls(e,a),u=Ls(o,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Rs(l)===Rs(u)?(t[a]=Math.max(b(Es(l),Es(u),r),0),(U.test(u)||U.test(l))&&(t[a]+="%")):t[a]=u;}(e.rotate||o.rotate)&&(t.rotate=b(e.rotate||0,o.rotate||0,r));}function Ls(t,e){return t[e]!==void 0?t[e]:t.borderRadius}var Ou=Is(0,.5,yo),ku=Is(.5,.95,E);function Is(t,e,o){return r=>r<t?0:r>e?1:o(Q(t,e,r))}function Os(t,e){t.min=e.min,t.max=e.max;}function q(t,e){Os(t.x,e.x),Os(t.y,e.y);}function Gr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin;}function ks(t,e,o,r,i){return t-=e,t=ke(t,1/o,r),i!==void 0&&(t=ke(t,1/i,r)),t}function ju(t,e=0,o=1,r=.5,i,s=t,n=t){if(U.test(e)&&(e=parseFloat(e),e=b(n.min,n.max,e/100)-n.min),typeof e!="number")return;let a=b(s.min,s.max,r);t===s&&(a-=e),t.min=ks(t.min,e,o,a,i),t.max=ks(t.max,e,o,a,i);}function js(t,e,[o,r,i],s,n){ju(t,e[o],e[r],e[i],e.scale,s,n);}var Nu=["x","scaleX","originX"],Uu=["y","scaleY","originY"];function $r(t,e,o,r){js(t.x,e,Nu,o?o.x:void 0,r?r.x:void 0),js(t.y,e,Uu,o?o.y:void 0,r?r.y:void 0);}function Ns(t){return t.translate===0&&t.scale===1}function Wr(t){return Ns(t.x)&&Ns(t.y)}function Us(t,e){return t.min===e.min&&t.max===e.max}function _s(t,e){return Us(t.x,e.x)&&Us(t.y,e.y)}function Ks(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function zr(t,e){return Ks(t.x,e.x)&&Ks(t.y,e.y)}function Hr(t){return B(t.x)/B(t.y)}function Yr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}var Ho=class{constructor(){this.members=[];}add(e){oe(this.members,e),e.scheduleRender();}remove(e){if(re(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let o=this.members[this.members.length-1];o&&this.promote(o);}}relegate(e){let o=this.members.findIndex(i=>e===i);if(o===0)return false;let r;for(let i=o;i>=0;i--){let s=this.members[i];if(s.isPresent!==false){r=s;break}}return r?(this.promote(r),true):false}promote(e,o){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,o&&(e.resumeFrom.preserveOpacity=true),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=true);let{crossfade:i}=e.options;i===false&&r.hide();}}exitAnimationComplete(){this.members.forEach(e=>{let{options:o,resumingFrom:r}=e;o.onExitComplete&&o.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete();});}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(false);});}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0);}};function Gs(t,e,o){let r="",i=t.x.translate/e.x,s=t.y.translate/e.y,n=o?.z||0;if((i||s||n)&&(r=`translate3d(${i}px, ${s}px, ${n}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),o){let{transformPerspective:u,rotate:m,rotateX:c,rotateY:f,skewX:p,skewY:h}=o;u&&(r=`perspective(${u}px) ${r}`),m&&(r+=`rotate(${m}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),h&&(r+=`skewY(${h}deg) `);}let a=t.x.scale*e.x,l=t.y.scale*e.y;return (a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}var qr=["","X","Y","Z"],Ku={visibility:"hidden"},$s=1e3,_u=0;function Xr(t,e,o,r){let{latestValues:i}=e;i[t]&&(o[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0));}function Js(t){if(t.hasCheckedOptimisedAppear=true,t.root===t)return;let{visualElement:e}=t.options;if(!e)return;let o=so(e);if(window.MotionHasOptimisedAnimation(o,"transform")){let{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(o,"transform",S,!(i||s));}let{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Js(r);}function Yo({attachResizeListener:t,defaultParent:e,measureScroll:o,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(n={},a=e?.()){this.id=_u++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=false,this.isAnimationBlocked=false,this.isLayoutDirty=false,this.isProjectionDirty=false,this.isSharedProjectionDirty=false,this.isTransformDirty=false,this.updateManuallyBlocked=false,this.updateBlockedByResize=false,this.isUpdating=false,this.isSVG=false,this.needsReset=false,this.shouldResetTransform=false,this.hasCheckedOptimisedAppear=false,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=false,this.updateScheduled=false,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=false,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=false,this.clearAllSnapshots());},this.updateProjection=()=>{this.projectionUpdateScheduled=false,this.nodes.forEach(Wu),this.nodes.forEach(Xu),this.nodes.forEach(Zu),this.nodes.forEach(zu);},this.resolvedRelativeTargetAt=0,this.hasProjected=false,this.isVisible=true,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=true;this.root===this&&(this.nodes=new zo);}addEventListener(n,a){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Tt),this.eventHandlers.get(n).add(a)}notifyListeners(n,...a){let l=this.eventHandlers.get(n);l&&l.notify(...a);}hasListeners(n){return this.eventHandlers.has(n)}mount(n,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ms(n),this.instance=n;let{layoutId:l,layout:u,visualElement:m}=this.options;if(m&&!m.current&&m.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=true),t){let c,f=()=>this.root.updateBlockedByResize=false;t(n,()=>{this.root.updateBlockedByResize=true,c&&c(),c=Ds(f,250),Te.hasAnimatedSinceResize&&(Te.hasAnimatedSinceResize=false,this.nodes.forEach(zs));});}l&&this.root.registerSharedNode(l,this),this.options.animate!==false&&m&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let d=this.options.transition||m.getDefaultTransition()||om,{onLayoutAnimationStart:y,onLayoutAnimationComplete:g}=m.getProps(),v=!this.targetLayout||!zr(this.targetLayout,h),T=!f&&p;if(this.options.layoutRoot||this.resumeFrom||T||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,T);let A={...ee(d,"layout"),onPlay:y,onComplete:g};(m.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=false),this.startAnimation(A);}else f||zs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h;});}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Y(this.updateProjection);}blockUpdate(){this.updateManuallyBlocked=true;}unblockUpdate(){this.updateManuallyBlocked=false;}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||false}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=true,this.nodes&&this.nodes.forEach(Ju),this.animationId++);}getTransformTemplate(){let{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=true){if(this.root.hasTreeAnimated=true,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Js(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=true;for(let m=0;m<this.path.length;m++){let c=this.path[m];c.shouldResetTransform=true,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(false);}let{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate");}update(){if(this.updateScheduled=false,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ws);return}this.isUpdating||this.nodes.forEach(Yu),this.isUpdating=false,this.nodes.forEach(qu),this.nodes.forEach(Gu),this.nodes.forEach($u),this.clearAllSnapshots();let a=k.now();R.delta=O(0,1e3/60,a-R.timestamp),R.timestamp=a,R.isProcessing=true,_e.update.process(R),_e.preRender.process(R),_e.render.process(R),R.isProcessing=false;}didUpdate(){this.updateScheduled||(this.updateScheduled=true,Gt.read(this.scheduleUpdate));}clearAllSnapshots(){this.nodes.forEach(Hu),this.sharedNodes.forEach(Qu);}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=true,S.preRender(this.updateProjection,false,true));}scheduleCheckAfterUnmount(){S.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed();});}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!B(this.snapshot.measuredBox.x)&&!B(this.snapshot.measuredBox.y)&&(this.snapshot=void 0));}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let n=this.layout;this.layout=this.measure(false),this.layoutCorrected=D(),this.isLayoutDirty=false,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0);}updateScroll(n="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(a=false),a){let l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:l,offset:o(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l};}}resetTransform(){if(!i)return;let n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Wr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,m=u!==this.prevTransformTemplateValue;n&&(a||gt(this.latestValues)||m)&&(i(this.instance,u),this.shouldResetTransform=false,this.scheduleRender());}measure(n=true){let a=this.measurePageBox(),l=this.removeElementScroll(a);return n&&(l=this.removeTransform(l)),rm(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var n;let{visualElement:a}=this.options;if(!a)return D();let l=a.measureViewportBox();if(!(((n=this.scroll)===null||n===void 0?void 0:n.wasRoot)||this.path.some(im))){let{scroll:m}=this.root;m&&(Ct(l.x,m.offset.x),Ct(l.y,m.offset.y));}return l}removeElementScroll(n){var a;let l=D();if(q(l,n),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){let m=this.path[u],{scroll:c,options:f}=m;m!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&q(l,n),Ct(l.x,c.offset.x),Ct(l.y,c.offset.y));}return l}applyTransform(n,a=false){let l=D();q(l,n);for(let u=0;u<this.path.length;u++){let m=this.path[u];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&Ot(l,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),gt(m.latestValues)&&Ot(l,m.latestValues);}return gt(this.latestValues)&&Ot(l,this.latestValues),l}removeTransform(n){let a=D();q(a,n);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!gt(u.latestValues))continue;No(u.latestValues)&&u.updateSnapshot();let m=D(),c=u.measurePageBox();q(m,c),$r(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,m);}return gt(this.latestValues)&&$r(a,this.latestValues),a}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=true;}setOptions(n){this.options={...this.options,...n,crossfade:n.crossfade!==void 0?n.crossfade:true};}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=false;}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==R.timestamp&&this.relativeParent.resolveTargetDelta(true);}resolveTargetDelta(n=false){var a;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(n||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=R.timestamp,!this.targetDelta&&!this.relativeTarget){let p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),ye(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),q(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=D(),this.targetWithTransforms=D()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Jn(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):q(this.target,this.layout.layoutBox),jr(this.target,this.targetDelta)):q(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=false;let p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),ye(this.relativeTargetOrigin,this.target,p.target),q(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}}}}getClosestProjectingParent(){if(!(!this.parent||No(this.parent.latestValues)||Or(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return !!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var n;let a=this.getLead(),l=!!this.resumingFrom||this!==a,u=true;if((this.isProjectionDirty||!((n=this.parent)===null||n===void 0)&&n.isProjectionDirty)&&(u=false),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=false),this.resolvedRelativeTargetAt===R.timestamp&&(u=false),u)return;let{layout:m,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||c))return;q(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,p=this.treeScale.y;ss(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=D());let{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gr(this.prevProjectionDelta.x,this.projectionDelta.x),Gr(this.prevProjectionDelta.y,this.projectionDelta.y)),ge(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Yr(this.projectionDelta.x,this.prevProjectionDelta.x)||!Yr(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=true,this.scheduleRender(),this.notifyListeners("projectionUpdate",h));}hide(){this.isVisible=false;}show(){this.isVisible=true;}scheduleRender(n=true){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),n){let l=this.getStack();l&&l.scheduleRender();}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0);}createProjectionDeltas(){this.prevProjectionDelta=It(),this.projectionDelta=It(),this.projectionDeltaWithTransform=It();}setAnimationOrigin(n,a=false){let l=this.snapshot,u=l?l.latestValues:{},m={...this.latestValues},c=It();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let f=D(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,d=p!==h,y=this.getStack(),g=!y||y.members.length<=1,v=!!(d&&!g&&this.options.crossfade===true&&!this.path.some(em));this.animationProgress=0;let T;this.mixTargetDelta=A=>{let P=A/1e3;Hs(c.x,n.x,P),Hs(c.y,n.y,P),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ye(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),tm(this.relativeTarget,this.relativeTargetOrigin,f,P),T&&_s(this.relativeTarget,T)&&(this.isProjectionDirty=false),T||(T=D()),q(T,this.relativeTarget)),d&&(this.animationValues=m,Fs(m,u,this.latestValues,P,v,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P;},this.mixTargetDelta(this.options.layoutRoot?1e3:0);}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=S.update(()=>{Te.hasAnimatedSinceResize=true,this.currentAnimation=Cs(0,$s,{...n,onUpdate:a=>{this.mixTargetDelta(a),n.onUpdate&&n.onUpdate(a);},onStop:()=>{},onComplete:()=>{n.onComplete&&n.onComplete(),this.completeAnimation();}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0;});}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete");}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($s),this.currentAnimation.stop()),this.completeAnimation();}applyTransformsToTarget(){let n=this.getLead(),{targetWithTransforms:a,target:l,layout:u,latestValues:m}=n;if(!(!a||!l||!u)){if(this!==n&&this.layout&&u&&Qs(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||D();let c=B(this.layout.layoutBox.x);l.x.min=n.target.x.min,l.x.max=l.x.min+c;let f=B(this.layout.layoutBox.y);l.y.min=n.target.y.min,l.y.max=l.y.min+f;}q(a,l),Ot(a,m),ge(this.projectionDeltaWithTransform,this.layoutCorrected,a,m);}}registerSharedNode(n,a){this.sharedNodes.has(n)||this.sharedNodes.set(n,new Ho),this.sharedNodes.get(n).add(a);let u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0});}isLead(){let n=this.getStack();return n?n.lead===this:true}getLead(){var n;let{layoutId:a}=this.options;return a?((n=this.getStack())===null||n===void 0?void 0:n.lead)||this:this}getPrevLead(){var n;let{layoutId:a}=this.options;return a?(n=this.getStack())===null||n===void 0?void 0:n.prevLead:void 0}getStack(){let{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:a,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),n&&(this.projectionDelta=void 0,this.needsReset=true),a&&this.setOptions({transition:a});}relegate(){let n=this.getStack();return n?n.relegate(this):false}resetSkewAndRotation(){let{visualElement:n}=this.options;if(!n)return;let a=false,{latestValues:l}=n;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=true),!a)return;let u={};l.z&&Xr("z",n,u,this.animationValues);for(let m=0;m<qr.length;m++)Xr(`rotate${qr[m]}`,n,u,this.animationValues),Xr(`skew${qr[m]}`,n,u,this.animationValues);n.render();for(let m in u)n.setStaticValue(m,u[m]),this.animationValues&&(this.animationValues[m]=u[m]);n.scheduleRender();}getProjectionStyles(n){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ku;let u={visibility:""},m=this.getTransformTemplate();if(this.needsReset)return this.needsReset=false,u.opacity="",u.pointerEvents=Qt(n?.pointerEvents)||"",u.transform=m?m(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let d={};return this.options.layoutId&&(d.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,d.pointerEvents=Qt(n?.pointerEvents)||""),this.hasProjected&&!gt(this.latestValues)&&(d.transform=m?m({},""):"none",this.hasProjected=false),d}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=Gs(this.projectionDeltaWithTransform,this.treeScale,f),m&&(u.transform=m(f,u.transform));let{x:p,y:h}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${h.origin*100}% 0`,c.animationValues?u.opacity=c===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let d in Dt){if(f[d]===void 0)continue;let{correct:y,applyTo:g,isCSSVariable:v}=Dt[d],T=u.transform==="none"?f[d]:y(f[d],c);if(g){let A=g.length;for(let P=0;P<A;P++)u[g[P]]=T;}else v?this.options.visualElement.renderState.vars[d]=T:u[d]=T;}return this.options.layoutId&&(u.pointerEvents=c===this?Qt(n?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0;}resetTree(){this.root.nodes.forEach(n=>{var a;return (a=n.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Ws),this.root.sharedNodes.clear();}}}function Gu(t){t.updateLayout();}function $u(t){var e;let o=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,n=o.source!==t.layout.source;s==="size"?z(c=>{let f=n?o.measuredBox[c]:o.layoutBox[c],p=B(f);f.min=r[c].min,f.max=f.min+p;}):Qs(s,o.layoutBox,r)&&z(c=>{let f=n?o.measuredBox[c]:o.layoutBox[c],p=B(r[c]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=true,t.relativeTarget[c].max=t.relativeTarget[c].min+p);});let a=It();ge(a,r,o.layoutBox);let l=It();n?ge(l,t.applyTransform(i,true),o.measuredBox):ge(l,r,o.layoutBox);let u=!Wr(a),m=false;if(!t.resumeFrom){let c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:p}=c;if(f&&p){let h=D();ye(h,o.layoutBox,f.layoutBox);let d=D();ye(d,r,p.layoutBox),zr(h,d)||(m=true),c.options.layoutRoot&&(t.relativeTarget=d,t.relativeTargetOrigin=h,t.relativeParent=c);}}}t.notifyListeners("didUpdate",{layout:r,snapshot:o,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:m});}else if(t.isLead()){let{onExitComplete:r}=t.options;r&&r();}t.options.transition=void 0;}function Wu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty));}function zu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=false;}function Hu(t){t.clearSnapshot();}function Ws(t){t.clearMeasurements();}function Yu(t){t.isLayoutDirty=false;}function qu(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform();}function zs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=true;}function Xu(t){t.resolveTargetDelta();}function Zu(t){t.calcProjection();}function Ju(t){t.resetSkewAndRotation();}function Qu(t){t.removeLeadSnapshot();}function Hs(t,e,o){t.translate=b(e.translate,0,o),t.scale=b(e.scale,1,o),t.origin=e.origin,t.originPoint=e.originPoint;}function Ys(t,e,o,r){t.min=b(e.min,o.min,r),t.max=b(e.max,o.max,r);}function tm(t,e,o,r){Ys(t.x,e.x,o.x,r),Ys(t.y,e.y,o.y,r);}function em(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}var om={duration:.45,ease:[.4,0,.1,1]},qs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Xs=qs("applewebkit/")&&!qs("chrome/")?Math.round:E;function Zs(t){t.min=Xs(t.min),t.max=Xs(t.max);}function rm(t){Zs(t.x),Zs(t.y);}function Qs(t,e,o){return t==="position"||t==="preserve-aspect"&&!Zn(Hr(e),Hr(o),.2)}function im(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}var ta=Yo({attachResizeListener:(t,e)=>pt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>true});var Zr={current:void 0},qo=Yo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Zr.current){let t=new ta({});t.mount(window),t.setOptions({layoutScroll:true}),Zr.current=t;}return Zr.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none";},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});var ea={pan:{Feature:$o},drag:{Feature:Go,ProjectionNode:qo,MeasureLayout:Wo}};function oa(t,e,o){var r;if(t instanceof EventTarget)return [t];if(typeof t=="string"){let i=document;let s=(r=o?.[t])!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function Xo(t,e){let o=oa(t),r=new AbortController,i={passive:true,...e,signal:r.signal};return [o,i,()=>r.abort()]}function ra(t){return !(t.pointerType==="touch"||ko())}function ia(t,e,o={}){let[r,i,s]=Xo(t,o),n=a=>{if(!ra(a))return;let{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;let m=c=>{ra(c)&&(u(c),l.removeEventListener("pointerleave",m));};l.addEventListener("pointerleave",m,i);};return r.forEach(a=>{a.addEventListener("pointerenter",n,i);}),s}function na(t,e,o){let{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",o==="Start");let i="onHover"+o,s=r[i];s&&S.postRender(()=>s(e,ht(e)));}var Zo=class extends F{mount(){let{current:e}=this.node;e&&(this.unmount=ia(e,(o,r)=>(na(this.node,r,"Start"),i=>na(this.node,i,"End"))));}unmount(){}};var Jo=class extends F{constructor(){super(...arguments),this.isActive=false;}onFocus(){let e=false;try{e=this.node.current.matches(":focus-visible");}catch{e=true;}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",true),this.isActive=true);}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",false),this.isActive=false);}mount(){this.unmount=nt(pt(this.node.current,"focus",()=>this.onFocus()),pt(this.node.current,"blur",()=>this.onBlur()));}unmount(){}};var Jr=(t,e)=>e?t===e?true:Jr(t,e.parentElement):false;var nm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sa(t){return nm.has(t.tagName)||t.tabIndex!==-1}var jt=new WeakSet;function aa(t){return e=>{e.key==="Enter"&&t(e);}}function Qr(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:true,bubbles:true}));}var la=(t,e)=>{let o=t.currentTarget;if(!o)return;let r=aa(()=>{if(jt.has(o))return;Qr(o,"down");let i=aa(()=>{Qr(o,"up");}),s=()=>Qr(o,"cancel");o.addEventListener("keyup",i,e),o.addEventListener("blur",s,e);});o.addEventListener("keydown",r,e),o.addEventListener("blur",()=>o.removeEventListener("keydown",r),e);};function ua(t){return de(t)&&!ko()}function ma(t,e,o={}){let[r,i,s]=Xo(t,o),n=a=>{let l=a.currentTarget;if(!l||!ua(a)||jt.has(l))return;jt.add(l),xe(a,"set");let u=e(l,a),m=(p,h)=>{l.removeEventListener("pointerup",c),l.removeEventListener("pointercancel",f),xe(p,"release"),!(!ua(p)||!jt.has(l))&&(jt.delete(l),typeof u=="function"&&u(p,{success:h}));},c=p=>{(p.isTrusted?sm(p,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):false)?m(p,false):m(p,!(l instanceof Element)||Jr(l,p.target));},f=p=>{m(p,false);};l.addEventListener("pointerup",c,i),l.addEventListener("pointercancel",f,i),l.addEventListener("lostpointercapture",f,i);};return r.forEach(a=>{a=o.useGlobalTarget?window:a;let l=false;a instanceof HTMLElement&&(l=true,!sa(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",n,i),l&&a.addEventListener("focus",u=>la(u,i),i);}),s}function sm(t,e){return t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom}function ca(t,e,o){let{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",o==="Start");let i="onTap"+(o==="End"?"":o),s=r[i];s&&S.postRender(()=>s(e,ht(e)));}var Qo=class extends F{mount(){let{current:e}=this.node;e&&(this.unmount=ma(e,(o,r)=>(ca(this.node,r,"Start"),(i,{success:s})=>ca(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}));}unmount(){}};var ei=new WeakMap,ti=new WeakMap,am=t=>{let e=ei.get(t.target);e&&e(t);},lm=t=>{t.forEach(am);};function um({root:t,...e}){let o=t||document;ti.has(o)||ti.set(o,{});let r=ti.get(o),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(lm,{root:t,...e})),r[i]}function fa(t,e,o){let r=um(e);return ei.set(t,o),r.observe(t),()=>{ei.delete(t),r.unobserve(t);}}var mm={some:0,all:1},tr=class extends F{constructor(){super(...arguments),this.hasEnteredView=false,this.isInView=false;}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:o,margin:r,amount:i="some",once:s}=e,n={root:o?o.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:mm[i]},a=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=true),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:m,onViewportLeave:c}=this.node.getProps(),f=u?m:c;f&&f(l);};return fa(this.node.current,n,a)}mount(){this.startObserver();}update(){if(typeof IntersectionObserver>"u")return;let{props:e,prevProps:o}=this.node;["amount","margin","root"].some(cm(e,o))&&this.startObserver();}unmount(){}};function cm({viewport:t={}},{viewport:e={}}={}){return o=>t[o]!==e[o]}var pa={inView:{Feature:tr},tap:{Feature:Qo},focus:{Feature:Jo},hover:{Feature:Zo}};var ha={layout:{ProjectionNode:qo,MeasureLayout:Wo}};var je={current:null},er={current:false};function da(){if(er.current=true,!!Kt)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>je.current=t.matches;t.addListener(e),e();}else je.current=false;}var fm=[...br,L,K],ga=t=>fm.find(Vo(t));var ya=new WeakMap;function xa(t,e,o){for(let r in e){let i=e[r],s=o[r];if(M(i))t.addValue(r,i),process.env.NODE_ENV==="development"&&yt(i.version==="12.4.7",`Attempting to mix Motion versions ${i.version} with 12.4.7 may not work as expected.`);else if(M(s))t.addValue(r,ft(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){let n=t.getValue(r);n.liveStyle===true?n.jump(i):n.hasAnimated||n.set(i);}else {let n=t.getStaticValue(r);t.addValue(r,ft(n!==void 0?n:i,{owner:t}));}}for(let r in o)e[r]===void 0&&t.removeValue(r);return e}var va=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],or=class{scrapeMotionValuesFromProps(e,o,r){return {}}constructor({parent:e,props:o,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:n},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let p=k.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,S.render(this.render,false,true));};let{latestValues:l,renderState:u,onUpdate:m}=n;this.onUpdate=m,this.latestValues=l,this.baseTarget={...l},this.initialValues=o.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=o,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=wt(o),this.isVariantNode=We(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(o,{},this);for(let p in f){let h=f[p];l[p]!==void 0&&M(h)&&h.set(l[p],false);}}mount(e){this.current=e,ya.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,r)=>this.bindToMotionValue(r,o)),er.current||da(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:je.current,process.env.NODE_ENV!=="production"&&yt(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let o=this.features[e];o&&(o.unmount(),o.isMounted=false);}this.current=null;}bindToMotionValue(e,o){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let r=$.has(e);r&&this.onBindTransform&&this.onBindTransform();let i=o.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&S.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=true);}),s=o.on("renderRequest",this.scheduleRender),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,o)),this.valueSubscriptions.set(e,()=>{i(),s(),n&&n(),o.owner&&o.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in at){let o=at[e];if(!o)continue;let{isEnabled:r,Feature:i}=o;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){let s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):D()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,o){this.latestValues[e]=o;}update(e,o){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let r=0;r<va.length;r++){let i=va[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,n=e[s];n&&(this.propEventSubscriptions[i]=this.on(i,n));}this.prevMotionValues=xa(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this);}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(e),()=>o.variantChildren.delete(e)}addValue(e,o){let r=this.values.get(e);o!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,o),this.values.set(e,o),this.latestValues[e]=o.get());}removeValue(e){this.values.delete(e);let o=this.valueSubscriptions.get(e);o&&(o(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,o){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&o!==void 0&&(r=ft(o===null?void 0:o,{owner:this}),this.addValue(e,r)),r}readValue(e,o){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(So(i)||vo(i))?i=parseFloat(i):!ga(i)&&K.test(o)&&(i=Po(e,o)),this.setBaseTarget(e,M(i)?i.get():i)),M(i)?i.get():i}setBaseTarget(e,o){this.baseTarget[e]=o;}getBaseTarget(e){var o;let{initial:r}=this.props,i;if(typeof r=="string"||typeof r=="object"){let n=Jt(this.props,r,(o=this.presenceContext)===null||o===void 0?void 0:o.custom);n&&(i=n[e]);}if(r&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!M(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,o){return this.events[e]||(this.events[e]=new Tt),this.events[e].add(o)}notify(e,...o){this.events[e]&&this.events[e].notify(...o);}};var Se=class extends or{constructor(){super(...arguments),this.KeyframeResolver=me;}sortInstanceNodePosition(e,o){return e.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(e,o){return e.style?e.style[o]:void 0}removeValueFromRenderState(e,{vars:o,style:r}){delete o[e],delete r[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;M(e)&&(this.childSubscription=e.on("change",o=>{this.current&&(this.current.textContent=`${o}`);}));}};function pm(t){return window.getComputedStyle(t)}var rr=class extends Se{constructor(){super(...arguments),this.type="html",this.renderInstance=Qe;}readValueFromInstance(e,o){if($.has(o)){let r=ue(o);return r&&r.default||0}else {let r=pm(e),i=($t(o)?r.getPropertyValue(o):r[o])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:o}){return Nr(e,o)}build(e,o,r){Ht(e,o,r.transformTemplate);}scrapeMotionValuesFromProps(e,o,r){return te(e,o,r)}};var ir=class extends Se{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=D,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Je(this.current,this.renderState);};}getBaseTargetFromProps(e,o){return e[o]}readValueFromInstance(e,o){if($.has(o)){let r=ue(o);return r&&r.default||0}return o=to.has(o)?o:_t(o),e.getAttribute(o)}scrapeMotionValuesFromProps(e,o,r){return oo(e,o,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&S.postRender(this.updateDimensions);}build(e,o,r){Xt(e,o,this.isSVGTag,r.transformTemplate);}renderInstance(e,o,r,i){eo(e,o,r,i);}mount(e){this.isSVGTag=Zt(e.tagName),super.mount(e);}};var Ta=(t,e)=>qt(t)?new ir(e):new rr(e,{allowProjection:t!==Fragment});var Pa=Gi({...Kn,...pa,...ea,...ha},Ta);var nr=pi(Pa);function dm({children:t,className:e,letterVariants:o,dadElement:r,scrollOnLastItem:i,key:s}){if(typeof t=="string"){let n=t.split("").map((a,l)=>{let u=useRef(null);return jsx(nr.span,{ref:u,className:e,variants:o,onAnimationComplete:i?()=>{u.current?.offsetParent&&i(u.current.offsetTop);}:void 0,children:a},`span-${s}-${a}-${l}`)});return r(n,true)}else if(Array.isArray(t)){let n=t.map(a=>typeof a=="string"?a.split("").map((u,m)=>{let c=useRef(null);return jsx(nr.span,{ref:c,className:e,variants:o,onAnimationComplete:i?()=>{c.current?.offsetParent&&i(c.current.offsetTop);}:void 0,children:u},`span-${s}-${u}-${m}`)}):a);return r(n)}return r(t,true)}export{dm as default};
1
+ import {createContext,useRef,useContext,forwardRef,useMemo,useInsertionEffect,useLayoutEffect,useEffect,useCallback,Fragment,createElement,useId,Component}from'react';import {jsx,jsxs}from'react/jsx-runtime';var Ca=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ne=createContext({});function ii(t){let e=useRef(null);return e.current===null&&(e.current=t()),e.current}var Kt=createContext(null);var Ue=createContext({transformPagePoint:t=>t,isStatic:false,reducedMotion:"never"});function ni(t=true){let e=useContext(Kt);if(e===null)return [true,null];let{isPresent:o,onExitComplete:r,register:i}=e,s=useId();useEffect(()=>{if(t)return i(s)},[t]);let n=useCallback(()=>t&&r&&r(s),[s,r,t]);return !o&&r?[false,n]:[true]}var _t=typeof window<"u";var si=_t?useLayoutEffect:useEffect;var R=t=>t;var J=R,G=R;process.env.NODE_ENV!=="production"&&(J=(t,e)=>{!t&&typeof console<"u"&&console.warn(e);},G=(t,e)=>{if(!t)throw new Error(e)});var Mt={useManualTiming:false};var Ve=["read","resolveKeyframes","update","preRender","render","postRender"];function ai(t,e){let o=new Set,r=new Set,i=false,s=false,n=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function u(c){n.has(c)&&(m.schedule(c),t()),c(a);}let m={schedule:(c,f=false,p=false)=>{let d=p&&i?o:r;return f&&n.add(c),d.has(c)||d.add(c),c},cancel:c=>{r.delete(c),n.delete(c);},process:c=>{if(a=c,i){s=true;return}i=true,[o,r]=[r,o],o.forEach(u),o.clear(),i=false,s&&(s=false,m.process(c));}};return m}var ka=40;function Ke(t,e){let o=false,r=true,i={delta:0,timestamp:0,isProcessing:false},s=()=>o=true,n=Ve.reduce((g,v)=>(g[v]=ai(s),g),{}),{read:a,resolveKeyframes:l,update:u,preRender:m,render:c,postRender:f}=n,p=()=>{let g=performance.now();o=false,(i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,ka),1)),i.timestamp=g,i.isProcessing=true,a.process(i),l.process(i),u.process(i),m.process(i),c.process(i),f.process(i),i.isProcessing=false,o&&e&&(r=false,t(p));},h=()=>{o=true,r=true,i.isProcessing||t(p);};return {schedule:Ve.reduce((g,v)=>{let T=n[v];return g[v]=(A,P=false,C=false)=>(o||h(),T.schedule(A,P,C)),g},{}),cancel:g=>{for(let v=0;v<Ve.length;v++)n[Ve[v]].cancel(g);},state:i,steps:n}}var{schedule:S,cancel:Y,state:E,steps:_e}=Ke(typeof requestAnimationFrame<"u"?requestAnimationFrame:R,true);var Ge=createContext({strict:false});var li={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},at={};for(let t in li)at[t]={isEnabled:e=>li[t].some(o=>!!e[o])};function ui(t){for(let e in t)at[e]={...at[e],...t[e]};}var Na=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function be(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Na.has(t)}var mi=t=>!be(t);function Ua(t){t&&(mi=e=>e.startsWith("on")?!be(e):t(e));}try{Ua(Ca("@emotion/is-prop-valid").default);}catch{}function ci(t,e,o){let r={};for(let i in t)i==="values"&&typeof t.values=="object"||(mi(i)||o===true&&be(i)||!e&&!be(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}var fi=new Set;function yt(t,e,o){t||fi.has(e)||(console.warn(e),fi.add(e));}function pi(t){if(typeof Proxy>"u")return t;let e=new Map,o=(...r)=>(process.env.NODE_ENV!=="production"&&yt(false,"motion() is deprecated. Use motion.create() instead."),t(...r));return new Proxy(o,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}var xt=createContext({});function vt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function lt(t){return typeof t=="string"||Array.isArray(t)}var $e=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ae=["initial",...$e];function wt(t){return vt(t.animate)||Ae.some(e=>lt(t[e]))}function We(t){return !!(wt(t)||t.variants)}function hi(t,e){if(wt(t)){let{initial:o,animate:r}=t;return {initial:o===false||lt(o)?o:void 0,animate:lt(r)?r:void 0}}return t.inherit!==false?e:{}}function gi(t){let{initial:e,animate:o}=hi(t,useContext(xt));return useMemo(()=>({initial:e,animate:o}),[di(e),di(o)])}function di(t){return Array.isArray(t)?t.join(" "):t}var yi=Symbol.for("motionComponentSymbol");function ut(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function xi(t,e,o){return useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),o&&(typeof o=="function"?o(r):ut(o)&&(o.current=r));},[e])}var Gt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var Wa="framerAppearId",ze="data-"+Gt(Wa);var{schedule:$t}=Ke(queueMicrotask,false);var He=createContext({});function vi(t,e,o,r,i){var s,n;let{visualElement:a}=useContext(xt),l=useContext(Ge),u=useContext(Kt),m=useContext(Ue).reducedMotion,c=useRef(null);r=r||l.renderer,!c.current&&r&&(c.current=r(t,{visualState:e,parent:a,props:o,presenceContext:u,blockInitialAnimation:u?u.initial===false:false,reducedMotionConfig:m}));let f=c.current,p=useContext(He);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&qa(c.current,o,i,p);let h=useRef(false);useInsertionEffect(()=>{f&&h.current&&f.update(o,u);});let d=o[ze],y=useRef(!!d&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,d))&&((n=window.MotionHasOptimisedAnimation)===null||n===void 0?void 0:n.call(window,d)));return si(()=>{f&&(h.current=true,window.MotionIsMounted=true,f.updateFeatures(),$t.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges());}),useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,d);}),y.current=false));}),f}function qa(t,e,o,r){let{layoutId:i,layout:s,drag:n,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new o(t.latestValues,e["data-framer-portal-id"]?void 0:Ti(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!n||a&&ut(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u});}function Ti(t){if(t)return t.options.allowProjection!==false?t.projection:Ti(t.parent)}function Pi({preloadedFeatures:t,createVisualElement:e,useRender:o,useVisualState:r,Component:i}){var s,n;t&&ui(t);function a(u,m){let c,f={...useContext(Ue),...u,layoutId:Qa(u)},{isStatic:p}=f,h=gi(u),d=r(u,p);if(!p&&_t){tl(f,t);let y=el(f);c=y.MeasureLayout,h.visualElement=vi(i,d,f,e,y.ProjectionNode);}return jsxs(xt.Provider,{value:h,children:[c&&h.visualElement?jsx(c,{visualElement:h.visualElement,...f}):null,o(i,u,xi(d,h.visualElement,m),d,p,h.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(n=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&n!==void 0?n:""})`}`;let l=forwardRef(a);return l[yi]=i,l}function Qa({layoutId:t}){let e=useContext(Ne).id;return e&&t!==void 0?e+"-"+t:t}function tl(t,e){let o=useContext(Ge).strict;if(process.env.NODE_ENV!=="production"&&e&&o){let r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?J(false,r):G(false,r);}}function el(t){let{drag:e,layout:o}=at;if(!e&&!o)return {};let r={...e,...o};return {MeasureLayout:e?.isEnabled(t)||o?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var Si=t=>e=>typeof e=="string"&&e.startsWith(t),Wt=Si("--"),ol=Si("var(--"),zt=t=>ol(t)?rl.test(t.split("/*")[0].trim()):false,rl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var Dt={};function Vi(t){for(let e in t)Dt[e]=t[e],Wt(e)&&(Dt[e].isCSSVariable=true);}var tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$=new Set(tt);function Ye(t,{layout:e,layoutId:o}){return $.has(t)||t.startsWith("origin")||(e||o!==void 0)&&(!!Dt[t]||t==="opacity")}var M=t=>!!(t&&t.getVelocity);var qe=(t,e)=>e&&typeof t=="number"?e.transform(t):t;var O=(t,e,o)=>o>e?e:o<t?t:o;var et={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},mt={...et,transform:t=>O(0,1,t)},Me={...et,default:1};var we=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ot=we("deg"),U=we("%"),x=we("px"),bi=we("vh"),Ai=we("vw"),mr={...U,parse:t=>U.parse(t)/100,transform:t=>U.transform(t*100)};var Ci={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x};var Mi={rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:Me,scaleX:Me,scaleY:Me,scaleZ:Me,skew:ot,skewX:ot,skewY:ot,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:mt,originX:mr,originY:mr,originZ:x};var cr={...et,transform:Math.round};var Ht={...Ci,...Mi,zIndex:cr,size:x,fillOpacity:mt,strokeOpacity:mt,numOctaves:cr};var il={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nl=tt.length;function wi(t,e,o){let r="",i=true;for(let s=0;s<nl;s++){let n=tt[s],a=t[n];if(a===void 0)continue;let l=true;if(typeof a=="number"?l=a===(n.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||o){let u=qe(a,Ht[n]);if(!l){i=false;let m=il[n]||n;r+=`${m}(${u}) `;}o&&(e[n]=u);}}return r=r.trim(),o?r=o(e,i?"":r):i&&(r="none"),r}function Yt(t,e,o){let{style:r,vars:i,transformOrigin:s}=t,n=false,a=false;for(let l in e){let u=e[l];if($.has(l)){n=true;continue}else if(Wt(l)){i[l]=u;continue}else {let m=qe(u,Ht[l]);l.startsWith("origin")?(a=true,s[l]=m):r[l]=m;}}if(e.transform||(n||o?r.transform=wi(e,t.transform,o):r.transform&&(r.transform="none")),a){let{originX:l="50%",originY:u="50%",originZ:m=0}=s;r.transformOrigin=`${l} ${u} ${m}`;}}var qt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fr(t,e,o){for(let r in e)!M(e[r])&&!Ye(r,o)&&(t[r]=e[r]);}function al({transformTemplate:t},e){return useMemo(()=>{let o=qt();return Yt(o,e,t),Object.assign({},o.vars,o.style)},[e])}function ll(t,e){let o=t.style||{},r={};return fr(r,o,t),Object.assign(r,al(t,e)),r}function Di(t,e){let o={},r=ll(t,e);return t.drag&&t.dragListener!==false&&(o.draggable=false,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===true?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=r,o}var Ri=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Xt(t){return typeof t!="string"||t.includes("-")?false:!!(Ri.indexOf(t)>-1||/[A-Z]/u.test(t))}var ul={offset:"stroke-dashoffset",array:"stroke-dasharray"},ml={offset:"strokeDashoffset",array:"strokeDasharray"};function Ei(t,e,o=1,r=0,i=true){t.pathLength=1;let s=i?ul:ml;t[s.offset]=x.transform(-r);let n=x.transform(e),a=x.transform(o);t[s.array]=`${n} ${a}`;}function Li(t,e,o){return typeof t=="string"?t:x.transform(e+o*t)}function Bi(t,e,o){let r=Li(e,t.x,t.width),i=Li(o,t.y,t.height);return `${r} ${i}`}function Zt(t,{attrX:e,attrY:o,attrScale:r,originX:i,originY:s,pathLength:n,pathSpacing:a=1,pathOffset:l=0,...u},m,c){if(Yt(t,u,c),m){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:f,style:p,dimensions:h}=t;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Bi(h,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(f.x=e),o!==void 0&&(f.y=o),r!==void 0&&(f.scale=r),n!==void 0&&Ei(f,n,a,l,false);}var Xe=()=>({...qt(),attrs:{}});var Jt=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Fi(t,e,o,r){let i=useMemo(()=>{let s=Xe();return Zt(s,e,Jt(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){let s={};fr(s,t.style,t),i.style={...s,...i.style};}return i}function Ii(t=false){return (o,r,i,{latestValues:s},n)=>{let l=(Xt(o)?Fi:Di)(r,s,n,o),u=ci(r,typeof o=="string",t),m=o!==Fragment?{...u,...l,ref:i}:{},{children:c}=r,f=useMemo(()=>M(c)?c.get():c,[c]);return createElement(o,{...m,children:f})}}function Oi(t){let e=[{},{}];return t?.values.forEach((o,r)=>{e[0][r]=o.get(),e[1][r]=o.getVelocity();}),e}function Qt(t,e,o,r){if(typeof e=="function"){let[i,s]=Oi(r);e=e(o!==void 0?o:t.custom,i,s);}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){let[i,s]=Oi(r);e=e(o!==void 0?o:t.custom,i,s);}return e}var De=t=>Array.isArray(t);var ki=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),ji=t=>De(t)?t[t.length-1]||0:t;function te(t){let e=M(t)?t.get():t;return ki(e)?e.toValue():e}function dl({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:o},r,i,s){let n={latestValues:gl(r,i,s,t),renderState:e()};return o&&(n.onMount=a=>o({props:r,current:a,...n}),n.onUpdate=a=>o(a)),n}var Ze=t=>(e,o)=>{let r=useContext(xt),i=useContext(Kt),s=()=>dl(t,e,r,i);return o?s():ii(s)};function gl(t,e,o,r){let i={},s=r(t,{});for(let f in s)i[f]=te(s[f]);let{initial:n,animate:a}=t,l=wt(t),u=We(t);e&&u&&!l&&t.inherit!==false&&(n===void 0&&(n=e.initial),a===void 0&&(a=e.animate));let m=o?o.initial===false:false;m=m||n===false;let c=m?a:n;if(c&&typeof c!="boolean"&&!vt(c)){let f=Array.isArray(c)?c:[c];for(let p=0;p<f.length;p++){let h=Qt(t,f[p]);if(h){let{transitionEnd:d,transition:y,...g}=h;for(let v in g){let T=g[v];if(Array.isArray(T)){let A=m?T.length-1:0;T=T[A];}T!==null&&(i[v]=T);}for(let v in d)i[v]=d[v];}}}return i}function ee(t,e,o){var r;let{style:i}=t,s={};for(let n in i)(M(i[n])||e.style&&M(e.style[n])||Ye(n,t)||((r=o?.getValue(n))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[n]=i[n]);return s}var Ui={useVisualState:Ze({scrapeMotionValuesFromProps:ee,createRenderState:qt})};function Je(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect();}catch{e.dimensions={x:0,y:0,width:0,height:0};}}function Qe(t,{style:e,vars:o},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(let s in o)t.style.setProperty(s,o[s]);}var to=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function eo(t,e,o,r){Qe(t,e,void 0,r);for(let i in e.attrs)t.setAttribute(to.has(i)?i:Gt(i),e.attrs[i]);}function oo(t,e,o){let r=ee(t,e,o);for(let i in t)if(M(t[i])||M(e[i])){let s=tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i];}return r}var Ki=["x","y","width","height","cx","cy","r"],_i={useVisualState:Ze({scrapeMotionValuesFromProps:oo,createRenderState:Xe,onUpdate:({props:t,prevProps:e,current:o,renderState:r,latestValues:i})=>{if(!o)return;let s=!!t.drag;if(!s){for(let a in i)if($.has(a)){s=true;break}}if(!s)return;let n=!e;if(e)for(let a=0;a<Ki.length;a++){let l=Ki[a];t[l]!==e[l]&&(n=true);}n&&S.read(()=>{Je(o,r),S.render(()=>{Zt(r,i,Jt(o.tagName),t.transformTemplate),eo(o,r);});});}})};function Gi(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:false}){let n={...Xt(r)?_i:Ui,preloadedFeatures:t,useRender:Ii(i),createVisualElement:e,Component:r};return Pi(n)}}function ct(t,e,o){let r=t.getProps();return Qt(r,e,o!==void 0?o:r.custom,t)}function oe(t,e){return t?t[e]||t.default||t:void 0}var ro=new Set(["width","height","top","left","right","bottom",...tt]);var io;function yl(){io=void 0;}var k={now:()=>(io===void 0&&k.set(E.isProcessing||Mt.useManualTiming?E.timestamp:performance.now()),io),set:t=>{io=t,queueMicrotask(yl);}};function re(t,e){t.indexOf(e)===-1&&t.push(e);}function ie(t,e){let o=t.indexOf(e);o>-1&&t.splice(o,1);}var Tt=class{constructor(){this.subscriptions=[];}add(e){return re(this.subscriptions,e),()=>ie(this.subscriptions,e)}notify(e,o,r){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,o,r);else for(let s=0;s<i;s++){let n=this.subscriptions[s];n&&n(e,o,r);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};function no(t,e){return e?t*(1e3/e):0}var $i=30,xl=t=>!isNaN(parseFloat(t)),pr=class{constructor(e,o={}){this.version="12.4.10",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=true)=>{let s=k.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current);},this.hasAnimated=false,this.setCurrent(e),this.owner=o.owner;}setCurrent(e){this.current=e,this.updatedAt=k.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=xl(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&yt(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,o){this.events[e]||(this.events[e]=new Tt);let r=this.events[e].add(o);return e==="change"?()=>{r(),S.read(()=>{this.events.change.getSize()||this.stop();});}:r}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,o){this.passiveEffect=e,this.stopPassiveEffect=o;}set(e,o=true){!o||!this.passiveEffect?this.updateAndNotify(e,o):this.passiveEffect(e,this.updateAndNotify);}setWithVelocity(e,o,r){this.set(o),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r;}jump(e,o=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>$i)return 0;let o=Math.min(this.updatedAt-this.prevUpdatedAt,$i);return no(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(e){return this.stop(),new Promise(o=>{this.hasAnimated=true,this.animation=e(o),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function ft(t,e){return new pr(t,e)}function vl(t,e,o){t.hasValue(e)?t.getValue(e).set(o):t.addValue(e,ft(o));}function zi(t,e){let o=ct(t,e),{transitionEnd:r={},transition:i={},...s}=o||{};s={...s,...r};for(let n in s){let a=ji(s[n]);vl(t,n,a);}}function Hi(t){return !!(M(t)&&t.add)}function Re(t,e){let o=t.getValue("willChange");if(Hi(o))return o.add(e)}function so(t){return t.props[ze]}function ne(t){let e;return ()=>(e===void 0&&(e=t()),e)}var Yi=ne(()=>window.ScrollTimeline!==void 0);var ao=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,o){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=o;}attachTimeline(e,o){let r=this.animations.map(i=>{if(Yi()&&i.attachTimeline)return i.attachTimeline(e);if(typeof o=="function")return o(i)});return ()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let o=0;o<this.animations.length;o++)e=Math.max(e,this.animations[o].duration);return e}runAll(e){this.animations.forEach(o=>o[e]());}flatten(){this.runAll("flatten");}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var lo=class extends ao{then(e,o){return Promise.all(this.animations).then(e).catch(o)}};var j=t=>t*1e3,W=t=>t/1e3;function se(t){return typeof t=="function"}function hr(t,e){t.timeline=e,t.onfinish=null;}var Ee=t=>Array.isArray(t)&&typeof t[0]=="number";var qi={linearEasing:void 0};function Xi(t,e){let o=ne(t);return ()=>{var r;return (r=qi[e])!==null&&r!==void 0?r:o()}}var ae=Xi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Q=(t,e,o)=>{let r=e-t;return r===0?1:(o-t)/r};var mo=(t,e,o=10)=>{let r="",i=Math.max(Math.round(e/o),2);for(let s=0;s<i;s++)r+=t(Q(0,i-1,s))+", ";return `linear(${r.substring(0,r.length-2)})`};function gr(t){return !!(typeof t=="function"&&ae()||!t||typeof t=="string"&&(t in dr||ae())||Ee(t)||Array.isArray(t)&&t.every(gr))}var Le=([t,e,o,r])=>`cubic-bezier(${t}, ${e}, ${o}, ${r})`,dr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Le([0,.65,.55,1]),circOut:Le([.55,0,1,.45]),backIn:Le([.31,.01,.66,-0.59]),backOut:Le([.33,1.53,.69,.99])};function yr(t,e){if(t)return typeof t=="function"&&ae()?mo(t,e):Ee(t)?Le(t):Array.isArray(t)?t.map(o=>yr(o,e)||dr.easeOut):dr[t]}var Zi=(t,e,o)=>(((1-3*o+3*e)*t+(3*o-6*e))*t+3*e)*t,Tl=1e-7,Pl=12;function Sl(t,e,o,r,i){let s,n,a=0;do n=e+(o-e)/2,s=Zi(n,r,i)-t,s>0?o=n:e=n;while(Math.abs(s)>Tl&&++a<Pl);return n}function Pt(t,e,o,r){if(t===e&&o===r)return R;let i=s=>Sl(s,0,1,t,o);return s=>s===0||s===1?s:Zi(i(s),e,r)}var co=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2;var fo=t=>e=>1-t(1-e);var xr=Pt(.33,1.53,.69,.99),Be=fo(xr),po=co(Be);var ho=t=>(t*=2)<1?.5*Be(t):.5*(2-Math.pow(2,-10*(t-1)));var go=t=>1-Math.sin(Math.acos(t)),yo=fo(go),xo=co(go);var vo=t=>/^0[^.\s]+$/u.test(t);function Ji(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||vo(t):true}var St=t=>Math.round(t*1e5)/1e5;var le=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qi(t){return t==null}var tn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var ue=(t,e)=>o=>!!(typeof o=="string"&&tn.test(o)&&o.startsWith(t)||e&&!Qi(o)&&Object.prototype.hasOwnProperty.call(o,e)),To=(t,e,o)=>r=>{if(typeof r!="string")return r;let[i,s,n,a]=r.match(le);return {[t]:parseFloat(i),[e]:parseFloat(s),[o]:parseFloat(n),alpha:a!==void 0?parseFloat(a):1}};var Vl=t=>O(0,255,t),vr={...et,transform:t=>Math.round(Vl(t))},rt={test:ue("rgb","red"),parse:To("red","green","blue"),transform:({red:t,green:e,blue:o,alpha:r=1})=>"rgba("+vr.transform(t)+", "+vr.transform(e)+", "+vr.transform(o)+", "+St(mt.transform(r))+")"};function bl(t){let e="",o="",r="",i="";return t.length>5?(e=t.substring(1,3),o=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),o=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,o+=o,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(o,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Fe={test:ue("#"),parse:bl,transform:rt.transform};var Vt={test:ue("hsl","hue"),parse:To("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+U.transform(St(e))+", "+U.transform(St(o))+", "+St(mt.transform(r))+")"};var L={test:t=>rt.test(t)||Fe.test(t)||Vt.test(t),parse:t=>rt.test(t)?rt.parse(t):Vt.test(t)?Vt.parse(t):Fe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):Vt.transform(t)};var en=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Al(t){var e,o;return isNaN(t)&&typeof t=="string"&&(((e=t.match(le))===null||e===void 0?void 0:e.length)||0)+(((o=t.match(en))===null||o===void 0?void 0:o.length)||0)>0}var rn="number",nn="color",Cl="var",Ml="var(",on="${}",wl=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Rt(t){let e=t.toString(),o=[],r={color:[],number:[],var:[]},i=[],s=0,a=e.replace(wl,l=>(L.test(l)?(r.color.push(s),i.push(nn),o.push(L.parse(l))):l.startsWith(Ml)?(r.var.push(s),i.push(Cl),o.push(l)):(r.number.push(s),i.push(rn),o.push(parseFloat(l))),++s,on)).split(on);return {values:o,split:a,indexes:r,types:i}}function sn(t){return Rt(t).values}function an(t){let{split:e,types:o}=Rt(t),r=e.length;return i=>{let s="";for(let n=0;n<r;n++)if(s+=e[n],i[n]!==void 0){let a=o[n];a===rn?s+=St(i[n]):a===nn?s+=L.transform(i[n]):s+=i[n];}return s}}var Dl=t=>typeof t=="number"?0:t;function Rl(t){let e=sn(t);return an(t)(e.map(Dl))}var K={test:Al,parse:sn,createTransformer:an,getAnimatableNone:Rl};var El=new Set(["brightness","contrast","saturate","opacity"]);function Ll(t){let[e,o]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;let[r]=o.match(le)||[];if(!r)return t;let i=o.replace(r,""),s=El.has(e)?1:0;return r!==o&&(s*=100),e+"("+s+i+")"}var Bl=/\b([a-z-]*)\(.*?\)/gu,Ie={...K,getAnimatableNone:t=>{let e=t.match(Bl);return e?e.map(Ll).join(" "):t}};var Fl={...Ht,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:Ie,WebkitFilter:Ie},me=t=>Fl[t];function Po(t,e){let o=me(t);return o!==Ie&&(o=K),o.getAnimatableNone?o.getAnimatableNone(e):void 0}var Il=new Set(["auto","none","0"]);function ln(t,e,o){let r=0,i;for(;r<t.length&&!i;){let s=t[r];typeof s=="string"&&!Il.has(s)&&Rt(s).values.length&&(i=t[r]),r++;}if(i&&o)for(let s of e)t[s]=Po(o,i);}var Tr=t=>t===et||t===x,un=(t,e)=>parseFloat(t.split(", ")[e]),mn=(t,e)=>(o,{transform:r})=>{if(r==="none"||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/u);if(i)return un(i[1],e);{let s=r.match(/^matrix\((.+)\)$/u);return s?un(s[1],t):0}},Ol=new Set(["x","y","z"]),kl=tt.filter(t=>!Ol.has(t));function cn(t){let e=[];return kl.forEach(o=>{let r=t.getValue(o);r!==void 0&&(e.push([o,r.get()]),r.set(o.startsWith("scale")?1:0));}),e}var Et={width:({x:t},{paddingLeft:e="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(e)-parseFloat(o),height:({y:t},{paddingTop:e="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(e)-parseFloat(o),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:mn(4,13),y:mn(5,14)};Et.translateX=Et.x;Et.translateY=Et.y;var Lt=new Set,Pr=false,Sr=false;function fn(){if(Sr){let t=Array.from(Lt).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),o=new Map;e.forEach(r=>{let i=cn(r);i.length&&(o.set(r,i),r.render());}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();let i=o.get(r);i&&i.forEach(([s,n])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(n);});}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY);});}Sr=false,Pr=false,Lt.forEach(t=>t.complete()),Lt.clear();}function pn(){Lt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Sr=true);});}function hn(){pn(),fn();}var bt=class{constructor(e,o,r,i,s,n=false){this.isComplete=false,this.isAsync=false,this.needsMeasurement=false,this.isScheduled=false,this.unresolvedKeyframes=[...e],this.onComplete=o,this.name=r,this.motionValue=i,this.element=s,this.isAsync=n;}scheduleResolve(){this.isScheduled=true,this.isAsync?(Lt.add(this),Pr||(Pr=true,S.read(pn),S.resolveKeyframes(fn))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:o,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){let n=i?.get(),a=e[e.length-1];if(n!==void 0)e[0]=n;else if(r&&o){let l=r.readValue(o,a);l!=null&&(e[0]=l);}e[0]===void 0&&(e[0]=a),i&&n===void 0&&i.set(e[0]);}else e[s]=e[s-1];}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=true,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Lt.delete(this);}cancel(){this.isComplete||(this.isScheduled=false,Lt.delete(this));}resume(){this.isComplete||this.scheduleResolve();}};var So=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);var jl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Nl(t){let e=jl.exec(t);if(!e)return [,];let[,o,r,i]=e;return [`--${o??r}`,i]}var Ul=4;function Vr(t,e,o=1){G(o<=Ul,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[r,i]=Nl(t);if(!r)return;let s=window.getComputedStyle(e).getPropertyValue(r);if(s){let n=s.trim();return So(n)?parseFloat(n):n}return zt(i)?Vr(i,e,o+1):i}var Vo=t=>e=>e.test(t);var dn={test:t=>t==="auto",parse:t=>t};var br=[et,x,U,ot,Ai,bi,dn],Ar=t=>br.find(Vo(t));var ce=class extends bt{constructor(e,o,r,i,s){super(e,o,r,i,s,true);}readKeyframes(){let{unresolvedKeyframes:e,element:o,name:r}=this;if(!o||!o.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),zt(u))){let m=Vr(u,o.current);m!==void 0&&(e[l]=m),l===e.length-1&&(this.finalKeyframe=u);}}if(this.resolveNoneKeyframes(),!ro.has(r)||e.length!==2)return;let[i,s]=e,n=Ar(i),a=Ar(s);if(n!==a)if(Tr(n)&&Tr(a))for(let l=0;l<e.length;l++){let u=e[l];typeof u=="string"&&(e[l]=parseFloat(u));}else this.needsMeasurement=true;}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:o}=this,r=[];for(let i=0;i<e.length;i++)Ji(e[i])&&r.push(i);r.length&&ln(e,r,o);}measureInitialState(){let{element:e,unresolvedKeyframes:o,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Et[r](e.measureViewportBox(),window.getComputedStyle(e.current)),o[0]=this.measuredOrigin;let i=o[o.length-1];i!==void 0&&e.getValue(r,i).jump(i,false);}measureEndState(){var e;let{element:o,name:r,unresolvedKeyframes:i}=this;if(!o||!o.current)return;let s=o.getValue(r);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,a=i[n];i[n]=Et[r](o.measureViewportBox(),window.getComputedStyle(o.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{o.getValue(l).set(u);}),this.resolveNoneKeyframes();}};var Cr=(t,e)=>e==="zIndex"?false:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(K.test(t)||t==="0")&&!t.startsWith("url("));function Kl(t){let e=t[0];if(t.length===1)return true;for(let o=0;o<t.length;o++)if(t[o]!==e)return true}function gn(t,e,o,r){let i=t[0];if(i===null)return false;if(e==="display"||e==="visibility")return true;let s=t[t.length-1],n=Cr(i,e),a=Cr(s,e);return J(n===a,`You are trying to animate ${e} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!n||!a?false:Kl(t)||(o==="spring"||se(o))&&r}var _l=t=>t!==null;function At(t,{repeat:e,repeatType:o="loop"},r){let i=t.filter(_l),s=e&&o!=="loop"&&e%2===1?0:i.length-1;return !s||r===void 0?i[s]:r}var Gl=40,fe=class{constructor({autoplay:e=true,delay:o=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:n="loop",...a}){this.isStopped=false,this.hasAttemptedResolve=false,this.createdAt=k.now(),this.options={autoplay:e,delay:o,type:r,repeat:i,repeatDelay:s,repeatType:n,...a},this.updateFinishedPromise();}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Gl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return !this._resolved&&!this.hasAttemptedResolve&&hn(),this._resolved}onKeyframesResolved(e,o){this.resolvedAt=k.now(),this.hasAttemptedResolve=true;let{name:r,type:i,velocity:s,delay:n,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!gn(e,r,i,s))if(!n){l&&l(At(e,this.options,o)),a&&a(),this.resolveFinishedPromise();return}else this.options.duration=0;let m=this.initPlayback(e,o);m!==false&&(this._resolved={keyframes:e,finalKeyframe:o,...m},this.onPostResolved());}onPostResolved(){}then(e,o){return this.currentFinishedPromise.then(e,o)}flatten(){this.options.type="keyframes",this.options.ease="linear";}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e;});}};function bo(t){let e=0,o=50,r=t.next(e);for(;!r.done&&e<2e4;)e+=o,r=t.next(e);return e>=2e4?1/0:e}var b=(t,e,o)=>t+(e-t)*o;function Mr(t,e,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(e-t)*6*o:o<1/2?e:o<2/3?t+(e-t)*(2/3-o)*6:t}function yn({hue:t,saturation:e,lightness:o,alpha:r}){t/=360,e/=100,o/=100;let i=0,s=0,n=0;if(!e)i=s=n=o;else {let a=o<.5?o*(1+e):o+e-o*e,l=2*o-a;i=Mr(l,a,t+1/3),s=Mr(l,a,t),n=Mr(l,a,t-1/3);}return {red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(n*255),alpha:r}}function pe(t,e){return o=>o>0?e:t}var wr=(t,e,o)=>{let r=t*t,i=o*(e*e-r)+r;return i<0?0:Math.sqrt(i)},$l=[Fe,rt,Vt],Wl=t=>$l.find(e=>e.test(t));function xn(t){let e=Wl(t);if(J(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return false;let o=e.parse(t);return e===Vt&&(o=yn(o)),o}var Dr=(t,e)=>{let o=xn(t),r=xn(e);if(!o||!r)return pe(t,e);let i={...o};return s=>(i.red=wr(o.red,r.red,s),i.green=wr(o.green,r.green,s),i.blue=wr(o.blue,r.blue,s),i.alpha=b(o.alpha,r.alpha,s),rt.transform(i))};var zl=(t,e)=>o=>e(t(o)),nt=(...t)=>t.reduce(zl);var Ao=new Set(["none","hidden"]);function vn(t,e){return Ao.has(t)?o=>o<=0?t:e:o=>o>=1?e:t}function Hl(t,e){return o=>b(t,e,o)}function Co(t){return typeof t=="number"?Hl:typeof t=="string"?zt(t)?pe:L.test(t)?Dr:Xl:Array.isArray(t)?Tn:typeof t=="object"?L.test(t)?Dr:Yl:pe}function Tn(t,e){let o=[...t],r=o.length,i=t.map((s,n)=>Co(s)(s,e[n]));return s=>{for(let n=0;n<r;n++)o[n]=i[n](s);return o}}function Yl(t,e){let o={...t,...e},r={};for(let i in o)t[i]!==void 0&&e[i]!==void 0&&(r[i]=Co(t[i])(t[i],e[i]));return i=>{for(let s in r)o[s]=r[s](i);return o}}function ql(t,e){var o;let r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],a=t.indexes[n][i[n]],l=(o=t.values[a])!==null&&o!==void 0?o:0;r[s]=l,i[n]++;}return r}var Xl=(t,e)=>{let o=K.createTransformer(e),r=Rt(t),i=Rt(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ao.has(t)&&!i.values.length||Ao.has(e)&&!r.values.length?vn(t,e):nt(Tn(ql(r,i),i.values),o):(J(true,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),pe(t,e))};function Mo(t,e,o){return typeof t=="number"&&typeof e=="number"&&typeof o=="number"?b(t,e,o):Co(t)(t,e)}var Zl=5;function wo(t,e,o){let r=Math.max(e-Zl,0);return no(o-t(r),e-r)}var w={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Rr=.001;function Pn({duration:t=w.duration,bounce:e=w.bounce,velocity:o=w.velocity,mass:r=w.mass}){let i,s;J(t<=j(w.maxDuration),"Spring duration must be 10 seconds or less");let n=1-e;n=O(w.minDamping,w.maxDamping,n),t=O(w.minDuration,w.maxDuration,W(t)),n<1?(i=u=>{let m=u*n,c=m*t,f=m-o,p=Do(u,n),h=Math.exp(-c);return Rr-f/p*h},s=u=>{let c=u*n*t,f=c*o+o,p=Math.pow(n,2)*Math.pow(u,2)*t,h=Math.exp(-c),d=Do(Math.pow(u,2),n);return (-i(u)+Rr>0?-1:1)*((f-p)*h)/d}):(i=u=>{let m=Math.exp(-u*t),c=(u-o)*t+1;return -1e-3+m*c},s=u=>{let m=Math.exp(-u*t),c=(o-u)*(t*t);return m*c});let a=5/t,l=Ql(i,s,a);if(t=j(t),isNaN(l))return {stiffness:w.stiffness,damping:w.damping,duration:t};{let u=Math.pow(l,2)*r;return {stiffness:u,damping:n*2*Math.sqrt(r*u),duration:t}}}var Jl=12;function Ql(t,e,o){let r=o;for(let i=1;i<Jl;i++)r=r-t(r)/e(r);return r}function Do(t,e){return t*Math.sqrt(1-e*e)}var eu=["duration","bounce"],ou=["stiffness","damping","mass"];function Sn(t,e){return e.some(o=>t[o]!==void 0)}function ru(t){let e={velocity:w.velocity,stiffness:w.stiffness,damping:w.damping,mass:w.mass,isResolvedFromDuration:false,...t};if(!Sn(t,ou)&&Sn(t,eu))if(t.visualDuration){let o=t.visualDuration,r=2*Math.PI/(o*1.2),i=r*r,s=2*O(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:w.mass,stiffness:i,damping:s};}else {let o=Pn(t);e={...e,...o,mass:w.mass},e.isResolvedFromDuration=true;}return e}function Ro(t=w.visualDuration,e=w.bounce){let o=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:r,restDelta:i}=o,s=o.keyframes[0],n=o.keyframes[o.keyframes.length-1],a={done:false,value:s},{stiffness:l,damping:u,mass:m,duration:c,velocity:f,isResolvedFromDuration:p}=ru({...o,velocity:-W(o.velocity||0)}),h=f||0,d=u/(2*Math.sqrt(l*m)),y=n-s,g=W(Math.sqrt(l/m)),v=Math.abs(y)<5;r||(r=v?w.restSpeed.granular:w.restSpeed.default),i||(i=v?w.restDelta.granular:w.restDelta.default);let T;if(d<1){let P=Do(g,d);T=C=>{let I=Math.exp(-d*g*C);return n-I*((h+d*g*y)/P*Math.sin(P*C)+y*Math.cos(P*C))};}else if(d===1)T=P=>n-Math.exp(-g*P)*(y+(h+g*y)*P);else {let P=g*Math.sqrt(d*d-1);T=C=>{let I=Math.exp(-d*g*C),V=Math.min(P*C,300);return n-I*((h+d*g*y)*Math.sinh(V)+P*y*Math.cosh(V))/P};}let A={calculatedDuration:p&&c||null,next:P=>{let C=T(P);if(p)a.done=P>=c;else {let I=0;d<1&&(I=P===0?j(h):wo(T,P,C));let V=Math.abs(I)<=r,_=Math.abs(n-C)<=i;a.done=V&&_;}return a.value=a.done?n:C,a},toString:()=>{let P=Math.min(bo(A),2e4),C=mo(I=>A.next(P*I).value,P,30);return P+"ms "+C}};return A}function Er({keyframes:t,velocity:e=0,power:o=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:n,min:a,max:l,restDelta:u=.5,restSpeed:m}){let c=t[0],f={done:false,value:c},p=V=>a!==void 0&&V<a||l!==void 0&&V>l,h=V=>a===void 0?l:l===void 0||Math.abs(a-V)<Math.abs(l-V)?a:l,d=o*e,y=c+d,g=n===void 0?y:n(y);g!==y&&(d=g-c);let v=V=>-d*Math.exp(-V/r),T=V=>g+v(V),A=V=>{let _=v(V),X=T(V);f.done=Math.abs(_)<=u,f.value=f.done?g:X;},P,C,I=V=>{p(f.value)&&(P=V,C=Ro({keyframes:[f.value,h(f.value)],velocity:wo(T,V,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:m}));};return I(0),{calculatedDuration:null,next:V=>{let _=false;return !C&&P===void 0&&(_=true,A(V),I(V)),P!==void 0&&V>=P?C.next(V-P):(!_&&A(V),f)}}}var Vn=Pt(.42,0,1,1),bn=Pt(0,0,.58,1),Eo=Pt(.42,0,.58,1);var An=t=>Array.isArray(t)&&typeof t[0]!="number";var Cn={linear:R,easeIn:Vn,easeInOut:Eo,easeOut:bn,circIn:go,circInOut:xo,circOut:yo,backIn:Be,backInOut:po,backOut:xr,anticipate:ho},Lr=t=>{if(Ee(t)){G(t.length===4,"Cubic bezier arrays must contain four numerical values.");let[e,o,r,i]=t;return Pt(e,o,r,i)}else if(typeof t=="string")return G(Cn[t]!==void 0,`Invalid easing type '${t}'`),Cn[t];return t};function iu(t,e,o){let r=[],i=o||Mo,s=t.length-1;for(let n=0;n<s;n++){let a=i(t[n],t[n+1]);if(e){let l=Array.isArray(e)?e[n]||R:e;a=nt(l,a);}r.push(a);}return r}function Mn(t,e,{clamp:o=true,ease:r,mixer:i}={}){let s=t.length;if(G(s===e.length,"Both input and output ranges must be the same length"),s===1)return ()=>e[0];if(s===2&&e[0]===e[1])return ()=>e[1];let n=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=iu(e,r,i),l=a.length,u=m=>{if(n&&m<t[0])return e[0];let c=0;if(l>1)for(;c<t.length-2&&!(m<t[c+1]);c++);let f=Q(t[c],t[c+1],m);return a[c](f)};return o?m=>u(O(t[0],t[s-1],m)):u}function wn(t,e){let o=t[t.length-1];for(let r=1;r<=e;r++){let i=Q(0,e,r);t.push(b(o,1,i));}}function Dn(t){let e=[0];return wn(e,t.length-1),e}function Rn(t,e){return t.map(o=>o*e)}function nu(t,e){return t.map(()=>e||Eo).splice(0,t.length-1)}function he({duration:t=300,keyframes:e,times:o,ease:r="easeInOut"}){let i=An(r)?r.map(Lr):Lr(r),s={done:false,value:e[0]},n=Rn(o&&o.length===e.length?o:Dn(e),t),a=Mn(n,e,{ease:Array.isArray(i)?i:nu(e,i)});return {calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}var En=t=>{let e=({timestamp:o})=>t(o);return {start:()=>S.update(e,true),stop:()=>Y(e),now:()=>E.isProcessing?E.timestamp:k.now()}};var su={decay:Er,inertia:Er,tween:he,keyframes:he,spring:Ro},au=t=>t/100,Bt=class extends fe{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=true,this.state==="idle")return;this.teardown();let{onStop:l}=this.options;l&&l();};let{name:o,motionValue:r,element:i,keyframes:s}=this.options,n=i?.KeyframeResolver||bt,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new n(s,a,o,r,i),this.resolver.scheduleResolve();}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes));}initPlayback(e){let{type:o="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:n=0}=this.options,a=se(o)?o:su[o]||he,l,u;process.env.NODE_ENV!=="production"&&a!==he&&G(e.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a!==he&&typeof e[0]!="number"&&(l=nt(au,Mo(e[0],e[1])),e=[0,100]);let m=a({...this.options,keyframes:e});s==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-n})),m.calculatedDuration===null&&(m.calculatedDuration=bo(m));let{calculatedDuration:c}=m,f=c+i,p=f*(r+1)-i;return {generator:m,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:p}}onPostResolved(){let{autoplay:e=true}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState;}tick(e,o=false){let{resolved:r}=this;if(!r){let{keyframes:V}=this.options;return {done:true,value:V[V.length-1]}}let{finalKeyframe:i,generator:s,mirroredGenerator:n,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:m,resolvedDuration:c}=r;if(this.startTime===null)return s.next(0);let{delay:f,repeat:p,repeatType:h,repeatDelay:d,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-m/this.speed,this.startTime)),o?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;let g=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>m;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=m);let T=this.currentTime,A=s;if(p){let V=Math.min(this.currentTime,m)/c,_=Math.floor(V),X=V%1;!X&&V>=1&&(X=1),X===1&&_--,_=Math.min(_,p+1),!!(_%2)&&(h==="reverse"?(X=1-X,d&&(X-=d/c)):h==="mirror"&&(A=n)),T=O(0,1,X)*c;}let P=v?{done:false,value:l[0]}:A.next(T);a&&(P.value=a(P.value));let{done:C}=P;!v&&u!==null&&(C=this.speed>=0?this.currentTime>=m:this.currentTime<=0);let I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return I&&i!==void 0&&(P.value=At(l,this.options,i)),y&&y(P.value),I&&this.finish(),P}get duration(){let{resolved:e}=this;return e?W(e.calculatedDuration):0}get time(){return W(this.currentTime)}set time(e){e=j(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed);}get speed(){return this.playbackSpeed}set speed(e){let o=this.playbackSpeed!==e;this.playbackSpeed=e,o&&(this.time=W(this.currentTime));}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:e=En,onPlay:o,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),o&&o();let i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start();}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0;}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null;}finish(){this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e();}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise();}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel();}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}};var Ln=new Set(["opacity","clipPath","filter","transform"]);function Bn(t,e,o,{delay:r=0,duration:i=300,repeat:s=0,repeatType:n="loop",ease:a="easeInOut",times:l}={}){let u={[e]:o};l&&(u.offset=l);let m=yr(a,i);Array.isArray(m)&&(u.easing=m);let c=t.animate(u,{delay:r,duration:i,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:s+1,direction:n==="reverse"?"alternate":"normal"});return c}var Fn=ne(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Lo=10,lu=2e4;function uu(t){return se(t.type)||t.type==="spring"||!gr(t.ease)}function mu(t,e){let o=new Bt({...e,keyframes:t,repeat:0,delay:0,isGenerator:true}),r={done:false,value:t[0]},i=[],s=0;for(;!r.done&&s<lu;)r=o.sample(s),i.push(r.value),s+=Lo;return {times:void 0,keyframes:i,duration:s-Lo,ease:"linear"}}var In={anticipate:ho,backInOut:po,circInOut:xo};function cu(t){return t in In}var Oe=class extends fe{constructor(e){super(e);let{name:o,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new ce(s,(n,a)=>this.onKeyframesResolved(n,a),o,r,i),this.resolver.scheduleResolve();}initPlayback(e,o){let{duration:r=300,times:i,ease:s,type:n,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return false;if(typeof s=="string"&&ae()&&cu(s)&&(s=In[s]),uu(this.options)){let{onComplete:c,onUpdate:f,motionValue:p,element:h,...d}=this.options,y=mu(e,d);e=y.keyframes,e.length===1&&(e[1]=e[0]),r=y.duration,i=y.times,s=y.ease,n="keyframes";}let m=Bn(a.owner.current,l,e,{...this.options,duration:r,times:i,ease:s});return m.startTime=u??this.calcStartTime(),this.pendingTimeline?(hr(m,this.pendingTimeline),this.pendingTimeline=void 0):m.onfinish=()=>{let{onComplete:c}=this.options;a.set(At(e,this.options,o)),c&&c(),this.cancel(),this.resolveFinishedPromise();},{animation:m,duration:r,times:i,type:n,ease:s,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:o}=e;return W(o)}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:o}=e;return W(o.currentTime||0)}set time(e){let{resolved:o}=this;if(!o)return;let{animation:r}=o;r.currentTime=j(e);}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:o}=e;return o.playbackRate}set speed(e){let{resolved:o}=this;if(!o)return;let{animation:r}=o;r.playbackRate=e;}get state(){let{resolved:e}=this;if(!e)return "idle";let{animation:o}=e;return o.playState}get startTime(){let{resolved:e}=this;if(!e)return null;let{animation:o}=e;return o.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else {let{resolved:o}=this;if(!o)return R;let{animation:r}=o;hr(r,e);}return R}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:o}=e;o.playState==="finished"&&this.updateFinishedPromise(),o.play();}pause(){let{resolved:e}=this;if(!e)return;let{animation:o}=e;o.pause();}stop(){if(this.resolver.cancel(),this.isStopped=true,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:o,keyframes:r,duration:i,type:s,ease:n,times:a}=e;if(o.playState==="idle"||o.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:m,onComplete:c,element:f,...p}=this.options,h=new Bt({...p,keyframes:r,duration:i,type:s,ease:n,times:a,isGenerator:true}),d=j(this.time);u.setWithVelocity(h.sample(d-Lo).value,h.sample(d).value,Lo);}let{onStop:l}=this.options;l&&l(),this.cancel();}complete(){let{resolved:e}=this;e&&e.animation.finish();}cancel(){let{resolved:e}=this;e&&e.animation.cancel();}static supports(e){let{motionValue:o,name:r,repeatDelay:i,repeatType:s,damping:n,type:a}=e;if(!o||!o.owner||!(o.owner.current instanceof HTMLElement))return false;let{onUpdate:l,transformTemplate:u}=o.owner.getProps();return Fn()&&r&&Ln.has(r)&&!l&&!u&&!i&&s!=="mirror"&&n!==0&&a!=="inertia"}};var fu={type:"spring",stiffness:500,damping:25,restSpeed:10},pu=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),hu={type:"keyframes",duration:.8},du={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},On=(t,{keyframes:e})=>e.length>2?hu:$.has(t)?t.startsWith("scale")?pu(e[1]):fu:du;function kn({when:t,delay:e,delayChildren:o,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:n,repeatDelay:a,from:l,elapsed:u,...m}){return !!Object.keys(m).length}var de=(t,e,o,r={},i,s)=>n=>{let a=oe(r,t)||{},l=a.delay||r.delay||0,{elapsed:u=0}=r;u=u-j(l);let m={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f);},onComplete:()=>{n(),a.onComplete&&a.onComplete();},name:t,motionValue:e,element:s?void 0:i};kn(a)||(m={...m,...On(t,m)}),m.duration&&(m.duration=j(m.duration)),m.repeatDelay&&(m.repeatDelay=j(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let c=false;if((m.type===false||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(c=true)),c&&!s&&e.get()!==void 0){let f=At(m.keyframes,a);if(f!==void 0)return S.update(()=>{m.onUpdate(f),m.onComplete();}),new lo([])}return !s&&Oe.supports(m)?new Oe(m):new Bt(m)};function gu({protectedKeys:t,needsAnimating:e},o){let r=t.hasOwnProperty(o)&&e[o]!==true;return e[o]=false,r}function Bo(t,e,{delay:o=0,transitionOverride:r,type:i}={}){var s;let{transition:n=t.getDefaultTransition(),transitionEnd:a,...l}=e;r&&(n=r);let u=[],m=i&&t.animationState&&t.animationState.getState()[i];for(let c in l){let f=t.getValue(c,(s=t.latestValues[c])!==null&&s!==void 0?s:null),p=l[c];if(p===void 0||m&&gu(m,c))continue;let h={delay:o,...oe(n||{},c)},d=false;if(window.MotionHandoffAnimation){let g=so(t);if(g){let v=window.MotionHandoffAnimation(g,c,S);v!==null&&(h.startTime=v,d=true);}}Re(t,c),f.start(de(c,f,p,t.shouldReduceMotion&&ro.has(c)?{type:false}:h,t,d));let y=f.animation;y&&u.push(y);}return a&&Promise.all(u).then(()=>{S.update(()=>{a&&zi(t,a);});}),u}function Fo(t,e,o={}){var r;let i=ct(t,e,o.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0),{transition:s=t.getDefaultTransition()||{}}=i||{};o.transitionOverride&&(s=o.transitionOverride);let n=i?()=>Promise.all(Bo(t,i,o)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{let{delayChildren:m=0,staggerChildren:c,staggerDirection:f}=s;return yu(t,e,m+u,c,f,o)}:()=>Promise.resolve(),{when:l}=s;if(l){let[u,m]=l==="beforeChildren"?[n,a]:[a,n];return u().then(()=>m())}else return Promise.all([n(),a(o.delay)])}function yu(t,e,o=0,r=0,i=1,s){let n=[],a=(t.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(t.variantChildren).sort(xu).forEach((u,m)=>{u.notify("AnimationStart",e),n.push(Fo(u,e,{...s,delay:o+l(m)}).then(()=>u.notify("AnimationComplete",e)));}),Promise.all(n)}function xu(t,e){return t.sortNodePosition(e)}function jn(t,e,o={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){let i=e.map(s=>Fo(t,s,o));r=Promise.all(i);}else if(typeof e=="string")r=Fo(t,e,o);else {let i=typeof e=="function"?ct(t,e,o.custom):e;r=Promise.all(Bo(t,i,o));}return r.then(()=>{t.notify("AnimationComplete",e);})}function Br(t,e){if(!Array.isArray(e))return false;let o=e.length;if(o!==t.length)return false;for(let r=0;r<o;r++)if(e[r]!==t[r])return false;return true}var vu=Ae.length;function Fr(t){if(!t)return;if(!t.isControllingVariants){let o=t.parent?Fr(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}let e={};for(let o=0;o<vu;o++){let r=Ae[o],i=t.props[r];(lt(i)||i===false)&&(e[r]=i);}return e}var Tu=[...$e].reverse(),Pu=$e.length;function Su(t){return e=>Promise.all(e.map(({animation:o,options:r})=>jn(t,o,r)))}function Un(t){let e=Su(t),o=Nn(),r=true,i=l=>(u,m)=>{var c;let f=ct(t,m,l==="exit"?(c=t.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:p,transitionEnd:h,...d}=f;u={...u,...d,...h};}return u};function s(l){e=l(t);}function n(l){let{props:u}=t,m=Fr(t.parent)||{},c=[],f=new Set,p={},h=1/0;for(let y=0;y<Pu;y++){let g=Tu[y],v=o[g],T=u[g]!==void 0?u[g]:m[g],A=lt(T),P=g===l?v.isActive:null;P===false&&(h=y);let C=T===m[g]&&T!==u[g]&&A;if(C&&r&&t.manuallyAnimateOnMount&&(C=false),v.protectedKeys={...p},!v.isActive&&P===null||!T&&!v.prevProp||vt(T)||typeof T=="boolean")continue;let I=Vu(v.prevProp,T),V=I||g===l&&v.isActive&&!C&&A||y>h&&A,_=false,X=Array.isArray(T)?T:[T],Ut=X.reduce(i(g),{});P===false&&(Ut={});let{prevResolvedValues:oi={}}=v,Aa={...oi,...Ut},ri=N=>{V=true,f.has(N)&&(_=true,f.delete(N)),v.needsAnimating[N]=true;let st=t.getValue(N);st&&(st.liveStyle=false);};for(let N in Aa){let st=Ut[N],sr=oi[N];if(p.hasOwnProperty(N))continue;let ar=false;De(st)&&De(sr)?ar=!Br(st,sr):ar=st!==sr,ar?st!=null?ri(N):f.add(N):st!==void 0&&f.has(N)?ri(N):v.protectedKeys[N]=true;}v.prevProp=T,v.prevResolvedValues=Ut,v.isActive&&(p={...p,...Ut}),r&&t.blockInitialAnimation&&(V=false),V&&(!(C&&I)||_)&&c.push(...X.map(N=>({animation:N,options:{type:g}})));}if(f.size){let y={};if(typeof u.initial!="boolean"){let g=ct(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(y.transition=g.transition);}f.forEach(g=>{let v=t.getBaseTarget(g),T=t.getValue(g);T&&(T.liveStyle=true),y[g]=v??null;}),c.push({animation:y});}let d=!!c.length;return r&&(u.initial===false||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(d=false),r=false,d?e(c):Promise.resolve()}function a(l,u){var m;if(o[l].isActive===u)return Promise.resolve();(m=t.variantChildren)===null||m===void 0||m.forEach(f=>{var p;return (p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),o[l].isActive=u;let c=n(l);for(let f in o)o[f].protectedKeys={};return c}return {animateChanges:n,setActive:a,setAnimateFunction:s,getState:()=>o,reset:()=>{o=Nn(),r=true;}}}function Vu(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Br(e,t):false}function Ft(t=false){return {isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Nn(){return {animate:Ft(true),whileInView:Ft(),whileHover:Ft(),whileTap:Ft(),whileDrag:Ft(),whileFocus:Ft(),exit:Ft()}}var F=class{constructor(e){this.isMounted=false,this.node=e;}update(){}};var Io=class extends F{constructor(e){super(e),e.animationState||(e.animationState=Un(e));}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();vt(e)&&(this.unmountControls=e.subscribe(this.node));}mount(){this.updateAnimationControlsSubscription();}update(){let{animate:e}=this.node.getProps(),{animate:o}=this.node.prevProps||{};e!==o&&this.updateAnimationControlsSubscription();}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this);}};var bu=0,Oo=class extends F{constructor(){super(...arguments),this.id=bu++;}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:o}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let i=this.node.animationState.setActive("exit",!e);o&&!e&&i.then(()=>{o(this.id);});}mount(){let{register:e,onExitComplete:o}=this.node.presenceContext||{};o&&o(this.id),e&&(this.unmount=e(this.id));}unmount(){}};var Kn={animation:{Feature:Io},exit:{Feature:Oo}};var Z={x:false,y:false};function ko(){return Z.x||Z.y}function _n(t){return t==="x"||t==="y"?Z[t]?null:(Z[t]=true,()=>{Z[t]=false;}):Z.x||Z.y?null:(Z.x=Z.y=true,()=>{Z.x=Z.y=false;})}function pt(t,e,o,r={passive:true}){return t.addEventListener(e,o,r),()=>t.removeEventListener(e,o)}var ge=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==false;function ht(t){return {point:{x:t.pageX,y:t.pageY}}}var Gn=t=>e=>ge(e)&&t(e,ht(e));function dt(t,e,o,r){return pt(t,e,Gn(o),r)}function jo({top:t,left:e,right:o,bottom:r}){return {x:{min:e,max:o},y:{min:t,max:r}}}function $n({x:t,y:e}){return {top:e.min,right:t.max,bottom:e.max,left:t.min}}function Wn(t,e){if(!e)return t;let o=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return {top:o.y,left:o.x,bottom:r.y,right:r.x}}var qn=1e-4,Au=1-qn,Cu=1+qn,Xn=.01,Mu=0-Xn,wu=0+Xn;function B(t){return t.max-t.min}function Zn(t,e,o){return Math.abs(t-e)<=o}function zn(t,e,o,r=.5){t.origin=r,t.originPoint=b(e.min,e.max,t.origin),t.scale=B(o)/B(e),t.translate=b(o.min,o.max,t.origin)-t.originPoint,(t.scale>=Au&&t.scale<=Cu||isNaN(t.scale))&&(t.scale=1),(t.translate>=Mu&&t.translate<=wu||isNaN(t.translate))&&(t.translate=0);}function ye(t,e,o,r){zn(t.x,e.x,o.x,r?r.originX:void 0),zn(t.y,e.y,o.y,r?r.originY:void 0);}function Hn(t,e,o){t.min=o.min+e.min,t.max=t.min+B(e);}function Jn(t,e,o){Hn(t.x,e.x,o.x),Hn(t.y,e.y,o.y);}function Yn(t,e,o){t.min=e.min-o.min,t.max=t.min+B(e);}function xe(t,e,o){Yn(t.x,e.x,o.x),Yn(t.y,e.y,o.y);}var Qn=()=>({translate:0,scale:1,origin:0,originPoint:0}),It=()=>({x:Qn(),y:Qn()}),ts=()=>({min:0,max:0}),D=()=>({x:ts(),y:ts()});function z(t){return [t("x"),t("y")]}function Ir(t){return t===void 0||t===1}function No({scale:t,scaleX:e,scaleY:o}){return !Ir(t)||!Ir(e)||!Ir(o)}function gt(t){return No(t)||Or(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Or(t){return es(t.x)||es(t.y)}function es(t){return t&&t!=="0%"}function ke(t,e,o){let r=t-o,i=e*r;return o+i}function os(t,e,o,r,i){return i!==void 0&&(t=ke(t,i,r)),ke(t,o,r)+e}function kr(t,e=0,o=1,r,i){t.min=os(t.min,e,o,r,i),t.max=os(t.max,e,o,r,i);}function jr(t,{x:e,y:o}){kr(t.x,e.translate,e.scale,e.originPoint),kr(t.y,o.translate,o.scale,o.originPoint);}var rs=.999999999999,is=1.0000000000001;function ss(t,e,o,r=false){let i=o.length;if(!i)return;e.x=e.y=1;let s,n;for(let a=0;a<i;a++){s=o[a],n=s.projectionDelta;let{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ot(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),n&&(e.x*=n.x.scale,e.y*=n.y.scale,jr(t,n)),r&&gt(s.latestValues)&&Ot(t,s.latestValues));}e.x<is&&e.x>rs&&(e.x=1),e.y<is&&e.y>rs&&(e.y=1);}function Ct(t,e){t.min=t.min+e,t.max=t.max+e;}function ns(t,e,o,r,i=.5){let s=b(t.min,t.max,i);kr(t,e,o,s,r);}function Ot(t,e){ns(t.x,e.x,e.scaleX,e.scale,e.originX),ns(t.y,e.y,e.scaleY,e.scale,e.originY);}function Nr(t,e){return jo(Wn(t.getBoundingClientRect(),e))}function as(t,e,o){let r=Nr(t,o),{scroll:i}=e;return i&&(Ct(r.x,i.offset.x),Ct(r.y,i.offset.y)),r}function kt(t,e){let o=`${e}PointerCapture`;if(t.target instanceof Element&&o in t.target&&t.pointerId!==void 0)try{t.target[o](t.pointerId);}catch{}}var ls=(t,e)=>Math.abs(t-e);function us(t,e){let o=ls(t.x,e.x),r=ls(t.y,e.y);return Math.sqrt(o**2+r**2)}var ve=class{constructor(e,o,{transformPagePoint:r,dragSnapToOrigin:i=false}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let m=Kr(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=us(m.offset,{x:0,y:0})>=3;if(!c&&!f)return;let{point:p}=m,{timestamp:h}=E;this.history.push({...p,timestamp:h});let{onStart:d,onMove:y}=this.handlers;c||(d&&d(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,m);},this.handlePointerMove=(m,c)=>{if(this.index=cs(m.currentTarget),m.target instanceof Element&&m.target.hasPointerCapture&&m.pointerId!==void 0)try{if(!m.target.hasPointerCapture(m.pointerId))return}catch{}this.lastMoveEvent=m,this.lastMoveEventInfo=Ur(c,this.transformPagePoint),S.update(this.updatePoint,true);},this.handlePointerUp=(m,c)=>{kt(m,"release"),this.end();let{onEnd:f,onSessionEnd:p,resumeAnimation:h}=this.handlers;if(this.dragSnapToOrigin&&h&&h(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let d=Kr(m.type==="pointercancel"||m.type==="lostpointercapture"?this.lastMoveEventInfo:Ur(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(m,d),p&&p(m,d);},!ge(e))return;this.dragSnapToOrigin=i,this.handlers=o,this.transformPagePoint=r;let s=ht(e),n=Ur(s,this.transformPagePoint),{point:a}=n,{timestamp:l}=E;this.history=[{...a,timestamp:l}];let{onSessionStart:u}=o;u&&u(e,Kr(n,this.history)),kt(e,"set"),this.removeListeners=nt(dt(e.currentTarget,"pointermove",this.handlePointerMove),dt(e.currentTarget,"pointerup",this.handlePointerUp),dt(e.currentTarget,"pointercancel",this.handlePointerUp),dt(e.currentTarget,"lostpointercapture",(m,c)=>{cs(m.currentTarget)!==this.index?kt(m,"set"):this.handlePointerUp(m,c);}));}updateHandlers(e){this.handlers=e;}end(){this.removeListeners&&this.removeListeners(),Y(this.updatePoint);}};function Ur(t,e){return e?{point:e(t.point)}:t}function ms(t,e){return {x:t.x-e.x,y:t.y-e.y}}function Kr({point:t},e){return {point:t,delta:ms(t,fs(e)),offset:ms(t,Du(e)),velocity:Ru(e,.1)}}function Du(t){return t[0]}function fs(t){return t[t.length-1]}function Ru(t,e){if(t.length<2)return {x:0,y:0};let o=t.length-1,r=null,i=fs(t);for(;o>=0&&(r=t[o],!(i.timestamp-r.timestamp>j(e)));)o--;if(!r)return {x:0,y:0};let s=W(i.timestamp-r.timestamp);if(s===0)return {x:0,y:0};let n={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function cs(t){return t.parentNode?Array.from(t.parentNode.children).indexOf(t):-1}function ys(t,{min:e,max:o},r){return e!==void 0&&t<e?t=r?b(e,t,r.min):Math.max(t,e):o!==void 0&&t>o&&(t=r?b(o,t,r.max):Math.min(t,o)),t}function ps(t,e,o){return {min:e!==void 0?t.min+e:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function xs(t,{top:e,left:o,bottom:r,right:i}){return {x:ps(t.x,o,i),y:ps(t.y,e,r)}}function hs(t,e){let o=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([o,r]=[r,o]),{min:o,max:r}}function vs(t,e){return {x:hs(t.x,e.x),y:hs(t.y,e.y)}}function Ts(t,e){let o=.5,r=B(t),i=B(e);return i>r?o=Q(e.min,e.max-r,t.min):r>i&&(o=Q(t.min,t.max-i,e.min)),O(0,1,o)}function Ps(t,e){let o={};return e.min!==void 0&&(o.min=e.min-t.min),e.max!==void 0&&(o.max=e.max-t.min),o}var Uo=.35;function Ss(t=Uo){return t===false?t=0:t===true&&(t=Uo),{x:ds(t,"left","right"),y:ds(t,"top","bottom")}}function ds(t,e,o){return {min:gs(t,e),max:gs(t,o)}}function gs(t,e){return typeof t=="number"?t:t[e]||0}var Eu=new WeakMap,_o=class{constructor(e){this.openDragLock=null,this.isDragging=false,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=false,this.hasMutatedConstraints=false,this.elastic=D(),this.visualElement=e;}start(e,{snapToCursor:o=false}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===false)return;let i=m=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(ht(m).point);},s=(m,c)=>{let{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_n(f),!this.openDragLock))return;this.isDragging=true,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=true,this.visualElement.projection.target=void 0),z(y=>{let g=this.getAxisMotionValue(y).get()||0;if(U.test(g)){let{projection:v}=this.visualElement;if(v&&v.layout){let T=v.layout.layoutBox[y];T&&(g=B(T)*(parseFloat(g)/100));}}this.originPoint[y]=g;}),h&&S.postRender(()=>h(m,c)),Re(this.visualElement,"transform");let{animationState:d}=this.visualElement;d&&d.setActive("whileDrag",true);},n=(m,c)=>{let{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:d}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:y}=c;if(p&&this.currentDirection===null){this.currentDirection=Lu(y),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",c.point,y),this.updateAxis("y",c.point,y),this.visualElement.render(),d&&d(m,c);},a=(m,c)=>this.stop(m,c),l=()=>z(m=>{var c;return this.getAnimationState(m)==="paused"&&((c=this.getAxisMotionValue(m).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ve(e,{onSessionStart:i,onStart:s,onMove:n,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u});}stop(e,o){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:i}=o;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&S.postRender(()=>s(e,o));}cancel(){this.isDragging=false;let{projection:e,animationState:o}=this.visualElement;e&&(e.isAnimationBlocked=false),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),o&&o.setActive("whileDrag",false);}updateAxis(e,o,r){let{drag:i}=this.getProps();if(!r||!Ko(e,i,this.currentDirection))return;let s=this.getAxisMotionValue(e),n=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(n=ys(n,this.constraints[e],this.elastic[e])),s.set(n);}resolveConstraints(){var e;let{dragConstraints:o,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(false):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;o&&ut(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&i?this.constraints=xs(i.layoutBox,o):this.constraints=false,this.elastic=Ss(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&z(n=>{this.constraints!==false&&this.getAxisMotionValue(n)&&(this.constraints[n]=Ps(i.layoutBox[n],this.constraints[n]));});}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:o}=this.getProps();if(!e||!ut(e))return false;let r=e.current;G(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return false;let s=as(r,i.root,this.visualElement.getTransformPagePoint()),n=vs(i.layout.layoutBox,s);if(o){let a=o($n(n));this.hasMutatedConstraints=!!a,a&&(n=jo(a));}return n}startAnimation(e){let{drag:o,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=z(m=>{if(!Ko(m,o,this.currentDirection))return;let c=l&&l[m]||{};n&&(c={min:0,max:0});let f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:r?e[m]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...c};return this.startAxisValueAnimation(m,h)});return Promise.all(u).then(a)}startAxisValueAnimation(e,o){let r=this.getAxisMotionValue(e);return Re(this.visualElement,e),r.start(de(e,r,0,o,this.visualElement,false))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop());}pauseAnimation(){z(e=>{var o;return (o=this.getAxisMotionValue(e).animation)===null||o===void 0?void 0:o.pause()});}getAnimationState(e){var o;return (o=this.getAxisMotionValue(e).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(e){let o=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[o];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){z(o=>{let{drag:r}=this.getProps();if(!Ko(o,r,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(o);if(i&&i.layout){let{min:n,max:a}=i.layout.layoutBox[o];s.set(e[o]-b(n,a,.5));}});}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:o}=this.getProps(),{projection:r}=this.visualElement;if(!ut(o)||!r||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};z(n=>{let a=this.getAxisMotionValue(n);if(a&&this.constraints!==false){let l=a.get();i[n]=Ts({min:l,max:l},this.constraints[n]);}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),z(n=>{if(!Ko(n,e,null))return;let a=this.getAxisMotionValue(n),{min:l,max:u}=this.constraints[n];a.set(b(l,u,i[n]));});}addListeners(){if(!this.visualElement.current)return;Eu.set(this.visualElement,this);let e=this.visualElement.current,o=dt(e,"pointerdown",l=>{let{drag:u,dragListener:m=true}=this.getProps();u&&m&&this.start(l);}),r=()=>{let{dragConstraints:l}=this.getProps();ut(l)&&l.current&&(this.constraints=this.resolveRefConstraints());},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),S.read(r);let n=pt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(z(m=>{let c=this.getAxisMotionValue(m);c&&(this.originPoint[m]+=l[m].translate,c.set(c.get()+l[m].translate));}),this.visualElement.render());});return ()=>{n(),o(),s(),a&&a();}}getProps(){let e=this.visualElement.getProps(),{drag:o=false,dragDirectionLock:r=false,dragPropagation:i=false,dragConstraints:s=false,dragElastic:n=Uo,dragMomentum:a=true}=e;return {...e,drag:o,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:n,dragMomentum:a}}};function Ko(t,e,o){return (e===true||e===t)&&(o===null||o===t)}function Lu(t,e=10){let o=null;return Math.abs(t.y)>e?o="y":Math.abs(t.x)>e&&(o="x"),o}var Go=class extends F{constructor(e){super(e),this.removeGroupControls=R,this.removeListeners=R,this.controls=new _o(e);}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||R;}unmount(){this.removeGroupControls(),this.removeListeners();}};var Vs=t=>(e,o)=>{t&&S.postRender(()=>t(e,o));},$o=class extends F{constructor(){super(...arguments),this.removePointerDownListener=R;}onPointerDown(e){this.session=new ve(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()});}createPanHandlers(){let{onPanSessionStart:e,onPanStart:o,onPan:r,onPanEnd:i}=this.node.getProps();return {onSessionStart:Vs(e),onStart:Vs(o),onMove:r,onEnd:(s,n)=>{delete this.session,i&&S.postRender(()=>i(s,n));}}}mount(){this.removePointerDownListener=dt(this.node.current,"pointerdown",e=>this.onPointerDown(e));}update(){this.session&&this.session.updateHandlers(this.createPanHandlers());}unmount(){this.removePointerDownListener(),this.session&&this.session.end();}};var Te={hasAnimatedSinceResize:true,hasEverUpdated:false};function bs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}var Pe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;let o=bs(t,e.target.x),r=bs(t,e.target.y);return `${o}% ${r}%`}};var As={correct:(t,{treeScale:e,projectionDelta:o})=>{let r=t,i=K.parse(t);if(i.length>5)return r;let s=K.createTransformer(t),n=typeof i[0]!="number"?1:0,a=o.x.scale*e.x,l=o.y.scale*e.y;i[0+n]/=a,i[1+n]/=l;let u=b(a,l,.5);return typeof i[2+n]=="number"&&(i[2+n]/=u),typeof i[3+n]=="number"&&(i[3+n]/=u),s(i)}};var _r=class extends Component{componentDidMount(){let{visualElement:e,layoutGroup:o,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;Vi(Iu),s&&(o.group&&o.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove();}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Te.hasEverUpdated=true;}getSnapshotBeforeUpdate(e){let{layoutDependency:o,visualElement:r,drag:i,isPresent:s}=this.props,n=r.projection;return n&&(n.isPresent=s,i||e.layoutDependency!==o||o===void 0||e.isPresent!==s?n.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?n.promote():n.relegate()||S.postRender(()=>{let a=n.getStack();(!a||!a.members.length)&&this.safeToRemove();}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),$t.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove();}));}componentWillUnmount(){let{visualElement:e,layoutGroup:o,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(i),r&&r.deregister&&r.deregister(i));}safeToRemove(){let{safeToRemove:e}=this.props;e&&e();}render(){return null}};function Wo(t){let[e,o]=ni(),r=useContext(Ne);return jsx(_r,{...t,layoutGroup:r,switchLayoutGroup:useContext(He),isPresent:e,safeToRemove:o})}var Iu={borderRadius:{...Pe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomLeftRadius:Pe,borderBottomRightRadius:Pe,boxShadow:As};function Ms(t,e,o){let r=M(t)?t:ft(t);return r.start(de("",r,e,o)),r.animation}function ws(t){return t instanceof SVGElement&&t.tagName!=="svg"}var Ds=(t,e)=>t.depth-e.depth;var zo=class{constructor(){this.children=[],this.isDirty=false;}add(e){re(this.children,e),this.isDirty=true;}remove(e){ie(this.children,e),this.isDirty=true;}forEach(e){this.isDirty&&this.children.sort(Ds),this.isDirty=false,this.children.forEach(e);}};function Rs(t,e){let o=k.now(),r=({timestamp:i})=>{let s=i-o;s>=e&&(Y(r),t(s-e));};return S.read(r,true),()=>Y(r)}var Fs=["TopLeft","TopRight","BottomLeft","BottomRight"],Ou=Fs.length,Es=t=>typeof t=="string"?parseFloat(t):t,Ls=t=>typeof t=="number"||x.test(t);function Is(t,e,o,r,i,s){i?(t.opacity=b(0,o.opacity!==void 0?o.opacity:1,ku(r)),t.opacityExit=b(e.opacity!==void 0?e.opacity:1,0,ju(r))):s&&(t.opacity=b(e.opacity!==void 0?e.opacity:1,o.opacity!==void 0?o.opacity:1,r));for(let n=0;n<Ou;n++){let a=`border${Fs[n]}Radius`,l=Bs(e,a),u=Bs(o,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ls(l)===Ls(u)?(t[a]=Math.max(b(Es(l),Es(u),r),0),(U.test(u)||U.test(l))&&(t[a]+="%")):t[a]=u;}(e.rotate||o.rotate)&&(t.rotate=b(e.rotate||0,o.rotate||0,r));}function Bs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}var ku=Os(0,.5,yo),ju=Os(.5,.95,R);function Os(t,e,o){return r=>r<t?0:r>e?1:o(Q(t,e,r))}function ks(t,e){t.min=e.min,t.max=e.max;}function q(t,e){ks(t.x,e.x),ks(t.y,e.y);}function Gr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin;}function js(t,e,o,r,i){return t-=e,t=ke(t,1/o,r),i!==void 0&&(t=ke(t,1/i,r)),t}function Nu(t,e=0,o=1,r=.5,i,s=t,n=t){if(U.test(e)&&(e=parseFloat(e),e=b(n.min,n.max,e/100)-n.min),typeof e!="number")return;let a=b(s.min,s.max,r);t===s&&(a-=e),t.min=js(t.min,e,o,a,i),t.max=js(t.max,e,o,a,i);}function Ns(t,e,[o,r,i],s,n){Nu(t,e[o],e[r],e[i],e.scale,s,n);}var Uu=["x","scaleX","originX"],Ku=["y","scaleY","originY"];function $r(t,e,o,r){Ns(t.x,e,Uu,o?o.x:void 0,r?r.x:void 0),Ns(t.y,e,Ku,o?o.y:void 0,r?r.y:void 0);}function Us(t){return t.translate===0&&t.scale===1}function Wr(t){return Us(t.x)&&Us(t.y)}function Ks(t,e){return t.min===e.min&&t.max===e.max}function Gs(t,e){return Ks(t.x,e.x)&&Ks(t.y,e.y)}function _s(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function zr(t,e){return _s(t.x,e.x)&&_s(t.y,e.y)}function Hr(t){return B(t.x)/B(t.y)}function Yr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}var Ho=class{constructor(){this.members=[];}add(e){re(this.members,e),e.scheduleRender();}remove(e){if(ie(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let o=this.members[this.members.length-1];o&&this.promote(o);}}relegate(e){let o=this.members.findIndex(i=>e===i);if(o===0)return false;let r;for(let i=o;i>=0;i--){let s=this.members[i];if(s.isPresent!==false){r=s;break}}return r?(this.promote(r),true):false}promote(e,o){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,o&&(e.resumeFrom.preserveOpacity=true),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=true);let{crossfade:i}=e.options;i===false&&r.hide();}}exitAnimationComplete(){this.members.forEach(e=>{let{options:o,resumingFrom:r}=e;o.onExitComplete&&o.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete();});}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(false);});}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0);}};function $s(t,e,o){let r="",i=t.x.translate/e.x,s=t.y.translate/e.y,n=o?.z||0;if((i||s||n)&&(r=`translate3d(${i}px, ${s}px, ${n}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),o){let{transformPerspective:u,rotate:m,rotateX:c,rotateY:f,skewX:p,skewY:h}=o;u&&(r=`perspective(${u}px) ${r}`),m&&(r+=`rotate(${m}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),h&&(r+=`skewY(${h}deg) `);}let a=t.x.scale*e.x,l=t.y.scale*e.y;return (a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}var qr=["","X","Y","Z"],_u={visibility:"hidden"},Ws=1e3,Gu=0;function Xr(t,e,o,r){let{latestValues:i}=e;i[t]&&(o[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0));}function Qs(t){if(t.hasCheckedOptimisedAppear=true,t.root===t)return;let{visualElement:e}=t.options;if(!e)return;let o=so(e);if(window.MotionHasOptimisedAnimation(o,"transform")){let{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(o,"transform",S,!(i||s));}let{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Qs(r);}function Yo({attachResizeListener:t,defaultParent:e,measureScroll:o,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(n={},a=e?.()){this.id=Gu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=false,this.isAnimationBlocked=false,this.isLayoutDirty=false,this.isProjectionDirty=false,this.isSharedProjectionDirty=false,this.isTransformDirty=false,this.updateManuallyBlocked=false,this.updateBlockedByResize=false,this.isUpdating=false,this.isSVG=false,this.needsReset=false,this.shouldResetTransform=false,this.hasCheckedOptimisedAppear=false,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=false,this.updateScheduled=false,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=false,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=false,this.clearAllSnapshots());},this.updateProjection=()=>{this.projectionUpdateScheduled=false,this.nodes.forEach(zu),this.nodes.forEach(Zu),this.nodes.forEach(Ju),this.nodes.forEach(Hu);},this.resolvedRelativeTargetAt=0,this.hasProjected=false,this.isVisible=true,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=true;this.root===this&&(this.nodes=new zo);}addEventListener(n,a){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Tt),this.eventHandlers.get(n).add(a)}notifyListeners(n,...a){let l=this.eventHandlers.get(n);l&&l.notify(...a);}hasListeners(n){return this.eventHandlers.has(n)}mount(n,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ws(n),this.instance=n;let{layoutId:l,layout:u,visualElement:m}=this.options;if(m&&!m.current&&m.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=true),t){let c,f=()=>this.root.updateBlockedByResize=false;t(n,()=>{this.root.updateBlockedByResize=true,c&&c(),c=Rs(f,250),Te.hasAnimatedSinceResize&&(Te.hasAnimatedSinceResize=false,this.nodes.forEach(Hs));});}l&&this.root.registerSharedNode(l,this),this.options.animate!==false&&m&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let d=this.options.transition||m.getDefaultTransition()||rm,{onLayoutAnimationStart:y,onLayoutAnimationComplete:g}=m.getProps(),v=!this.targetLayout||!zr(this.targetLayout,h),T=!f&&p;if(this.options.layoutRoot||this.resumeFrom||T||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,T);let A={...oe(d,"layout"),onPlay:y,onComplete:g};(m.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=false),this.startAnimation(A);}else f||Hs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h;});}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Y(this.updateProjection);}blockUpdate(){this.updateManuallyBlocked=true;}unblockUpdate(){this.updateManuallyBlocked=false;}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||false}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=true,this.nodes&&this.nodes.forEach(Qu),this.animationId++);}getTransformTemplate(){let{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=true){if(this.root.hasTreeAnimated=true,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Qs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=true;for(let m=0;m<this.path.length;m++){let c=this.path[m];c.shouldResetTransform=true,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(false);}let{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate");}update(){if(this.updateScheduled=false,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(zs);return}this.isUpdating||this.nodes.forEach(qu),this.isUpdating=false,this.nodes.forEach(Xu),this.nodes.forEach($u),this.nodes.forEach(Wu),this.clearAllSnapshots();let a=k.now();E.delta=O(0,1e3/60,a-E.timestamp),E.timestamp=a,E.isProcessing=true,_e.update.process(E),_e.preRender.process(E),_e.render.process(E),E.isProcessing=false;}didUpdate(){this.updateScheduled||(this.updateScheduled=true,$t.read(this.scheduleUpdate));}clearAllSnapshots(){this.nodes.forEach(Yu),this.sharedNodes.forEach(tm);}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=true,S.preRender(this.updateProjection,false,true));}scheduleCheckAfterUnmount(){S.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed();});}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!B(this.snapshot.measuredBox.x)&&!B(this.snapshot.measuredBox.y)&&(this.snapshot=void 0));}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let n=this.layout;this.layout=this.measure(false),this.layoutCorrected=D(),this.isLayoutDirty=false,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0);}updateScroll(n="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(a=false),a){let l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:l,offset:o(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l};}}resetTransform(){if(!i)return;let n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Wr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,m=u!==this.prevTransformTemplateValue;n&&(a||gt(this.latestValues)||m)&&(i(this.instance,u),this.shouldResetTransform=false,this.scheduleRender());}measure(n=true){let a=this.measurePageBox(),l=this.removeElementScroll(a);return n&&(l=this.removeTransform(l)),im(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var n;let{visualElement:a}=this.options;if(!a)return D();let l=a.measureViewportBox();if(!(((n=this.scroll)===null||n===void 0?void 0:n.wasRoot)||this.path.some(nm))){let{scroll:m}=this.root;m&&(Ct(l.x,m.offset.x),Ct(l.y,m.offset.y));}return l}removeElementScroll(n){var a;let l=D();if(q(l,n),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){let m=this.path[u],{scroll:c,options:f}=m;m!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&q(l,n),Ct(l.x,c.offset.x),Ct(l.y,c.offset.y));}return l}applyTransform(n,a=false){let l=D();q(l,n);for(let u=0;u<this.path.length;u++){let m=this.path[u];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&Ot(l,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),gt(m.latestValues)&&Ot(l,m.latestValues);}return gt(this.latestValues)&&Ot(l,this.latestValues),l}removeTransform(n){let a=D();q(a,n);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!gt(u.latestValues))continue;No(u.latestValues)&&u.updateSnapshot();let m=D(),c=u.measurePageBox();q(m,c),$r(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,m);}return gt(this.latestValues)&&$r(a,this.latestValues),a}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=true;}setOptions(n){this.options={...this.options,...n,crossfade:n.crossfade!==void 0?n.crossfade:true};}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=false;}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==E.timestamp&&this.relativeParent.resolveTargetDelta(true);}resolveTargetDelta(n=false){var a;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(n||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=E.timestamp,!this.targetDelta&&!this.relativeTarget){let p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),xe(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),q(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=D(),this.targetWithTransforms=D()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Jn(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):q(this.target,this.layout.layoutBox),jr(this.target,this.targetDelta)):q(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=false;let p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),xe(this.relativeTargetOrigin,this.target,p.target),q(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0;}}}}getClosestProjectingParent(){if(!(!this.parent||No(this.parent.latestValues)||Or(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return !!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var n;let a=this.getLead(),l=!!this.resumingFrom||this!==a,u=true;if((this.isProjectionDirty||!((n=this.parent)===null||n===void 0)&&n.isProjectionDirty)&&(u=false),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=false),this.resolvedRelativeTargetAt===E.timestamp&&(u=false),u)return;let{layout:m,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||c))return;q(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,p=this.treeScale.y;ss(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=D());let{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gr(this.prevProjectionDelta.x,this.projectionDelta.x),Gr(this.prevProjectionDelta.y,this.projectionDelta.y)),ye(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Yr(this.projectionDelta.x,this.prevProjectionDelta.x)||!Yr(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=true,this.scheduleRender(),this.notifyListeners("projectionUpdate",h));}hide(){this.isVisible=false;}show(){this.isVisible=true;}scheduleRender(n=true){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),n){let l=this.getStack();l&&l.scheduleRender();}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0);}createProjectionDeltas(){this.prevProjectionDelta=It(),this.projectionDelta=It(),this.projectionDeltaWithTransform=It();}setAnimationOrigin(n,a=false){let l=this.snapshot,u=l?l.latestValues:{},m={...this.latestValues},c=It();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let f=D(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,d=p!==h,y=this.getStack(),g=!y||y.members.length<=1,v=!!(d&&!g&&this.options.crossfade===true&&!this.path.some(om));this.animationProgress=0;let T;this.mixTargetDelta=A=>{let P=A/1e3;Ys(c.x,n.x,P),Ys(c.y,n.y,P),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xe(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),em(this.relativeTarget,this.relativeTargetOrigin,f,P),T&&Gs(this.relativeTarget,T)&&(this.isProjectionDirty=false),T||(T=D()),q(T,this.relativeTarget)),d&&(this.animationValues=m,Is(m,u,this.latestValues,P,v,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P;},this.mixTargetDelta(this.options.layoutRoot?1e3:0);}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=S.update(()=>{Te.hasAnimatedSinceResize=true,this.currentAnimation=Ms(0,Ws,{...n,onUpdate:a=>{this.mixTargetDelta(a),n.onUpdate&&n.onUpdate(a);},onStop:()=>{},onComplete:()=>{n.onComplete&&n.onComplete(),this.completeAnimation();}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0;});}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete");}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ws),this.currentAnimation.stop()),this.completeAnimation();}applyTransformsToTarget(){let n=this.getLead(),{targetWithTransforms:a,target:l,layout:u,latestValues:m}=n;if(!(!a||!l||!u)){if(this!==n&&this.layout&&u&&ta(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||D();let c=B(this.layout.layoutBox.x);l.x.min=n.target.x.min,l.x.max=l.x.min+c;let f=B(this.layout.layoutBox.y);l.y.min=n.target.y.min,l.y.max=l.y.min+f;}q(a,l),Ot(a,m),ye(this.projectionDeltaWithTransform,this.layoutCorrected,a,m);}}registerSharedNode(n,a){this.sharedNodes.has(n)||this.sharedNodes.set(n,new Ho),this.sharedNodes.get(n).add(a);let u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0});}isLead(){let n=this.getStack();return n?n.lead===this:true}getLead(){var n;let{layoutId:a}=this.options;return a?((n=this.getStack())===null||n===void 0?void 0:n.lead)||this:this}getPrevLead(){var n;let{layoutId:a}=this.options;return a?(n=this.getStack())===null||n===void 0?void 0:n.prevLead:void 0}getStack(){let{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:a,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),n&&(this.projectionDelta=void 0,this.needsReset=true),a&&this.setOptions({transition:a});}relegate(){let n=this.getStack();return n?n.relegate(this):false}resetSkewAndRotation(){let{visualElement:n}=this.options;if(!n)return;let a=false,{latestValues:l}=n;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=true),!a)return;let u={};l.z&&Xr("z",n,u,this.animationValues);for(let m=0;m<qr.length;m++)Xr(`rotate${qr[m]}`,n,u,this.animationValues),Xr(`skew${qr[m]}`,n,u,this.animationValues);n.render();for(let m in u)n.setStaticValue(m,u[m]),this.animationValues&&(this.animationValues[m]=u[m]);n.scheduleRender();}getProjectionStyles(n){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _u;let u={visibility:""},m=this.getTransformTemplate();if(this.needsReset)return this.needsReset=false,u.opacity="",u.pointerEvents=te(n?.pointerEvents)||"",u.transform=m?m(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let d={};return this.options.layoutId&&(d.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,d.pointerEvents=te(n?.pointerEvents)||""),this.hasProjected&&!gt(this.latestValues)&&(d.transform=m?m({},""):"none",this.hasProjected=false),d}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=$s(this.projectionDeltaWithTransform,this.treeScale,f),m&&(u.transform=m(f,u.transform));let{x:p,y:h}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${h.origin*100}% 0`,c.animationValues?u.opacity=c===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let d in Dt){if(f[d]===void 0)continue;let{correct:y,applyTo:g,isCSSVariable:v}=Dt[d],T=u.transform==="none"?f[d]:y(f[d],c);if(g){let A=g.length;for(let P=0;P<A;P++)u[g[P]]=T;}else v?this.options.visualElement.renderState.vars[d]=T:u[d]=T;}return this.options.layoutId&&(u.pointerEvents=c===this?te(n?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0;}resetTree(){this.root.nodes.forEach(n=>{var a;return (a=n.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(zs),this.root.sharedNodes.clear();}}}function $u(t){t.updateLayout();}function Wu(t){var e;let o=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,n=o.source!==t.layout.source;s==="size"?z(c=>{let f=n?o.measuredBox[c]:o.layoutBox[c],p=B(f);f.min=r[c].min,f.max=f.min+p;}):ta(s,o.layoutBox,r)&&z(c=>{let f=n?o.measuredBox[c]:o.layoutBox[c],p=B(r[c]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=true,t.relativeTarget[c].max=t.relativeTarget[c].min+p);});let a=It();ye(a,r,o.layoutBox);let l=It();n?ye(l,t.applyTransform(i,true),o.measuredBox):ye(l,r,o.layoutBox);let u=!Wr(a),m=false;if(!t.resumeFrom){let c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:p}=c;if(f&&p){let h=D();xe(h,o.layoutBox,f.layoutBox);let d=D();xe(d,r,p.layoutBox),zr(h,d)||(m=true),c.options.layoutRoot&&(t.relativeTarget=d,t.relativeTargetOrigin=h,t.relativeParent=c);}}}t.notifyListeners("didUpdate",{layout:r,snapshot:o,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:m});}else if(t.isLead()){let{onExitComplete:r}=t.options;r&&r();}t.options.transition=void 0;}function zu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty));}function Hu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=false;}function Yu(t){t.clearSnapshot();}function zs(t){t.clearMeasurements();}function qu(t){t.isLayoutDirty=false;}function Xu(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform();}function Hs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=true;}function Zu(t){t.resolveTargetDelta();}function Ju(t){t.calcProjection();}function Qu(t){t.resetSkewAndRotation();}function tm(t){t.removeLeadSnapshot();}function Ys(t,e,o){t.translate=b(e.translate,0,o),t.scale=b(e.scale,1,o),t.origin=e.origin,t.originPoint=e.originPoint;}function qs(t,e,o,r){t.min=b(e.min,o.min,r),t.max=b(e.max,o.max,r);}function em(t,e,o,r){qs(t.x,e.x,o.x,r),qs(t.y,e.y,o.y,r);}function om(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}var rm={duration:.45,ease:[.4,0,.1,1]},Xs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Zs=Xs("applewebkit/")&&!Xs("chrome/")?Math.round:R;function Js(t){t.min=Zs(t.min),t.max=Zs(t.max);}function im(t){Js(t.x),Js(t.y);}function ta(t,e,o){return t==="position"||t==="preserve-aspect"&&!Zn(Hr(e),Hr(o),.2)}function nm(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}var ea=Yo({attachResizeListener:(t,e)=>pt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>true});var Zr={current:void 0},qo=Yo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Zr.current){let t=new ea({});t.mount(window),t.setOptions({layoutScroll:true}),Zr.current=t;}return Zr.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none";},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});var oa={pan:{Feature:$o},drag:{Feature:Go,ProjectionNode:qo,MeasureLayout:Wo}};function ra(t,e,o){var r;if(t instanceof EventTarget)return [t];if(typeof t=="string"){let i=document;let s=(r=o?.[t])!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function Xo(t,e){let o=ra(t),r=new AbortController,i={passive:true,...e,signal:r.signal};return [o,i,()=>r.abort()]}function ia(t){return !(t.pointerType==="touch"||ko())}function na(t,e,o={}){let[r,i,s]=Xo(t,o),n=a=>{if(!ia(a))return;let{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;let m=c=>{ia(c)&&(u(c),l.removeEventListener("pointerleave",m));};l.addEventListener("pointerleave",m,i);};return r.forEach(a=>{a.addEventListener("pointerenter",n,i);}),s}function sa(t,e,o){let{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",o==="Start");let i="onHover"+o,s=r[i];s&&S.postRender(()=>s(e,ht(e)));}var Zo=class extends F{mount(){let{current:e}=this.node;e&&(this.unmount=na(e,(o,r)=>(sa(this.node,r,"Start"),i=>sa(this.node,i,"End"))));}unmount(){}};var Jo=class extends F{constructor(){super(...arguments),this.isActive=false;}onFocus(){let e=false;try{e=this.node.current.matches(":focus-visible");}catch{e=true;}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",true),this.isActive=true);}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",false),this.isActive=false);}mount(){this.unmount=nt(pt(this.node.current,"focus",()=>this.onFocus()),pt(this.node.current,"blur",()=>this.onBlur()));}unmount(){}};var Jr=(t,e)=>e?t===e?true:Jr(t,e.parentElement):false;var sm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function aa(t){return sm.has(t.tagName)||t.tabIndex!==-1}var Nt=new WeakSet;function la(t){return e=>{e.key==="Enter"&&t(e);}}function Qr(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:true,bubbles:true}));}var ua=(t,e)=>{let o=t.currentTarget;if(!o)return;let r=la(()=>{if(Nt.has(o))return;Qr(o,"down");let i=la(()=>{Qr(o,"up");}),s=()=>Qr(o,"cancel");o.addEventListener("keyup",i,e),o.addEventListener("blur",s,e);});o.addEventListener("keydown",r,e),o.addEventListener("blur",()=>o.removeEventListener("keydown",r),e);};function ma(t){return ge(t)&&!ko()}function ca(t,e,o={}){let[r,i,s]=Xo(t,o),n=a=>{let l=a.currentTarget;if(!l||!ma(a)||Nt.has(l))return;Nt.add(l),kt(a,"set");let u=e(l,a),m=(p,h)=>{l.removeEventListener("pointerup",c),l.removeEventListener("pointercancel",f),kt(p,"release"),!(!ma(p)||!Nt.has(l))&&(Nt.delete(l),typeof u=="function"&&u(p,{success:h}));},c=p=>{(p.isTrusted?am(p,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):false)?m(p,false):m(p,!(l instanceof Element)||Jr(l,p.target));},f=p=>{m(p,false);};l.addEventListener("pointerup",c,i),l.addEventListener("pointercancel",f,i),l.addEventListener("lostpointercapture",f,i);};return r.forEach(a=>{a=o.useGlobalTarget?window:a;let l=false;a instanceof HTMLElement&&(l=true,!aa(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",n,i),l&&a.addEventListener("focus",u=>ua(u,i),i);}),s}function am(t,e){return t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom}function fa(t,e,o){let{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",o==="Start");let i="onTap"+(o==="End"?"":o),s=r[i];s&&S.postRender(()=>s(e,ht(e)));}var Qo=class extends F{mount(){let{current:e}=this.node;e&&(this.unmount=ca(e,(o,r)=>(fa(this.node,r,"Start"),(i,{success:s})=>fa(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}));}unmount(){}};var ei=new WeakMap,ti=new WeakMap,lm=t=>{let e=ei.get(t.target);e&&e(t);},um=t=>{t.forEach(lm);};function mm({root:t,...e}){let o=t||document;ti.has(o)||ti.set(o,{});let r=ti.get(o),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(um,{root:t,...e})),r[i]}function pa(t,e,o){let r=mm(e);return ei.set(t,o),r.observe(t),()=>{ei.delete(t),r.unobserve(t);}}var cm={some:0,all:1},tr=class extends F{constructor(){super(...arguments),this.hasEnteredView=false,this.isInView=false;}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:o,margin:r,amount:i="some",once:s}=e,n={root:o?o.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:cm[i]},a=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=true),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:m,onViewportLeave:c}=this.node.getProps(),f=u?m:c;f&&f(l);};return pa(this.node.current,n,a)}mount(){this.startObserver();}update(){if(typeof IntersectionObserver>"u")return;let{props:e,prevProps:o}=this.node;["amount","margin","root"].some(fm(e,o))&&this.startObserver();}unmount(){}};function fm({viewport:t={}},{viewport:e={}}={}){return o=>t[o]!==e[o]}var ha={inView:{Feature:tr},tap:{Feature:Qo},focus:{Feature:Jo},hover:{Feature:Zo}};var da={layout:{ProjectionNode:qo,MeasureLayout:Wo}};var je={current:null},er={current:false};function ga(){if(er.current=true,!!_t)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>je.current=t.matches;t.addListener(e),e();}else je.current=false;}var pm=[...br,L,K],ya=t=>pm.find(Vo(t));var xa=new WeakMap;function va(t,e,o){for(let r in e){let i=e[r],s=o[r];if(M(i))t.addValue(r,i),process.env.NODE_ENV==="development"&&yt(i.version==="12.4.10",`Attempting to mix Motion versions ${i.version} with 12.4.10 may not work as expected.`);else if(M(s))t.addValue(r,ft(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){let n=t.getValue(r);n.liveStyle===true?n.jump(i):n.hasAnimated||n.set(i);}else {let n=t.getStaticValue(r);t.addValue(r,ft(n!==void 0?n:i,{owner:t}));}}for(let r in o)e[r]===void 0&&t.removeValue(r);return e}var Ta=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],or=class{scrapeMotionValuesFromProps(e,o,r){return {}}constructor({parent:e,props:o,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:n},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let p=k.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,S.render(this.render,false,true));};let{latestValues:l,renderState:u,onUpdate:m}=n;this.onUpdate=m,this.latestValues=l,this.baseTarget={...l},this.initialValues=o.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=o,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=wt(o),this.isVariantNode=We(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(o,{},this);for(let p in f){let h=f[p];l[p]!==void 0&&M(h)&&h.set(l[p],false);}}mount(e){this.current=e,xa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,r)=>this.bindToMotionValue(r,o)),er.current||ga(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:je.current,process.env.NODE_ENV!=="production"&&yt(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let o=this.features[e];o&&(o.unmount(),o.isMounted=false);}this.current=null;}bindToMotionValue(e,o){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let r=$.has(e);r&&this.onBindTransform&&this.onBindTransform();let i=o.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&S.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=true);}),s=o.on("renderRequest",this.scheduleRender),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,o)),this.valueSubscriptions.set(e,()=>{i(),s(),n&&n(),o.owner&&o.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in at){let o=at[e];if(!o)continue;let{isEnabled:r,Feature:i}=o;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){let s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):D()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,o){this.latestValues[e]=o;}update(e,o){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let r=0;r<Ta.length;r++){let i=Ta[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,n=e[s];n&&(this.propEventSubscriptions[i]=this.on(i,n));}this.prevMotionValues=va(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this);}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(e),()=>o.variantChildren.delete(e)}addValue(e,o){let r=this.values.get(e);o!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,o),this.values.set(e,o),this.latestValues[e]=o.get());}removeValue(e){this.values.delete(e);let o=this.valueSubscriptions.get(e);o&&(o(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,o){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&o!==void 0&&(r=ft(o===null?void 0:o,{owner:this}),this.addValue(e,r)),r}readValue(e,o){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(So(i)||vo(i))?i=parseFloat(i):!ya(i)&&K.test(o)&&(i=Po(e,o)),this.setBaseTarget(e,M(i)?i.get():i)),M(i)?i.get():i}setBaseTarget(e,o){this.baseTarget[e]=o;}getBaseTarget(e){var o;let{initial:r}=this.props,i;if(typeof r=="string"||typeof r=="object"){let n=Qt(this.props,r,(o=this.presenceContext)===null||o===void 0?void 0:o.custom);n&&(i=n[e]);}if(r&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!M(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,o){return this.events[e]||(this.events[e]=new Tt),this.events[e].add(o)}notify(e,...o){this.events[e]&&this.events[e].notify(...o);}};var Se=class extends or{constructor(){super(...arguments),this.KeyframeResolver=ce;}sortInstanceNodePosition(e,o){return e.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(e,o){return e.style?e.style[o]:void 0}removeValueFromRenderState(e,{vars:o,style:r}){delete o[e],delete r[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;M(e)&&(this.childSubscription=e.on("change",o=>{this.current&&(this.current.textContent=`${o}`);}));}};function hm(t){return window.getComputedStyle(t)}var rr=class extends Se{constructor(){super(...arguments),this.type="html",this.renderInstance=Qe;}readValueFromInstance(e,o){if($.has(o)){let r=me(o);return r&&r.default||0}else {let r=hm(e),i=(Wt(o)?r.getPropertyValue(o):r[o])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:o}){return Nr(e,o)}build(e,o,r){Yt(e,o,r.transformTemplate);}scrapeMotionValuesFromProps(e,o,r){return ee(e,o,r)}};var ir=class extends Se{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=D,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Je(this.current,this.renderState);};}getBaseTargetFromProps(e,o){return e[o]}readValueFromInstance(e,o){if($.has(o)){let r=me(o);return r&&r.default||0}return o=to.has(o)?o:Gt(o),e.getAttribute(o)}scrapeMotionValuesFromProps(e,o,r){return oo(e,o,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&S.postRender(this.updateDimensions);}build(e,o,r){Zt(e,o,this.isSVGTag,r.transformTemplate);}renderInstance(e,o,r,i){eo(e,o,r,i);}mount(e){this.isSVGTag=Jt(e.tagName),super.mount(e);}};var Pa=(t,e)=>Xt(t)?new ir(e):new rr(e,{allowProjection:t!==Fragment});var Sa=Gi({...Kn,...ha,...oa,...da},Pa);var nr=pi(Sa);function gm({children:t,className:e,characterVariants:o,dadElement:r,onCharacterAnimationComplete:i,key:s}){if(typeof t=="string"){let n=t.split("").map((a,l)=>{let u=useRef(null);return jsx(nr.span,{ref:u,className:e,variants:o,onAnimationComplete:i?()=>{i(u);}:void 0,children:a},`span-${s}-${a}-${l}`)});return r(n,true)}else if(Array.isArray(t)){let n=t.map(a=>typeof a=="string"?a.split("").map((u,m)=>{let c=useRef(null);return jsx(nr.span,{ref:c,className:e,variants:o,onAnimationComplete:i?()=>{i(c);}:void 0,children:u},`span-${s}-${u}-${m}`)}):a);return r(n)}return r(t,true)}export{gm as default};