framer-motion 12.35.0 → 12.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/dom.js +1 -1
- package/dist/cjs/dom.js.map +1 -1
- package/dist/cjs/{feature-bundle-jADFMKLx.js → feature-bundle-DqHxNjy5.js} +14 -4
- package/dist/cjs/feature-bundle-DqHxNjy5.js.map +1 -0
- package/dist/cjs/index.js +77 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/dom-mini.d.ts +17 -5
- package/dist/dom-mini.js +1 -1
- package/dist/dom.d.ts +18 -6
- package/dist/dom.js +1 -1
- package/dist/es/components/AnimatePresence/PopChild.mjs +4 -3
- package/dist/es/components/AnimatePresence/PopChild.mjs.map +1 -1
- package/dist/es/events/event-info.mjs +1 -3
- package/dist/es/events/event-info.mjs.map +1 -1
- package/dist/es/gestures/pan/PanSession.mjs +12 -0
- package/dist/es/gestures/pan/PanSession.mjs.map +1 -1
- package/dist/es/index.mjs +1 -0
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/render/dom/scroll/info.mjs +1 -1
- package/dist/es/render/dom/scroll/info.mjs.map +1 -1
- package/dist/es/utils/transform-rotated-parent.mjs +72 -0
- package/dist/es/utils/transform-rotated-parent.mjs.map +1 -0
- package/dist/framer-motion.dev.js +294 -88
- package/dist/framer-motion.js +1 -1
- package/dist/mini.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-animate.js.map +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-m.js.map +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-motion.js.map +1 -1
- package/dist/size-rollup-scroll.js +1 -1
- package/dist/size-rollup-scroll.js.map +1 -1
- package/dist/size-rollup-waapi-animate.js +1 -1
- package/dist/size-rollup-waapi-animate.js.map +1 -1
- package/dist/types/index.d.ts +50 -6
- package/package.json +3 -3
- package/dist/cjs/feature-bundle-jADFMKLx.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(t,e,s)=>s>e?e:s<t?t:s;function e(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const u=t=>1e3*t,c=t=>t/1e3;function d(t,e){return e?t*(1e3/e):0}const p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{a=t,n?i=!0:(n=!0,[e,s]=[s,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t)))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:g}=o,v=()=>{const a=i.useManualTiming?r.timestamp:performance.now();s=!1,i.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(v))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(v)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e<f.length;e++)o[f[e]].cancel(t)},state:r,steps:o}}const{schedule:g,cancel:v,state:y}=m("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:h,!0);let b;function w(){b=void 0}const V={now:()=>(void 0===b&&V.set(y.isProcessing||i.useManualTiming?y.timestamp:performance.now()),b),set:t=>{b=t,queueMicrotask(w)}},S=t=>e=>"string"==typeof e&&e.startsWith(t),M=S("--"),T=S("var(--"),A=t=>!!T(t)&&C.test(t.split("/*")[0].trim()),C=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function k(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},F={...x,transform:e=>t(0,1,e)},E={...x,default:1},B=t=>Math.round(1e5*t)/1e5,P=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const R=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I=(t,e)=>s=>Boolean("string"==typeof s&&R.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),N=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(P);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},O={...x,transform:e=>Math.round((e=>t(0,255,e))(e))},$={test:I("rgb","red"),parse:N("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+O.transform(t)+", "+O.transform(e)+", "+O.transform(s)+", "+B(F.transform(n))+")"};const L={test:I("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:$.transform},Y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),W=Y("deg"),X=Y("%"),j=Y("px"),K=Y("vh"),U=Y("vw"),Z=(()=>({...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(100*t)}))(),z={test:I("hsl","hue"),parse:N("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+X.transform(B(e))+", "+X.transform(B(s))+", "+B(F.transform(n))+")"},D={test:t=>$.test(t)||L.test(t)||z.test(t),parse:t=>$.test(t)?$.parse(t):z.test(t)?z.parse(t):L.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?$.transform(t):z.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const H="number",_="color",G=/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 J(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(G,t=>(D.test(t)?(n.color.push(r),i.push(_),s.push(D.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(H),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function Q(t){return J(t).values}function tt(t){const{split:e,types:s}=J(t),n=e.length;return t=>{let i="";for(let r=0;r<n;r++)if(i+=e[r],void 0!==t[r]){const e=s[r];i+=e===H?B(t[r]):e===_?D.transform(t[r]):t[r]}return i}}const et=t=>"number"==typeof t?0:D.test(t)?D.getAnimatableNone(t):t;const st={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(P)?.length||0)+(t.match(q)?.length||0)>0},parse:Q,createTransformer:tt,getAnimatableNone:function(t){const e=Q(t);return tt(t)(e.map(et))}},nt=(t,e,s)=>t+(e-t)*s,it=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},rt=t=>null!==t;function at(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(rt),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class ot{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ht=t=>180*t/Math.PI,lt=t=>{const e=ht(Math.atan2(t[1],t[0]));return ct(e)},ut={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:lt,rotateZ:lt,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},ct=t=>((t%=360)<0&&(t+=360),t),dt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),pt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ft={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dt,scaleY:pt,scale:t=>(dt(t)+pt(t))/2,rotateX:t=>ct(ht(Math.atan2(t[6],t[5]))),rotateY:t=>ct(ht(Math.atan2(-t[2],t[0]))),rotateZ:lt,rotate:lt,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 mt(t){return t.includes("scale")?1:0}function gt(t,e){if(!t||"none"===t)return mt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=ft,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ut,i=e}if(!i)return mt(e);const r=n[e],a=i[1].split(",").map(yt);return"function"==typeof r?r(a):a[r]}const vt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return gt(s,e)};function yt(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wt=(()=>new Set(bt))(),Vt=t=>t===x||t===j,St=new Set(["x","y","z"]),Mt=bt.filter(t=>!St.has(t));const Tt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>gt(e,"x"),y:(t,{transform:e})=>gt(e,"y")};Tt.translateX=Tt.x,Tt.translateY=Tt.y;const At=new Set;let Ct=!1,kt=!1,xt=!1;function Ft(){if(kt){const t=Array.from(At).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return Mt.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}kt=!1,Ct=!1,At.forEach(t=>t.complete(xt)),At.clear()}function Et(){At.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(kt=!0)})}function Bt(){xt=!0,Et(),Ft(),xt=!1}class Pt{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(At.add(this),Ct||(Ct=!0,g.read(Et),g.resolveKeyframes(Ft))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),At.delete(this)}cancel(){"scheduled"===this.state&&(At.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Rt={};function It(t,e){const s=o(t);return()=>Rt[e]??s()}const Nt=It(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ot=It(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$t=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Lt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$t([0,.65,.55,1]),circOut:$t([.55,0,1,.45]),backIn:$t([.31,.01,.66,-.59]),backOut:$t([.33,1.53,.69,.99])};function Yt(t,e){return t?"function"==typeof t?Ot()?it(t,e):"ease-out":p(t)?$t(t):Array.isArray(t)?t.map(t=>Yt(t,e)||Lt.easeOut):Lt[t]:void 0}function Wt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Yt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Xt(t){return"function"==typeof t&&"applyToOptions"in t}class jt extends ot{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Xt(t)&&Ot()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Wt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=at(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Nt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),h):n(this)}}function Kt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ut(t,e,s,n){if("function"==typeof e){const[i,r]=Kt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Kt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class Zt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=V.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=V.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new l);const s=this.events[t].add(e);return"change"===t?()=>{s(),g.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=V.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zt(t,e){return new Zt(t,e)}const Dt=t=>Boolean(t&&t.getVelocity);function qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ht="data-"+qt("framerAppearId"),_t=t=>e=>e.test(t),Gt=[x,j,X,W,U,K,{test:t=>"auto"===t,parse:t=>t}],Jt=t=>Gt.find(_t(t)),Qt=new Set(["brightness","contrast","saturate","opacity"]);function te(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(P)||[];if(!n)return t;const i=s.replace(n,"");let r=Qt.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ee=/\b([a-z-]*)\(.*?\)/gu,se={...st,getAnimatableNone:t=>{const e=t.match(ee);return e?e.map(te).join(" "):t}},ne={...st,getAnimatableNone:t=>{const e=st.parse(t);return st.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ie={...x,transform:Math.round},re={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...{rotate:W,rotateX:W,rotateY:W,rotateZ:W,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:W,skewX:W,skewY:W,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:F,originX:Z,originY:Z,originZ:j},zIndex:ie,fillOpacity:F,strokeOpacity:F,numOctaves:ie},ae={...re,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:se,WebkitFilter:se,mask:ne,WebkitMask:ne},oe=t=>ae[t],he=new Set([se,ne]);function le(t,e){let s=oe(t);return he.has(s)||(s=st),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ue=new Set(["opacity","clipPath","filter","transform"]),ce=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:de}=m(queueMicrotask,!1),pe=[...Gt,D,st],fe=()=>({x:{min:0,max:0},y:{min:0,max:0}}),me=new WeakMap;function ge(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ve(t){return"string"==typeof t||Array.isArray(t)}const ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],be=["initial",...ye];function we(t){return ge(t.animate)||be.some(e=>ve(t[e]))}function Ve(t){return Boolean(we(t)||t.variants)}const Se={current:null},Me={current:!1},Te="undefined"!=typeof window;const Ae=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ce={};function ke(t){Ce=t}function xe(){return Ce}class Fe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Pt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=V.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,g.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=we(e),this.isVariantNode=Ve(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Dt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,me.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Me.current||function(){if(Me.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Se.current=t.matches;t.addEventListener("change",e),e()}else Se.current=!1}(),this.shouldReduceMotion=Se.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),v(this.notifyUpdate),v(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ue.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new jt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=wt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&g.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ce){const e=Ce[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ae.length;e++){const s=Ae[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],r=s[n];if(Dt(i))t.addValue(n,i);else if(Dt(r))t.addValue(n,zt(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,zt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=zt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!pe.find(_t(n))&&st.test(e)&&(s=le(t,e))),this.setBaseTarget(t,Dt(s)?s.get():s)),Dt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ut(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Dt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){de.render(this.render)}}const Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Be=bt.length;function Pe(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(wt.has(t))a=!0;else if(M(t))i[t]=s;else{const e=ce(s,re[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r<Be;r++){const a=bt[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||s){const t=ce(o,re[a]);h||(i=!1,n+=`${Ee[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=r;n.transformOrigin=`${t} ${e} ${s}`}}function Re(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ie={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!j.test(t))return t;t=parseFloat(t)}return`${Re(t,e.target.x)}% ${Re(t,e.target.y)}%`}},Ne={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=st.parse(t);if(i.length>5)return n;const r=st.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=nt(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Oe={borderRadius:{...Ie,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,boxShadow:Ne};function $e(t,{layout:e,layoutId:s}){return wt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Oe[t]||"opacity"===t)}function Le(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Dt(n[e])||i&&Dt(i[e])||$e(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},We={offset:"strokeDashoffset",array:"strokeDasharray"};const Xe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function je(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Pe(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of Xe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ye:We;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const Ke=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ue(t,e,s){const n=Le(t,e,s);for(const s in t)if(Dt(t[s])||Dt(e[s])){n[-1!==bt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ze=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ze(t){return"string"==typeof t&&!t.includes("-")&&!!(Ze.indexOf(t)>-1||/[A-Z]/u.test(t))}export{Tt as $,st as A,J as B,y as C,V as D,v as E,g as F,c as G,d as H,u as I,t as J,it as K,at as L,i as M,jt as N,Xt as O,o as P,Pt as Q,Bt as R,r as S,wt as T,bt as U,zt as V,ot as W,a as X,le as Y,Jt as Z,k as _,we as a,Vt as a0,Fe as a1,mt as a2,vt as a3,M as a4,qt as a5,fe as a6,oe as a7,be as a8,ye as a9,ve as b,$e as c,Pe as d,je as e,Ke as f,ze as g,Ve as h,Dt as i,ge as j,Ue as k,xe as l,ke as m,h as n,Ht as o,p,n as q,Ut as r,Le as s,nt as t,$ as u,z as v,L as w,s as x,A as y,D as z};
|
|
1
|
+
const t=(t,e,s)=>s>e?e:s<t?t:s;function e(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const u=t=>1e3*t,c=t=>t/1e3;function d(t,e){return e?t*(1e3/e):0}const p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{a=t,n?i=!0:(n=!0,[e,s]=[s,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t)))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:g}=o,v=()=>{const a=i.useManualTiming?r.timestamp:performance.now();s=!1,i.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(v))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(v)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e<f.length;e++)o[f[e]].cancel(t)},state:r,steps:o}}const{schedule:g,cancel:v,state:y}=m("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:h,!0);let b;function w(){b=void 0}const V={now:()=>(void 0===b&&V.set(y.isProcessing||i.useManualTiming?y.timestamp:performance.now()),b),set:t=>{b=t,queueMicrotask(w)}},S=t=>e=>"string"==typeof e&&e.startsWith(t),M=S("--"),T=S("var(--"),A=t=>!!T(t)&&C.test(t.split("/*")[0].trim()),C=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function k(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},F={...x,transform:e=>t(0,1,e)},E={...x,default:1},B=t=>Math.round(1e5*t)/1e5,P=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const R=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I=(t,e)=>s=>Boolean("string"==typeof s&&R.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),N=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(P);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},O={...x,transform:e=>Math.round((e=>t(0,255,e))(e))},$={test:I("rgb","red"),parse:N("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+O.transform(t)+", "+O.transform(e)+", "+O.transform(s)+", "+B(F.transform(n))+")"};const L={test:I("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:$.transform},Y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),W=Y("deg"),X=Y("%"),j=Y("px"),K=Y("vh"),U=Y("vw"),Z=(()=>({...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(100*t)}))(),z={test:I("hsl","hue"),parse:N("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+X.transform(B(e))+", "+X.transform(B(s))+", "+B(F.transform(n))+")"},D={test:t=>$.test(t)||L.test(t)||z.test(t),parse:t=>$.test(t)?$.parse(t):z.test(t)?z.parse(t):L.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?$.transform(t):z.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const H="number",_="color",G=/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 J(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(G,t=>(D.test(t)?(n.color.push(r),i.push(_),s.push(D.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(H),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function Q({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=t[r],void 0!==n[r]){const t=e[r];i+=t===H?B(n[r]):t===_?D.transform(n[r]):n[r]}return i}}const tt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:D.test(s)?D.getAnimatableNone(s):s;var s};const et={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(P)?.length||0)+(t.match(q)?.length||0)>0},parse:function(t){return J(t).values},createTransformer:function(t){return Q(J(t))},getAnimatableNone:function(t){const e=J(t);return Q(e)(e.values.map((t,s)=>tt(t,e.split[s])))}},st=(t,e,s)=>t+(e-t)*s,nt=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},it=t=>null!==t;function rt(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(it),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class at{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ot=t=>180*t/Math.PI,ht=t=>{const e=ot(Math.atan2(t[1],t[0]));return ut(e)},lt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ht,rotateZ:ht,skewX:t=>ot(Math.atan(t[1])),skewY:t=>ot(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ut=t=>((t%=360)<0&&(t+=360),t),ct=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),dt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),pt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ct,scaleY:dt,scale:t=>(ct(t)+dt(t))/2,rotateX:t=>ut(ot(Math.atan2(t[6],t[5]))),rotateY:t=>ut(ot(Math.atan2(-t[2],t[0]))),rotateZ:ht,rotate:ht,skewX:t=>ot(Math.atan(t[4])),skewY:t=>ot(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ft(t){return t.includes("scale")?1:0}function mt(t,e){if(!t||"none"===t)return ft(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=pt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lt,i=e}if(!i)return ft(e);const r=n[e],a=i[1].split(",").map(vt);return"function"==typeof r?r(a):a[r]}const gt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return mt(s,e)};function vt(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=(()=>new Set(yt))(),wt=t=>t===x||t===j,Vt=new Set(["x","y","z"]),St=yt.filter(t=>!Vt.has(t));const Mt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>mt(e,"x"),y:(t,{transform:e})=>mt(e,"y")};Mt.translateX=Mt.x,Mt.translateY=Mt.y;const Tt=new Set;let At=!1,Ct=!1,kt=!1;function xt(){if(Ct){const t=Array.from(Tt).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return St.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ct=!1,At=!1,Tt.forEach(t=>t.complete(kt)),Tt.clear()}function Ft(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ct=!0)})}function Et(){kt=!0,Ft(),xt(),kt=!1}class Bt{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Tt.add(this),At||(At=!0,g.read(Ft),g.resolveKeyframes(xt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Tt.delete(this)}cancel(){"scheduled"===this.state&&(Tt.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Pt(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Rt={};function It(t,e){const s=o(t);return()=>Rt[e]??s()}const Nt=It(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ot=It(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$t=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Lt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$t([0,.65,.55,1]),circOut:$t([.55,0,1,.45]),backIn:$t([.31,.01,.66,-.59]),backOut:$t([.33,1.53,.69,.99])};function Yt(t,e){return t?"function"==typeof t?Ot()?nt(t,e):"ease-out":p(t)?$t(t):Array.isArray(t)?t.map(t=>Yt(t,e)||Lt.easeOut):Lt[t]:void 0}function Wt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Yt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Xt(t){return"function"==typeof t&&"applyToOptions"in t}class jt extends at{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Xt(t)&&Ot()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Wt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=rt(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Pt(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Nt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),h):n(this)}}function Kt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ut(t,e,s,n){if("function"==typeof e){const[i,r]=Kt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Kt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class Zt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=V.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=V.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new l);const s=this.events[t].add(e);return"change"===t?()=>{s(),g.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=V.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zt(t,e){return new Zt(t,e)}const Dt=t=>Boolean(t&&t.getVelocity);function qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ht="data-"+qt("framerAppearId"),_t=t=>e=>e.test(t),Gt=[x,j,X,W,U,K,{test:t=>"auto"===t,parse:t=>t}],Jt=t=>Gt.find(_t(t)),Qt=new Set(["brightness","contrast","saturate","opacity"]);function te(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(P)||[];if(!n)return t;const i=s.replace(n,"");let r=Qt.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ee=/\b([a-z-]*)\(.*?\)/gu,se={...et,getAnimatableNone:t=>{const e=t.match(ee);return e?e.map(te).join(" "):t}},ne={...et,getAnimatableNone:t=>{const e=et.parse(t);return et.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ie={...x,transform:Math.round},re={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...{rotate:W,rotateX:W,rotateY:W,rotateZ:W,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:W,skewX:W,skewY:W,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:F,originX:Z,originY:Z,originZ:j},zIndex:ie,fillOpacity:F,strokeOpacity:F,numOctaves:ie},ae={...re,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:se,WebkitFilter:se,mask:ne,WebkitMask:ne},oe=t=>ae[t],he=new Set([se,ne]);function le(t,e){let s=oe(t);return he.has(s)||(s=et),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ue=new Set(["opacity","clipPath","filter","transform"]),ce=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:de}=m(queueMicrotask,!1),pe=[...Gt,D,et],fe=()=>({x:{min:0,max:0},y:{min:0,max:0}}),me=new WeakMap;function ge(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ve(t){return"string"==typeof t||Array.isArray(t)}const ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],be=["initial",...ye];function we(t){return ge(t.animate)||be.some(e=>ve(t[e]))}function Ve(t){return Boolean(we(t)||t.variants)}const Se={current:null},Me={current:!1},Te="undefined"!=typeof window;const Ae=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ce={};function ke(t){Ce=t}function xe(){return Ce}class Fe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Bt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=V.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,g.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=we(e),this.isVariantNode=Ve(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Dt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,me.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Me.current||function(){if(Me.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Se.current=t.matches;t.addEventListener("change",e),e()}else Se.current=!1}(),this.shouldReduceMotion=Se.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),v(this.notifyUpdate),v(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ue.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new jt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&g.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ce){const e=Ce[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ae.length;e++){const s=Ae[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],r=s[n];if(Dt(i))t.addValue(n,i);else if(Dt(r))t.addValue(n,zt(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,zt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=zt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!pe.find(_t(n))&&et.test(e)&&(s=le(t,e))),this.setBaseTarget(t,Dt(s)?s.get():s)),Dt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ut(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Dt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){de.render(this.render)}}const Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Be=yt.length;function Pe(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(bt.has(t))a=!0;else if(M(t))i[t]=s;else{const e=ce(s,re[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r<Be;r++){const a=yt[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||s){const t=ce(o,re[a]);h||(i=!1,n+=`${Ee[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=r;n.transformOrigin=`${t} ${e} ${s}`}}function Re(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ie={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!j.test(t))return t;t=parseFloat(t)}return`${Re(t,e.target.x)}% ${Re(t,e.target.y)}%`}},Ne={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=et.parse(t);if(i.length>5)return n;const r=et.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=st(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Oe={borderRadius:{...Ie,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,boxShadow:Ne};function $e(t,{layout:e,layoutId:s}){return bt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Oe[t]||"opacity"===t)}function Le(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Dt(n[e])||i&&Dt(i[e])||$e(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},We={offset:"strokeDashoffset",array:"strokeDasharray"};const Xe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function je(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Pe(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of Xe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ye:We;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const Ke=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ue(t,e,s){const n=Le(t,e,s);for(const s in t)if(Dt(t[s])||Dt(e[s])){n[-1!==yt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ze=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ze(t){return"string"==typeof t&&!t.includes("-")&&!!(Ze.indexOf(t)>-1||/[A-Z]/u.test(t))}export{k as $,et as A,J as B,y as C,V as D,v as E,g as F,c as G,t as H,nt as I,u as J,d as K,rt as L,i as M,jt as N,Pt as O,Xt as P,o as Q,Bt as R,Et as S,r as T,bt as U,yt as V,at as W,zt as X,a as Y,le as Z,Jt as _,we as a,Mt as a0,wt as a1,Fe as a2,ft as a3,gt as a4,M as a5,qt as a6,fe as a7,oe as a8,be as a9,ye as aa,ve as b,$e as c,Pe as d,je as e,Ke as f,ze as g,Ve as h,Dt as i,ge as j,Ue as k,xe as l,ke as m,h as n,Ht as o,p,n as q,Ut as r,Le as s,st as t,$ as u,z as v,L as w,s as x,A as y,D as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as T,M as b,W as A,L as x,N as S,O as k,P as M,Q as C,R as V,S as E,T as P,r as D,U as O,V as F,i as I,o as L,X as K,Y as R,Z as B,_ as j,$ as q,a0 as N,a1 as U,a2 as H,a3 as $,a4 as W,d as G,s as _,a5 as z,a6 as Y,k as X,e as J,f as Z,a7 as Q,b as tt,a8 as et,j as nt,a9 as it,g as st}from"./size-rollup-dom-animation-assets.js";import{Fragment as rt}from"react";const ot=(t,e)=>n=>e(t(n)),at=(...t)=>t.reduce(ot),ut=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},lt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ct(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=lt(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:lt(r(t),n,s)}const ht=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,dt=t=>e=>1-t(1-e),pt=ct(.33,1.53,.69,.99),mt=dt(pt),ft=ht(mt),yt=t=>(t*=2)<1?.5*mt(t):.5*(2-Math.pow(2,-10*(t-1))),vt=t=>1-Math.sin(Math.acos(t)),gt=dt(vt),wt=ht(vt),Tt=ct(.42,0,1,1),bt=ct(0,0,.58,1),At=ct(.42,0,.58,1),xt={linear:t,easeIn:Tt,easeInOut:At,easeOut:bt,circIn:vt,circInOut:wt,circOut:gt,backIn:mt,backInOut:ft,backOut:pt,anticipate:yt},St=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return ct(e,i,s,r)}return"string"==typeof t?(n(void 0!==xt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),xt[t]):t};function kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Mt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Vt=[o,s,r];function Et(t){const e=(n=t,Vt.find(t=>t.test(n)));var n;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===r&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=kt(a,i,t+1/3),r=kt(a,i,t),o=kt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Pt=(t,e)=>{const n=Et(t),r=Et(e);if(!n||!r)return Mt(t,e);const o={...n};return t=>(o.red=Ct(n.red,r.red,t),o.green=Ct(n.green,r.green,t),o.blue=Ct(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},Dt=new Set(["none","hidden"]);function Ot(t,e){return n=>i(t,e,n)}function Ft(t){return"number"==typeof t?Ot:"string"==typeof t?u(t)?Mt:l.test(t)?Pt:Kt:Array.isArray(t)?It:"object"==typeof t?l.test(t)?Pt:Lt:Mt}function It(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Ft(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Lt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Ft(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Kt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(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?Dt.has(t)&&!s.values.length||Dt.has(e)&&!i.values.length?function(t,e){return Dt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):at(It(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(a(!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"),Mt(t,e))};function Rt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return i(t,e,n);return Ft(t)(t,e)}const Bt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},jt=2e4;function qt(t){let e=0;let n=t.next(e);for(;!n.done&&e<jt;)e+=50,n=t.next(e);return e>=jt?1/0:e}function Nt(t,e,n){const i=Math.max(e-5,0);return v(n-t(i),e-i)}const Ut=100,Ht=10,$t=1,Wt=0,Gt=800,_t=.3,zt=.3,Yt={granular:.01,default:2},Xt={granular:.005,default:.5},Jt=.01,Zt=10,Qt=.05,te=1,ee=.001;function ne({duration:t=Gt,bounce:e=_t,velocity:n=Wt,mass:i=$t}){let s,r;a(t<=g(Zt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=w(Qt,te,o),t=w(Jt,Zt,y(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=se(e,o),u=Math.exp(-s);return ee-r/a*u},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=se(Math.pow(e,2),o);return(-s(e)+ee>0?-1:1)*((r-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let i=n;for(let n=1;n<ie;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=g(t),isNaN(u))return{stiffness:Ut,damping:Ht,duration:t};{const e=Math.pow(u,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}const ie=12;function se(t,e){return t*Math.sqrt(1-e*e)}const re=["duration","bounce"],oe=["stiffness","damping","mass"];function ae(t,e){return e.some(e=>void 0!==t[e])}function ue(t=zt,e=_t){const n="object"!=typeof t?{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:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Wt,stiffness:Ut,damping:Ht,mass:$t,isResolvedFromDuration:!1,...t};if(!ae(t,oe)&&ae(t,re))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*w(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:$t,stiffness:s,damping:r}}else{const n=ne({...t,velocity:0});e={...e,...n,mass:$t},e.isResolvedFromDuration=!0}return e}({...n,velocity:-y(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),v=o-r,b=y(Math.sqrt(u/c)),A=Math.abs(v)<5;let x;if(i||(i=A?Yt.granular:Yt.default),s||(s=A?Xt.granular:Xt.default),f<1){const t=se(b,f);x=e=>{const n=Math.exp(-f*b*e);return o-n*((m+f*b*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>o-Math.exp(-b*t)*(v+(m+b*v)*t);else{const t=b*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*b*e),i=Math.min(t*e,300);return o-n*((m+f*b*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const S={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0===t?m:0;f<1&&(n=0===t?g(m):Nt(x,t,e));const r=Math.abs(n)<=i,u=Math.abs(o-e)<=s;a.done=r&&u}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(qt(S),jt),e=T(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function le({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=h+m,y=void 0===o?f:o(f);y!==f&&(m=y-h);const v=t=>-m*Math.exp(-t/i),g=t=>y+v(t),w=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let T,b;const A=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(T=t,b=ue({keyframes:[d.value,p(d.value)],velocity:Nt(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return A(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==T||(e=!0,w(t),A(t)),void 0!==T&&t>=T?b.next(t-T):(!e&&w(t),d)}}}function ce(e,i,{clamp:s=!0,ease:r,mixer:o}={}){const a=e.length;if(n(a===i.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const u=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const l=function(e,n,i){const s=[],r=i||b.mix||Rt,o=e.length-1;for(let i=0;i<o;i++){let o=r(e[i],e[i+1]);if(n){const e=Array.isArray(n)?n[i]||t:n;o=at(e,o)}s.push(o)}return s}(i,r,o),c=l.length,h=t=>{if(u&&t<e[0])return i[0];let n=0;if(c>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=ut(e[n],e[n+1],t);return l[n](s)};return s?t=>h(w(e[0],e[a-1],t)):h}function he(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=ut(0,e,s);t.push(i(n,1,r))}}(e,t.length-1),e}function de({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(St):St(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:he(e),t),a=ce(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||At).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}ue.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(qt(i),jt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}(t,100,ue);return t.ease=e.ease,t.duration=g(e.duration),t.type="keyframes",t};const pe={decay:le,inertia:le,tween:de,keyframes:de,spring:ue};function me(t){"string"==typeof t.type&&(t.type=pe[t.type])}const fe=t=>t/100;class ye extends A{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;me(t);const{type:e=de,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||de;a!==de&&"number"!=typeof o[0]&&(this.mixKeyframes=at(fe,Rt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=qt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let g=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(T=r)),g=w(0,1,n)*o}const b=v?{done:!1,value:l[0]}:T.next(g);s&&(b.value=s(b.value));let{done:A}=b;v||null===a||(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&A);return S&&p!==le&&(b.value=x(l,this.options,f,this.speed)),m&&m(b.value),S&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=g(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(p.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Bt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(p.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ve={anticipate:yt,backInOut:ft,circInOut:wt};function ge(t){"string"==typeof t.ease&&t.ease in ve&&(t.ease=ve[t.ease])}class we extends S{constructor(t){ge(t),me(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ye({...r,autoplay:!1}),a=Math.max(10,p.now()-this.startTime),u=w(0,10,a-10);e.setWithVelocity(o.sample(Math.max(0,a-u)).value,o.sample(a).value,u),o.stop()}}const Te=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function be(t){t.duration=0,t.type="keyframes"}const Ae=new Set(["opacity","clipPath","filter","transform"]),xe=M(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Se extends A{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=p.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||C;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:u,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=p.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Te(s,e),u=Te(r,e);return a(o===u,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!(!o||!u)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||k(n))&&i)}(e,r,o,u)||(!b.instantAnimations&&l||h?.(x(e,i,n)),e[0]=e[e.length-1],be(i),i.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!c&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return xe()&&n&&Ae.has(n)&&("transform"!==n||!l)&&!u&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(d),f=d.motionValue?.owner?.current,y=m?new we({...d,element:f}):new ye(d);y.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),V()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ke(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}const Me=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ce(t,e,i=1){n(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=Me.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return E(t)?parseFloat(t):t}return u(r)?Ce(r,e,i+1):r}const Ve={type:"spring",stiffness:500,damping:25,restSpeed:10},Ee={type:"keyframes",duration:.8},Pe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},De=(t,{keyframes:e})=>e.length>2?Ee:P.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ve:Pe,Oe=t=>null!==t;function Fe(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ie(t,e){const n=t?.[e]??t?.default??t;return n!==t?Fe(n,t):n}const Le=(t,e,n,i={},s,r)=>o=>{const a=Ie(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=g(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,De(t,c)),c.duration&&(c.duration=g(c.duration)),c.repeatDelay&&(c.repeatDelay=g(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(be(c),0===c.delay&&(h=!0)),(b.instantAnimations||b.skipAnimations||s?.shouldSkipAnimations)&&(h=!0,be(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const i=t.filter(Oe);return i[e&&"loop"!==n&&e%2==1?0:i.length-1]}(c.keyframes,a);if(void 0!==t)return void f.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ye(c):new Se(c)};function Ke(t,e,n){const i=t.getProps();return D(i,e,void 0!==n?n:i.custom,t)}const Re=new Set(["width","height","top","left","right","bottom",...O]),Be=t=>Array.isArray(t);function je(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,F(n))}function qe(t){return Be(t)?t[t.length-1]||0:t}function Ne(t,e){const n=t.getValue("willChange");if(i=n,Boolean(I(i)&&i.add))return n.add(e);if(!n&&b.WillChange){const n=new b.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ue(t){return t.props[L]}function He({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function $e(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Fe(r,u):u;const l=r?.reduceMotion;i&&(r=i);const c=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&He(h,e))continue;const o={delay:n,...Ie(r||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=Ue(t);if(n){const t=window.MotionHandoffAnimation(n,e,f);null!==t&&(o.startTime=t,d=!0)}}Ne(t,e);const p=l??t.shouldReduceMotion;i.start(Le(e,i,s,p&&Re.has(e)?{type:!1}:o,t,d));const m=i.animation;m&&c.push(m)}if(o){const e=()=>f.update(()=>{o&&function(t,e){const n=Ke(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)je(t,e,qe(r[e]))}(t,o)});c.length?Promise.all(c).then(e):e()}return c}function We(t,e,n={}){const i=Ke(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all($e(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(We(u,e,{...o,delay:n+("function"==typeof i?0:i)+ke(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function Ge(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||K(t))}const _e=new Set(["auto","none","0"]);class ze extends C{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),u(i))){const s=Ce(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Re.has(n)||2!==t.length)return;const[i,s]=t,r=B(i),o=B(s);if(j(i)!==j(s)&&q[n])this.needsMeasurement=!0;else if(r!==o)if(N(r)&&N(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else q[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Ge(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!_e.has(e)&&h(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=R(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=q[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=q[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ye=!1;function Xe(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Je(t){return!("touch"===t.pointerType||Ye)}function Ze(t,e,n={}){const[i,s,r]=Xe(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if(!Je(i))return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const Qe=(t,e)=>!!e&&(t===e||Qe(t,e.parentElement)),tn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const en=new WeakSet;function nn(t){return e=>{"Enter"===e.key&&t(e)}}function sn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!0}const on=new WeakSet;function an(t,e,n={}){const[i,s,r]=Xe(t,n),o=t=>{const i=t.currentTarget;if(!rn(t))return;if(on.has(t))return;en.add(i),n.stopPropagation&&on.add(t);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),en.has(i)&&en.delete(i),rn(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Qe(i,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",u,s)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=nn(()=>{if(en.has(n))return;sn(n,"down");const t=nn(()=>{sn(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>sn(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return tn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class un extends U{constructor(){super(...arguments),this.KeyframeResolver=ze}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ln{constructor(t){this.isMounted=!1,this.node=t}update(){}}function cn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class hn extends un{constructor(){super(...arguments),this.type="html",this.renderInstance=cn}readValueFromInstance(t,e){if(P.has(e))return this.projection?.isProjecting?H(e):$(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(W(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){G(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return _(t,e,n)}}const dn=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"]);class pn extends un{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(P.has(e)){const t=Q(e);return t&&t.default||0}return e=dn.has(e)?e:z(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return X(t,e,n)}build(t,e,n){J(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){cn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(dn.has(n)?n:z(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Z(t.tagName),super.mount(t)}}const mn=et.length;function fn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&fn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<mn;n++){const i=et[n],s=t.props[i];(tt(s)||!1===s)&&(e[i]=s)}return e}function yn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const vn=[...it].reverse(),gn=it.length;function wn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>We(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=We(t,e,n);else{const s="function"==typeof e?Ke(t,e,n.custom):e;i=Promise.all($e(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Tn(t){let e=wn(t),n=xn(),i=!0,s=!1;const r=e=>(n,i)=>{const s=Ke(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:a}=t,u=fn(t.parent)||{},l=[],c=new Set;let h={},d=1/0;for(let e=0;e<gn;e++){const p=vn[e],m=n[p],f=void 0!==a[p]?a[p]:u[p],y=tt(f),v=p===o?m.isActive:null;!1===v&&(d=e);let g=f===u[p]&&f!==a[p]&&y;if(g&&(i||s)&&t.manuallyAnimateOnMount&&(g=!1),m.protectedKeys={...h},!m.isActive&&null===v||!f&&!m.prevProp||nt(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==v){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const w=bn(m.prevProp,f);let T=w||p===o&&m.isActive&&!g&&y||e>d&&y,b=!1;const A=Array.isArray(f)?f:[f];let x=A.reduce(r(p),{});!1===v&&(x={});const{prevResolvedValues:S={}}=m,k={...S,...x},M=e=>{T=!0,c.has(e)&&(b=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in k){const e=x[t],n=S[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Be(e)&&Be(n)?!yn(e,n):e!==n,i?null!=e?M(t):c.add(t):void 0!==e&&c.has(t)?M(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=x,m.isActive&&(h={...h,...x}),(i||s)&&t.blockInitialAnimation&&(T=!1);const C=g&&w;T&&(!C||b)&&l.push(...A.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!C&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Ke(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=ke(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof a.initial){const n=Ke(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let p=Boolean(l.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=xn(),s=!0}}}function bn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!yn(e,t)}function An(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xn(){return{animate:An(!0),whileInView:An(),whileHover:An(),whileTap:An(),whileDrag:An(),whileFocus:An(),exit:An()}}function Sn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}let kn=0;const Mn={animation:{Feature:class extends ln{constructor(t){super(t),t.animationState||(t.animationState=Tn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();nt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ln{constructor(){super(...arguments),this.id=kn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Cn(t){return{point:{x:t.pageX,y:t.pageY}}}function Vn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&f.postRender(()=>s(e,Cn(e)))}function En(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&f.postRender(()=>s(e,Cn(e)))}const Pn=new WeakMap,Dn=new WeakMap,On=t=>{const e=Pn.get(t.target);e&&e(t)},Fn=t=>{t.forEach(On)};function In(t,e,n){const i=function({root:t,...e}){const n=t||document;Dn.has(n)||Dn.set(n,{});const i=Dn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Fn,{root:t,...e})),i[s]}(e);return Pn.set(t,n),i.observe(t),()=>{Pn.delete(t),i.unobserve(t)}}const Ln={some:0,all:1};const Kn={renderer:(t,e)=>e.isSVG??st(t)?new pn(e):new hn(e,{allowProjection:t!==rt}),...Mn,...{inView:{Feature:class extends ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ln[i]};return In(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ln{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=an(t,(t,e)=>(En(this.node,e,"Start"),(t,{success:e})=>En(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=at(Sn(this.node.current,"focus",()=>this.onFocus()),Sn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ln{mount(){const{current:t}=this.node;t&&(this.unmount=Ze(t,(t,e)=>(Vn(this.node,e,"Start"),t=>Vn(this.node,t,"End"))))}unmount(){}}}}};export{Kn as domAnimation};
|
|
1
|
+
import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as T,M as b,W as x,L as A,N as S,O as M,P as k,Q as C,R as V,S as E,T as P,U as D,r as O,V as F,X as I,i as L,o as K,Y as R,Z as B,_ as j,$ as q,a0 as N,a1 as U,a2 as H,a3 as $,a4 as G,a5 as W,d as _,s as z,a6 as Y,a7 as X,k as J,e as Z,f as Q,a8 as tt,b as et,a9 as nt,j as it,aa as st,g as rt}from"./size-rollup-dom-animation-assets.js";import{Fragment as ot}from"react";const at=(t,e)=>n=>e(t(n)),ut=(...t)=>t.reduce(at),lt=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ct=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ht(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=ct(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:ct(r(t),n,s)}const dt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pt=t=>e=>1-t(1-e),mt=ht(.33,1.53,.69,.99),ft=pt(mt),yt=dt(ft),vt=t=>(t*=2)<1?.5*ft(t):.5*(2-Math.pow(2,-10*(t-1))),gt=t=>1-Math.sin(Math.acos(t)),wt=pt(gt),Tt=dt(gt),bt=ht(.42,0,1,1),xt=ht(0,0,.58,1),At=ht(.42,0,.58,1),St={linear:t,easeIn:bt,easeInOut:At,easeOut:xt,circIn:gt,circInOut:Tt,circOut:wt,backIn:ft,backInOut:yt,backOut:mt,anticipate:vt},Mt=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return ht(e,i,s,r)}return"string"==typeof t?(n(void 0!==St[t],`Invalid easing type '${t}'`,"invalid-easing-type"),St[t]):t};function kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ct(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Et=[o,s,r];function Pt(t){const e=(n=t,Et.find(t=>t.test(n)));var n;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===r&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=kt(a,i,t+1/3),r=kt(a,i,t),o=kt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Dt=(t,e)=>{const n=Pt(t),r=Pt(e);if(!n||!r)return Ct(t,e);const o={...n};return t=>(o.red=Vt(n.red,r.red,t),o.green=Vt(n.green,r.green,t),o.blue=Vt(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},Ot=new Set(["none","hidden"]);function Ft(t,e){return n=>i(t,e,n)}function It(t){return"number"==typeof t?Ft:"string"==typeof t?u(t)?Ct:l.test(t)?Dt:Rt:Array.isArray(t)?Lt:"object"==typeof t?l.test(t)?Dt:Kt:Ct}function Lt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>It(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Kt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=It(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Rt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(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?Ot.has(t)&&!s.values.length||Ot.has(e)&&!i.values.length?function(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):ut(Lt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(a(!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"),Ct(t,e))};function Bt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return i(t,e,n);return It(t)(t,e)}const jt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},qt=2e4;function Nt(t){let e=0;let n=t.next(e);for(;!n.done&&e<qt;)e+=50,n=t.next(e);return e>=qt?1/0:e}const Ut=100,Ht=10,$t=1,Gt=0,Wt=800,_t=.3,zt=.3,Yt={granular:.01,default:2},Xt={granular:.005,default:.5},Jt=.01,Zt=10,Qt=.05,te=1;function ee(t,e){return t*Math.sqrt(1-e*e)}const ne=.001;const ie=["duration","bounce"],se=["stiffness","damping","mass"];function re(t,e){return e.some(e=>void 0!==t[e])}function oe(t){let e={velocity:Gt,stiffness:Ut,damping:Ht,mass:$t,isResolvedFromDuration:!1,...t};if(!re(t,se)&&re(t,ie))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*v(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:$t,stiffness:s,damping:r}}else{const n=function({duration:t=Wt,bounce:e=_t,velocity:n=Gt,mass:i=$t}){let s,r;a(t<=w(Zt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=v(Qt,te,o),t=v(Jt,Zt,y(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=ee(e,o),u=Math.exp(-s);return ne-r/a*u},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=ee(Math.pow(e,2),o);return(-s(e)+ne>0?-1:1)*((r-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=w(t),isNaN(u))return{stiffness:Ut,damping:Ht,duration:t};{const e=Math.pow(u,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:$t},e.isResolvedFromDuration=!0}return e}function ae(t=zt,e=_t){const n="object"!=typeof t?{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:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=oe({...n,velocity:-y(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),v=o-r,T=y(Math.sqrt(u/c)),b=Math.abs(v)<5;let x,A,S,M,k,C;if(i||(i=b?Yt.granular:Yt.default),s||(s=b?Xt.granular:Xt.default),f<1)S=ee(T,f),M=(m+f*T*v)/S,x=t=>{const e=Math.exp(-f*T*t);return o-e*(M*Math.sin(S*t)+v*Math.cos(S*t))},k=f*T*M+v*S,C=f*T*v-M*S,A=t=>Math.exp(-f*T*t)*(k*Math.sin(S*t)+C*Math.cos(S*t));else if(1===f){x=t=>o-Math.exp(-T*t)*(v+(m+T*v)*t);const t=m+T*v;A=e=>Math.exp(-T*e)*(T*t*e-m)}else{const t=T*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*T*e),i=Math.min(t*e,300);return o-n*((m+f*T*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(m+f*T*v)/t,n=f*T*e-v*t,i=f*T*v-e*t;A=e=>{const s=Math.exp(-f*T*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const V={calculatedDuration:p&&h||null,velocity:t=>w(A(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*T*t),n=Math.sin(S*t),r=Math.cos(S*t),u=o-e*(M*n+v*r),l=w(e*(k*n+C*r));return a.done=Math.abs(l)<=i&&Math.abs(o-u)<=s,a.value=a.done?o:u,a}const e=x(t);if(p)a.done=t>=h;else{const n=w(A(t));a.done=Math.abs(n)<=i&&Math.abs(o-e)<=s}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Nt(V),qt),e=g(e=>V.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return V}ae.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Nt(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}(t,100,ae);return t.ease=e.ease,t.duration=w(e.duration),t.type="keyframes",t};function ue(t,e,n){const i=Math.max(e-5,0);return T(n-t(i),e-i)}function le({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=h+m,y=void 0===o?f:o(f);y!==f&&(m=y-h);const v=t=>-m*Math.exp(-t/i),g=t=>y+v(t),w=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let T,b;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(T=t,b=ae({keyframes:[d.value,p(d.value)],velocity:ue(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==T||(e=!0,w(t),x(t)),void 0!==T&&t>=T?b.next(t-T):(!e&&w(t),d)}}}function ce(e,i,{clamp:s=!0,ease:r,mixer:o}={}){const a=e.length;if(n(a===i.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const u=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const l=function(e,n,i){const s=[],r=i||b.mix||Bt,o=e.length-1;for(let i=0;i<o;i++){let o=r(e[i],e[i+1]);if(n){const e=Array.isArray(n)?n[i]||t:n;o=ut(e,o)}s.push(o)}return s}(i,r,o),c=l.length,h=t=>{if(u&&t<e[0])return i[0];let n=0;if(c>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=lt(e[n],e[n+1],t);return l[n](s)};return s?t=>h(v(e[0],e[a-1],t)):h}function he(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=lt(0,e,s);t.push(i(n,1,r))}}(e,t.length-1),e}function de({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Mt):Mt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:he(e),t),a=ce(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||At).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const pe={decay:le,inertia:le,tween:de,keyframes:de,spring:ae};function me(t){"string"==typeof t.type&&(t.type=pe[t.type])}const fe=t=>t/100;class ye extends x{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;me(t);const{type:e=de,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||de;a!==de&&"number"!=typeof o[0]&&(this.mixKeyframes=ut(fe,Bt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Nt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(T=r)),w=v(0,1,n)*o}const b=g?{done:!1,value:l[0]}:T.next(w);s&&!g&&(b.value=s(b.value));let{done:x}=b;g||null===a||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&p!==le&&(b.value=A(l,this.options,f,this.speed)),m&&m(b.value),S&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=w(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return ue(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(p.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=jt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(p.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ve={anticipate:vt,backInOut:yt,circInOut:Tt};function ge(t){"string"==typeof t.ease&&t.ease in ve&&(t.ease=ve[t.ease])}class we extends S{constructor(t){ge(t),me(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ye({...r,autoplay:!1}),a=Math.max(10,p.now()-this.startTime),u=v(0,10,a-10),l=o.sample(a).value,{name:c}=this.options;s&&c&&M(s,c,l),e.setWithVelocity(o.sample(Math.max(0,a-u)).value,l,u),o.stop()}}const Te=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function be(t){t.duration=0,t.type="keyframes"}const xe=new Set(["opacity","clipPath","filter","transform"]),Ae=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Se extends x{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=p.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||V;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:u,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=p.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Te(s,e),u=Te(r,e);return a(o===u,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!(!o||!u)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||k(n))&&i)}(e,r,o,u)||(!b.instantAnimations&&l||h?.(A(e,i,n)),e[0]=e[e.length-1],be(i),i.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!c&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return Ae()&&n&&xe.has(n)&&("transform"!==n||!l)&&!u&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(d),f=d.motionValue?.owner?.current,y=m?new we({...d,element:f}):new ye(d);y.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),E()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Me(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}const ke=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ce(t,e,i=1){n(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=ke.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return P(t)?parseFloat(t):t}return u(r)?Ce(r,e,i+1):r}const Ve={type:"spring",stiffness:500,damping:25,restSpeed:10},Ee={type:"keyframes",duration:.8},Pe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},De=(t,{keyframes:e})=>e.length>2?Ee:D.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ve:Pe,Oe=t=>null!==t;function Fe(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ie(t,e){const n=t?.[e]??t?.default??t;return n!==t?Fe(n,t):n}const Le=(t,e,n,i={},s,r)=>o=>{const a=Ie(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=w(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,De(t,c)),c.duration&&(c.duration=w(c.duration)),c.repeatDelay&&(c.repeatDelay=w(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(be(c),0===c.delay&&(h=!0)),(b.instantAnimations||b.skipAnimations||s?.shouldSkipAnimations)&&(h=!0,be(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const i=t.filter(Oe);return i[e&&"loop"!==n&&e%2==1?0:i.length-1]}(c.keyframes,a);if(void 0!==t)return void f.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ye(c):new Se(c)};function Ke(t,e,n){const i=t.getProps();return O(i,e,void 0!==n?n:i.custom,t)}const Re=new Set(["width","height","top","left","right","bottom",...F]),Be=t=>Array.isArray(t);function je(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,I(n))}function qe(t){return Be(t)?t[t.length-1]||0:t}function Ne(t,e){const n=t.getValue("willChange");if(i=n,Boolean(L(i)&&i.add))return n.add(e);if(!n&&b.WillChange){const n=new b.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ue(t){return t.props[K]}function He({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function $e(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Fe(r,u):u;const l=r?.reduceMotion;i&&(r=i);const c=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&He(h,e))continue;const o={delay:n,...Ie(r||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=Ue(t);if(n){const t=window.MotionHandoffAnimation(n,e,f);null!==t&&(o.startTime=t,d=!0)}}Ne(t,e);const p=l??t.shouldReduceMotion;i.start(Le(e,i,s,p&&Re.has(e)?{type:!1}:o,t,d));const m=i.animation;m&&c.push(m)}if(o){const e=()=>f.update(()=>{o&&function(t,e){const n=Ke(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)je(t,e,qe(r[e]))}(t,o)});c.length?Promise.all(c).then(e):e()}return c}function Ge(t,e,n={}){const i=Ke(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all($e(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(Ge(u,e,{...o,delay:n+("function"==typeof i?0:i)+Me(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function We(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||R(t))}const _e=new Set(["auto","none","0"]);class ze extends V{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),u(i))){const s=Ce(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Re.has(n)||2!==t.length)return;const[i,s]=t,r=j(i),o=j(s);if(q(i)!==q(s)&&N[n])this.needsMeasurement=!0;else if(r!==o)if(U(r)&&U(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else N[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||We(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!_e.has(e)&&h(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=B(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=N[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=N[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ye=!1;function Xe(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Je(t){return!("touch"===t.pointerType||Ye)}function Ze(t,e,n={}){const[i,s,r]=Xe(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if(!Je(i))return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const Qe=(t,e)=>!!e&&(t===e||Qe(t,e.parentElement)),tn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const en=new WeakSet;function nn(t){return e=>{"Enter"===e.key&&t(e)}}function sn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!0}const on=new WeakSet;function an(t,e,n={}){const[i,s,r]=Xe(t,n),o=t=>{const i=t.currentTarget;if(!rn(t))return;if(on.has(t))return;en.add(i),n.stopPropagation&&on.add(t);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),en.has(i)&&en.delete(i),rn(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Qe(i,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",u,s)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=nn(()=>{if(en.has(n))return;sn(n,"down");const t=nn(()=>{sn(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>sn(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return tn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class un extends H{constructor(){super(...arguments),this.KeyframeResolver=ze}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;L(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ln{constructor(t){this.isMounted=!1,this.node=t}update(){}}function cn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class hn extends un{constructor(){super(...arguments),this.type="html",this.renderInstance=cn}readValueFromInstance(t,e){if(D.has(e))return this.projection?.isProjecting?$(e):G(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(W(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){_(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return z(t,e,n)}}const dn=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"]);class pn extends un{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=X}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(D.has(e)){const t=tt(e);return t&&t.default||0}return e=dn.has(e)?e:Y(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return J(t,e,n)}build(t,e,n){Z(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){cn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(dn.has(n)?n:Y(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Q(t.tagName),super.mount(t)}}const mn=nt.length;function fn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&fn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<mn;n++){const i=nt[n],s=t.props[i];(et(s)||!1===s)&&(e[i]=s)}return e}function yn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const vn=[...st].reverse(),gn=st.length;function wn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Ge(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Ge(t,e,n);else{const s="function"==typeof e?Ke(t,e,n.custom):e;i=Promise.all($e(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Tn(t){let e=wn(t),n=An(),i=!0,s=!1;const r=e=>(n,i)=>{const s=Ke(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:a}=t,u=fn(t.parent)||{},l=[],c=new Set;let h={},d=1/0;for(let e=0;e<gn;e++){const p=vn[e],m=n[p],f=void 0!==a[p]?a[p]:u[p],y=et(f),v=p===o?m.isActive:null;!1===v&&(d=e);let g=f===u[p]&&f!==a[p]&&y;if(g&&(i||s)&&t.manuallyAnimateOnMount&&(g=!1),m.protectedKeys={...h},!m.isActive&&null===v||!f&&!m.prevProp||it(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==v){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const w=bn(m.prevProp,f);let T=w||p===o&&m.isActive&&!g&&y||e>d&&y,b=!1;const x=Array.isArray(f)?f:[f];let A=x.reduce(r(p),{});!1===v&&(A={});const{prevResolvedValues:S={}}=m,M={...S,...A},k=e=>{T=!0,c.has(e)&&(b=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in M){const e=A[t],n=S[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Be(e)&&Be(n)?!yn(e,n):e!==n,i?null!=e?k(t):c.add(t):void 0!==e&&c.has(t)?k(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=A,m.isActive&&(h={...h,...A}),(i||s)&&t.blockInitialAnimation&&(T=!1);const C=g&&w;T&&(!C||b)&&l.push(...x.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!C&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Ke(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Me(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof a.initial){const n=Ke(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let p=Boolean(l.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=An(),s=!0}}}function bn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!yn(e,t)}function xn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function An(){return{animate:xn(!0),whileInView:xn(),whileHover:xn(),whileTap:xn(),whileDrag:xn(),whileFocus:xn(),exit:xn()}}function Sn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}let Mn=0;const kn={animation:{Feature:class extends ln{constructor(t){super(t),t.animationState||(t.animationState=Tn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();it(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ln{constructor(){super(...arguments),this.id=Mn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Cn(t){return{point:{x:t.pageX,y:t.pageY}}}function Vn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&f.postRender(()=>s(e,Cn(e)))}function En(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&f.postRender(()=>s(e,Cn(e)))}const Pn=new WeakMap,Dn=new WeakMap,On=t=>{const e=Pn.get(t.target);e&&e(t)},Fn=t=>{t.forEach(On)};function In(t,e,n){const i=function({root:t,...e}){const n=t||document;Dn.has(n)||Dn.set(n,{});const i=Dn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Fn,{root:t,...e})),i[s]}(e);return Pn.set(t,n),i.observe(t),()=>{Pn.delete(t),i.unobserve(t)}}const Ln={some:0,all:1};const Kn={renderer:(t,e)=>e.isSVG??rt(t)?new pn(e):new hn(e,{allowProjection:t!==ot}),...kn,...{inView:{Feature:class extends ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ln[i]};return In(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ln{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=an(t,(t,e)=>(En(this.node,e,"Start"),(t,{success:e})=>En(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ut(Sn(this.node.current,"focus",()=>this.onFocus()),Sn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ln{mount(){const{current:t}=this.node;t&&(this.unmount=Ze(t,(t,e)=>(Vn(this.node,e,"Start"),t=>Vn(this.node,t,"End"))))}unmount(){}}}}};export{Kn as domAnimation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s<t?t:s;function i(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let a=()=>{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(a=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},r=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const p=t=>1e3*t,f=t=>t/1e3;function m(t,e){return e?t*(1e3/e):0}const g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,r=y.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const a=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function o(e){a.has(e)&&(h.schedule(e),t()),e(r)}const h={schedule:(t,i=!1,r=!1)=>{const o=r&&n?e:s;return i&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{r=t,n?i=!0:(n=!0,[e,s]=[s,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t)))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=r,g=()=>{const a=o.useManualTiming?i.timestamp:performance.now();s=!1,o.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,a)=>{const o=r[a];return e[a]=(e,a=!1,r=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,a,r)),e},{}),cancel:t=>{for(let e=0;e<y.length;e++)r[y[e]].cancel(t)},state:i,steps:r}}const{schedule:w,cancel:V,state:S,steps:M}=b("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let T;function A(){T=void 0}const C={now:()=>(void 0===T&&C.set(S.isProcessing||o.useManualTiming?S.timestamp:performance.now()),T),set:t=>{T=t,queueMicrotask(A)}},k=t=>e=>"string"==typeof e&&e.startsWith(t),x=k("--"),F=k("var(--"),E=t=>!!F(t)&&P.test(t.split("/*")[0].trim()),P=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function B(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const R={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I={...R,transform:t=>n(0,1,t)},N={...R,default:1},O=t=>Math.round(1e5*t)/1e5,$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>s=>Boolean("string"==typeof s&&L.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,a,r,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(r),alpha:void 0!==o?parseFloat(o):1}},X={...R,transform:t=>Math.round((t=>n(0,255,t))(t))},j={test:Y("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+O(I.transform(n))+")"};const K={test:Y("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:j.transform},U=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Z=U("deg"),z=U("%"),D=U("px"),q=U("vh"),H=U("vw"),_=(()=>({...z,parse:t=>z.parse(t)/100,transform:t=>z.transform(100*t)}))(),G={test:Y("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+z.transform(O(e))+", "+z.transform(O(s))+", "+O(I.transform(n))+")"},J={test:t=>j.test(t)||K.test(t)||G.test(t),parse:t=>j.test(t)?j.parse(t):G.test(t)?G.parse(t):K.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?j.transform(t):G.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const tt="number",et="color",st=/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 nt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(st,t=>(J.test(t)?(n.color.push(a),i.push(et),s.push(J.parse(t))):t.startsWith("var(")?(n.var.push(a),i.push("var"),s.push(t)):(n.number.push(a),i.push(tt),s.push(parseFloat(t))),++a,"${}")).split("${}");return{values:s,split:r,indexes:n,types:i}}function it(t){return nt(t).values}function at(t){const{split:e,types:s}=nt(t),n=e.length;return t=>{let i="";for(let a=0;a<n;a++)if(i+=e[a],void 0!==t[a]){const e=s[a];i+=e===tt?O(t[a]):e===et?J.transform(t[a]):t[a]}return i}}const rt=t=>"number"==typeof t?0:J.test(t)?J.getAnimatableNone(t):t;const ot={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match($)?.length||0)+(t.match(Q)?.length||0)>0},parse:it,createTransformer:at,getAnimatableNone:function(t){const e=it(t);return at(t)(e.map(rt))}},ht=(t,e,s)=>t+(e-t)*s,lt=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ut=t=>null!==t;function ct(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(ut),r=i<0||e&&"loop"!==s&&e%2==1?0:a.length-1;return r&&void 0!==n?n:a[r]}class dt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const pt=t=>180*t/Math.PI,ft=t=>{const e=pt(Math.atan2(t[1],t[0]));return gt(e)},mt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ft,rotateZ:ft,skewX:t=>pt(Math.atan(t[1])),skewY:t=>pt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},gt=t=>((t%=360)<0&&(t+=360),t),vt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),yt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),bt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vt,scaleY:yt,scale:t=>(vt(t)+yt(t))/2,rotateX:t=>gt(pt(Math.atan2(t[6],t[5]))),rotateY:t=>gt(pt(Math.atan2(-t[2],t[0]))),rotateZ:ft,rotate:ft,skewX:t=>pt(Math.atan(t[4])),skewY:t=>pt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function wt(t){return t.includes("scale")?1:0}function Vt(t,e){if(!t||"none"===t)return wt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=bt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=mt,i=e}if(!i)return wt(e);const a=n[e],r=i[1].split(",").map(Mt);return"function"==typeof a?a(r):r[a]}const St=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return Vt(s,e)};function Mt(t){return parseFloat(t.trim())}const Tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],At=(()=>new Set(Tt))(),Ct=t=>t===R||t===D,kt=new Set(["x","y","z"]),xt=Tt.filter(t=>!kt.has(t));const Ft={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>Vt(e,"x"),y:(t,{transform:e})=>Vt(e,"y")};Ft.translateX=Ft.x,Ft.translateY=Ft.y;const Et=new Set;let Pt=!1,Bt=!1,Rt=!1;function It(){if(Bt){const t=Array.from(Et).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return xt.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Bt=!1,Pt=!1,Et.forEach(t=>t.complete(Rt)),Et.clear()}function Nt(){Et.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Bt=!0)})}function Ot(){Rt=!0,Nt(),It(),Rt=!1}class $t{constructor(t,e,s,n,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Et.add(this),Pt||(Pt=!0,w.read(Nt),w.resolveKeyframes(It))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),a=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,a);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=a),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Et.delete(this)}cancel(){"scheduled"===this.state&&(Et.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Lt={};function Yt(t,e){const s=u(t);return()=>Lt[e]??s()}const Wt=Yt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=Yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Kt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Ut(t,e){return t?"function"==typeof t?Xt()?lt(t,e):"ease-out":g(t)?jt(t):Array.isArray(t)?t.map(t=>Ut(t,e)||Kt.easeOut):Kt[t]:void 0}function Zt(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:r="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Ut(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:"reverse"===r?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function zt(t){return"function"==typeof t&&"applyToOptions"in t}class Dt extends dt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=t,r("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return zt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Zt(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ct(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),c):n(this)}}function qt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ht(t,e,s,n){if("function"==typeof e){const[i,a]=qt(n);e=e(void 0!==s?s:t.custom,i,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,a]=qt(n);e=e(void 0!==s?s:t.custom,i,a)}return e}class _t{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=C.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=C.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=C.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gt(t,e){return new _t(t,e)}const Jt=t=>Boolean(t&&t.getVelocity);function Qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const te="data-"+Qt("framerAppearId"),ee=t=>e=>e.test(t),se=[R,D,z,Z,H,q,{test:t=>"auto"===t,parse:t=>t}],ne=t=>se.find(ee(t)),ie=new Set(["brightness","contrast","saturate","opacity"]);function ae(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let a=ie.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const re=/\b([a-z-]*)\(.*?\)/gu,oe={...ot,getAnimatableNone:t=>{const e=t.match(re);return e?e.map(ae).join(" "):t}},he={...ot,getAnimatableNone:t=>{const e=ot.parse(t);return ot.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},le={...R,transform:Math.round},ue={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,inset:D,insetBlock:D,insetBlockStart:D,insetBlockEnd:D,insetInline:D,insetInlineStart:D,insetInlineEnd:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockStart:D,paddingBlockEnd:D,paddingInline:D,paddingInlineStart:D,paddingInlineEnd:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockStart:D,marginBlockEnd:D,marginInline:D,marginInlineStart:D,marginInlineEnd:D,fontSize:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:Z,rotateX:Z,rotateY:Z,rotateZ:Z,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:Z,skewX:Z,skewY:Z,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:I,originX:_,originY:_,originZ:D},zIndex:le,fillOpacity:I,strokeOpacity:I,numOctaves:le},ce={...ue,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:oe,WebkitFilter:oe,mask:he,WebkitMask:he},de=t=>ce[t],pe=new Set([oe,he]);function fe(t,e){let s=de(t);return pe.has(s)||(s=ot),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const me=new Set(["opacity","clipPath","filter","transform"]),ge=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ve}=b(queueMicrotask,!1),ye=[...se,J,ot],be=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),we=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ve=new WeakMap;function Se(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Me(t){return"string"==typeof t||Array.isArray(t)}const Te=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ae=["initial",...Te];function Ce(t){return Se(t.animate)||Ae.some(e=>Me(t[e]))}function ke(t){return Boolean(Ce(t)||t.variants)}const xe={current:null},Fe={current:!1},Ee="undefined"!=typeof window;const Pe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Be={};function Re(t){Be=t}function Ie(){return Be}class Ne{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:a,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=$t,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=C.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,w.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=r;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=Ce(e),this.isVariantNode=ke(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Jt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Ve.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Fe.current||function(){if(Fe.current=!0,Ee)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xe.current=t.matches;t.addEventListener("change",e),e()}else xe.current=!1}(),this.shouldReduceMotion=xe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&me.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:a,duration:r}=e.accelerate,o=new Dt({element:this.current,name:t,keyframes:n,times:i,ease:a,duration:p(r)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=At.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Be){const e=Be[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Pe.length;e++){const s=Pe[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],a=s[n];if(Jt(i))t.addValue(n,i);else if(Jt(a))t.addValue(n,Gt(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,Gt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Gt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!ye.find(ee(n))&&ot.test(e)&&(s=fe(t,e))),this.setBaseTarget(t,Jt(s)?s.get():s)),Jt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ht(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Jt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ve.render(this.render)}}const Oe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$e=Tt.length;function Le(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let r=!1,o=!1;for(const t in e){const s=e[t];if(At.has(t))r=!0;else if(x(t))i[t]=s;else{const e=ge(s,ue[t]);t.startsWith("origin")?(o=!0,a[t]=e):n[t]=e}}if(e.transform||(r||s?n.transform=function(t,e,s){let n="",i=!0;for(let a=0;a<$e;a++){const r=Tt[a],o=t[r];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(r.startsWith("scale")?1:0);else{const t=parseFloat(o);h=r.startsWith("scale")?1===t:0===t}if(!h||s){const t=ge(o,ue[r]);h||(i=!1,n+=`${Oe[r]||r}(${t}) `),s&&(e[r]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=a;n.transformOrigin=`${t} ${e} ${s}`}}function Ye(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const We={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!D.test(t))return t;t=parseFloat(t)}return`${Ye(t,e.target.x)}% ${Ye(t,e.target.y)}%`}},Xe={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=ot.parse(t);if(i.length>5)return n;const a=ot.createTransformer(t),r="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+r]/=o,i[1+r]/=h;const l=ht(o,h,.5);return"number"==typeof i[2+r]&&(i[2+r]/=l),"number"==typeof i[3+r]&&(i[3+r]/=l),a(i)}},je={borderRadius:{...We,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomLeftRadius:We,borderBottomRightRadius:We,boxShadow:Xe};function Ke(t,{layout:e,layoutId:s}){return At.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!je[t]||"opacity"===t)}function Ue(t,e,s){const n=t.style,i=e?.style,a={};if(!n)return a;for(const e in n)(Jt(n[e])||i&&Jt(i[e])||Ke(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(a[e]=n[e]);return a}const Ze={offset:"stroke-dashoffset",array:"stroke-dasharray"},ze={offset:"strokeDashoffset",array:"strokeDasharray"};const De=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qe(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:r=0,...o},h,l,u){if(Le(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of De)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?Ze:ze;t[a.offset]=""+-n,t[a.array]=`${e} ${s}`}(c,i,a,r,!1)}const He=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _e(t,e,s){const n=Ue(t,e,s);for(const s in t)if(Jt(t[s])||Jt(e[s])){n[-1!==Tt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Ge(t){return Jt(t)?t.get():t}const Je=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Qe(t){return"string"==typeof t&&!t.includes("-")&&!!(Je.indexOf(t)>-1||/[A-Z]/u.test(t))}const ts=t(null),es=t({});function ss(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{Gt as $,E as A,J as B,ot as C,nt as D,S as E,C as F,V as G,w as H,f as I,m as J,p as K,v as L,n as M,lt as N,o as O,ts as P,ct as Q,Dt as R,es as S,zt as T,u as U,$t as V,dt as W,Ot as X,h as Y,At as Z,Tt as _,Me as a,l as a0,fe as a1,ne as a2,B as a3,Ft as a4,Ct as a5,Ne as a6,wt as a7,St as a8,x as a9,Qt as aa,we as ab,de as ac,Ae as ad,Te as ae,z as af,D as ag,e as ah,s as ai,d as aj,M as ak,ve as al,be as am,je as an,Jt as b,Ke as c,Le as d,qe as e,He as f,Qe as g,ke as h,Ce as i,Se as j,Ht as k,_e as l,Ie as m,Re as n,te as o,ss as p,c as q,Ge as r,Ue as s,g as t,r as u,ht as v,j as w,G as x,K as y,a as z};
|
|
1
|
+
import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s<t?t:s;function i(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let a=()=>{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(a=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},r=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const p=t=>1e3*t,f=t=>t/1e3;function m(t,e){return e?t*(1e3/e):0}const g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,r=y.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const a=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function o(e){a.has(e)&&(h.schedule(e),t()),e(r)}const h={schedule:(t,i=!1,r=!1)=>{const o=r&&n?e:s;return i&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{r=t,n?i=!0:(n=!0,[e,s]=[s,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t)))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=r,g=()=>{const a=o.useManualTiming?i.timestamp:performance.now();s=!1,o.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,a)=>{const o=r[a];return e[a]=(e,a=!1,r=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,a,r)),e},{}),cancel:t=>{for(let e=0;e<y.length;e++)r[y[e]].cancel(t)},state:i,steps:r}}const{schedule:w,cancel:V,state:S,steps:M}=b("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let T;function A(){T=void 0}const C={now:()=>(void 0===T&&C.set(S.isProcessing||o.useManualTiming?S.timestamp:performance.now()),T),set:t=>{T=t,queueMicrotask(A)}},k=t=>e=>"string"==typeof e&&e.startsWith(t),x=k("--"),F=k("var(--"),E=t=>!!F(t)&&P.test(t.split("/*")[0].trim()),P=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function B(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const R={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I={...R,transform:t=>n(0,1,t)},N={...R,default:1},O=t=>Math.round(1e5*t)/1e5,$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>s=>Boolean("string"==typeof s&&L.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,a,r,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(r),alpha:void 0!==o?parseFloat(o):1}},X={...R,transform:t=>Math.round((t=>n(0,255,t))(t))},j={test:Y("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+O(I.transform(n))+")"};const K={test:Y("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:j.transform},U=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Z=U("deg"),z=U("%"),D=U("px"),q=U("vh"),H=U("vw"),_=(()=>({...z,parse:t=>z.parse(t)/100,transform:t=>z.transform(100*t)}))(),G={test:Y("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+z.transform(O(e))+", "+z.transform(O(s))+", "+O(I.transform(n))+")"},J={test:t=>j.test(t)||K.test(t)||G.test(t),parse:t=>j.test(t)?j.parse(t):G.test(t)?G.parse(t):K.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?j.transform(t):G.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const tt="number",et="color",st=/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 nt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(st,t=>(J.test(t)?(n.color.push(a),i.push(et),s.push(J.parse(t))):t.startsWith("var(")?(n.var.push(a),i.push("var"),s.push(t)):(n.number.push(a),i.push(tt),s.push(parseFloat(t))),++a,"${}")).split("${}");return{values:s,split:r,indexes:n,types:i}}function it({split:t,types:e}){const s=t.length;return n=>{let i="";for(let a=0;a<s;a++)if(i+=t[a],void 0!==n[a]){const t=e[a];i+=t===tt?O(n[a]):t===et?J.transform(n[a]):n[a]}return i}}const at=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:J.test(s)?J.getAnimatableNone(s):s;var s};const rt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match($)?.length||0)+(t.match(Q)?.length||0)>0},parse:function(t){return nt(t).values},createTransformer:function(t){return it(nt(t))},getAnimatableNone:function(t){const e=nt(t);return it(e)(e.values.map((t,s)=>at(t,e.split[s])))}},ot=(t,e,s)=>t+(e-t)*s,ht=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},lt=t=>null!==t;function ut(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(lt),r=i<0||e&&"loop"!==s&&e%2==1?0:a.length-1;return r&&void 0!==n?n:a[r]}class ct{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const dt=t=>180*t/Math.PI,pt=t=>{const e=dt(Math.atan2(t[1],t[0]));return mt(e)},ft={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pt,rotateZ:pt,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},mt=t=>((t%=360)<0&&(t+=360),t),gt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gt,scaleY:vt,scale:t=>(gt(t)+vt(t))/2,rotateX:t=>mt(dt(Math.atan2(t[6],t[5]))),rotateY:t=>mt(dt(Math.atan2(-t[2],t[0]))),rotateZ:pt,rotate:pt,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function bt(t){return t.includes("scale")?1:0}function wt(t,e){if(!t||"none"===t)return bt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=yt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ft,i=e}if(!i)return bt(e);const a=n[e],r=i[1].split(",").map(St);return"function"==typeof a?a(r):r[a]}const Vt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return wt(s,e)};function St(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Tt=(()=>new Set(Mt))(),At=t=>t===R||t===D,Ct=new Set(["x","y","z"]),kt=Mt.filter(t=>!Ct.has(t));const xt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>wt(e,"x"),y:(t,{transform:e})=>wt(e,"y")};xt.translateX=xt.x,xt.translateY=xt.y;const Ft=new Set;let Et=!1,Pt=!1,Bt=!1;function Rt(){if(Pt){const t=Array.from(Ft).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return kt.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Pt=!1,Et=!1,Ft.forEach(t=>t.complete(Bt)),Ft.clear()}function It(){Ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pt=!0)})}function Nt(){Bt=!0,It(),Rt(),Bt=!1}class Ot{constructor(t,e,s,n,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Ft.add(this),Et||(Et=!0,w.read(It),w.resolveKeyframes(Rt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),a=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,a);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=a),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ft.delete(this)}cancel(){"scheduled"===this.state&&(Ft.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function $t(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Lt={};function Yt(t,e){const s=u(t);return()=>Lt[e]??s()}const Wt=Yt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=Yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Kt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Ut(t,e){return t?"function"==typeof t?Xt()?ht(t,e):"ease-out":g(t)?jt(t):Array.isArray(t)?t.map(t=>Ut(t,e)||Kt.easeOut):Kt[t]:void 0}function Zt(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:r="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Ut(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:"reverse"===r?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function zt(t){return"function"==typeof t&&"applyToOptions"in t}class Dt extends ct{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=t,r("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return zt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Zt(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ut(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$t(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),c):n(this)}}function qt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ht(t,e,s,n){if("function"==typeof e){const[i,a]=qt(n);e=e(void 0!==s?s:t.custom,i,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,a]=qt(n);e=e(void 0!==s?s:t.custom,i,a)}return e}class _t{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=C.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=C.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=C.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gt(t,e){return new _t(t,e)}const Jt=t=>Boolean(t&&t.getVelocity);function Qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const te="data-"+Qt("framerAppearId"),ee=t=>e=>e.test(t),se=[R,D,z,Z,H,q,{test:t=>"auto"===t,parse:t=>t}],ne=t=>se.find(ee(t)),ie=new Set(["brightness","contrast","saturate","opacity"]);function ae(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let a=ie.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const re=/\b([a-z-]*)\(.*?\)/gu,oe={...rt,getAnimatableNone:t=>{const e=t.match(re);return e?e.map(ae).join(" "):t}},he={...rt,getAnimatableNone:t=>{const e=rt.parse(t);return rt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},le={...R,transform:Math.round},ue={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,inset:D,insetBlock:D,insetBlockStart:D,insetBlockEnd:D,insetInline:D,insetInlineStart:D,insetInlineEnd:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockStart:D,paddingBlockEnd:D,paddingInline:D,paddingInlineStart:D,paddingInlineEnd:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockStart:D,marginBlockEnd:D,marginInline:D,marginInlineStart:D,marginInlineEnd:D,fontSize:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:Z,rotateX:Z,rotateY:Z,rotateZ:Z,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:Z,skewX:Z,skewY:Z,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:I,originX:_,originY:_,originZ:D},zIndex:le,fillOpacity:I,strokeOpacity:I,numOctaves:le},ce={...ue,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:oe,WebkitFilter:oe,mask:he,WebkitMask:he},de=t=>ce[t],pe=new Set([oe,he]);function fe(t,e){let s=de(t);return pe.has(s)||(s=rt),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const me=new Set(["opacity","clipPath","filter","transform"]),ge=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ve}=b(queueMicrotask,!1),ye=[...se,J,rt],be=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),we=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ve=new WeakMap;function Se(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Me(t){return"string"==typeof t||Array.isArray(t)}const Te=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ae=["initial",...Te];function Ce(t){return Se(t.animate)||Ae.some(e=>Me(t[e]))}function ke(t){return Boolean(Ce(t)||t.variants)}const xe={current:null},Fe={current:!1},Ee="undefined"!=typeof window;const Pe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Be={};function Re(t){Be=t}function Ie(){return Be}class Ne{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:a,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ot,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=C.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,w.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=r;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=Ce(e),this.isVariantNode=ke(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Jt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Ve.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Fe.current||function(){if(Fe.current=!0,Ee)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xe.current=t.matches;t.addEventListener("change",e),e()}else xe.current=!1}(),this.shouldReduceMotion=xe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&me.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:a,duration:r}=e.accelerate,o=new Dt({element:this.current,name:t,keyframes:n,times:i,ease:a,duration:p(r)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=Tt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Be){const e=Be[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Pe.length;e++){const s=Pe[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],a=s[n];if(Jt(i))t.addValue(n,i);else if(Jt(a))t.addValue(n,Gt(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,Gt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Gt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!ye.find(ee(n))&&rt.test(e)&&(s=fe(t,e))),this.setBaseTarget(t,Jt(s)?s.get():s)),Jt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ht(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Jt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ve.render(this.render)}}const Oe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$e=Mt.length;function Le(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let r=!1,o=!1;for(const t in e){const s=e[t];if(Tt.has(t))r=!0;else if(x(t))i[t]=s;else{const e=ge(s,ue[t]);t.startsWith("origin")?(o=!0,a[t]=e):n[t]=e}}if(e.transform||(r||s?n.transform=function(t,e,s){let n="",i=!0;for(let a=0;a<$e;a++){const r=Mt[a],o=t[r];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(r.startsWith("scale")?1:0);else{const t=parseFloat(o);h=r.startsWith("scale")?1===t:0===t}if(!h||s){const t=ge(o,ue[r]);h||(i=!1,n+=`${Oe[r]||r}(${t}) `),s&&(e[r]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=a;n.transformOrigin=`${t} ${e} ${s}`}}function Ye(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const We={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!D.test(t))return t;t=parseFloat(t)}return`${Ye(t,e.target.x)}% ${Ye(t,e.target.y)}%`}},Xe={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=rt.parse(t);if(i.length>5)return n;const a=rt.createTransformer(t),r="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+r]/=o,i[1+r]/=h;const l=ot(o,h,.5);return"number"==typeof i[2+r]&&(i[2+r]/=l),"number"==typeof i[3+r]&&(i[3+r]/=l),a(i)}},je={borderRadius:{...We,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomLeftRadius:We,borderBottomRightRadius:We,boxShadow:Xe};function Ke(t,{layout:e,layoutId:s}){return Tt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!je[t]||"opacity"===t)}function Ue(t,e,s){const n=t.style,i=e?.style,a={};if(!n)return a;for(const e in n)(Jt(n[e])||i&&Jt(i[e])||Ke(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(a[e]=n[e]);return a}const Ze={offset:"stroke-dashoffset",array:"stroke-dasharray"},ze={offset:"strokeDashoffset",array:"strokeDasharray"};const De=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qe(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:r=0,...o},h,l,u){if(Le(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of De)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?Ze:ze;t[a.offset]=""+-n,t[a.array]=`${e} ${s}`}(c,i,a,r,!1)}const He=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _e(t,e,s){const n=Ue(t,e,s);for(const s in t)if(Jt(t[s])||Jt(e[s])){n[-1!==Mt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Ge(t){return Jt(t)?t.get():t}const Je=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Qe(t){return"string"==typeof t&&!t.includes("-")&&!!(Je.indexOf(t)>-1||/[A-Z]/u.test(t))}const ts=t(null),es=t({});function ss(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{Mt as $,E as A,J as B,rt as C,nt as D,S as E,C as F,V as G,w as H,f as I,n as J,ht as K,v as L,p as M,m as N,o as O,ts as P,ut as Q,Dt as R,es as S,$t as T,zt as U,u as V,ct as W,Ot as X,Nt as Y,h as Z,Tt as _,Me as a,Gt as a0,l as a1,fe as a2,ne as a3,B as a4,xt as a5,At as a6,Ne as a7,bt as a8,Vt as a9,x as aa,Qt as ab,we as ac,de as ad,Ae as ae,Te as af,z as ag,D as ah,e as ai,s as aj,d as ak,M as al,ve as am,be as an,je as ao,Jt as b,Ke as c,Le as d,qe as e,He as f,Qe as g,ke as h,Ce as i,Se as j,Ht as k,_e as l,Ie as m,Re as n,te as o,ss as p,c as q,Ge as r,Ue as s,g as t,r as u,ot as v,j as w,G as x,K as y,a as z};
|