@ptlm-azulejo/segmented-control 0.0.1 → 0.1.0-alpha.67

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
- (function(D,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],y):(D=typeof globalThis!="undefined"?globalThis:D||self,y(D["segmented-control"]={},D.Vue))})(this,function(D,y){"use strict";var sh=Object.defineProperty,oh=Object.defineProperties;var rh=Object.getOwnPropertyDescriptors;var ue=Object.getOwnPropertySymbols;var jo=Object.prototype.hasOwnProperty,_o=Object.prototype.propertyIsEnumerable;var yn=Math.pow,Io=(D,y,F)=>y in D?sh(D,y,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[y]=F,g=(D,y)=>{for(var F in y||(y={}))jo.call(y,F)&&Io(D,F,y[F]);if(ue)for(var F of ue(y))_o.call(y,F)&&Io(D,F,y[F]);return D},V=(D,y)=>oh(D,rh(y));var K=(D,y)=>{var F={};for(var z in D)jo.call(D,z)&&y.indexOf(z)<0&&(F[z]=D[z]);if(D!=null&&ue)for(var z of ue(D))y.indexOf(z)<0&&_o.call(D,z)&&(F[z]=D[z]);return F};const F=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function z(t,e){let n=new Set,i=new Set,s=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),t()),u(a)}const c={schedule:(u,h=!1,d=!1)=>{const p=d&&s?n:i;return h&&o.add(u),p.has(u)||p.add(u),u},cancel:u=>{i.delete(u),o.delete(u)},process:u=>{if(a=u,s){r=!0;return}s=!0,[n,i]=[i,n],n.forEach(l),n.clear(),s=!1,r&&(r=!1,c.process(u))}};return c}const et={},Uo=40;function vn(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=F.reduce((S,w)=>(S[w]=z(r),S),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:f,postRender:p}=o,m=()=>{const S=et.useManualTiming?s.timestamp:performance.now();n=!1,et.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(S-s.timestamp,Uo),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),f.process(s),p.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(m))},v=()=>{n=!0,i=!0,s.isProcessing||t(m)};return{schedule:F.reduce((S,w)=>{const T=o[w];return S[w]=(P,C=!1,E=!1)=>(n||v(),T.schedule(P,C,E)),S},{}),cancel:S=>{for(let w=0;w<F.length;w++)o[F[w]].cancel(S)},state:s,steps:o}}const $=t=>t,{schedule:M,cancel:nt,state:I,steps:ce}=vn(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:$,!0);let Wt;function No(){Wt=void 0}const U={now:()=>(Wt===void 0&&U.set(I.isProcessing||et.useManualTiming?I.timestamp:performance.now()),Wt),set:t=>{Wt=t,queueMicrotask(No)}},H=t=>t*1e3,W=t=>t/1e3;function $o(t,e){const n=U.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(nt(i),t(r-e))};return M.setup(i,!0),()=>nt(i)}const At=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ot=At("deg"),q=At("%"),x=At("px"),Ko=At("vh"),Wo=At("vw"),bn=V(g({},q),{parse:t=>q.parse(t)/100,transform:t=>q.transform(t*100)});function xn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Z={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;const n=xn(t,e.target.x),i=xn(t,e.target.y);return`${n}% ${i}%`}},J=(t,e,n)=>n>e?e:n<t?t:n,pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Pt=V(g({},pt),{transform:t=>J(0,1,t)}),Gt=V(g({},pt),{default:1}),Et=t=>Math.round(t*1e5)/1e5,he=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Go(t){return t==null}const zo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fe=(t,e)=>n=>!!(typeof n=="string"&&zo.test(n)&&n.startsWith(t)||e&&!Go(n)&&Object.prototype.hasOwnProperty.call(n,e)),Tn=(t,e,n)=>i=>{if(typeof i!="string")return i;const[s,r,o,a]=i.match(he);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ho=t=>J(0,255,t),de=V(g({},pt),{transform:t=>Math.round(Ho(t))}),ut={test:fe("rgb","red"),parse:Tn("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+de.transform(t)+", "+de.transform(e)+", "+de.transform(n)+", "+Et(Pt.transform(i))+")"};function Yo(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}}const pe={test:fe("#"),parse:Yo,transform:ut.transform},mt={test:fe("hsl","hue"),parse:Tn("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+q.transform(Et(e))+", "+q.transform(Et(n))+", "+Et(Pt.transform(i))+")"},B={test:t=>ut.test(t)||pe.test(t)||mt.test(t),parse:t=>ut.test(t)?ut.parse(t):mt.test(t)?mt.parse(t):pe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ut.transform(t):mt.transform(t),getAnimatableNone:t=>{const e=B.parse(t);return e.alpha=0,B.transform(e)}},Xo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function qo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(he))==null?void 0:e.length)||0)+(((n=t.match(Xo))==null?void 0:n.length)||0)>0}const Sn="number",wn="color",Zo="var",Jo="var(",An="${}",Qo=/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 Vt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const a=e.replace(Qo,l=>(B.test(l)?(i.color.push(r),s.push(wn),n.push(B.parse(l))):l.startsWith(Jo)?(i.var.push(r),s.push(Zo),n.push(l)):(i.number.push(r),s.push(Sn),n.push(parseFloat(l))),++r,An)).split(An);return{values:n,split:a,indexes:i,types:s}}function Pn(t){return Vt(t).values}function En(t){const{split:e,types:n}=Vt(t),i=e.length;return s=>{let r="";for(let o=0;o<i;o++)if(r+=e[o],s[o]!==void 0){const a=n[o];a===Sn?r+=Et(s[o]):a===wn?r+=B.transform(s[o]):r+=s[o]}return r}}const tr=t=>typeof t=="number"?0:B.test(t)?B.getAnimatableNone(t):t;function er(t){const e=Pn(t);return En(t)(e.map(tr))}const rt={test:qo,parse:Pn,createTransformer:En,getAnimatableNone:er},R=(t,e,n)=>t+(e-t)*n,Vn={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=rt.parse(t);if(s.length>5)return i;const r=rt.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=R(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}},Cn=t=>e=>typeof e=="string"&&e.startsWith(t),me=Cn("--"),nr=Cn("var(--"),ge=t=>nr(t)?ir.test(t.split("/*")[0].trim()):!1,ir=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Ct={borderRadius:V(g({},Z),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Z,borderTopRightRadius:Z,borderBottomLeftRadius:Z,borderBottomRightRadius:Z,boxShadow:Vn};function Dn(t){for(const e in t)Ct[e]=t[e],me(e)&&(Ct[e].isCSSVariable=!0)}function Mt(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,i=Symbol(n);return[o=>{const a=y.inject(i,o);if(a===void 0)throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return a},o=>(y.provide(i,o),o)]}const[sr,or]=Mt("Motion"),[rr]=Mt("LayoutGroup");function Rn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}class it{constructor(e){this.state=e}beforeMount(){}mount(){}unmount(){}update(){}beforeUpdate(e){}beforeUnmount(){}}var gt=function(){},zt=function(){};process.env.NODE_ENV!=="production"&&(gt=function(t,e){!t&&typeof console!="undefined"&&console.warn(e)},zt=function(t,e){if(!t)throw new Error(e)});function Dt(t,e,n){if(Array.isArray(t))return t.reduce((i,s)=>{const r=Dt(s,e,n);return r?g(g({},i),r):i},{});if(typeof t=="object")return t;if(t&&e){const i=e[t];return typeof i=="function"?i(n):i}}function ar(t,e){return typeof t!=typeof e?!0:Array.isArray(t)&&Array.isArray(e)?!lr(t,e):t!==e}function lr(t,e){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 Ln(t){return t==null?void 0:t.startsWith("--")}const ur=t=>t;function cr(t){return typeof t=="number"}const hr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],fr=new Set(hr);function Bn(t){return fr.has(t)}class dr{constructor(e){this.features=[];const{features:n=[],lazyMotionContext:i}=e.options,s=n.concat(i.features.value);this.features=s.map(o=>new o(e));const r=this.features;y.watch(i.features,o=>{o.forEach(a=>{if(!s.includes(a)){s.push(a);const l=new a(e);r.push(l),e.isMounted()&&(l.beforeMount(),l.mount())}})},{flush:"pre"})}mount(){this.features.forEach(e=>e.mount())}beforeMount(){this.features.forEach(e=>{var n;return(n=e.beforeMount)==null?void 0:n.call(e)})}unmount(){this.features.forEach(e=>e.unmount())}update(){this.features.forEach(e=>{var n;return(n=e.update)==null?void 0:n.call(e)})}beforeUpdate(e){this.features.forEach(n=>{var i;return(i=n.beforeUpdate)==null?void 0:i.call(n,e)})}beforeUnmount(){this.features.forEach(e=>e.beforeUnmount())}}function pr(t){return typeof t=="string"||t===!1||Array.isArray(t)}const kn=new WeakMap;let mr=0;class gr{constructor(e,n){var i;this.element=null,this.isExiting=!1,this.presenceContainer=null,this.children=new Set,this.activeStates={initial:!0,animate:!0},this.currentProcess=null,this._context=null,this.animateUpdates=$,this.id=`motion-state-${mr++}`,this.options=e,this.parent=n,(i=n==null?void 0:n.children)==null||i.add(this);const r=(e.initial===void 0&&e.variants?this.context.initial:e.initial)===!1?["initial","animate"]:["initial"];this.initTarget(r),this.featureManager=new dr(this),this.type=Bn(this.options.as)?"svg":"html"}get context(){if(!this._context){const e={get:(n,i)=>{var s;return pr(this.options[i])?this.options[i]:(s=this.parent)==null?void 0:s.context[i]}};this._context=new Proxy({},e)}return this._context}initTarget(e){var s;var n;const i=(s=this.options.custom)!=null?s:(n=this.options.animatePresenceContext)==null?void 0:n.custom;this.baseTarget=e.reduce((r,o)=>g(g({},r),Dt(this.options[o]||this.context[o],this.options.variants,i)),{}),this.target={}}updateOptions(e){var n;this.options=e,(n=this.visualElement)==null||n.update(V(g({},this.options),{whileTap:this.options.whilePress}),null)}beforeMount(){this.featureManager.beforeMount()}mount(e,n,i=!1){var s;zt(!!e,"Animation state must be mounted with valid Element"),this.element=e,this.updateOptions(n),this.featureManager.mount(),!i&&this.options.animate&&((s=this.startAnimation)==null||s.call(this))}clearAnimation(){var e,n;this.currentProcess&&nt(this.currentProcess),this.currentProcess=null,(n=(e=this.visualElement)==null?void 0:e.variantChildren)==null||n.forEach(i=>{i.state.clearAnimation()})}startAnimation(){this.clearAnimation(),this.currentProcess=M.render(()=>{this.currentProcess=null,this.animateUpdates()})}beforeUnmount(){this.featureManager.beforeUnmount()}unmount(){var e,n,i;(n=(e=this.parent)==null?void 0:e.children)==null||n.delete(this),kn.delete(this.element),this.featureManager.unmount(),(i=this.visualElement)==null||i.unmount(),this.clearAnimation()}beforeUpdate(e){this.featureManager.beforeUpdate(e)}update(e){this.updateOptions(e),this.featureManager.update(),this.startAnimation()}setActive(e,n,i=!0){var s;!this.element||this.activeStates[e]===n||(this.activeStates[e]=n,(s=this.visualElement.variantChildren)==null||s.forEach(r=>{r.state.setActive(e,n,!1)}),i&&this.animateUpdates({isExit:e==="exit"&&this.activeStates.exit}))}isMounted(){return!!this.element}getSnapshot(e,n){}didUpdate(e){}}const ct=new WeakMap;function Fn(t,e,n){return new CustomEvent(t,{detail:{target:e,isExit:n}})}const On={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>`${t}deg`},yr={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>`${t}px`},rotate:On,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:ur},skew:On},vr=["translate","scale","rotate","skew"],br=["","X","Y","Z"],ye=new Map,Ht=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"];vr.forEach(t=>{br.forEach(e=>{Ht.push(t+e),ye.set(t+e,yr[t])})});const xr=new Set(Ht),Tr=t=>xr.has(t),In={x:"translateX",y:"translateY",z:"translateZ"};function Sr([t],[e]){return Ht.indexOf(t)-Ht.indexOf(e)}function wr(t,[e,n]){return`${t} ${e}(${n})`}function Ar(t){return t.sort(Sr).reduce(wr,"").trim()}const jn={translate:[0,0],rotate:0,scale:1,skew:0,x:0,y:0,z:0},k=t=>!!(t&&t.getVelocity),Pr={get:(t,e)=>{let n=Ln(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&n!=="0"){const i=ye.get(e);i&&(n=i.initialValue)}return n},set:(t,e,n)=>{Ln(e)?t.style.setProperty(e,n):t.style[e]=n}};function Er(t){var e;const n={},i=[];for(let s in t){let r=t[s];r=k(r)?r.get():r,Tr(s)&&s in In&&(s=In[s]);let o=Array.isArray(r)?r[0]:r;const a=ye.get(s);a?(o=cr(r)?(e=a.toDefaultUnit)==null?void 0:e.call(a,r):r,i.push([s,o])):n[s]=o}return i.length&&(n.transform=Ar(i)),Object.keys(n).length===0?null:n}const Vr={fill:!0,stroke:!0,opacity:!0,"stroke-width":!0,"fill-opacity":!0,"stroke-opacity":!0,"stroke-linecap":!0,"stroke-linejoin":!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,cx:!0,cy:!0,r:!0,d:!0,x1:!0,y1:!0,x2:!0,y2:!0,points:!0,"path-length":!0,viewBox:!0,width:!0,height:!0,"preserve-aspect-ratio":!0,"clip-path":!0,filter:!0,mask:!0,"stop-color":!0,"stop-opacity":!0,"gradient-transform":!0,"gradient-units":!0,"spread-method":!0,"marker-end":!0,"marker-mid":!0,"marker-start":!0,"text-anchor":!0,"dominant-baseline":!0,"font-family":!0,"font-size":!0,"font-weight":!0,"letter-spacing":!0,"vector-effect":!0};function Cr(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Mr(t,e,n=1,i=0){t.pathLength=1,delete t["path-length"],t["stroke-dashoffset"]=x.transform(-i);const s=x.transform(e),r=x.transform(n);t["stroke-dasharray"]=`${s} ${r}`}function Dr(t){const e={},n={};for(const i in t){const s=Cr(i);if(s in Vr){const r=t[i];e[s]=k(r)?r.get():r}else n[i]=t[i]}return e["path-length"]!==void 0&&Mr(e,e["path-length"],e["path-spacing"],e["path-offset"]),{attrs:e,style:n}}typeof WorkerGlobalScope!="undefined"&&globalThis instanceof WorkerGlobalScope;const Yt=t=>typeof t!="undefined";function Rr({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Lr(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}}function Br(t,e){return Rr(Lr(t.getBoundingClientRect(),e))}const _n={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"]},ve={};for(const t in _n)ve[t]={isEnabled:e=>_n[t].some(n=>!!e[n])};const Un=()=>({translate:0,scale:1,origin:0,originPoint:0}),yt=()=>({x:Un(),y:Un()}),Nn=()=>({min:0,max:0}),O=()=>({x:Nn(),y:Nn()}),kr=typeof window!="undefined",Xt={current:null},$n={current:!1};function Fr(){if($n.current=!0,!!kr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xt.current=t.matches;t.addEventListener("change",e),e()}else Xt.current=!1}function Or(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ir(t){return typeof t=="string"||Array.isArray(t)}const jr=["initial",...["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"]];function Kn(t){return Or(t.animate)||jr.some(e=>Ir(t[e]))}function _r(t){return!!(Kn(t)||t.variants)}function be(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}const Wn=new Set;function Gn(t,e,n){t||Wn.has(e)||(console.warn(be(e,n)),Wn.add(e))}function xe(t,e){t.indexOf(e)===-1&&t.push(e)}function qt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Te{constructor(){this.subscriptions=[]}add(e){return xe(this.subscriptions,e),()=>qt(this.subscriptions,e)}notify(e,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,i);else for(let r=0;r<s;r++){const o=this.subscriptions[r];o&&o(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function zn(t,e){return e?t*(1e3/e):0}const Hn=30,Ur=t=>!isNaN(parseFloat(t));class Nr{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{var s;const r=U.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=U.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ur(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Gn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Te);const i=this.events[e].add(n);return e==="change"?()=>{i(),M.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=U.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Hn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Hn);return zn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vt(t,e){return new Nr(t,e)}function $r(t,e,n){for(const i in e){const s=e[i],r=n[i];if(k(s))t.addValue(i,s);else if(k(r))t.addValue(i,vt(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const o=t.getValue(i);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(i);t.addValue(i,vt(o!==void 0?o:s,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}function Yn(t){const e=[{},{}];return t==null||t.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function Xn(t,e,n,i){if(typeof e=="function"){const[s,r]=Yn(i);e=e(n!==void 0?n:t.custom,s,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,r]=Yn(i);e=e(n!==void 0?n:t.custom,s,r)}return e}function Kr(t){var e;for(let n=1;n<t.length;n++)(e=t[n])!=null||(t[n]=t[n-1])}const ht=t=>t*180/Math.PI,Se=t=>{const e=ht(Math.atan2(t[1],t[0]));return we(e)},Wr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Se,rotateZ:Se,skewX:t=>ht(Math.atan(t[1])),skewY:t=>ht(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},we=t=>(t=t%360,t<0&&(t+=360),t),qn=Se,Zn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Jn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Gr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zn,scaleY:Jn,scale:t=>(Zn(t)+Jn(t))/2,rotateX:t=>we(ht(Math.atan2(t[6],t[5]))),rotateY:t=>we(ht(Math.atan2(-t[2],t[0]))),rotateZ:qn,rotate:qn,skewX:t=>ht(Math.atan(t[4])),skewY:t=>ht(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ae(t){return t.includes("scale")?1:0}function Pe(t,e){if(!t||t==="none")return Ae(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Gr,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Wr,s=a}if(!s)return Ae(e);const r=i[e],o=s[1].split(",").map(Hr);return typeof r=="function"?r(o):o[r]}const zr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Pe(n,e)};function Hr(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xt=new Set(bt),Qn=t=>t===pt||t===x,Yr=new Set(["x","y","z"]),Xr=bt.filter(t=>!Yr.has(t));function qr(t){const e=[];return Xr.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const at={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})=>Pe(e,"x"),y:(t,{transform:e})=>Pe(e,"y")};at.translateX=at.x,at.translateY=at.y;const ft=new Set;let Ee=!1,Ve=!1,Ce=!1;function ti(){if(Ve){const t=Array.from(ft).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const s=qr(i);s.length&&(n.set(i,s),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([r,o])=>{var a;(a=i.getValue(r))==null||a.set(o)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Ve=!1,Ee=!1,ft.forEach(t=>t.complete(Ce)),ft.clear()}function ei(){ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ve=!0)})}function Zr(){Ce=!0,ei(),ti(),Ce=!1}class Me{constructor(e,n,i,s,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=s,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ft.add(this),Ee||(Ee=!0,M.read(ei),M.resolveKeyframes(ti))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:s}=this;if(e[0]===null){const r=s==null?void 0:s.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(i&&n){const a=i.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&r===void 0&&s.set(e[0])}Kr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ft.delete(this)}cancel(){this.state==="scheduled"&&(ft.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ni=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ii=t=>/^0[^.\s]+$/u.test(t),Jr={test:t=>t==="auto",parse:t=>t},si=t=>e=>e.test(t),oi=[pt,x,q,ot,Wo,Ko,Jr],ri=t=>oi.find(si(t)),Qr=[...oi,B,rt],ta=t=>Qr.find(si(t)),ea=new Set(["brightness","contrast","saturate","opacity"]);function na(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(he)||[];if(!i)return t;const s=n.replace(i,"");let r=ea.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const ia=/\b([a-z-]*)\(.*?\)/gu,De=V(g({},rt),{getAnimatableNone:t=>{const e=t.match(ia);return e?e.map(na).join(" "):t}}),ai=V(g({},pt),{transform:Math.round}),Re=V(g({borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,inset:x,insetBlock:x,insetBlockStart:x,insetBlockEnd:x,insetInline:x,insetInlineStart:x,insetInlineEnd:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,paddingBlock:x,paddingBlockStart:x,paddingBlockEnd:x,paddingInline:x,paddingInlineStart:x,paddingInlineEnd:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,marginBlock:x,marginBlockStart:x,marginBlockEnd:x,marginInline:x,marginInlineStart:x,marginInlineEnd:x,backgroundPositionX:x,backgroundPositionY:x},{rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:Gt,scaleX:Gt,scaleY:Gt,scaleZ:Gt,skew:ot,skewX:ot,skewY:ot,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:Pt,originX:bn,originY:bn,originZ:x}),{zIndex:ai,fillOpacity:Pt,strokeOpacity:Pt,numOctaves:ai}),sa=V(g({},Re),{color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:De,WebkitFilter:De}),li=t=>sa[t];function ui(t,e){let n=li(t);return n!==De&&(n=rt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const{schedule:ci}=vn(queueMicrotask,!0),hi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class fi{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Me,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 f=U.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,M.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget=g({},l),this.initialValues=n.initial?g({},l):{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Kn(n),this.isVariantNode=_r(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const d=this.scrapeMotionValuesFromProps(n,{},this),{willChange:u}=d,h=K(d,["willChange"]);for(const f in h){const p=h[f];l[f]!==void 0&&k(p)&&p.set(l[f])}}mount(e){var n;this.current=e,ct.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:($n.current||Fr(),this.shouldReduceMotion=Xt.current),process.env.NODE_ENV!=="production"&&Gn(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),nt(this.notifyUpdate),nt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const i=this.features[n];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(e){var n;this.children.add(e),(n=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=xt.has(e);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&M.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ve){const n=ve[e];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):O()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<hi.length;i++){const s=hi[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const r="on"+s,o=e[r];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=$r(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=vt(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!=null?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(ni(i)||ii(i))?i=parseFloat(i):!ta(i)&&rt.test(n)&&(i=ui(e,n)),this.setBaseTarget(e,k(i)?i.get():i)),k(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const o=Xn(this.props,i,(n=this.presenceContext)==null?void 0:n.custom);o&&(s=o[e])}if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!k(r)?r:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Te),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ci.render(this.render)}}const di=new Set(["width","height","top","left","right","bottom",...bt]);var pi;let Rt=()=>{},Q=()=>{};typeof process!="undefined"&&((pi=process.env)==null?void 0:pi.NODE_ENV)!=="production"&&(Rt=(t,e,n)=>{!t&&typeof console!="undefined"&&console.warn(be(e,n))},Q=(t,e,n)=>{if(!t)throw new Error(be(e,n))});const oa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ra(t){const e=oa.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n!=null?n:i}`,s]}const aa=4;function mi(t,e,n=1){Q(n<=aa,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=ra(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const o=r.trim();return ni(o)?parseFloat(o):o}return ge(s)?mi(s,e,n+1):s}function la(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ii(t):!0}const ua=new Set(["auto","none","0"]);function ca(t,e,n){let i=0,s;for(;i<t.length&&!s;){const r=t[i];typeof r=="string"&&!ua.has(r)&&Vt(r).values.length&&(s=t[i]),i++}if(s&&n)for(const r of e)t[r]=ui(n,s)}class ha extends Me{constructor(e,n,i,s,r){super(e,n,i,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),ge(h))){const d=mi(h,n.current);d!==void 0&&(e[u]=d),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!di.has(i)||e.length!==2)return;const[s,r]=e,o=ri(s),a=ri(r),l=Mn(s),c=Mn(r);if(l!==c&&at[i]){this.needsMeasurement=!0;return}if(o!==a)if(Qn(o)&&Qn(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else at[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||la(e[s]))&&i.push(s);i.length&&ca(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=at[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(i,s).jump(s,!1)}measureEndState(){var e;const{element:n,name:i,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const r=n.getValue(i);r&&r.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=at[i](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(e=this.removedTransforms)!=null&&e.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}class gi extends fi{constructor(){super(...arguments),this.KeyframeResolver=ha}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;k(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}const yi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,fa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},da=bt.length;function pa(t,e,n){let i="",s=!0;for(let r=0;r<da;r++){const o=bt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=yi(a,Re[o]);if(!l){s=!1;const u=fa[o]||o;i+=`${u}(${c}) `}n&&(e[o]=c)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function vi(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(xt.has(l)){o=!0;continue}else if(me(l)){s[l]=c;continue}else{const u=yi(c,Re[l]);l.startsWith("origin")?(a=!0,r[l]=u):i[l]=u}}if(e.transform||(o||n?i.transform=pa(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;i.transformOrigin=`${l} ${c} ${u}`}}function bi(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];s==null||s.applyProjectionStyles(r,i);for(o in n)r.setProperty(o,n[o])}function ma(t,{layout:e,layoutId:n}){return xt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ct[t]||t==="opacity")}function xi(t,e,n){var i;const{style:s}=t,r={};for(const o in s)(k(s[o])||e.style&&k(e.style[o])||ma(o,t)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(r[o]=s[o]);return r}function ga(t){return window.getComputedStyle(t)}class Ti extends gi{constructor(){super(...arguments),this.type="html",this.renderInstance=bi}readValueFromInstance(e,n){var i;if(xt.has(n))return(i=this.projection)!=null&&i.isProjecting?Ae(n):zr(e,n);{const s=ga(e),r=(me(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Br(e,n)}build(e,n,i){vi(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return xi(e,n,i)}}const Le=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ya={offset:"stroke-dashoffset",array:"stroke-dasharray"},va={offset:"strokeDashoffset",array:"strokeDasharray"};function ba(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?ya:va;t[r.offset]=x.transform(-i);const o=x.transform(e),a=x.transform(n);t[r.array]=`${o} ${a}`}const xa=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ta(t,h,l,c,u){var d=h,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0}=d,a=K(d,["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"]);var m,v;if(vi(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:p}=t;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=(m=f.transformOrigin)!=null?m:"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=(v=u==null?void 0:u.transformBox)!=null?v:"fill-box",delete f.transformBox);for(const b of xa)f[b]!==void 0&&(p[b]=f[b],delete f[b]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),s!==void 0&&ba(f,s,r,o,!1)}const Si=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"]),Sa=t=>typeof t=="string"&&t.toLowerCase()==="svg";function wa(t,e,n,i){bi(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(Si.has(s)?s:Le(s),e.attrs[s])}function Aa(t,e,n){const i=xi(t,e,n);for(const s in t)if(k(t[s])||k(e[s])){const r=bt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[r]=t[s]}return i}class wi extends gi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=O}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(xt.has(n)){const i=li(n);return i&&i.default||0}return n=Si.has(n)?n:Le(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return Aa(e,n,i)}build(e,n,i){Ta(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,s){wa(e,n,i,s)}mount(e){this.isSVGTag=Sa(e.tagName),super.mount(e)}}function Pa(t,e){return Bn(t)?new wi(e):new Ti(e)}function Ea(t,e,n,i=0,s=1){const r=Array.from(t),o=r.indexOf(e),a=t.size,l=(a-1)*i,c=typeof n=="function";return o===r.length-1&&(e.parent.enteringChildren=void 0),c?n(o,a):s===1?o*i:l-o*i}function Be(t){return typeof t=="object"&&!Array.isArray(t)}function ke(t,e,n){var i;if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const r=(i=n==null?void 0:n[t])!=null?i:s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function Ai(t,e,n,i){return typeof t=="string"&&Be(e)?ke(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Va(t,e,n){return t*(e+1)}function Pi(t,e,n,i){var s;return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):(s=i.get(e))!=null?s:t}const Ca=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},Ei=t=>Array.isArray(t)&&typeof t[0]!="number";function Vi(t,e){return Ei(t)?t[Ca(0,t.length,e)]:t}function Ma(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(qt(t,s),i--)}}function Da(t,e,n,i,s,r){Ma(t,s,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:R(s,r,i[o]),easing:Vi(n,o)})}function Ra(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function La(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const Tt=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};function Ci(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=Tt(0,e,i);t.push(R(n,1,s))}}function Mi(t){const e=[0];return Ci(e,t.length-1),e}const Zt=2e4;function Fe(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<Zt;)e+=n,i=t.next(e);return e>=Zt?1/0:e}function Di(t,e=100,n){const i=n(V(g({},t),{keyframes:[0,e]})),s=Math.min(Fe(i),Zt);return{type:"keyframes",ease:r=>i.next(s*r).value/e,duration:W(s)}}function Oe(t){return typeof t=="function"&&"applyToOptions"in t}const Ba="easeInOut",ka=20;function Fa(t,r={},i,s){var o=r,{defaultTransition:e={}}=o,n=K(o,["defaultTransition"]);const a=e.duration||.3,l=new Map,c=new Map,u={},h=new Map;let d=0,f=0,p=0;for(let m=0;m<t.length;m++){const v=t[m];if(typeof v=="string"){h.set(v,f);continue}else if(!Array.isArray(v)){h.set(v.name,Pi(f,v.at,d,h));continue}let[b,A,S={}]=v;S.at!==void 0&&(f=Pi(f,S.at,d,h));let w=0;const T=(P,C,E,j=0,N=0)=>{const _=Oa(P),Oo=C,{delay:mn=0,times:st=Mi(_),type:gn="keyframes",repeat:Ut,repeatType:ch,repeatDelay:hh=0}=Oo,ih=K(Oo,["delay","times","type","repeat","repeatType","repeatDelay"]);let{ease:lt=e.ease||"easeOut",duration:X}=C;const Do=typeof mn=="function"?mn(j,N):mn,Ro=_.length,Lo=Oe(gn)?gn:s==null?void 0:s[gn||"keyframes"];if(Ro<=2&&Lo){let Nt=100;if(Ro===2&&_a(_)){const $t=_[1]-_[0];Nt=Math.abs($t)}const ae=g({},ih);X!==void 0&&(ae.duration=H(X));const le=Di(ae,Nt,Lo);lt=le.ease,X=le.duration}X!=null||(X=a);const Bo=f+Do;st.length===1&&st[0]===0&&(st[1]=1);const ko=st.length-_.length;if(ko>0&&Ci(st,ko),_.length===1&&_.unshift(null),Ut){Q(Ut<ka,"Repeat count too high, must be less than 20","repeat-count-high"),X=Va(X,Ut);const Nt=[..._],ae=[...st];lt=Array.isArray(lt)?[...lt]:[lt];const le=[...lt];for(let $t=0;$t<Ut;$t++){_.push(...Nt);for(let Kt=0;Kt<Nt.length;Kt++)st.push(ae[Kt]+($t+1)),lt.push(Kt===0?"linear":Vi(le,Kt-1))}Ra(st,Ut)}const Fo=Bo+X;Da(E,_,lt,st,Bo,Fo),w=Math.max(Do+X,w),p=Math.max(Fo,p)};if(k(b)){const P=Ri(b,c);T(A,S,Li("default",P))}else{const P=Ai(b,A,i,u),C=P.length;for(let E=0;E<C;E++){A=A,S=S;const j=P[E],N=Ri(j,c);for(const _ in A)T(A[_],Ia(S,_),Li(_,N),E,C)}}d=f,f+=w}return c.forEach((m,v)=>{for(const b in m){const A=m[b];A.sort(La);const S=[],w=[],T=[];for(let C=0;C<A.length;C++){const{at:E,value:j,easing:N}=A[C];S.push(j),w.push(Tt(0,p,E)),T.push(N||"easeOut")}w[0]!==0&&(w.unshift(0),S.unshift(S[0]),T.unshift(Ba)),w[w.length-1]!==1&&(w.push(1),S.push(null)),l.has(v)||l.set(v,{keyframes:{},transition:{}});const P=l.get(v);P.keyframes[b]=S,P.transition[b]=g(V(g({},e),{duration:p,ease:T,times:w}),n)}}),l}function Ri(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Li(t,e){return e[t]||(e[t]=[]),e[t]}function Oa(t){return Array.isArray(t)?t:[t]}function Ia(t,e){return t&&t[e]?g(g({},t),t[e]):g({},t)}const ja=t=>typeof t=="number",_a=t=>t.every(ja),Ua=t=>Array.isArray(t);function Na(t,e,n){const i=t.getProps();return Xn(i,e,i.custom,t)}function $a(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vt(n))}function Ka(t){return Ua(t)?t[t.length-1]||0:t}function Wa(t,e){let o=Na(t,e)||{},{transitionEnd:i={},transition:s={}}=o,r=K(o,["transitionEnd","transition"]);r=g(g({},r),i);for(const a in r){const l=Ka(r[a]);$a(t,a,l)}}function Ga(t){return!!(k(t)&&t.add)}function za(t,e){const n=t.getValue("willChange");if(Ga(n))return n.add(e);if(!n&&et.WillChange){const i=new et.WillChange("auto");t.addValue("willChange",i),i.add(e)}}const Ha="data-"+Le("framerAppearId");function Bi(t){return t.props[Ha]}const Ya=t=>t!==null;function Xa(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(Ya),r=e&&n!=="loop"&&e%2===1?0:s.length-1;return s[r]}const qa={type:"spring",stiffness:500,damping:25,restSpeed:10},Za=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ja={type:"keyframes",duration:.8},Qa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tl=(t,{keyframes:e})=>e.length>2?Ja:xt.has(t)?t.startsWith("scale")?Za(e[1]):qa:Qa;function el(h){var d=h,{when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c}=d,u=K(d,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(u).length}function Ie(t,e){var n,i;return(i=(n=t==null?void 0:t[e])!=null?n:t==null?void 0:t.default)!=null?i:t}function je(t){t.duration=0,t.type="keyframes"}function _e(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function nl({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let s=0,r=0,o=0;if(!e)s=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=_e(l,a,t+1/3),r=_e(l,a,t),o=_e(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}function Jt(t,e){return n=>n>0?e:t}const Ue=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},il=[pe,ut,mt],sl=t=>il.find(e=>e.test(t));function ki(t){const e=sl(t);if(Rt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===mt&&(n=nl(n)),n}const Fi=(t,e)=>{const n=ki(t),i=ki(e);if(!n||!i)return Jt(t,e);const s=g({},n);return r=>(s.red=Ue(n.red,i.red,r),s.green=Ue(n.green,i.green,r),s.blue=Ue(n.blue,i.blue,r),s.alpha=R(n.alpha,i.alpha,r),ut.transform(s))},Ne=new Set(["none","hidden"]);function ol(t,e){return Ne.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}const rl=(t,e)=>n=>e(t(n)),Lt=(...t)=>t.reduce(rl);function al(t,e){return n=>R(t,e,n)}function $e(t){return typeof t=="number"?al:typeof t=="string"?ge(t)?Jt:B.test(t)?Fi:cl:Array.isArray(t)?Oi:typeof t=="object"?B.test(t)?Fi:ll:Jt}function Oi(t,e){const n=[...t],i=n.length,s=t.map((r,o)=>$e(r)(r,e[o]));return r=>{for(let o=0;o<i;o++)n[o]=s[o](r);return n}}function ll(t,e){const n=g(g({},t),e),i={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(i[s]=$e(t[s])(t[s],e[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}}function ul(t,e){var s;const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=(s=t.values[a])!=null?s:0;n[r]=l,i[o]++}return n}const cl=(t,e)=>{const n=rt.createTransformer(e),i=Vt(t),s=Vt(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?Ne.has(t)&&!s.values.length||Ne.has(e)&&!i.values.length?ol(t,e):Lt(Oi(ul(i,s),s.values),n):(Rt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Jt(t,e))};function Ii(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?R(t,e,n):$e(t)(t,e)}const hl=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>M.update(e,n),stop:()=>nt(e),now:()=>I.isProcessing?I.timestamp:U.now()}},ji=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let r=0;r<s;r++)i+=Math.round(t(r/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},fl=5;function _i(t,e,n){const i=Math.max(e-fl,0);return zn(n-t(i),e-i)}const L={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ke=.001;function dl({duration:t=L.duration,bounce:e=L.bounce,velocity:n=L.velocity,mass:i=L.mass}){let s,r;Rt(t<=H(L.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=J(L.minDamping,L.maxDamping,o),t=J(L.minDuration,L.maxDuration,W(t)),o<1?(s=c=>{const u=c*o,h=u*t,d=u-n,f=We(c,o),p=Math.exp(-h);return Ke-d/f*p},r=c=>{const h=c*o*t,d=h*n+n,f=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),m=We(Math.pow(c,2),o);return(-s(c)+Ke>0?-1:1)*((d-f)*p)/m}):(s=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-Ke+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=ml(s,r,a);if(t=H(t),isNaN(l))return{stiffness:L.stiffness,damping:L.damping,duration:t};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}const pl=12;function ml(t,e,n){let i=n;for(let s=1;s<pl;s++)i=i-t(i)/e(i);return i}function We(t,e){return t*Math.sqrt(1-e*e)}const gl=["duration","bounce"],yl=["stiffness","damping","mass"];function Ui(t,e){return e.some(n=>t[n]!==void 0)}function vl(t){let e=g({velocity:L.velocity,stiffness:L.stiffness,damping:L.damping,mass:L.mass,isResolvedFromDuration:!1},t);if(!Ui(t,yl)&&Ui(t,gl))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,r=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(s);e=V(g({},e),{mass:L.mass,stiffness:s,damping:r})}else{const n=dl(t);e=V(g(g({},e),n),{mass:L.mass}),e.isResolvedFromDuration=!0}return e}function Bt(t=L.visualDuration,e=L.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:f}=vl(V(g({},n),{velocity:-W(n.velocity||0)})),p=d||0,m=c/(2*Math.sqrt(l*u)),v=o-r,b=W(Math.sqrt(l/u)),A=Math.abs(v)<5;i||(i=A?L.restSpeed.granular:L.restSpeed.default),s||(s=A?L.restDelta.granular:L.restDelta.default);let S;if(m<1){const T=We(b,m);S=P=>{const C=Math.exp(-m*b*P);return o-C*((p+m*b*v)/T*Math.sin(T*P)+v*Math.cos(T*P))}}else if(m===1)S=T=>o-Math.exp(-b*T)*(v+(p+b*v)*T);else{const T=b*Math.sqrt(m*m-1);S=P=>{const C=Math.exp(-m*b*P),E=Math.min(T*P,300);return o-C*((p+m*b*v)*Math.sinh(E)+T*v*Math.cosh(E))/T}}const w={calculatedDuration:f&&h||null,next:T=>{const P=S(T);if(f)a.done=T>=h;else{let C=T===0?p:0;m<1&&(C=T===0?H(p):_i(S,T,P));const E=Math.abs(C)<=i,j=Math.abs(o-P)<=s;a.done=E&&j}return a.value=a.done?o:P,a},toString:()=>{const T=Math.min(Fe(w),Zt),P=ji(C=>w.next(T*C).value,T,30);return T+"ms "+P},toTransition:()=>{}};return w}Bt.applyToOptions=t=>{const e=Di(t,100,Bt);return t.ease=e.ease,t.duration=H(e.duration),t.type="keyframes",t};function Ge({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},f=E=>a!==void 0&&E<a||l!==void 0&&E>l,p=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let m=n*e;const v=h+m,b=o===void 0?v:o(v);b!==v&&(m=b-h);const A=E=>-m*Math.exp(-E/i),S=E=>b+A(E),w=E=>{const j=A(E),N=S(E);d.done=Math.abs(j)<=c,d.value=d.done?b:N};let T,P;const C=E=>{f(d.value)&&(T=E,P=Bt({keyframes:[d.value,p(d.value)],velocity:_i(S,E,d.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:E=>{let j=!1;return!P&&T===void 0&&(j=!0,w(E),C(E)),T!==void 0&&E>=T?P.next(E-T):(!j&&w(E),d)}}}function bl(t,e,n){const i=[],s=n||et.mix||Ii,r=t.length-1;for(let o=0;o<r;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||$:e;a=Lt(l,a)}i.push(a)}return i}function xl(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(Q(r===e.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=bl(e,i,s),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const d=Tt(t[h],t[h+1],u);return a[h](d)};return n?u=>c(J(t[0],t[r-1],u)):c}function Tl(t,e){return t.map(n=>n*e)}const Ni=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Sl=1e-7,wl=12;function Al(t,e,n,i,s){let r,o,a=0;do o=e+(n-e)/2,r=Ni(o,i,s)-t,r>0?n=o:e=o;while(Math.abs(r)>Sl&&++a<wl);return o}function kt(t,e,n,i){if(t===e&&n===i)return $;const s=r=>Al(r,0,1,t,n);return r=>r===0||r===1?r:Ni(s(r),e,i)}const Pl=kt(.42,0,1,1),El=kt(0,0,.58,1),$i=kt(.42,0,.58,1),Ki=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Wi=t=>e=>1-t(1-e),Gi=kt(.33,1.53,.69,.99),ze=Wi(Gi),zi=Ki(ze),Hi=t=>(t*=2)<1?.5*ze(t):.5*(2-Math.pow(2,-10*(t-1))),He=t=>1-Math.sin(Math.acos(t)),Yi=Wi(He),Xi=Ki(He),qi=t=>Array.isArray(t)&&typeof t[0]=="number",Zi={linear:$,easeIn:Pl,easeInOut:$i,easeOut:El,circIn:He,circInOut:Xi,circOut:Yi,backIn:ze,backInOut:zi,backOut:Gi,anticipate:Hi},Vl=t=>typeof t=="string",Ji=t=>{if(qi(t)){Q(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return kt(e,n,i,s)}else if(Vl(t))return Q(Zi[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Zi[t];return t};function Cl(t,e){return t.map(()=>e||$i).splice(0,t.length-1)}function St({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Ei(i)?i.map(Ji):Ji(i),r={done:!1,value:e[0]},o=Tl(n&&n.length===e.length?n:Mi(e),t),a=xl(o,e,{ease:Array.isArray(s)?s:Cl(e,s)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Ml=t=>t!==null;function Ye(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(Ml),a=s<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||i===void 0?r[a]:i}const Dl={decay:Ge,inertia:Ge,tween:St,keyframes:St,spring:Bt};function Qi(t){typeof t.type=="string"&&(t.type=Dl[t.type])}class Xe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Rl=t=>t/100;class qe extends Xe{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:s}=this.options;s&&s.updatedAt!==U.now()&&this.tick(U.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Qi(e);const{type:n=St,repeat:i=0,repeatDelay:s=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||St;process.env.NODE_ENV!=="production"&&l!==St&&Q(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==St&&typeof a[0]!="number"&&(this.mixKeyframes=Lt(Rl,Ii(a[0],a[1])),a=[0,100]);const c=l(V(g({},e),{keyframes:a}));r==="mirror"&&(this.mirroredGenerator=l(V(g({},e),{keyframes:[...a].reverse(),velocity:-o}))),c.calculatedDuration===null&&(c.calculatedDuration=Fe(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let S=this.currentTime,w=i;if(h){const E=Math.min(this.currentTime,s)/a;let j=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&j--,j=Math.min(j,h+1),!!(j%2)&&(d==="reverse"?(N=1-N,f&&(N-=f/a)):d==="mirror"&&(w=o)),S=J(0,1,N)*a}const T=A?{done:!1,value:u[0]}:w.next(S);r&&(T.value=r(T.value));let{done:P}=T;!A&&l!==null&&(P=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return C&&p!==Ge&&(T.value=Ye(u,this.options,v,this.speed)),m&&m(T.value),C&&this.finish(),T}then(e,n){return this.finished.then(e,n)}get duration(){return W(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(this.currentTime)}set time(e){var n;e=H(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(U.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=W(this.currentTime))}play(){var e,n;if(this.isStopped)return;const{driver:i=hl,startTime:s}=this.options;this.driver||(this.driver=i(o=>this.tick(o))),(n=(e=this.options).onPlay)==null||n.call(e);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s!=null?s:r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(U.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}const Ll=t=>t.startsWith("--");function Bl(t,e,n){Ll(e)?t.style.setProperty(e,n):t.style[e]=n}function Ze(t){let e;return()=>(e===void 0&&(e=t()),e)}const kl=Ze(()=>window.ScrollTimeline!==void 0),Fl={};function Ol(t,e){const n=Ze(t);return()=>{var i;return(i=Fl[e])!=null?i:n()}}const ts=Ol(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Ft=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,es={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ft([0,.65,.55,1]),circOut:Ft([.55,0,1,.45]),backIn:Ft([.31,.01,.66,-.59]),backOut:Ft([.33,1.53,.69,.99])};function ns(t,e){if(t)return typeof t=="function"?ts()?ji(t,e):"ease-out":qi(t)?Ft(t):Array.isArray(t)?t.map(n=>ns(n,e)||es.easeOut):es[t]}function Il(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=ns(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function jl(n){var i=n,{type:t}=i,e=K(i,["type"]);var s,r;return Oe(t)&&ts()?t.applyToOptions(e):((s=e.duration)!=null||(e.duration=300),(r=e.ease)!=null||(e.ease="easeOut"),e)}class _l extends Xe{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Q(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=jl(e);this.animation=Il(n,i,s,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=Ye(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Bl(n,i,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var e,n;const i=((n=(e=this.animation.effect)==null?void 0:e.getComputedTiming)==null?void 0:n.call(e).duration)||0;return W(Number(i))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=H(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){var e;return(e=this.manualStartTime)!=null?e:Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&kl()?(this.animation.timeline=e,$):n(this)}}const is={anticipate:Hi,backInOut:zi,circInOut:Xi};function Ul(t){return t in is}function Nl(t){typeof t.ease=="string"&&Ul(t.ease)&&(t.ease=is[t.ease])}const Je=10;class $l extends _l{constructor(e){Nl(e),Qi(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const u=this.options,{motionValue:n,onUpdate:i,onComplete:s,element:r}=u,o=K(u,["motionValue","onUpdate","onComplete","element"]);if(!n)return;if(e!==void 0){n.set(e);return}const a=new qe(V(g({},o),{autoplay:!1})),l=Math.max(Je,U.now()-this.startTime),c=J(0,Je,l-Je);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const ss=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(rt.test(t)||t==="0")&&!t.startsWith("url("));function Kl(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Wl(t,e,n,i){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=ss(s,e),a=ss(r,e);return Rt(o===a,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Kl(t)||(n==="spring"||Oe(n))&&i}const Gl=new Set(["opacity","clipPath","filter","transform"]),zl=Ze(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Hl(t){var e;const{motionValue:n,name:i,repeatDelay:s,repeatType:r,damping:o,type:a}=t;if(!(((e=n==null?void 0:n.owner)==null?void 0:e.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return zl()&&i&&Gl.has(i)&&(i!=="transform"||!u)&&!c&&!s&&r!=="mirror"&&o!==0&&a!=="inertia"}const Yl=40;class Xl extends Xe{constructor(d){var f=d,{autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u}=f,h=K(f,["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"]);var p;super(),this.stop=()=>{var b,A;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(A=this.keyframeResolver)==null||A.cancel()},this.createdAt=U.now();const m=g({autoplay:e,delay:n,type:i,repeat:s,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u},h),v=(u==null?void 0:u.KeyframeResolver)||Me;this.keyframeResolver=new v(a,(b,A,S)=>this.onKeyframesResolved(b,A,m,!S),l,c,u),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=U.now(),Wl(e,r,o,a)||((et.instantAnimations||!l)&&(u==null||u(Ye(e,i,n))),e[0]=e[e.length-1],je(i),i.repeat=0);const h=s?this.resolvedAt?this.resolvedAt-this.createdAt>Yl?this.resolvedAt:this.createdAt:this.createdAt:void 0,d=V(g({startTime:h,finalKeyframe:n},i),{keyframes:e}),f=!c&&Hl(d)?new $l(V(g({},d),{element:d.motionValue.owner.current})):new qe(d);f.finished.then(()=>this.notifyFinished()).catch($),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Zr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const Qe=(t,e,n,i={},s,r)=>o=>{const a=Ie(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-H(l);const u=V(g({keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity()},a),{delay:-c,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s});el(a)||Object.assign(u,tl(t,u)),u.duration&&(u.duration=H(u.duration)),u.repeatDelay&&(u.repeatDelay=H(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(je(u),u.delay===0&&(h=!0)),(et.instantAnimations||et.skipAnimations)&&(h=!0,je(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const d=Xa(u.keyframes,a);if(d!==void 0){M.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new qe(u):new Xl(u)};function ql({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function Zl(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var h;let u=e,{transition:r=t.getDefaultTransition(),transitionEnd:o}=u,a=K(u,["transition","transitionEnd"]);i&&(r=i);const l=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const d in a){const f=t.getValue(d,(h=t.latestValues[d])!=null?h:null),p=a[d];if(p===void 0||c&&ql(c,d))continue;const m=g({delay:n},Ie(r||{},d)),v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(p)&&p===v&&!m.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const S=Bi(t);if(S){const w=window.MotionHandoffAnimation(S,d,M);w!==null&&(m.startTime=w,b=!0)}}za(t,d),f.start(Qe(d,f,p,t.shouldReduceMotion&&di.has(d)?{type:!1}:m,t,b));const A=f.animation;A&&l.push(A)}return o&&Promise.all(l).then(()=>{M.update(()=>{o&&Wa(t,o)})}),l}function Jl(t,e){return t in e}class Ql extends fi{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(Jl(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return O()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function os(t){return typeof t=="object"&&t!==null}function tn(t){return os(t)&&"ownerSVGElement"in t}function rs(t){return tn(t)&&t.tagName==="svg"}function tu(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=tn(t)&&!rs(t)?new wi(e):new Ti(e);n.mount(t),ct.set(t,n)}function eu(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Ql(e);n.mount(t),ct.set(t,n)}function as(t,e,n){const i=k(t)?t:vt(t);return i.start(Qe("",i,e,n)),i.animation}function nu(t,e){return k(t)||typeof t=="number"||typeof t=="string"&&!Be(e)}function ls(t,e,n,i){const s=[];if(nu(t,e))s.push(as(t,Be(e)&&e.default||e,n&&(n.default||n)));else{const r=Ai(t,e,i),o=r.length;Q(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){const l=r[a];Q(l!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const c=l instanceof Element?tu:eu;ct.has(l)||c(l);const u=ct.get(l),h=g({},n);"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...Zl(u,V(g({},e),{transition:h}),{}))}}return s}function iu(t,e,n){const i=[];return Fa(t,e,n,{spring:Bt}).forEach(({keyframes:r,transition:o},a)=>{i.push(...ls(a,r,o))}),i}class su{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=n}attachTimeline(e){const n=this.animations.map(i=>i.attachTimeline(e));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return us(this.animations,"duration")}get iterationDuration(){return us(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function us(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];s!==null&&s>n&&(n=s)}return n}class ou extends su{then(e,n){return this.finished.finally(e).then(()=>{})}}function ru(t){return Array.isArray(t)&&t.some(Array.isArray)}function au(t){function e(n,i,s){let r=[],o;if(ru(n))r=iu(n,i,t);else{const l=s||{},{onComplete:c}=l,u=K(l,["onComplete"]);typeof c=="function"&&(o=c),r=ls(n,i,u,t)}const a=new ou(r);return o&&a.finished.then(o),a}return e}const lu=au(),uu=["initial","animate","whileInView","whileHover","whilePress","whileDrag","whileFocus","exit"];class cu extends it{constructor(e){var n,i;super(e),this.animateUpdates=({controlActiveState:s,directAnimate:r,directTransition:o,controlDelay:a=0,isExit:l}={})=>{const{reducedMotion:c}=this.state.options.motionConfig;this.state.visualElement.shouldReduceMotion=c==="always"||c==="user"&&!!Xt.current;const u=this.state.target;this.state.target=g({},this.state.baseTarget);let h={};h=this.resolveStateAnimation({controlActiveState:s,directAnimate:r,directTransition:o}),this.state.finalTransition=h;const d=this.createAnimationFactories(u,h,a),{getChildAnimations:f}=this.setupChildAnimations(h,this.state.activeStates);return this.executeAnimations({factories:d,getChildAnimations:f,transition:h,controlActiveState:s,isExit:l})},this.state.visualElement=Pa(this.state.options.as,{presenceContext:null,parent:(n=this.state.parent)==null?void 0:n.visualElement,props:V(g({},this.state.options),{whileTap:this.state.options.whilePress}),visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:g({},this.state.baseTarget)},reducedMotionConfig:this.state.options.motionConfig.reducedMotion}),(i=this.state.visualElement.parent)==null||i.addChild(this.state.visualElement),this.state.animateUpdates=this.animateUpdates,this.state.isMounted()&&this.state.startAnimation()}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;Rn(e)&&(this.unmountControls=e.subscribe(this.state))}executeAnimations({factories:e,getChildAnimations:n,transition:i,controlActiveState:s,isExit:r=!1}){const o=()=>Promise.all(e.map(h=>h()).filter(Boolean)),a=g({},this.state.target),l=this.state.element,c=h=>{var d,f;r&&(this.state.isExiting=!0),l.dispatchEvent(Fn("motionstart",a)),(f=(d=this.state.options).onAnimationStart)==null||f.call(d,a),h.then(()=>{var p,m,v,b;if(r){this.state.isExiting=!1;const A=this.state.options.animatePresenceContext;if(A!=null&&A.onMotionExitComplete&&this.state.presenceContainer){const S=this.state,w=S.visualElement.projection;(p=S.options)!=null&&p.layoutId&&((m=w.currentAnimation)==null?void 0:m.state)==="running"&&!S.options.exit||A.onMotionExitComplete(S.presenceContainer,S)}}l.dispatchEvent(Fn("motioncomplete",a,r)),(b=(v=this.state.options).onAnimationComplete)==null||b.call(v,a)}).catch($)},u=()=>{const h=i!=null&&i.when?(i.when==="beforeChildren"?o():n()).then(()=>i.when==="beforeChildren"?n():o()):Promise.all([o(),n()]);return c(h),h};return s?u:u()}setupChildAnimations(e,n){var i;const s=this.state.visualElement;if(!((i=s.variantChildren)!=null&&i.size)||!n)return{getChildAnimations:()=>Promise.resolve()};const{staggerChildren:r=0,staggerDirection:o=1,delayChildren:a=0}=e||{},l=s.variantChildren.size,c=(l-1)*r,u=typeof a=="function",h=u?f=>a(f,l):o===1?(f=0)=>f*r:(f=0)=>c-f*r,d=Array.from(s.variantChildren).map((f,p)=>f.state.animateUpdates({controlActiveState:n,controlDelay:(u?0:a)+h(p)}));return{getChildAnimations:()=>Promise.all(d.map(f=>f()))}}createAnimationFactories(e,n,i){const s=[];return Object.keys(this.state.target).forEach(r=>{var l;var o;if(!ar(e[r],this.state.target[r]))return;(l=(o=this.state.baseTarget)[r])!=null||(o[r]=Pr.get(this.state.element,r));const a=this.state.target[r]==="none"&&Yt(jn[r])?jn[r]:this.state.target[r];s.push(()=>{var c;return lu(this.state.element,{[r]:a},V(g({},(n==null?void 0:n[r])||n),{delay:(((c=n==null?void 0:n[r])==null?void 0:c.delay)||(n==null?void 0:n.delay)||0)+i}))})}),s}resolveStateAnimation({controlActiveState:e,directAnimate:n,directTransition:i}){let s=this.state.options.transition,r={};const{variants:o,custom:a,transition:l,animatePresenceContext:c}=this.state.options,u=a!=null?a:c==null?void 0:c.custom;return this.state.activeStates=g(g({},this.state.activeStates),e),uu.forEach(h=>{if(!this.state.activeStates[h]||Rn(this.state.options[h]))return;const d=this.state.options[h];let f=Yt(d)?Dt(d,o,u):void 0;if(this.state.visualElement.isVariantNode){const p=Dt(this.state.context[h],o,u);f=Object.assign(p?p||{}:r,f)}f&&(h!=="initial"&&(s=f.transition||this.state.options.transition||{}),r=Object.assign(r,f))}),n&&(r=Dt(n,o,u),s=r.transition||i||l),Object.entries(r).forEach(([h,d])=>{h!=="transition"&&(this.state.target[h]=d)}),s}mount(){var e,n;const{element:i}=this.state;kn.set(i,this.state),ct.get(i)||(this.state.visualElement.mount(i),ct.set(i,this.state.visualElement)),this.state.visualElement.state=this.state,this.updateAnimationControlsSubscription();const s=this.state.visualElement,r=s.parent;if(s.enteringChildren=void 0,(e=this.state.parent)!=null&&e.isMounted()&&!s.isControllingVariants&&((n=r==null?void 0:r.enteringChildren)!=null&&n.has(s))){const{delayChildren:o}=this.state.parent.finalTransition||{};this.animateUpdates({controlActiveState:this.state.parent.activeStates,controlDelay:Ea(r.enteringChildren,s,o)})()}}update(){const{animate:e}=this.state.options,{animate:n}=this.state.visualElement.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;(e=this.unmountControls)==null||e.call(this)}}function hu(t){return os(t)&&"offsetHeight"in t}const fu={y:!1};function du(){return fu.y}const cs=(t,e)=>e?t===e?!0:cs(t,e.parentElement):!1,pu=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function hs(t,e){const n=ke(t),i=new AbortController,s=V(g({passive:!0},e),{signal:i.signal});return[n,s,()=>i.abort()]}const mu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function gu(t){return mu.has(t.tagName)||t.isContentEditable===!0}const Qt=new WeakSet;function fs(t){return e=>{e.key==="Enter"&&t(e)}}function en(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const yu=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=fs(()=>{if(Qt.has(n))return;en(n,"down");const s=fs(()=>{en(n,"up")}),r=()=>en(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function ds(t){return pu(t)&&!0}function vu(t,e,n={}){const[i,s,r]=hs(t,n),o=a=>{const l=a.currentTarget;if(!ds(a))return;Qt.add(l);const c=e(l,a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),Qt.has(l)&&Qt.delete(l),ds(f)&&typeof c=="function"&&c(f,{success:p})},h=f=>{u(f,l===window||l===document||n.useGlobalTarget||cs(l,f.target))},d=f=>{u(f,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",d,s)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),hu(a)&&(a.addEventListener("focus",c=>yu(c,s)),!gu(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function ps(t){return{point:{x:t.pageX,y:t.pageY}}}function ms(t,e,n){const i=t.options;i.whilePress&&t.setActive("whilePress",n==="Start");const s=`onPress${n==="End"?"":n}`,r=i[s];r&&M.postRender(()=>r(e,ps(e)))}class bu extends it{isActive(){const{whilePress:e,onPress:n,onPressCancel:i,onPressStart:s}=this.state.options;return!!(e||n||i||s)}constructor(e){super(e)}mount(){this.register()}update(){const{whilePress:e,onPress:n,onPressCancel:i,onPressStart:s}=this.state.options;e||n||i||s||this.register()}register(){const e=this.state.element;!e||!this.isActive()||(this.unmount(),this.unmount=vu(e,(n,i)=>(ms(this.state,i,"Start"),(s,{success:r})=>ms(this.state,s,r?"End":"Cancel")),{useGlobalTarget:this.state.options.globalPressTarget}))}}function gs(t){return!(t.pointerType==="touch"||du())}function xu(t,e,n={}){const[i,s,r]=hs(t,n),o=a=>{if(!gs(a))return;const{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;const u=h=>{gs(h)&&(c(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,s)};return i.forEach(a=>{a.addEventListener("pointerenter",o,s)}),r}function ys(t,e,n){const i=t.options;i.whileHover&&t.setActive("whileHover",n==="Start");const s=`onHover${n}`,r=i[s];r&&M.postRender(()=>r(e,ps(e)))}class Tu extends it{isActive(){const{whileHover:e,onHoverStart:n,onHoverEnd:i}=this.state.options;return!!(e||n||i)}constructor(e){super(e)}mount(){this.register()}update(){const{whileHover:e,onHoverStart:n,onHoverEnd:i}=this.state.visualElement.prevProps;e||n||i||this.register()}register(){const e=this.state.element;!e||!this.isActive()||(this.unmount(),this.unmount=xu(e,(n,i)=>(ys(this.state,i,"Start"),s=>{ys(this.state,s,"End")})))}}const Su={some:0,all:1};function wu(t,e,{root:n,margin:i,amount:s="some"}={}){const r=ke(t),o=new WeakMap,a=c=>{c.forEach(u=>{const h=o.get(u.target);if(u.isIntersecting!==!!h)if(u.isIntersecting){const d=e(u.target,u);typeof d=="function"?o.set(u.target,d):l.unobserve(u.target)}else typeof h=="function"&&(h(u),o.delete(u.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:i,threshold:typeof s=="number"?s:Su[s]});return r.forEach(c=>l.observe(c)),()=>l.disconnect()}function vs(t,e,n){const i=t.options;i.whileInView&&t.setActive("whileInView",n==="Enter");const s=`onViewport${n}`,r=i[s];r&&M.postRender(()=>r(e))}class Au extends it{isActive(){const{whileInView:e,onViewportEnter:n,onViewportLeave:i}=this.state.options;return!!(e||n||i)}constructor(e){super(e)}startObserver(){const e=this.state.element;if(!e||!this.isActive())return;this.unmount();const s=this.state.options.inViewOptions||{},{once:n}=s,i=K(s,["once"]);this.unmount=wu(e,(r,o)=>{if(vs(this.state,o,"Enter"),!n)return a=>{vs(this.state,o,"Leave")}},i)}mount(){this.startObserver()}update(){const{props:e,prevProps:n}=this.state.visualElement;["amount","margin","root"].some(Pu(e,n))&&this.startObserver()}}function Pu({inViewOptions:t={}},{inViewOptions:e={}}={}){return n=>t[n]!==e[n]}function te(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}class Eu extends it{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.state.element.matches(":focus-visible")}catch(n){e=!0}e&&(this.state.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&(this.state.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Lt(te(this.state.element,"focus",()=>this.onFocus()),te(this.state.element,"blur",()=>this.onBlur()))}}const Vu=(t,e)=>t.depth-e.depth;class Cu{constructor(){this.children=[],this.isDirty=!1}add(e){xe(this.children,e),this.isDirty=!0}remove(e){qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Vu),this.isDirty=!1,this.children.forEach(e)}}function nn(t){return k(t)?t.get():t}const bs=["TopLeft","TopRight","BottomLeft","BottomRight"],Mu=bs.length,xs=t=>typeof t=="string"?parseFloat(t):t,Ts=t=>typeof t=="number"||x.test(t);function Du(t,e,n,i,s,r){var o,a,l,c;s?(t.opacity=R(0,(o=n.opacity)!=null?o:1,Ru(i)),t.opacityExit=R((a=e.opacity)!=null?a:1,0,Lu(i))):r&&(t.opacity=R((l=e.opacity)!=null?l:1,(c=n.opacity)!=null?c:1,i));for(let u=0;u<Mu;u++){const h=`border${bs[u]}Radius`;let d=Ss(e,h),f=Ss(n,h);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||Ts(d)===Ts(f)?(t[h]=Math.max(R(xs(d),xs(f),i),0),(q.test(f)||q.test(d))&&(t[h]+="%")):t[h]=f}(e.rotate||n.rotate)&&(t.rotate=R(e.rotate||0,n.rotate||0,i))}function Ss(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ru=ws(0,.5,Yi),Lu=ws(.5,.95,$);function ws(t,e,n){return i=>i<t?0:i>e?1:n(Tt(t,e,i))}function As(t,e){t.min=e.min,t.max=e.max}function Y(t,e){As(t.x,e.x),As(t.y,e.y)}function Ps(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function sn(t){return t===void 0||t===1}function on({scale:t,scaleX:e,scaleY:n}){return!sn(t)||!sn(e)||!sn(n)}function dt(t){return on(t)||Es(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Es(t){return Vs(t.x)||Vs(t.y)}function Vs(t){return t&&t!=="0%"}function ee(t,e,n){const i=t-n,s=e*i;return n+s}function Cs(t,e,n,i,s){return s!==void 0&&(t=ee(t,s,i)),ee(t,n,i)+e}function rn(t,e=0,n=1,i,s){t.min=Cs(t.min,e,n,i,s),t.max=Cs(t.max,e,n,i,s)}function Ms(t,{x:e,y:n}){rn(t.x,e.translate,e.scale,e.originPoint),rn(t.y,n.translate,n.scale,n.originPoint)}const Ds=.999999999999,Rs=1.0000000000001;function Bu(t,e,n,i=!1){const s=n.length;if(!s)return;e.x=e.y=1;let r,o;for(let a=0;a<s;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&wt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ms(t,o)),i&&dt(r.latestValues)&&wt(t,r.latestValues))}e.x<Rs&&e.x>Ds&&(e.x=1),e.y<Rs&&e.y>Ds&&(e.y=1)}function ne(t,e){t.min=t.min+e,t.max=t.max+e}function Ls(t,e,n,i,s=.5){const r=R(t.min,t.max,s);rn(t,e,n,r,i)}function wt(t,e){Ls(t.x,e.x,e.scaleX,e.scale,e.originX),Ls(t.y,e.y,e.scaleY,e.scale,e.originY)}const Bs=1e-4,ku=1-Bs,Fu=1+Bs,ks=.01,Ou=0-ks,Iu=0+ks;function G(t){return t.max-t.min}function ju(t,e,n){return Math.abs(t-e)<=n}function Fs(t,e,n,i=.5){t.origin=i,t.originPoint=R(e.min,e.max,t.origin),t.scale=G(n)/G(e),t.translate=R(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ku&&t.scale<=Fu||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ou&&t.translate<=Iu||isNaN(t.translate))&&(t.translate=0)}function Ot(t,e,n,i){Fs(t.x,e.x,n.x,i?i.originX:void 0),Fs(t.y,e.y,n.y,i?i.originY:void 0)}function Os(t,e,n){t.min=n.min+e.min,t.max=t.min+G(e)}function _u(t,e,n){Os(t.x,e.x,n.x),Os(t.y,e.y,n.y)}function Is(t,e,n){t.min=e.min-n.min,t.max=t.min+G(e)}function ie(t,e,n){Is(t.x,e.x,n.x),Is(t.y,e.y,n.y)}function js(t,e,n,i,s){return t-=e,t=ee(t,1/n,i),s!==void 0&&(t=ee(t,1/s,i)),t}function Uu(t,e=0,n=1,i=.5,s,r=t,o=t){if(q.test(e)&&(e=parseFloat(e),e=R(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=R(r.min,r.max,i);t===r&&(a-=e),t.min=js(t.min,e,n,a,s),t.max=js(t.max,e,n,a,s)}function _s(t,e,[n,i,s],r,o){Uu(t,e[n],e[i],e[s],e.scale,r,o)}const Nu=["x","scaleX","originX"],$u=["y","scaleY","originY"];function Us(t,e,n,i){_s(t.x,e,Nu,n?n.x:void 0,i?i.x:void 0),_s(t.y,e,$u,n?n.y:void 0,i?i.y:void 0)}function Ns(t){return t.translate===0&&t.scale===1}function $s(t){return Ns(t.x)&&Ns(t.y)}function Ks(t,e){return t.min===e.min&&t.max===e.max}function Ku(t,e){return Ks(t.x,e.x)&&Ks(t.y,e.y)}function Ws(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Gs(t,e){return Ws(t.x,e.x)&&Ws(t.y,e.y)}function zs(t){return G(t.x)/G(t.y)}function Hs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Wu{constructor(){this.members=[]}add(e){xe(this.members,e),e.scheduleRender()}remove(e){if(qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Gu(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),d&&(i+=`rotateY(${d}deg) `),f&&(i+=`skewX(${f}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}function Ys(t){return[t("x"),t("y")]}const se={hasAnimatedSinceResize:!0,hasEverUpdated:!1},an=["","X","Y","Z"],zu=1e3;let Hu=0;function ln(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Xs(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Bi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",M,!(s||r))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Xs(i)}function qs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Hu++,this.animationId=0,this.animationCommitId=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.layoutVersion=0,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(qu),this.nodes.forEach(tc),this.nodes.forEach(ec),this.nodes.forEach(Zu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Te),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=tn(o)&&!rs(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const d=()=>this.root.updateBlockedByResize=!1;M.read(()=>{h=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,u&&u(),u=$o(d,250),se.hasAnimatedSinceResize&&(se.hasAnimatedSinceResize=!1,this.nodes.forEach(Qs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||rc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=c.getProps(),b=!this.targetLayout||!Gs(this.targetLayout,f),A=!h&&d;if(this.options.layoutRoot||this.resumeFrom||A||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S=V(g({},Ie(p,"layout")),{onPlay:m,onComplete:v});(c.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,A)}else h||Qs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),nt(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(nc),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Xs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Zs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Js);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qu),this.nodes.forEach(Yu),this.nodes.forEach(Xu)):this.nodes.forEach(Js),this.clearAllSnapshots();const a=U.now();I.delta=J(0,1e3/60,a-I.timestamp),I.timestamp=a,I.isProcessing=!0,ce.update.process(I),ce.preRender.process(I),ce.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ci.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ju),this.sharedNodes.forEach(ic)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!G(this.snapshot.measuredBox.x)&&!G(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=O(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!$s(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||dt(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),ac(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return O();const l=a.measureViewportBox();if(!(((o=this.scroll)==null?void 0:o.wasRoot)||this.path.some(lc))){const{scroll:u}=this.root;u&&(ne(l.x,u.offset.x),ne(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=O();if(Y(l,o),(a=this.scroll)!=null&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:d}=u;u!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&Y(l,o),ne(l.x,h.offset.x),ne(l.y,h.offset.y))}return l}applyTransform(o,a=!1){const l=O();Y(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&wt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),dt(u.latestValues)&&wt(l,u.latestValues)}return dt(this.latestValues)&&wt(l,this.latestValues),l}removeTransform(o){const a=O();Y(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!dt(c.latestValues))continue;on(c.latestValues)&&c.updateSnapshot();const u=O(),h=c.measurePageBox();Y(u,h),Us(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return dt(this.latestValues)&&Us(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options=V(g(g({},this.options),o),{crossfade:o.crossfade!==void 0?o.crossfade:!0})}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==I.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(a=this.parent)!=null&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!this.layout||!(h||d))return;this.resolvedRelativeTargetAt=I.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=O(),this.targetWithTransforms=O()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_u(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Y(this.target,this.layout.layoutBox),Ms(this.target,this.targetDelta)):Y(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||on(this.parent.latestValues)||Es(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=O(),this.relativeTargetOrigin=O(),ie(this.relativeTargetOrigin,a,l),Y(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(o=this.parent)!=null&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===I.timestamp&&(c=!1),c)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;Y(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Bu(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=O());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ps(this.prevProjectionDelta.x,this.projectionDelta.x),Ps(this.prevProjectionDelta.y,this.projectionDelta.y)),Ot(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Hs(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=yt(),this.projectionDelta=yt(),this.projectionDeltaWithTransform=yt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u=g({},this.latestValues),h=yt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=O(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,v=this.getStack(),b=!v||v.members.length<=1,A=!!(m&&!b&&this.options.crossfade===!0&&!this.path.some(oc));this.animationProgress=0;let S;this.mixTargetDelta=w=>{const T=w/1e3;to(h.x,o.x,T),to(h.y,o.y,T),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ie(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sc(this.relativeTarget,this.relativeTargetOrigin,d,T),S&&Ku(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=O()),Y(S,this.relativeTarget)),m&&(this.animationValues=u,Du(u,c,this.latestValues,T,A,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(nt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{se.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=vt(0)),this.currentAnimation=as(this.motionValue,[0,1e3],V(g({},o),{velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(zu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&oo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||O();const h=G(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=G(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}Y(a,l),wt(a,u),Ot(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Wu),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ln("z",o,c,this.animationValues);for(let u=0;u<an.length;u++)ln(`rotate${an[u]}`,o,c,this.animationValues),ln(`skew${an[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=nn(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=nn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!dt(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=Gu(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,c.animationValues?o.opacity=c===this?(m=(p=u.opacity)!=null?p:this.latestValues.opacity)!=null?m:1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const v in Ct){if(u[v]===void 0)continue;const{correct:b,applyTo:A,isCSSVariable:S}=Ct[v],w=h==="none"?u[v]:b(u[v],c);if(A){const T=A.length;for(let P=0;P<T;P++)o[A[P]]=w}else S?this.options.visualElement.renderState.vars[v]=w:o[v]=w}this.options.layoutId&&(o.pointerEvents=c===this?nn(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Zs),this.root.sharedNodes.clear()}}}function Yu(t){t.updateLayout()}function Xu(t){var e;const n=((e=t.resumeFrom)==null?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;r==="size"?Ys(h=>{const d=o?n.measuredBox[h]:n.layoutBox[h],f=G(d);d.min=i[h].min,d.max=d.min+f}):oo(r,n.layoutBox,i)&&Ys(h=>{const d=o?n.measuredBox[h]:n.layoutBox[h],f=G(i[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const a=yt();Ot(a,i,n.layoutBox);const l=yt();o?Ot(l,t.applyTransform(s,!0),n.measuredBox):Ot(l,i,n.layoutBox);const c=!$s(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const p=O();ie(p,n.layoutBox,d.layoutBox);const m=O();ie(m,i,f.layoutBox),Gs(p,m)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:i}=t.options;i&&i()}t.options.transition=void 0}function qu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Zu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ju(t){t.clearSnapshot()}function Zs(t){t.clearMeasurements()}function Js(t){t.isLayoutDirty=!1}function Qu(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Qs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function tc(t){t.resolveTargetDelta()}function ec(t){t.calcProjection()}function nc(t){t.resetSkewAndRotation()}function ic(t){t.removeLeadSnapshot()}function to(t,e,n){t.translate=R(e.translate,0,n),t.scale=R(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function eo(t,e,n,i){t.min=R(e.min,n.min,i),t.max=R(e.max,n.max,i)}function sc(t,e,n,i){eo(t.x,e.x,n.x,i),eo(t.y,e.y,n.y,i)}function oc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rc={duration:.45,ease:[.4,0,.1,1]},no=t=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),io=no("applewebkit/")&&!no("chrome/")?Math.round:$;function so(t){t.min=io(t.min),t.max=io(t.max)}function ac(t){so(t.x),so(t.y)}function oo(t,e,n){return t==="position"||t==="preserve-aspect"&&!ju(zs(e),zs(n),.2)}function lc(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}function uc(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const cc=qs({attachResizeListener:(t,e)=>uc(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),un={current:void 0},hc=qs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!un.current){const t=new cc({});t.mount(window),t.setOptions({layoutScroll:!0}),un.current=t}return un.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function ro(t){if(t)return t.options.allowProjection!==!1?t.projection:ro(t.parent)}const ao={borderRadius:V(g({},Z),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Z,borderTopRightRadius:Z,borderBottomLeftRadius:Z,borderBottomRightRadius:Z,boxShadow:Vn};function It(t){return typeof t=="object"&&t!==null&&"nodeType"in t}class fc extends it{constructor(e){super(e),Dn(ao)}initProjection(){const e=this.state.options;this.state.visualElement.projection=new hc(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:ro(this.state.visualElement.parent)),this.state.visualElement.projection.isPresent=!0,this.setOptions()}beforeMount(){this.initProjection()}setOptions(){const e=this.state.options,{layoutId:n,layout:i,drag:s=!1,dragConstraints:r=!1}=e;this.state.visualElement.projection.setOptions({layout:i,layoutId:n,alwaysMeasureLayout:!!n||!!s||r&&It(r),visualElement:this.state.visualElement,animationType:typeof e.layout=="string"?e.layout:"both",layoutRoot:e.layoutRoot,layoutScroll:e.layoutScroll,crossfade:e.crossfade,onExitComplete:()=>{var o,a;!((o=this.state.visualElement.projection)!=null&&o.isPresent)&&this.state.options.layoutId&&!this.state.isExiting&&((a=this.state.options.animatePresenceContext)==null||a.onMotionExitComplete(this.state.presenceContainer,this.state))}})}update(){this.setOptions()}mount(){var e;(e=this.state.visualElement.projection)==null||e.mount(this.state.element)}}function lo(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function cn(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function dc(t){return e=>lo(e)&&t(e,cn(e))}function jt(t,e,n,i){return te(t,e,dc(n),i)}function uo(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const co=uo("dragHorizontal"),ho=uo("dragVertical");function pc(t){let e=!1;if(t==="y")e=ho();else if(t==="x")e=co();else{const n=co(),i=ho();n&&i?e=()=>{n(),i()}:(n&&n(),i&&i())}return e}function hn(t){return t.max-t.min}function mc(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?R(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?R(n,t,i.max):Math.min(t,n)),t}const fn=.35;function gc(t,{top:e,left:n,bottom:i,right:s}){return{x:fo(t.x,n,s),y:fo(t.y,e,i)}}function fo(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yc(t=fn){return t===!1?t=0:t===!0&&(t=fn),{x:po(t,"left","right"),y:po(t,"top","bottom")}}function po(t,e,n){return{min:mo(t,e),max:mo(t,n)}}function mo(t,e){return typeof t=="number"?t:t[e]||0}function vc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}function bc(t,e){return{x:go(t.x,e.x),y:go(t.y,e.y)}}function go(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}}function xc(t,e){let n=.5;const i=hn(t),s=hn(e);return s>i?n=Tt(e.min,e.max-i,t.min):i>s&&(n=Tt(t.min,t.max-s,e.min)),J(0,1,n)}const yo=(t,e)=>Math.abs(t-e);function Tc(t,e){const n=yo(t.x,e.x),i=yo(t.y,e.y);return Math.sqrt(yn(n,2)+yn(i,2))}const vo=new Set(["auto","scroll"]);class bo{constructor(e,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=pn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=Tc(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:v}=I;this.history.push(V(g({},m),{timestamp:v}));const{onStart:b,onMove:A}=this.handlers;f||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=dn(f,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=pn(d.type==="pointercancel"?this.lastMoveEventInfo:dn(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,b),m&&m(d,b)},!lo(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const a=cn(e),l=dn(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=I;this.history=[V(g({},c),{timestamp:u})];const{onSessionStart:h}=n;h&&h(e,pn(l,this.history)),this.removeListeners=Lt(jt(this.contextWindow,"pointermove",this.handlePointerMove),jt(this.contextWindow,"pointerup",this.handlePointerUp),jt(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}isScrollable(e){const n=window.getComputedStyle(e);return n.overflow==="auto"||n.overflow==="scroll"||n.overflowX==="auto"||n.overflowX==="scroll"||n.overflowY==="auto"||n.overflowY==="scroll"}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(vo.has(i.overflowX)||vo.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:s.x-n.x,y:s.y-n.y};r.x===0&&r.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,s),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){var e;this.removeListeners&&this.removeListeners(),(e=this.removeScrollListeners)==null||e.call(this),this.scrollPositions.clear(),nt(this.updatePoint)}}function dn(t,e){return e?{point:e(t.point)}:t}function xo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pn({point:t},e){return{point:t,delta:xo(t,To(e)),offset:xo(t,Sc(e)),velocity:wc(e,.1)}}function Sc(t){return t[0]}function To(t){return t[t.length-1]}function wc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=To(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>H(e)));)n--;if(!i)return{x:0,y:0};const r=W(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const So=()=>({min:0,max:0});function Ac(){return{x:So(),y:So()}}function tt(t){return[t("x"),t("y")]}function Pc(t){return!!(k(t)&&t.add)}function wo(t,e){const n=t.getValue("willChange");if(Pc(n))return n.add(e)}function Ao({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ec(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}}function Vc({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Po(t,e){t.min=t.min+e,t.max=t.max+e}function Cc(t,e){return Ao(Ec(t.getBoundingClientRect(),e))}function Mc(t,e,n){const i=Cc(t,n),{scroll:s}=e;return s&&(Po(i.x,s.offset.x),Po(i.y,s.offset.y)),i}function Dc(t){var e;return(e=t.projection)==null?void 0:e.isPresent}function Eo({current:t}){return t?t.ownerDocument.defaultView:null}const Rc=new WeakMap;class Lc{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ac(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const i=c=>{n?this.stopAnimation():this.pauseAnimation(),n&&this.snapToCursor(cn(c,"page").point)},s=(c,u)=>{this.stopAnimation();const{drag:h,dragPropagation:d,onDragStart:f}=this.getProps();if(h&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=pc(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tt(m=>{let v=this.getAxisMotionValue(m).get()||0;if(q.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const A=b.layout.layoutBox[m];A&&(v=hn(A)*(parseFloat(v)/100))}}this.originPoint[m]=v}),f&&M.postRender(()=>f(c,u)),wo(this.visualElement,"transform"),this.visualElement.state.setActive("whileDrag",!0)},r=(c,u)=>{const{dragPropagation:h,dragDirectionLock:d,onDirectionLock:f,onDrag:p}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:m}=u;if(d&&this.currentDirection===null){this.currentDirection=Bc(m),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,m),this.updateAxis("y",u.point,m),this.visualElement.render(),p&&p(c,u)},o=(c,u)=>this.stop(c,u),a=()=>tt(c=>{var u;return this.getAnimationState(c)==="paused"&&((u=this.getAxisMotionValue(c).animation)==null?void 0:u.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new bo(e,{onSessionStart:i,onStart:s,onMove:r,onSessionEnd:o,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:Eo(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&M.postRender(()=>r(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.visualElement.state.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:s}=this.getProps();if(!i||!oe(e,s,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=mc(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)==null?void 0:e.layout,r=this.constraints;n&&It(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=gc(s.layoutBox,n):this.constraints=!1,this.elastic=yc(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&tt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!It(e))return!1;const i=e;zt(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=Mc(i,s.root,this.visualElement.getTransformPagePoint());let o=bc(s.layout.layoutBox,r);if(n){const a=n(Vc(o));this.hasMutatedConstraints=!!a,a&&(o=Ao(a))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=tt(u=>{if(!oe(u,n,this.currentDirection))return;let h=l&&l[u]||{};o&&(h={min:0,max:0});const d=s?200:1e6,f=s?40:1e7,p=g(g({type:"inertia",velocity:i?e[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10},r),h);return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return wo(this.visualElement,e),i.start(Qe(e,i,0,n,this.visualElement,!1))}stopAnimation(){Dc(this.visualElement)&&tt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){tt(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps();return i[n]||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){tt(n=>{const{drag:i}=this.getProps();if(!oe(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(e[n]-R(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!It(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};tt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=xc({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),tt(o=>{if(!oe(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(R(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Rc.set(this.visualElement,this);const e=this.visualElement.current,n=jt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();It(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),M.read(i);const o=te(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(tt(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=fn,dragMomentum:a=!0}=e;return V(g({},e),{drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a})}}function oe(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Bc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class kc extends it{constructor(e){super(e),this.removeGroupControls=$,this.removeListeners=$,this.controls=new Lc(e.visualElement)}mount(){const{dragControls:e}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$}unmount(){this.removeGroupControls(),this.removeListeners()}}let _t=!1;class Fc extends it{constructor(e){super(e),Dn(ao),e.getSnapshot=this.getSnapshot.bind(this),e.didUpdate=this.didUpdate.bind(this)}beforeUpdate(e){this.getSnapshot(e,void 0)}update(){this.didUpdate()}didUpdate(){var e,n;_t&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(_t=!1,(n=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||n.didUpdate())}mount(){var e;const n=this.state.options,i=this.state.options.layoutGroup;if(n.layout||n.layoutId){const s=this.state.visualElement.projection;if(s){s.promote();const r=s.getStack();r!=null&&r.prevLead&&!r.prevLead.snapshot&&(r.prevLead.willUpdate(),_t=!0),(e=i==null?void 0:i.group)==null||e.add(s)}se.hasEverUpdated=!0}this.didUpdate()}beforeUnmount(){this.getSnapshot(this.state.options,!1)}unmount(){const e=this.state.options.layoutGroup,n=this.state.visualElement.projection;n&&(e!=null&&e.group&&(this.state.options.layout||this.state.options.layoutId)&&e.group.remove(n),this.state.options.layoutId&&(_t=!0),this.didUpdate())}getSnapshot(e,n){const i=this.state.visualElement.projection,{drag:s,layoutDependency:r,layout:o,layoutId:a}=e;if(!i||!o&&!a&&!s)return;_t=!0;const l=this.state.options;(s||l.layoutDependency!==r||r===void 0||Yt(n)&&i.isPresent!==n)&&i.willUpdate(),Yt(n)&&n!==i.isPresent&&(i.isPresent=n,n?i.promote():i.relegate())}}function Vo(t){return(e,n)=>{t&&M.postRender(()=>t(e,n))}}class Oc extends it{constructor(){super(...arguments),this.removePointerDownListener=$}onPointerDown(e){this.session=new bo(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:Eo(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Vo((e,n)=>{const{onPanSessionStart:i}=this.state.options;i&&i(e,n)}),onStart:Vo((e,n)=>{const{onPanStart:i}=this.state.options;i&&i(e,n)}),onMove:(e,n)=>{const{onPan:i}=this.state.options;i&&i(e,n)},onEnd:(e,n)=>{const{onPanEnd:i}=this.state.options;delete this.session,i&&M.postRender(()=>i(e,n))}}}mount(){this.removePointerDownListener=jt(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ic=[cu,bu,Tu,Au,Eu,fc,Oc,kc,Fc],jc={reducedMotion:"never",transition:void 0,nonce:void 0},[_c]=Mt("MotionConfig");function Uc(){return _c(y.computed(()=>jc))}const Nc="data-ap-child",[$c]=Mt("AnimatePresenceContext");function re(t){if(t)return t.nodeType===3||t.nodeType===8?re(t.nextSibling):t}const[Kc]=Mt("LazyMotionContext");function Wc(t){var e;const n=sr(null),i=rr({}),s=Uc(),r=$c({}),o=Kc({features:y.ref([]),strict:!1});if(process.env.NODE_ENV!=="production"&&((e=t.features)!=null&&e.length)&&o.strict){const p="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?gt(!1,p):zt(!1,p)}const a=y.useAttrs();function l(){return i.id&&t.layoutId?`${i.id}-${t.layoutId}`:t.layoutId||void 0}function c(){var p,m;return V(g({},t),{lazyMotionContext:o,layoutId:l(),transition:(p=t.transition)!=null?p:s.value.transition,layoutGroup:i,motionConfig:s.value,inViewOptions:(m=t.inViewOptions)!=null?m:s.value.inViewOptions,animatePresenceContext:r,initial:r.initial===!1?r.initial:t.initial===!0?void 0:t.initial})}function u(){return g(g({},a),c())}const h=new gr(u(),n);or(h);function d(){var S,w;var p;const m=h.type==="svg",v=g({},a);Object.keys(a).forEach(T=>{k(a[T])&&(v[T]=a[T].get())});let b=g(g({},t.style),m?{}:((p=h.visualElement)==null?void 0:p.latestValues)||h.baseTarget);if(m){const{attrs:T,style:P}=Dr(g(g({},h.isMounted()?h.target:h.baseTarget),b));(P.transform||T.transformOrigin)&&(P.transformOrigin=(S=T.transformOrigin)!=null?S:"50% 50%",delete T.transformOrigin),P.transform&&(P.transformBox=(w=P.transformBox)!=null?w:"fill-box",delete T.transformBox),Object.assign(v,T),b=P}t.drag&&t.dragListener!==!1&&Object.assign(b,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const A=Er(b);return A&&(v.style=A),v}const f=y.getCurrentInstance().proxy;return y.onBeforeMount(()=>{h.beforeMount()}),y.onMounted(()=>{if(h.mount(re(f.$el),u(),zc(f)),r.register&&h.element){const p=h.element.closest(`[${Nc}]`);p?(h.presenceContainer=p,r.register(p,h)):r.registerPending&&r.registerPending(h)}}),y.onBeforeUnmount(()=>h.beforeUnmount()),y.onUnmounted(()=>{r.unregisterPending&&r.unregisterPending(h);const p=re(f.$el);p!=null&&p.isConnected||h.unmount()}),y.onBeforeUpdate(()=>{h.beforeUpdate(u())}),y.onUpdated(()=>{h.update(u())}),{getProps:c,getAttrs:d,layoutGroup:i,state:h}}const Gc={ignoreStrict:{type:Boolean},forwardMotionProps:{type:Boolean,default:!1},asChild:{type:Boolean,default:!1},hover:{type:[String,Array,Object]},press:{type:[String,Array,Object]},inView:{type:[String,Array,Object]},focus:{type:[String,Array,Object]},whileDrag:{type:[String,Array,Object]},whileHover:{type:[String,Array,Object],default:({hover:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"hover is deprecated. Use whileHover instead."),t)},whilePress:{type:[String,Array,Object],default:({press:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"press is deprecated. Use whilePress instead."),t)},whileInView:{type:[String,Array,Object],default:({inView:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"inView is deprecated. Use whileInView instead."),t)},whileFocus:{type:[String,Array,Object],default:({focus:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"focus is deprecated. Use whileFocus instead."),t)},custom:{type:[String,Number,Object,Array]},initial:{type:[String,Array,Object,Boolean],default:void 0},animate:{type:[String,Array,Object],default:void 0},exit:{type:[String,Array,Object]},variants:{type:Object},inherit:{type:Boolean},style:{type:Object},transformTemplate:{type:Function},transition:{type:Object},layoutGroup:{type:Object},motionConfig:{type:Object},onAnimationComplete:{type:Function},onUpdate:{type:Function},layout:{type:[Boolean,String],default:!1},layoutId:{type:String,default:void 0},layoutScroll:{type:Boolean,default:!1},layoutRoot:{type:Boolean,default:!1},"data-framer-portal-id":{type:String},crossfade:{type:Boolean,default:!0},layoutDependency:{type:null,default:void 0},onBeforeLayoutMeasure:{type:Function},onLayoutMeasure:{type:Function},onLayoutAnimationStart:{type:Function},onLayoutAnimationComplete:{type:Function},globalPressTarget:{type:Boolean},onPressStart:{type:Function},onPress:{type:Function},onPressCancel:{type:Function},onHoverStart:{type:Function},onHoverEnd:{type:Function},inViewOptions:{type:Object},onViewportEnter:{type:Function},onViewportLeave:{type:Function},drag:{type:[Boolean,String]},dragSnapToOrigin:{type:Boolean},dragDirectionLock:{type:Boolean},dragPropagation:{type:Boolean},dragConstraints:{type:[Boolean,Object]},dragElastic:{type:[Boolean,Number,Object],default:.5},dragMomentum:{type:Boolean,default:!0},dragTransition:{type:Object},dragListener:{type:Boolean,default:!0},dragControls:{type:Object},onDragStart:{type:Function},onDragEnd:{type:Function},onDrag:{type:Function},onDirectionLock:{type:Function},onDragTransitionEnd:{type:Function},onMeasureDragConstraints:{type:Function},onPanSessionStart:{type:Function},onPanStart:{type:Function},onPan:{type:Function},onPanEnd:{type:Function}};function zc(t){var e;const n=((e=re(t.$el))==null?void 0:e.style.display)==="none";return t.$.vnode.transition&&n}const Hc=new Map,Yc=new Map;function Xc(t){if(!Array.isArray(t))return[t];const e=[];for(const n of t)Array.isArray(n)?e.push(...n):e.push(n);return e}const qc=["area","img","input"];function Zc(t,e,n){var i,s;if(typeof t=="string"&&qc.includes(t))return y.h(t,e);if(t==="template"){if(!n.default)return null;const r=Xc(n.default()),o=r.findIndex(u=>u.type!==y.Comment);if(o===-1)return r;const a=r[o];(i=a.props)==null||delete i.ref;const l=a.props?y.mergeProps(e,a.props):e;e.class&&((s=a.props)!=null&&s.class)&&delete a.props.class;const c=y.cloneVNode(a,l);for(const u in l)u.startsWith("on")&&(c.props||(c.props={}),c.props[u]=l[u]);return r.length===1?c:(r[o]=c,r)}return null}function Co(t,e={}){var n;const i=typeof t=="string",s=i?t:t.name||"",r=((n=e.features)==null?void 0:n.length)>0?Hc:Yc;if(i&&(r!=null&&r.has(t)))return r.get(t);const o=y.defineComponent({inheritAttrs:!1,props:V(g({},Gc),{features:{type:Object,default:()=>e.features||[]},as:{type:[String,Object],default:t||"div"}}),name:s?`motion.${s}`:"Motion",setup(a,{slots:l}){const{getProps:c,getAttrs:u,state:h}=Wc(a);function d(){const f=h.element;if((!(typeof a.as=="object")||a.asChild)&&f){const{style:m}=u();if(m)for(const[v,b]of Object.entries(m))f.style[v]=b}}return()=>{const f=c(),p=u(),m=a.asChild?"template":a.as,v=V(g(g({},e.forwardMotionProps||a.forwardMotionProps?f:{}),p),{onVnodeUpdated:d}),b=Zc(m,v,l);return b!==null?b:y.h(m,g({},v),l)}}});return i&&(r==null||r.set(t,o)),o}function Jc(t=[]){return new Proxy({},{get(e,n){return n==="create"?(i,s)=>Co(i,V(g({},s),{features:t})):Co(n,{features:t})}})}const Mo=Jc(Ic);Mo.create("div");function Qc(t){function e(l){return t.modelValue.value===l.value}function n(l){return t.disabled.value||!!l.disabled}function i(l){n(l)||e(l)||t.onSelect(l.value)}function s(){const l=t.items.value,c=l.findIndex(u=>u.value===t.modelValue.value);return c>=0&&!n(l[c])?c:l.findIndex(u=>!n(u))}function r(l){const c=s();return c<0?-1:l===c?0:-1}function o(l,c){const u=t.items.value;let h=l;for(let d=0;d<u.length;d++)if(h=(h+c+u.length)%u.length,!n(u[h]))return h;return l}function a(l,c){var p;const u=t.items.value,h=u[c];if(!h||n(h))return;let d=null;switch(l.key){case"ArrowRight":case"ArrowDown":d=o(c,1);break;case"ArrowLeft":case"ArrowUp":d=o(c,-1);break;case"Home":d=u.findIndex(m=>!n(m));break;case"End":d=[...u].reverse().findIndex(m=>!n(m)),d>=0&&(d=u.length-1-d);break;default:return}if(d===null||d<0||d===c)return;l.preventDefault();const f=u[d];f&&(i(f),(p=t.focusIndex)==null||p.call(t,d))}return{isSelected:e,isSegmentDisabled:n,select:i,getTabIndex:r,onKeydown:a}}const th=["aria-label","aria-disabled"],eh=["aria-checked","aria-label","tabindex","disabled","onClick","onKeydown"],nh=y.defineComponent({__name:"index",props:{items:{},modelValue:{},size:{default:"m"},fullWidth:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},ui:{default:()=>({})},ariaLabel:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=y.toRef(n,"items"),r=y.toRef(n,"modelValue"),o=y.toRef(n,"disabled"),a=y.ref([]);function l(w,T){a.value[T]=w}const{isSelected:c,isSegmentDisabled:u,select:h,getTabIndex:d,onKeydown:f}=Qc({items:s,modelValue:r,disabled:o,onSelect:w=>i("update:modelValue",w),focusIndex:w=>{var T;return(T=a.value[w])==null?void 0:T.focus()}}),p=y.computed(()=>{const w=n.items.findIndex(T=>T.value===n.modelValue);return w>=0?w:0}),m=y.computed(()=>{const w=n.items.length;if(w!==0)return n.fullWidth?`repeat(${w}, minmax(0, 1fr))`:`repeat(${w}, auto)`}),v=y.computed(()=>["segmented-control",n.size==="s"?"segmented-control--s":"segmented-control--m",n.fullWidth&&"segmented-control--full-width",n.ui.root]);function b(w){return["segmented-control__segment",c(w)&&"segmented-control__segment--selected",c(w)?n.ui.segmentSelected:n.ui.segment].filter(Boolean)}function A(w){return["segmented-control__label",c(w)&&"segmented-control__label--selected",c(w)?n.ui.labelSelected:n.ui.label].filter(Boolean)}const S={type:"spring",visualDuration:.2,bounce:.2};return(w,T)=>(y.openBlock(),y.createElementBlock("div",{role:"radiogroup",class:y.normalizeClass(v.value),style:y.normalizeStyle(m.value?{gridTemplateColumns:m.value}:void 0),"aria-label":t.ariaLabel,"aria-disabled":t.disabled||void 0},[t.items.length>0?(y.openBlock(),y.createBlock(y.unref(Mo).div,{key:0,layout:"","data-state":t.modelValue,class:y.normalizeClass(["segmented-control__indicator",t.ui.indicator]),style:y.normalizeStyle({gridColumn:p.value+1,gridRow:1}),transition:S,"aria-hidden":"true"},null,8,["data-state","class","style"])):y.createCommentVNode("",!0),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.items,(P,C)=>(y.openBlock(),y.createElementBlock("button",{key:P.value,ref_for:!0,ref:E=>l(E,C),type:"button",role:"radio",class:y.normalizeClass(b(P)),style:y.normalizeStyle({gridColumn:C+1,gridRow:1}),"aria-checked":y.unref(c)(P),"aria-label":P.label,tabindex:y.unref(d)(C),disabled:y.unref(u)(P),onClick:E=>y.unref(h)(P),onKeydown:E=>y.unref(f)(E,C)},[y.createElementVNode("span",{class:y.normalizeClass(A(P))},y.toDisplayString(P.label),3)],46,eh))),128))],14,th))}});D.AzSegmentedControl=nh,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
1
+ (function(D,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],y):(D=typeof globalThis!="undefined"?globalThis:D||self,y(D["segmented-control"]={},D.Vue))})(this,function(D,y){"use strict";var sh=Object.defineProperty,oh=Object.defineProperties;var rh=Object.getOwnPropertyDescriptors;var ue=Object.getOwnPropertySymbols;var jo=Object.prototype.hasOwnProperty,_o=Object.prototype.propertyIsEnumerable;var yn=Math.pow,Io=(D,y,F)=>y in D?sh(D,y,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[y]=F,g=(D,y)=>{for(var F in y||(y={}))jo.call(y,F)&&Io(D,F,y[F]);if(ue)for(var F of ue(y))_o.call(y,F)&&Io(D,F,y[F]);return D},V=(D,y)=>oh(D,rh(y));var K=(D,y)=>{var F={};for(var z in D)jo.call(D,z)&&y.indexOf(z)<0&&(F[z]=D[z]);if(D!=null&&ue)for(var z of ue(D))y.indexOf(z)<0&&_o.call(D,z)&&(F[z]=D[z]);return F};const F=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function z(t,e){let n=new Set,i=new Set,s=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),t()),u(a)}const c={schedule:(u,h=!1,d=!1)=>{const p=d&&s?n:i;return h&&o.add(u),p.has(u)||p.add(u),u},cancel:u=>{i.delete(u),o.delete(u)},process:u=>{if(a=u,s){r=!0;return}s=!0,[n,i]=[i,n],n.forEach(l),n.clear(),s=!1,r&&(r=!1,c.process(u))}};return c}const et={},Uo=40;function vn(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=F.reduce((S,w)=>(S[w]=z(r),S),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:f,postRender:p}=o,m=()=>{const S=et.useManualTiming?s.timestamp:performance.now();n=!1,et.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(S-s.timestamp,Uo),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),f.process(s),p.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(m))},v=()=>{n=!0,i=!0,s.isProcessing||t(m)};return{schedule:F.reduce((S,w)=>{const T=o[w];return S[w]=(P,C=!1,E=!1)=>(n||v(),T.schedule(P,C,E)),S},{}),cancel:S=>{for(let w=0;w<F.length;w++)o[F[w]].cancel(S)},state:s,steps:o}}const $=t=>t,{schedule:M,cancel:nt,state:I,steps:ce}=vn(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:$,!0);let Wt;function No(){Wt=void 0}const U={now:()=>(Wt===void 0&&U.set(I.isProcessing||et.useManualTiming?I.timestamp:performance.now()),Wt),set:t=>{Wt=t,queueMicrotask(No)}},H=t=>t*1e3,W=t=>t/1e3;function $o(t,e){const n=U.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(nt(i),t(r-e))};return M.setup(i,!0),()=>nt(i)}const At=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ot=At("deg"),q=At("%"),x=At("px"),Ko=At("vh"),Wo=At("vw"),bn=V(g({},q),{parse:t=>q.parse(t)/100,transform:t=>q.transform(t*100)});function xn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Z={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;const n=xn(t,e.target.x),i=xn(t,e.target.y);return`${n}% ${i}%`}},J=(t,e,n)=>n>e?e:n<t?t:n,pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Pt=V(g({},pt),{transform:t=>J(0,1,t)}),Gt=V(g({},pt),{default:1}),Et=t=>Math.round(t*1e5)/1e5,he=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Go(t){return t==null}const zo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fe=(t,e)=>n=>!!(typeof n=="string"&&zo.test(n)&&n.startsWith(t)||e&&!Go(n)&&Object.prototype.hasOwnProperty.call(n,e)),Tn=(t,e,n)=>i=>{if(typeof i!="string")return i;const[s,r,o,a]=i.match(he);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ho=t=>J(0,255,t),de=V(g({},pt),{transform:t=>Math.round(Ho(t))}),ut={test:fe("rgb","red"),parse:Tn("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+de.transform(t)+", "+de.transform(e)+", "+de.transform(n)+", "+Et(Pt.transform(i))+")"};function Yo(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}}const pe={test:fe("#"),parse:Yo,transform:ut.transform},mt={test:fe("hsl","hue"),parse:Tn("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+q.transform(Et(e))+", "+q.transform(Et(n))+", "+Et(Pt.transform(i))+")"},B={test:t=>ut.test(t)||pe.test(t)||mt.test(t),parse:t=>ut.test(t)?ut.parse(t):mt.test(t)?mt.parse(t):pe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ut.transform(t):mt.transform(t),getAnimatableNone:t=>{const e=B.parse(t);return e.alpha=0,B.transform(e)}},Xo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function qo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(he))==null?void 0:e.length)||0)+(((n=t.match(Xo))==null?void 0:n.length)||0)>0}const Sn="number",wn="color",Zo="var",Jo="var(",An="${}",Qo=/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 Vt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const a=e.replace(Qo,l=>(B.test(l)?(i.color.push(r),s.push(wn),n.push(B.parse(l))):l.startsWith(Jo)?(i.var.push(r),s.push(Zo),n.push(l)):(i.number.push(r),s.push(Sn),n.push(parseFloat(l))),++r,An)).split(An);return{values:n,split:a,indexes:i,types:s}}function Pn(t){return Vt(t).values}function En(t){const{split:e,types:n}=Vt(t),i=e.length;return s=>{let r="";for(let o=0;o<i;o++)if(r+=e[o],s[o]!==void 0){const a=n[o];a===Sn?r+=Et(s[o]):a===wn?r+=B.transform(s[o]):r+=s[o]}return r}}const tr=t=>typeof t=="number"?0:B.test(t)?B.getAnimatableNone(t):t;function er(t){const e=Pn(t);return En(t)(e.map(tr))}const rt={test:qo,parse:Pn,createTransformer:En,getAnimatableNone:er},R=(t,e,n)=>t+(e-t)*n,Vn={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=rt.parse(t);if(s.length>5)return i;const r=rt.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=R(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}},Cn=t=>e=>typeof e=="string"&&e.startsWith(t),me=Cn("--"),nr=Cn("var(--"),ge=t=>nr(t)?ir.test(t.split("/*")[0].trim()):!1,ir=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Ct={borderRadius:V(g({},Z),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Z,borderTopRightRadius:Z,borderBottomLeftRadius:Z,borderBottomRightRadius:Z,boxShadow:Vn};function Dn(t){for(const e in t)Ct[e]=t[e],me(e)&&(Ct[e].isCSSVariable=!0)}function Mt(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,i=Symbol(n);return[o=>{const a=y.inject(i,o);if(a===void 0)throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return a},o=>(y.provide(i,o),o)]}const[sr,or]=Mt("Motion"),[rr]=Mt("LayoutGroup");function Rn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}class it{constructor(e){this.state=e}beforeMount(){}mount(){}unmount(){}update(){}beforeUpdate(e){}beforeUnmount(){}}var gt=function(){},zt=function(){};process.env.NODE_ENV!=="production"&&(gt=function(t,e){!t&&typeof console!="undefined"&&console.warn(e)},zt=function(t,e){if(!t)throw new Error(e)});function Dt(t,e,n){if(Array.isArray(t))return t.reduce((i,s)=>{const r=Dt(s,e,n);return r?g(g({},i),r):i},{});if(typeof t=="object")return t;if(t&&e){const i=e[t];return typeof i=="function"?i(n):i}}function ar(t,e){return typeof t!=typeof e?!0:Array.isArray(t)&&Array.isArray(e)?!lr(t,e):t!==e}function lr(t,e){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 Ln(t){return t==null?void 0:t.startsWith("--")}const ur=t=>t;function cr(t){return typeof t=="number"}const hr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],fr=new Set(hr);function Bn(t){return fr.has(t)}class dr{constructor(e){this.features=[];const{features:n=[],lazyMotionContext:i}=e.options,s=n.concat(i.features.value);this.features=s.map(o=>new o(e));const r=this.features;y.watch(i.features,o=>{o.forEach(a=>{if(!s.includes(a)){s.push(a);const l=new a(e);r.push(l),e.isMounted()&&(l.beforeMount(),l.mount())}})},{flush:"pre"})}mount(){this.features.forEach(e=>e.mount())}beforeMount(){this.features.forEach(e=>{var n;return(n=e.beforeMount)==null?void 0:n.call(e)})}unmount(){this.features.forEach(e=>e.unmount())}update(){this.features.forEach(e=>{var n;return(n=e.update)==null?void 0:n.call(e)})}beforeUpdate(e){this.features.forEach(n=>{var i;return(i=n.beforeUpdate)==null?void 0:i.call(n,e)})}beforeUnmount(){this.features.forEach(e=>e.beforeUnmount())}}function pr(t){return typeof t=="string"||t===!1||Array.isArray(t)}const kn=new WeakMap;let mr=0;class gr{constructor(e,n){var i;this.element=null,this.isExiting=!1,this.presenceContainer=null,this.children=new Set,this.activeStates={initial:!0,animate:!0},this.currentProcess=null,this._context=null,this.animateUpdates=$,this.id=`motion-state-${mr++}`,this.options=e,this.parent=n,(i=n==null?void 0:n.children)==null||i.add(this);const r=(e.initial===void 0&&e.variants?this.context.initial:e.initial)===!1?["initial","animate"]:["initial"];this.initTarget(r),this.featureManager=new dr(this),this.type=Bn(this.options.as)?"svg":"html"}get context(){if(!this._context){const e={get:(n,i)=>{var s;return pr(this.options[i])?this.options[i]:(s=this.parent)==null?void 0:s.context[i]}};this._context=new Proxy({},e)}return this._context}initTarget(e){var s;var n;const i=(s=this.options.custom)!=null?s:(n=this.options.animatePresenceContext)==null?void 0:n.custom;this.baseTarget=e.reduce((r,o)=>g(g({},r),Dt(this.options[o]||this.context[o],this.options.variants,i)),{}),this.target={}}updateOptions(e){var n;this.options=e,(n=this.visualElement)==null||n.update(V(g({},this.options),{whileTap:this.options.whilePress}),null)}beforeMount(){this.featureManager.beforeMount()}mount(e,n,i=!1){var s;zt(!!e,"Animation state must be mounted with valid Element"),this.element=e,this.updateOptions(n),this.featureManager.mount(),!i&&this.options.animate&&((s=this.startAnimation)==null||s.call(this))}clearAnimation(){var e,n;this.currentProcess&&nt(this.currentProcess),this.currentProcess=null,(n=(e=this.visualElement)==null?void 0:e.variantChildren)==null||n.forEach(i=>{i.state.clearAnimation()})}startAnimation(){this.clearAnimation(),this.currentProcess=M.render(()=>{this.currentProcess=null,this.animateUpdates()})}beforeUnmount(){this.featureManager.beforeUnmount()}unmount(){var e,n,i;(n=(e=this.parent)==null?void 0:e.children)==null||n.delete(this),kn.delete(this.element),this.featureManager.unmount(),(i=this.visualElement)==null||i.unmount(),this.clearAnimation()}beforeUpdate(e){this.featureManager.beforeUpdate(e)}update(e){this.updateOptions(e),this.featureManager.update(),this.startAnimation()}setActive(e,n,i=!0){var s;!this.element||this.activeStates[e]===n||(this.activeStates[e]=n,(s=this.visualElement.variantChildren)==null||s.forEach(r=>{r.state.setActive(e,n,!1)}),i&&this.animateUpdates({isExit:e==="exit"&&this.activeStates.exit}))}isMounted(){return!!this.element}getSnapshot(e,n){}didUpdate(e){}}const ct=new WeakMap;function Fn(t,e,n){return new CustomEvent(t,{detail:{target:e,isExit:n}})}const On={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>`${t}deg`},yr={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>`${t}px`},rotate:On,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:ur},skew:On},vr=["translate","scale","rotate","skew"],br=["","X","Y","Z"],ye=new Map,Ht=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"];vr.forEach(t=>{br.forEach(e=>{Ht.push(t+e),ye.set(t+e,yr[t])})});const xr=new Set(Ht),Tr=t=>xr.has(t),In={x:"translateX",y:"translateY",z:"translateZ"};function Sr([t],[e]){return Ht.indexOf(t)-Ht.indexOf(e)}function wr(t,[e,n]){return`${t} ${e}(${n})`}function Ar(t){return t.sort(Sr).reduce(wr,"").trim()}const jn={translate:[0,0],rotate:0,scale:1,skew:0,x:0,y:0,z:0},k=t=>!!(t&&t.getVelocity),Pr={get:(t,e)=>{let n=Ln(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&n!=="0"){const i=ye.get(e);i&&(n=i.initialValue)}return n},set:(t,e,n)=>{Ln(e)?t.style.setProperty(e,n):t.style[e]=n}};function Er(t){var e;const n={},i=[];for(let s in t){let r=t[s];r=k(r)?r.get():r,Tr(s)&&s in In&&(s=In[s]);let o=Array.isArray(r)?r[0]:r;const a=ye.get(s);a?(o=cr(r)?(e=a.toDefaultUnit)==null?void 0:e.call(a,r):r,i.push([s,o])):n[s]=o}return i.length&&(n.transform=Ar(i)),Object.keys(n).length===0?null:n}const Vr={fill:!0,stroke:!0,opacity:!0,"stroke-width":!0,"fill-opacity":!0,"stroke-opacity":!0,"stroke-linecap":!0,"stroke-linejoin":!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,cx:!0,cy:!0,r:!0,d:!0,x1:!0,y1:!0,x2:!0,y2:!0,points:!0,"path-length":!0,viewBox:!0,width:!0,height:!0,"preserve-aspect-ratio":!0,"clip-path":!0,filter:!0,mask:!0,"stop-color":!0,"stop-opacity":!0,"gradient-transform":!0,"gradient-units":!0,"spread-method":!0,"marker-end":!0,"marker-mid":!0,"marker-start":!0,"text-anchor":!0,"dominant-baseline":!0,"font-family":!0,"font-size":!0,"font-weight":!0,"letter-spacing":!0,"vector-effect":!0};function Cr(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Mr(t,e,n=1,i=0){t.pathLength=1,delete t["path-length"],t["stroke-dashoffset"]=x.transform(-i);const s=x.transform(e),r=x.transform(n);t["stroke-dasharray"]=`${s} ${r}`}function Dr(t){const e={},n={};for(const i in t){const s=Cr(i);if(s in Vr){const r=t[i];e[s]=k(r)?r.get():r}else n[i]=t[i]}return e["path-length"]!==void 0&&Mr(e,e["path-length"],e["path-spacing"],e["path-offset"]),{attrs:e,style:n}}typeof WorkerGlobalScope!="undefined"&&globalThis instanceof WorkerGlobalScope;const Yt=t=>typeof t!="undefined";function Rr({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Lr(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}}function Br(t,e){return Rr(Lr(t.getBoundingClientRect(),e))}const _n={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"]},ve={};for(const t in _n)ve[t]={isEnabled:e=>_n[t].some(n=>!!e[n])};const Un=()=>({translate:0,scale:1,origin:0,originPoint:0}),yt=()=>({x:Un(),y:Un()}),Nn=()=>({min:0,max:0}),O=()=>({x:Nn(),y:Nn()}),kr=typeof window!="undefined",Xt={current:null},$n={current:!1};function Fr(){if($n.current=!0,!!kr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xt.current=t.matches;t.addEventListener("change",e),e()}else Xt.current=!1}function Or(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ir(t){return typeof t=="string"||Array.isArray(t)}const jr=["initial",...["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"]];function Kn(t){return Or(t.animate)||jr.some(e=>Ir(t[e]))}function _r(t){return!!(Kn(t)||t.variants)}function be(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}const Wn=new Set;function Gn(t,e,n){t||Wn.has(e)||(console.warn(be(e,n)),Wn.add(e))}function xe(t,e){t.indexOf(e)===-1&&t.push(e)}function qt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Te{constructor(){this.subscriptions=[]}add(e){return xe(this.subscriptions,e),()=>qt(this.subscriptions,e)}notify(e,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,i);else for(let r=0;r<s;r++){const o=this.subscriptions[r];o&&o(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function zn(t,e){return e?t*(1e3/e):0}const Hn=30,Ur=t=>!isNaN(parseFloat(t));class Nr{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{var s;const r=U.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=U.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ur(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Gn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Te);const i=this.events[e].add(n);return e==="change"?()=>{i(),M.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=U.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Hn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Hn);return zn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vt(t,e){return new Nr(t,e)}function $r(t,e,n){for(const i in e){const s=e[i],r=n[i];if(k(s))t.addValue(i,s);else if(k(r))t.addValue(i,vt(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const o=t.getValue(i);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(i);t.addValue(i,vt(o!==void 0?o:s,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}function Yn(t){const e=[{},{}];return t==null||t.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function Xn(t,e,n,i){if(typeof e=="function"){const[s,r]=Yn(i);e=e(n!==void 0?n:t.custom,s,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,r]=Yn(i);e=e(n!==void 0?n:t.custom,s,r)}return e}function Kr(t){var e;for(let n=1;n<t.length;n++)(e=t[n])!=null||(t[n]=t[n-1])}const ht=t=>t*180/Math.PI,Se=t=>{const e=ht(Math.atan2(t[1],t[0]));return we(e)},Wr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Se,rotateZ:Se,skewX:t=>ht(Math.atan(t[1])),skewY:t=>ht(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},we=t=>(t=t%360,t<0&&(t+=360),t),qn=Se,Zn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Jn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Gr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zn,scaleY:Jn,scale:t=>(Zn(t)+Jn(t))/2,rotateX:t=>we(ht(Math.atan2(t[6],t[5]))),rotateY:t=>we(ht(Math.atan2(-t[2],t[0]))),rotateZ:qn,rotate:qn,skewX:t=>ht(Math.atan(t[4])),skewY:t=>ht(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ae(t){return t.includes("scale")?1:0}function Pe(t,e){if(!t||t==="none")return Ae(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Gr,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Wr,s=a}if(!s)return Ae(e);const r=i[e],o=s[1].split(",").map(Hr);return typeof r=="function"?r(o):o[r]}const zr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Pe(n,e)};function Hr(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xt=new Set(bt),Qn=t=>t===pt||t===x,Yr=new Set(["x","y","z"]),Xr=bt.filter(t=>!Yr.has(t));function qr(t){const e=[];return Xr.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const at={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})=>Pe(e,"x"),y:(t,{transform:e})=>Pe(e,"y")};at.translateX=at.x,at.translateY=at.y;const ft=new Set;let Ee=!1,Ve=!1,Ce=!1;function ti(){if(Ve){const t=Array.from(ft).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const s=qr(i);s.length&&(n.set(i,s),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([r,o])=>{var a;(a=i.getValue(r))==null||a.set(o)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Ve=!1,Ee=!1,ft.forEach(t=>t.complete(Ce)),ft.clear()}function ei(){ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ve=!0)})}function Zr(){Ce=!0,ei(),ti(),Ce=!1}class Me{constructor(e,n,i,s,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=s,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ft.add(this),Ee||(Ee=!0,M.read(ei),M.resolveKeyframes(ti))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:s}=this;if(e[0]===null){const r=s==null?void 0:s.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(i&&n){const a=i.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&r===void 0&&s.set(e[0])}Kr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ft.delete(this)}cancel(){this.state==="scheduled"&&(ft.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ni=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ii=t=>/^0[^.\s]+$/u.test(t),Jr={test:t=>t==="auto",parse:t=>t},si=t=>e=>e.test(t),oi=[pt,x,q,ot,Wo,Ko,Jr],ri=t=>oi.find(si(t)),Qr=[...oi,B,rt],ta=t=>Qr.find(si(t)),ea=new Set(["brightness","contrast","saturate","opacity"]);function na(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(he)||[];if(!i)return t;const s=n.replace(i,"");let r=ea.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const ia=/\b([a-z-]*)\(.*?\)/gu,De=V(g({},rt),{getAnimatableNone:t=>{const e=t.match(ia);return e?e.map(na).join(" "):t}}),ai=V(g({},pt),{transform:Math.round}),Re=V(g({borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,inset:x,insetBlock:x,insetBlockStart:x,insetBlockEnd:x,insetInline:x,insetInlineStart:x,insetInlineEnd:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,paddingBlock:x,paddingBlockStart:x,paddingBlockEnd:x,paddingInline:x,paddingInlineStart:x,paddingInlineEnd:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,marginBlock:x,marginBlockStart:x,marginBlockEnd:x,marginInline:x,marginInlineStart:x,marginInlineEnd:x,backgroundPositionX:x,backgroundPositionY:x},{rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:Gt,scaleX:Gt,scaleY:Gt,scaleZ:Gt,skew:ot,skewX:ot,skewY:ot,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:Pt,originX:bn,originY:bn,originZ:x}),{zIndex:ai,fillOpacity:Pt,strokeOpacity:Pt,numOctaves:ai}),sa=V(g({},Re),{color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:De,WebkitFilter:De}),li=t=>sa[t];function ui(t,e){let n=li(t);return n!==De&&(n=rt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const{schedule:ci}=vn(queueMicrotask,!0),hi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class fi{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Me,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 f=U.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,M.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget=g({},l),this.initialValues=n.initial?g({},l):{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Kn(n),this.isVariantNode=_r(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const d=this.scrapeMotionValuesFromProps(n,{},this),{willChange:u}=d,h=K(d,["willChange"]);for(const f in h){const p=h[f];l[f]!==void 0&&k(p)&&p.set(l[f])}}mount(e){var n;this.current=e,ct.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:($n.current||Fr(),this.shouldReduceMotion=Xt.current),process.env.NODE_ENV!=="production"&&Gn(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),nt(this.notifyUpdate),nt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const i=this.features[n];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(e){var n;this.children.add(e),(n=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=xt.has(e);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&M.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ve){const n=ve[e];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):O()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<hi.length;i++){const s=hi[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const r="on"+s,o=e[r];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=$r(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=vt(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!=null?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(ni(i)||ii(i))?i=parseFloat(i):!ta(i)&&rt.test(n)&&(i=ui(e,n)),this.setBaseTarget(e,k(i)?i.get():i)),k(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const o=Xn(this.props,i,(n=this.presenceContext)==null?void 0:n.custom);o&&(s=o[e])}if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!k(r)?r:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Te),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ci.render(this.render)}}const di=new Set(["width","height","top","left","right","bottom",...bt]);var pi;let Rt=()=>{},Q=()=>{};typeof process!="undefined"&&((pi=process.env)==null?void 0:pi.NODE_ENV)!=="production"&&(Rt=(t,e,n)=>{!t&&typeof console!="undefined"&&console.warn(be(e,n))},Q=(t,e,n)=>{if(!t)throw new Error(be(e,n))});const oa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ra(t){const e=oa.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n!=null?n:i}`,s]}const aa=4;function mi(t,e,n=1){Q(n<=aa,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=ra(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const o=r.trim();return ni(o)?parseFloat(o):o}return ge(s)?mi(s,e,n+1):s}function la(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ii(t):!0}const ua=new Set(["auto","none","0"]);function ca(t,e,n){let i=0,s;for(;i<t.length&&!s;){const r=t[i];typeof r=="string"&&!ua.has(r)&&Vt(r).values.length&&(s=t[i]),i++}if(s&&n)for(const r of e)t[r]=ui(n,s)}class ha extends Me{constructor(e,n,i,s,r){super(e,n,i,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),ge(h))){const d=mi(h,n.current);d!==void 0&&(e[u]=d),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!di.has(i)||e.length!==2)return;const[s,r]=e,o=ri(s),a=ri(r),l=Mn(s),c=Mn(r);if(l!==c&&at[i]){this.needsMeasurement=!0;return}if(o!==a)if(Qn(o)&&Qn(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else at[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||la(e[s]))&&i.push(s);i.length&&ca(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=at[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(i,s).jump(s,!1)}measureEndState(){var e;const{element:n,name:i,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const r=n.getValue(i);r&&r.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=at[i](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(e=this.removedTransforms)!=null&&e.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}class gi extends fi{constructor(){super(...arguments),this.KeyframeResolver=ha}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;k(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}const yi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,fa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},da=bt.length;function pa(t,e,n){let i="",s=!0;for(let r=0;r<da;r++){const o=bt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=yi(a,Re[o]);if(!l){s=!1;const u=fa[o]||o;i+=`${u}(${c}) `}n&&(e[o]=c)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function vi(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(xt.has(l)){o=!0;continue}else if(me(l)){s[l]=c;continue}else{const u=yi(c,Re[l]);l.startsWith("origin")?(a=!0,r[l]=u):i[l]=u}}if(e.transform||(o||n?i.transform=pa(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;i.transformOrigin=`${l} ${c} ${u}`}}function bi(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];s==null||s.applyProjectionStyles(r,i);for(o in n)r.setProperty(o,n[o])}function ma(t,{layout:e,layoutId:n}){return xt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ct[t]||t==="opacity")}function xi(t,e,n){var i;const{style:s}=t,r={};for(const o in s)(k(s[o])||e.style&&k(e.style[o])||ma(o,t)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(r[o]=s[o]);return r}function ga(t){return window.getComputedStyle(t)}class Ti extends gi{constructor(){super(...arguments),this.type="html",this.renderInstance=bi}readValueFromInstance(e,n){var i;if(xt.has(n))return(i=this.projection)!=null&&i.isProjecting?Ae(n):zr(e,n);{const s=ga(e),r=(me(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Br(e,n)}build(e,n,i){vi(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return xi(e,n,i)}}const Le=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ya={offset:"stroke-dashoffset",array:"stroke-dasharray"},va={offset:"strokeDashoffset",array:"strokeDasharray"};function ba(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?ya:va;t[r.offset]=x.transform(-i);const o=x.transform(e),a=x.transform(n);t[r.array]=`${o} ${a}`}const xa=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ta(t,h,l,c,u){var d=h,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0}=d,a=K(d,["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"]);var m,v;if(vi(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:p}=t;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=(m=f.transformOrigin)!=null?m:"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=(v=u==null?void 0:u.transformBox)!=null?v:"fill-box",delete f.transformBox);for(const b of xa)f[b]!==void 0&&(p[b]=f[b],delete f[b]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),s!==void 0&&ba(f,s,r,o,!1)}const Si=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"]),Sa=t=>typeof t=="string"&&t.toLowerCase()==="svg";function wa(t,e,n,i){bi(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(Si.has(s)?s:Le(s),e.attrs[s])}function Aa(t,e,n){const i=xi(t,e,n);for(const s in t)if(k(t[s])||k(e[s])){const r=bt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[r]=t[s]}return i}class wi extends gi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=O}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(xt.has(n)){const i=li(n);return i&&i.default||0}return n=Si.has(n)?n:Le(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return Aa(e,n,i)}build(e,n,i){Ta(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,s){wa(e,n,i,s)}mount(e){this.isSVGTag=Sa(e.tagName),super.mount(e)}}function Pa(t,e){return Bn(t)?new wi(e):new Ti(e)}function Ea(t,e,n,i=0,s=1){const r=Array.from(t),o=r.indexOf(e),a=t.size,l=(a-1)*i,c=typeof n=="function";return o===r.length-1&&(e.parent.enteringChildren=void 0),c?n(o,a):s===1?o*i:l-o*i}function Be(t){return typeof t=="object"&&!Array.isArray(t)}function ke(t,e,n){var i;if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const r=(i=n==null?void 0:n[t])!=null?i:s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function Ai(t,e,n,i){return typeof t=="string"&&Be(e)?ke(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Va(t,e,n){return t*(e+1)}function Pi(t,e,n,i){var s;return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):(s=i.get(e))!=null?s:t}const Ca=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},Ei=t=>Array.isArray(t)&&typeof t[0]!="number";function Vi(t,e){return Ei(t)?t[Ca(0,t.length,e)]:t}function Ma(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(qt(t,s),i--)}}function Da(t,e,n,i,s,r){Ma(t,s,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:R(s,r,i[o]),easing:Vi(n,o)})}function Ra(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function La(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const Tt=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};function Ci(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=Tt(0,e,i);t.push(R(n,1,s))}}function Mi(t){const e=[0];return Ci(e,t.length-1),e}const Zt=2e4;function Fe(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<Zt;)e+=n,i=t.next(e);return e>=Zt?1/0:e}function Di(t,e=100,n){const i=n(V(g({},t),{keyframes:[0,e]})),s=Math.min(Fe(i),Zt);return{type:"keyframes",ease:r=>i.next(s*r).value/e,duration:W(s)}}function Oe(t){return typeof t=="function"&&"applyToOptions"in t}const Ba="easeInOut",ka=20;function Fa(t,r={},i,s){var o=r,{defaultTransition:e={}}=o,n=K(o,["defaultTransition"]);const a=e.duration||.3,l=new Map,c=new Map,u={},h=new Map;let d=0,f=0,p=0;for(let m=0;m<t.length;m++){const v=t[m];if(typeof v=="string"){h.set(v,f);continue}else if(!Array.isArray(v)){h.set(v.name,Pi(f,v.at,d,h));continue}let[b,A,S={}]=v;S.at!==void 0&&(f=Pi(f,S.at,d,h));let w=0;const T=(P,C,E,j=0,N=0)=>{const _=Oa(P),Oo=C,{delay:mn=0,times:st=Mi(_),type:gn="keyframes",repeat:Ut,repeatType:ch,repeatDelay:hh=0}=Oo,ih=K(Oo,["delay","times","type","repeat","repeatType","repeatDelay"]);let{ease:lt=e.ease||"easeOut",duration:X}=C;const Do=typeof mn=="function"?mn(j,N):mn,Ro=_.length,Lo=Oe(gn)?gn:s==null?void 0:s[gn||"keyframes"];if(Ro<=2&&Lo){let Nt=100;if(Ro===2&&_a(_)){const $t=_[1]-_[0];Nt=Math.abs($t)}const ae=g({},ih);X!==void 0&&(ae.duration=H(X));const le=Di(ae,Nt,Lo);lt=le.ease,X=le.duration}X!=null||(X=a);const Bo=f+Do;st.length===1&&st[0]===0&&(st[1]=1);const ko=st.length-_.length;if(ko>0&&Ci(st,ko),_.length===1&&_.unshift(null),Ut){Q(Ut<ka,"Repeat count too high, must be less than 20","repeat-count-high"),X=Va(X,Ut);const Nt=[..._],ae=[...st];lt=Array.isArray(lt)?[...lt]:[lt];const le=[...lt];for(let $t=0;$t<Ut;$t++){_.push(...Nt);for(let Kt=0;Kt<Nt.length;Kt++)st.push(ae[Kt]+($t+1)),lt.push(Kt===0?"linear":Vi(le,Kt-1))}Ra(st,Ut)}const Fo=Bo+X;Da(E,_,lt,st,Bo,Fo),w=Math.max(Do+X,w),p=Math.max(Fo,p)};if(k(b)){const P=Ri(b,c);T(A,S,Li("default",P))}else{const P=Ai(b,A,i,u),C=P.length;for(let E=0;E<C;E++){A=A,S=S;const j=P[E],N=Ri(j,c);for(const _ in A)T(A[_],Ia(S,_),Li(_,N),E,C)}}d=f,f+=w}return c.forEach((m,v)=>{for(const b in m){const A=m[b];A.sort(La);const S=[],w=[],T=[];for(let C=0;C<A.length;C++){const{at:E,value:j,easing:N}=A[C];S.push(j),w.push(Tt(0,p,E)),T.push(N||"easeOut")}w[0]!==0&&(w.unshift(0),S.unshift(S[0]),T.unshift(Ba)),w[w.length-1]!==1&&(w.push(1),S.push(null)),l.has(v)||l.set(v,{keyframes:{},transition:{}});const P=l.get(v);P.keyframes[b]=S,P.transition[b]=g(V(g({},e),{duration:p,ease:T,times:w}),n)}}),l}function Ri(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Li(t,e){return e[t]||(e[t]=[]),e[t]}function Oa(t){return Array.isArray(t)?t:[t]}function Ia(t,e){return t&&t[e]?g(g({},t),t[e]):g({},t)}const ja=t=>typeof t=="number",_a=t=>t.every(ja),Ua=t=>Array.isArray(t);function Na(t,e,n){const i=t.getProps();return Xn(i,e,i.custom,t)}function $a(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vt(n))}function Ka(t){return Ua(t)?t[t.length-1]||0:t}function Wa(t,e){let o=Na(t,e)||{},{transitionEnd:i={},transition:s={}}=o,r=K(o,["transitionEnd","transition"]);r=g(g({},r),i);for(const a in r){const l=Ka(r[a]);$a(t,a,l)}}function Ga(t){return!!(k(t)&&t.add)}function za(t,e){const n=t.getValue("willChange");if(Ga(n))return n.add(e);if(!n&&et.WillChange){const i=new et.WillChange("auto");t.addValue("willChange",i),i.add(e)}}const Ha="data-"+Le("framerAppearId");function Bi(t){return t.props[Ha]}const Ya=t=>t!==null;function Xa(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(Ya),r=e&&n!=="loop"&&e%2===1?0:s.length-1;return s[r]}const qa={type:"spring",stiffness:500,damping:25,restSpeed:10},Za=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ja={type:"keyframes",duration:.8},Qa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tl=(t,{keyframes:e})=>e.length>2?Ja:xt.has(t)?t.startsWith("scale")?Za(e[1]):qa:Qa;function el(h){var d=h,{when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c}=d,u=K(d,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(u).length}function Ie(t,e){var n,i;return(i=(n=t==null?void 0:t[e])!=null?n:t==null?void 0:t.default)!=null?i:t}function je(t){t.duration=0,t.type="keyframes"}function _e(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function nl({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let s=0,r=0,o=0;if(!e)s=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=_e(l,a,t+1/3),r=_e(l,a,t),o=_e(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}function Jt(t,e){return n=>n>0?e:t}const Ue=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},il=[pe,ut,mt],sl=t=>il.find(e=>e.test(t));function ki(t){const e=sl(t);if(Rt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===mt&&(n=nl(n)),n}const Fi=(t,e)=>{const n=ki(t),i=ki(e);if(!n||!i)return Jt(t,e);const s=g({},n);return r=>(s.red=Ue(n.red,i.red,r),s.green=Ue(n.green,i.green,r),s.blue=Ue(n.blue,i.blue,r),s.alpha=R(n.alpha,i.alpha,r),ut.transform(s))},Ne=new Set(["none","hidden"]);function ol(t,e){return Ne.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}const rl=(t,e)=>n=>e(t(n)),Lt=(...t)=>t.reduce(rl);function al(t,e){return n=>R(t,e,n)}function $e(t){return typeof t=="number"?al:typeof t=="string"?ge(t)?Jt:B.test(t)?Fi:cl:Array.isArray(t)?Oi:typeof t=="object"?B.test(t)?Fi:ll:Jt}function Oi(t,e){const n=[...t],i=n.length,s=t.map((r,o)=>$e(r)(r,e[o]));return r=>{for(let o=0;o<i;o++)n[o]=s[o](r);return n}}function ll(t,e){const n=g(g({},t),e),i={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(i[s]=$e(t[s])(t[s],e[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}}function ul(t,e){var s;const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=(s=t.values[a])!=null?s:0;n[r]=l,i[o]++}return n}const cl=(t,e)=>{const n=rt.createTransformer(e),i=Vt(t),s=Vt(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?Ne.has(t)&&!s.values.length||Ne.has(e)&&!i.values.length?ol(t,e):Lt(Oi(ul(i,s),s.values),n):(Rt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Jt(t,e))};function Ii(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?R(t,e,n):$e(t)(t,e)}const hl=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>M.update(e,n),stop:()=>nt(e),now:()=>I.isProcessing?I.timestamp:U.now()}},ji=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let r=0;r<s;r++)i+=Math.round(t(r/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},fl=5;function _i(t,e,n){const i=Math.max(e-fl,0);return zn(n-t(i),e-i)}const L={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ke=.001;function dl({duration:t=L.duration,bounce:e=L.bounce,velocity:n=L.velocity,mass:i=L.mass}){let s,r;Rt(t<=H(L.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=J(L.minDamping,L.maxDamping,o),t=J(L.minDuration,L.maxDuration,W(t)),o<1?(s=c=>{const u=c*o,h=u*t,d=u-n,f=We(c,o),p=Math.exp(-h);return Ke-d/f*p},r=c=>{const h=c*o*t,d=h*n+n,f=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),m=We(Math.pow(c,2),o);return(-s(c)+Ke>0?-1:1)*((d-f)*p)/m}):(s=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-Ke+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=ml(s,r,a);if(t=H(t),isNaN(l))return{stiffness:L.stiffness,damping:L.damping,duration:t};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}const pl=12;function ml(t,e,n){let i=n;for(let s=1;s<pl;s++)i=i-t(i)/e(i);return i}function We(t,e){return t*Math.sqrt(1-e*e)}const gl=["duration","bounce"],yl=["stiffness","damping","mass"];function Ui(t,e){return e.some(n=>t[n]!==void 0)}function vl(t){let e=g({velocity:L.velocity,stiffness:L.stiffness,damping:L.damping,mass:L.mass,isResolvedFromDuration:!1},t);if(!Ui(t,yl)&&Ui(t,gl))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,r=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(s);e=V(g({},e),{mass:L.mass,stiffness:s,damping:r})}else{const n=dl(t);e=V(g(g({},e),n),{mass:L.mass}),e.isResolvedFromDuration=!0}return e}function Bt(t=L.visualDuration,e=L.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:f}=vl(V(g({},n),{velocity:-W(n.velocity||0)})),p=d||0,m=c/(2*Math.sqrt(l*u)),v=o-r,b=W(Math.sqrt(l/u)),A=Math.abs(v)<5;i||(i=A?L.restSpeed.granular:L.restSpeed.default),s||(s=A?L.restDelta.granular:L.restDelta.default);let S;if(m<1){const T=We(b,m);S=P=>{const C=Math.exp(-m*b*P);return o-C*((p+m*b*v)/T*Math.sin(T*P)+v*Math.cos(T*P))}}else if(m===1)S=T=>o-Math.exp(-b*T)*(v+(p+b*v)*T);else{const T=b*Math.sqrt(m*m-1);S=P=>{const C=Math.exp(-m*b*P),E=Math.min(T*P,300);return o-C*((p+m*b*v)*Math.sinh(E)+T*v*Math.cosh(E))/T}}const w={calculatedDuration:f&&h||null,next:T=>{const P=S(T);if(f)a.done=T>=h;else{let C=T===0?p:0;m<1&&(C=T===0?H(p):_i(S,T,P));const E=Math.abs(C)<=i,j=Math.abs(o-P)<=s;a.done=E&&j}return a.value=a.done?o:P,a},toString:()=>{const T=Math.min(Fe(w),Zt),P=ji(C=>w.next(T*C).value,T,30);return T+"ms "+P},toTransition:()=>{}};return w}Bt.applyToOptions=t=>{const e=Di(t,100,Bt);return t.ease=e.ease,t.duration=H(e.duration),t.type="keyframes",t};function Ge({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},f=E=>a!==void 0&&E<a||l!==void 0&&E>l,p=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let m=n*e;const v=h+m,b=o===void 0?v:o(v);b!==v&&(m=b-h);const A=E=>-m*Math.exp(-E/i),S=E=>b+A(E),w=E=>{const j=A(E),N=S(E);d.done=Math.abs(j)<=c,d.value=d.done?b:N};let T,P;const C=E=>{f(d.value)&&(T=E,P=Bt({keyframes:[d.value,p(d.value)],velocity:_i(S,E,d.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:E=>{let j=!1;return!P&&T===void 0&&(j=!0,w(E),C(E)),T!==void 0&&E>=T?P.next(E-T):(!j&&w(E),d)}}}function bl(t,e,n){const i=[],s=n||et.mix||Ii,r=t.length-1;for(let o=0;o<r;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||$:e;a=Lt(l,a)}i.push(a)}return i}function xl(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(Q(r===e.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=bl(e,i,s),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const d=Tt(t[h],t[h+1],u);return a[h](d)};return n?u=>c(J(t[0],t[r-1],u)):c}function Tl(t,e){return t.map(n=>n*e)}const Ni=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Sl=1e-7,wl=12;function Al(t,e,n,i,s){let r,o,a=0;do o=e+(n-e)/2,r=Ni(o,i,s)-t,r>0?n=o:e=o;while(Math.abs(r)>Sl&&++a<wl);return o}function kt(t,e,n,i){if(t===e&&n===i)return $;const s=r=>Al(r,0,1,t,n);return r=>r===0||r===1?r:Ni(s(r),e,i)}const Pl=kt(.42,0,1,1),El=kt(0,0,.58,1),$i=kt(.42,0,.58,1),Ki=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Wi=t=>e=>1-t(1-e),Gi=kt(.33,1.53,.69,.99),ze=Wi(Gi),zi=Ki(ze),Hi=t=>(t*=2)<1?.5*ze(t):.5*(2-Math.pow(2,-10*(t-1))),He=t=>1-Math.sin(Math.acos(t)),Yi=Wi(He),Xi=Ki(He),qi=t=>Array.isArray(t)&&typeof t[0]=="number",Zi={linear:$,easeIn:Pl,easeInOut:$i,easeOut:El,circIn:He,circInOut:Xi,circOut:Yi,backIn:ze,backInOut:zi,backOut:Gi,anticipate:Hi},Vl=t=>typeof t=="string",Ji=t=>{if(qi(t)){Q(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return kt(e,n,i,s)}else if(Vl(t))return Q(Zi[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Zi[t];return t};function Cl(t,e){return t.map(()=>e||$i).splice(0,t.length-1)}function St({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Ei(i)?i.map(Ji):Ji(i),r={done:!1,value:e[0]},o=Tl(n&&n.length===e.length?n:Mi(e),t),a=xl(o,e,{ease:Array.isArray(s)?s:Cl(e,s)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Ml=t=>t!==null;function Ye(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(Ml),a=s<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||i===void 0?r[a]:i}const Dl={decay:Ge,inertia:Ge,tween:St,keyframes:St,spring:Bt};function Qi(t){typeof t.type=="string"&&(t.type=Dl[t.type])}class Xe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Rl=t=>t/100;class qe extends Xe{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:s}=this.options;s&&s.updatedAt!==U.now()&&this.tick(U.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Qi(e);const{type:n=St,repeat:i=0,repeatDelay:s=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||St;process.env.NODE_ENV!=="production"&&l!==St&&Q(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==St&&typeof a[0]!="number"&&(this.mixKeyframes=Lt(Rl,Ii(a[0],a[1])),a=[0,100]);const c=l(V(g({},e),{keyframes:a}));r==="mirror"&&(this.mirroredGenerator=l(V(g({},e),{keyframes:[...a].reverse(),velocity:-o}))),c.calculatedDuration===null&&(c.calculatedDuration=Fe(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let S=this.currentTime,w=i;if(h){const E=Math.min(this.currentTime,s)/a;let j=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&j--,j=Math.min(j,h+1),!!(j%2)&&(d==="reverse"?(N=1-N,f&&(N-=f/a)):d==="mirror"&&(w=o)),S=J(0,1,N)*a}const T=A?{done:!1,value:u[0]}:w.next(S);r&&(T.value=r(T.value));let{done:P}=T;!A&&l!==null&&(P=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return C&&p!==Ge&&(T.value=Ye(u,this.options,v,this.speed)),m&&m(T.value),C&&this.finish(),T}then(e,n){return this.finished.then(e,n)}get duration(){return W(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(this.currentTime)}set time(e){var n;e=H(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(U.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=W(this.currentTime))}play(){var e,n;if(this.isStopped)return;const{driver:i=hl,startTime:s}=this.options;this.driver||(this.driver=i(o=>this.tick(o))),(n=(e=this.options).onPlay)==null||n.call(e);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s!=null?s:r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(U.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}const Ll=t=>t.startsWith("--");function Bl(t,e,n){Ll(e)?t.style.setProperty(e,n):t.style[e]=n}function Ze(t){let e;return()=>(e===void 0&&(e=t()),e)}const kl=Ze(()=>window.ScrollTimeline!==void 0),Fl={};function Ol(t,e){const n=Ze(t);return()=>{var i;return(i=Fl[e])!=null?i:n()}}const ts=Ol(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Ft=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,es={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ft([0,.65,.55,1]),circOut:Ft([.55,0,1,.45]),backIn:Ft([.31,.01,.66,-.59]),backOut:Ft([.33,1.53,.69,.99])};function ns(t,e){if(t)return typeof t=="function"?ts()?ji(t,e):"ease-out":qi(t)?Ft(t):Array.isArray(t)?t.map(n=>ns(n,e)||es.easeOut):es[t]}function Il(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=ns(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function jl(n){var i=n,{type:t}=i,e=K(i,["type"]);var s,r;return Oe(t)&&ts()?t.applyToOptions(e):((s=e.duration)!=null||(e.duration=300),(r=e.ease)!=null||(e.ease="easeOut"),e)}class _l extends Xe{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Q(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=jl(e);this.animation=Il(n,i,s,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=Ye(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Bl(n,i,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var e,n;const i=((n=(e=this.animation.effect)==null?void 0:e.getComputedTiming)==null?void 0:n.call(e).duration)||0;return W(Number(i))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=H(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){var e;return(e=this.manualStartTime)!=null?e:Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&kl()?(this.animation.timeline=e,$):n(this)}}const is={anticipate:Hi,backInOut:zi,circInOut:Xi};function Ul(t){return t in is}function Nl(t){typeof t.ease=="string"&&Ul(t.ease)&&(t.ease=is[t.ease])}const Je=10;class $l extends _l{constructor(e){Nl(e),Qi(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const u=this.options,{motionValue:n,onUpdate:i,onComplete:s,element:r}=u,o=K(u,["motionValue","onUpdate","onComplete","element"]);if(!n)return;if(e!==void 0){n.set(e);return}const a=new qe(V(g({},o),{autoplay:!1})),l=Math.max(Je,U.now()-this.startTime),c=J(0,Je,l-Je);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const ss=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(rt.test(t)||t==="0")&&!t.startsWith("url("));function Kl(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Wl(t,e,n,i){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=ss(s,e),a=ss(r,e);return Rt(o===a,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Kl(t)||(n==="spring"||Oe(n))&&i}const Gl=new Set(["opacity","clipPath","filter","transform"]),zl=Ze(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Hl(t){var e;const{motionValue:n,name:i,repeatDelay:s,repeatType:r,damping:o,type:a}=t;if(!(((e=n==null?void 0:n.owner)==null?void 0:e.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return zl()&&i&&Gl.has(i)&&(i!=="transform"||!u)&&!c&&!s&&r!=="mirror"&&o!==0&&a!=="inertia"}const Yl=40;class Xl extends Xe{constructor(d){var f=d,{autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u}=f,h=K(f,["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"]);var p;super(),this.stop=()=>{var b,A;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(A=this.keyframeResolver)==null||A.cancel()},this.createdAt=U.now();const m=g({autoplay:e,delay:n,type:i,repeat:s,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u},h),v=(u==null?void 0:u.KeyframeResolver)||Me;this.keyframeResolver=new v(a,(b,A,S)=>this.onKeyframesResolved(b,A,m,!S),l,c,u),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=U.now(),Wl(e,r,o,a)||((et.instantAnimations||!l)&&(u==null||u(Ye(e,i,n))),e[0]=e[e.length-1],je(i),i.repeat=0);const h=s?this.resolvedAt?this.resolvedAt-this.createdAt>Yl?this.resolvedAt:this.createdAt:this.createdAt:void 0,d=V(g({startTime:h,finalKeyframe:n},i),{keyframes:e}),f=!c&&Hl(d)?new $l(V(g({},d),{element:d.motionValue.owner.current})):new qe(d);f.finished.then(()=>this.notifyFinished()).catch($),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Zr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const Qe=(t,e,n,i={},s,r)=>o=>{const a=Ie(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-H(l);const u=V(g({keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity()},a),{delay:-c,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s});el(a)||Object.assign(u,tl(t,u)),u.duration&&(u.duration=H(u.duration)),u.repeatDelay&&(u.repeatDelay=H(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(je(u),u.delay===0&&(h=!0)),(et.instantAnimations||et.skipAnimations)&&(h=!0,je(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const d=Xa(u.keyframes,a);if(d!==void 0){M.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new qe(u):new Xl(u)};function ql({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function Zl(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var h;let u=e,{transition:r=t.getDefaultTransition(),transitionEnd:o}=u,a=K(u,["transition","transitionEnd"]);i&&(r=i);const l=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const d in a){const f=t.getValue(d,(h=t.latestValues[d])!=null?h:null),p=a[d];if(p===void 0||c&&ql(c,d))continue;const m=g({delay:n},Ie(r||{},d)),v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(p)&&p===v&&!m.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const S=Bi(t);if(S){const w=window.MotionHandoffAnimation(S,d,M);w!==null&&(m.startTime=w,b=!0)}}za(t,d),f.start(Qe(d,f,p,t.shouldReduceMotion&&di.has(d)?{type:!1}:m,t,b));const A=f.animation;A&&l.push(A)}return o&&Promise.all(l).then(()=>{M.update(()=>{o&&Wa(t,o)})}),l}function Jl(t,e){return t in e}class Ql extends fi{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(Jl(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return O()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function os(t){return typeof t=="object"&&t!==null}function tn(t){return os(t)&&"ownerSVGElement"in t}function rs(t){return tn(t)&&t.tagName==="svg"}function tu(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=tn(t)&&!rs(t)?new wi(e):new Ti(e);n.mount(t),ct.set(t,n)}function eu(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Ql(e);n.mount(t),ct.set(t,n)}function as(t,e,n){const i=k(t)?t:vt(t);return i.start(Qe("",i,e,n)),i.animation}function nu(t,e){return k(t)||typeof t=="number"||typeof t=="string"&&!Be(e)}function ls(t,e,n,i){const s=[];if(nu(t,e))s.push(as(t,Be(e)&&e.default||e,n&&(n.default||n)));else{const r=Ai(t,e,i),o=r.length;Q(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){const l=r[a];Q(l!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const c=l instanceof Element?tu:eu;ct.has(l)||c(l);const u=ct.get(l),h=g({},n);"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...Zl(u,V(g({},e),{transition:h}),{}))}}return s}function iu(t,e,n){const i=[];return Fa(t,e,n,{spring:Bt}).forEach(({keyframes:r,transition:o},a)=>{i.push(...ls(a,r,o))}),i}class su{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=n}attachTimeline(e){const n=this.animations.map(i=>i.attachTimeline(e));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return us(this.animations,"duration")}get iterationDuration(){return us(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function us(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];s!==null&&s>n&&(n=s)}return n}class ou extends su{then(e,n){return this.finished.finally(e).then(()=>{})}}function ru(t){return Array.isArray(t)&&t.some(Array.isArray)}function au(t){function e(n,i,s){let r=[],o;if(ru(n))r=iu(n,i,t);else{const l=s||{},{onComplete:c}=l,u=K(l,["onComplete"]);typeof c=="function"&&(o=c),r=ls(n,i,u,t)}const a=new ou(r);return o&&a.finished.then(o),a}return e}const lu=au(),uu=["initial","animate","whileInView","whileHover","whilePress","whileDrag","whileFocus","exit"];class cu extends it{constructor(e){var n,i;super(e),this.animateUpdates=({controlActiveState:s,directAnimate:r,directTransition:o,controlDelay:a=0,isExit:l}={})=>{const{reducedMotion:c}=this.state.options.motionConfig;this.state.visualElement.shouldReduceMotion=c==="always"||c==="user"&&!!Xt.current;const u=this.state.target;this.state.target=g({},this.state.baseTarget);let h={};h=this.resolveStateAnimation({controlActiveState:s,directAnimate:r,directTransition:o}),this.state.finalTransition=h;const d=this.createAnimationFactories(u,h,a),{getChildAnimations:f}=this.setupChildAnimations(h,this.state.activeStates);return this.executeAnimations({factories:d,getChildAnimations:f,transition:h,controlActiveState:s,isExit:l})},this.state.visualElement=Pa(this.state.options.as,{presenceContext:null,parent:(n=this.state.parent)==null?void 0:n.visualElement,props:V(g({},this.state.options),{whileTap:this.state.options.whilePress}),visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:g({},this.state.baseTarget)},reducedMotionConfig:this.state.options.motionConfig.reducedMotion}),(i=this.state.visualElement.parent)==null||i.addChild(this.state.visualElement),this.state.animateUpdates=this.animateUpdates,this.state.isMounted()&&this.state.startAnimation()}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;Rn(e)&&(this.unmountControls=e.subscribe(this.state))}executeAnimations({factories:e,getChildAnimations:n,transition:i,controlActiveState:s,isExit:r=!1}){const o=()=>Promise.all(e.map(h=>h()).filter(Boolean)),a=g({},this.state.target),l=this.state.element,c=h=>{var d,f;r&&(this.state.isExiting=!0),l.dispatchEvent(Fn("motionstart",a)),(f=(d=this.state.options).onAnimationStart)==null||f.call(d,a),h.then(()=>{var p,m,v,b;if(r){this.state.isExiting=!1;const A=this.state.options.animatePresenceContext;if(A!=null&&A.onMotionExitComplete&&this.state.presenceContainer){const S=this.state,w=S.visualElement.projection;(p=S.options)!=null&&p.layoutId&&((m=w.currentAnimation)==null?void 0:m.state)==="running"&&!S.options.exit||A.onMotionExitComplete(S.presenceContainer,S)}}l.dispatchEvent(Fn("motioncomplete",a,r)),(b=(v=this.state.options).onAnimationComplete)==null||b.call(v,a)}).catch($)},u=()=>{const h=i!=null&&i.when?(i.when==="beforeChildren"?o():n()).then(()=>i.when==="beforeChildren"?n():o()):Promise.all([o(),n()]);return c(h),h};return s?u:u()}setupChildAnimations(e,n){var i;const s=this.state.visualElement;if(!((i=s.variantChildren)!=null&&i.size)||!n)return{getChildAnimations:()=>Promise.resolve()};const{staggerChildren:r=0,staggerDirection:o=1,delayChildren:a=0}=e||{},l=s.variantChildren.size,c=(l-1)*r,u=typeof a=="function",h=u?f=>a(f,l):o===1?(f=0)=>f*r:(f=0)=>c-f*r,d=Array.from(s.variantChildren).map((f,p)=>f.state.animateUpdates({controlActiveState:n,controlDelay:(u?0:a)+h(p)}));return{getChildAnimations:()=>Promise.all(d.map(f=>f()))}}createAnimationFactories(e,n,i){const s=[];return Object.keys(this.state.target).forEach(r=>{var l;var o;if(!ar(e[r],this.state.target[r]))return;(l=(o=this.state.baseTarget)[r])!=null||(o[r]=Pr.get(this.state.element,r));const a=this.state.target[r]==="none"&&Yt(jn[r])?jn[r]:this.state.target[r];s.push(()=>{var c;return lu(this.state.element,{[r]:a},V(g({},(n==null?void 0:n[r])||n),{delay:(((c=n==null?void 0:n[r])==null?void 0:c.delay)||(n==null?void 0:n.delay)||0)+i}))})}),s}resolveStateAnimation({controlActiveState:e,directAnimate:n,directTransition:i}){let s=this.state.options.transition,r={};const{variants:o,custom:a,transition:l,animatePresenceContext:c}=this.state.options,u=a!=null?a:c==null?void 0:c.custom;return this.state.activeStates=g(g({},this.state.activeStates),e),uu.forEach(h=>{if(!this.state.activeStates[h]||Rn(this.state.options[h]))return;const d=this.state.options[h];let f=Yt(d)?Dt(d,o,u):void 0;if(this.state.visualElement.isVariantNode){const p=Dt(this.state.context[h],o,u);f=Object.assign(p?p||{}:r,f)}f&&(h!=="initial"&&(s=f.transition||this.state.options.transition||{}),r=Object.assign(r,f))}),n&&(r=Dt(n,o,u),s=r.transition||i||l),Object.entries(r).forEach(([h,d])=>{h!=="transition"&&(this.state.target[h]=d)}),s}mount(){var e,n;const{element:i}=this.state;kn.set(i,this.state),ct.get(i)||(this.state.visualElement.mount(i),ct.set(i,this.state.visualElement)),this.state.visualElement.state=this.state,this.updateAnimationControlsSubscription();const s=this.state.visualElement,r=s.parent;if(s.enteringChildren=void 0,(e=this.state.parent)!=null&&e.isMounted()&&!s.isControllingVariants&&((n=r==null?void 0:r.enteringChildren)!=null&&n.has(s))){const{delayChildren:o}=this.state.parent.finalTransition||{};this.animateUpdates({controlActiveState:this.state.parent.activeStates,controlDelay:Ea(r.enteringChildren,s,o)})()}}update(){const{animate:e}=this.state.options,{animate:n}=this.state.visualElement.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;(e=this.unmountControls)==null||e.call(this)}}function hu(t){return os(t)&&"offsetHeight"in t}const fu={y:!1};function du(){return fu.y}const cs=(t,e)=>e?t===e?!0:cs(t,e.parentElement):!1,pu=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function hs(t,e){const n=ke(t),i=new AbortController,s=V(g({passive:!0},e),{signal:i.signal});return[n,s,()=>i.abort()]}const mu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function gu(t){return mu.has(t.tagName)||t.isContentEditable===!0}const Qt=new WeakSet;function fs(t){return e=>{e.key==="Enter"&&t(e)}}function en(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const yu=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=fs(()=>{if(Qt.has(n))return;en(n,"down");const s=fs(()=>{en(n,"up")}),r=()=>en(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function ds(t){return pu(t)&&!0}function vu(t,e,n={}){const[i,s,r]=hs(t,n),o=a=>{const l=a.currentTarget;if(!ds(a))return;Qt.add(l);const c=e(l,a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),Qt.has(l)&&Qt.delete(l),ds(f)&&typeof c=="function"&&c(f,{success:p})},h=f=>{u(f,l===window||l===document||n.useGlobalTarget||cs(l,f.target))},d=f=>{u(f,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",d,s)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),hu(a)&&(a.addEventListener("focus",c=>yu(c,s)),!gu(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function ps(t){return{point:{x:t.pageX,y:t.pageY}}}function ms(t,e,n){const i=t.options;i.whilePress&&t.setActive("whilePress",n==="Start");const s=`onPress${n==="End"?"":n}`,r=i[s];r&&M.postRender(()=>r(e,ps(e)))}class bu extends it{isActive(){const{whilePress:e,onPress:n,onPressCancel:i,onPressStart:s}=this.state.options;return!!(e||n||i||s)}constructor(e){super(e)}mount(){this.register()}update(){const{whilePress:e,onPress:n,onPressCancel:i,onPressStart:s}=this.state.options;e||n||i||s||this.register()}register(){const e=this.state.element;!e||!this.isActive()||(this.unmount(),this.unmount=vu(e,(n,i)=>(ms(this.state,i,"Start"),(s,{success:r})=>ms(this.state,s,r?"End":"Cancel")),{useGlobalTarget:this.state.options.globalPressTarget}))}}function gs(t){return!(t.pointerType==="touch"||du())}function xu(t,e,n={}){const[i,s,r]=hs(t,n),o=a=>{if(!gs(a))return;const{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;const u=h=>{gs(h)&&(c(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,s)};return i.forEach(a=>{a.addEventListener("pointerenter",o,s)}),r}function ys(t,e,n){const i=t.options;i.whileHover&&t.setActive("whileHover",n==="Start");const s=`onHover${n}`,r=i[s];r&&M.postRender(()=>r(e,ps(e)))}class Tu extends it{isActive(){const{whileHover:e,onHoverStart:n,onHoverEnd:i}=this.state.options;return!!(e||n||i)}constructor(e){super(e)}mount(){this.register()}update(){const{whileHover:e,onHoverStart:n,onHoverEnd:i}=this.state.visualElement.prevProps;e||n||i||this.register()}register(){const e=this.state.element;!e||!this.isActive()||(this.unmount(),this.unmount=xu(e,(n,i)=>(ys(this.state,i,"Start"),s=>{ys(this.state,s,"End")})))}}const Su={some:0,all:1};function wu(t,e,{root:n,margin:i,amount:s="some"}={}){const r=ke(t),o=new WeakMap,a=c=>{c.forEach(u=>{const h=o.get(u.target);if(u.isIntersecting!==!!h)if(u.isIntersecting){const d=e(u.target,u);typeof d=="function"?o.set(u.target,d):l.unobserve(u.target)}else typeof h=="function"&&(h(u),o.delete(u.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:i,threshold:typeof s=="number"?s:Su[s]});return r.forEach(c=>l.observe(c)),()=>l.disconnect()}function vs(t,e,n){const i=t.options;i.whileInView&&t.setActive("whileInView",n==="Enter");const s=`onViewport${n}`,r=i[s];r&&M.postRender(()=>r(e))}class Au extends it{isActive(){const{whileInView:e,onViewportEnter:n,onViewportLeave:i}=this.state.options;return!!(e||n||i)}constructor(e){super(e)}startObserver(){const e=this.state.element;if(!e||!this.isActive())return;this.unmount();const s=this.state.options.inViewOptions||{},{once:n}=s,i=K(s,["once"]);this.unmount=wu(e,(r,o)=>{if(vs(this.state,o,"Enter"),!n)return a=>{vs(this.state,o,"Leave")}},i)}mount(){this.startObserver()}update(){const{props:e,prevProps:n}=this.state.visualElement;["amount","margin","root"].some(Pu(e,n))&&this.startObserver()}}function Pu({inViewOptions:t={}},{inViewOptions:e={}}={}){return n=>t[n]!==e[n]}function te(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}class Eu extends it{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.state.element.matches(":focus-visible")}catch(n){e=!0}e&&(this.state.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&(this.state.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Lt(te(this.state.element,"focus",()=>this.onFocus()),te(this.state.element,"blur",()=>this.onBlur()))}}const Vu=(t,e)=>t.depth-e.depth;class Cu{constructor(){this.children=[],this.isDirty=!1}add(e){xe(this.children,e),this.isDirty=!0}remove(e){qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Vu),this.isDirty=!1,this.children.forEach(e)}}function nn(t){return k(t)?t.get():t}const bs=["TopLeft","TopRight","BottomLeft","BottomRight"],Mu=bs.length,xs=t=>typeof t=="string"?parseFloat(t):t,Ts=t=>typeof t=="number"||x.test(t);function Du(t,e,n,i,s,r){var o,a,l,c;s?(t.opacity=R(0,(o=n.opacity)!=null?o:1,Ru(i)),t.opacityExit=R((a=e.opacity)!=null?a:1,0,Lu(i))):r&&(t.opacity=R((l=e.opacity)!=null?l:1,(c=n.opacity)!=null?c:1,i));for(let u=0;u<Mu;u++){const h=`border${bs[u]}Radius`;let d=Ss(e,h),f=Ss(n,h);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||Ts(d)===Ts(f)?(t[h]=Math.max(R(xs(d),xs(f),i),0),(q.test(f)||q.test(d))&&(t[h]+="%")):t[h]=f}(e.rotate||n.rotate)&&(t.rotate=R(e.rotate||0,n.rotate||0,i))}function Ss(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ru=ws(0,.5,Yi),Lu=ws(.5,.95,$);function ws(t,e,n){return i=>i<t?0:i>e?1:n(Tt(t,e,i))}function As(t,e){t.min=e.min,t.max=e.max}function Y(t,e){As(t.x,e.x),As(t.y,e.y)}function Ps(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function sn(t){return t===void 0||t===1}function on({scale:t,scaleX:e,scaleY:n}){return!sn(t)||!sn(e)||!sn(n)}function dt(t){return on(t)||Es(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Es(t){return Vs(t.x)||Vs(t.y)}function Vs(t){return t&&t!=="0%"}function ee(t,e,n){const i=t-n,s=e*i;return n+s}function Cs(t,e,n,i,s){return s!==void 0&&(t=ee(t,s,i)),ee(t,n,i)+e}function rn(t,e=0,n=1,i,s){t.min=Cs(t.min,e,n,i,s),t.max=Cs(t.max,e,n,i,s)}function Ms(t,{x:e,y:n}){rn(t.x,e.translate,e.scale,e.originPoint),rn(t.y,n.translate,n.scale,n.originPoint)}const Ds=.999999999999,Rs=1.0000000000001;function Bu(t,e,n,i=!1){const s=n.length;if(!s)return;e.x=e.y=1;let r,o;for(let a=0;a<s;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&wt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ms(t,o)),i&&dt(r.latestValues)&&wt(t,r.latestValues))}e.x<Rs&&e.x>Ds&&(e.x=1),e.y<Rs&&e.y>Ds&&(e.y=1)}function ne(t,e){t.min=t.min+e,t.max=t.max+e}function Ls(t,e,n,i,s=.5){const r=R(t.min,t.max,s);rn(t,e,n,r,i)}function wt(t,e){Ls(t.x,e.x,e.scaleX,e.scale,e.originX),Ls(t.y,e.y,e.scaleY,e.scale,e.originY)}const Bs=1e-4,ku=1-Bs,Fu=1+Bs,ks=.01,Ou=0-ks,Iu=0+ks;function G(t){return t.max-t.min}function ju(t,e,n){return Math.abs(t-e)<=n}function Fs(t,e,n,i=.5){t.origin=i,t.originPoint=R(e.min,e.max,t.origin),t.scale=G(n)/G(e),t.translate=R(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ku&&t.scale<=Fu||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ou&&t.translate<=Iu||isNaN(t.translate))&&(t.translate=0)}function Ot(t,e,n,i){Fs(t.x,e.x,n.x,i?i.originX:void 0),Fs(t.y,e.y,n.y,i?i.originY:void 0)}function Os(t,e,n){t.min=n.min+e.min,t.max=t.min+G(e)}function _u(t,e,n){Os(t.x,e.x,n.x),Os(t.y,e.y,n.y)}function Is(t,e,n){t.min=e.min-n.min,t.max=t.min+G(e)}function ie(t,e,n){Is(t.x,e.x,n.x),Is(t.y,e.y,n.y)}function js(t,e,n,i,s){return t-=e,t=ee(t,1/n,i),s!==void 0&&(t=ee(t,1/s,i)),t}function Uu(t,e=0,n=1,i=.5,s,r=t,o=t){if(q.test(e)&&(e=parseFloat(e),e=R(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=R(r.min,r.max,i);t===r&&(a-=e),t.min=js(t.min,e,n,a,s),t.max=js(t.max,e,n,a,s)}function _s(t,e,[n,i,s],r,o){Uu(t,e[n],e[i],e[s],e.scale,r,o)}const Nu=["x","scaleX","originX"],$u=["y","scaleY","originY"];function Us(t,e,n,i){_s(t.x,e,Nu,n?n.x:void 0,i?i.x:void 0),_s(t.y,e,$u,n?n.y:void 0,i?i.y:void 0)}function Ns(t){return t.translate===0&&t.scale===1}function $s(t){return Ns(t.x)&&Ns(t.y)}function Ks(t,e){return t.min===e.min&&t.max===e.max}function Ku(t,e){return Ks(t.x,e.x)&&Ks(t.y,e.y)}function Ws(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Gs(t,e){return Ws(t.x,e.x)&&Ws(t.y,e.y)}function zs(t){return G(t.x)/G(t.y)}function Hs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Wu{constructor(){this.members=[]}add(e){xe(this.members,e),e.scheduleRender()}remove(e){if(qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Gu(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),d&&(i+=`rotateY(${d}deg) `),f&&(i+=`skewX(${f}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}function Ys(t){return[t("x"),t("y")]}const se={hasAnimatedSinceResize:!0,hasEverUpdated:!1},an=["","X","Y","Z"],zu=1e3;let Hu=0;function ln(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Xs(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Bi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",M,!(s||r))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Xs(i)}function qs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Hu++,this.animationId=0,this.animationCommitId=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.layoutVersion=0,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(qu),this.nodes.forEach(tc),this.nodes.forEach(ec),this.nodes.forEach(Zu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Te),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=tn(o)&&!rs(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const d=()=>this.root.updateBlockedByResize=!1;M.read(()=>{h=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,u&&u(),u=$o(d,250),se.hasAnimatedSinceResize&&(se.hasAnimatedSinceResize=!1,this.nodes.forEach(Qs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||rc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=c.getProps(),b=!this.targetLayout||!Gs(this.targetLayout,f),A=!h&&d;if(this.options.layoutRoot||this.resumeFrom||A||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S=V(g({},Ie(p,"layout")),{onPlay:m,onComplete:v});(c.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,A)}else h||Qs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),nt(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(nc),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Xs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Zs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Js);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qu),this.nodes.forEach(Yu),this.nodes.forEach(Xu)):this.nodes.forEach(Js),this.clearAllSnapshots();const a=U.now();I.delta=J(0,1e3/60,a-I.timestamp),I.timestamp=a,I.isProcessing=!0,ce.update.process(I),ce.preRender.process(I),ce.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ci.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ju),this.sharedNodes.forEach(ic)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!G(this.snapshot.measuredBox.x)&&!G(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=O(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!$s(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||dt(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),ac(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return O();const l=a.measureViewportBox();if(!(((o=this.scroll)==null?void 0:o.wasRoot)||this.path.some(lc))){const{scroll:u}=this.root;u&&(ne(l.x,u.offset.x),ne(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=O();if(Y(l,o),(a=this.scroll)!=null&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:d}=u;u!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&Y(l,o),ne(l.x,h.offset.x),ne(l.y,h.offset.y))}return l}applyTransform(o,a=!1){const l=O();Y(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&wt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),dt(u.latestValues)&&wt(l,u.latestValues)}return dt(this.latestValues)&&wt(l,this.latestValues),l}removeTransform(o){const a=O();Y(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!dt(c.latestValues))continue;on(c.latestValues)&&c.updateSnapshot();const u=O(),h=c.measurePageBox();Y(u,h),Us(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return dt(this.latestValues)&&Us(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options=V(g(g({},this.options),o),{crossfade:o.crossfade!==void 0?o.crossfade:!0})}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==I.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(a=this.parent)!=null&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!this.layout||!(h||d))return;this.resolvedRelativeTargetAt=I.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=O(),this.targetWithTransforms=O()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_u(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Y(this.target,this.layout.layoutBox),Ms(this.target,this.targetDelta)):Y(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||on(this.parent.latestValues)||Es(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=O(),this.relativeTargetOrigin=O(),ie(this.relativeTargetOrigin,a,l),Y(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(o=this.parent)!=null&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===I.timestamp&&(c=!1),c)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;Y(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Bu(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=O());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ps(this.prevProjectionDelta.x,this.projectionDelta.x),Ps(this.prevProjectionDelta.y,this.projectionDelta.y)),Ot(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Hs(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=yt(),this.projectionDelta=yt(),this.projectionDeltaWithTransform=yt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u=g({},this.latestValues),h=yt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=O(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,v=this.getStack(),b=!v||v.members.length<=1,A=!!(m&&!b&&this.options.crossfade===!0&&!this.path.some(oc));this.animationProgress=0;let S;this.mixTargetDelta=w=>{const T=w/1e3;to(h.x,o.x,T),to(h.y,o.y,T),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ie(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sc(this.relativeTarget,this.relativeTargetOrigin,d,T),S&&Ku(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=O()),Y(S,this.relativeTarget)),m&&(this.animationValues=u,Du(u,c,this.latestValues,T,A,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(nt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{se.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=vt(0)),this.currentAnimation=as(this.motionValue,[0,1e3],V(g({},o),{velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(zu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&oo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||O();const h=G(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=G(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}Y(a,l),wt(a,u),Ot(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Wu),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ln("z",o,c,this.animationValues);for(let u=0;u<an.length;u++)ln(`rotate${an[u]}`,o,c,this.animationValues),ln(`skew${an[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=nn(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=nn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!dt(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=Gu(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,c.animationValues?o.opacity=c===this?(m=(p=u.opacity)!=null?p:this.latestValues.opacity)!=null?m:1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const v in Ct){if(u[v]===void 0)continue;const{correct:b,applyTo:A,isCSSVariable:S}=Ct[v],w=h==="none"?u[v]:b(u[v],c);if(A){const T=A.length;for(let P=0;P<T;P++)o[A[P]]=w}else S?this.options.visualElement.renderState.vars[v]=w:o[v]=w}this.options.layoutId&&(o.pointerEvents=c===this?nn(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Zs),this.root.sharedNodes.clear()}}}function Yu(t){t.updateLayout()}function Xu(t){var e;const n=((e=t.resumeFrom)==null?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;r==="size"?Ys(h=>{const d=o?n.measuredBox[h]:n.layoutBox[h],f=G(d);d.min=i[h].min,d.max=d.min+f}):oo(r,n.layoutBox,i)&&Ys(h=>{const d=o?n.measuredBox[h]:n.layoutBox[h],f=G(i[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const a=yt();Ot(a,i,n.layoutBox);const l=yt();o?Ot(l,t.applyTransform(s,!0),n.measuredBox):Ot(l,i,n.layoutBox);const c=!$s(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const p=O();ie(p,n.layoutBox,d.layoutBox);const m=O();ie(m,i,f.layoutBox),Gs(p,m)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:i}=t.options;i&&i()}t.options.transition=void 0}function qu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Zu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ju(t){t.clearSnapshot()}function Zs(t){t.clearMeasurements()}function Js(t){t.isLayoutDirty=!1}function Qu(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Qs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function tc(t){t.resolveTargetDelta()}function ec(t){t.calcProjection()}function nc(t){t.resetSkewAndRotation()}function ic(t){t.removeLeadSnapshot()}function to(t,e,n){t.translate=R(e.translate,0,n),t.scale=R(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function eo(t,e,n,i){t.min=R(e.min,n.min,i),t.max=R(e.max,n.max,i)}function sc(t,e,n,i){eo(t.x,e.x,n.x,i),eo(t.y,e.y,n.y,i)}function oc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rc={duration:.45,ease:[.4,0,.1,1]},no=t=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),io=no("applewebkit/")&&!no("chrome/")?Math.round:$;function so(t){t.min=io(t.min),t.max=io(t.max)}function ac(t){so(t.x),so(t.y)}function oo(t,e,n){return t==="position"||t==="preserve-aspect"&&!ju(zs(e),zs(n),.2)}function lc(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}function uc(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const cc=qs({attachResizeListener:(t,e)=>uc(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),un={current:void 0},hc=qs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!un.current){const t=new cc({});t.mount(window),t.setOptions({layoutScroll:!0}),un.current=t}return un.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function ro(t){if(t)return t.options.allowProjection!==!1?t.projection:ro(t.parent)}const ao={borderRadius:V(g({},Z),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Z,borderTopRightRadius:Z,borderBottomLeftRadius:Z,borderBottomRightRadius:Z,boxShadow:Vn};function It(t){return typeof t=="object"&&t!==null&&"nodeType"in t}class fc extends it{constructor(e){super(e),Dn(ao)}initProjection(){const e=this.state.options;this.state.visualElement.projection=new hc(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:ro(this.state.visualElement.parent)),this.state.visualElement.projection.isPresent=!0,this.setOptions()}beforeMount(){this.initProjection()}setOptions(){const e=this.state.options,{layoutId:n,layout:i,drag:s=!1,dragConstraints:r=!1}=e;this.state.visualElement.projection.setOptions({layout:i,layoutId:n,alwaysMeasureLayout:!!n||!!s||r&&It(r),visualElement:this.state.visualElement,animationType:typeof e.layout=="string"?e.layout:"both",layoutRoot:e.layoutRoot,layoutScroll:e.layoutScroll,crossfade:e.crossfade,onExitComplete:()=>{var o,a;!((o=this.state.visualElement.projection)!=null&&o.isPresent)&&this.state.options.layoutId&&!this.state.isExiting&&((a=this.state.options.animatePresenceContext)==null||a.onMotionExitComplete(this.state.presenceContainer,this.state))}})}update(){this.setOptions()}mount(){var e;(e=this.state.visualElement.projection)==null||e.mount(this.state.element)}}function lo(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function cn(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function dc(t){return e=>lo(e)&&t(e,cn(e))}function jt(t,e,n,i){return te(t,e,dc(n),i)}function uo(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const co=uo("dragHorizontal"),ho=uo("dragVertical");function pc(t){let e=!1;if(t==="y")e=ho();else if(t==="x")e=co();else{const n=co(),i=ho();n&&i?e=()=>{n(),i()}:(n&&n(),i&&i())}return e}function hn(t){return t.max-t.min}function mc(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?R(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?R(n,t,i.max):Math.min(t,n)),t}const fn=.35;function gc(t,{top:e,left:n,bottom:i,right:s}){return{x:fo(t.x,n,s),y:fo(t.y,e,i)}}function fo(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yc(t=fn){return t===!1?t=0:t===!0&&(t=fn),{x:po(t,"left","right"),y:po(t,"top","bottom")}}function po(t,e,n){return{min:mo(t,e),max:mo(t,n)}}function mo(t,e){return typeof t=="number"?t:t[e]||0}function vc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}function bc(t,e){return{x:go(t.x,e.x),y:go(t.y,e.y)}}function go(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}}function xc(t,e){let n=.5;const i=hn(t),s=hn(e);return s>i?n=Tt(e.min,e.max-i,t.min):i>s&&(n=Tt(t.min,t.max-s,e.min)),J(0,1,n)}const yo=(t,e)=>Math.abs(t-e);function Tc(t,e){const n=yo(t.x,e.x),i=yo(t.y,e.y);return Math.sqrt(yn(n,2)+yn(i,2))}const vo=new Set(["auto","scroll"]);class bo{constructor(e,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=pn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=Tc(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:v}=I;this.history.push(V(g({},m),{timestamp:v}));const{onStart:b,onMove:A}=this.handlers;f||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=dn(f,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=pn(d.type==="pointercancel"?this.lastMoveEventInfo:dn(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,b),m&&m(d,b)},!lo(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const a=cn(e),l=dn(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=I;this.history=[V(g({},c),{timestamp:u})];const{onSessionStart:h}=n;h&&h(e,pn(l,this.history)),this.removeListeners=Lt(jt(this.contextWindow,"pointermove",this.handlePointerMove),jt(this.contextWindow,"pointerup",this.handlePointerUp),jt(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}isScrollable(e){const n=window.getComputedStyle(e);return n.overflow==="auto"||n.overflow==="scroll"||n.overflowX==="auto"||n.overflowX==="scroll"||n.overflowY==="auto"||n.overflowY==="scroll"}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(vo.has(i.overflowX)||vo.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:s.x-n.x,y:s.y-n.y};r.x===0&&r.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,s),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){var e;this.removeListeners&&this.removeListeners(),(e=this.removeScrollListeners)==null||e.call(this),this.scrollPositions.clear(),nt(this.updatePoint)}}function dn(t,e){return e?{point:e(t.point)}:t}function xo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pn({point:t},e){return{point:t,delta:xo(t,To(e)),offset:xo(t,Sc(e)),velocity:wc(e,.1)}}function Sc(t){return t[0]}function To(t){return t[t.length-1]}function wc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=To(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>H(e)));)n--;if(!i)return{x:0,y:0};const r=W(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const So=()=>({min:0,max:0});function Ac(){return{x:So(),y:So()}}function tt(t){return[t("x"),t("y")]}function Pc(t){return!!(k(t)&&t.add)}function wo(t,e){const n=t.getValue("willChange");if(Pc(n))return n.add(e)}function Ao({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ec(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}}function Vc({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Po(t,e){t.min=t.min+e,t.max=t.max+e}function Cc(t,e){return Ao(Ec(t.getBoundingClientRect(),e))}function Mc(t,e,n){const i=Cc(t,n),{scroll:s}=e;return s&&(Po(i.x,s.offset.x),Po(i.y,s.offset.y)),i}function Dc(t){var e;return(e=t.projection)==null?void 0:e.isPresent}function Eo({current:t}){return t?t.ownerDocument.defaultView:null}const Rc=new WeakMap;class Lc{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ac(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const i=c=>{n?this.stopAnimation():this.pauseAnimation(),n&&this.snapToCursor(cn(c,"page").point)},s=(c,u)=>{this.stopAnimation();const{drag:h,dragPropagation:d,onDragStart:f}=this.getProps();if(h&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=pc(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tt(m=>{let v=this.getAxisMotionValue(m).get()||0;if(q.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const A=b.layout.layoutBox[m];A&&(v=hn(A)*(parseFloat(v)/100))}}this.originPoint[m]=v}),f&&M.postRender(()=>f(c,u)),wo(this.visualElement,"transform"),this.visualElement.state.setActive("whileDrag",!0)},r=(c,u)=>{const{dragPropagation:h,dragDirectionLock:d,onDirectionLock:f,onDrag:p}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:m}=u;if(d&&this.currentDirection===null){this.currentDirection=Bc(m),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,m),this.updateAxis("y",u.point,m),this.visualElement.render(),p&&p(c,u)},o=(c,u)=>this.stop(c,u),a=()=>tt(c=>{var u;return this.getAnimationState(c)==="paused"&&((u=this.getAxisMotionValue(c).animation)==null?void 0:u.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new bo(e,{onSessionStart:i,onStart:s,onMove:r,onSessionEnd:o,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:Eo(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&M.postRender(()=>r(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.visualElement.state.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:s}=this.getProps();if(!i||!oe(e,s,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=mc(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)==null?void 0:e.layout,r=this.constraints;n&&It(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=gc(s.layoutBox,n):this.constraints=!1,this.elastic=yc(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&tt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!It(e))return!1;const i=e;zt(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=Mc(i,s.root,this.visualElement.getTransformPagePoint());let o=bc(s.layout.layoutBox,r);if(n){const a=n(Vc(o));this.hasMutatedConstraints=!!a,a&&(o=Ao(a))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=tt(u=>{if(!oe(u,n,this.currentDirection))return;let h=l&&l[u]||{};o&&(h={min:0,max:0});const d=s?200:1e6,f=s?40:1e7,p=g(g({type:"inertia",velocity:i?e[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10},r),h);return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return wo(this.visualElement,e),i.start(Qe(e,i,0,n,this.visualElement,!1))}stopAnimation(){Dc(this.visualElement)&&tt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){tt(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps();return i[n]||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){tt(n=>{const{drag:i}=this.getProps();if(!oe(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(e[n]-R(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!It(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};tt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=xc({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),tt(o=>{if(!oe(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(R(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Rc.set(this.visualElement,this);const e=this.visualElement.current,n=jt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();It(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),M.read(i);const o=te(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(tt(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=fn,dragMomentum:a=!0}=e;return V(g({},e),{drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a})}}function oe(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Bc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class kc extends it{constructor(e){super(e),this.removeGroupControls=$,this.removeListeners=$,this.controls=new Lc(e.visualElement)}mount(){const{dragControls:e}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$}unmount(){this.removeGroupControls(),this.removeListeners()}}let _t=!1;class Fc extends it{constructor(e){super(e),Dn(ao),e.getSnapshot=this.getSnapshot.bind(this),e.didUpdate=this.didUpdate.bind(this)}beforeUpdate(e){this.getSnapshot(e,void 0)}update(){this.didUpdate()}didUpdate(){var e,n;_t&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(_t=!1,(n=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||n.didUpdate())}mount(){var e;const n=this.state.options,i=this.state.options.layoutGroup;if(n.layout||n.layoutId){const s=this.state.visualElement.projection;if(s){s.promote();const r=s.getStack();r!=null&&r.prevLead&&!r.prevLead.snapshot&&(r.prevLead.willUpdate(),_t=!0),(e=i==null?void 0:i.group)==null||e.add(s)}se.hasEverUpdated=!0}this.didUpdate()}beforeUnmount(){this.getSnapshot(this.state.options,!1)}unmount(){const e=this.state.options.layoutGroup,n=this.state.visualElement.projection;n&&(e!=null&&e.group&&(this.state.options.layout||this.state.options.layoutId)&&e.group.remove(n),this.state.options.layoutId&&(_t=!0),this.didUpdate())}getSnapshot(e,n){const i=this.state.visualElement.projection,{drag:s,layoutDependency:r,layout:o,layoutId:a}=e;if(!i||!o&&!a&&!s)return;_t=!0;const l=this.state.options;(s||l.layoutDependency!==r||r===void 0||Yt(n)&&i.isPresent!==n)&&i.willUpdate(),Yt(n)&&n!==i.isPresent&&(i.isPresent=n,n?i.promote():i.relegate())}}function Vo(t){return(e,n)=>{t&&M.postRender(()=>t(e,n))}}class Oc extends it{constructor(){super(...arguments),this.removePointerDownListener=$}onPointerDown(e){this.session=new bo(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:Eo(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Vo((e,n)=>{const{onPanSessionStart:i}=this.state.options;i&&i(e,n)}),onStart:Vo((e,n)=>{const{onPanStart:i}=this.state.options;i&&i(e,n)}),onMove:(e,n)=>{const{onPan:i}=this.state.options;i&&i(e,n)},onEnd:(e,n)=>{const{onPanEnd:i}=this.state.options;delete this.session,i&&M.postRender(()=>i(e,n))}}}mount(){this.removePointerDownListener=jt(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ic=[cu,bu,Tu,Au,Eu,fc,Oc,kc,Fc],jc={reducedMotion:"never",transition:void 0,nonce:void 0},[_c]=Mt("MotionConfig");function Uc(){return _c(y.computed(()=>jc))}const Nc="data-ap-child",[$c]=Mt("AnimatePresenceContext");function re(t){if(t)return t.nodeType===3||t.nodeType===8?re(t.nextSibling):t}const[Kc]=Mt("LazyMotionContext");function Wc(t){var e;const n=sr(null),i=rr({}),s=Uc(),r=$c({}),o=Kc({features:y.ref([]),strict:!1});if(process.env.NODE_ENV!=="production"&&((e=t.features)!=null&&e.length)&&o.strict){const p="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?gt(!1,p):zt(!1,p)}const a=y.useAttrs();function l(){return i.id&&t.layoutId?`${i.id}-${t.layoutId}`:t.layoutId||void 0}function c(){var p,m;return V(g({},t),{lazyMotionContext:o,layoutId:l(),transition:(p=t.transition)!=null?p:s.value.transition,layoutGroup:i,motionConfig:s.value,inViewOptions:(m=t.inViewOptions)!=null?m:s.value.inViewOptions,animatePresenceContext:r,initial:r.initial===!1?r.initial:t.initial===!0?void 0:t.initial})}function u(){return g(g({},a),c())}const h=new gr(u(),n);or(h);function d(){var S,w;var p;const m=h.type==="svg",v=g({},a);Object.keys(a).forEach(T=>{k(a[T])&&(v[T]=a[T].get())});let b=g(g({},t.style),m?{}:((p=h.visualElement)==null?void 0:p.latestValues)||h.baseTarget);if(m){const{attrs:T,style:P}=Dr(g(g({},h.isMounted()?h.target:h.baseTarget),b));(P.transform||T.transformOrigin)&&(P.transformOrigin=(S=T.transformOrigin)!=null?S:"50% 50%",delete T.transformOrigin),P.transform&&(P.transformBox=(w=P.transformBox)!=null?w:"fill-box",delete T.transformBox),Object.assign(v,T),b=P}t.drag&&t.dragListener!==!1&&Object.assign(b,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const A=Er(b);return A&&(v.style=A),v}const f=y.getCurrentInstance().proxy;return y.onBeforeMount(()=>{h.beforeMount()}),y.onMounted(()=>{if(h.mount(re(f.$el),u(),zc(f)),r.register&&h.element){const p=h.element.closest(`[${Nc}]`);p?(h.presenceContainer=p,r.register(p,h)):r.registerPending&&r.registerPending(h)}}),y.onBeforeUnmount(()=>h.beforeUnmount()),y.onUnmounted(()=>{r.unregisterPending&&r.unregisterPending(h);const p=re(f.$el);p!=null&&p.isConnected||h.unmount()}),y.onBeforeUpdate(()=>{h.beforeUpdate(u())}),y.onUpdated(()=>{h.update(u())}),{getProps:c,getAttrs:d,layoutGroup:i,state:h}}const Gc={ignoreStrict:{type:Boolean},forwardMotionProps:{type:Boolean,default:!1},asChild:{type:Boolean,default:!1},hover:{type:[String,Array,Object]},press:{type:[String,Array,Object]},inView:{type:[String,Array,Object]},focus:{type:[String,Array,Object]},whileDrag:{type:[String,Array,Object]},whileHover:{type:[String,Array,Object],default:({hover:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"hover is deprecated. Use whileHover instead."),t)},whilePress:{type:[String,Array,Object],default:({press:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"press is deprecated. Use whilePress instead."),t)},whileInView:{type:[String,Array,Object],default:({inView:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"inView is deprecated. Use whileInView instead."),t)},whileFocus:{type:[String,Array,Object],default:({focus:t})=>(process.env.NODE_ENV==="development"&&t&&gt(!0,"focus is deprecated. Use whileFocus instead."),t)},custom:{type:[String,Number,Object,Array]},initial:{type:[String,Array,Object,Boolean],default:void 0},animate:{type:[String,Array,Object],default:void 0},exit:{type:[String,Array,Object]},variants:{type:Object},inherit:{type:Boolean},style:{type:Object},transformTemplate:{type:Function},transition:{type:Object},layoutGroup:{type:Object},motionConfig:{type:Object},onAnimationComplete:{type:Function},onUpdate:{type:Function},layout:{type:[Boolean,String],default:!1},layoutId:{type:String,default:void 0},layoutScroll:{type:Boolean,default:!1},layoutRoot:{type:Boolean,default:!1},"data-framer-portal-id":{type:String},crossfade:{type:Boolean,default:!0},layoutDependency:{type:null,default:void 0},onBeforeLayoutMeasure:{type:Function},onLayoutMeasure:{type:Function},onLayoutAnimationStart:{type:Function},onLayoutAnimationComplete:{type:Function},globalPressTarget:{type:Boolean},onPressStart:{type:Function},onPress:{type:Function},onPressCancel:{type:Function},onHoverStart:{type:Function},onHoverEnd:{type:Function},inViewOptions:{type:Object},onViewportEnter:{type:Function},onViewportLeave:{type:Function},drag:{type:[Boolean,String]},dragSnapToOrigin:{type:Boolean},dragDirectionLock:{type:Boolean},dragPropagation:{type:Boolean},dragConstraints:{type:[Boolean,Object]},dragElastic:{type:[Boolean,Number,Object],default:.5},dragMomentum:{type:Boolean,default:!0},dragTransition:{type:Object},dragListener:{type:Boolean,default:!0},dragControls:{type:Object},onDragStart:{type:Function},onDragEnd:{type:Function},onDrag:{type:Function},onDirectionLock:{type:Function},onDragTransitionEnd:{type:Function},onMeasureDragConstraints:{type:Function},onPanSessionStart:{type:Function},onPanStart:{type:Function},onPan:{type:Function},onPanEnd:{type:Function}};function zc(t){var e;const n=((e=re(t.$el))==null?void 0:e.style.display)==="none";return t.$.vnode.transition&&n}const Hc=new Map,Yc=new Map;function Xc(t){if(!Array.isArray(t))return[t];const e=[];for(const n of t)Array.isArray(n)?e.push(...n):e.push(n);return e}const qc=["area","img","input"];function Zc(t,e,n){var i,s;if(typeof t=="string"&&qc.includes(t))return y.h(t,e);if(t==="template"){if(!n.default)return null;const r=Xc(n.default()),o=r.findIndex(u=>u.type!==y.Comment);if(o===-1)return r;const a=r[o];(i=a.props)==null||delete i.ref;const l=a.props?y.mergeProps(e,a.props):e;e.class&&((s=a.props)!=null&&s.class)&&delete a.props.class;const c=y.cloneVNode(a,l);for(const u in l)u.startsWith("on")&&(c.props||(c.props={}),c.props[u]=l[u]);return r.length===1?c:(r[o]=c,r)}return null}function Co(t,e={}){var n;const i=typeof t=="string",s=i?t:t.name||"",r=((n=e.features)==null?void 0:n.length)>0?Hc:Yc;if(i&&(r!=null&&r.has(t)))return r.get(t);const o=y.defineComponent({inheritAttrs:!1,props:V(g({},Gc),{features:{type:Object,default:()=>e.features||[]},as:{type:[String,Object],default:t||"div"}}),name:s?`motion.${s}`:"Motion",setup(a,{slots:l}){const{getProps:c,getAttrs:u,state:h}=Wc(a);function d(){const f=h.element;if((!(typeof a.as=="object")||a.asChild)&&f){const{style:m}=u();if(m)for(const[v,b]of Object.entries(m))f.style[v]=b}}return()=>{const f=c(),p=u(),m=a.asChild?"template":a.as,v=V(g(g({},e.forwardMotionProps||a.forwardMotionProps?f:{}),p),{onVnodeUpdated:d}),b=Zc(m,v,l);return b!==null?b:y.h(m,g({},v),l)}}});return i&&(r==null||r.set(t,o)),o}function Jc(t=[]){return new Proxy({},{get(e,n){return n==="create"?(i,s)=>Co(i,V(g({},s),{features:t})):Co(n,{features:t})}})}const Mo=Jc(Ic);Mo.create("div");function Qc(t){function e(l){return t.modelValue.value===l.value}function n(l){return t.disabled.value||!!l.disabled}function i(l){n(l)||e(l)||t.onSelect(l.value)}function s(){const l=t.items.value,c=l.findIndex(u=>u.value===t.modelValue.value);return c>=0&&!n(l[c])?c:l.findIndex(u=>!n(u))}function r(l){const c=s();return c<0?-1:l===c?0:-1}function o(l,c){const u=t.items.value;let h=l;for(let d=0;d<u.length;d++)if(h=(h+c+u.length)%u.length,!n(u[h]))return h;return l}function a(l,c){var p;const u=t.items.value,h=u[c];if(!h||n(h))return;let d=null;switch(l.key){case"ArrowRight":case"ArrowDown":d=o(c,1);break;case"ArrowLeft":case"ArrowUp":d=o(c,-1);break;case"Home":d=u.findIndex(m=>!n(m));break;case"End":d=[...u].reverse().findIndex(m=>!n(m)),d>=0&&(d=u.length-1-d);break;default:return}if(d===null||d<0||d===c)return;l.preventDefault();const f=u[d];f&&(i(f),(p=t.focusIndex)==null||p.call(t,d))}return{isSelected:e,isSegmentDisabled:n,select:i,getTabIndex:r,onKeydown:a}}const th=["aria-label","aria-disabled"],eh=["aria-checked","aria-label","tabindex","disabled","onClick","onKeydown"],nh=y.defineComponent({__name:"index",props:{items:{},modelValue:{},size:{default:"m"},fullWidth:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},ui:{default:()=>({})},ariaLabel:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=y.toRef(n,"items"),r=y.toRef(n,"modelValue"),o=y.toRef(n,"disabled"),a=y.ref([]);function l(w,T){a.value[T]=w}const{isSelected:c,isSegmentDisabled:u,select:h,getTabIndex:d,onKeydown:f}=Qc({items:s,modelValue:r,disabled:o,onSelect:w=>i("update:modelValue",w),focusIndex:w=>{var T;return(T=a.value[w])==null?void 0:T.focus()}}),p=y.computed(()=>{const w=n.items.findIndex(T=>T.value===n.modelValue);return w>=0?w:0}),m=y.computed(()=>{const w=n.items.length;if(w!==0)return n.fullWidth?`repeat(${w}, minmax(0, 1fr))`:`repeat(${w}, auto)`}),v=y.computed(()=>["segmented-control",n.size==="s"?"segmented-control--s":"segmented-control--m",n.fullWidth&&"segmented-control--full-width",n.ui.root]);function b(w){return["segmented-control__segment",c(w)&&"segmented-control__segment--selected",c(w)?n.ui.segmentSelected:n.ui.segment].filter(Boolean)}function A(w){return["segmented-control__label",c(w)&&"segmented-control__label--selected",c(w)?n.ui.labelSelected:n.ui.label].filter(Boolean)}const S={type:"spring",visualDuration:.2,bounce:.2};return(w,T)=>(y.openBlock(),y.createElementBlock("div",{"data-testid":"segmented-control",role:"radiogroup",class:y.normalizeClass(v.value),style:y.normalizeStyle(m.value?{gridTemplateColumns:m.value}:void 0),"aria-label":t.ariaLabel,"aria-disabled":t.disabled||void 0},[t.items.length>0?(y.openBlock(),y.createBlock(y.unref(Mo).div,{key:0,layout:"","data-testid":"segmented-control-indicator","data-state":t.modelValue,class:y.normalizeClass(["segmented-control__indicator",t.ui.indicator]),style:y.normalizeStyle({gridColumn:p.value+1,gridRow:1}),transition:S,"aria-hidden":"true"},null,8,["data-state","class","style"])):y.createCommentVNode("",!0),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.items,(P,C)=>(y.openBlock(),y.createElementBlock("button",{key:P.value,ref_for:!0,ref:E=>l(E,C),type:"button",role:"radio","data-testid":"segmented-control-segment",class:y.normalizeClass(b(P)),style:y.normalizeStyle({gridColumn:C+1,gridRow:1}),"aria-checked":y.unref(c)(P),"aria-label":P.label,tabindex:y.unref(d)(C),disabled:y.unref(u)(P),onClick:E=>y.unref(h)(P),onKeydown:E=>y.unref(f)(E,C)},[y.createElementVNode("span",{"data-testid":"segmented-control-label",class:y.normalizeClass(A(P))},y.toDisplayString(P.label),3)],46,eh))),128))],14,th))}});D.AzSegmentedControl=nh,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});