@tenedev/toast 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/toast.mjs ADDED
@@ -0,0 +1,20 @@
1
+ import{jsx as t,Fragment as e,jsxs as n}from"react/jsx-runtime";import*as i from"react";import{createContext as s,useRef as o,useId as r,useContext as a,useInsertionEffect as l,useCallback as u,useMemo as c,useEffect as h,Children as d,isValidElement as p,useLayoutEffect as m,useState as f,forwardRef as v,Fragment as g,createElement as y,Component as x}from"react";function w(t,e,n){if(n||2===arguments.length)for(var i,s=0,o=e.length;s<o;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}("@import 'tailwindcss';\n"),"function"==typeof SuppressedError&&SuppressedError;var P=function(){},T=function(t){P(t,{type:"message"})};T.setAddToast=function(t){P=t},T.success=function(t){return P(t,{type:"success"})},T.error=function(t){return P(t,{type:"error"})},T.info=function(t){return P(t,{type:"info"})},T.warning=function(t){return P(t,{type:"warning"})},T.message=function(t){return P(t,{type:"message"})};var S=Object.assign(T,T);const b=s({});function A(t){const e=o(null);return null===e.current&&(e.current=t()),e.current}const E=s(null),V=s({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class M extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=t instanceof HTMLElement&&t.offsetWidth||0,i=this.props.sizeRef.current;i.height=e.offsetHeight||0,i.width=e.offsetWidth||0,i.top=e.offsetTop,i.left=e.offsetLeft,i.right=n-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function C({children:e,isPresent:n,anchorX:s}){const u=r(),c=o(null),h=o({width:0,height:0,top:0,left:0,right:0}),{nonce:d}=a(V);return l((()=>{const{width:t,height:e,top:i,left:o,right:r}=h.current;if(n||!c.current||!t||!e)return;const a="left"===s?`left: ${o}`:`right: ${r}`;c.current.dataset.motionPopId=u;const l=document.createElement("style");return d&&(l.nonce=d),document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${u}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${a}px !important;\n top: ${i}px !important;\n }\n `),()=>{document.head.removeChild(l)}}),[n]),t(M,{isPresent:n,childRef:c,sizeRef:h,children:i.cloneElement(e,{ref:c})})}const D=({children:e,initial:n,isPresent:s,onExitComplete:o,custom:a,presenceAffectsLayout:l,mode:h,anchorX:d})=>{const p=A(k),m=r(),f=u((t=>{p.set(t,!0);for(const t of p.values())if(!t)return;o&&o()}),[p,o]),v=c((()=>({id:m,initial:n,isPresent:s,custom:a,onExitComplete:f,register:t=>(p.set(t,!1),()=>p.delete(t))})),l?[Math.random(),f]:[s,f]);return c((()=>{p.forEach(((t,e)=>p.set(e,!1)))}),[s]),i.useEffect((()=>{!s&&!p.size&&o&&o()}),[s]),"popLayout"===h&&(e=t(C,{isPresent:s,anchorX:d,children:e})),t(E.Provider,{value:v,children:e})};function k(){return new Map}function R(t=!0){const e=a(E);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,o=r();h((()=>{t&&s(o)}),[t]);const l=u((()=>t&&i&&i(o)),[o,i,t]);return!n&&i?[!1,l]:[!0]}const L=t=>t.key||"";function B(t){const e=[];return d.forEach(t,(t=>{p(t)&&e.push(t)})),e}const j="undefined"!=typeof window,F=j?m:h,O=({children:n,custom:i,initial:s=!0,onExitComplete:r,presenceAffectsLayout:l=!0,mode:u="sync",propagate:h=!1,anchorX:d="left"})=>{const[p,m]=R(h),v=c((()=>B(n)),[n]),g=h&&!p?[]:v.map(L),y=o(!0),x=o(v),w=A((()=>new Map)),[P,T]=f(v),[S,E]=f(v);F((()=>{y.current=!1,x.current=v;for(let t=0;t<S.length;t++){const e=L(S[t]);g.includes(e)?w.delete(e):!0!==w.get(e)&&w.set(e,!1)}}),[S,g.length,g.join("-")]);const V=[];if(v!==P){let t=[...v];for(let e=0;e<S.length;e++){const n=S[e],i=L(n);g.includes(i)||(t.splice(e,0,n),V.push(n))}return"wait"===u&&V.length&&(t=V),E(B(t)),T(v),null}"production"!==process.env.NODE_ENV&&"wait"===u&&S.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:M}=a(b);return t(e,{children:S.map((e=>{const n=L(e),o=!(h&&!p)&&(v===S||g.includes(n));return t(D,{isPresent:o,initial:!(y.current&&!s)&&void 0,custom:i,presenceAffectsLayout:l,mode:u,onExitComplete:o?void 0:()=>{if(!w.has(n))return;w.set(n,!0);let t=!0;w.forEach((e=>{e||(t=!1)})),t&&(null==M||M(),E(x.current),h&&(null==m||m()),r&&r())},anchorX:d,children:e},n)}))})},I=t=>t;let N=I,U=I;"production"!==process.env.NODE_ENV&&(N=(t,e)=>{t||"undefined"==typeof console||console.warn(e)},U=(t,e)=>{if(!t)throw new Error(e)});const $=!1,W=["read","resolveKeyframes","update","preRender","render","postRender"],z={value:null};function Y(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=W.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){r.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(u),e&&z.value&&z.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,c.process(t)))}};return c}(o,e?n:void 0),t)),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=r,p=()=>{const o=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),h.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:W.reduce(((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e}),{}),cancel:t=>{for(let e=0;e<W.length;e++)r[W[e]].cancel(t)},state:s,steps:r}}const{schedule:X,cancel:K,state:H,steps:G}=Y("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:I,!0),q=s({strict:!1}),_={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"]},Z={};for(const t in _)Z[t]={isEnabled:e=>_[t].some((t=>!!e[t]))};const J=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 Q(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||J.has(t)}let tt=t=>!Q(t);try{(et=require("@emotion/is-prop-valid").default)&&(tt=t=>t.startsWith("on")?!Q(t):et(t))}catch(t){}var et;const nt=new Set;function it(t,e,n){t||nt.has(e)||(console.warn(e),nt.add(e))}function st(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy(((...e)=>("production"!==process.env.NODE_ENV&&it(!1,"motion() is deprecated. Use motion.create() instead."),t(...e))),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const ot=s({});function rt(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function at(t){return"string"==typeof t||Array.isArray(t)}const lt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ut=["initial",...lt];function ct(t){return rt(t.animate)||ut.some((e=>at(t[e])))}function ht(t){return Boolean(ct(t)||t.variants)}function dt(t){const{initial:e,animate:n}=function(t,e){if(ct(t)){const{initial:e,animate:n}=t;return{initial:!1===e||at(e)?e:void 0,animate:at(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,a(ot));return c((()=>({initial:e,animate:n})),[pt(e),pt(n)])}function pt(t){return Array.isArray(t)?t.join(" "):t}const mt=Symbol.for("motionComponentSymbol");function ft(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function vt(t,e,n){return u((i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):ft(n)&&(n.current=i))}),[e])}const gt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yt="data-"+gt("framerAppearId"),{schedule:xt}=Y(queueMicrotask,!1),wt=s({});function Pt(t,e,n,i,s){var r,u;const{visualElement:c}=a(ot),d=a(q),p=a(E),m=a(V).reducedMotion,f=o(null);i=i||d.renderer,!f.current&&i&&(f.current=i(t,{visualState:e,parent:c,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:m}));const v=f.current,g=a(wt);!v||v.projection||!s||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Tt(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&ft(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(f.current,n,s,g);const y=o(!1);l((()=>{v&&y.current&&v.update(n,p)}));const x=n[yt],w=o(Boolean(x)&&!(null===(r=window.MotionHandoffIsComplete)||void 0===r?void 0:r.call(window,x))&&(null===(u=window.MotionHasOptimisedAnimation)||void 0===u?void 0:u.call(window,x)));return F((()=>{v&&(y.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),xt.render(v.render),w.current&&v.animationState&&v.animationState.animateChanges())})),h((()=>{v&&(!w.current&&v.animationState&&v.animationState.animateChanges(),w.current&&(queueMicrotask((()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)})),w.current=!1))})),v}function Tt(t){if(t)return!1!==t.options.allowProjection?t.projection:Tt(t.parent)}function St({preloadedFeatures:e,createVisualElement:i,useRender:s,useVisualState:o,Component:r}){var l,u;function c(l,u){let c;const h={...a(V),...l,layoutId:bt(l)},{isStatic:d}=h,p=dt(l),m=o(l,d);if(!d&&j){!function(t,e){const n=a(q).strict;if("production"!==process.env.NODE_ENV&&e&&n){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?N(!1,e):U(!1,e)}}(h,e);const t=function(t){const{drag:e,layout:n}=Z;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);c=t.MeasureLayout,p.visualElement=Pt(r,m,h,i,t.ProjectionNode)}return n(ot.Provider,{value:p,children:[c&&p.visualElement?t(c,{visualElement:p.visualElement,...h}):null,s(r,l,vt(m,p.visualElement,u),m,d,p.visualElement)]})}e&&function(t){for(const e in t)Z[e]={...Z[e],...t[e]}}(e),c.displayName=`motion.${"string"==typeof r?r:`create(${null!==(u=null!==(l=r.displayName)&&void 0!==l?l:r.name)&&void 0!==u?u:""})`}`;const h=v(c);return h[mt]=r,h}function bt({layoutId:t}){const e=a(b).id;return e&&void 0!==t?e+"-"+t:t}const At=t=>e=>"string"==typeof e&&e.startsWith(t),Et=At("--"),Vt=At("var(--"),Mt=t=>!!Vt(t)&&Ct.test(t.split("/*")[0].trim()),Ct=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Dt={};const kt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Rt=new Set(kt);function Lt(t,{layout:e,layoutId:n}){return Rt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Dt[t]||"opacity"===t)}const Bt=t=>Boolean(t&&t.getVelocity),jt=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ft=(t,e,n)=>n>e?e:n<t?t:n,Ot={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},It={...Ot,transform:t=>Ft(0,1,t)},Nt={...Ot,default:1},Ut=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),$t=Ut("deg"),Wt=Ut("%"),zt=Ut("px"),Yt=Ut("vh"),Xt=Ut("vw"),Kt={...Wt,parse:t=>Wt.parse(t)/100,transform:t=>Wt.transform(100*t)},Ht={borderWidth:zt,borderTopWidth:zt,borderRightWidth:zt,borderBottomWidth:zt,borderLeftWidth:zt,borderRadius:zt,radius:zt,borderTopLeftRadius:zt,borderTopRightRadius:zt,borderBottomRightRadius:zt,borderBottomLeftRadius:zt,width:zt,maxWidth:zt,height:zt,maxHeight:zt,top:zt,right:zt,bottom:zt,left:zt,padding:zt,paddingTop:zt,paddingRight:zt,paddingBottom:zt,paddingLeft:zt,margin:zt,marginTop:zt,marginRight:zt,marginBottom:zt,marginLeft:zt,backgroundPositionX:zt,backgroundPositionY:zt},Gt={rotate:$t,rotateX:$t,rotateY:$t,rotateZ:$t,scale:Nt,scaleX:Nt,scaleY:Nt,scaleZ:Nt,skew:$t,skewX:$t,skewY:$t,distance:zt,translateX:zt,translateY:zt,translateZ:zt,x:zt,y:zt,z:zt,perspective:zt,transformPerspective:zt,opacity:It,originX:Kt,originY:Kt,originZ:zt},qt={...Ot,transform:Math.round},_t={...Ht,...Gt,zIndex:qt,size:zt,fillOpacity:It,strokeOpacity:It,numOctaves:qt},Zt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jt=kt.length;function Qt(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(Rt.has(t))r=!0;else if(Et(t))s[t]=n;else{const e=jt(n,_t[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o<Jt;o++){const r=kt[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=jt(a,_t[r]);l||(s=!1,i+=`${Zt[r]||r}(${t}) `),n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const te=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ee(t,e,n){for(const i in e)Bt(e[i])||Lt(i,n)||(t[i]=e[i])}function ne(t,e){const n={};return ee(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return c((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Qt(n,e,t),Object.assign({},n.vars,n.style)}),[e])}(t,e)),n}function ie(t,e){const n={},i=ne(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const se=["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 oe(t){return"string"==typeof t&&!t.includes("-")&&!!(se.indexOf(t)>-1||/[A-Z]/u.test(t))}const re={offset:"stroke-dashoffset",array:"stroke-dasharray"},ae={offset:"strokeDashoffset",array:"strokeDasharray"};function le(t,e,n){return"string"==typeof t?t:zt.transform(e+n*t)}function ue(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Qt(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${le(e,t.x,t.width)} ${le(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?re:ae;t[o.offset]=zt.transform(-i);const r=zt.transform(e),a=zt.transform(n);t[o.array]=`${r} ${a}`}(d,r,a,l,!1)}const ce=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),he=t=>"string"==typeof t&&"svg"===t.toLowerCase();function de(t,e,n,i){const s=c((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return ue(n,e,he(i),t.transformTemplate),{...n.attrs,style:{...n.style}}}),[e]);if(t.style){const e={};ee(e,t.style,t),s.style={...e,...s.style}}return s}function pe(t=!1){return(e,n,i,{latestValues:s},o)=>{const r=(oe(e)?de:ie)(n,s,o,e),a=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(tt(s)||!0===n&&Q(s)||!e&&!Q(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),l=e!==g?{...a,...r,ref:i}:{},{children:u}=n,h=c((()=>Bt(u)?u.get():u),[u]);return y(e,{...l,children:h})}}function me(t){const e=[{},{}];return null==t||t.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function fe(t,e,n,i){if("function"==typeof e){const[s,o]=me(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=me(i);e=e(void 0!==n?n:t.custom,s,o)}return e}const ve=t=>Array.isArray(t);function ge(t){const e=Bt(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ye=t=>(e,n)=>{const i=a(ot),s=a(E),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:xe(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,e,i,s);return n?o():A(o)};function xe(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=ge(o[t]);let{initial:r,animate:a}=t;const l=ct(t),u=ht(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===r;const h=c?a:r;if(h&&"boolean"!=typeof h&&!rt(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=fe(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}function we(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(Bt(s[r])||e.style&&Bt(e.style[r])||Lt(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return o}const Pe={useVisualState:ye({scrapeMotionValuesFromProps:we,createRenderState:te})};function Te(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}function Se(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}const be=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 Ae(t,e,n,i){Se(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(be.has(n)?n:gt(n),e.attrs[n])}function Ee(t,e,n){const i=we(t,e,n);for(const n in t)if(Bt(t[n])||Bt(e[n])){i[-1!==kt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Ve=["x","y","width","height","cx","cy","r"],Me={useVisualState:ye({scrapeMotionValuesFromProps:Ee,createRenderState:ce,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o)for(const t in s)if(Rt.has(t)){o=!0;break}if(!o)return;let r=!e;if(e)for(let n=0;n<Ve.length;n++){const i=Ve[n];t[i]!==e[i]&&(r=!0)}r&&X.read((()=>{Te(n,i),X.render((()=>{ue(i,s,he(n.tagName),t.transformTemplate),Ae(n,i)}))}))}})};function Ce(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return St({...oe(n)?Me:Pe,preloadedFeatures:t,useRender:pe(i),createVisualElement:e,Component:n})}}function De(t,e,n){const i=t.getProps();return fe(i,e,void 0!==n?n:i.custom,t)}function ke(t,e){return t?t[e]||t.default||t:void 0}const Re=new Set(["width","height","top","left","right","bottom",...kt]);let Le;function Be(){Le=void 0}const je={now:()=>(void 0===Le&&je.set(H.isProcessing||$?H.timestamp:performance.now()),Le),set:t=>{Le=t,queueMicrotask(Be)}};function Fe(t,e){-1===t.indexOf(e)&&t.push(e)}function Oe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Ie{constructor(){this.subscriptions=[]}add(t){return Fe(this.subscriptions,t),()=>Oe(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ne(t,e){return e?t*(1e3/e):0}class Ue{constructor(t,e={}){this.version="12.4.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=je.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=je.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&it(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Ie);const n=this.events[t].add(e);return"change"===t?()=>{n(),X.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=je.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Ne(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),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 $e(t,e){return new Ue(t,e)}function We(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,$e(n))}function ze(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Bt(i)&&i.add))return n.add(e);var i}function Ye(t){return t.props[yt]}function Xe(t){let e;return()=>(void 0===e&&(e=t()),e)}const Ke=Xe((()=>void 0!==window.ScrollTimeline));class He{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>"finished"in t?t.finished:t)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map((n=>Ke()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0));return()=>{n.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ge extends He{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}const qe=t=>1e3*t,_e=t=>t/1e3;function Ze(t){return"function"==typeof t}function Je(t,e){t.timeline=e,t.onfinish=null}const Qe=t=>Array.isArray(t)&&"number"==typeof t[0],tn={linearEasing:void 0};function en(t,e){const n=Xe(t);return()=>{var t;return null!==(t=tn[e])&&void 0!==t?t:n()}}const nn=en((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),sn=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},on=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(sn(0,s-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`};function rn(t){return Boolean("function"==typeof t&&nn()||!t||"string"==typeof t&&(t in ln||nn())||Qe(t)||Array.isArray(t)&&t.every(rn))}const an=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ln={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:an([0,.65,.55,1]),circOut:an([.55,0,1,.45]),backIn:an([.31,.01,.66,-.59]),backOut:an([.33,1.53,.69,.99])};function un(t,e){return t?"function"==typeof t&&nn()?on(t,e):Qe(t)?an(t):Array.isArray(t)?t.map((t=>un(t,e)||ln.easeOut)):ln[t]:void 0}const cn=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function hn(t,e,n,i){if(t===e&&n===i)return I;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=cn(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:cn(s(t),e,i)}const dn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pn=t=>e=>1-t(1-e),mn=hn(.33,1.53,.69,.99),fn=pn(mn),vn=dn(fn),gn=t=>(t*=2)<1?.5*fn(t):.5*(2-Math.pow(2,-10*(t-1))),yn=t=>1-Math.sin(Math.acos(t)),xn=pn(yn),wn=dn(yn),Pn=t=>/^0[^.\s]+$/u.test(t);const Tn=t=>Math.round(1e5*t)/1e5,Sn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const bn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,An=(t,e)=>n=>Boolean("string"==typeof n&&bn.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),En=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Sn);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Vn={...Ot,transform:t=>Math.round((t=>Ft(0,255,t))(t))},Mn={test:An("rgb","red"),parse:En("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Vn.transform(t)+", "+Vn.transform(e)+", "+Vn.transform(n)+", "+Tn(It.transform(i))+")"};const Cn={test:An("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Mn.transform},Dn={test:An("hsl","hue"),parse:En("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Wt.transform(Tn(e))+", "+Wt.transform(Tn(n))+", "+Tn(It.transform(i))+")"},kn={test:t=>Mn.test(t)||Cn.test(t)||Dn.test(t),parse:t=>Mn.test(t)?Mn.parse(t):Dn.test(t)?Dn.parse(t):Cn.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Mn.transform(t):Dn.transform(t)},Rn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ln="number",Bn="color",jn=/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 Fn(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(jn,(t=>(kn.test(t)?(i.color.push(o),s.push(Bn),n.push(kn.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Ln),n.push(parseFloat(t))),++o,"${}"))).split("${}");return{values:n,split:r,indexes:i,types:s}}function On(t){return Fn(t).values}function In(t){const{split:e,types:n}=Fn(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===Ln?Tn(t[o]):e===Bn?kn.transform(t[o]):t[o]}return s}}const Nn=t=>"number"==typeof t?0:t;const Un={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Sn))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Rn))||void 0===n?void 0:n.length)||0)>0},parse:On,createTransformer:In,getAnimatableNone:function(t){const e=On(t);return In(t)(e.map(Nn))}},$n=new Set(["brightness","contrast","saturate","opacity"]);function Wn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Sn)||[];if(!i)return t;const s=n.replace(i,"");let o=$n.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const zn=/\b([a-z-]*)\(.*?\)/gu,Yn={...Un,getAnimatableNone:t=>{const e=t.match(zn);return e?e.map(Wn).join(" "):t}},Xn={..._t,color:kn,backgroundColor:kn,outlineColor:kn,fill:kn,stroke:kn,borderColor:kn,borderTopColor:kn,borderRightColor:kn,borderBottomColor:kn,borderLeftColor:kn,filter:Yn,WebkitFilter:Yn},Kn=t=>Xn[t];function Hn(t,e){let n=Kn(t);return n!==Yn&&(n=Un),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Gn=new Set(["auto","none","0"]);const qn=t=>t===Ot||t===zt,_n=(t,e)=>parseFloat(t.split(", ")[e]),Zn=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return _n(s[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?_n(e[1],t):0}},Jn=new Set(["x","y","z"]),Qn=kt.filter((t=>!Jn.has(t)));const ti={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Zn(4,13),y:Zn(5,14)};ti.translateX=ti.x,ti.translateY=ti.y;const ei=new Set;let ni=!1,ii=!1;function si(){if(ii){const t=Array.from(ei).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return Qn.forEach((n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}ii=!1,ni=!1,ei.forEach((t=>t.complete())),ei.clear()}function oi(){ei.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(ii=!0)}))}class ri{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ei.add(this),ni||(ni=!0,X.read(oi),X.resolveKeyframes(si))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ei.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ei.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ai=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),li=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ui(t,e,n=1){U(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,s]=function(t){const e=li.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${null!=n?n:i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return ai(t)?parseFloat(t):t}return Mt(s)?ui(s,e,n+1):s}const ci=t=>e=>e.test(t),hi=[Ot,zt,Wt,$t,Xt,Yt,{test:t=>"auto"===t,parse:t=>t}],di=t=>hi.find(ci(t));class pi extends ri{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),Mt(i))){const s=ui(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Re.has(n)||2!==t.length)return;const[i,s]=t,o=di(i),r=di(s);if(o!==r)if(qn(o)&&qn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||Pn(i))&&n.push(e);var i;n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Gn.has(e)&&Fn(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Hn(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ti[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=ti[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach((([t,n])=>{e.getValue(t).set(n)})),this.resolveNoneKeyframes()}}const mi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Un.test(t)&&"0"!==t||t.startsWith("url(")));function fi(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=mi(s,e),a=mi(o,e);return N(r===a,`You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Ze(n))&&i)}const vi=t=>null!==t;function gi(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(vi),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class yi{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=je.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(oi(),si()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=je.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!fi(t,n,i,s)){if(!o)return a&&a(gi(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((t=>{this.resolveFinishedPromise=t}))}}const xi=2e4;function wi(t){let e=0;let n=t.next(e);for(;!n.done&&e<xi;)e+=50,n=t.next(e);return e>=xi?1/0:e}const Pi=(t,e,n)=>t+(e-t)*n;function Ti(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Si(t,e){return n=>n>0?e:t}const bi=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Ai=[Cn,Mn,Dn];function Ei(t){const e=(n=t,Ai.find((t=>t.test(n))));var n;if(N(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let i=e.parse(t);return e===Dn&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ti(a,i,t+1/3),o=Ti(a,i,t),r=Ti(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Vi=(t,e)=>{const n=Ei(t),i=Ei(e);if(!n||!i)return Si(t,e);const s={...n};return t=>(s.red=bi(n.red,i.red,t),s.green=bi(n.green,i.green,t),s.blue=bi(n.blue,i.blue,t),s.alpha=Pi(n.alpha,i.alpha,t),Mn.transform(s))},Mi=(t,e)=>n=>e(t(n)),Ci=(...t)=>t.reduce(Mi),Di=new Set(["none","hidden"]);function ki(t,e){return n=>Pi(t,e,n)}function Ri(t){return"number"==typeof t?ki:"string"==typeof t?Mt(t)?Si:kn.test(t)?Vi:ji:Array.isArray(t)?Li:"object"==typeof t?kn.test(t)?Vi:Bi:Si}function Li(t,e){const n=[...t],i=n.length,s=t.map(((t,n)=>Ri(t)(t,e[n])));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Bi(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Ri(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ji=(t,e)=>{const n=Un.createTransformer(e),i=Fn(t),s=Fn(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Di.has(t)&&!s.values.length||Di.has(e)&&!i.values.length?function(t,e){return Di.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Ci(Li(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):(N(!0,`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.`),Si(t,e))};function Fi(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Pi(t,e,n);return Ri(t)(t,e)}function Oi(t,e,n){const i=Math.max(e-5,0);return Ne(n-t(i),e-i)}const Ii=100,Ni=10,Ui=1,$i=0,Wi=800,zi=.3,Yi=.3,Xi={granular:.01,default:2},Ki={granular:.005,default:.5},Hi=.01,Gi=10,qi=.05,_i=1;function Zi({duration:t=Wi,bounce:e=zi,velocity:n=$i,mass:i=Ui}){let s,o;N(t<=qe(Gi),"Spring duration must be 10 seconds or less");let r=1-e;r=Ft(qi,_i,r),t=Ft(Hi,Gi,_e(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/Qi(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Qi(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<Ji;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=qe(t),isNaN(a))return{stiffness:Ii,damping:Ni,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Ji=12;function Qi(t,e){return t*Math.sqrt(1-e*e)}const ts=["duration","bounce"],es=["stiffness","damping","mass"];function ns(t,e){return e.some((e=>void 0!==t[e]))}function is(t=Yi,e=zi){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:$i,stiffness:Ii,damping:Ni,mass:Ui,isResolvedFromDuration:!1,...t};if(!ns(t,es)&&ns(t,ts))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*Ft(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ui,stiffness:s,damping:o}}else{const n=Zi(t);e={...e,...n,mass:Ui},e.isResolvedFromDuration=!0}return e}({...n,velocity:-_e(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*c)),v=r-o,g=_e(Math.sqrt(l/c)),y=Math.abs(v)<5;let x;if(i||(i=y?Xi.granular:Xi.default),s||(s=y?Ki.granular:Ki.default),f<1){const t=Qi(g,f);x=e=>{const n=Math.exp(-f*g*e);return r-n*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-g*t)*(v+(m+g*v)*t);else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const w={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0;f<1&&(n=0===t?qe(m):Oi(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(wi(w),xi),e=on((e=>w.next(t*e).value),t,30);return t+"ms "+e}};return w}function ss({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,v=void 0===r?f:r(f);v!==f&&(m=v-h);const g=t=>-m*Math.exp(-t/i),y=t=>v+g(t),x=t=>{const e=g(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let w,P;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,P=is({keyframes:[d.value,p(d.value)],velocity:Oi(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==w||(e=!0,x(t),T(t)),void 0!==w&&t>=w?P.next(t-w):(!e&&x(t),d)}}}const os=hn(.42,0,1,1),rs=hn(0,0,.58,1),as=hn(.42,0,.58,1),ls={linear:I,easeIn:os,easeInOut:as,easeOut:rs,circIn:yn,circInOut:wn,circOut:xn,backIn:fn,backInOut:vn,backOut:mn,anticipate:gn},us=t=>{if(Qe(t)){U(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,i,s]=t;return hn(e,n,i,s)}return"string"==typeof t?(U(void 0!==ls[t],`Invalid easing type '${t}'`),ls[t]):t};function cs(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(U(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||Fi,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||I:e;o=Ci(t,o)}i.push(o)}return i}(e,i,s),l=a.length,u=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=sn(t[i],t[i+1],n);return a[i](s)};return n?e=>u(Ft(t[0],t[o-1],e)):u}function hs(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=sn(0,e,i);t.push(Pi(n,1,s))}}(e,t.length-1),e}function ds({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(us):us(i),o={done:!1,value:e[0]},r=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:hs(e),t),a=cs(r,e,{ease:Array.isArray(s)?s:(l=e,u=s,l.map((()=>u||as)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const ps=t=>{const e=({timestamp:e})=>t(e);return{start:()=>X.update(e,!0),stop:()=>K(e),now:()=>H.isProcessing?H.timestamp:je.now()}},ms={decay:ss,inertia:ss,tween:ds,keyframes:ds,spring:is},fs=t=>t/100;class vs extends yi{constructor(t){super(t),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=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||ri;this.resolver=new o(s,((t,e)=>this.onKeyframesResolved(t,e)),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=Ze(e)?e:ms[e]||ds;let a,l;"production"!==process.env.NODE_ENV&&r!==ds&&U(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),r!==ds&&"number"!=typeof t[0]&&(a=Ci(fs,Fi(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=wi(u));const{calculatedDuration:c}=u,h=c+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return s.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-h*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/c)):"mirror"===p&&(x=o)),y=Ft(0,1,n)*c}const w=g?{done:!1,value:a[0]}:x.next(y);r&&(w.value=r(w.value));let{done:P}=w;g||null===l||(P=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&P);return T&&void 0!==i&&(w.value=gi(a,this.options,i)),f&&f(w.value),T&&this.finish(),w}get duration(){const{resolved:t}=this;return t?_e(t.calculatedDuration):0}get time(){return _e(this.currentTime)}set time(t){t=qe(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=_e(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ps,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&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(t){return this.startTime=0,this.tick(t,!0)}}const gs=new Set(["opacity","clipPath","filter","transform"]);function ys(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=un(a,s);Array.isArray(c)&&(u.easing=c);return t.animate(u,{delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const xs=Xe((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const ws={anticipate:gn,backInOut:vn,circInOut:wn};class Ps extends yi{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new pi(s,((t,e)=>this.onKeyframesResolved(t,e)),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var u;if("string"==typeof s&&nn()&&s in ws&&(s=ws[s]),Ze((u=this.options).type)||"spring"===u.type||!rn(u.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new vs({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,i=c.times,s=c.ease,o="keyframes"}const c=ys(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(Je(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;r.set(gi(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return _e(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return _e(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=qe(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return I;const{animation:n}=e;Je(n,t)}else this.pendingTimeline=t;return I}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new vs({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),h=qe(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return xs()&&n&&gs.has(n)&&!a&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const Ts={type:"spring",stiffness:500,damping:25,restSpeed:10},Ss={type:"keyframes",duration:.8},bs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},As=(t,{keyframes:e})=>e.length>2?Ss:Rt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ts:bs;const Es=(t,e,n,i={},s,o)=>r=>{const a=ke(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=qe(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(c={...c,...As(t,c)}),c.duration&&(c.duration=qe(c.duration)),c.repeatDelay&&(c.repeatDelay=qe(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(h=!0)),h&&!o&&void 0!==e.get()){const t=gi(c.keyframes,a);if(void 0!==t)return X.update((()=>{c.onUpdate(t),c.onComplete()})),new Ge([])}return!o&&Ps.supports(c)?new Ps(c):new vs(c)};function Vs({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Ms(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||c&&Vs(c,e))continue;const a={delay:n,...ke(r||{},e)};let h=!1;if(window.MotionHandoffAnimation){const n=Ye(t);if(n){const t=window.MotionHandoffAnimation(n,e,X);null!==t&&(a.startTime=t,h=!0)}}ze(t,e),i.start(Es(e,i,s,t.shouldReduceMotion&&Re.has(e)?{type:!1}:a,t,h));const d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then((()=>{X.update((()=>{a&&function(t,e){const n=De(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)We(t,e,(r=o[e],ve(r)?r[r.length-1]||0:r));var r}(t,a)}))})),u}function Cs(t,e,n={}){var i;const s=De(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(Ms(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Ds).forEach(((t,i)=>{t.notify("AnimationStart",e),r.push(Cs(t,e,{...o,delay:n+l(i)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then((()=>e()))}return Promise.all([r(),a(n.delay)])}function Ds(t,e){return t.sortNodePosition(e)}function ks(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const Rs=ut.length;function Ls(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Ls(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Rs;n++){const i=ut[n],s=t.props[i];(at(s)||!1===s)&&(e[i]=s)}return e}const Bs=[...lt].reverse(),js=lt.length;function Fs(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map((e=>Cs(t,e,n)));i=Promise.all(s)}else if("string"==typeof e)i=Cs(t,e,n);else{const s="function"==typeof e?De(t,e,n.custom):e;i=Promise.all(Ms(t,s,n))}return i.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}function Os(t){let e=Fs(t),n=Us(),i=!0;const s=e=>(n,i)=>{var s;const o=De(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=Ls(t.parent)||{},l=[],u=new Set;let c={},h=1/0;for(let e=0;e<js;e++){const d=Bs[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],f=at(m),v=d===o?p.isActive:null;!1===v&&(h=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&i&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...c},!p.isActive&&null===v||!m&&!p.prevProp||rt(m)||"boolean"==typeof m)continue;const y=Is(p.prevProp,m);let x=y||d===o&&p.isActive&&!g&&f||e>h&&f,w=!1;const P=Array.isArray(m)?m:[m];let T=P.reduce(s(d),{});!1===v&&(T={});const{prevResolvedValues:S={}}=p,b={...S,...T},A=e=>{x=!0,u.has(e)&&(w=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in b){const e=T[t],n=S[t];if(c.hasOwnProperty(t))continue;let i=!1;i=ve(e)&&ve(n)?!ks(e,n):e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=T,p.isActive&&(c={...c,...T}),i&&t.blockInitialAnimation&&(x=!1);x&&(!(g&&y)||w)&&l.push(...P.map((t=>({animation:t,options:{type:d}}))))}if(u.size){const e={};if("boolean"!=typeof r.initial){const n=De(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach((n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?i:null})),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)})),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Us(),i=!0}}}function Is(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ks(e,t)}function Ns(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Us(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class $s{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Ws=0;const zs={animation:{Feature:class extends $s{constructor(t){super(t),t.animationState||(t.animationState=Os(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();rt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends $s{constructor(){super(...arguments),this.id=Ws++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then((()=>{e(this.id)}))}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}},Ys={x:!1,y:!1};function Xs(){return Ys.x||Ys.y}const Ks=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Hs(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Gs(t){return{point:{x:t.pageX,y:t.pageY}}}function qs(t,e,n,i){return Hs(t,e,(t=>e=>Ks(e)&&t(e,Gs(e)))(n),i)}const _s=(t,e)=>Math.abs(t-e);class Zs{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=to(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=_s(t.x,e.x),i=_s(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=H;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Js(e,this.transformPagePoint),X.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=to("pointercancel"===t.type?this.lastMoveEventInfo:Js(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Ks(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=Js(Gs(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=H;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,to(o,this.history)),this.removeListeners=Ci(qs(this.contextWindow,"pointermove",this.handlePointerMove),qs(this.contextWindow,"pointerup",this.handlePointerUp),qs(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),K(this.updatePoint)}}function Js(t,e){return e?{point:e(t.point)}:t}function Qs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function to({point:t},e){return{point:t,delta:Qs(t,no(e)),offset:Qs(t,eo(e)),velocity:io(e,.1)}}function eo(t){return t[0]}function no(t){return t[t.length-1]}function io(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=no(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>qe(e)));)n--;if(!i)return{x:0,y:0};const o=_e(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function so(t){return t.max-t.min}function oo(t,e,n,i=.5){t.origin=i,t.originPoint=Pi(e.min,e.max,t.origin),t.scale=so(n)/so(e),t.translate=Pi(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ro(t,e,n,i){oo(t.x,e.x,n.x,i?i.originX:void 0),oo(t.y,e.y,n.y,i?i.originY:void 0)}function ao(t,e,n){t.min=n.min+e.min,t.max=t.min+so(e)}function lo(t,e,n){t.min=e.min-n.min,t.max=t.min+so(e)}function uo(t,e,n){lo(t.x,e.x,n.x),lo(t.y,e.y,n.y)}function co(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ho(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const po=.35;function mo(t,e,n){return{min:fo(t,e),max:fo(t,n)}}function fo(t,e){return"number"==typeof t?t:t[e]||0}const vo=()=>({x:{min:0,max:0},y:{min:0,max:0}});function go(t){return[t("x"),t("y")]}function yo({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function xo(t){return void 0===t||1===t}function wo({scale:t,scaleX:e,scaleY:n}){return!xo(t)||!xo(e)||!xo(n)}function Po(t){return wo(t)||To(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function To(t){return So(t.x)||So(t.y)}function So(t){return t&&"0%"!==t}function bo(t,e,n){return n+e*(t-n)}function Ao(t,e,n,i,s){return void 0!==s&&(t=bo(t,s,i)),bo(t,n,i)+e}function Eo(t,e=0,n=1,i,s){t.min=Ao(t.min,e,n,i,s),t.max=Ao(t.max,e,n,i,s)}function Vo(t,{x:e,y:n}){Eo(t.x,e.translate,e.scale,e.originPoint),Eo(t.y,n.translate,n.scale,n.originPoint)}const Mo=.999999999999,Co=1.0000000000001;function Do(t,e){t.min=t.min+e,t.max=t.max+e}function ko(t,e,n,i,s=.5){Eo(t,e,n,Pi(t.min,t.max,s),i)}function Ro(t,e){ko(t.x,e.x,e.scaleX,e.scale,e.originX),ko(t.y,e.y,e.scaleY,e.scale,e.originY)}function Lo(t,e){return yo(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Bo=({current:t})=>t?t.ownerDocument.defaultView:null,jo=new WeakMap;class Fo{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new Zs(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Gs(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?Ys[o]?null:(Ys[o]=!0,()=>{Ys[o]=!1}):Ys.x||Ys.y?null:(Ys.x=Ys.y=!0,()=>{Ys.x=Ys.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),go((t=>{let e=this.getAxisMotionValue(t).get()||0;if(Wt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=so(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e})),s&&X.postRender((()=>s(t,e))),ze(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>go((t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:Bo(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&X.postRender((()=>s(t,e)))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Oo(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Pi(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Pi(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&ft(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:co(t.x,n,s),y:co(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=po){return!1===t?t=0:!0===t&&(t=po),{x:mo(t,"left","right"),y:mo(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&go((t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))}))}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!ft(t))return!1;const n=t.current;U(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Lo(t,n),{scroll:s}=e;return s&&(Do(i.x,s.offset.x),Do(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ho(t.x,e.x),y:ho(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=yo(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=go((r=>{if(!Oo(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=i?200:1e6,c=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)}));return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return ze(this.visualElement,t),n.start(Es(t,n,0,e,this.visualElement,!1))}stopAnimation(){go((t=>this.getAxisMotionValue(t).stop()))}pauseAnimation(){go((t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()}))}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){go((e=>{const{drag:n}=this.getProps();if(!Oo(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-Pi(n,o,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!ft(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};go((t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=so(t),s=so(e);return s>i?n=sn(e.min,e.max-i,t.min):i>s&&(n=sn(t.min,t.max-s,e.min)),Ft(0,1,n)}({min:n,max:n},this.constraints[t])}}));const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),go((e=>{if(!Oo(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Pi(s,o,i[e]))}))}addListeners(){if(!this.visualElement.current)return;jo.set(this.visualElement,this);const t=qs(this.visualElement.current,"pointerdown",(t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)})),e=()=>{const{dragConstraints:t}=this.getProps();ft(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),X.read(e);const s=Hs(window,"resize",(()=>this.scalePositionWithinConstraints())),o=n.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(go((e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))})),this.visualElement.render())}));return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=po,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Oo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Io=t=>(e,n)=>{t&&X.postRender((()=>t(e,n)))};const No={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Uo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const $o={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!zt.test(t))return t;t=parseFloat(t)}return`${Uo(t,e.target.x)}% ${Uo(t,e.target.y)}%`}},Wo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Un.parse(t);if(s.length>5)return i;const o=Un.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=Pi(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}};class zo extends x{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Dt[e]=t[e],Et(e)&&(Dt[e].isCSSVariable=!0)}(Xo),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",(()=>{this.safeToRemove()})),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),No.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||X.postRender((()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),xt.postRender((()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Yo(e){const[n,i]=R(),s=a(b);return t(zo,{...e,layoutGroup:s,switchLayoutGroup:a(wt),isPresent:n,safeToRemove:i})}const Xo={borderRadius:{...$o,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$o,borderTopRightRadius:$o,borderBottomLeftRadius:$o,borderBottomRightRadius:$o,boxShadow:Wo};const Ko=(t,e)=>t.depth-e.depth;class Ho{constructor(){this.children=[],this.isDirty=!1}add(t){Fe(this.children,t),this.isDirty=!0}remove(t){Oe(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ko),this.isDirty=!1,this.children.forEach(t)}}const Go=["TopLeft","TopRight","BottomLeft","BottomRight"],qo=Go.length,_o=t=>"string"==typeof t?parseFloat(t):t,Zo=t=>"number"==typeof t||zt.test(t);function Jo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Qo=er(0,.5,xn),tr=er(.5,.95,I);function er(t,e,n){return i=>i<t?0:i>e?1:n(sn(t,e,i))}function nr(t,e){t.min=e.min,t.max=e.max}function ir(t,e){nr(t.x,e.x),nr(t.y,e.y)}function sr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function or(t,e,n,i,s){return t=bo(t-=e,1/n,i),void 0!==s&&(t=bo(t,1/s,i)),t}function rr(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Wt.test(e)&&(e=parseFloat(e),e=Pi(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=Pi(o.min,o.max,i);t===o&&(a-=e),t.min=or(t.min,e,n,a,s),t.max=or(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const ar=["x","scaleX","originX"],lr=["y","scaleY","originY"];function ur(t,e,n,i){rr(t.x,e,ar,n?n.x:void 0,i?i.x:void 0),rr(t.y,e,lr,n?n.y:void 0,i?i.y:void 0)}function cr(t){return 0===t.translate&&1===t.scale}function hr(t){return cr(t.x)&&cr(t.y)}function dr(t,e){return t.min===e.min&&t.max===e.max}function pr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function mr(t,e){return pr(t.x,e.x)&&pr(t.y,e.y)}function fr(t){return so(t.x)/so(t.y)}function vr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class gr{constructor(){this.members=[]}add(t){Fe(this.members,t),t.scheduleRender()}remove(t){if(Oe(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex((e=>t===e));if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach((t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((t=>{t.instance&&t.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const yr=["","X","Y","Z"],xr={visibility:"hidden"};let wr=0;function Pr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Tr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ye(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",X,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Tr(i)}function Sr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=wr++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Er),this.nodes.forEach(Lr),this.nodes.forEach(Br),this.nodes.forEach(Vr)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ho)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Ie),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var i;this.isSVG=(i=e)instanceof SVGElement&&"svg"!==i.tagName,this.instance=e;const{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||s)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=je.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(K(i),t(o-e))};return X.read(i,!0),()=>K(i)}(i,250),No.hasAnimatedSinceResize&&(No.hasAnimatedSinceResize=!1,this.nodes.forEach(Rr))}))}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&this.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||r.getDefaultTransition()||Ur,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!mr(this.targetLayout,i),u=!e&&n;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...ke(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Rr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,K(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(jr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Tr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Cr);this.isUpdating||this.nodes.forEach(Dr),this.isUpdating=!1,this.nodes.forEach(kr),this.nodes.forEach(br),this.nodes.forEach(Ar),this.clearAllSnapshots();const t=je.now();H.delta=Ft(0,1e3/60,t-H.timestamp),H.timestamp=t,H.isProcessing=!0,G.update.process(H),G.preRender.process(H),G.render.process(H),H.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Mr),this.sharedNodes.forEach(Fr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,X.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){X.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||so(this.snapshot.measuredBox.x)||so(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!hr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||Po(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),zr((i=n).x),zr(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const n=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(Xr))){const{scroll:t}=this.root;t&&(Do(n.x,t.offset.x),Do(n.y,t.offset.y))}return n}removeElementScroll(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};if(ir(n,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return n;for(let e=0;e<this.path.length;e++){const i=this.path[e],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&ir(n,t),Do(n.x,s.offset.x),Do(n.y,s.offset.y))}return n}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};ir(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Ro(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Po(i.latestValues)&&Ro(n,i.latestValues)}return Po(this.latestValues)&&Ro(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ir(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Po(n.latestValues))continue;wo(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};ir(i,n.measurePageBox()),ur(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Po(this.latestValues)&&ur(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==H.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=H.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},uo(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,a,l;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,ao(r.x,a.x,l.x),ao(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ir(this.target,this.layout.layoutBox),Vo(this.target,this.targetDelta)):ir(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},uo(this.relativeTargetOrigin,this.target,t.target),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!wo(this.parent.latestValues)&&!To(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===H.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;ir(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ro(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Vo(t,r)),i&&Po(o.latestValues)&&Ro(t,o.latestValues))}e.x<Co&&e.x>Mo&&(e.x=1),e.y<Co&&e.y>Mo&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(sr(this.prevProjectionDelta.x,this.projectionDelta.x),sr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),ro(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&vr(this.projectionDelta.x,this.prevProjectionDelta.x)&&vr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Nr));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,v;Or(o.x,t.x,n),Or(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,v=n,Ir(p.x,m.x,f.x,v),Ir(p.y,m.y,f.y,v),h&&(l=this.relativeTarget,d=h,dr(l.x,d.x)&&dr(l.y,d.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),ir(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=Pi(0,void 0!==n.opacity?n.opacity:1,Qo(i)),t.opacityExit=Pi(void 0!==e.opacity?e.opacity:1,0,tr(i))):o&&(t.opacity=Pi(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<qo;s++){const o=`border${Go[s]}Radius`;let r=Jo(e,o),a=Jo(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||Zo(r)===Zo(a)?(t[o]=Math.max(Pi(_o(r),_o(a),i),0),(Wt.test(a)||Wt.test(r))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=Pi(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(K(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=X.update((()=>{No.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const i=Bt(t)?t:$e(t);return i.start(Es("",i,e,n)),i.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Yr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=so(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=so(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}ir(e,n),Ro(e,s),ro(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new gr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Pr("z",t,i,this.animationValues);for(let e=0;e<yr.length;e++)Pr(`rotate${yr[e]}`,t,i,this.animationValues),Pr(`skew${yr[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return xr;const i={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=ge(null==t?void 0:t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=ge(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Po(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==n?void 0:n.z)||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in Dt){if(void 0===r[t])continue;const{correct:e,applyTo:n,isCSSVariable:s}=Dt[t],a="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=a}else s?this.options.visualElement.renderState.vars[t]=a:i[t]=a}return this.options.layoutId&&(i.pointerEvents=o===this?ge(null==t?void 0:t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()})),this.root.nodes.forEach(Cr),this.root.sharedNodes.clear()}}}function br(t){t.updateLayout()}function Ar(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?go((t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=so(i);i.min=e[t].min,i.max=i.min+s})):Yr(s,n.layoutBox,e)&&go((i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=so(e[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)}));const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ro(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?ro(a,t.applyTransform(i,!0),n.measuredBox):ro(a,e,n.layoutBox);const l=!hr(r);let u=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};uo(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};uo(a,e,o.layoutBox),mr(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Er(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Vr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Mr(t){t.clearSnapshot()}function Cr(t){t.clearMeasurements()}function Dr(t){t.isLayoutDirty=!1}function kr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Rr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Lr(t){t.resolveTargetDelta()}function Br(t){t.calcProjection()}function jr(t){t.resetSkewAndRotation()}function Fr(t){t.removeLeadSnapshot()}function Or(t,e,n){t.translate=Pi(e.translate,0,n),t.scale=Pi(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ir(t,e,n,i){t.min=Pi(e.min,n.min,i),t.max=Pi(e.max,n.max,i)}function Nr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ur={duration:.45,ease:[.4,0,.1,1]},$r=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Wr=$r("applewebkit/")&&!$r("chrome/")?Math.round:I;function zr(t){t.min=Wr(t.min),t.max=Wr(t.max)}function Yr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=fr(e),s=fr(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function Xr(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const Kr=Sr({attachResizeListener:(t,e)=>Hs(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hr={current:void 0},Gr=Sr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Hr.current){const t=new Kr({});t.mount(window),t.setOptions({layoutScroll:!0}),Hr.current=t}return Hr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),qr={pan:{Feature:class extends $s{constructor(){super(...arguments),this.removePointerDownListener=I}onPointerDown(t){this.session=new Zs(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bo(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Io(t),onStart:Io(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&X.postRender((()=>i(t,e)))}}}mount(){this.removePointerDownListener=qs(this.node.current,"pointerdown",(t=>this.onPointerDown(t)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends $s{constructor(t){super(t),this.removeGroupControls=I,this.removeListeners=I,this.controls=new Fo(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||I}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Gr,MeasureLayout:Yo}};function _r(t,e){const n=function(t){if(t instanceof Element)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Zr(t){return!("touch"===t.pointerType||Xs())}function Jr(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&X.postRender((()=>s(e,Gs(e))))}const Qr=(t,e)=>!!e&&(t===e||Qr(t,e.parentElement)),ta=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ea=new WeakSet;function na(t){return e=>{"Enter"===e.key&&t(e)}}function ia(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function sa(t){return Ks(t)&&!Xs()}function oa(t,e,n={}){const[i,s,o]=_r(t,n),r=t=>{const i=t.currentTarget;if(!sa(t)||ea.has(i))return;ea.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),sa(t)&&ea.has(i)&&(ea.delete(i),"function"==typeof o&&o(t,{success:e}))},a=t=>{r(t,n.useGlobalTarget||Qr(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach((t=>{(function(t){return ta.has(t.tagName)||-1!==t.tabIndex})(t)||null!==t.getAttribute("tabindex")||(t.tabIndex=0);(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=na((()=>{if(ea.has(n))return;ia(n,"down");const t=na((()=>{ia(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>ia(n,"cancel")),e)}));n.addEventListener("keydown",i,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",i)),e)})(t,s)),s)})),o}function ra(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&X.postRender((()=>s(e,Gs(e))))}const aa=new WeakMap,la=new WeakMap,ua=t=>{const e=aa.get(t.target);e&&e(t)},ca=t=>{t.forEach(ua)};function ha(t,e,n){const i=function({root:t,...e}){const n=t||document;la.has(n)||la.set(n,{});const i=la.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(ca,{root:t,...e})),i[s]}(e);return aa.set(t,n),i.observe(t),()=>{aa.delete(t),i.unobserve(t)}}const da={some:0,all:1};const pa={inView:{Feature:class extends $s{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:da[i]};return ha(this.node.current,o,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends $s{mount(){const{current:t}=this.node;t&&(this.unmount=oa(t,((t,e)=>(ra(this.node,e,"Start"),(t,{success:e})=>ra(this.node,t,e?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends $s{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ci(Hs(this.node.current,"focus",(()=>this.onFocus())),Hs(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends $s{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=_r(t,n),r=t=>{if(!Zr(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{Zr(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach((t=>{t.addEventListener("pointerenter",r,s)})),o}(t,((t,e)=>(Jr(this.node,e,"Start"),t=>Jr(this.node,t,"End")))))}unmount(){}}}},ma={layout:{ProjectionNode:Gr,MeasureLayout:Yo}},fa={current:null},va={current:!1};const ga=[...hi,kn,Un],ya=new WeakMap;const xa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class wa{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ri,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=()=>{const t=je.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,X.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=ct(e),this.isVariantNode=ht(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&Bt(e)&&e.set(a[t],!1)}}mount(t){this.current=t,ya.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),va.current||function(){if(va.current=!0,j)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fa.current=t.matches;t.addListener(e),e()}else fa.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||fa.current),"production"!==process.env.NODE_ENV&&it(!0!==this.shouldReduceMotion,"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(),K(this.notifyUpdate),K(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Rt.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&X.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{i(),s(),o&&o(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Z){const e=Z[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<xa.length;e++){const n=xa[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Bt(s))t.addValue(i,s),"development"===process.env.NODE_ENV&&it("12.4.3"===s.version,`Attempting to mix Motion versions ${s.version} with 12.4.3 may not work as expected.`);else if(Bt(o))t.addValue(i,$e(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,$e(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=$e(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=i&&("string"==typeof i&&(ai(i)||Pn(i))?i=parseFloat(i):(s=i,!ga.find(ci(s))&&Un.test(e)&&(i=Hn(t,e))),this.setBaseTarget(t,Bt(i)?i.get():i)),Bt(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=fe(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Bt(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new Ie),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Pa extends wa{constructor(){super(...arguments),this.KeyframeResolver=pi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Bt(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}class Ta extends Pa{constructor(){super(...arguments),this.type="html",this.renderInstance=Se}readValueFromInstance(t,e){if(Rt.has(e)){const t=Kn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),s=(Et(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Lo(t,e)}build(t,e,n){Qt(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return we(t,e,n)}}class Sa extends Pa{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vo,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Te(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Rt.has(e)){const t=Kn(e);return t&&t.default||0}return e=be.has(e)?e:gt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Ee(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&X.postRender(this.updateDimensions)}build(t,e,n){ue(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){Ae(t,e,0,i)}mount(t){this.isSVGTag=he(t.tagName),super.mount(t)}}const ba=(t,e)=>oe(t)?new Sa(e):new Ta(e,{allowProjection:t!==g}),Aa=st(Ce({...zs,...pa,...qr,...ma},ba)),Ea=(...t)=>t.filter(((t,e,n)=>Boolean(t)&&""!==t.trim()&&n.indexOf(t)===e)).join(" ").trim()
2
+ /**
3
+ * @license lucide-react v0.475.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */;var Va={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
8
+ /**
9
+ * @license lucide-react v0.475.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */const Ma=v((({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:r,...a},l)=>y("svg",{ref:l,...Va,width:e,height:e,stroke:t,strokeWidth:i?24*Number(n)/Number(e):n,className:Ea("lucide",s),...a},[...r.map((([t,e])=>y(t,e))),...Array.isArray(o)?o:[o]]))),Ca=(t,e)=>{const n=v((({className:n,...i},s)=>{return y(Ma,{ref:s,iconNode:e,className:Ea(`lucide-${o=t,o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...i});var o}));return n.displayName=`${t}`,n},Da=Ca("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),ka=Ca("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Ra=Ca("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),La=Ca("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ba=Ca("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);
14
+ /**
15
+ * @license lucide-react v0.475.0 - ISC
16
+ *
17
+ * This source code is licensed under the ISC license.
18
+ * See the LICENSE file in the root directory of this source tree.
19
+ */function ja(e){var i=e.position,s=void 0===i?"bottom-right":i,r=e.closeButton,a=void 0!==r&&r,l=e.gap,c=void 0===l?4:l,d=e.duration,p=void 0===d?4e3:d,m=e.richColors,v=void 0!==m&&m,g=f([]),y=g[0],x=g[1],P=o(new Map),T=u((function(t){x((function(e){return e.filter((function(e){return e.id!==t}))})),P.current.has(t)&&(clearTimeout(P.current.get(t)),P.current.delete(t))}),[]),b=u((function(t,e){var n=Date.now();x((function(i){return w(w([],i,!0),[{id:n,message:t,description:null==e?void 0:e.description,type:null==e?void 0:e.type}],!1)}));var i=setTimeout((function(){T(n)}),p);P.current.set(n,i)}),[T]);h((function(){return S.setAddToast(b),function(){P.current.forEach((function(t){return clearTimeout(t)})),P.current.clear(),x([])}}),[b]);var A={top:{initial:{y:"-50%",opacity:0},exit:{y:"-50%",opacity:0},animate:{y:0,opacity:1}},bottom:{initial:{y:"50%",opacity:0},exit:{y:"50%",opacity:0},animate:{y:0,opacity:1}}},E=s.includes("top")?A.top:A.bottom,V=function(t,e){if(!t)return"";return{success:"text-green-500",error:"text-red-500",info:"text-blue-500",warning:"text-yellow-500"}[e]||""},M=function(e){switch(e){case"success":return t(ka,{className:"mr-2 w-5"});case"error":return t(Da,{className:"mr-2 w-5"});case"info":return t(Ra,{className:"mr-2 w-5"});case"warning":return t(La,{className:"mr-2 w-5"});default:return null}};return t("div",{style:{gap:"".concat(c,"px"),zIndex:1e3},className:"fixed mx-auto flex w-full min-w-[5%] flex-col sm:max-w-[50%] md:max-w-[30%] ".concat({"top-left":"top-2 left-2","top-mid":"top-2 left-1/2 -translate-x-1/2","top-right":"top-2 right-2","bottom-left":"bottom-2 left-4 flex-col-reverse","bottom-mid":"bottom-2 left-1/2 -translate-x-1/2 flex-col-reverse","bottom-right":"bottom-2 right-2 flex-col-reverse"}[s]),children:t(O,{children:y.map((function(e){return n(Aa.div,{initial:E.initial,exit:E.exit,animate:E.animate,transition:{type:"spring",duration:.5,stiffness:200,damping:20},className:"relative flex min-h-14 flex-col content-center justify-center rounded-lg border border-zinc-700 p-2 font-medium ".concat(e.type?V(v,e.type):"bg-[#F5F5F5]"),children:[a&&t("span",{className:"absolute top-1 right-0 cursor-pointer text-black",onClick:function(){return T(e.id)},children:t(Ba,{className:"w-5"})}),n("div",{className:"flex items-center",children:[e.type&&M(e.type),e.message]})]},e.id)}))})})}export{ja as Toaster,S as toast};
20
+ //# sourceMappingURL=toast.mjs.map