@rapidload/page-optimizer
Version:
Helps you get better page speed scores by analyzing and providing optimal actions (for Wordpress)
11 lines • 114 kB
JavaScript
import{j as U}from"./vendor.T3CYoFTJ.js";import{r as x}from"./core-vendor.V80Ff32-.js";const Ee=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Gt=x.createContext({}),$t=x.createContext(null),Le=typeof window<"u",As=Le?x.useLayoutEffect:x.useEffect,Fe=x.createContext({strict:!1}),zt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),eo="framerAppearId",ws="data-"+zt(eo),no={skipAnimations:!1,useManualTiming:!1};function so(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){r.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,c=!1,h=!1)=>{const d=h&&s?e:n;return c&&r.add(u),d.has(u)||d.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[e,n]=[n,e],n.clear(),e.forEach(a),s=!1,i&&(i=!1,l.process(u))}};return l}const Et=["read","resolveKeyframes","update","preRender","render","postRender"],io=40;function Vs(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Et.reduce((v,y)=>(v[y]=so(r),v),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:f}=o,d=()=>{const v=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,io),1),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(d))},p=()=>{n=!0,s=!0,i.isProcessing||t(d)};return{schedule:Et.reduce((v,y)=>{const m=o[y];return v[y]=(S,b=!1,C=!1)=>(n||p(),m.schedule(S,b,C)),v},{}),cancel:v=>{for(let y=0;y<Et.length;y++)o[Et[y]].cancel(v)},state:i,steps:o}}const{schedule:Be,cancel:Au}=Vs(queueMicrotask,!1);function at(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const Cs=x.createContext({});let un=!1;function oo(t,e,n,s,i){const{visualElement:r}=x.useContext(Gt),o=x.useContext(Fe),a=x.useContext($t),l=x.useContext(Ee).reducedMotion,u=x.useRef();s=s||o.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:r,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,h=x.useContext(Cs);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&ao(u.current,n,i,h),x.useInsertionEffect(()=>{c&&c.update(n,a)});const f=x.useRef(!!(n[ws]&&!window.HandoffComplete));return As(()=>{c&&(c.updateFeatures(),Be.render(c.render),f.current&&c.animationState&&c.animationState.animateChanges())}),x.useEffect(()=>{c&&(!f.current&&c.animationState&&c.animationState.animateChanges(),f.current&&(f.current=!1,un||(un=!0,queueMicrotask(ro))))}),c}function ro(){window.HandoffComplete=!0}function ao(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ds(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&at(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function Ds(t){if(t)return t.options.allowProjection!==!1?t.projection:Ds(t.parent)}function lo(t,e,n){return x.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):at(n)&&(n.current=s))},[e])}function St(t){return typeof t=="string"||Array.isArray(t)}function bt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const ke=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],je=["initial",...ke];function Ht(t){return bt(t.animate)||je.some(e=>St(t[e]))}function Rs(t){return!!(Ht(t)||t.variants)}function uo(t,e){if(Ht(t)){const{initial:n,animate:s}=t;return{initial:n===!1||St(n)?n:void 0,animate:St(s)?s:void 0}}return t.inherit!==!1?e:{}}function co(t){const{initial:e,animate:n}=uo(t,x.useContext(Gt));return x.useMemo(()=>({initial:e,animate:n}),[cn(e),cn(n)])}function cn(t){return Array.isArray(t)?t.join(" "):t}const hn={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"]},ft={};for(const t in hn)ft[t]={isEnabled:e=>hn[t].some(n=>!!e[n])};function me(t){for(const e in t)ft[e]={...ft[e],...t[e]}}const Ie=x.createContext({}),ho=Symbol.for("motionComponentSymbol"),L=t=>t;let ge=L;function fo({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&me(t);function r(a,l){let u;const c={...x.useContext(Ee),...a,layoutId:po(a)},{isStatic:h}=c,f=co(a),d=s(a,h);if(!h&&Le){mo();const p=go(c);u=p.MeasureLayout,f.visualElement=oo(i,d,c,e,p.ProjectionNode)}return U.jsxs(Gt.Provider,{value:f,children:[u&&f.visualElement?U.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,a,lo(d,f.visualElement,l),d,h,f.visualElement)]})}const o=x.forwardRef(r);return o[ho]=i,o}function po({layoutId:t}){const e=x.useContext(Ie).id;return e&&t!==void 0?e+"-"+t:t}function mo(t,e){x.useContext(Fe).strict}function go(t){const{drag:e,layout:n}=ft;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Ms(t){function e(s,i={}){return fo(t(s,i))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const yo=["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 typeof t!="string"||t.includes("-")?!1:!!(yo.indexOf(t)>-1||/[A-Z]/u.test(t))}const Ot={};function vo(t){Object.assign(Ot,t)}const Ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Q=new Set(Ct);function Es(t,{layout:e,layoutId:n}){return Q.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ot[t]||t==="opacity")}const E=t=>!!(t&&t.getVelocity),Ls=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Z=(t,e,n)=>n>e?e:n<t?t:n,pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},vt={...pt,transform:t=>Z(0,1,t)},Lt={...pt,default:1},xt=t=>Math.round(t*1e5)/1e5,Ne=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,xo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Po=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function Dt(t){return typeof t=="string"}function To(t){return t==null}const Rt=t=>({test:e=>Dt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),X=Rt("deg"),W=Rt("%"),T=Rt("px"),So=Rt("vh"),bo=Rt("vw"),fn={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},dn={...pt,transform:Math.round},Ue={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,size:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,rotate:X,rotateX:X,rotateY:X,rotateZ:X,scale:Lt,scaleX:Lt,scaleY:Lt,scaleZ:Lt,skew:X,skewX:X,skewY:X,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:vt,originX:fn,originY:fn,originZ:T,zIndex:dn,backgroundPositionX:T,backgroundPositionY:T,fillOpacity:vt,strokeOpacity:vt,numOctaves:dn},Ao={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wo=Ct.length;function Vo(t,e,n){let s="",i=!0;for(let r=0;r<wo;r++){const o=Ct[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Ls(a,Ue[o]);if(!l){i=!1;const c=Ao[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}const Fs=t=>e=>typeof e=="string"&&e.startsWith(t),Bs=Fs("--"),Co=Fs("var(--"),We=t=>Co(t)?Do.test(t.split("/*")[0].trim()):!1,Do=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ke(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(Q.has(l)){o=!0;continue}else if(Bs(l)){i[l]=u;continue}else{const c=Ls(u,Ue[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=Vo(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}const _e=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ks(t,e,n){for(const s in e)!E(e[s])&&!Es(s,n)&&(t[s]=e[s])}function Ro({transformTemplate:t},e){return x.useMemo(()=>{const n=_e();return Ke(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Mo(t,e){const n=t.style||{},s={};return ks(s,n,t),Object.assign(s,Ro(t,e)),s}function Eo(t,e){const n={},s=Mo(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Lo=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 Nt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Lo.has(t)}let js=t=>!Nt(t);function Fo(t){t&&(js=e=>e.startsWith("on")?!Nt(e):t(e))}try{Fo(require("@emotion/is-prop-valid").default)}catch{}function Bo(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(js(i)||n===!0&&Nt(i)||!e&&!Nt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function pn(t,e,n){return typeof t=="string"?t:T.transform(e+n*t)}function ko(t,e,n){const s=pn(e,t.x,t.width),i=pn(n,t.y,t.height);return`${s} ${i}`}const jo={offset:"stroke-dashoffset",array:"stroke-dasharray"},Io={offset:"strokeDashoffset",array:"strokeDasharray"};function Oo(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?jo:Io;t[r.offset]=T.transform(-s);const o=T.transform(e),a=T.transform(n);t[r.array]=`${o} ${a}`}function Ge(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Ke(t,u,h),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:p}=t;f.transform&&(p&&(d.transform=f.transform),delete f.transform),p&&(i!==void 0||r!==void 0||d.transform)&&(d.transformOrigin=ko(p,i!==void 0?i:.5,r!==void 0?r:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),o!==void 0&&Oo(f,o,a,l,!1)}const Is=()=>({..._e(),attrs:{}}),$e=t=>typeof t=="string"&&t.toLowerCase()==="svg";function No(t,e,n,s){const i=x.useMemo(()=>{const r=Is();return Ge(r,e,$e(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};ks(r,t.style,t),i.style={...r,...i.style}}return i}function Uo(t=!1){return(n,s,i,{latestValues:r},o)=>{const l=(Oe(n)?No:Eo)(s,r,o,n),u=Bo(s,typeof n=="string",t),c=n!==x.Fragment?{...u,...l,ref:i}:{},{children:h}=s,f=x.useMemo(()=>E(h)?h.get():h,[h]);return x.createElement(n,{...c,children:f})}}function Os(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const Ns=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 Us(t,e,n,s){Os(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Ns.has(i)?i:zt(i),e.attrs[i])}function ze(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(E(i[o])||e.style&&E(e.style[o])||Es(o,t)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),r}function Ws(t,e,n){const s=ze(t,e,n);for(const i in t)if(E(t[i])||E(e[i])){const r=Ct.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}function mn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function He(t,e,n,s){if(typeof e=="function"){const[i,r]=mn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=mn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Xe(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const ye=t=>Array.isArray(t),Wo=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Ko=t=>ye(t)?t[t.length-1]||0:t;function kt(t){const e=E(t)?t.get():t;return Wo(e)?e.toValue():e}const Ks=new Set(["opacity","clipPath","filter","transform"]);function _s(t){if(Q.has(t))return"transform";if(Ks.has(t))return zt(t)}function Xt(t,e){t.indexOf(e)===-1&&t.push(e)}function Yt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function _o({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:n,onMount:s},i,r,o,a){const l={latestValues:$o(i,r,o,a?!1:t,e),renderState:n()};return s&&(l.mount=u=>s(i,u,l)),l}const Gs=t=>(e,n)=>{const s=x.useContext(Gt),i=x.useContext($t),r=()=>_o(t,e,s,i,n);return n?r():Xe(r)};function Go(t,e){const n=_s(e);n&&Xt(t,n)}function gn(t,e,n){const s=Array.isArray(e)?e:[e];for(let i=0;i<s.length;i++){const r=He(t,s[i]);if(r){const{transitionEnd:o,transition:a,...l}=r;n(l,o)}}}function $o(t,e,n,s,i){var r;const o={},a=[],l=s&&((r=t.style)===null||r===void 0?void 0:r.willChange)===void 0,u=i(t,{});for(const P in u)o[P]=kt(u[P]);let{initial:c,animate:h}=t;const f=Ht(t),d=Rs(t);e&&d&&!f&&t.inherit!==!1&&(c===void 0&&(c=e.initial),h===void 0&&(h=e.animate));let p=n?n.initial===!1:!1;p=p||c===!1;const g=p?h:c;return g&&typeof g!="boolean"&&!bt(g)&&gn(t,g,(P,v)=>{for(const y in P){let m=P[y];if(Array.isArray(m)){const S=p?m.length-1:0;m=m[S]}m!==null&&(o[y]=m)}for(const y in v)o[y]=v[y]}),l&&(h&&c!==!1&&!bt(h)&&gn(t,h,P=>{for(const v in P)Go(a,v)}),a.length&&(o.willChange=a.join(","))),o}const{schedule:w,cancel:H,state:R,steps:ee}=Vs(typeof requestAnimationFrame<"u"?requestAnimationFrame:L,!0),zo={useVisualState:Gs({scrapeMotionValuesFromProps:Ws,createRenderState:Is,onMount:(t,e,{renderState:n,latestValues:s})=>{w.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),w.render(()=>{Ge(n,s,$e(e.tagName),t.transformTemplate),Us(e,n)})}})},Ho={useVisualState:Gs({applyWillChange:!0,scrapeMotionValuesFromProps:ze,createRenderState:_e})};function $s(t,{forwardMotionProps:e=!1},n,s){return{...Oe(t)?zo:Ho,preloadedFeatures:n,useRender:Uo(e),createVisualElement:s,Component:t}}function _(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const zs=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function qt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Xo=t=>e=>zs(e)&&t(e,qt(e));function G(t,e,n,s){return _(t,e,Xo(n),s)}const Yo=(t,e)=>n=>e(t(n)),$=(...t)=>t.reduce(Yo);function Hs(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const yn=Hs("dragHorizontal"),vn=Hs("dragVertical");function Xs(t){let e=!1;if(t==="y")e=vn();else if(t==="x")e=yn();else{const n=yn(),s=vn();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Ys(){const t=Xs(!0);return t?(t(),!1):!0}class tt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function xn(t,e){const n=e?"pointerenter":"pointerleave",s=e?"onHoverStart":"onHoverEnd",i=(r,o)=>{if(r.pointerType==="touch"||Ys())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const l=a[s];l&&w.postRender(()=>l(r,o))};return G(t.current,n,i,{passive:!t.getProps()[s]})}class qo extends tt{mount(){this.unmount=$(xn(this.node,!0),xn(this.node,!1))}unmount(){}}class Zo extends tt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=$(_(this.node.current,"focus",()=>this.onFocus()),_(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const qs=(t,e)=>e?t===e?!0:qs(t,e.parentElement):!1;function ne(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,qt(n))}class Jo extends tt{constructor(){super(...arguments),this.removeStartListeners=L,this.removeEndListeners=L,this.removeAccessibleListeners=L,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),r=G(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:h}=this.node.getProps(),f=!h&&!qs(this.node.current,a.target)?c:u;f&&w.update(()=>f(a,l))},{passive:!(s.onTap||s.onPointerUp)}),o=G(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=$(r,o),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||ne("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&w.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=_(this.node.current,"keyup",o),ne("down",(a,l)=>{this.startPress(a,l)})},n=_(this.node.current,"keydown",e),s=()=>{this.isPressing&&ne("cancel",(r,o)=>this.cancelPress(r,o))},i=_(this.node.current,"blur",s);this.removeAccessibleListeners=$(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&w.postRender(()=>s(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Ys()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&w.postRender(()=>s(e,n))}mount(){const e=this.node.getProps(),n=G(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=_(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=$(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const ve=new WeakMap,se=new WeakMap,Qo=t=>{const e=ve.get(t.target);e&&e(t)},tr=t=>{t.forEach(Qo)};function er({root:t,...e}){const n=t||document;se.has(n)||se.set(n,{});const s=se.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(tr,{root:t,...e})),s[i]}function nr(t,e,n){const s=er(e);return ve.set(t,n),s.observe(t),()=>{ve.delete(t),s.unobserve(t)}}const sr={some:0,all:1};class ir extends tt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:sr[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return nr(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(or(e,n))&&this.startObserver()}unmount(){}}function or({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Zs={inView:{Feature:ir},tap:{Feature:Jo},focus:{Feature:Zo},hover:{Feature:qo}};function Js(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function Zt(t,e,n){const s=t.getProps();return He(s,e,n!==void 0?n:s.custom,t)}const Y=t=>t*1e3,z=t=>t/1e3,rr={type:"spring",stiffness:500,damping:25,restSpeed:10},ar=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),lr={type:"keyframes",duration:.8},ur={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},cr=(t,{keyframes:e})=>e.length>2?lr:Q.has(t)?t.startsWith("scale")?ar(e[1]):rr:ur;function hr({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function Ye(t,e){return t[e]||t.default||t}const fr=t=>t!==null;function Jt(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(fr),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}let jt;function dr(){jt=void 0}const q={now:()=>(jt===void 0&&q.set(R.isProcessing||no.useManualTiming?R.timestamp:performance.now()),jt),set:t=>{jt=t,queueMicrotask(dr)}},Qs=t=>/^0[^.\s]+$/u.test(t);function pr(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Qs(t):!0}const ti=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),mr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function gr(t){const e=mr.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ei(t,e,n=1){const[s,i]=gr(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return ti(o)?parseFloat(o):o}return We(i)?ei(i,e,n+1):i}const yr=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Pn=t=>t===pt||t===T,Tn=(t,e)=>parseFloat(t.split(", ")[e]),Sn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return Tn(i[1],e);{const r=s.match(/^matrix\((.+)\)$/u);return r?Tn(r[1],t):0}},vr=new Set(["x","y","z"]),xr=Ct.filter(t=>!vr.has(t));function Pr(t){const e=[];return xr.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const dt={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:Sn(4,13),y:Sn(5,14)};dt.translateX=dt.x;dt.translateY=dt.y;const ni=t=>e=>e.test(t),Tr={test:t=>t==="auto",parse:t=>t},si=[pt,T,W,X,bo,So,Tr],bn=t=>si.find(ni(t)),ot=new Set;let xe=!1,Pe=!1;function ii(){if(Pe){const t=Array.from(ot).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Pr(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Pe=!1,xe=!1,ot.forEach(t=>t.complete()),ot.clear()}function oi(){ot.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pe=!0)})}function Sr(){oi(),ii()}class qe{constructor(e,n,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ot.add(this),xe||(xe=!0,w.read(oi),w.resolveKeyframes(ii))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let r=0;r<e.length;r++)if(e[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ot.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ot.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ze=(t,e)=>n=>!!(Dt(n)&&Po.test(n)&&n.startsWith(t)||e&&!To(n)&&Object.prototype.hasOwnProperty.call(n,e)),ri=(t,e,n)=>s=>{if(!Dt(s))return s;const[i,r,o,a]=s.match(Ne);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},br=t=>Z(0,255,t),ie={...pt,transform:t=>Math.round(br(t))},it={test:Ze("rgb","red"),parse:ri("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ie.transform(t)+", "+ie.transform(e)+", "+ie.transform(n)+", "+xt(vt.transform(s))+")"};function Ar(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Te={test:Ze("#"),parse:Ar,transform:it.transform},lt={test:Ze("hsl","hue"),parse:ri("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+W.transform(xt(e))+", "+W.transform(xt(n))+", "+xt(vt.transform(s))+")"},M={test:t=>it.test(t)||Te.test(t)||lt.test(t),parse:t=>it.test(t)?it.parse(t):lt.test(t)?lt.parse(t):Te.parse(t),transform:t=>Dt(t)?t:t.hasOwnProperty("red")?it.transform(t):lt.transform(t)};function wr(t){var e,n;return isNaN(t)&&Dt(t)&&(((e=t.match(Ne))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(xo))===null||n===void 0?void 0:n.length)||0)>0}const ai="number",li="color",Vr="var",Cr="var(",An="${}",Dr=/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 At(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Dr,l=>(M.test(l)?(s.color.push(r),i.push(li),n.push(M.parse(l))):l.startsWith(Cr)?(s.var.push(r),i.push(Vr),n.push(l)):(s.number.push(r),i.push(ai),n.push(parseFloat(l))),++r,An)).split(An);return{values:n,split:a,indexes:s,types:i}}function ui(t){return At(t).values}function ci(t){const{split:e,types:n}=At(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===ai?r+=xt(i[o]):a===li?r+=M.transform(i[o]):r+=i[o]}return r}}const Rr=t=>typeof t=="number"?0:t;function Mr(t){const e=ui(t);return ci(t)(e.map(Rr))}const J={test:wr,parse:ui,createTransformer:ci,getAnimatableNone:Mr},Er=new Set(["brightness","contrast","saturate","opacity"]);function Lr(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ne)||[];if(!s)return t;const i=n.replace(s,"");let r=Er.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Fr=/\b([a-z-]*)\(.*?\)/gu,Se={...J,getAnimatableNone:t=>{const e=t.match(Fr);return e?e.map(Lr).join(" "):t}},Br={...Ue,color:M,backgroundColor:M,outlineColor:M,fill:M,stroke:M,borderColor:M,borderTopColor:M,borderRightColor:M,borderBottomColor:M,borderLeftColor:M,filter:Se,WebkitFilter:Se},Je=t=>Br[t];function hi(t,e){let n=Je(t);return n!==Se&&(n=J),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const kr=new Set(["auto","none","0"]);function jr(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!kr.has(r)&&At(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=hi(n,i)}class fi extends qe{constructor(e,n,s,i){super(e,n,s,i,i==null?void 0:i.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),We(u))){const c=ei(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!yr.has(s)||e.length!==2)return;const[i,r]=e,o=bn(i),a=bn(r);if(o!==a)if(Pn(o)&&Pn(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)pr(e[i])&&s.push(i);s.length&&jr(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=dt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n.current)return;const r=n.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=dt[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function di(t){let e;return()=>(e===void 0&&(e=t()),e)}const wn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(J.test(t)||t==="0")&&!t.startsWith("url("));function Ir(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Or(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=wn(i,e),a=wn(r,e);return!o||!a?!1:Ir(t)||n==="spring"&&s}class pi{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Sr(),this._resolved}onKeyframesResolved(e,n){this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Or(e,s,i,r))if(o)this.options.duration=0;else{l==null||l(Jt(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function mi(t,e){return e?t*(1e3/e):0}const Nr=5;function gi(t,e,n){const s=Math.max(e-Nr,0);return mi(n-t(s),e-s)}const oe=.001,Ur=.01,Wr=10,Kr=.05,_r=1;function Gr({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,r,o=1-e;o=Z(Kr,_r,o),t=Z(Ur,Wr,z(t)),o<1?(i=u=>{const c=u*o,h=c*t,f=c-n,d=be(u,o),p=Math.exp(-h);return oe-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),g=be(Math.pow(u,2),o);return(-i(u)+oe>0?-1:1)*((f-d)*p)/g}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-oe+c*h},r=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=zr(i,r,a);if(t=Y(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const $r=12;function zr(t,e,n){let s=n;for(let i=1;i<$r;i++)s=s-t(s)/e(s);return s}function be(t,e){return t*Math.sqrt(1-e*e)}const Hr=["duration","bounce"],Xr=["stiffness","damping","mass"];function Vn(t,e){return e.some(n=>t[n]!==void 0)}function Yr(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Vn(t,Xr)&&Vn(t,Hr)){const n=Gr(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function yi({keyframes:t,restDelta:e,restSpeed:n,...s}){const i=t[0],r=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:f}=Yr({...s,velocity:-z(s.velocity||0)}),d=h||0,p=l/(2*Math.sqrt(a*u)),g=r-i,P=z(Math.sqrt(a/u)),v=Math.abs(g)<5;n||(n=v?.01:2),e||(e=v?.005:.5);let y;if(p<1){const m=be(P,p);y=S=>{const b=Math.exp(-p*P*S);return r-b*((d+p*P*g)/m*Math.sin(m*S)+g*Math.cos(m*S))}}else if(p===1)y=m=>r-Math.exp(-P*m)*(g+(d+P*g)*m);else{const m=P*Math.sqrt(p*p-1);y=S=>{const b=Math.exp(-p*P*S),C=Math.min(m*S,300);return r-b*((d+p*P*g)*Math.sinh(C)+m*g*Math.cosh(C))/m}}return{calculatedDuration:f&&c||null,next:m=>{const S=y(m);if(f)o.done=m>=c;else{let b=d;m!==0&&(p<1?b=gi(y,m,S):b=0);const C=Math.abs(b)<=n,N=Math.abs(r-S)<=e;o.done=C&&N}return o.value=o.done?r:S,o}}}function Cn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let g=n*e;const P=h+g,v=o===void 0?P:o(P);v!==P&&(g=v-h);const y=A=>-g*Math.exp(-A/s),m=A=>v+y(A),S=A=>{const k=y(A),j=m(A);f.done=Math.abs(k)<=u,f.value=f.done?v:j};let b,C;const N=A=>{d(f.value)&&(b=A,C=yi({keyframes:[f.value,p(f.value)],velocity:gi(m,A,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return N(0),{calculatedDuration:null,next:A=>{let k=!1;return!C&&b===void 0&&(k=!0,S(A),N(A)),b!==void 0&&A>=b?C.next(A-b):(!k&&S(A),f)}}}const vi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,qr=1e-7,Zr=12;function Jr(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=vi(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>qr&&++a<Zr);return o}function Mt(t,e,n,s){if(t===e&&n===s)return L;const i=r=>Jr(r,0,1,t,n);return r=>r===0||r===1?r:vi(i(r),e,s)}const Qr=Mt(.42,0,1,1),ta=Mt(0,0,.58,1),xi=Mt(.42,0,.58,1),ea=t=>Array.isArray(t)&&typeof t[0]!="number",Pi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ti=t=>e=>1-t(1-e),Qe=t=>1-Math.sin(Math.acos(t)),Si=Ti(Qe),na=Pi(Qe),bi=Mt(.33,1.53,.69,.99),tn=Ti(bi),sa=Pi(tn),ia=t=>(t*=2)<1?.5*tn(t):.5*(2-Math.pow(2,-10*(t-1))),Dn={linear:L,easeIn:Qr,easeInOut:xi,easeOut:ta,circIn:Qe,circInOut:na,circOut:Si,backIn:tn,backInOut:sa,backOut:bi,anticipate:ia},Rn=t=>{if(Array.isArray(t)){ge(t.length===4);const[e,n,s,i]=t;return Mt(e,n,s,i)}else if(typeof t=="string")return ge(Dn[t]!==void 0),Dn[t];return t},wt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},V=(t,e,n)=>t+(e-t)*n;function re(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function oa({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=re(l,a,t+1/3),r=re(l,a,t),o=re(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Ut(t,e){return n=>n>0?e:t}const ae=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ra=[Te,it,lt],aa=t=>ra.find(e=>e.test(t));function Mn(t){const e=aa(t);if(!e)return!1;let n=e.parse(t);return e===lt&&(n=oa(n)),n}const En=(t,e)=>{const n=Mn(t),s=Mn(e);if(!n||!s)return Ut(t,e);const i={...n};return r=>(i.red=ae(n.red,s.red,r),i.green=ae(n.green,s.green,r),i.blue=ae(n.blue,s.blue,r),i.alpha=V(n.alpha,s.alpha,r),it.transform(i))},Ae=new Set(["none","hidden"]);function la(t,e){return Ae.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ua(t,e){return n=>V(t,e,n)}function en(t){return typeof t=="number"?ua:typeof t=="string"?We(t)?Ut:M.test(t)?En:fa:Array.isArray(t)?Ai:typeof t=="object"?M.test(t)?En:ca:Ut}function Ai(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>en(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function ca(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=en(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function ha(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[r]=l,i[o]++}return s}const fa=(t,e)=>{const n=J.createTransformer(e),s=At(t),i=At(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ae.has(t)&&!i.values.length||Ae.has(e)&&!s.values.length?la(t,e):$(Ai(ha(s,i),i.values),n):Ut(t,e)};function wi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?V(t,e,n):en(t)(t,e)}function da(t,e,n){const s=[],i=n||wi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||L:e;a=$(l,a)}s.push(a)}return s}function pa(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(ge(r===e.length),r===1)return()=>e[0];if(r===2&&t[0]===t[1])return()=>e[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=da(e,s,i),a=o.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const h=wt(t[c],t[c+1],u);return o[c](h)};return n?u=>l(Z(t[0],t[r-1],u)):l}function ma(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=wt(0,e,s);t.push(V(n,1,i))}}function ga(t){const e=[0];return ma(e,t.length-1),e}function ya(t,e){return t.map(n=>n*e)}function va(t,e){return t.map(()=>e||xi).splice(0,t.length-1)}function Wt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=ea(s)?s.map(Rn):Rn(s),r={done:!1,value:e[0]},o=ya(n&&n.length===e.length?n:ga(e),t),a=pa(o,e,{ease:Array.isArray(i)?i:va(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Ln=2e4;function xa(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Ln;)e+=n,s=t.next(e);return e>=Ln?1/0:e}const Pa=t=>{const e=({timestamp:n})=>t(n);return{start:()=>w.update(e,!0),stop:()=>H(e),now:()=>R.isProcessing?R.timestamp:q.now()}},Ta={decay:Cn,inertia:Cn,tween:Wt,keyframes:Wt,spring:yi},Sa=t=>t/100;class nn extends pi{constructor({KeyframeResolver:e=qe,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:s,motionValue:i,keyframes:r}=this.options,o=(a,l)=>this.onKeyframesResolved(a,l);s&&i&&i.owner?this.resolver=i.owner.resolveKeyframes(r,o,s,i):this.resolver=new e(r,o,s,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=Ta[n]||Wt;let l,u;a!==Wt&&typeof e[0]!="number"&&(l=$(Sa,wi(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});r==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=xa(c));const{calculatedDuration:h}=c,f=h+i,d=f*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:d}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:f,repeat:d,repeatType:p,repeatDelay:g,onUpdate:P}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-f*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let m=this.currentTime,S=r;if(d){const A=Math.min(this.currentTime,c)/h;let k=Math.floor(A),j=A%1;!j&&A>=1&&(j=1),j===1&&k--,k=Math.min(k,d+1),!!(k%2)&&(p==="reverse"?(j=1-j,g&&(j-=g/h)):p==="mirror"&&(S=o)),m=Z(0,1,j)*h}const b=y?{done:!1,value:l[0]}:S.next(m);a&&(b.value=a(b.value));let{done:C}=b;!y&&u!==null&&(C=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return N&&i!==void 0&&(b.value=Jt(l,this.options,i)),P&&P(b.value),N&&this.finish(),b}get duration(){const{resolved:e}=this;return e?z(e.calculatedDuration):0}get time(){return z(this.currentTime)}set time(e){e=Y(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=z(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Pa,onPlay:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Vi=t=>Array.isArray(t)&&typeof t[0]=="number";function Ci(t){return!!(!t||typeof t=="string"&&t in sn||Vi(t)||Array.isArray(t)&&t.every(Ci))}const gt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,sn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gt([0,.65,.55,1]),circOut:gt([.55,0,1,.45]),backIn:gt([.31,.01,.66,-.59]),backOut:gt([.33,1.53,.69,.99])};function ba(t){return Di(t)||sn.easeOut}function Di(t){if(t)return Vi(t)?gt(t):Array.isArray(t)?t.map(ba):sn[t]}function Aa(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=Di(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}const wa=di(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Kt=10,Va=2e4;function Ca(t){return t.type==="spring"||!Ci(t.ease)}function Da(t,e){const n=new nn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<Va;)s=n.sample(r),i.push(s.value),r+=Kt;return{times:void 0,keyframes:i,duration:r-Kt,ease:"linear"}}class Fn extends pi{constructor(e){super(e);const{name:n,motionValue:s,keyframes:i}=this.options;this.resolver=new fi(i,(r,o)=>this.onKeyframesResolved(r,o),n,s),this.resolver.scheduleResolve()}initPlayback(e,n){var s;let{duration:i=300,times:r,ease:o,type:a,motionValue:l,name:u}=this.options;if(!(!((s=l.owner)===null||s===void 0)&&s.current))return!1;if(Ca(this.options)){const{onComplete:h,onUpdate:f,motionValue:d,...p}=this.options,g=Da(e,p);e=g.keyframes,e.length===1&&(e[1]=e[0]),i=g.duration,r=g.times,o=g.ease,a="keyframes"}const c=Aa(l.owner.current,u,e,{...this.options,duration:i,times:r,ease:o});return c.startTime=q.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;l.set(Jt(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:i,times:r,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return z(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return z(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=Y(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return L;const{animation:s}=n;s.timeline=e,s.onfinish=null}return L}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:r,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:h,...f}=this.options,d=new nn({...f,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),p=Y(this.time);u.setWithVelocity(d.sample(p-Kt).value,d.sample(p).value,Kt)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=e;return wa()&&s&&Ks.has(s)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}function Ra(t,e){let n;const s=()=>{const{currentTime:i}=e,o=(i===null?0:i.value)/100;n!==o&&t(o),n=o};return w.update(s,!0),()=>H(s)}const Ma=di(()=>window.ScrollTimeline!==void 0);class Ea{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e){const n=this.animations.map(s=>{if(Ma()&&s.attachTimeline)s.attachTimeline(e);else return s.pause(),Ra(i=>{s.time=s.duration*i},e)});return()=>{n.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const on=(t,e,n,s={},i,r,o)=>a=>{const l=Ye(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c=c-Y(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:d=>{e.set(d),l.onUpdate&&l.onUpdate(d)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),o&&o()},onStop:o,name:t,motionValue:e,element:r?void 0:i};hr(l)||(h={...h,...cr(t,h)}),h.duration&&(h.duration=Y(h.duration)),h.repeatDelay&&(h.repeatDelay=Y(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let f=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(f=!0)),f&&!r&&e.get()!==void 0){const d=Jt(h.keyframes,l);if(d!==void 0)return w.update(()=>{h.onUpdate(d),h.onComplete()}),new Ea([])}return!r&&Fn.supports(h)?new Fn(h):new nn(h)};class rn{constructor(){this.subscriptions=[]}add(e){return Xt(this.subscriptions,e),()=>Yt(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Bn=30,La=t=>!isNaN(parseFloat(t));class Ri{constructor(e,n={}){this.version="11.3.21",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=q.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=q.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=La(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new rn);const s=this.events[e].add(n);return e==="change"?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=q.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Bn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Bn);return mi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 Vt(t,e){return new Ri(t,e)}function Fa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vt(n))}function Ba(t,e){const n=Zt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Ko(r[o]);Fa(t,o,a)}}function Mi(t){return t.getProps()[ws]}class ka extends Ri{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const n=_s(e);if(!n)return;const s=this.counts.get(n)||0;this.counts.set(n,s+1),s===0&&(this.output.push(n),this.update());let i=!1;return()=>{if(i)return;i=!0;const r=this.counts.get(n)-1;this.counts.set(n,r),r===0&&(Yt(this.output,n),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function ja(t){return!!(E(t)&&t.add)}function we(t,e){var n;if(!t.applyWillChange)return;let s=t.getValue("willChange");if(!s&&!(!((n=t.props.style)===null||n===void 0)&&n.willChange)&&(s=new ka("auto"),t.addValue("willChange",s)),ja(s))return s.add(e)}function Ia({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ei(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const f=t.getValue(h,(r=t.latestValues[h])!==null&&r!==void 0?r:null),d=l[h];if(d===void 0||c&&Ia(c,h))continue;const p={delay:n,elapsed:0,...Ye(o||{},h)};let g=!1;if(window.HandoffAppearAnimations){const v=Mi(t);if(v){const y=window.HandoffAppearAnimations(v,h,f,w);y!==null&&(p.elapsed=y,g=!0)}}f.start(on(h,f,d,t.shouldReduceMotion&&Q.has(h)?{type:!1}:p,t,g,we(t,h)));const P=f.animation;P&&u.push(P)}return a&&Promise.all(u).then(()=>{w.update(()=>{a&&Ba(t,a)})}),u}function Ve(t,e,n={}){var s;const i=Zt(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(Ei(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=r;return Oa(t,e,c+u,h,f,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function Oa(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(Na).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Ve(u,e,{...r,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function Na(t,e){return t.sortNodePosition(e)}function Ua(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ve(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ve(t,e,n);else{const i=typeof e=="function"?Zt(t,e,n.custom):e;s=Promise.all(Ei(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Wa=[...ke].reverse(),Ka=ke.length;function _a(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ua(t,n,s)))}function Ga(t){let e=_a(t),n=kn(),s=!0;const i=l=>(u,c)=>{var h;const f=Zt(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(f){const{transition:d,transitionEnd:p,...g}=f;u={...u,...g,...p}}return u};function r(l){e=l(t)}function o(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},h=[],f=new Set;let d={},p=1/0;for(let P=0;P<Ka;P++){const v=Wa[P],y=n[v],m=u[v]!==void 0?u[v]:c[v],S=St(m),b=v===l?y.isActive:null;b===!1&&(p=P);let C=m===c[v]&&m!==u[v]&&S;if(C&&s&&t.manuallyAnimateOnMount&&(C=!1),y.protectedKeys={...d},!y.isActive&&b===null||!m&&!y.prevProp||bt(m)||typeof m=="boolean")continue;let A=$a(y.prevProp,m)||v===l&&y.isActive&&!C&&S||P>p&&S,k=!1;const j=Array.isArray(m)?m:[m];let rt=j.reduce(i(v),{});b===!1&&(rt={});const{prevResolvedValues:an={}}=y,to={...an,...rt},ln=F=>{A=!0,f.has(F)&&(k=!0,f.delete(F)),y.needsAnimating[F]=!0;const K=t.getValue(F);K&&(K.liveStyle=!1)};for(const F in to){const K=rt[F],Qt=an[F];if(d.hasOwnProperty(F))continue;let te=!1;ye(K)&&ye(Qt)?te=!Js(K,Qt):te=K!==Qt,te?K!=null?ln(F):f.add(F):K!==void 0&&f.has(F)?ln(F):y.protectedKeys[F]=!0}y.prevProp=m,y.prevResolvedValues=rt,y.isActive&&(d={...d,...rt}),s&&t.blockInitialAnimation&&(A=!1),A&&(!C||k)&&h.push(...j.map(F=>({animation:F,options:{type:v}})))}if(f.size){const P={};f.forEach(v=>{const y=t.getBaseTarget(v),m=t.getValue(v);m&&(m.liveStyle=!0),P[v]=y??null}),h.push({animation:P})}let g=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var d;return(d=f.animationState)===null||d===void 0?void 0:d.setActive(l,u)}),n[l].isActive=u;const h=o(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=kn(),s=!0}}}function $a(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Js(e,t):!1}function et(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kn(){return{animate:et(!0),whileInView:et(),whileHover:et(),whileTap:et(),whileDrag:et(),whileFocus:et(),exit:et()}}class za extends tt{constructor(e){super(e),e.animationState||(e.animationState=Ga(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();bt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Ha=0;class Xa extends tt{constructor(){super(...arguments),this.id=Ha++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Li={animation:{Feature:za},exit:{Feature:Xa}},jn=(t,e)=>Math.abs(t-e);function Ya(t,e){const n=jn(t.x,e.x),s=jn(t.y,e.y);return Math.sqrt(n**2+s**2)}class Fi{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:r=!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 h=ue(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=Ya(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:p}=h,{timestamp:g}=R;this.history.push({...p,timestamp:g});const{onStart:P,onMove:v}=this.handlers;f||(P&&P(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=le(f,this.transformPagePoint),w.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=ue(h.type==="pointercancel"?this.lastMoveEventInfo:le(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,P),p&&p(h,P)},!zs(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=qt(e),a=le(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=R;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,ue(a,this.history)),this.removeListeners=$(G(this.contextWindow,"pointermove",this.handlePointerMove),G(this.contextWindow,"pointerup",this.handlePointerUp),G(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),H(this.updatePoint)}}function le(t,e){return e?{point:e(t.point)}:t}function In(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ue({point:t},e){return{point:t,delta:In(t,Bi(e)),offset:In(t,qa(e)),velocity:Za(e,.1)}}function qa(t){return t[0]}function Bi(t){return t[t.length-1]}function Za(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Bi(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Y(e)));)n--;if(!s)return{x:0,y:0};const r=z(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const ki=1e-4,Ja=1-ki,Qa=1+ki,ji=.01,tl=0-ji,el=0+ji;function B(t){return t.max-t.min}function nl(t,e,n){return Math.abs(t-e)<=n}function On(t,e,n,s=.5){t.origin=s,t.originPoint=V(e.min,e.max,t.origin),t.scale=B(n)/B(e),t.translate=V(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Ja&&t.scale<=Qa||isNaN(t.scale))&&(t.scale=1),(t.translate>=tl&&t.translate<=el||isNaN(t.translate))&&(t.translate=0)}function Pt(t,e,n,s){On(t.x,e.x,n.x,s?s.originX:void 0),On(t.y,e.y,n.y,s?s.originY:void 0)}function Nn(t,e,n){t.min=n.min+e.min,t.max=t.min+B(e)}function sl(t,e,n){Nn(t.x,e.x,n.x),Nn(t.y,e.y,n.y)}function Un(t,e,n){t.min=e.min-n.min,t.max=t.min+B(e)}function Tt(t,e,n){Un(t.x,e.x,n.x),Un(t.y,e.y,n.y)}function il(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?V(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?V(n,t,s.max):Math.min(t,n)),t}function Wn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ol(t,{top:e,left:n,bottom:s,right:i}){return{x:Wn(t.x,n,i),y:Wn(t.y,e,s)}}function Kn(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function rl(t,e){return{x:Kn(t.x,e.x),y:Kn(t.y,e.y)}}function al(t,e){let n=.5;const s=B(t),i=B(e);return i>s?n=wt(e.min,e.max-s,t.min):s>i&&(n=wt(t.min,t.max-i,e.min)),Z(0,1,n)}function ll(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Ce=.35;function ul(t=Ce){return t===!1?t=0:t===!0&&(t=Ce),{x:_n(t,"left","right"),y:_n(t,"top","bottom")}}function _n(t,e,n){return{min:Gn(t,e),max:Gn(t,n)}}function Gn(t,e){return typeof t=="number"?t:t[e]||0}const $n=()=>({translate:0,scale:1,origin:0,originPoint:0}),ut=()=>({x:$n(),y:$n()}),zn=()=>({min:0,max:0}),D=()=>({x:zn(),y:zn()});function O(t){return[t("x"),t("y")]}function Ii({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function cl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function hl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ce(t){return t===void 0||t===1}function De({scale:t,scaleX:e,scaleY:n}){return!ce(t)||!ce(e)||!ce(n)}function nt(t){return De(t)||Oi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Oi(t){return Hn(t.x)||Hn(t.y)}function Hn(t){return t&&t!=="0%"}function _t(t,e,n){const s=t-n,i=e*s;return n+i}function Xn(t,e,n,s,i){return i!==void 0&&(t=_t(t,i,s)),_t(t,n,s)+e}function Re(t,e=0,n=1,s,i){t.min=Xn(t.min,e,n,s,i),t.max=Xn(t.max,e,n,s,i)}function Ni(t,{x:e,y:n}){Re(t.x,e.translate,e.scale,e.originPoint),Re(t.y,n.translate,n.scale,n.originPoint)}const Yn=.999999999999,qn=1.0000000000001;function fl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ht(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ni(t,o)),s&&nt(r.latestValues)&&ht(t,r.latestValues))}e.x<qn&&e.x>Yn&&(e.x=1),e.y<qn&&e.y>Yn&&(e.y=1)}function ct(t,e){t.min=t.min+e,t.max=t.max+e}function Zn(t,e,n,s,i=.5){const r=V(t.min,t.max,i);Re(t,e,n,r,s)}function ht(t,e){Zn(t.x,e.x,e.scaleX,e.scale,e.originX),Zn(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ui(t,e){return Ii(hl(t.getBoundingClientRect(),e))}function dl(t,e,n){const s=Ui(t,n),{scroll:i}=e;return i&&(ct(s.x,i.offset.x),ct(s.y,i.offset.y)),s}const Wi=({current:t})=>t?t.ownerDocument.defaultView:null,pl=new WeakMap;class ml{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=D(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(qt(c,"page").point)},r=(c,h)=>{var f;const{drag:d,dragPropagation:p,onDragStart:g}=this.getProps();if(d&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Xs(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),O(v=>{let y=this.getAxisMotionValue(v).get()||0;if(W.test(y)){const{projection:m}=this.visualElement;if(m&&m.layout){const S=m.layout.layoutBox[v];S&&(y=B(S)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&w.postRender(()=>g(c,h)),(f=this.removeWillChange)===null||f===void 0||f.call(this),this.removeWillChange=we(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},o=(c,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:p,onDrag:g}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:P}=h;if(d&&this.currentDirection===null){this.currentDirection=gl(P),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,P),this.updateAxis("y",h.point,P),this.visualElement.render(),g&&g(c,h)},a=(c,h)=>this.stop(c,h),l=()=>O(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Fi(e,{onSessionStart:i,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Wi(this.visualElement)})}stop(e,n){var s;(s=this.removeWillChange)===null||s===void 0||s.call(this);const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&w.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ft(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=il(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,r=this.constraints;n&&at(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=ol(i.layoutBox,n):this.constraints=!1,this.elastic=ul(s),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&O(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ll(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!at(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=dl(s,i.root,this.visualElement.getTransformPagePoint());let o=rl(i.layout.layoutBox,r);if(n){const a=n(cl(o));this.hasMutatedConstraints=!!a,a&&(o=Ii(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=O(c=>{if(!Ft(c,n,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return s.start(on(e,s,0,n,this.visualElement,!1,we(this.visualElement,e)))}stopAnimation(){O(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){O(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){O(n=>{const{drag:s}=this.getProps();if(!Ft(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-V(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!at(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};O(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=al({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),O(o=>{if(!Ft(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(V(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;pl.set(this.visualElement,this);const e=this.visualElement.current,n=G(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();at(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),w.read(s);const o=_(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(O(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Ce,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ft(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function gl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class yl extends tt{constructor(e){super(e),this.removeGroupControls=L,this.removeListeners=L,this.controls=new ml(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}}const Jn=t=>(e,n)=>{t&&w.postRender(()=>t(e,n))};class vl extends tt{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(e){this.session=new Fi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Wi(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Jn(e),onStart:Jn(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&w.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=G(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function xl(){const t=x.useContext($t);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=x.useId();x.useEffect(()=>s(i),[]);const r=x.useCallback(()=>n&&n(i),[i,n]);return!e&&n?[!1,r]:[!0]}const It={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Qn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const mt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Qn(t,e.target.x),s=Qn(t,e.target.y);return`${n}% ${s}%`}},Pl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=J.parse(t);if(i.length>5)return s;const r=J.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=V(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}};class Tl extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;vo(Sl),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),It.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,o=s.projection;return o&&(o.isPresent=r,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||w.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Be.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ki(t){const[e,n]=xl(),s=x.useContext(Ie);return U.jsx(Tl,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(Cs),isPresent:e,safeToRemove:n})}const Sl={borderRadius:{...mt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomLeftRadius:mt,borderBottomRightRadius:mt,boxShadow:Pl},_i=["TopLeft","TopRight","BottomLeft","BottomRight"],bl=_i.length,ts=t=>typeof t=="string"?parseFloat(t):t,es=t=>typeof t=="number"||T.test(t);function Al(t,e,n,s,i,r){i?(t.opacity=V(0,n.opacity!==void 0?n.opacity:1,wl(s)),t.opacityExit=V(e.opacity!==void 0?e.opacity:1,0,Vl(s))):r&&(t.opacity=V(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<bl;o++){const a=`border${_i[o]}Radius`;let l=ns(e,a),u=ns(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||es(l)===es(u)?(t[a]=Math.max(V(ts(l),ts(u),s),0),(W.test(u)||W.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=V(e.rotate||0,n.rotate||0,s))}function ns(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const wl=Gi(0,.5,Si),Vl=Gi(.5,.95,L);function Gi(t,e,n){return s=>s<t?0:s>e?1:n(wt(t,e,s))}function ss(t,e){t.min=e.min,t.max=e.max}function I(t,e){ss(t.x,e.x),ss(t.y,e.y)}function is(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function os(t,e,n,s,i){return t-=e,t=_t(t,1/n,s),i!==void 0&&(t=_t(t,1/i,s)),t}function Cl(t,e=0,n=1,s=.5,i,r=t,o=t){if(W.test(e)&&(e=parseFloat(e),e=V(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=V(r.min,r.max,s);t===r&&(a-=e),t.min=os(t.min,e,n,a,i),t.max=os(t.max,e,n,a,i)}function rs(t,e,[n,s,i],r,o){Cl(t,e[n],e[s],e[i],e.scale,r,o)}const Dl=["x","scaleX","originX"],Rl=["y","scaleY","originY"];function as(t,e,n,s){rs(t.x,e,Dl,n?n.x:void 0,s?s.x:void 0),rs(t.y,e,Rl,n?n.y:void 0,s?s.y:void 0)}function ls(t){return t.translate===0&&t.scale===1}function $i(t){return ls(t.x)&&ls(t.y)}function us(t,e){return t.min===e.min&&t.max===e.max}function Ml(t,e){return us(t.x,e.x)&&us(t.y,e.y)}function cs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function zi(t,e){return cs(t.x,e.x)&&cs(t.y,e.y)}function hs(t){return B(t.x)/B(t.y)}function fs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class El{constructor(){this.members=[]}add(e){Xt(this.members,e),e.scheduleRender()}remove(e){if(Yt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ll(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Fl=(t,e)=>t.depth-e.depth;class Bl{constructor(){this.children=[],this.isDirty=!1}add(e){Xt(this.children,e),this.isDirty=!0}remove(e){Yt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Fl),this.isDirty=!1,this.children.forEach(e)}}function kl(t,e){const n=q.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(H(s),t(r-e))};return w.read(s,!0),()=>H(s)}function jl(t){return t instanceof SVGElement&&t.tagName!=="svg"}function Il(t,e,n){const s=E(t)?t:Vt(t);return s.start(on("",s,e,n)),s.animation}const st={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},yt=typeof window<"u"&&window.MotionDebug!==void 0,he=["","X","Y","Z"],Ol={visibility:"hidden"},ds=1e3;let Nl=0;function fe(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Hi(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?Mi(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?Hi(t.parent):!1:!1}function Xi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Nl++,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,yt&&(st.totalNodes=st.resolvedTargetDeltas=st.recalculatedProjection=0),this.nodes.forEach(Kl),this.nodes.forEach(Hl),this.nodes.forEach(Xl),this.nodes.forEach(_l),yt&&window.MotionDebug.record(st)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Bl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new rn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=jl(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=kl(f,250),It.hasAnimatedSinceResize&&(It.hasAnimatedSinceResize=!1,this.nodes.forEach(ms))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||Ql,{onLayoutAnimationStart:P,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!zi(this.targetLayout,p)||d,m=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||m||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,m);const S={...Ye(g,"layout"),onPlay:P,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else f||ms(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,H(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(Yl),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.HandoffCancelAllAnimations&&Hi(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ps);return}this.isUpdating||this.nodes.forEach($l),this.isUpdating=!1,this.nodes.forEach(zl),this.nodes.forEach(Ul),this.nodes.forEach(Wl),this.clearAllSnapshots();const a=q.now();R.delta=Z(0,1e3/60,a-R.timestamp),R.timestamp=a,R.isProcessing=!0,ee.update.process(R),ee.preRender.process(R),ee.render.process(R),R.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Be.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gl),this.sharedNodes.forEach(ql)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,w.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){w.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=D(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!$i(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||nt(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),tu(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return D();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(eu))){const{scroll:c}=this.root;c&&(ct(l.x,c.offset.x),ct(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=D();if(I(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&I(l,o),ct(l.x,h.offset.x),ct(l.y,h.offset.y))}return l}applyTransform(o,a=!1){const l=D();I(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ht(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),nt(c.latestValues)&&ht(l,c.latestValues)}return nt(this.latestValues)&&ht(l,this.latestValues),l}removeTransform(o){const a=D();I(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!nt(u.latestValues))continue;De(u.latestValues)&&u.updateSnapshot();const c=D(),h=u.measurePageBox();I(c,h),as(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return nt(this.latestValues)&&as(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==R.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=R.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),Tt(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),I(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=D(),this.targetWithTransforms=D()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):I(this.target,this.layout.layoutBox),Ni(this.target,this.targetDelta)):I(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=D(),this.relativeTargetOrigin=D(),Tt(this.relativeTargetOrigin,this.target,d.target),I(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}yt&&st.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||De(this.parent.latestValues)||Oi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===R.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||h))return;I(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;fl(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=D());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(is(this.prevProjectionDelta.x,this.projectionDelta.x),is(this.prevProjectionDelta.y,this.projectionDelta.y)),Pt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!fs(this.projectionDelta.x,this.prevProjectionDelta.x)||!fs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),yt&&st.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ut(),this.projectionDelta=ut(),this.projectionDeltaWithTransform=ut()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=ut();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=D(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=d!==p,P=this.getStack(),v=!P||P.members.length<=1,y=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(Jl));this.animationProgress=0;let m;this.mixTargetDelta=S=>{const b=S/1e3;gs(h.x,o.x,b),gs(h.y,o.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Zl(this.relativeTarget,this.relativeTargetOrigin,f,b),m&&Ml(this.relativeTarget,m)&&(this.isProjectionDirty=!1),m||(m=D()),I(m,this.relativeTarget)),g&&(this.animationValues=c,Al(c,u,this.latestValues,b,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(H(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=w.update(()=>{It.hasAnimatedSinceResize=!0,this.currentAnimation=Il(0,ds,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ds),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Yi(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||D();const h=B(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=B(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}I(a,l),ht(a,c),Pt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new El),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&fe("z",o,u,this.animationValues);for(let c=0;c<he.length;c++)fe(`rotate${he[c]}`,o,u,this.animationValues),fe(`skew${he[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ol;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=kt(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=kt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!nt(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=Ll(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:d,y:p}=this.projectionDelta;u.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,h.animationValues?u.opacity=h===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=h===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in Ot){if(f[g]===void 0)continue;const{correct:P,applyTo:v}=Ot[g],y=u.transform==="none"?f[g]:P(f[g],h);if(v){const m=v.length;for(let S=0;S<m;S++)u[v[S]]=y}else u[g]=y}return this.options.layoutId&&(u.pointerEvents=h===this?kt(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(ps),this.root.sharedNodes.clear()}}}function Ul(t){t.updateLayout()}function Wl(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;r==="size"?O(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=B(f);f.min=s[h].min,f.max=f.min+d}):Yi(r,n.layoutBox,s)&&O(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=B(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=ut();Pt(a,s,n.layoutBox);const l=ut();o?Pt(l,t.applyTransform(i,!0),n.measuredBox):Pt(l,s,n.layoutBox);const u=!$i(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=D();Tt(p,n.layoutBox,f.layoutBox);const g=D();Tt(g,s,d.layoutBox),zi(p,g)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Kl(t){yt&&st.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function _l(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Gl(t){t.clearSnapshot()}function ps(t){t.clearMeasurements()}function $l(t){t.isLayoutDirty=!1}function zl(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ms(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Hl(t){t.resolveTargetDelta()}function Xl(t){t.calcProjection()}function Yl(t){t.resetSkewAndRotation()}function ql(t){t.removeLeadSnapshot()}function gs(t,e,n){t.translate=V(e.translate,0,n),t.scale=V(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ys(t,e,n,s){t.min=V(e.min,n.min,s),t.max=V(e.max,n.max,s)}function Zl(t,e,n,s){ys(t.x,e.x,n.x,s),ys(t.y,e.y,n.y,s)}function Jl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Ql={duration:.45,ease:[.4,0,.1,1]},vs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xs=vs("applewebkit/")&&!vs("chrome/")?Math.round:L;function Ps(t){t.min=xs(t.min),t.max=xs(t.max)}function tu(t){Ps(t.x),Ps(t.y)}function Yi(t,e,n){return t==="position"||t==="preserve-aspect"&&!nl(hs(e),hs(n),.2)}function eu(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const nu=Xi({attachResizeListener:(t,e)=>_(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),de={current:void 0},qi=Xi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!de.current){const t=new nu({});t.mount(window),t.setOptions({layoutScroll:!0}),de.current=t}return de.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),su={pan:{Feature:vl},drag:{Feature:yl,ProjectionNode:qi,MeasureLayout:Ki}},Me={current:null},Zi={current:!1};function iu(){if(Zi.current=!0,!!Le)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Me.current=t.matches;t.addListener(e),e()}else Me.current=!1}function ou(t,e,n){for(const s in e){const i=e[s],r=n[s];if(E(i))t.addValue(s,i);else if(E(r))t.addValue(s,Vt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Vt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ts=new WeakMap,ru=[...si,M,J],au=t=>ru.find(ni(t)),Ss=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],lu=je.length;class uu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.applyWillChange=!1,this.resolveKeyframes=(f,d,p,g)=>new this.KeyframeResolver(f,d,p,g,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,w.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Ht(n),this.isVariantNode=Rs(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&E(d)&&d.set(l[f],!1)}}mount(e){this.current=e,Ts.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Zi.current||iu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Me.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ts.delete(this.current),this.projection&&this.projection.unmount(),H(this.notifyUpdate),H(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){const s=Q.has(e),i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ft){const n=ft[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):D()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Ss.length;s++){const i=Ss[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=ou(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const n={};for(let s=0;s<lu;s++){const i=je[s],r=this.props[i];(St(r)||r===!1)&&(n[i]=r)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Vt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(ti(i)||Qs(i))?i=parseFloat(i):!au(i)&&J.test(n)&&(i=hi(e,n)),this.setBaseTarget(e,E(i)?i.get():i)),E(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=He(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!E(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new rn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Ji extends uu{constructor(){super(...arguments),this.KeyframeResolver=fi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}}function cu(t){return window.getComputedStyle(t)}class hu extends Ji{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Os}readValueFromInstance(e,n){if(Q.has(n)){const s=Je(n);return s&&s.default||0}else{const s=cu(e),i=(Bs(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ui(e,n)}build(e,n,s){Ke(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return ze(e,n,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;E(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class fu extends Ji{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=D}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Q.has(n)){const s=Je(n);return s&&s.default||0}return n=Ns.has(n)?n:zt(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Ws(e,n,s)}build(e,n,s){Ge(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){Us(e,n,s,i)}mount(e){this.isSVGTag=$e(e.tagName),super.mount(e)}}const Qi=(t,e)=>Oe(t)?new fu(e):new hu(e,{allowProjection:t!==x.Fragment}),du={layout:{ProjectionNode:qi,MeasureLayout:Ki}},pu={...Li,...Zs,...su,...du},Vu=Ms((t,e)=>$s(t,e,pu,Qi)),Cu=Ms($s);class mu extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function gu({children:t,isPresent:e}){const n=x.useId(),s=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0}),{nonce:r}=x.useContext(Ee);return x.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=i.current;if(e||!s.current||!o||!a)return;s.current.dataset.motionPopId=n;const c=document.createElement("style");return r&&(c.nonce=r),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
[data-motion-pop-id="${n}"] {
position: absolute !important;
width: ${o}px !important;
height: ${a}px !important;
top: ${l}px !important;
left: ${u}px !important;
}
`),()=>{document.head.removeChild(c)}},[e]),U.jsx(mu,{isPresent:e,childRef:s,sizeRef:i,children:x.cloneElement(t,{ref:s})})}const yu=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o})=>{const a=Xe(vu),l=x.useId(),u=x.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:c=>{a.set(c,!0);for(const h of a.values())if(!h)return;s&&s()},register:c=>(a.set(c,!1),()=>a.delete(c))}),r?[Math.random()]:[n]);return x.useMemo(()=>{a.forEach((c,h)=>a.set(h,!1))},[n]),x.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),o==="popLayout"&&(t=U.jsx(gu,{isPresent:n,children:t})),U.jsx($t.Provider,{value:u,children:t})};function vu(){return new Map}const Bt=t=>t.key||"";function bs(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const Du=({children:t,exitBeforeEnter:e,custom:n,initial:s=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:o="sync"})=>{const a=x.useMemo(()=>bs(t),[t]),l=a.map(Bt),u=x.useRef(!0),c=x.useRef(a),h=Xe(()=>new Map),[f,d]=x.useState(a),[p,g]=x.useState(a);As(()=>{u.current=!1,c.current=a;for(let y=0;y<p.length;y++){const m=Bt(p[y]);l.includes(m)?h.delete(m):h.get(m)!==!0&&h.set(m,!1)}},[p,l.length,l.join("-")]);const P=[];if(a!==f){let y=[...a];for(let m=0;m<p.length;m++){const S=p[m],b=Bt(S);l.includes(b)||(y.splice(m,0,S),P.push(S))}o==="wait"&&P.length&&(y=P),g(bs(y)),d(a);return}const{forceRender:v}=x.useContext(Ie);return U.jsx(U.Fragment,{children:p.map(y=>{const m=Bt(y),S=a===p||l.includes(m),b=()=>{if(h.has(m))h.set(m,!0);else return;let C=!0;h.forEach(N=>{N||(C=!1)}),C&&(v==null||v(),g(c.current),i&&i())};return U.jsx(yu,{isPresent:S,initial:!u.current||s?void 0:!1,custom:S?void 0:n,presenceAffectsLayout:r,mode:o,onExitComplete:S?void 0:b,children:y},m)})})};function Ru({children:t,features:e,strict:n=!1}){const[,s]=x.useState(!pe(e)),i=x.useRef(void 0);if(!pe(e)){const{renderer:r,...o}=e;i.current=r,me(o)}return x.useEffect(()=>{pe(e)&&e().then(({renderer:r,...o})=>{me(o),i.current=r,s(!0)})},[]),U.jsx(Fe.Provider,{value:{renderer:i.current,strict:n},children:t})}function pe(t){return typeof t=="function"}const Mu={renderer:Qi,...Li,...Zs};function xu(t,e,n){return typeof t=="string"?t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Pu={some:0,all:1};function Tu(t,e,{root:n,margin:s,amount:i="some"}={}){const r=xu(t),o=new WeakMap,a=u=>{u.forEach(c=>{const h=o.get(c.target);if(c.isIntersecting!==!!h)if(c.isIntersecting){const f=e(c);typeof f=="function"?o.set(c.target,f):l.unobserve(c.target)}else h&&(h(c),o.delete(c.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:s,threshold:typeof i=="number"?i:Pu[i]});return r.forEach(u=>l.observe(u)),()=>l.disconnect()}function Eu(t,{root:e,margin:n,amount:s,once:i=!1}={}){const[r,o]=x.useState(!1);return x.useEffect(()=>{if(!t.current||i&&r)return;const a=()=>(o(!0),i?void 0:()=>o(!1)),l={root:e&&e.current||void 0,margin:n,amount:s};return Tu(t.current,a,l)},[e,t,n,i,s]),r}export{Du as A,Ru as L,Vu as a,Mu as d,Cu as m,Eu as u};
//# sourceMappingURL=animations.CVpoelRy.js.map