/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@wix/motion@2.2.0/dist/cjs/motion.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class _{animations;options;ready;isCSS;longestAnimation;constructor(e,n){this.animations=e,this.options=n,this.ready=n?.measured||Promise.resolve(),this.isCSS=e[0]instanceof CSSAnimation,this.longestAnimation=this._getAnimationWithLongestEndTime()}_getAnimationWithLongestEndTime(){return this.animations.reduce((e,n)=>{const o=e.effect?.getComputedTiming().endTime??0,s=n.effect?.getComputedTiming().endTime??0;return o>s?e:n},this.animations[0])}getProgress(){return this.longestAnimation?.effect?.getComputedTiming().progress||0}async play(e){await this.ready;for(const n of this.animations)n.play();await Promise.all(this.animations.map(n=>n.ready)),e&&e()}pause(){for(const e of this.animations)e.pause()}async reverse(e){await this.ready;for(const n of this.animations)n.reverse();await Promise.all(this.animations.map(n=>n.ready)),e&&e()}progress(e){for(const n of this.animations){const{delay:o,duration:s,iterations:i}=n.effect.getTiming(),r=(Number.isFinite(s)?s:0)*(Number.isFinite(i)?i:1);n.currentTime=((o||0)+r)*e}}cancel(){for(const e of this.animations)e.cancel()}setPlaybackRate(e){for(const n of this.animations)n.playbackRate=e}async onFinish(e){try{await Promise.all(this.animations.map(o=>o.finished));const n=this.animations[0];if(n&&!this.isCSS){const o=n.effect?.target;if(o){const s=this.options?.effectId||n.id,i=new CustomEvent("animationend",{detail:{effectId:s}});o.dispatchEvent(i)}}e()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}async onAbort(e){try{await Promise.all(this.animations.map(n=>n.finished))}catch(n){if(n.name==="AbortError"){const o=this.animations[0];if(o&&!this.isCSS){const s=o.effect?.target;if(s){const i=new Event("animationcancel");s.dispatchEvent(i)}}e()}}}get finished(){return Promise.all(this.animations.map(e=>e.finished))}get playState(){return this.animations.some(e=>e.playState==="running")?"running":this.animations[0]?.playState}hasAnimationName(e){return this.animations.some(n=>n.animationName===e)}hasAnimationId(e){return this.animations.some(n=>n.id===e)}getTimingOptions(){return this.animations.map(e=>{const n=e.effect?.getTiming(),o=n?.delay??0,s=Number(n?.duration)||0,i=n?.iterations??1;return{delay:o,duration:s,iterations:i}})}}const M=t=>t,H=t=>1-Math.cos(t*Math.PI/2),K=t=>Math.sin(t*Math.PI/2),V=t=>-(Math.cos(Math.PI*t)-1)/2,J=t=>t**2,U=t=>1-(1-t)**2,X=t=>t<.5?2*t**2:1-(-2*t+2)**2/2,Y=t=>t**3,Z=t=>1-(1-t)**3,Q=t=>t<.5?4*t**3:1-(-2*t+2)**3/2,tt=t=>t**4,et=t=>1-(1-t)**4,nt=t=>t<.5?8*t**4:1-(-2*t+2)**4/2,it=t=>t**5,st=t=>1-(1-t)**5,ot=t=>t<.5?16*t**5:1-(-2*t+2)**5/2,rt=t=>t===0?0:2**(10*t-10),at=t=>t===1?1:1-2**(-10*t),ct=t=>t===0?0:t===1?1:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,ut=t=>1-Math.sqrt(1-t**2),ft=t=>Math.sqrt(1-(t-1)**2),mt=t=>t<.5?(1-Math.sqrt(1-4*t**2))/2:(Math.sqrt(-(2*t-3)*(2*t-1))+1)/2,lt=t=>2.70158*t**3-1.70158*t**2,dt=t=>1+2.70158*(t-1)**3+1.70158*(t-1)**2,ht=(t,e=1.70158*1.525)=>t<.5?(2*t)**2*((e+1)*2*t-e)/2:((2*t-2)**2*((e+1)*(t*2-2)+e)+2)/2,P={linear:M,sineIn:H,sineOut:K,sineInOut:V,quadIn:J,quadOut:U,quadInOut:X,cubicIn:Y,cubicOut:Z,cubicInOut:Q,quartIn:tt,quartOut:et,quartInOut:nt,quintIn:it,quintOut:st,quintInOut:ot,expoIn:rt,expoOut:at,expoInOut:ct,circIn:ut,circOut:ft,circInOut:mt,backIn:lt,backOut:dt,backInOut:ht},O=(t,e,n,o,s)=>{const i=3*e,r=3*(o-2*e),a=1-3*o+3*e,f=3*n,d=3*(s-2*n),c=1-3*s+3*n;let u;if(a===0)u=r===0?`(${t} / ${i})`:`((sqrt(max(0, ${i*i} + ${4*r} * ${t})) - ${i}) / ${2*r})`;else{const m=r/(3*a),p=2*Math.pow(r,3)-9*i*r*a,l=54*Math.pow(a,3),h=(3*a*i-r*r)/(9*a*a),$=`((${p} - ${27*a*a} * ${t}) / ${l})`;if(h<0){const g=2*Math.sqrt(-h);let b=0;for(const I of[0,1,2])[0,.25,.5,.75,1].every(A=>{const S=Math.min(Math.max(2*(p-27*a*a*A)/(l*h*g),-1),1),j=g*Math.cos((Math.acos(S)-I*2*Math.PI)/3)-m;return j>=-1e-6&&j<=1.000001})&&(b=I);const y=`(acos(clamp(-1, ${2/(h*g)} * ${$}, 1)) - ${360*b}deg) / 3`;u=`(${g} * cos(${y}) - ${m})`}else{const g=`sqrt(pow(${$}, 2) + ${Math.pow(h,3)})`;u=`(pow(${g} - ${$}, 1 / 3) - pow(${g} + ${$}, 1 / 3) - ${m})`}}return`(${c} * pow(${u}, 3) + ${d} * pow(${u}, 2) + ${f} * ${u})`},k={linear:t=>t,ease:t=>O(t,.25,.1,.25,1),easeIn:t=>O(t,.42,0,1,1),easeOut:t=>O(t,0,0,.58,1),easeInOut:t=>O(t,.42,0,.58,1),sineIn:t=>`(1 - cos(${t} * 90deg))`,sineOut:t=>`(sin(${t} * 90deg))`,sineInOut:t=>`((1 - cos(${t} * 180deg)) / 2)`,quadIn:t=>`(${t} * ${t})`,quadOut:t=>`(1 - (1 - ${t}) * (1 - ${t}))`,quadInOut:t=>`(round(${t}) * (1 - (-2 * ${t} + 2) * (-2 * ${t} + 2) / 2) + (1 - round(${t})) * 2 * ${t} * ${t})`,cubicIn:t=>`pow(${t}, 3)`,cubicOut:t=>`(1 - pow(1 - ${t}, 3))`,cubicInOut:t=>`(round(${t}) * (1 - pow(-2 * ${t} + 2, 3) / 2) + (1 - round(${t})) * 4 * pow(${t}, 3))`,quartIn:t=>`pow(${t}, 4)`,quartOut:t=>`(1 - pow(1 - ${t}, 4))`,quartInOut:t=>`(round(${t}) * (1 - pow(-2 * ${t} + 2, 4) / 2) + (1 - round(${t})) * 8 * pow(${t}, 4))`,quintIn:t=>`pow(${t}, 5)`,quintOut:t=>`(1 - pow(1 - ${t}, 5))`,quintInOut:t=>`(round(${t}) * (1 - pow(-2 * ${t} + 2, 5) / 2) + (1 - round(${t})) * 16 * pow(${t}, 5))`,expoIn:t=>`(pow(2, 10 * ${t} - 10) - pow(2, -10) * (1 - ${t}))`,expoOut:t=>`(1 - pow(2, -10 * ${t}) + pow(2, -10) * ${t})`,expoInOut:t=>`((round(${t}) * (2 - pow(2, -20 * ${t} + 10)) + (1 - round(${t})) * pow(2, 20 * ${t} - 10)) / 2)`,circIn:t=>`(1 - sqrt(1 - ${t} * ${t}))`,circOut:t=>`sqrt(1 - (${t} - 1) * (${t} - 1))`,circInOut:t=>`((round(${t}) * (sqrt(max(0, (3 - 2 * ${t}) * (2 * ${t} - 1))) + 1) + (1 - round(${t})) * (1 - sqrt(max(0, 1 - 4 * ${t} * ${t})))) / 2)`,backIn:t=>`(2.70158 * pow(${t}, 3) - 1.70158 * ${t} * ${t})`,backOut:t=>`(1 + 2.70158 * pow(${t} - 1, 3) + 1.70158 * (${t} - 1) * (${t} - 1))`,backInOut:t=>`((round(${t}) * (2 + (2 * ${t} - 2) * (2 * ${t} - 2) * (2.5949095 + 3.5949095 * (2 * ${t} - 2))) + (1 - round(${t})) * 4 * ${t} * ${t} * (3.5949095 * 2 * ${t} - 2.5949095)) / 2)`},z={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",sineIn:"cubic-bezier(0.47, 0, 0.745, 0.715)",sineOut:"cubic-bezier(0.39, 0.575, 0.565, 1)",sineInOut:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",quadIn:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",quadOut:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",quadInOut:"cubic-bezier(0.455, 0.03, 0.515, 0.955)",cubicIn:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",cubicOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",cubicInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",quartIn:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",quartOut:"cubic-bezier(0.165, 0.84, 0.44, 1)",quartInOut:"cubic-bezier(0.77, 0, 0.175, 1)",quintIn:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",quintOut:"cubic-bezier(0.23, 1, 0.32, 1)",quintInOut:"cubic-bezier(0.86, 0, 0.07, 1)",expoIn:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",expoOut:"cubic-bezier(0.19, 1, 0.22, 1)",expoInOut:"cubic-bezier(1, 0, 0, 1)",circIn:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",circOut:"cubic-bezier(0.075, 0.82, 0.165, 1)",circInOut:"cubic-bezier(0.785, 0.135, 0.15, 0.86)",backIn:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",backOut:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",backInOut:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"};function pt(t){return t==="percentage"?"%":t||"px"}const Mt=/^(webkit|moz|ms|o)(?=[A-Z])/,Nt=Object.assign(Object.create(null),{float:"cssFloat","animation-timing-function":"easing","animation-composition":"composite"});function Ft(t){return t.startsWith("--")?t:(Mt.test(t)?`-${t}`:t).replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function gt(t){return t.startsWith("--")||!t.includes("-")?t:t.replace(/^-/,"").replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function $t(t){return Nt[t]||gt(t)}function Gt(t){for(const e in t)if(Object.hasOwn(t,e)&&$t(e)!==e)return!0;return!1}function N(t){if(!Array.isArray(t))return t;let e;return t.forEach((n,o)=>{if(!n||typeof n!="object"||!Gt(n))return;e??=t.slice();const s={};for(const i in n)Object.hasOwn(n,i)&&(s[$t(i)]=n[i]);e[o]=s}),e||t}function bt(t){return t?z[t]||t:z.linear}function yt(t,e,n,o){const s=3*t,i=3*(n-t)-s,r=1-s-i,a=3*e,f=3*(o-e)-a,d=1-a-f,c=l=>((r*l+i)*l+s)*l,u=l=>((d*l+f)*l+a)*l,m=l=>(3*r*l+2*i)*l+s;function p(l){let h=l;for(let b=0;b<8;b++){const y=c(h)-l;if(Math.abs(y)<1e-7)return h;const I=m(h);if(Math.abs(I)<1e-6)break;h-=y/I}let $=0,g=1;for(h=($+g)/2;g-$>1e-7;){const b=c(h);if(Math.abs(b-l)<1e-7)return h;l>b?$=h:g=h,h=($+g)/2}return h}return l=>l<=0?0:l>=1?1:u(p(l))}function It(t){const e=t.match(/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/);if(!e)return;const n=parseFloat(e[1]),o=parseFloat(e[2]),s=parseFloat(e[3]),i=parseFloat(e[4]);if(![n,o,s,i].some(isNaN))return[n,o,s,i]}function Dt(t){const e=It(t);if(!(!e||e.some(isNaN)))return yt(...e)}function jt(t){const e=It(t);if(!(!e||e.some(isNaN)))return n=>O(n,...e)}function Et(t){const e=t.match(/^linear\((.+)\)$/);if(!e)return;const n=e[1].split(",").map(i=>i.trim()).filter(Boolean);if(n.length===0)return;const o=[];for(const i of n){const r=i.split(/\s+/),a=parseFloat(r[0]);if(isNaN(a))return;const f=[];for(let d=1;d<r.length;d++)if(r[d].endsWith("%")){const c=parseFloat(r[d])/100;if(isNaN(c))return;f.push(c)}f.length===0?o.push({output:a,pos:null}):f.length===1?o.push({output:a,pos:f[0]}):(o.push({output:a,pos:f[0]}),o.push({output:a,pos:f[1]}))}if(o.length===0)return;o[0].pos===null&&(o[0].pos=0),o[o.length-1].pos===null&&(o[o.length-1].pos=1);let s=0;for(;s<o.length;)if(o[s].pos===null){const i=s-1;let r=s;for(;r<o.length&&o[r].pos===null;)r++;const a=o[i].pos,f=o[r].pos,d=r-i;for(let c=i+1;c<r;c++)o[c].pos=a+(f-a)*(c-i)/d;s=r+1}else s++;for(let i=1;i<o.length;i++)o[i].pos<o[i-1].pos&&(o[i].pos=o[i-1].pos);return o}function Rt(t){const e=Et(t);if(e)return n=>{if(n<=e[0].pos)return e[0].output;const o=e[e.length-1];if(n>=o.pos)return o.output;let s=0,i=e.length-1;for(;s<i-1;){const f=s+i>>>1;e[f].pos<=n?s=f:i=f}const r=e[s],a=e[i];return a.pos===r.pos?a.output:r.output+(a.output-r.output)*(n-r.pos)/(a.pos-r.pos)}}function Lt(t){const e=Et(t);if(e)return n=>{const o=[`${e[0].output}`];for(let s=1;s<e.length;s++){const i=e[s].pos-e[s-1].pos,r=e[s].output-e[s-1].output;if(i===0&&e[s-1].pos===0)o.push(`${r}`);else{const a=i===0?`round(${n} / ${2*e[s-1].pos})`:`(${n} - ${e[s-1].pos}) / ${i}`;o.push(`clamp(0, ${a}, 1) * ${r}`)}}return`(${o.join(" + ")})`}}function F(t){if(!t)return;const e=P[t];return e||(Dt(t)??Rt(t)??P.linear)}function Ot(t){if(!t)return;const e=k[t];return e||(jt(t)??Lt(t)??k.linear)}class Wt extends _{animationGroups;delay;offset;offsetEasing;sequenceId;timingOptions;constructor(e,n={}){const o=e.flatMap(s=>[...s.animations]);super(o),this.animationGroups=e,this.delay=n.delay??0,this.offset=n.offset??0,this.sequenceId=n.sequenceId,this.offsetEasing=typeof n.offsetEasing=="function"?n.offsetEasing:F(n.offsetEasing)??M,this.timingOptions=this.animationGroups.map(s=>s.getTimingOptions().map(({delay:i,duration:r,iterations:a})=>({delay:i,duration:Number.isFinite(r)?r:0,iterations:Number.isFinite(a)?a:1}))),this.applyOffsets(),this.ready=Promise.all(e.map(s=>s.ready)).then(()=>{})}calculateOffsets(){const e=this.animationGroups.length;if(e<=1)return[0];const n=e-1;return Array.from({length:e},(o,s)=>this.offsetEasing(s/n)*n*this.offset|0)}applyOffsets(){if(this.animationGroups.length===0||this.animations.length===0)return;const e=this.calculateOffsets(),n=this.getSequenceActiveDuration(e),o=this.animationGroups.length-1;this.animationGroups.forEach((s,i)=>{s.animations.forEach((r,a)=>{const f=r.effect;if(!f)return;const{delay:d,duration:c,iterations:u}=this.timingOptions[i][a],m=d+e[i],p=n-(m+c*u);if(s.isCSS&&this.sequenceId){const{target:l}=f;l instanceof HTMLElement&&(l.style.setProperty(`--motion-${this.sequenceId}-index`,`${i}`),l.style.setProperty(`--motion-${this.sequenceId}-last`,`${o}`)),f.updateTiming({endDelay:p})}else f.updateTiming({delay:m+this.delay,endDelay:p})})})}getSequenceActiveDuration(e){const n=[];for(let o=0;o<this.timingOptions.length;o++){const s=this.timingOptions[o].reduce((i,r)=>{if(!r)return i;const{delay:a,duration:f,iterations:d}=r;return Math.max(i,a+f*d)},0);n.push(e[o]+s)}return Math.max(...n)}addGroups(e){if(e.length===0)return;const n=[...e].sort((o,s)=>s.index-o.index);for(const{index:o,group:s}of n){const i=Math.min(o,this.animationGroups.length);this.animationGroups.splice(i,0,s),this.timingOptions.splice(i,0,s.getTimingOptions());const r=[...s.animations],a=this.animationGroups.slice(0,i).reduce((f,d)=>f+d.animations.length,0);this.animations.splice(a,0,...r)}this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(o=>o.ready)).then(()=>{})}removeGroups(e){const n=[],o=[],s=[];for(let i=0;i<this.animationGroups.length;i++)e(this.animationGroups[i])?n.push(this.animationGroups[i]):(o.push(this.animationGroups[i]),s.push(this.timingOptions[i]));if(n.length===0)return n;for(const i of n)i.cancel();return this.animationGroups=o,this.timingOptions=s,this.animations=o.flatMap(i=>[...i.animations]),this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(i=>i.ready)).then(()=>{}),n}async onFinish(e){try{await Promise.all(this.animationGroups.map(n=>n.finished)),e()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}}class Bt{_animation;customEffect;progress;_tickCbId;_finishHandler;constructor(e,n,o,s){const i=new KeyframeEffect(n,[],{...o,composite:"add"}),{timeline:r}=s;this._animation=new Animation(i,r),this._tickCbId=null,this.progress=null,this.customEffect=a=>e(i.target,a),this._finishHandler=a=>{this.effect.target?.getAnimations().find(f=>f===this._animation)||this.cancel()},this.addEventListener("finish",this._finishHandler),this.addEventListener("remove",this._finishHandler)}_tick(){try{const e=this.effect?.getComputedTiming().progress??null;e!==this.progress&&(this.customEffect?.(e),this.progress=e),this._tickCbId=requestAnimationFrame(()=>{this._tick()})}catch(e){this._tickCbId=null,console.error(`failed to run customEffect! effectId: ${this.id}, error: ${e instanceof Error?e.message:e}`)}}get currentTime(){return this._animation.currentTime}set currentTime(e){this._animation.currentTime=e}get startTime(){return this._animation.startTime}set startTime(e){this._animation.startTime=e}get playbackRate(){return this._animation.playbackRate}set playbackRate(e){this._animation.playbackRate=e}get id(){return this._animation.id}set id(e){this._animation.id=e}get effect(){return this._animation.effect}set effect(e){this._animation.effect=e}get timeline(){return this._animation.timeline}set timeline(e){this._animation.timeline=e}get finished(){return this._animation.finished}get pending(){return this._animation.pending}get playState(){return this._animation.playState}get ready(){return this._animation.ready}get replaceState(){return this._animation.replaceState}get oncancel(){return this._animation.oncancel}set oncancel(e){this._animation.oncancel=e}get onfinish(){return this._animation.onfinish}set onfinish(e){this._animation.onfinish=e}get onremove(){return this._animation.onremove}set onremove(e){this._animation.onremove=e}play(){this._animation.play(),cancelAnimationFrame(this._tickCbId),this._tickCbId=requestAnimationFrame(()=>this._tick())}pause(){this._animation.pause(),cancelAnimationFrame(this._tickCbId),this._tickCbId=null}cancel(){this.removeEventListener("finish",this._finishHandler),this.removeEventListener("remove",this._finishHandler),this._animation.cancel(),this.customEffect(null),cancelAnimationFrame(this._tickCbId),this._tickCbId=null}commitStyles(){console.warn("CustomEffect animations do not support commitStyles method as they have no style to commit")}finish(){this._animation.finish()}persist(){this._animation.persist()}reverse(){this._animation.reverse()}updatePlaybackRate(e){this._animation.updatePlaybackRate(e)}addEventListener(e,n,o){this._animation.addEventListener(e,n,o)}removeEventListener(e,n,o){this._animation.removeEventListener(e,n,o)}dispatchEvent(e){return this._animation.dispatchEvent(e)}}function Ht(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var T={exports:{}},R=T.exports,L;function Kt(){return L||(L=1,(function(t){(function(e){var n=function(){},o=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function s(){var c=this;c.reads=[],c.writes=[],c.raf=o.bind(e)}s.prototype={constructor:s,runTasks:function(c){for(var u;u=c.shift();)u()},measure:function(c,u){var m=u?c.bind(u):c;return this.reads.push(m),i(this),m},mutate:function(c,u){var m=u?c.bind(u):c;return this.writes.push(m),i(this),m},clear:function(c){return a(this.reads,c)||a(this.writes,c)},extend:function(c){if(typeof c!="object")throw new Error("expected object");var u=Object.create(this);return f(u,c),u.fastdom=this,u.initialize&&u.initialize(),u},catch:null};function i(c){c.scheduled||(c.scheduled=!0,c.raf(r.bind(null,c)))}function r(c){var u=c.writes,m=c.reads,p;try{n("flushing reads",m.length),c.runTasks(m),n("flushing writes",u.length),c.runTasks(u)}catch(l){p=l}if(c.scheduled=!1,(m.length||u.length)&&i(c),p)if(n("task errored",p.message),c.catch)c.catch(p);else throw p}function a(c,u){var m=c.indexOf(u);return!!~m&&!!c.splice(m,1)}function f(c,u){for(var m in u)u.hasOwnProperty(m)&&(c[m]=u[m])}var d=e.fastdom=e.fastdom||new s;t.exports=d})(typeof window<"u"?window:typeof R<"u"?R:globalThis)})(T)),T.exports}var Vt=Kt();const E=Ht(Vt),x={};function Jt(t){Object.assign(x,t)}function vt(t,e=!0){return t in x?x[t]:(e&&console.warn(`${t} not found in registry. Please make sure to import and register the preset.`),null)}function v(t,e){return t?(e||document).getElementById(t):null}function wt(t,e){return t?.matches(`[data-motion-part~="${e}"]`)?t:t?.querySelector(`[data-motion-part~="${e}"]`)}function _t(t,e){const n=typeof t=="string"?v(t):t;return e?.length?e.map(o=>wt(n,o)).filter(Boolean):n?[n]:[]}function Ut(t){const e=t.alternate?"alternate":"";return t.reversed?`${e?`${e}-`:""}reverse`:e||"normal"}function C(t){return`${t.value}${pt(t.unit)}`}function W(t,e,n){return`${t.name||"cover"} ${n&&t.offset.unit!=="percentage"?`calc(100% + ${C(t.offset)}${e?` + ${e}`:""})`:e?`calc(${C(t.offset)} + ${e})`:C(t.offset)}`}function qt(t){return{start:W(t.startOffset,t.startOffsetAdd),end:W(t.endOffset,t.endOffsetAdd,!0)}}function At(t){return e=>E.measure(()=>e(t))}function St(t){return e=>E.mutate(()=>e(t))}function w(t){if(t.namedEffect){const e=t.namedEffect.type;return typeof e=="string"?vt(e):null}else if(t.keyframeEffect){const e=o=>{const{name:s,keyframes:i}=o.keyframeEffect;return[{...o,name:s,keyframes:i}]};return{web:e,style:e,getNames:o=>{const{effectId:s}=o,{name:i}=o.keyframeEffect,r=i||s;return r?[r]:[]}}}else if(t.customEffect)return e=>[{...e,keyframes:[]}];return null}function Tt(t,e,n,o){return t.map((s,i)=>{const r={fill:s.fill,easing:bt(s.easing),iterations:s.iterations===0?1/0:s.iterations||1,composite:s.composite,direction:Ut(s)};return G(e)?(r.duration=s.duration,r.delay=s.delay||0):e?.trigger==="view-progress"&&(o||window.ViewTimeline)?r.duration="auto":(r.duration=99.99,r.delay=.01),{effect:s,options:r,id:n&&`${n}-${i+1}`,part:s.part}})}function G(t){return!t||t.trigger!=="pointer-move"&&t.trigger!=="view-progress"}function B(t,e,n,o,s){if(t){if(G(o)&&(e.duration=e.duration||1,s?.reducedMotion))if(e.iterations===1||e.iterations==null)e={...e,duration:1};else return[];let i;return n instanceof HTMLElement&&(i={measure:At(n),mutate:St(n)}),t.web?t.web(e,i,s):t(e,i,s)}return[]}function D(t,e,n,o,s){const i=typeof t=="string"?v(t,s):t;if(n?.trigger==="pointer-move"&&!e.keyframeEffect){let m=e;e.customEffect&&(m={...e,namedEffect:{id:"",type:"CustomMouse"}});const p=w(m),l=B(p,e,i,n,o);return typeof l!="function"?null:l(i)}const r=w(e),a=B(r,e,i,n,o);if(!a||a.length===0)return null;const f=Tt(a,n,e.effectId);let d;const c=n?.trigger==="view-progress";c&&window.ViewTimeline&&(d=new ViewTimeline({subject:n.element||v(n.componentId)}));const u=f.map(({effect:m,options:p,id:l,part:h})=>{const $=h?wt(i,h):i,g=new KeyframeEffect($||null,[],p);E.mutate(()=>{"timing"in m&&g.updateTiming(m.timing),g.setKeyframes(N(m.keyframes))});const b=c&&d?{timeline:d}:{},y=typeof m.customEffect=="function"?new Bt(m.customEffect,$||null,p,b):new Animation(g,b.timeline);if(c)if(d)E.mutate(()=>{const{start:I,end:q}=qt(m);y.rangeStart=I,y.rangeEnd=q,y.play()});else{const{startOffset:I,endOffset:q}=e;E.mutate(()=>{const A=m.startOffset||I,S=m.endOffset||q;Object.assign(y,{start:{name:A.name,offset:A.offset?.value,add:m.startOffsetAdd},end:{name:S.name,offset:S.offset?.value,add:m.endOffsetAdd}})})}return l&&(y.id=l),y});return u.length>1&&u.forEach(m=>m.persist?.()),new _(u,{...e,trigger:{...n||{}},measured:new Promise(m=>E.mutate(m))})}function Xt(t,e,n){const{duration:o,delay:s,iterations:i=1,fill:r,easing:a="linear",direction:f}=t.options,d=t.effect.name,c=o==="auto",{sequenceId:u,delay:m,offset:p,offsetEasing:l="linear"}=n||{};let h=`${s??0}ms`;if(u&&typeof l=="string"){const $=Ot(l);if($){const g=(s??0)+(m??0);if(p){const b=$(`(var(--motion-${u}-index, 0) / var(--motion-${u}-last, 1))`);h=`calc(${`(${g} + ${b} * ${p} * var(--motion-${u}-last, 1))`} * 1ms)`}else h=`${g}ms`}}return`${d} ${c?"auto":`${o}ms`}${c?" ":` ${h} `}${a}${r&&r!=="none"?` ${r}`:""} ${!i||i===1/0?"infinite":i}${f==="normal"?"":` ${f}`} ${e?"":"paused"}`}function Yt(t,e,n){return t?.style?(G(n)&&(e.duration=e.duration||1),t.style(e)):[]}function Zt(t,e,n,o){const s=w(e),i=Yt(s,e),r=Tt(i,n,e.effectId,!0),a=n?.trigger==="view-progress";return r.map((f,d)=>{const{start:c,end:u}=a?qt(f.effect):{};return{part:f.part,animation:Xt(f,a,o),composition:f.options.composite,custom:f.effect.custom,name:f.effect.name,keyframes:N(f.effect.keyframes),id:f.id&&`${f.id}-${d+1}`,animationTimeline:a?`--${n?.id}`:"",animationRange:c||u?`${c} ${u}`:""}})}function Ct(t,e,n){const o=w(e),s=t instanceof HTMLElement?t:v(t);if(o&&o.prepare&&s){const i={measure:At(s),mutate:St(s)};o.prepare(e,i)}n&&E.mutate(n)}function Pt(t,e){const n=w(e);if(!n)return null;if(!n.style)return e.effectId&&t?kt(t,e.effectId,n.parts):null;const o=n.getNames(e),i=_t(t,n.parts)?.flatMap(f=>f.getAnimations()),r=i?.map(f=>f.animationName)||[],a=[];return o.forEach(f=>{r.includes(f)&&a.push(i?.find(d=>d.animationName===f))}),a?.length?new _(a):null}function kt(t,e,n){const s=_t(t,n)?.flatMap(i=>i.getAnimations()).filter(i=>{const r=i.id||i.animationName;return r?r.startsWith(e):!0});return s?.length?new _(s):null}function Qt(t,e,n,o={}){const{disabled:s,allowActiveEvent:i,...r}=o,a=D(t,e,n,r);if(!a)return null;let f={};if(n.trigger==="view-progress"&&!window.ViewTimeline){const d=n.element||v(n.componentId),{ready:c}=a;return a.animations.map(u=>({get start(){return u.start},get end(){return u.end},viewSource:d,ready:c,getProgress(){return a.getProgress()},effect(m,p){const{activeDuration:l}=u.effect.getComputedTiming(),{delay:h}=u.effect.getTiming();u.currentTime=((h||0)+(l||0))*p},disabled:s,destroy(){u.cancel()}}))}else if(n.trigger==="pointer-move"){const d=e,{centeredToTarget:c,transitionDuration:u,transitionEasing:m}=d,p=n.axis;if(d.keyframeEffect){const l=a;return l.animations?.length===0?null:{target:(typeof t=="string"?v(t):t)??void 0,centeredToTarget:c,ready:l.ready,_currentProgress:0,getProgress(){return this._currentProgress},effect($,g){const b=p==="x"?g.x:g.y;this._currentProgress=b,l.progress(b)},disabled:s??!1,destroy(){l.cancel()}}}f={centeredToTarget:c,allowActiveEvent:i},e.customEffect&&u&&(f.transitionDuration=u,f.transitionEasing=F(m)),f.target=a.target}return{...f,getProgress(){return a.getProgress()},effect(d,c,u,m){a.progress(u?{...c,v:u,active:m}:c)},disabled:s,destroy(){a.cancel()}}}function zt(t,e,n,o=!1){const s=Pt(t,e);return s?(s.ready=new Promise(i=>{Ct(t,e,i)}),s):D(t,e,n,{reducedMotion:o})}function te(t){return t===null?[null]:typeof t=="string"?Array.from(document.querySelectorAll(t)):Array.isArray(t)?t:[t]}function xt(t,e){const n=[];for(const{target:o,options:s}of t){const i=te(o);for(const r of i){const a=zt(r,s,void 0,e?.reducedMotion);a instanceof _&&n.push(a)}}return n}function ee(t,e,n){const o=xt(e,n);return new Wt(o,t)}exports.backIn=lt;exports.backInOut=ht;exports.backOut=dt;exports.circIn=ut;exports.circInOut=mt;exports.circOut=ft;exports.createAnimationGroups=xt;exports.cssEasings=z;exports.cubicBezierCalc=O;exports.cubicBezierEasing=yt;exports.cubicIn=Y;exports.cubicInOut=Q;exports.cubicOut=Z;exports.expoIn=rt;exports.expoInOut=ct;exports.expoOut=at;exports.getAnimation=zt;exports.getCSSAnimation=Zt;exports.getCssUnits=pt;exports.getEasing=bt;exports.getElementAnimation=kt;exports.getElementCSSAnimation=Pt;exports.getJsEasing=F;exports.getJsEasingInCSS=Ot;exports.getRegisteredEffect=vt;exports.getScrubScene=Qt;exports.getSequence=ee;exports.getWebAnimation=D;exports.jsEasings=P;exports.jsEasingsInCSS=k;exports.linear=M;exports.normalizeKeyframes=N;exports.prepareAnimation=Ct;exports.quadIn=J;exports.quadInOut=X;exports.quadOut=U;exports.quartIn=tt;exports.quartInOut=nt;exports.quartOut=et;exports.quintIn=it;exports.quintInOut=ot;exports.quintOut=st;exports.registerEffects=Jt;exports.sineIn=H;exports.sineInOut=V;exports.sineOut=K;exports.toCSSPropertyName=Ft;exports.toWAAPIPropertyName=gt;
//# sourceMappingURL=motion.js.map
