framer-motion 12.4.12 → 12.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useId as s,useEffect as o,useCallback as r,Component as a,useMemo as l,useLayoutEffect as u,useRef as h,useInsertionEffect as c,forwardRef as d,Fragment as p,createElement as m}from"react";function f(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function v(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function g(t,e,n,i){if("function"==typeof e){const[s,o]=v(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=v(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function y(t,e,n){const i=t.getProps();return g(i,e,void 0!==n?n:i.custom,t)}const x=t=>t;let P=x;function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const w=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},S=t=>1e3*t,b=t=>t/1e3,A=T(()=>void 0!==window.ScrollTimeline);class E extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>A()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function V(t,e){return t?t[e]||t.default||t:void 0}function M(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function D(t){return"function"==typeof t}function C(t,e){t.timeline=e,t.onfinish=null}const R=t=>Array.isArray(t)&&"number"==typeof t[0],k={linearEasing:void 0};function L(t,e){const n=T(t);return()=>{var t;return null!==(t=k[e])&&void 0!==t?t:n()}}const B=L(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),j=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(w(0,s-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`};function F(t){return Boolean("function"==typeof t&&B()||!t||"string"==typeof t&&(t in I||B())||R(t)||Array.isArray(t)&&t.every(F))}const O=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,I={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:O([0,.65,.55,1]),circOut:O([.55,0,1,.45]),backIn:O([.31,.01,.66,-.59]),backOut:O([.33,1.53,.69,.99])};const U={x:!1,y:!1};function N(){return U.x||U.y}function W(t,e){const n=function(t,e,n){var i;if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const o=null!==(i=null==n?void 0:n[t])&&void 0!==i?i:s.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function $(t){return!("touch"===t.pointerType||N())}function Y(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const K=(t,e)=>!!e&&(t===e||K(t,e.parentElement)),X=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,z=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const H=new WeakSet;function G(t){return e=>{"Enter"===e.key&&t(e)}}function q(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Z(t){return X(t)&&!N()}function _(t,e,n={}){const[i,s,o]=W(t,n),r=t=>{const n=t.currentTarget;if(!n||!Z(t)||H.has(n))return;H.add(n),Y(t,"set");const i=e(n,t),o=(t,e)=>{n.removeEventListener("pointerup",r),n.removeEventListener("pointercancel",a),Y(t,"release"),Z(t)&&H.has(n)&&(H.delete(n),"function"==typeof i&&i(t,{success:e}))},r=t=>{const e=!!t.isTrusted&&(i=t,s=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},i.clientX<s.left||i.clientX>s.right||i.clientY<s.top||i.clientY>s.bottom);var i,s;o(t,!e&&(!(n instanceof Element)||K(n,t.target)))},a=t=>{o(t,!1)};n.addEventListener("pointerup",r,s),n.addEventListener("pointercancel",a,s),n.addEventListener("lostpointercapture",a,s)};return i.forEach(t=>{let e=!1;var i;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,i=t,z.has(i.tagName)||-1!==i.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",r,s),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=G(()=>{if(H.has(n))return;q(n,"down");const t=G(()=>{q(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>q(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s),s)}),o}const J=!1,Q=["read","resolveKeyframes","update","preRender","render","postRender"],tt={value:null,addProjectionMetrics:null};function et(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Q.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){r.has(e)&&(h.schedule(e),t()),l++,e(a)}const h={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(u),e&&tt.value&&tt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,h.process(t)))}};return h}(o,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:h,render:c,postRender:d}=r,p=()=>{const o=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),h.process(s),c.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:Q.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Q.length;e++)r[Q[e]].cancel(t)},state:s,steps:r}}const{schedule:nt,cancel:it,state:st,steps:ot}=et("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:x,!0),rt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],at=new Set(rt),lt=new Set(["width","height","top","left","right","bottom",...rt]),ut=t=>Array.isArray(t);let ht;function ct(){ht=void 0}const dt={now:()=>(void 0===ht&&dt.set(st.isProcessing||J?st.timestamp:performance.now()),ht),set:t=>{ht=t,queueMicrotask(ct)}};function pt(t,e){-1===t.indexOf(e)&&t.push(e)}function mt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ft{constructor(){this.subscriptions=[]}add(t){return pt(this.subscriptions,t),()=>mt(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function vt(t,e){return e?t*(1e3/e):0}class gt{constructor(t,e={}){this.version="12.4.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=dt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ft);const n=this.events[t].add(e);return"change"===t?()=>{n(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return vt(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yt(t,e){return new gt(t,e)}function xt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}const Pt=t=>Boolean(t&&t.getVelocity);function Tt(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Pt(i)&&i.add))return n.add(e);var i}const wt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),St="data-"+wt("framerAppearId");function bt(t){return t.props[St]}const At=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Et(t,e,n,i){if(t===e&&n===i)return x;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=At(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:At(s(t),e,i)}const Vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Mt=t=>e=>1-t(1-e),Dt=Et(.33,1.53,.69,.99),Ct=Mt(Dt),Rt=Vt(Ct),kt=t=>(t*=2)<1?.5*Ct(t):.5*(2-Math.pow(2,-10*(t-1))),Lt=t=>1-Math.sin(Math.acos(t)),Bt=Mt(Lt),jt=Vt(Lt),Ft=t=>/^0[^.\s]+$/u.test(t);const Ot=(t,e,n)=>n>e?e:n<t?t:n,It={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Ut={...It,transform:t=>Ot(0,1,t)},Nt={...It,default:1},Wt=t=>Math.round(1e5*t)/1e5,$t=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Yt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Kt=(t,e)=>n=>Boolean("string"==typeof n&&Yt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Xt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match($t);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},zt={...It,transform:t=>Math.round((t=>Ot(0,255,t))(t))},Ht={test:Kt("rgb","red"),parse:Xt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+zt.transform(t)+", "+zt.transform(e)+", "+zt.transform(n)+", "+Wt(Ut.transform(i))+")"};const Gt={test:Kt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Ht.transform},qt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Zt=qt("deg"),_t=qt("%"),Jt=qt("px"),Qt=qt("vh"),te=qt("vw"),ee={..._t,parse:t=>_t.parse(t)/100,transform:t=>_t.transform(100*t)},ne={test:Kt("hsl","hue"),parse:Xt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+_t.transform(Wt(e))+", "+_t.transform(Wt(n))+", "+Wt(Ut.transform(i))+")"},ie={test:t=>Ht.test(t)||Gt.test(t)||ne.test(t),parse:t=>Ht.test(t)?Ht.parse(t):ne.test(t)?ne.parse(t):Gt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ht.transform(t):ne.transform(t)},se=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const oe=/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 re(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(oe,t=>(ie.test(t)?(i.color.push(o),s.push("color"),n.push(ie.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push("number"),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function ae(t){return re(t).values}function le(t){const{split:e,types:n}=re(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+="number"===e?Wt(t[o]):"color"===e?ie.transform(t[o]):t[o]}return s}}const ue=t=>"number"==typeof t?0:t;const he={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match($t))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(se))||void 0===n?void 0:n.length)||0)>0},parse:ae,createTransformer:le,getAnimatableNone:function(t){const e=ae(t);return le(t)(e.map(ue))}},ce=new Set(["brightness","contrast","saturate","opacity"]);function de(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match($t)||[];if(!i)return t;const s=n.replace(i,"");let o=ce.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const pe=/\b([a-z-]*)\(.*?\)/gu,me={...he,getAnimatableNone:t=>{const e=t.match(pe);return e?e.map(de).join(" "):t}},fe={borderWidth:Jt,borderTopWidth:Jt,borderRightWidth:Jt,borderBottomWidth:Jt,borderLeftWidth:Jt,borderRadius:Jt,radius:Jt,borderTopLeftRadius:Jt,borderTopRightRadius:Jt,borderBottomRightRadius:Jt,borderBottomLeftRadius:Jt,width:Jt,maxWidth:Jt,height:Jt,maxHeight:Jt,top:Jt,right:Jt,bottom:Jt,left:Jt,padding:Jt,paddingTop:Jt,paddingRight:Jt,paddingBottom:Jt,paddingLeft:Jt,margin:Jt,marginTop:Jt,marginRight:Jt,marginBottom:Jt,marginLeft:Jt,backgroundPositionX:Jt,backgroundPositionY:Jt},ve={rotate:Zt,rotateX:Zt,rotateY:Zt,rotateZ:Zt,scale:Nt,scaleX:Nt,scaleY:Nt,scaleZ:Nt,skew:Zt,skewX:Zt,skewY:Zt,distance:Jt,translateX:Jt,translateY:Jt,translateZ:Jt,x:Jt,y:Jt,z:Jt,perspective:Jt,transformPerspective:Jt,opacity:Ut,originX:ee,originY:ee,originZ:Jt},ge={...It,transform:Math.round},ye={...fe,...ve,zIndex:ge,size:Jt,fillOpacity:Ut,strokeOpacity:Ut,numOctaves:ge},xe={...ye,color:ie,backgroundColor:ie,outlineColor:ie,fill:ie,stroke:ie,borderColor:ie,borderTopColor:ie,borderRightColor:ie,borderBottomColor:ie,borderLeftColor:ie,filter:me,WebkitFilter:me},Pe=t=>xe[t];function Te(t,e){let n=Pe(t);return n!==me&&(n=he),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const we=new Set(["auto","none","0"]);const Se=t=>t===It||t===Jt,be=(t,e)=>parseFloat(t.split(", ")[e]),Ae=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return be(s[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?be(e[1],t):0}},Ee=new Set(["x","y","z"]),Ve=rt.filter(t=>!Ee.has(t));const Me={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:Ae(4,13),y:Ae(5,14)};Me.translateX=Me.x,Me.translateY=Me.y;const De=new Set;let Ce=!1,Re=!1;function ke(){if(Re){const t=Array.from(De).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ve.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Re=!1,Ce=!1,De.forEach(t=>t.complete()),De.clear()}function Le(){De.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Re=!0)})}class Be{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(De.add(this),Ce||(Ce=!0,nt.read(Le),nt.resolveKeyframes(ke))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),De.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,De.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const je=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Fe=t=>e=>"string"==typeof e&&e.startsWith(t),Oe=Fe("--"),Ie=Fe("var(--"),Ue=t=>!!Ie(t)&&Ne.test(t.split("/*")[0].trim()),Ne=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,We=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $e(t,e,n=1){const[i,s]=function(t){const e=We.exec(t);if(!e)return[,];const[,n,i,s]=e;return["--"+(null!=n?n:i),s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return je(t)?parseFloat(t):t}return Ue(s)?$e(s,e,n+1):s}const Ye=t=>e=>e.test(t),Ke=[It,Jt,_t,Zt,te,Qt,{test:t=>"auto"===t,parse:t=>t}],Xe=t=>Ke.find(Ye(t));class ze extends Be{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),Ue(i))){const s=$e(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!lt.has(n)||2!==t.length)return;const[i,s]=t,o=Xe(i),r=Xe(s);if(o!==r)if(Se(o)&&Se(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||Ft(i))&&n.push(e);var i;n.length&&function(t,e,n){let i=0,s=void 0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!we.has(e)&&re(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Te(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Me[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=Me[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const He=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!he.test(t)&&"0"!==t||t.startsWith("url(")));function Ge(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=He(s,e),a=He(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||D(n))&&i)}const qe=t=>null!==t;function Ze(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(qe),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class _e{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=dt.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Le(),ke()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=dt.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Ge(t,n,i,s)){if(!o)return a&&a(Ze(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Je=(t,e,n)=>t+(e-t)*n;function Qe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function tn(t,e){return n=>n>0?e:t}const en=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},nn=[Gt,Ht,ne];function sn(t){const e=(n=t,nn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===ne&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Qe(a,i,t+1/3),o=Qe(a,i,t),r=Qe(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const on=(t,e)=>{const n=sn(t),i=sn(e);if(!n||!i)return tn(t,e);const s={...n};return t=>(s.red=en(n.red,i.red,t),s.green=en(n.green,i.green,t),s.blue=en(n.blue,i.blue,t),s.alpha=Je(n.alpha,i.alpha,t),Ht.transform(s))},rn=(t,e)=>n=>e(t(n)),an=(...t)=>t.reduce(rn),ln=new Set(["none","hidden"]);function un(t,e){return n=>Je(t,e,n)}function hn(t){return"number"==typeof t?un:"string"==typeof t?Ue(t)?tn:ie.test(t)?on:pn:Array.isArray(t)?cn:"object"==typeof t?ie.test(t)?on:dn:tn}function cn(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>hn(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function dn(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=hn(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const pn=(t,e)=>{const n=he.createTransformer(e),i=re(t),s=re(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?ln.has(t)&&!s.values.length||ln.has(e)&&!i.values.length?function(t,e){return ln.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):an(cn(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):tn(t,e)};function mn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Je(t,e,n);return hn(t)(t,e)}function fn(t,e,n){const i=Math.max(e-5,0);return vt(n-t(i),e-i)}const vn=100,gn=10,yn=1,xn=0,Pn=800,Tn=.3,wn=.3,Sn={granular:.01,default:2},bn={granular:.005,default:.5},An=.01,En=10,Vn=.05,Mn=1;function Dn({duration:t=Pn,bounce:e=Tn,velocity:n=xn,mass:i=yn}){let s,o,r=1-e;r=Ot(Vn,Mn,r),t=Ot(An,En,b(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/Cn(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Cn(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=S(t),isNaN(a))return{stiffness:vn,damping:gn,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Cn(t,e){return t*Math.sqrt(1-e*e)}const Rn=["duration","bounce"],kn=["stiffness","damping","mass"];function Ln(t,e){return e.some(e=>void 0!==t[e])}function Bn(t=wn,e=Tn){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:xn,stiffness:vn,damping:gn,mass:yn,isResolvedFromDuration:!1,...t};if(!Ln(t,kn)&&Ln(t,Rn))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*Ot(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:yn,stiffness:s,damping:o}}else{const n=Dn(t);e={...e,...n,mass:yn},e.isResolvedFromDuration=!0}return e}({...n,velocity:-b(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*h)),v=r-o,g=b(Math.sqrt(l/h)),y=Math.abs(v)<5;let x;if(i||(i=y?Sn.granular:Sn.default),s||(s=y?bn.granular:bn.default),f<1){const t=Cn(g,f);x=e=>{const n=Math.exp(-f*g*e);return r-n*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-g*t)*(v+(m+g*v)*t);else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const P={calculatedDuration:p&&c||null,next:t=>{const e=x(t);if(p)a.done=t>=c;else{let n=0;f<1&&(n=0===t?S(m):fn(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(M(P),2e4),e=j(e=>P.next(t*e).value,t,30);return t+"ms "+e}};return P}function jn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=c+m,v=void 0===r?f:r(f);v!==f&&(m=v-c);const g=t=>-m*Math.exp(-t/i),y=t=>v+g(t),x=t=>{const e=g(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let P,T;const w=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,T=Bn({keyframes:[d.value,p(d.value)],velocity:fn(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:h}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==P||(e=!0,x(t),w(t)),void 0!==P&&t>=P?T.next(t-P):(!e&&x(t),d)}}}const Fn=Et(.42,0,1,1),On=Et(0,0,.58,1),In=Et(.42,0,.58,1),Un={linear:x,easeIn:Fn,easeInOut:In,easeOut:On,circIn:Lt,circInOut:jt,circOut:Bt,backIn:Ct,backInOut:Rt,backOut:Dt,anticipate:kt},Nn=t=>{if(R(t)){P(4===t.length);const[e,n,i,s]=t;return Et(e,n,i,s)}return"string"==typeof t?Un[t]:t};function Wn(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(P(o===e.length),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||mn,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||x:e;o=an(t,o)}i.push(o)}return i}(e,i,s),l=a.length,u=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=w(t[i],t[i+1],n);return a[i](s)};return n?e=>u(Ot(t[0],t[o-1],e)):u}function $n(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=w(0,e,i);t.push(Je(n,1,s))}}(e,t.length-1),e}function Yn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Nn):Nn(i),o={done:!1,value:e[0]},r=Wn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:$n(e),t),e,{ease:Array.isArray(s)?s:(a=e,l=s,a.map(()=>l||In).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Kn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>nt.update(e,!0),stop:()=>it(e),now:()=>st.isProcessing?st.timestamp:dt.now()}},Xn={decay:jn,inertia:jn,tween:Yn,keyframes:Yn,spring:Bn},zn=t=>t/100;class Hn extends _e{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Be;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=D(e)?e:Xn[e]||Yn;let a,l;r!==Yn&&"number"!=typeof t[0]&&(a=an(zn,mn(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=M(u));const{calculatedDuration:h}=u,c=h+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:h}=n;if(null===this.startTime)return s.next(0);const{delay:c,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/h;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/h)):"mirror"===p&&(x=o)),y=Ot(0,1,n)*h}const P=g?{done:!1,value:a[0]}:x.next(y);r&&(P.value=r(P.value));let{done:T}=P;g||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return w&&void 0!==i&&(P.value=Ze(a,this.options,i)),f&&f(P.value),w&&this.finish(),P}get duration(){const{resolved:t}=this;return t?b(t.calculatedDuration):0}get time(){return b(this.currentTime)}set time(t){t=S(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=b(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Kn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Gn=new Set(["opacity","clipPath","filter","transform"]);function qn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const h=function t(e,n){return e?"function"==typeof e&&B()?j(e,n):R(e)?O(e):Array.isArray(e)?e.map(e=>t(e,n)||I.easeOut):I[e]:void 0}(a,s);Array.isArray(h)&&(u.easing=h);return t.animate(u,{delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const Zn=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const _n={anticipate:kt,backInOut:Rt,circInOut:jt};class Jn extends _e{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new ze(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var u;if("string"==typeof s&&B()&&s in _n&&(s=_n[s]),D((u=this.options).type)||"spring"===u.type||!F(u.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...u}=this.options,h=function(t,e){const n=new Hn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),n=h.duration,i=h.times,s=h.ease,o="keyframes"}const h=qn(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(C(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;r.set(Ze(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return b(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return b(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=S(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return x;const{animation:n}=e;C(n,t)}else this.pendingTimeline=t;return x}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,h=new Hn({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),c=S(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Zn()&&n&&Gn.has(n)&&!a&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const Qn={type:"spring",stiffness:500,damping:25,restSpeed:10},ti={type:"keyframes",duration:.8},ei={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ni=(t,{keyframes:e})=>e.length>2?ti:at.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qn:ei;const ii=(t,e,n,i={},s,o)=>r=>{const a=V(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=S(l);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(a)||(h={...h,...ni(t,h)}),h.duration&&(h.duration=S(h.duration)),h.repeatDelay&&(h.repeatDelay=S(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let c=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(c=!0)),h.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=Ze(h.keyframes,a);if(void 0!==t)return nt.update(()=>{h.onUpdate(t),h.onComplete()}),new E([])}return!o&&Jn.supports(h)?new Jn(h):new Hn(h)};function si({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function oi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||h&&si(h,e))continue;const a={delay:n,...V(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=bt(t);if(n){const t=window.MotionHandoffAnimation(n,e,nt);null!==t&&(a.startTime=t,c=!0)}}Tt(t,e),i.start(ii(e,i,s,t.shouldReduceMotion&&lt.has(e)?{type:!1}:a,t,c));const d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{nt.update(()=>{a&&function(t,e){const n=y(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){xt(t,e,(r=o[e],ut(r)?r[r.length-1]||0:r))}var r}(t,a)})}),u}function ri(t,e,n={}){var i;const s=y(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(oi(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(ai).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(ri(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function ai(t,e){return t.sortNodePosition(e)}function li(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function ui(t){return"string"==typeof t||Array.isArray(t)}const hi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ci=["initial",...hi],di=ci.length;const pi=[...hi].reverse(),mi=hi.length;function fi(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>ri(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=ri(t,e,n);else{const s="function"==typeof e?y(t,e,n.custom):e;i=Promise.all(oi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function vi(t){let e=fi(t),n=xi(),i=!0;const s=e=>(n,i)=>{var s;const o=y(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<di;t++){const i=ci[t],s=e.props[i];(ui(s)||!1===s)&&(n[i]=s)}return n}(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;e<mi;e++){const d=pi[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],v=ui(m),g=d===o?p.isActive:null;!1===g&&(c=e);let y=m===a[d]&&m!==r[d]&&v;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===g||!m&&!p.prevProp||f(m)||"boolean"==typeof m)continue;const x=gi(p.prevProp,m);let P=x||d===o&&p.isActive&&!y&&v||e>c&&v,T=!1;const w=Array.isArray(m)?m:[m];let S=w.reduce(s(d),{});!1===g&&(S={});const{prevResolvedValues:b={}}=p,A={...b,...S},E=e=>{P=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=b[t];if(h.hasOwnProperty(t))continue;let i=!1;i=ut(e)&&ut(n)?!li(e,n):e!==n,i?null!=e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(h={...h,...S}),i&&t.blockInitialAnimation&&(P=!1);const V=!(y&&x)||T;P&&V&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};if("boolean"!=typeof r.initial){const n=y(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?i:null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=xi(),i=!0}}}function gi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!li(e,t)}function yi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xi(){return{animate:yi(!0),whileInView:yi(),whileHover:yi(),whileTap:yi(),whileDrag:yi(),whileFocus:yi(),exit:yi()}}class Pi{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Ti=0;const wi={animation:{Feature:class extends Pi{constructor(t){super(t),t.animationState||(t.animationState=vi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();f(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Pi{constructor(){super(...arguments),this.id=Ti++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Si(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function bi(t){return{point:{x:t.pageX,y:t.pageY}}}function Ai(t,e,n,i){return Si(t,e,(t=>e=>X(e)&&t(e,bi(e)))(n),i)}function Ei({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Vi(t){return t.max-t.min}function Mi(t,e,n,i=.5){t.origin=i,t.originPoint=Je(e.min,e.max,t.origin),t.scale=Vi(n)/Vi(e),t.translate=Je(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Di(t,e,n,i){Mi(t.x,e.x,n.x,i?i.originX:void 0),Mi(t.y,e.y,n.y,i?i.originY:void 0)}function Ci(t,e,n){t.min=n.min+e.min,t.max=t.min+Vi(e)}function Ri(t,e,n){t.min=e.min-n.min,t.max=t.min+Vi(e)}function ki(t,e,n){Ri(t.x,e.x,n.x),Ri(t.y,e.y,n.y)}const Li=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Bi(t){return[t("x"),t("y")]}function ji(t){return void 0===t||1===t}function Fi({scale:t,scaleX:e,scaleY:n}){return!ji(t)||!ji(e)||!ji(n)}function Oi(t){return Fi(t)||Ii(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ii(t){return Ui(t.x)||Ui(t.y)}function Ui(t){return t&&"0%"!==t}function Ni(t,e,n){return n+e*(t-n)}function Wi(t,e,n,i,s){return void 0!==s&&(t=Ni(t,s,i)),Ni(t,n,i)+e}function $i(t,e=0,n=1,i,s){t.min=Wi(t.min,e,n,i,s),t.max=Wi(t.max,e,n,i,s)}function Yi(t,{x:e,y:n}){$i(t.x,e.translate,e.scale,e.originPoint),$i(t.y,n.translate,n.scale,n.originPoint)}function Ki(t,e){t.min=t.min+e,t.max=t.max+e}function Xi(t,e,n,i,s=.5){$i(t,e,n,Je(t.min,t.max,s),i)}function zi(t,e){Xi(t.x,e.x,e.scaleX,e.scale,e.originX),Xi(t.y,e.y,e.scaleY,e.scale,e.originY)}function Hi(t,e){return Ei(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Gi=({current:t})=>t?t.ownerDocument.defaultView:null;function qi(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const Zi=(t,e)=>Math.abs(t-e);class _i{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=ts(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Zi(t.x,e.x),i=Zi(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=st;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Ji(e,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=ts("pointercancel"===t.type?this.lastMoveEventInfo:Ji(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!X(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=Ji(bi(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=st;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,ts(o,this.history)),this.removeListeners=an(Ai(this.contextWindow,"pointermove",this.handlePointerMove),Ai(this.contextWindow,"pointerup",this.handlePointerUp),Ai(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),it(this.updatePoint)}}function Ji(t,e){return e?{point:e(t.point)}:t}function Qi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ts({point:t},e){return{point:t,delta:Qi(t,ns(e)),offset:Qi(t,es(e)),velocity:is(e,.1)}}function es(t){return t[0]}function ns(t){return t[t.length-1]}function is(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=ns(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>S(e)));)n--;if(!i)return{x:0,y:0};const o=b(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ss(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function os(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const rs=.35;function as(t,e,n){return{min:ls(t,e),max:ls(t,n)}}function ls(t,e){return"number"==typeof t?t:t[e]||0}const us=new WeakMap;class hs{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new _i(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(bi(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?U[o]?null:(U[o]=!0,()=>{U[o]=!1}):U.x||U.y?null:(U.x=U.y=!0,()=>{U.x=U.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bi(t=>{let e=this.getAxisMotionValue(t).get()||0;if(_t.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Vi(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&nt.postRender(()=>s(t,e)),Tt(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Bi(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:Gi(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&nt.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!cs(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Je(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Je(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&qi(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:ss(t.x,n,s),y:ss(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=rs){return!1===t?t=0:!0===t&&(t=rs),{x:as(t,"left","right"),y:as(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Bi(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!qi(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Hi(t,n),{scroll:s}=e;return s&&(Ki(i.x,s.offset.x),Ki(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:os(t.x,e.x),y:os(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Ei(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Bi(r=>{if(!cs(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=i?200:1e6,h=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Tt(this.visualElement,t),n.start(ii(t,n,0,e,this.visualElement,!1))}stopAnimation(){Bi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bi(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Bi(e=>{const{drag:n}=this.getProps();if(!cs(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-Je(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!qi(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bi(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=Vi(t),s=Vi(e);return s>i?n=w(e.min,e.max-i,t.min):i>s&&(n=w(t.min,t.max-s,e.min)),Ot(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Bi(e=>{if(!cs(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Je(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;us.set(this.visualElement,this);const t=Ai(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();qi(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),nt.read(e);const s=Si(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Bi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=rs,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function cs(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ds=t=>(e,n)=>{t&&nt.postRender(()=>t(e,n))};const ps=new WeakMap;const ms={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"]},fs={};for(const t in ms)fs[t]={isEnabled:e=>ms[t].some(t=>!!e[t])};const vs="undefined"!=typeof window,gs={current:null},ys={current:!1};const xs=[...Ke,ie,he];function Ps(t){return f(t.animate)||ci.some(e=>ui(t[e]))}function Ts(t){return Boolean(Ps(t)||t.variants)}const ws=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ss extends class{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Be,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,nt.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Ps(e),this.isVariantNode=Ts(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Pt(e)&&e.set(a[t],!1)}}mount(t){this.current=t,ps.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),ys.current||function(){if(ys.current=!0,vs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gs.current=t.matches;t.addListener(e),e()}else gs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||gs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),it(this.notifyUpdate),it(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=at.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&nt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in fs){const e=fs[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ws.length;e++){const n=ws[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Pt(s))t.addValue(i,s);else if(Pt(o))t.addValue(i,yt(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,yt(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=yt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=i&&("string"==typeof i&&(je(i)||Ft(i))?i=parseFloat(i):(s=i,!xs.find(Ye(s))&&he.test(e)&&(i=Te(t,e))),this.setBaseTarget(t,Pt(i)?i.get():i)),Pt(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=g(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Pt(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new ft),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=ze}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Pt(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const bs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,As={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Es=rt.length;function Vs(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(at.has(t))r=!0;else if(Oe(t))s[t]=n;else{const e=bs(n,ye[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o<Es;o++){const r=rt[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=bs(a,ye[r]);if(!l){s=!1;i+=`${As[r]||r}(${t}) `}n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const Ms={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ds={offset:"strokeDashoffset",array:"strokeDasharray"};function Cs(t,e,n){return"string"==typeof t?t:Jt.transform(e+n*t)}function Rs(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},h,c){if(Vs(t,u,c),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Cs(e,t.x,t.width)} ${Cs(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Ms:Ds;t[o.offset]=Jt.transform(-i);const r=Jt.transform(e),a=Jt.transform(n);t[o.array]=`${r} ${a}`}(d,r,a,l,!1)}const ks=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"]),Ls=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Bs(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}function js(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}function Fs(t,e,n,i){js(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(ks.has(n)?n:wt(n),e.attrs[n])}const Os={};function Is(t,{layout:e,layoutId:n}){return at.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Os[t]||"opacity"===t)}function Us(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(Pt(s[r])||e.style&&Pt(e.style[r])||Is(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return o}function Ns(t,e,n){const i=Us(t,e,n);for(const n in t)if(Pt(t[n])||Pt(e[n])){i[-1!==rt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Ws extends Ss{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Li,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Bs(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(at.has(e)){const t=Pe(e);return t&&t.default||0}return e=ks.has(e)?e:wt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Ns(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&nt.postRender(this.updateDimensions)}build(t,e,n){Rs(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){Fs(t,e,0,i)}mount(t){this.isSVGTag=Ls(t.tagName),super.mount(t)}}class $s extends Ss{constructor(){super(...arguments),this.type="html",this.renderInstance=js}readValueFromInstance(t,e){if(at.has(e)){const t=Pe(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),s=(Oe(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Hi(t,e)}build(t,e,n){Vs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Us(t,e,n)}}const{schedule:Ys,cancel:Ks}=et(queueMicrotask,!1),Xs=(t,e)=>t.depth-e.depth;class zs{constructor(){this.children=[],this.isDirty=!1}add(t){pt(this.children,t),this.isDirty=!0}remove(t){mt(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Xs),this.isDirty=!1,this.children.forEach(t)}}function Hs(t){const e=Pt(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Gs=["TopLeft","TopRight","BottomLeft","BottomRight"],qs=Gs.length,Zs=t=>"string"==typeof t?parseFloat(t):t,_s=t=>"number"==typeof t||Jt.test(t);function Js(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Qs=eo(0,.5,Bt),to=eo(.5,.95,x);function eo(t,e,n){return i=>i<t?0:i>e?1:n(w(t,e,i))}function no(t,e){t.min=e.min,t.max=e.max}function io(t,e){no(t.x,e.x),no(t.y,e.y)}function so(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function oo(t,e,n,i,s){return t=Ni(t-=e,1/n,i),void 0!==s&&(t=Ni(t,1/s,i)),t}function ro(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){if(_t.test(e)){e=parseFloat(e);e=Je(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Je(o.min,o.max,i);t===o&&(a-=e),t.min=oo(t.min,e,n,a,s),t.max=oo(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const ao=["x","scaleX","originX"],lo=["y","scaleY","originY"];function uo(t,e,n,i){ro(t.x,e,ao,n?n.x:void 0,i?i.x:void 0),ro(t.y,e,lo,n?n.y:void 0,i?i.y:void 0)}function ho(t){return 0===t.translate&&1===t.scale}function co(t){return ho(t.x)&&ho(t.y)}function po(t,e){return t.min===e.min&&t.max===e.max}function mo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function fo(t,e){return mo(t.x,e.x)&&mo(t.y,e.y)}function vo(t){return Vi(t.x)/Vi(t.y)}function go(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class yo{constructor(){this.members=[]}add(t){pt(this.members,t),t.scheduleRender()}remove(t){if(mt(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const xo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Po=["","X","Y","Z"],To={visibility:"hidden"};let wo=0;function So(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function bo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=wo++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Vo),this.nodes.forEach(Bo),this.nodes.forEach(jo),this.nodes.forEach(Mo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new zs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ft),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var i;this.isSVG=(i=e)instanceof SVGElement&&"svg"!==i.tagName,this.instance=e;const{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||s)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=dt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(it(i),t(o-e))};return nt.read(i,!0),()=>it(i)}(i,250),xo.hasAnimatedSinceResize&&(xo.hasAnimatedSinceResize=!1,this.nodes.forEach(Lo))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||r.getDefaultTransition()||Wo,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!fo(this.targetLayout,i),u=!e&&n;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...V(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Lo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,it(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(Fo),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const i=bt(n);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",nt,!(t||n))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&t(s)}(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Co);this.isUpdating||this.nodes.forEach(Ro),this.isUpdating=!1,this.nodes.forEach(ko),this.nodes.forEach(Ao),this.nodes.forEach(Eo),this.clearAllSnapshots();const t=dt.now();st.delta=Ot(0,1e3/60,t-st.timestamp),st.timestamp=t,st.isProcessing=!0,ot.update.process(st),ot.preRender.process(st),ot.render.process(st),st.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ys.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Do),this.sharedNodes.forEach(Oo)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,nt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){nt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Vi(this.snapshot.measuredBox.x)||Vi(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!co(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||Oi(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Ko((i=n).x),Ko(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const n=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(zo))){const{scroll:t}=this.root;t&&(Ki(n.x,t.offset.x),Ki(n.y,t.offset.y))}return n}removeElementScroll(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};if(io(n,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return n;for(let e=0;e<this.path.length;e++){const i=this.path[e],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&io(n,t),Ki(n.x,s.offset.x),Ki(n.y,s.offset.y))}return n}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};io(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&zi(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Oi(i.latestValues)&&zi(n,i.latestValues)}return Oi(this.latestValues)&&zi(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};io(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Oi(n.latestValues))continue;Fi(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};io(i,n.measurePageBox()),uo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Oi(this.latestValues)&&uo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==st.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=st.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ki(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),io(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,a,l;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,Ci(r.x,a.x,l.x),Ci(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):io(this.target,this.layout.layoutBox),Yi(this.target,this.targetDelta)):io(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ki(this.relativeTargetOrigin,this.target,t.target),io(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Fi(this.parent.latestValues)&&!Ii(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===st.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;io(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&zi(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Yi(t,r)),i&&Oi(o.latestValues)&&zi(t,o.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(so(this.prevProjectionDelta.x,this.projectionDelta.x),so(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Di(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&go(this.projectionDelta.x,this.prevProjectionDelta.x)&&go(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,h=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(No));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,v;Io(o.x,t.x,n),Io(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ki(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,v=n,Uo(p.x,m.x,f.x,v),Uo(p.y,m.y,f.y,v),c&&(l=this.relativeTarget,d=c,po(l.x,d.x)&&po(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),io(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=Je(0,void 0!==n.opacity?n.opacity:1,Qs(i)),t.opacityExit=Je(void 0!==e.opacity?e.opacity:1,0,to(i))):o&&(t.opacity=Je(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<qs;s++){const o=`border${Gs[s]}Radius`;let r=Js(e,o),a=Js(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||_s(r)===_s(a)?(t[o]=Math.max(Je(Zs(r),Zs(a),i),0),(_t.test(a)||_t.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=Je(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,h,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(it(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{xo.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const i=Pt(t)?t:yt(t);return i.start(ii("",i,e,n)),i.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Xo(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Vi(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Vi(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}io(e,n),zi(e,s),Di(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new yo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&So("z",t,i,this.animationValues);for(let e=0;e<Po.length;e++)So("rotate"+Po[e],t,i,this.animationValues),So("skew"+Po[e],t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return To;const i={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=Hs(null==t?void 0:t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Hs(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Oi(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==n?void 0:n.z)||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in Os){if(void 0===r[t])continue;const{correct:e,applyTo:n,isCSSVariable:s}=Os[t],a="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=a}else s?this.options.visualElement.renderState.vars[t]=a:i[t]=a}return this.options.layoutId&&(i.pointerEvents=o===this?Hs(null==t?void 0:t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(Co),this.root.sharedNodes.clear()}}}function Ao(t){t.updateLayout()}function Eo(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?Bi(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=Vi(i);i.min=e[t].min,i.max=i.min+s}):Xo(s,n.layoutBox,e)&&Bi(i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=Vi(e[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Di(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Di(a,t.applyTransform(i,!0),n.measuredBox):Di(a,e,n.layoutBox);const l=!co(r);let u=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};ki(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};ki(a,e,o.layoutBox),fo(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Vo(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Mo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Do(t){t.clearSnapshot()}function Co(t){t.clearMeasurements()}function Ro(t){t.isLayoutDirty=!1}function ko(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Lo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Bo(t){t.resolveTargetDelta()}function jo(t){t.calcProjection()}function Fo(t){t.resetSkewAndRotation()}function Oo(t){t.removeLeadSnapshot()}function Io(t,e,n){t.translate=Je(e.translate,0,n),t.scale=Je(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Uo(t,e,n,i){t.min=Je(e.min,n.min,i),t.max=Je(e.max,n.max,i)}function No(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Wo={duration:.45,ease:[.4,0,.1,1]},$o=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Yo=$o("applewebkit/")&&!$o("chrome/")?Math.round:x;function Ko(t){t.min=Yo(t.min),t.max=Yo(t.max)}function Xo(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=vo(e),s=vo(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function zo(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const Ho=bo({attachResizeListener:(t,e)=>Si(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Go={current:void 0},qo=bo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Go.current){const t=new Ho({});t.mount(window),t.setOptions({layoutScroll:!0}),Go.current=t}return Go.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Zo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const _o={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Jt.test(t))return t;t=parseFloat(t)}return`${Zo(t,e.target.x)}% ${Zo(t,e.target.y)}%`}},Jo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=he.parse(t);if(s.length>5)return i;const o=he.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=Je(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}},Qo=n(null);const tr=n({}),er=n({});class nr extends a{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Os[e]=t[e],Oe(e)&&(Os[e].isCSSVariable=!0)}(sr),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),xo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||nt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ys.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ir(e){const[n,a]=function(t=!0){const e=i(Qo);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:a,register:l}=e,u=s();o(()=>{if(t)return l(u)},[t]);const h=r(()=>t&&a&&a(u),[u,a,t]);return!n&&a?[!1,h]:[!0]}(),l=i(tr);return t(nr,{...e,layoutGroup:l,switchLayoutGroup:i(er),isPresent:n,safeToRemove:a})}const sr={borderRadius:{..._o,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_o,borderTopRightRadius:_o,borderBottomLeftRadius:_o,borderBottomRightRadius:_o,boxShadow:Jo},or={pan:{Feature:class extends Pi{constructor(){super(...arguments),this.removePointerDownListener=x}onPointerDown(t){this.session=new _i(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Gi(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ds(t),onStart:ds(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&nt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Ai(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Pi{constructor(t){super(t),this.removeGroupControls=x,this.removeListeners=x,this.controls=new hs(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||x}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:qo,MeasureLayout:ir}};function rr(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&nt.postRender(()=>s(e,bi(e)))}function ar(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&nt.postRender(()=>s(e,bi(e)))}const lr=new WeakMap,ur=new WeakMap,hr=t=>{const e=lr.get(t.target);e&&e(t)},cr=t=>{t.forEach(hr)};function dr(t,e,n){const i=function({root:t,...e}){const n=t||document;ur.has(n)||ur.set(n,{});const i=ur.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(cr,{root:t,...e})),i[s]}(e);return lr.set(t,n),i.observe(t),()=>{lr.delete(t),i.unobserve(t)}}const pr={some:0,all:1};const mr={inView:{Feature:class extends Pi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:pr[i]};return dr(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Pi{mount(){const{current:t}=this.node;t&&(this.unmount=_(t,(t,e)=>(ar(this.node,e,"Start"),(t,{success:e})=>ar(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Pi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=an(Si(this.node.current,"focus",()=>this.onFocus()),Si(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Pi{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=W(t,n),r=t=>{if(!$(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{$(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(rr(this.node,e,"Start"),t=>rr(this.node,t,"End"))))}unmount(){}}}},fr={layout:{ProjectionNode:qo,MeasureLayout:ir}},vr=n({strict:!1}),gr=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),yr=n({});function xr(t){const{initial:e,animate:n}=function(t,e){if(Ps(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ui(e)?e:void 0,animate:ui(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(yr));return l(()=>({initial:e,animate:n}),[Pr(e),Pr(n)])}function Pr(t){return Array.isArray(t)?t.join(" "):t}const Tr=Symbol.for("motionComponentSymbol");function wr(t,e,n){return r(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):qi(n)&&(n.current=i))},[e])}const Sr=vs?u:o;function br(t,e,n,s,r){var a,l;const{visualElement:u}=i(yr),d=i(vr),p=i(Qo),m=i(gr).reducedMotion,f=h(null);s=s||d.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:u,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:m}));const v=f.current,g=i(er);!v||v.projection||!r||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){return e?!1!==e.options.allowProjection?e.projection:t(e.parent):void 0}(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&qi(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(f.current,n,r,g);const y=h(!1);c(()=>{v&&y.current&&v.update(n,p)});const x=n[St],P=h(Boolean(x)&&!(null===(a=window.MotionHandoffIsComplete)||void 0===a?void 0:a.call(window,x))&&(null===(l=window.MotionHasOptimisedAnimation)||void 0===l?void 0:l.call(window,x)));return Sr(()=>{v&&(y.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),Ys.render(v.render),P.current&&v.animationState&&v.animationState.animateChanges())}),o(()=>{v&&(!P.current&&v.animationState&&v.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)}),P.current=!1))}),v}function Ar({preloadedFeatures:n,createVisualElement:s,useRender:o,useVisualState:r,Component:a}){var l,u;function h(n,l){let u;const h={...i(gr),...n,layoutId:Er(n)},{isStatic:c}=h,d=xr(n),p=r(n,c);if(!c&&vs){i(vr).strict;const t=function(t){const{drag:e,layout:n}=fs;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);u=t.MeasureLayout,d.visualElement=br(a,p,h,s,t.ProjectionNode)}return e(yr.Provider,{value:d,children:[u&&d.visualElement?t(u,{visualElement:d.visualElement,...h}):null,o(a,n,wr(p,d.visualElement,l),p,c,d.visualElement)]})}n&&function(t){for(const e in t)fs[e]={...fs[e],...t[e]}}(n),h.displayName="motion."+("string"==typeof a?a:`create(${null!==(u=null!==(l=a.displayName)&&void 0!==l?l:a.name)&&void 0!==u?u:""})`);const c=d(h);return c[Tr]=a,c}function Er({layoutId:t}){const e=i(tr).id;return e&&void 0!==t?e+"-"+t:t}const Vr=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Mr(t,e,n){for(const i in e)Pt(e[i])||Is(i,n)||(t[i]=e[i])}function Dr(t,e){const n={};return Mr(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Vs(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Cr(t,e){const n={},i=Dr(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Rr=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 kr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Rr.has(t)}let Lr=t=>!kr(t);try{(Br=require("@emotion/is-prop-valid").default)&&(Lr=t=>t.startsWith("on")?!kr(t):Br(t))}catch(t){}var Br;const jr=["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 Fr(t){return"string"==typeof t&&!t.includes("-")&&!!(jr.indexOf(t)>-1||/[A-Z]/u.test(t))}const Or=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Ir(t,e,n,i){const s=l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Rs(n,e,Ls(i),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Mr(e,t.style,t),s.style={...e,...s.style}}return s}function Ur(t=!1){return(e,n,i,{latestValues:s},o)=>{const r=(Fr(e)?Ir:Cr)(n,s,o,e),a=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Lr(s)||!0===n&&kr(s)||!e&&!kr(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),u=e!==p?{...a,...r,ref:i}:{},{children:h}=n,c=l(()=>Pt(h)?h.get():h,[h]);return m(e,{...u,children:c})}}const Nr=t=>(e,n)=>{const s=i(yr),o=i(Qo),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:Wr(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,e,s,o);return n?r():function(t){const e=h(null);return null===e.current&&(e.current=t()),e.current}(r)};function Wr(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=Hs(o[t]);let{initial:r,animate:a}=t;const l=Ps(t),u=Ts(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let h=!!n&&!1===n.initial;h=h||!1===r;const c=h?a:r;if(c&&"boolean"!=typeof c&&!f(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n<e.length;n++){const i=g(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[h?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const $r={useVisualState:Nr({scrapeMotionValuesFromProps:Us,createRenderState:Vr})},Yr=["x","y","width","height","cx","cy","r"],Kr={useVisualState:Nr({scrapeMotionValuesFromProps:Ns,createRenderState:Or,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o)for(const t in s)if(at.has(t)){o=!0;break}if(!o)return;let r=!e;if(e)for(let n=0;n<Yr.length;n++){const i=Yr[n];t[i]!==e[i]&&(r=!0)}r&&nt.read(()=>{Bs(n,i),nt.render(()=>{Rs(i,s,Ls(n.tagName),t.transformTemplate),Fs(n,i)})})}})};function Xr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Ar({...Fr(n)?Kr:$r,preloadedFeatures:t,useRender:Ur(i),createVisualElement:e,Component:n})}}const zr=Xr({...wi,...mr,...or,...fr},(t,e)=>Fr(t)?new Ws(e):new $s(e,{allowProjection:t!==p}))("div");export{zr as MotionDiv};
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useId as s,useEffect as o,useCallback as r,Component as a,useMemo as l,useLayoutEffect as u,useRef as h,useInsertionEffect as c,forwardRef as d,Fragment as p,createElement as m}from"react";function f(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function v(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function g(t,e,n,i){if("function"==typeof e){const[s,o]=v(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=v(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function y(t,e,n){const i=t.getProps();return g(i,e,void 0!==n?n:i.custom,t)}const x=t=>t;let P=x;function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const w=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},S=t=>1e3*t,b=t=>t/1e3,A=T(()=>void 0!==window.ScrollTimeline);class E extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>A()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function V(t,e){return t?t[e]||t.default||t:void 0}function M(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function D(t){return"function"==typeof t}function C(t,e){t.timeline=e,t.onfinish=null}const k=t=>Array.isArray(t)&&"number"==typeof t[0],R={linearEasing:void 0};function L(t,e){const n=T(t);return()=>{var t;return null!==(t=R[e])&&void 0!==t?t:n()}}const B=L(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),j=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(w(0,s-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`};function F(t){return Boolean("function"==typeof t&&B()||!t||"string"==typeof t&&(t in I||B())||k(t)||Array.isArray(t)&&t.every(F))}const O=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,I={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:O([0,.65,.55,1]),circOut:O([.55,0,1,.45]),backIn:O([.31,.01,.66,-.59]),backOut:O([.33,1.53,.69,.99])};const U={x:!1,y:!1};function N(){return U.x||U.y}function W(t,e){const n=function(t,e,n){var i;if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const o=null!==(i=null==n?void 0:n[t])&&void 0!==i?i:s.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Y(t){return!("touch"===t.pointerType||N())}function $(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const X=(t,e)=>!!e&&(t===e||X(t,e.parentElement)),K=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,z=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const H=new WeakSet;function G(t){return e=>{"Enter"===e.key&&t(e)}}function q(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Z(t){return K(t)&&!N()}function _(t,e,n={}){const[i,s,o]=W(t,n),r=t=>{const n=t.currentTarget;if(!n||!Z(t)||H.has(n))return;H.add(n),$(t,"set");const i=e(n,t),o=(t,e)=>{n.removeEventListener("pointerup",r),n.removeEventListener("pointercancel",a),$(t,"release"),Z(t)&&H.has(n)&&(H.delete(n),"function"==typeof i&&i(t,{success:e}))},r=t=>{const e=!!t.isTrusted&&(i=t,s=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},i.clientX<s.left||i.clientX>s.right||i.clientY<s.top||i.clientY>s.bottom);var i,s;o(t,!e&&(!(n instanceof Element)||X(n,t.target)))},a=t=>{o(t,!1)};n.addEventListener("pointerup",r,s),n.addEventListener("pointercancel",a,s),n.addEventListener("lostpointercapture",a,s)};return i.forEach(t=>{let e=!1;var i;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,i=t,z.has(i.tagName)||-1!==i.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",r,s),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=G(()=>{if(H.has(n))return;q(n,"down");const t=G(()=>{q(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>q(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s),s)}),o}const J=!1,Q=["read","resolveKeyframes","update","preRender","render","postRender"],tt={value:null,addProjectionMetrics:null};function et(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Q.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){r.has(e)&&(h.schedule(e),t()),l++,e(a)}const h={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(u),e&&tt.value&&tt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,h.process(t)))}};return h}(o,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:h,render:c,postRender:d}=r,p=()=>{const o=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),h.process(s),c.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:Q.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Q.length;e++)r[Q[e]].cancel(t)},state:s,steps:r}}const{schedule:nt,cancel:it,state:st,steps:ot}=et("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:x,!0),rt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],at=new Set(rt),lt=new Set(["width","height","top","left","right","bottom",...rt]),ut=t=>Array.isArray(t);let ht;function ct(){ht=void 0}const dt={now:()=>(void 0===ht&&dt.set(st.isProcessing||J?st.timestamp:performance.now()),ht),set:t=>{ht=t,queueMicrotask(ct)}};function pt(t,e){-1===t.indexOf(e)&&t.push(e)}function mt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ft{constructor(){this.subscriptions=[]}add(t){return pt(this.subscriptions,t),()=>mt(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function vt(t,e){return e?t*(1e3/e):0}class gt{constructor(t,e={}){this.version="12.4.13",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=dt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ft);const n=this.events[t].add(e);return"change"===t?()=>{n(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return vt(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yt(t,e){return new gt(t,e)}function xt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}const Pt=t=>Boolean(t&&t.getVelocity);function Tt(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Pt(i)&&i.add))return n.add(e);var i}const wt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),St="data-"+wt("framerAppearId");function bt(t){return t.props[St]}const At=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Et(t,e,n,i){if(t===e&&n===i)return x;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=At(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:At(s(t),e,i)}const Vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Mt=t=>e=>1-t(1-e),Dt=Et(.33,1.53,.69,.99),Ct=Mt(Dt),kt=Vt(Ct),Rt=t=>(t*=2)<1?.5*Ct(t):.5*(2-Math.pow(2,-10*(t-1))),Lt=t=>1-Math.sin(Math.acos(t)),Bt=Mt(Lt),jt=Vt(Lt),Ft=t=>/^0[^.\s]+$/u.test(t);const Ot=(t,e,n)=>n>e?e:n<t?t:n,It={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Ut={...It,transform:t=>Ot(0,1,t)},Nt={...It,default:1},Wt=t=>Math.round(1e5*t)/1e5,Yt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const $t=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xt=(t,e)=>n=>Boolean("string"==typeof n&&$t.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Kt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Yt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},zt={...It,transform:t=>Math.round((t=>Ot(0,255,t))(t))},Ht={test:Xt("rgb","red"),parse:Kt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+zt.transform(t)+", "+zt.transform(e)+", "+zt.transform(n)+", "+Wt(Ut.transform(i))+")"};const Gt={test:Xt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Ht.transform},qt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Zt=qt("deg"),_t=qt("%"),Jt=qt("px"),Qt=qt("vh"),te=qt("vw"),ee={..._t,parse:t=>_t.parse(t)/100,transform:t=>_t.transform(100*t)},ne={test:Xt("hsl","hue"),parse:Kt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+_t.transform(Wt(e))+", "+_t.transform(Wt(n))+", "+Wt(Ut.transform(i))+")"},ie={test:t=>Ht.test(t)||Gt.test(t)||ne.test(t),parse:t=>Ht.test(t)?Ht.parse(t):ne.test(t)?ne.parse(t):Gt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ht.transform(t):ne.transform(t)},se=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const oe=/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 re(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(oe,t=>(ie.test(t)?(i.color.push(o),s.push("color"),n.push(ie.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push("number"),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function ae(t){return re(t).values}function le(t){const{split:e,types:n}=re(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+="number"===e?Wt(t[o]):"color"===e?ie.transform(t[o]):t[o]}return s}}const ue=t=>"number"==typeof t?0:t;const he={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Yt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(se))||void 0===n?void 0:n.length)||0)>0},parse:ae,createTransformer:le,getAnimatableNone:function(t){const e=ae(t);return le(t)(e.map(ue))}},ce=new Set(["brightness","contrast","saturate","opacity"]);function de(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Yt)||[];if(!i)return t;const s=n.replace(i,"");let o=ce.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const pe=/\b([a-z-]*)\(.*?\)/gu,me={...he,getAnimatableNone:t=>{const e=t.match(pe);return e?e.map(de).join(" "):t}},fe={borderWidth:Jt,borderTopWidth:Jt,borderRightWidth:Jt,borderBottomWidth:Jt,borderLeftWidth:Jt,borderRadius:Jt,radius:Jt,borderTopLeftRadius:Jt,borderTopRightRadius:Jt,borderBottomRightRadius:Jt,borderBottomLeftRadius:Jt,width:Jt,maxWidth:Jt,height:Jt,maxHeight:Jt,top:Jt,right:Jt,bottom:Jt,left:Jt,padding:Jt,paddingTop:Jt,paddingRight:Jt,paddingBottom:Jt,paddingLeft:Jt,margin:Jt,marginTop:Jt,marginRight:Jt,marginBottom:Jt,marginLeft:Jt,backgroundPositionX:Jt,backgroundPositionY:Jt},ve={rotate:Zt,rotateX:Zt,rotateY:Zt,rotateZ:Zt,scale:Nt,scaleX:Nt,scaleY:Nt,scaleZ:Nt,skew:Zt,skewX:Zt,skewY:Zt,distance:Jt,translateX:Jt,translateY:Jt,translateZ:Jt,x:Jt,y:Jt,z:Jt,perspective:Jt,transformPerspective:Jt,opacity:Ut,originX:ee,originY:ee,originZ:Jt},ge={...It,transform:Math.round},ye={...fe,...ve,zIndex:ge,size:Jt,fillOpacity:Ut,strokeOpacity:Ut,numOctaves:ge},xe={...ye,color:ie,backgroundColor:ie,outlineColor:ie,fill:ie,stroke:ie,borderColor:ie,borderTopColor:ie,borderRightColor:ie,borderBottomColor:ie,borderLeftColor:ie,filter:me,WebkitFilter:me},Pe=t=>xe[t];function Te(t,e){let n=Pe(t);return n!==me&&(n=he),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const we=new Set(["auto","none","0"]);const Se=t=>180*t/Math.PI,be=t=>{const e=Se(Math.atan2(t[1],t[0]));return Ee(e)},Ae={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:be,rotateZ:be,skewX:t=>Se(Math.atan(t[1])),skewY:t=>Se(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ee=t=>((t%=360)<0&&(t+=360),t),Ve=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Me=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),De={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ve,scaleY:Me,scale:t=>(Ve(t)+Me(t))/2,rotateX:t=>Ee(Se(Math.atan2(t[6],t[5]))),rotateY:t=>Ee(Se(Math.atan2(-t[2],t[0]))),rotateZ:be,rotate:be,skewX:t=>Se(Math.atan(t[4])),skewY:t=>Se(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ce(t){return t.includes("scale")?1:0}function ke(t,e){if(!t||"none"===t)return Ce(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=De,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Ae,s=e}if(!s)return Ce(e);const o=i[e],r=s[1].split(",").map(Re);return"function"==typeof o?o(r):r[o]}function Re(t){return parseFloat(t.trim())}const Le=t=>t===It||t===Jt,Be=new Set(["x","y","z"]),je=rt.filter(t=>!Be.has(t));const Fe={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:(t,{transform:e})=>ke(e,"x"),y:(t,{transform:e})=>ke(e,"y")};Fe.translateX=Fe.x,Fe.translateY=Fe.y;const Oe=new Set;let Ie=!1,Ue=!1;function Ne(){if(Ue){const t=Array.from(Oe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return je.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ue=!1,Ie=!1,Oe.forEach(t=>t.complete()),Oe.clear()}function We(){Oe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ue=!0)})}class Ye{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Oe.add(this),Ie||(Ie=!0,nt.read(We),nt.resolveKeyframes(Ne))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Oe.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Oe.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const $e=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Xe=t=>e=>"string"==typeof e&&e.startsWith(t),Ke=Xe("--"),ze=Xe("var(--"),He=t=>!!ze(t)&&Ge.test(t.split("/*")[0].trim()),Ge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,qe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ze(t,e,n=1){const[i,s]=function(t){const e=qe.exec(t);if(!e)return[,];const[,n,i,s]=e;return["--"+(null!=n?n:i),s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return $e(t)?parseFloat(t):t}return He(s)?Ze(s,e,n+1):s}const _e=t=>e=>e.test(t),Je=[It,Jt,_t,Zt,te,Qt,{test:t=>"auto"===t,parse:t=>t}],Qe=t=>Je.find(_e(t));class tn extends Ye{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),He(i))){const s=Ze(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!lt.has(n)||2!==t.length)return;const[i,s]=t,o=Qe(i),r=Qe(s);if(o!==r)if(Le(o)&&Le(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||Ft(i))&&n.push(e);var i;n.length&&function(t,e,n){let i=0,s=void 0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!we.has(e)&&re(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Te(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Fe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=Fe[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const en=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!he.test(t)&&"0"!==t||t.startsWith("url(")));function nn(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=en(s,e),a=en(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||D(n))&&i)}const sn=t=>null!==t;function on(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(sn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class rn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=dt.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(We(),Ne()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=dt.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!nn(t,n,i,s)){if(!o)return a&&a(on(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const an=(t,e,n)=>t+(e-t)*n;function ln(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function un(t,e){return n=>n>0?e:t}const hn=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},cn=[Gt,Ht,ne];function dn(t){const e=(n=t,cn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===ne&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=ln(a,i,t+1/3),o=ln(a,i,t),r=ln(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const pn=(t,e)=>{const n=dn(t),i=dn(e);if(!n||!i)return un(t,e);const s={...n};return t=>(s.red=hn(n.red,i.red,t),s.green=hn(n.green,i.green,t),s.blue=hn(n.blue,i.blue,t),s.alpha=an(n.alpha,i.alpha,t),Ht.transform(s))},mn=(t,e)=>n=>e(t(n)),fn=(...t)=>t.reduce(mn),vn=new Set(["none","hidden"]);function gn(t,e){return n=>an(t,e,n)}function yn(t){return"number"==typeof t?gn:"string"==typeof t?He(t)?un:ie.test(t)?pn:Tn:Array.isArray(t)?xn:"object"==typeof t?ie.test(t)?pn:Pn:un}function xn(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>yn(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Pn(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=yn(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Tn=(t,e)=>{const n=he.createTransformer(e),i=re(t),s=re(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?vn.has(t)&&!s.values.length||vn.has(e)&&!i.values.length?function(t,e){return vn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):fn(xn(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):un(t,e)};function wn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return an(t,e,n);return yn(t)(t,e)}function Sn(t,e,n){const i=Math.max(e-5,0);return vt(n-t(i),e-i)}const bn=100,An=10,En=1,Vn=0,Mn=800,Dn=.3,Cn=.3,kn={granular:.01,default:2},Rn={granular:.005,default:.5},Ln=.01,Bn=10,jn=.05,Fn=1;function On({duration:t=Mn,bounce:e=Dn,velocity:n=Vn,mass:i=En}){let s,o,r=1-e;r=Ot(jn,Fn,r),t=Ot(Ln,Bn,b(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/In(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=In(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=S(t),isNaN(a))return{stiffness:bn,damping:An,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function In(t,e){return t*Math.sqrt(1-e*e)}const Un=["duration","bounce"],Nn=["stiffness","damping","mass"];function Wn(t,e){return e.some(e=>void 0!==t[e])}function Yn(t=Cn,e=Dn){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Vn,stiffness:bn,damping:An,mass:En,isResolvedFromDuration:!1,...t};if(!Wn(t,Nn)&&Wn(t,Un))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*Ot(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:En,stiffness:s,damping:o}}else{const n=On(t);e={...e,...n,mass:En},e.isResolvedFromDuration=!0}return e}({...n,velocity:-b(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*h)),v=r-o,g=b(Math.sqrt(l/h)),y=Math.abs(v)<5;let x;if(i||(i=y?kn.granular:kn.default),s||(s=y?Rn.granular:Rn.default),f<1){const t=In(g,f);x=e=>{const n=Math.exp(-f*g*e);return r-n*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-g*t)*(v+(m+g*v)*t);else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const P={calculatedDuration:p&&c||null,next:t=>{const e=x(t);if(p)a.done=t>=c;else{let n=0;f<1&&(n=0===t?S(m):Sn(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(M(P),2e4),e=j(e=>P.next(t*e).value,t,30);return t+"ms "+e}};return P}function $n({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=c+m,v=void 0===r?f:r(f);v!==f&&(m=v-c);const g=t=>-m*Math.exp(-t/i),y=t=>v+g(t),x=t=>{const e=g(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let P,T;const w=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,T=Yn({keyframes:[d.value,p(d.value)],velocity:Sn(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:h}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==P||(e=!0,x(t),w(t)),void 0!==P&&t>=P?T.next(t-P):(!e&&x(t),d)}}}const Xn=Et(.42,0,1,1),Kn=Et(0,0,.58,1),zn=Et(.42,0,.58,1),Hn={linear:x,easeIn:Xn,easeInOut:zn,easeOut:Kn,circIn:Lt,circInOut:jt,circOut:Bt,backIn:Ct,backInOut:kt,backOut:Dt,anticipate:Rt},Gn=t=>{if(k(t)){P(4===t.length);const[e,n,i,s]=t;return Et(e,n,i,s)}return"string"==typeof t?Hn[t]:t};function qn(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(P(o===e.length),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||wn,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||x:e;o=fn(t,o)}i.push(o)}return i}(e,i,s),l=a.length,u=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=w(t[i],t[i+1],n);return a[i](s)};return n?e=>u(Ot(t[0],t[o-1],e)):u}function Zn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=w(0,e,i);t.push(an(n,1,s))}}(e,t.length-1),e}function _n({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Gn):Gn(i),o={done:!1,value:e[0]},r=qn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Zn(e),t),e,{ease:Array.isArray(s)?s:(a=e,l=s,a.map(()=>l||zn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Jn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>nt.update(e,!0),stop:()=>it(e),now:()=>st.isProcessing?st.timestamp:dt.now()}},Qn={decay:$n,inertia:$n,tween:_n,keyframes:_n,spring:Yn},ti=t=>t/100;class ei extends rn{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Ye;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=D(e)?e:Qn[e]||_n;let a,l;r!==_n&&"number"!=typeof t[0]&&(a=fn(ti,wn(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=M(u));const{calculatedDuration:h}=u,c=h+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:h}=n;if(null===this.startTime)return s.next(0);const{delay:c,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/h;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/h)):"mirror"===p&&(x=o)),y=Ot(0,1,n)*h}const P=g?{done:!1,value:a[0]}:x.next(y);r&&(P.value=r(P.value));let{done:T}=P;g||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return w&&void 0!==i&&(P.value=on(a,this.options,i)),f&&f(P.value),w&&this.finish(),P}get duration(){const{resolved:t}=this;return t?b(t.calculatedDuration):0}get time(){return b(this.currentTime)}set time(t){t=S(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=b(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Jn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const ni=new Set(["opacity","clipPath","filter","transform"]);function ii(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const h=function t(e,n){return e?"function"==typeof e&&B()?j(e,n):k(e)?O(e):Array.isArray(e)?e.map(e=>t(e,n)||I.easeOut):I[e]:void 0}(a,s);Array.isArray(h)&&(u.easing=h);return t.animate(u,{delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const si=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const oi={anticipate:Rt,backInOut:kt,circInOut:jt};class ri extends rn{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new tn(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var u;if("string"==typeof s&&B()&&s in oi&&(s=oi[s]),D((u=this.options).type)||"spring"===u.type||!F(u.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...u}=this.options,h=function(t,e){const n=new ei({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),n=h.duration,i=h.times,s=h.ease,o="keyframes"}const h=ii(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(C(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;r.set(on(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return b(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return b(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=S(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return x;const{animation:n}=e;C(n,t)}else this.pendingTimeline=t;return x}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,h=new ei({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),c=S(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return si()&&n&&ni.has(n)&&!a&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const ai={type:"spring",stiffness:500,damping:25,restSpeed:10},li={type:"keyframes",duration:.8},ui={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hi=(t,{keyframes:e})=>e.length>2?li:at.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ai:ui;const ci=(t,e,n,i={},s,o)=>r=>{const a=V(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=S(l);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(a)||(h={...h,...hi(t,h)}),h.duration&&(h.duration=S(h.duration)),h.repeatDelay&&(h.repeatDelay=S(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let c=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(c=!0)),h.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=on(h.keyframes,a);if(void 0!==t)return nt.update(()=>{h.onUpdate(t),h.onComplete()}),new E([])}return!o&&ri.supports(h)?new ri(h):new ei(h)};function di({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function pi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||h&&di(h,e))continue;const a={delay:n,...V(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=bt(t);if(n){const t=window.MotionHandoffAnimation(n,e,nt);null!==t&&(a.startTime=t,c=!0)}}Tt(t,e),i.start(ci(e,i,s,t.shouldReduceMotion&&lt.has(e)?{type:!1}:a,t,c));const d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{nt.update(()=>{a&&function(t,e){const n=y(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){xt(t,e,(r=o[e],ut(r)?r[r.length-1]||0:r))}var r}(t,a)})}),u}function mi(t,e,n={}){var i;const s=y(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(pi(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(fi).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(mi(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function fi(t,e){return t.sortNodePosition(e)}function vi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function gi(t){return"string"==typeof t||Array.isArray(t)}const yi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xi=["initial",...yi],Pi=xi.length;const Ti=[...yi].reverse(),wi=yi.length;function Si(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>mi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=mi(t,e,n);else{const s="function"==typeof e?y(t,e,n.custom):e;i=Promise.all(pi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function bi(t){let e=Si(t),n=Vi(),i=!0;const s=e=>(n,i)=>{var s;const o=y(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<Pi;t++){const i=xi[t],s=e.props[i];(gi(s)||!1===s)&&(n[i]=s)}return n}(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;e<wi;e++){const d=Ti[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],v=gi(m),g=d===o?p.isActive:null;!1===g&&(c=e);let y=m===a[d]&&m!==r[d]&&v;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===g||!m&&!p.prevProp||f(m)||"boolean"==typeof m)continue;const x=Ai(p.prevProp,m);let P=x||d===o&&p.isActive&&!y&&v||e>c&&v,T=!1;const w=Array.isArray(m)?m:[m];let S=w.reduce(s(d),{});!1===g&&(S={});const{prevResolvedValues:b={}}=p,A={...b,...S},E=e=>{P=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=b[t];if(h.hasOwnProperty(t))continue;let i=!1;i=ut(e)&&ut(n)?!vi(e,n):e!==n,i?null!=e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(h={...h,...S}),i&&t.blockInitialAnimation&&(P=!1);const V=!(y&&x)||T;P&&V&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};if("boolean"!=typeof r.initial){const n=y(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?i:null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Vi(),i=!0}}}function Ai(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!vi(e,t)}function Ei(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vi(){return{animate:Ei(!0),whileInView:Ei(),whileHover:Ei(),whileTap:Ei(),whileDrag:Ei(),whileFocus:Ei(),exit:Ei()}}class Mi{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Di=0;const Ci={animation:{Feature:class extends Mi{constructor(t){super(t),t.animationState||(t.animationState=bi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();f(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Mi{constructor(){super(...arguments),this.id=Di++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function ki(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Ri(t){return{point:{x:t.pageX,y:t.pageY}}}function Li(t,e,n,i){return ki(t,e,(t=>e=>K(e)&&t(e,Ri(e)))(n),i)}function Bi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ji(t){return t.max-t.min}function Fi(t,e,n,i=.5){t.origin=i,t.originPoint=an(e.min,e.max,t.origin),t.scale=ji(n)/ji(e),t.translate=an(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Oi(t,e,n,i){Fi(t.x,e.x,n.x,i?i.originX:void 0),Fi(t.y,e.y,n.y,i?i.originY:void 0)}function Ii(t,e,n){t.min=n.min+e.min,t.max=t.min+ji(e)}function Ui(t,e,n){t.min=e.min-n.min,t.max=t.min+ji(e)}function Ni(t,e,n){Ui(t.x,e.x,n.x),Ui(t.y,e.y,n.y)}const Wi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Yi(t){return[t("x"),t("y")]}function $i(t){return void 0===t||1===t}function Xi({scale:t,scaleX:e,scaleY:n}){return!$i(t)||!$i(e)||!$i(n)}function Ki(t){return Xi(t)||zi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function zi(t){return Hi(t.x)||Hi(t.y)}function Hi(t){return t&&"0%"!==t}function Gi(t,e,n){return n+e*(t-n)}function qi(t,e,n,i,s){return void 0!==s&&(t=Gi(t,s,i)),Gi(t,n,i)+e}function Zi(t,e=0,n=1,i,s){t.min=qi(t.min,e,n,i,s),t.max=qi(t.max,e,n,i,s)}function _i(t,{x:e,y:n}){Zi(t.x,e.translate,e.scale,e.originPoint),Zi(t.y,n.translate,n.scale,n.originPoint)}function Ji(t,e){t.min=t.min+e,t.max=t.max+e}function Qi(t,e,n,i,s=.5){Zi(t,e,n,an(t.min,t.max,s),i)}function ts(t,e){Qi(t.x,e.x,e.scaleX,e.scale,e.originX),Qi(t.y,e.y,e.scaleY,e.scale,e.originY)}function es(t,e){return Bi(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const ns=({current:t})=>t?t.ownerDocument.defaultView:null;function is(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const ss=(t,e)=>Math.abs(t-e);class os{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=ls(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=ss(t.x,e.x),i=ss(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=st;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=rs(e,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=ls("pointercancel"===t.type?this.lastMoveEventInfo:rs(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!K(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=rs(Ri(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=st;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,ls(o,this.history)),this.removeListeners=fn(Li(this.contextWindow,"pointermove",this.handlePointerMove),Li(this.contextWindow,"pointerup",this.handlePointerUp),Li(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),it(this.updatePoint)}}function rs(t,e){return e?{point:e(t.point)}:t}function as(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ls({point:t},e){return{point:t,delta:as(t,hs(e)),offset:as(t,us(e)),velocity:cs(e,.1)}}function us(t){return t[0]}function hs(t){return t[t.length-1]}function cs(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=hs(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>S(e)));)n--;if(!i)return{x:0,y:0};const o=b(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ds(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ps(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const ms=.35;function fs(t,e,n){return{min:vs(t,e),max:vs(t,n)}}function vs(t,e){return"number"==typeof t?t:t[e]||0}const gs=new WeakMap;class ys{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new os(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Ri(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?U[o]?null:(U[o]=!0,()=>{U[o]=!1}):U.x||U.y?null:(U.x=U.y=!0,()=>{U.x=U.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yi(t=>{let e=this.getAxisMotionValue(t).get()||0;if(_t.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=ji(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&nt.postRender(()=>s(t,e)),Tt(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Yi(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:ns(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&nt.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!xs(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?an(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?an(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&is(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:ds(t.x,n,s),y:ds(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=ms){return!1===t?t=0:!0===t&&(t=ms),{x:fs(t,"left","right"),y:fs(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Yi(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!is(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=es(t,n),{scroll:s}=e;return s&&(Ji(i.x,s.offset.x),Ji(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ps(t.x,e.x),y:ps(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Bi(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Yi(r=>{if(!xs(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=i?200:1e6,h=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Tt(this.visualElement,t),n.start(ci(t,n,0,e,this.visualElement,!1))}stopAnimation(){Yi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yi(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Yi(e=>{const{drag:n}=this.getProps();if(!xs(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-an(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!is(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yi(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=ji(t),s=ji(e);return s>i?n=w(e.min,e.max-i,t.min):i>s&&(n=w(t.min,t.max-s,e.min)),Ot(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Yi(e=>{if(!xs(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(an(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;gs.set(this.visualElement,this);const t=Li(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();is(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),nt.read(e);const s=ki(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Yi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ms,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function xs(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ps=t=>(e,n)=>{t&&nt.postRender(()=>t(e,n))};const Ts=new WeakMap;const ws={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"]},Ss={};for(const t in ws)Ss[t]={isEnabled:e=>ws[t].some(t=>!!e[t])};const bs="undefined"!=typeof window,As={current:null},Es={current:!1};const Vs=[...Je,ie,he];function Ms(t){return f(t.animate)||xi.some(e=>gi(t[e]))}function Ds(t){return Boolean(Ms(t)||t.variants)}const Cs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ks extends class{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ye,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,nt.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Ms(e),this.isVariantNode=Ds(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Pt(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ts.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Es.current||function(){if(Es.current=!0,bs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>As.current=t.matches;t.addListener(e),e()}else As.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||As.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),it(this.notifyUpdate),it(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=at.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&nt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ss){const e=Ss[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Cs.length;e++){const n=Cs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Pt(s))t.addValue(i,s);else if(Pt(o))t.addValue(i,yt(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,yt(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=yt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=i&&("string"==typeof i&&($e(i)||Ft(i))?i=parseFloat(i):(s=i,!Vs.find(_e(s))&&he.test(e)&&(i=Te(t,e))),this.setBaseTarget(t,Pt(i)?i.get():i)),Pt(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=g(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Pt(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new ft),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=tn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Pt(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const Rs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ls={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bs=rt.length;function js(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(at.has(t))r=!0;else if(Ke(t))s[t]=n;else{const e=Rs(n,ye[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o<Bs;o++){const r=rt[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=Rs(a,ye[r]);if(!l){s=!1;i+=`${Ls[r]||r}(${t}) `}n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const Fs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Os={offset:"strokeDashoffset",array:"strokeDasharray"};function Is(t,e,n){return"string"==typeof t?t:Jt.transform(e+n*t)}function Us(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},h,c){if(js(t,u,c),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Is(e,t.x,t.width)} ${Is(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Fs:Os;t[o.offset]=Jt.transform(-i);const r=Jt.transform(e),a=Jt.transform(n);t[o.array]=`${r} ${a}`}(d,r,a,l,!1)}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"]),Ws=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ys(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}function $s(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}function Xs(t,e,n,i){$s(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ns.has(n)?n:wt(n),e.attrs[n])}const Ks={};function zs(t,{layout:e,layoutId:n}){return at.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ks[t]||"opacity"===t)}function Hs(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(Pt(s[r])||e.style&&Pt(e.style[r])||zs(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return o}function Gs(t,e,n){const i=Hs(t,e,n);for(const n in t)if(Pt(t[n])||Pt(e[n])){i[-1!==rt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class qs extends ks{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wi,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Ys(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(at.has(e)){const t=Pe(e);return t&&t.default||0}return e=Ns.has(e)?e:wt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Gs(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&nt.postRender(this.updateDimensions)}build(t,e,n){Us(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){Xs(t,e,0,i)}mount(t){this.isSVGTag=Ws(t.tagName),super.mount(t)}}class Zs extends ks{constructor(){super(...arguments),this.type="html",this.renderInstance=$s}readValueFromInstance(t,e){if(at.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ke(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Ke(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return es(t,e)}build(t,e,n){js(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Hs(t,e,n)}}const{schedule:_s,cancel:Js}=et(queueMicrotask,!1),Qs=(t,e)=>t.depth-e.depth;class to{constructor(){this.children=[],this.isDirty=!1}add(t){pt(this.children,t),this.isDirty=!0}remove(t){mt(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Qs),this.isDirty=!1,this.children.forEach(t)}}function eo(t){const e=Pt(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const no=["TopLeft","TopRight","BottomLeft","BottomRight"],io=no.length,so=t=>"string"==typeof t?parseFloat(t):t,oo=t=>"number"==typeof t||Jt.test(t);function ro(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ao=uo(0,.5,Bt),lo=uo(.5,.95,x);function uo(t,e,n){return i=>i<t?0:i>e?1:n(w(t,e,i))}function ho(t,e){t.min=e.min,t.max=e.max}function co(t,e){ho(t.x,e.x),ho(t.y,e.y)}function po(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function mo(t,e,n,i,s){return t=Gi(t-=e,1/n,i),void 0!==s&&(t=Gi(t,1/s,i)),t}function fo(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){if(_t.test(e)){e=parseFloat(e);e=an(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=an(o.min,o.max,i);t===o&&(a-=e),t.min=mo(t.min,e,n,a,s),t.max=mo(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const vo=["x","scaleX","originX"],go=["y","scaleY","originY"];function yo(t,e,n,i){fo(t.x,e,vo,n?n.x:void 0,i?i.x:void 0),fo(t.y,e,go,n?n.y:void 0,i?i.y:void 0)}function xo(t){return 0===t.translate&&1===t.scale}function Po(t){return xo(t.x)&&xo(t.y)}function To(t,e){return t.min===e.min&&t.max===e.max}function wo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function So(t,e){return wo(t.x,e.x)&&wo(t.y,e.y)}function bo(t){return ji(t.x)/ji(t.y)}function Ao(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Eo{constructor(){this.members=[]}add(t){pt(this.members,t),t.scheduleRender()}remove(t){if(mt(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Vo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Mo=["","X","Y","Z"],Do={visibility:"hidden"};let Co=0;function ko(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Ro({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=Co++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jo),this.nodes.forEach(Yo),this.nodes.forEach($o),this.nodes.forEach(Fo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new to)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ft),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var i;this.isSVG=(i=e)instanceof SVGElement&&"svg"!==i.tagName,this.instance=e;const{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||s)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=dt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(it(i),t(o-e))};return nt.read(i,!0),()=>it(i)}(i,250),Vo.hasAnimatedSinceResize&&(Vo.hasAnimatedSinceResize=!1,this.nodes.forEach(Wo))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||r.getDefaultTransition()||qo,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!So(this.targetLayout,i),u=!e&&n;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...V(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Wo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,it(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(Xo),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const i=bt(n);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",nt,!(t||n))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&t(s)}(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Io);this.isUpdating||this.nodes.forEach(Uo),this.isUpdating=!1,this.nodes.forEach(No),this.nodes.forEach(Lo),this.nodes.forEach(Bo),this.clearAllSnapshots();const t=dt.now();st.delta=Ot(0,1e3/60,t-st.timestamp),st.timestamp=t,st.isProcessing=!0,ot.update.process(st),ot.preRender.process(st),ot.render.process(st),st.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_s.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Oo),this.sharedNodes.forEach(Ko)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,nt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){nt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ji(this.snapshot.measuredBox.x)||ji(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Po(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||Ki(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Jo((i=n).x),Jo(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const n=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(tr))){const{scroll:t}=this.root;t&&(Ji(n.x,t.offset.x),Ji(n.y,t.offset.y))}return n}removeElementScroll(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};if(co(n,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return n;for(let e=0;e<this.path.length;e++){const i=this.path[e],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&co(n,t),Ji(n.x,s.offset.x),Ji(n.y,s.offset.y))}return n}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};co(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ts(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Ki(i.latestValues)&&ts(n,i.latestValues)}return Ki(this.latestValues)&&ts(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};co(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Ki(n.latestValues))continue;Xi(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};co(i,n.measurePageBox()),yo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Ki(this.latestValues)&&yo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==st.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=st.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ni(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),co(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,a,l;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,Ii(r.x,a.x,l.x),Ii(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):co(this.target,this.layout.layoutBox),_i(this.target,this.targetDelta)):co(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ni(this.relativeTargetOrigin,this.target,t.target),co(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Xi(this.parent.latestValues)&&!zi(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===st.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;co(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ts(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,_i(t,r)),i&&Ki(o.latestValues)&&ts(t,o.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(po(this.prevProjectionDelta.x,this.projectionDelta.x),po(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Oi(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Ao(this.projectionDelta.x,this.prevProjectionDelta.x)&&Ao(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,h=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Go));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,v;zo(o.x,t.x,n),zo(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ni(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,v=n,Ho(p.x,m.x,f.x,v),Ho(p.y,m.y,f.y,v),c&&(l=this.relativeTarget,d=c,To(l.x,d.x)&&To(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),co(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=an(0,void 0!==n.opacity?n.opacity:1,ao(i)),t.opacityExit=an(void 0!==e.opacity?e.opacity:1,0,lo(i))):o&&(t.opacity=an(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<io;s++){const o=`border${no[s]}Radius`;let r=ro(e,o),a=ro(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||oo(r)===oo(a)?(t[o]=Math.max(an(so(r),so(a),i),0),(_t.test(a)||_t.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=an(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,h,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(it(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{Vo.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const i=Pt(t)?t:yt(t);return i.start(ci("",i,e,n)),i.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Qo(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ji(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=ji(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}co(e,n),ts(e,s),Oi(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Eo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ko("z",t,i,this.animationValues);for(let e=0;e<Mo.length;e++)ko("rotate"+Mo[e],t,i,this.animationValues),ko("skew"+Mo[e],t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Do;const i={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=eo(null==t?void 0:t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=eo(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Ki(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==n?void 0:n.z)||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in Ks){if(void 0===r[t])continue;const{correct:e,applyTo:n,isCSSVariable:s}=Ks[t],a="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=a}else s?this.options.visualElement.renderState.vars[t]=a:i[t]=a}return this.options.layoutId&&(i.pointerEvents=o===this?eo(null==t?void 0:t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(Io),this.root.sharedNodes.clear()}}}function Lo(t){t.updateLayout()}function Bo(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?Yi(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=ji(i);i.min=e[t].min,i.max=i.min+s}):Qo(s,n.layoutBox,e)&&Yi(i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=ji(e[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Oi(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Oi(a,t.applyTransform(i,!0),n.measuredBox):Oi(a,e,n.layoutBox);const l=!Po(r);let u=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ni(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ni(a,e,o.layoutBox),So(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function jo(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Fo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Oo(t){t.clearSnapshot()}function Io(t){t.clearMeasurements()}function Uo(t){t.isLayoutDirty=!1}function No(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Wo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Yo(t){t.resolveTargetDelta()}function $o(t){t.calcProjection()}function Xo(t){t.resetSkewAndRotation()}function Ko(t){t.removeLeadSnapshot()}function zo(t,e,n){t.translate=an(e.translate,0,n),t.scale=an(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ho(t,e,n,i){t.min=an(e.min,n.min,i),t.max=an(e.max,n.max,i)}function Go(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const qo={duration:.45,ease:[.4,0,.1,1]},Zo=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),_o=Zo("applewebkit/")&&!Zo("chrome/")?Math.round:x;function Jo(t){t.min=_o(t.min),t.max=_o(t.max)}function Qo(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=bo(e),s=bo(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function tr(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const er=Ro({attachResizeListener:(t,e)=>ki(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),nr={current:void 0},ir=Ro({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!nr.current){const t=new er({});t.mount(window),t.setOptions({layoutScroll:!0}),nr.current=t}return nr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function sr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const or={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Jt.test(t))return t;t=parseFloat(t)}return`${sr(t,e.target.x)}% ${sr(t,e.target.y)}%`}},rr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=he.parse(t);if(s.length>5)return i;const o=he.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=an(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}},ar=n(null);const lr=n({}),ur=n({});class hr extends a{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Ks[e]=t[e],Ke(e)&&(Ks[e].isCSSVariable=!0)}(dr),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Vo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||nt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),_s.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cr(e){const[n,a]=function(t=!0){const e=i(ar);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:a,register:l}=e,u=s();o(()=>{if(t)return l(u)},[t]);const h=r(()=>t&&a&&a(u),[u,a,t]);return!n&&a?[!1,h]:[!0]}(),l=i(lr);return t(hr,{...e,layoutGroup:l,switchLayoutGroup:i(ur),isPresent:n,safeToRemove:a})}const dr={borderRadius:{...or,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:or,borderTopRightRadius:or,borderBottomLeftRadius:or,borderBottomRightRadius:or,boxShadow:rr},pr={pan:{Feature:class extends Mi{constructor(){super(...arguments),this.removePointerDownListener=x}onPointerDown(t){this.session=new os(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ns(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ps(t),onStart:Ps(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&nt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Li(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Mi{constructor(t){super(t),this.removeGroupControls=x,this.removeListeners=x,this.controls=new ys(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||x}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ir,MeasureLayout:cr}};function mr(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&nt.postRender(()=>s(e,Ri(e)))}function fr(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&nt.postRender(()=>s(e,Ri(e)))}const vr=new WeakMap,gr=new WeakMap,yr=t=>{const e=vr.get(t.target);e&&e(t)},xr=t=>{t.forEach(yr)};function Pr(t,e,n){const i=function({root:t,...e}){const n=t||document;gr.has(n)||gr.set(n,{});const i=gr.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(xr,{root:t,...e})),i[s]}(e);return vr.set(t,n),i.observe(t),()=>{vr.delete(t),i.unobserve(t)}}const Tr={some:0,all:1};const wr={inView:{Feature:class extends Mi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Tr[i]};return Pr(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Mi{mount(){const{current:t}=this.node;t&&(this.unmount=_(t,(t,e)=>(fr(this.node,e,"Start"),(t,{success:e})=>fr(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Mi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=fn(ki(this.node.current,"focus",()=>this.onFocus()),ki(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Mi{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=W(t,n),r=t=>{if(!Y(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{Y(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(mr(this.node,e,"Start"),t=>mr(this.node,t,"End"))))}unmount(){}}}},Sr={layout:{ProjectionNode:ir,MeasureLayout:cr}},br=n({strict:!1}),Ar=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Er=n({});function Vr(t){const{initial:e,animate:n}=function(t,e){if(Ms(t)){const{initial:e,animate:n}=t;return{initial:!1===e||gi(e)?e:void 0,animate:gi(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(Er));return l(()=>({initial:e,animate:n}),[Mr(e),Mr(n)])}function Mr(t){return Array.isArray(t)?t.join(" "):t}const Dr=Symbol.for("motionComponentSymbol");function Cr(t,e,n){return r(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):is(n)&&(n.current=i))},[e])}const kr=bs?u:o;function Rr(t,e,n,s,r){var a,l;const{visualElement:u}=i(Er),d=i(br),p=i(ar),m=i(Ar).reducedMotion,f=h(null);s=s||d.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:u,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:m}));const v=f.current,g=i(ur);!v||v.projection||!r||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){return e?!1!==e.options.allowProjection?e.projection:t(e.parent):void 0}(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&is(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(f.current,n,r,g);const y=h(!1);c(()=>{v&&y.current&&v.update(n,p)});const x=n[St],P=h(Boolean(x)&&!(null===(a=window.MotionHandoffIsComplete)||void 0===a?void 0:a.call(window,x))&&(null===(l=window.MotionHasOptimisedAnimation)||void 0===l?void 0:l.call(window,x)));return kr(()=>{v&&(y.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),_s.render(v.render),P.current&&v.animationState&&v.animationState.animateChanges())}),o(()=>{v&&(!P.current&&v.animationState&&v.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)}),P.current=!1))}),v}function Lr({preloadedFeatures:n,createVisualElement:s,useRender:o,useVisualState:r,Component:a}){var l,u;function h(n,l){let u;const h={...i(Ar),...n,layoutId:Br(n)},{isStatic:c}=h,d=Vr(n),p=r(n,c);if(!c&&bs){i(br).strict;const t=function(t){const{drag:e,layout:n}=Ss;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);u=t.MeasureLayout,d.visualElement=Rr(a,p,h,s,t.ProjectionNode)}return e(Er.Provider,{value:d,children:[u&&d.visualElement?t(u,{visualElement:d.visualElement,...h}):null,o(a,n,Cr(p,d.visualElement,l),p,c,d.visualElement)]})}n&&function(t){for(const e in t)Ss[e]={...Ss[e],...t[e]}}(n),h.displayName="motion."+("string"==typeof a?a:`create(${null!==(u=null!==(l=a.displayName)&&void 0!==l?l:a.name)&&void 0!==u?u:""})`);const c=d(h);return c[Dr]=a,c}function Br({layoutId:t}){const e=i(lr).id;return e&&void 0!==t?e+"-"+t:t}const jr=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Fr(t,e,n){for(const i in e)Pt(e[i])||zs(i,n)||(t[i]=e[i])}function Or(t,e){const n={};return Fr(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return js(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Ir(t,e){const n={},i=Or(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Ur=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 Nr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ur.has(t)}let Wr=t=>!Nr(t);try{(Yr=require("@emotion/is-prop-valid").default)&&(Wr=t=>t.startsWith("on")?!Nr(t):Yr(t))}catch(t){}var Yr;const $r=["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 Xr(t){return"string"==typeof t&&!t.includes("-")&&!!($r.indexOf(t)>-1||/[A-Z]/u.test(t))}const Kr=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function zr(t,e,n,i){const s=l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Us(n,e,Ws(i),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Fr(e,t.style,t),s.style={...e,...s.style}}return s}function Hr(t=!1){return(e,n,i,{latestValues:s},o)=>{const r=(Xr(e)?zr:Ir)(n,s,o,e),a=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Wr(s)||!0===n&&Nr(s)||!e&&!Nr(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),u=e!==p?{...a,...r,ref:i}:{},{children:h}=n,c=l(()=>Pt(h)?h.get():h,[h]);return m(e,{...u,children:c})}}const Gr=t=>(e,n)=>{const s=i(Er),o=i(ar),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:qr(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,e,s,o);return n?r():function(t){const e=h(null);return null===e.current&&(e.current=t()),e.current}(r)};function qr(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=eo(o[t]);let{initial:r,animate:a}=t;const l=Ms(t),u=Ds(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let h=!!n&&!1===n.initial;h=h||!1===r;const c=h?a:r;if(c&&"boolean"!=typeof c&&!f(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n<e.length;n++){const i=g(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[h?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const Zr={useVisualState:Gr({scrapeMotionValuesFromProps:Hs,createRenderState:jr})},_r=["x","y","width","height","cx","cy","r"],Jr={useVisualState:Gr({scrapeMotionValuesFromProps:Gs,createRenderState:Kr,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o)for(const t in s)if(at.has(t)){o=!0;break}if(!o)return;let r=!e;if(e)for(let n=0;n<_r.length;n++){const i=_r[n];t[i]!==e[i]&&(r=!0)}r&&nt.read(()=>{Ys(n,i),nt.render(()=>{Us(i,s,Ws(n.tagName),t.transformTemplate),Xs(n,i)})})}})};function Qr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Lr({...Xr(n)?Jr:Zr,preloadedFeatures:t,useRender:Hr(i),createVisualElement:e,Component:n})}}const ta=Qr({...Ci,...wr,...pr,...Sr},(t,e)=>Xr(t)?new qs(e):new Zs(e,{allowProjection:t!==p}))("div");export{ta as MotionDiv};